gci-chatbot-ai 1.0.3 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,93 +1,93 @@
1
- (function(ue,S){typeof exports=="object"&&typeof module<"u"?S(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],S):(ue=typeof globalThis<"u"?globalThis:ue||self,S(ue.GciChatbotAi={},ue.Vue))})(this,function(ue,S){"use strict";const AL="",Dn="data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIGlkPSJMYXllcl8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHg9IjAiIHk9IjAiIHZpZXdCb3g9IjAgMCAxNjkuNiAxMDcuOSIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+PHN0eWxlPi5zdDB7ZmlsbDojMmZhMWFkfS5zdDJ7ZmlsbDojZmZiODE3fS5zdDN7ZmlsbDojZmVkNTI0fTwvc3R5bGU+PHN3aXRjaD48Zz48cGF0aCBjbGFzcz0ic3QwIiBkPSJNMjAuMyA3MS45Yy0uNS0uMS0uOS0uMi0xLjEtLjMtMS0uNC0xLjItMS4yLTEuMi0xLjUgMC0uNCAwLS45LjMtMS43LjMtLjguNS0xLjQuOC0yIC4zLS42LjctMSAxLjEtMS4zLjUtLjMgMS0uNSAxLjYtLjUuNCAwIC44IDAgMS4yLjEuMSAwIC4zLjEuNS4xbC4zLjFjLjEgMCAuNC4xLjcuMi4zLjEuNy4yIDEuMi4zbDIuMi42Yy0uNi0uNC0xLjQtLjgtMi4zLTEuM2wtMy43LTIuMWMtLjQtLjMtLjctLjctLjgtMS4ydi0uOWMwLS4yLjEtLjUuMi0uOC4xLS4zLjEtLjUuMi0uNy4yLS43LjUtMS40LjctMS45LjMtLjYuNi0xIDEtMS40LjQtLjMuOS0uNiAxLjUtLjcuNS0uMSAxLS4xIDEuNiAwIC4zIDAgLjYuMSAxIC4yczEuMS4zID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zIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgYmVnaW49IjBzIj48L2FuaW1hdGU+DQogIDwvY2lyY2xlPg0KDQogIDxjaXJjbGUgY3g9IjQ1IiBjeT0iMTUiIHI9IjYiIGZpbGw9IiM1QjhDRkYiPg0KICAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9Im9wYWNpdHkiIHZhbHVlcz0iMC4zOzE7MC4zIiBkdXI9IjEuNHMiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiBiZWdpbj0iMC4ycyI+PC9hbmltYXRlPg0KICA8L2NpcmNsZT4NCg0KICA8Y2lyY2xlIGN4PSI3NSIgY3k9IjE1IiByPSI2IiBmaWxsPSIjNUI4Q0ZGIj4NCiAgICA8YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJvcGFjaXR5IiB2YWx1ZXM9IjAuMzsxOzAuMyIgZHVyPSIxLjRzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgYmVnaW49IjAuNHMiPjwvYW5pbWF0ZT4NCiAgPC9jaXJjbGU+DQo8L3N2Zz4NCg==";var St="vercel.ai.error",Zn=Symbol.for(St),pt,yt,q=class On extends(yt=Error,pt=Zn,yt){constructor({name:t,message:r,cause:n}){super(r),this[pt]=!0,this.name=t,this.cause=n}static isInstance(t){return On.hasMarker(t,St)}static hasMarker(t,r){const n=Symbol.for(r);return t!=null&&typeof t=="object"&&n in t&&typeof t[n]=="boolean"&&t[n]===!0}};function ft(e){return e==null?"unknown error":typeof e=="string"?e:e instanceof Error?e.message:JSON.stringify(e)}var gt="AI_InvalidArgumentError",mt=`vercel.ai.error.${gt}`,$n=Symbol.for(mt),ht,It,Pn=class extends(It=q,ht=$n,It){constructor({message:e,cause:t,argument:r}){super({name:gt,message:e,cause:t}),this[ht]=!0,this.argument=r}static isInstance(e){return q.hasMarker(e,mt)}},Et="AI_JSONParseError",Nt=`vercel.ai.error.${Et}`,Un=Symbol.for(Nt),xt,vt,_t=class extends(vt=q,xt=Un,vt){constructor({text:e,cause:t}){super({name:Et,message:`JSON parsing failed: Text: ${e}.
2
- Error message: ${ft(t)}`,cause:t}),this[xt]=!0,this.text=e}static isInstance(e){return q.hasMarker(e,Nt)}},At="AI_TypeValidationError",Ct=`vercel.ai.error.${At}`,Yn=Symbol.for(Ct),bt,zt,ce=class dt extends(zt=q,bt=Yn,zt){constructor({value:t,cause:r}){super({name:At,message:`Type validation failed: Value: ${JSON.stringify(t)}.
3
- Error message: ${ft(r)}`,cause:r}),this[bt]=!0,this.value=t}static isInstance(t){return q.hasMarker(t,Ct)}static wrap({value:t,cause:r}){return dt.isInstance(r)&&r.value===t?r:new dt({value:t,cause:r})}};function j(e,t,r){function n(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);const a=i.prototype,L=Object.keys(a);for(let l=0;l<L.length;l++){const f=L[l];f in s||(s[f]=a[f].bind(s))}}const u=(r==null?void 0:r.Parent)??Object;class o extends u{}Object.defineProperty(o,"name",{value:e});function i(s){var c;const a=r!=null&&r.Parent?new o:this;n(a,s),(c=a._zod).deferred??(c.deferred=[]);for(const L of a._zod.deferred)L();return a}return Object.defineProperty(i,"init",{value:n}),Object.defineProperty(i,Symbol.hasInstance,{value:s=>{var c,a;return r!=null&&r.Parent&&s instanceof r.Parent?!0:(a=(c=s==null?void 0:s._zod)==null?void 0:c.traits)==null?void 0:a.has(e)}}),Object.defineProperty(i,"name",{value:e}),i}class Le extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Tt extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Je={};function X(e){return e&&Object.assign(Je,e),Je}function wt(e){const t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,u])=>t.indexOf(+n)===-1).map(([n,u])=>u)}function Ve(e,t){return typeof t=="bigint"?t.toString():t}function Ae(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Be(e){return e==null}function We(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Rn(e,t){const r=(e.toString().split(".")[1]||"").length,n=t.toString();let u=(n.split(".")[1]||"").length;if(u===0&&/\d?e-\d?/.test(n)){const c=n.match(/\d?e-(\d?)/);c!=null&&c[1]&&(u=Number.parseInt(c[1]))}const o=r>u?r:u,i=Number.parseInt(e.toFixed(o).replace(".","")),s=Number.parseInt(t.toFixed(o).replace(".",""));return i%s/10**o}const Ot=Symbol("evaluating");function _(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==Ot)return n===void 0&&(n=Ot,n=r()),n},set(u){Object.defineProperty(e,t,{value:u})},configurable:!0})}function oe(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function K(...e){const t={};for(const r of e){const n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function Dt(e){return JSON.stringify(e)}function Qn(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const kt="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function fe(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Fn=Ae(()=>{var e;if(typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function le(e){if(fe(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const r=t.prototype;return!(fe(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Zt(e){return le(e)?{...e}:Array.isArray(e)?[...e]:e}const Jn=new Set(["string","number","symbol"]);function je(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ee(e,t,r){const n=new e._zod.constr(t??e._zod.def);return(!t||r!=null&&r.parent)&&(n._zod.parent=e),n}function m(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0: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 Vn(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const Bn={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]};function Wn(e,t){const r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const o=K(e._zod.def,{get shape(){const i={};for(const s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&(i[s]=r.shape[s])}return oe(this,"shape",i),i},checks:[]});return ee(e,o)}function Gn(e,t){const r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const o=K(e._zod.def,{get shape(){const i={...e._zod.def.shape};for(const s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&delete i[s]}return oe(this,"shape",i),i},checks:[]});return ee(e,o)}function qn(e,t){if(!le(t))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0){const o=e._zod.def.shape;for(const i in t)if(Object.getOwnPropertyDescriptor(o,i)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const u=K(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t};return oe(this,"shape",o),o}});return ee(e,u)}function Hn(e,t){if(!le(t))throw new Error("Invalid input to safeExtend: expected a plain object");const r=K(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return oe(this,"shape",n),n}});return ee(e,r)}function Xn(e,t){const r=K(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return oe(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return ee(e,r)}function Kn(e,t,r){const u=t._zod.def.checks;if(u&&u.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const i=K(t._zod.def,{get shape(){const s=t._zod.def.shape,c={...s};if(r)for(const a in r){if(!(a in s))throw new Error(`Unrecognized key: "${a}"`);r[a]&&(c[a]=e?new e({type:"optional",innerType:s[a]}):s[a])}else for(const a in s)c[a]=e?new e({type:"optional",innerType:s[a]}):s[a];return oe(this,"shape",c),c},checks:[]});return ee(t,i)}function eu(e,t,r){const n=K(t._zod.def,{get shape(){const u=t._zod.def.shape,o={...u};if(r)for(const i in r){if(!(i in o))throw new Error(`Unrecognized key: "${i}"`);r[i]&&(o[i]=new e({type:"nonoptional",innerType:u[i]}))}else for(const i in u)o[i]=new e({type:"nonoptional",innerType:u[i]});return oe(this,"shape",o),o}});return ee(t,n)}function Me(e,t=0){var r;if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(((r=e.issues[n])==null?void 0:r.continue)!==!0)return!0;return!1}function de(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function Ce(e){return typeof e=="string"?e:e==null?void 0:e.message}function te(e,t,r){var u,o,i,s,c,a;const n={...e,path:e.path??[]};if(!e.message){const L=Ce((i=(o=(u=e.inst)==null?void 0:u._zod.def)==null?void 0:o.error)==null?void 0:i.call(o,e))??Ce((s=t==null?void 0:t.error)==null?void 0:s.call(t,e))??Ce((c=r.customError)==null?void 0:c.call(r,e))??Ce((a=r.localeError)==null?void 0:a.call(r,e))??"Invalid input";n.message=L}return delete n.inst,delete n.continue,t!=null&&t.reportInput||delete n.input,n}function Ge(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function ge(...e){const[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}const $t=(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,Ve,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Pt=j("$ZodError",$t),Ut=j("$ZodError",$t,{Parent:Error});function tu(e,t=r=>r.message){const r={},n=[];for(const u of e.issues)u.path.length>0?(r[u.path[0]]=r[u.path[0]]||[],r[u.path[0]].push(t(u))):n.push(t(u));return{formErrors:n,fieldErrors:r}}function ru(e,t=r=>r.message){const r={_errors:[]},n=u=>{for(const o of u.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(i=>n({issues:i}));else if(o.code==="invalid_key")n({issues:o.issues});else if(o.code==="invalid_element")n({issues:o.issues});else if(o.path.length===0)r._errors.push(t(o));else{let i=r,s=0;for(;s<o.path.length;){const c=o.path[s];s===o.path.length-1?(i[c]=i[c]||{_errors:[]},i[c]._errors.push(t(o))):i[c]=i[c]||{_errors:[]},i=i[c],s++}}};return n(e),r}const qe=e=>(t,r,n,u)=>{const o=n?Object.assign(n,{async:!1}):{async:!1},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)throw new Le;if(i.issues.length){const s=new((u==null?void 0:u.Err)??e)(i.issues.map(c=>te(c,o,X())));throw kt(s,u==null?void 0:u.callee),s}return i.value},He=e=>async(t,r,n,u)=>{const o=n?Object.assign(n,{async:!0}):{async:!0};let i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise&&(i=await i),i.issues.length){const s=new((u==null?void 0:u.Err)??e)(i.issues.map(c=>te(c,o,X())));throw kt(s,u==null?void 0:u.callee),s}return i.value},be=e=>(t,r,n)=>{const u=n?{...n,async:!1}:{async:!1},o=t._zod.run({value:r,issues:[]},u);if(o instanceof Promise)throw new Le;return o.issues.length?{success:!1,error:new(e??Pt)(o.issues.map(i=>te(i,u,X())))}:{success:!0,data:o.value}},nu=be(Ut),ze=e=>async(t,r,n)=>{const u=n?Object.assign(n,{async:!0}):{async:!0};let o=t._zod.run({value:r,issues:[]},u);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(i=>te(i,u,X())))}:{success:!0,data:o.value}},uu=ze(Ut),ou=e=>(t,r,n)=>{const u=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return qe(e)(t,r,u)},iu=e=>(t,r,n)=>qe(e)(t,r,n),su=e=>async(t,r,n)=>{const u=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return He(e)(t,r,u)},au=e=>async(t,r,n)=>He(e)(t,r,n),cu=e=>(t,r,n)=>{const u=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return be(e)(t,r,u)},Lu=e=>(t,r,n)=>be(e)(t,r,n),lu=e=>async(t,r,n)=>{const u=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return ze(e)(t,r,u)},ju=e=>async(t,r,n)=>ze(e)(t,r,n),Mu=/^[cC][^\s-]{8,}$/,du=/^[0-9a-z]+$/,Su=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,pu=/^[0-9a-vA-V]{20}$/,yu=/^[A-Za-z0-9]{27}$/,fu=/^[a-zA-Z0-9_-]{21}$/,gu=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,mu=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Yt=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,hu=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Iu="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Eu(){return new RegExp(Iu,"u")}const Nu=/^(?:(?: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])$/,xu=/^(([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}|:))$/,vu=/^((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])$/,_u=/^(([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])$/,Au=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Rt=/^[A-Za-z0-9_-]*$/,Cu=/^\+[1-9]\d{6,14}$/,Qt="(?:(?:\\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])))",bu=new RegExp(`^${Qt}$`);function Ft(e){const 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 zu(e){return new RegExp(`^${Ft(e)}$`)}function Tu(e){const t=Ft({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${t}(?:${r.join("|")})`;return new RegExp(`^${Qt}T(?:${n})$`)}const wu=e=>{const t=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Ou=/^-?\d+$/,Jt=/^-?\d+(?:\.\d+)?$/,Du=/^(?:true|false)$/i,ku=/^null$/i,Zu=/^[^A-Z]*$/,$u=/^[^a-z]*$/,F=j("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Vt={number:"number",bigint:"bigint",object:"date"},Bt=j("$ZodCheckLessThan",(e,t)=>{F.init(e,t);const r=Vt[typeof t.value];e._zod.onattach.push(n=>{const u=n._zod.bag,o=(t.inclusive?u.maximum:u.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<o&&(t.inclusive?u.maximum=t.value:u.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Wt=j("$ZodCheckGreaterThan",(e,t)=>{F.init(e,t);const r=Vt[typeof t.value];e._zod.onattach.push(n=>{const u=n._zod.bag,o=(t.inclusive?u.minimum:u.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>o&&(t.inclusive?u.minimum=t.value:u.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Pu=j("$ZodCheckMultipleOf",(e,t)=>{F.init(e,t),e._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):Rn(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),Uu=j("$ZodCheckNumberFormat",(e,t)=>{var i;F.init(e,t),t.format=t.format||"float64";const r=(i=t.format)==null?void 0:i.includes("int"),n=r?"int":"number",[u,o]=Bn[t.format];e._zod.onattach.push(s=>{const c=s._zod.bag;c.format=t.format,c.minimum=u,c.maximum=o,r&&(c.pattern=Ou)}),e._zod.check=s=>{const c=s.value;if(r){if(!Number.isInteger(c)){s.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?s.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):s.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}c<u&&s.issues.push({origin:"number",input:c,code:"too_small",minimum:u,inclusive:!0,inst:e,continue:!t.abort}),c>o&&s.issues.push({origin:"number",input:c,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),Yu=j("$ZodCheckMaxLength",(e,t)=>{var r;F.init(e,t),(r=e._zod.def).when??(r.when=n=>{const u=n.value;return!Be(u)&&u.length!==void 0}),e._zod.onattach.push(n=>{const u=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<u&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const u=n.value;if(u.length<=t.maximum)return;const i=Ge(u);n.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:u,inst:e,continue:!t.abort})}}),Ru=j("$ZodCheckMinLength",(e,t)=>{var r;F.init(e,t),(r=e._zod.def).when??(r.when=n=>{const u=n.value;return!Be(u)&&u.length!==void 0}),e._zod.onattach.push(n=>{const u=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>u&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const u=n.value;if(u.length>=t.minimum)return;const i=Ge(u);n.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:u,inst:e,continue:!t.abort})}}),Qu=j("$ZodCheckLengthEquals",(e,t)=>{var r;F.init(e,t),(r=e._zod.def).when??(r.when=n=>{const u=n.value;return!Be(u)&&u.length!==void 0}),e._zod.onattach.push(n=>{const u=n._zod.bag;u.minimum=t.length,u.maximum=t.length,u.length=t.length}),e._zod.check=n=>{const u=n.value,o=u.length;if(o===t.length)return;const i=Ge(u),s=o>t.length;n.issues.push({origin:i,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Te=j("$ZodCheckStringFormat",(e,t)=>{var r,n;F.init(e,t),e._zod.onattach.push(u=>{const o=u._zod.bag;o.format=t.format,t.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=u=>{t.pattern.lastIndex=0,!t.pattern.test(u.value)&&u.issues.push({origin:"string",code:"invalid_format",format:t.format,input:u.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),Fu=j("$ZodCheckRegex",(e,t)=>{Te.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Ju=j("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Zu),Te.init(e,t)}),Vu=j("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=$u),Te.init(e,t)}),Bu=j("$ZodCheckIncludes",(e,t)=>{F.init(e,t);const r=je(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(u=>{const o=u._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=u=>{u.value.includes(t.includes,t.position)||u.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:u.value,inst:e,continue:!t.abort})}}),Wu=j("$ZodCheckStartsWith",(e,t)=>{F.init(e,t);const r=new RegExp(`^${je(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{const u=n._zod.bag;u.patterns??(u.patterns=new Set),u.patterns.add(r)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Gu=j("$ZodCheckEndsWith",(e,t)=>{F.init(e,t);const r=new RegExp(`.*${je(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{const u=n._zod.bag;u.patterns??(u.patterns=new Set),u.patterns.add(r)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),qu=j("$ZodCheckOverwrite",(e,t)=>{F.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});class Hu{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}const n=t.split(`
4
- `).filter(i=>i),u=Math.min(...n.map(i=>i.length-i.trimStart().length)),o=n.map(i=>i.slice(u)).map(i=>" ".repeat(this.indent*2)+i);for(const i of o)this.content.push(i)}compile(){const t=Function,r=this==null?void 0:this.args,u=[...((this==null?void 0:this.content)??[""]).map(o=>` ${o}`)];return new t(...r,u.join(`
5
- `))}}const Xu={major:4,minor:3,patch:5},D=j("$ZodType",(e,t)=>{var u;var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Xu;const n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(const o of n)for(const i of o._zod.onattach)i(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),(u=e._zod.deferred)==null||u.push(()=>{e._zod.run=e._zod.parse});else{const o=(s,c,a)=>{let L=Me(s),l;for(const f of c){if(f._zod.def.when){if(!f._zod.def.when(s))continue}else if(L)continue;const d=s.issues.length,I=f._zod.check(s);if(I instanceof Promise&&(a==null?void 0:a.async)===!1)throw new Le;if(l||I instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await I,s.issues.length!==d&&(L||(L=Me(s,d)))});else{if(s.issues.length===d)continue;L||(L=Me(s,d))}}return l?l.then(()=>s):s},i=(s,c,a)=>{if(Me(s))return s.aborted=!0,s;const L=o(c,n,a);if(L instanceof Promise){if(a.async===!1)throw new Le;return L.then(l=>e._zod.parse(l,a))}return e._zod.parse(L,a)};e._zod.run=(s,c)=>{if(c.skipChecks)return e._zod.parse(s,c);if(c.direction==="backward"){const L=e._zod.parse({value:s.value,issues:[]},{...c,skipChecks:!0});return L instanceof Promise?L.then(l=>i(l,s,c)):i(L,s,c)}const a=e._zod.parse(s,c);if(a instanceof Promise){if(c.async===!1)throw new Le;return a.then(L=>o(L,n,c))}return o(a,n,c)}}_(e,"~standard",()=>({validate:o=>{var i;try{const s=nu(e,o);return s.success?{value:s.data}:{issues:(i=s.error)==null?void 0:i.issues}}catch{return uu(e,o).then(c=>{var a;return c.success?{value:c.data}:{issues:(a=c.error)==null?void 0:a.issues}})}},vendor:"zod",version:1}))}),Xe=j("$ZodString",(e,t)=>{var r;D.init(e,t),e._zod.pattern=[...((r=e==null?void 0:e._zod.bag)==null?void 0:r.patterns)??[]].pop()??wu(e._zod.bag),e._zod.parse=(n,u)=>{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}}),$=j("$ZodStringFormat",(e,t)=>{Te.init(e,t),Xe.init(e,t)}),Ku=j("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=mu),$.init(e,t)}),eo=j("$ZodUUID",(e,t)=>{if(t.version){const n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Yt(n))}else t.pattern??(t.pattern=Yt());$.init(e,t)}),to=j("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=hu),$.init(e,t)}),ro=j("$ZodURL",(e,t)=>{$.init(e,t),e._zod.check=r=>{try{const n=r.value.trim(),u=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(u.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(u.protocol.endsWith(":")?u.protocol.slice(0,-1):u.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=u.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),no=j("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Eu()),$.init(e,t)}),uo=j("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=fu),$.init(e,t)}),oo=j("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Mu),$.init(e,t)}),io=j("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=du),$.init(e,t)}),so=j("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Su),$.init(e,t)}),ao=j("$ZodXID",(e,t)=>{t.pattern??(t.pattern=pu),$.init(e,t)}),co=j("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=yu),$.init(e,t)}),Lo=j("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Tu(t)),$.init(e,t)}),lo=j("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=bu),$.init(e,t)}),jo=j("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=zu(t)),$.init(e,t)}),Mo=j("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=gu),$.init(e,t)}),So=j("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Nu),$.init(e,t),e._zod.bag.format="ipv4"}),po=j("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=xu),$.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),yo=j("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=vu),$.init(e,t)}),fo=j("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=_u),$.init(e,t),e._zod.check=r=>{const n=r.value.split("/");try{if(n.length!==2)throw new Error;const[u,o]=n;if(!o)throw new Error;const i=Number(o);if(`${i}`!==o)throw new Error;if(i<0||i>128)throw new Error;new URL(`http://[${u}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function Gt(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const go=j("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Au),$.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{Gt(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function mo(e){if(!Rt.test(e))return!1;const t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Gt(r)}const ho=j("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Rt),$.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{mo(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Io=j("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Cu),$.init(e,t)});function Eo(e,t=null){try{const r=e.split(".");if(r.length!==3)return!1;const[n]=r;if(!n)return!1;const u=JSON.parse(atob(n));return!("typ"in u&&(u==null?void 0:u.typ)!=="JWT"||!u.alg||t&&(!("alg"in u)||u.alg!==t))}catch{return!1}}const No=j("$ZodJWT",(e,t)=>{$.init(e,t),e._zod.check=r=>{Eo(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),qt=j("$ZodNumber",(e,t)=>{D.init(e,t),e._zod.pattern=e._zod.bag.pattern??Jt,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}const u=r.value;if(typeof u=="number"&&!Number.isNaN(u)&&Number.isFinite(u))return r;const o=typeof u=="number"?Number.isNaN(u)?"NaN":Number.isFinite(u)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:u,inst:e,...o?{received:o}:{}}),r}}),xo=j("$ZodNumberFormat",(e,t)=>{Uu.init(e,t),qt.init(e,t)}),vo=j("$ZodBoolean",(e,t)=>{D.init(e,t),e._zod.pattern=Du,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}const u=r.value;return typeof u=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:u,inst:e}),r}}),_o=j("$ZodNull",(e,t)=>{D.init(e,t),e._zod.pattern=ku,e._zod.values=new Set([null]),e._zod.parse=(r,n)=>{const u=r.value;return u===null||r.issues.push({expected:"null",code:"invalid_type",input:u,inst:e}),r}}),Ao=j("$ZodUnknown",(e,t)=>{D.init(e,t),e._zod.parse=r=>r}),Co=j("$ZodNever",(e,t)=>{D.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function Ht(e,t,r){e.issues.length&&t.issues.push(...de(r,e.issues)),t.value[r]=e.value}const bo=j("$ZodArray",(e,t)=>{D.init(e,t),e._zod.parse=(r,n)=>{const u=r.value;if(!Array.isArray(u))return r.issues.push({expected:"array",code:"invalid_type",input:u,inst:e}),r;r.value=Array(u.length);const o=[];for(let i=0;i<u.length;i++){const s=u[i],c=t.element._zod.run({value:s,issues:[]},n);c instanceof Promise?o.push(c.then(a=>Ht(a,r,i))):Ht(c,r,i)}return o.length?Promise.all(o).then(()=>r):r}});function we(e,t,r,n,u){if(e.issues.length){if(u&&!(r in n))return;t.issues.push(...de(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}function Xt(e){var n,u,o,i;const t=Object.keys(e.shape);for(const s of t)if(!((i=(o=(u=(n=e.shape)==null?void 0:n[s])==null?void 0:u._zod)==null?void 0:o.traits)!=null&&i.has("$ZodType")))throw new Error(`Invalid element at key "${s}": expected a Zod schema`);const r=Vn(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function Kt(e,t,r,n,u,o){const i=[],s=u.keySet,c=u.catchall._zod,a=c.def.type,L=c.optout==="optional";for(const l in t){if(s.has(l))continue;if(a==="never"){i.push(l);continue}const f=c.run({value:t[l],issues:[]},n);f instanceof Promise?e.push(f.then(d=>we(d,r,l,t,L))):we(f,r,l,t,L)}return i.length&&r.issues.push({code:"unrecognized_keys",keys:i,input:t,inst:o}),e.length?Promise.all(e).then(()=>r):r}const zo=j("$ZodObject",(e,t)=>{D.init(e,t);const r=Object.getOwnPropertyDescriptor(t,"shape");if(!(r!=null&&r.get)){const s=t.shape;Object.defineProperty(t,"shape",{get:()=>{const c={...s};return Object.defineProperty(t,"shape",{value:c}),c}})}const n=Ae(()=>Xt(t));_(e._zod,"propValues",()=>{const s=t.shape,c={};for(const a in s){const L=s[a]._zod;if(L.values){c[a]??(c[a]=new Set);for(const l of L.values)c[a].add(l)}}return c});const u=fe,o=t.catchall;let i;e._zod.parse=(s,c)=>{i??(i=n.value);const a=s.value;if(!u(a))return s.issues.push({expected:"object",code:"invalid_type",input:a,inst:e}),s;s.value={};const L=[],l=i.shape;for(const f of i.keys){const d=l[f],I=d._zod.optout==="optional",p=d._zod.run({value:a[f],issues:[]},c);p instanceof Promise?L.push(p.then(g=>we(g,s,f,a,I))):we(p,s,f,a,I)}return o?Kt(L,a,s,c,n.value,e):L.length?Promise.all(L).then(()=>s):s}}),To=j("$ZodObjectJIT",(e,t)=>{zo.init(e,t);const r=e._zod.parse,n=Ae(()=>Xt(t)),u=f=>{var M;const d=new Hu(["shape","payload","ctx"]),I=n.value,p=z=>{const C=Dt(z);return`shape[${C}]._zod.run({ value: input[${C}], issues: [] }, ctx)`};d.write("const input = payload.value;");const g=Object.create(null);let N=0;for(const z of I.keys)g[z]=`key_${N++}`;d.write("const newResult = {};");for(const z of I.keys){const C=g[z],v=Dt(z),w=f[z],J=((M=w==null?void 0:w._zod)==null?void 0:M.optout)==="optional";d.write(`const ${C} = ${p(z)};`),J?d.write(`
6
- if (${C}.issues.length) {
7
- if (${v} in input) {
8
- payload.issues = payload.issues.concat(${C}.issues.map(iss => ({
1
+ (function(oe,h){typeof exports=="object"&&typeof module<"u"?h(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],h):(oe=typeof globalThis<"u"?globalThis:oe||self,h(oe.GciChatbotAi={},oe.Vue))})(this,function(oe,h){"use strict";const Sl="",xn="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIwIiBoZWlnaHQ9IjMwIiB2aWV3Qm94PSIwIDAgMTIwIDMwIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiPg0KICA8Y2lyY2xlIGN4PSIxNSIgY3k9IjE1IiByPSI2IiBmaWxsPSIjNUI4Q0ZGIj4NCiAgICA8YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJvcGFjaXR5IiB2YWx1ZXM9IjAuMzsxOzAuMyIgZHVyPSIxLjRzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgYmVnaW49IjBzIj48L2FuaW1hdGU+DQogIDwvY2lyY2xlPg0KDQogIDxjaXJjbGUgY3g9IjQ1IiBjeT0iMTUiIHI9IjYiIGZpbGw9IiM1QjhDRkYiPg0KICAgIDxhbmltYXRlIGF0dHJpYnV0ZU5hbWU9Im9wYWNpdHkiIHZhbHVlcz0iMC4zOzE7MC4zIiBkdXI9IjEuNHMiIHJlcGVhdENvdW50PSJpbmRlZmluaXRlIiBiZWdpbj0iMC4ycyI+PC9hbmltYXRlPg0KICA8L2NpcmNsZT4NCg0KICA8Y2lyY2xlIGN4PSI3NSIgY3k9IjE1IiByPSI2IiBmaWxsPSIjNUI4Q0ZGIj4NCiAgICA8YW5pbWF0ZSBhdHRyaWJ1dGVOYW1lPSJvcGFjaXR5IiB2YWx1ZXM9IjAuMzsxOzAuMyIgZHVyPSIxLjRzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSIgYmVnaW49IjAuNHMiPjwvYW5pbWF0ZT4NCiAgPC9jaXJjbGU+DQo8L3N2Zz4NCg==";var ht="vercel.ai.error",jn=Symbol.for(ht),gt,vt,H=class Rn extends(vt=Error,gt=jn,vt){constructor({name:t,message:r,cause:n}){super(r),this[gt]=!0,this.name=t,this.cause=n}static isInstance(t){return Rn.hasMarker(t,ht)}static hasMarker(t,r){const n=Symbol.for(r);return t!=null&&typeof t=="object"&&n in t&&typeof t[n]=="boolean"&&t[n]===!0}};function _t(e){return e==null?"unknown error":typeof e=="string"?e:e instanceof Error?e.message:JSON.stringify(e)}var yt="AI_InvalidArgumentError",bt=`vercel.ai.error.${yt}`,Cn=Symbol.for(bt),wt,It,Mn=class extends(It=H,wt=Cn,It){constructor({message:e,cause:t,argument:r}){super({name:yt,message:e,cause:t}),this[wt]=!0,this.argument=r}static isInstance(e){return H.hasMarker(e,bt)}},Et="AI_JSONParseError",kt=`vercel.ai.error.${Et}`,Dn=Symbol.for(kt),zt,St,Ot=class extends(St=H,zt=Dn,St){constructor({text:e,cause:t}){super({name:Et,message:`JSON parsing failed: Text: ${e}.
2
+ Error message: ${_t(t)}`,cause:t}),this[zt]=!0,this.text=e}static isInstance(e){return H.hasMarker(e,kt)}},Zt="AI_TypeValidationError",$t=`vercel.ai.error.${Zt}`,Un=Symbol.for($t),Nt,Tt,ue=class mt extends(Tt=H,Nt=Un,Tt){constructor({value:t,cause:r}){super({name:Zt,message:`Type validation failed: Value: ${JSON.stringify(t)}.
3
+ Error message: ${_t(r)}`,cause:r}),this[Nt]=!0,this.value=t}static isInstance(t){return H.hasMarker(t,$t)}static wrap({value:t,cause:r}){return mt.isInstance(r)&&r.value===t?r:new mt({value:t,cause:r})}};function p(e,t,r){function n(i,u){if(i._zod||Object.defineProperty(i,"_zod",{value:{def:u,constr:a,traits:new Set},enumerable:!1}),i._zod.traits.has(e))return;i._zod.traits.add(e),t(i,u);const c=a.prototype,l=Object.keys(c);for(let d=0;d<l.length;d++){const _=l[d];_ in i||(i[_]=c[_].bind(i))}}const o=(r==null?void 0:r.Parent)??Object;class s extends o{}Object.defineProperty(s,"name",{value:e});function a(i){var u;const c=r!=null&&r.Parent?new s:this;n(c,i),(u=c._zod).deferred??(u.deferred=[]);for(const l of c._zod.deferred)l();return c}return Object.defineProperty(a,"init",{value:n}),Object.defineProperty(a,Symbol.hasInstance,{value:i=>{var u,c;return r!=null&&r.Parent&&i instanceof r.Parent?!0:(c=(u=i==null?void 0:i._zod)==null?void 0:u.traits)==null?void 0:c.has(e)}}),Object.defineProperty(a,"name",{value:e}),a}class le extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Pt extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Je={};function Q(e){return e&&Object.assign(Je,e),Je}function At(e){const t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}function We(e,t){return typeof t=="bigint"?t.toString():t}function Ze(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Ye(e){return e==null}function qe(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Ln(e,t){const r=(e.toString().split(".")[1]||"").length,n=t.toString();let o=(n.split(".")[1]||"").length;if(o===0&&/\d?e-\d?/.test(n)){const u=n.match(/\d?e-(\d?)/);u!=null&&u[1]&&(o=Number.parseInt(u[1]))}const s=r>o?r:o,a=Number.parseInt(e.toFixed(s).replace(".","")),i=Number.parseInt(t.toFixed(s).replace(".",""));return a%i/10**s}const Rt=Symbol("evaluating");function O(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==Rt)return n===void 0&&(n=Rt,n=r()),n},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function se(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function K(...e){const t={};for(const r of e){const n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function xt(e){return JSON.stringify(e)}function Vn(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const jt="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function _e(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const Bn=Ze(()=>{var e;if(typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function de(e){if(_e(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const r=t.prototype;return!(_e(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Ct(e){return de(e)?{...e}:Array.isArray(e)?[...e]:e}const Fn=new Set(["string","number","symbol"]);function pe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ee(e,t,r){const n=new e._zod.constr(t??e._zod.def);return(!t||r!=null&&r.parent)&&(n._zod.parent=e),n}function b(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0: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 Jn(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const Wn={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]};function Yn(e,t){const r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s=K(e._zod.def,{get shape(){const a={};for(const i in t){if(!(i in r.shape))throw new Error(`Unrecognized key: "${i}"`);t[i]&&(a[i]=r.shape[i])}return se(this,"shape",a),a},checks:[]});return ee(e,s)}function qn(e,t){const r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=K(e._zod.def,{get shape(){const a={...e._zod.def.shape};for(const i in t){if(!(i in r.shape))throw new Error(`Unrecognized key: "${i}"`);t[i]&&delete a[i]}return se(this,"shape",a),a},checks:[]});return ee(e,s)}function Gn(e,t){if(!de(t))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0){const s=e._zod.def.shape;for(const a in t)if(Object.getOwnPropertyDescriptor(s,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const o=K(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return se(this,"shape",s),s}});return ee(e,o)}function Hn(e,t){if(!de(t))throw new Error("Invalid input to safeExtend: expected a plain object");const r=K(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return se(this,"shape",n),n}});return ee(e,r)}function Xn(e,t){const r=K(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return se(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return ee(e,r)}function Qn(e,t,r){const o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const a=K(t._zod.def,{get shape(){const i=t._zod.def.shape,u={...i};if(r)for(const c in r){if(!(c in i))throw new Error(`Unrecognized key: "${c}"`);r[c]&&(u[c]=e?new e({type:"optional",innerType:i[c]}):i[c])}else for(const c in i)u[c]=e?new e({type:"optional",innerType:i[c]}):i[c];return se(this,"shape",u),u},checks:[]});return ee(t,a)}function Kn(e,t,r){const n=K(t._zod.def,{get shape(){const o=t._zod.def.shape,s={...o};if(r)for(const a in r){if(!(a in s))throw new Error(`Unrecognized key: "${a}"`);r[a]&&(s[a]=new e({type:"nonoptional",innerType:o[a]}))}else for(const a in o)s[a]=new e({type:"nonoptional",innerType:o[a]});return se(this,"shape",s),s}});return ee(t,n)}function fe(e,t=0){var r;if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(((r=e.issues[n])==null?void 0:r.continue)!==!0)return!0;return!1}function me(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function $e(e){return typeof e=="string"?e:e==null?void 0:e.message}function te(e,t,r){var o,s,a,i,u,c;const n={...e,path:e.path??[]};if(!e.message){const l=$e((a=(s=(o=e.inst)==null?void 0:o._zod.def)==null?void 0:s.error)==null?void 0:a.call(s,e))??$e((i=t==null?void 0:t.error)==null?void 0:i.call(t,e))??$e((u=r.customError)==null?void 0:u.call(r,e))??$e((c=r.localeError)==null?void 0:c.call(r,e))??"Invalid input";n.message=l}return delete n.inst,delete n.continue,t!=null&&t.reportInput||delete n.input,n}function Ge(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function ye(...e){const[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}const Mt=(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,We,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Dt=p("$ZodError",Mt),Ut=p("$ZodError",Mt,{Parent:Error});function eo(e,t=r=>r.message){const r={},n=[];for(const o of e.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(t(o))):n.push(t(o));return{formErrors:n,fieldErrors:r}}function to(e,t=r=>r.message){const r={_errors:[]},n=o=>{for(const s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>n({issues:a}));else if(s.code==="invalid_key")n({issues:s.issues});else if(s.code==="invalid_element")n({issues:s.issues});else if(s.path.length===0)r._errors.push(t(s));else{let a=r,i=0;for(;i<s.path.length;){const u=s.path[i];i===s.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(t(s))):a[u]=a[u]||{_errors:[]},a=a[u],i++}}};return n(e),r}const He=e=>(t,r,n,o)=>{const s=n?Object.assign(n,{async:!1}):{async:!1},a=t._zod.run({value:r,issues:[]},s);if(a instanceof Promise)throw new le;if(a.issues.length){const i=new((o==null?void 0:o.Err)??e)(a.issues.map(u=>te(u,s,Q())));throw jt(i,o==null?void 0:o.callee),i}return a.value},Xe=e=>async(t,r,n,o)=>{const s=n?Object.assign(n,{async:!0}):{async:!0};let a=t._zod.run({value:r,issues:[]},s);if(a instanceof Promise&&(a=await a),a.issues.length){const i=new((o==null?void 0:o.Err)??e)(a.issues.map(u=>te(u,s,Q())));throw jt(i,o==null?void 0:o.callee),i}return a.value},Ne=e=>(t,r,n)=>{const o=n?{...n,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new le;return s.issues.length?{success:!1,error:new(e??Dt)(s.issues.map(a=>te(a,o,Q())))}:{success:!0,data:s.value}},ro=Ne(Ut),Te=e=>async(t,r,n)=>{const o=n?Object.assign(n,{async:!0}):{async:!0};let s=t._zod.run({value:r,issues:[]},o);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(a=>te(a,o,Q())))}:{success:!0,data:s.value}},no=Te(Ut),oo=e=>(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return He(e)(t,r,o)},so=e=>(t,r,n)=>He(e)(t,r,n),ao=e=>async(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Xe(e)(t,r,o)},io=e=>async(t,r,n)=>Xe(e)(t,r,n),co=e=>(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Ne(e)(t,r,o)},uo=e=>(t,r,n)=>Ne(e)(t,r,n),lo=e=>async(t,r,n)=>{const o=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return Te(e)(t,r,o)},po=e=>async(t,r,n)=>Te(e)(t,r,n),fo=/^[cC][^\s-]{8,}$/,mo=/^[0-9a-z]+$/,ho=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,go=/^[0-9a-vA-V]{20}$/,vo=/^[A-Za-z0-9]{27}$/,_o=/^[a-zA-Z0-9_-]{21}$/,yo=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,bo=/^([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})$/,Lt=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)$/,wo=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Io="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Eo(){return new RegExp(Io,"u")}const ko=/^(?:(?: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])$/,zo=/^(([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}|:))$/,So=/^((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])$/,Oo=/^(([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])$/,Zo=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Vt=/^[A-Za-z0-9_-]*$/,$o=/^\+[1-9]\d{6,14}$/,Bt="(?:(?:\\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])))",No=new RegExp(`^${Bt}$`);function Ft(e){const 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 To(e){return new RegExp(`^${Ft(e)}$`)}function Po(e){const t=Ft({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${t}(?:${r.join("|")})`;return new RegExp(`^${Bt}T(?:${n})$`)}const Ao=e=>{const t=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Ro=/^-?\d+$/,Jt=/^-?\d+(?:\.\d+)?$/,xo=/^(?:true|false)$/i,jo=/^null$/i,Co=/^[^A-Z]*$/,Mo=/^[^a-z]*$/,F=p("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Wt={number:"number",bigint:"bigint",object:"date"},Yt=p("$ZodCheckLessThan",(e,t)=>{F.init(e,t);const r=Wt[typeof t.value];e._zod.onattach.push(n=>{const o=n._zod.bag,s=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<s&&(t.inclusive?o.maximum=t.value:o.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),qt=p("$ZodCheckGreaterThan",(e,t)=>{F.init(e,t);const r=Wt[typeof t.value];e._zod.onattach.push(n=>{const o=n._zod.bag,s=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Do=p("$ZodCheckMultipleOf",(e,t)=>{F.init(e,t),e._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):Ln(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),Uo=p("$ZodCheckNumberFormat",(e,t)=>{var a;F.init(e,t),t.format=t.format||"float64";const r=(a=t.format)==null?void 0:a.includes("int"),n=r?"int":"number",[o,s]=Wn[t.format];e._zod.onattach.push(i=>{const u=i._zod.bag;u.format=t.format,u.minimum=o,u.maximum=s,r&&(u.pattern=Ro)}),e._zod.check=i=>{const u=i.value;if(r){if(!Number.isInteger(u)){i.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:u,inst:e});return}if(!Number.isSafeInteger(u)){u>0?i.issues.push({input:u,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort}):i.issues.push({input:u,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}u<o&&i.issues.push({origin:"number",input:u,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),u>s&&i.issues.push({origin:"number",input:u,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),Lo=p("$ZodCheckMaxLength",(e,t)=>{var r;F.init(e,t),(r=e._zod.def).when??(r.when=n=>{const o=n.value;return!Ye(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{const o=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const o=n.value;if(o.length<=t.maximum)return;const a=Ge(o);n.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Vo=p("$ZodCheckMinLength",(e,t)=>{var r;F.init(e,t),(r=e._zod.def).when??(r.when=n=>{const o=n.value;return!Ye(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{const o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const o=n.value;if(o.length>=t.minimum)return;const a=Ge(o);n.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Bo=p("$ZodCheckLengthEquals",(e,t)=>{var r;F.init(e,t),(r=e._zod.def).when??(r.when=n=>{const o=n.value;return!Ye(o)&&o.length!==void 0}),e._zod.onattach.push(n=>{const o=n._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=n=>{const o=n.value,s=o.length;if(s===t.length)return;const a=Ge(o),i=s>t.length;n.issues.push({origin:a,...i?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Pe=p("$ZodCheckStringFormat",(e,t)=>{var r,n;F.init(e,t),e._zod.onattach.push(o=>{const s=o._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),Fo=p("$ZodCheckRegex",(e,t)=>{Pe.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Jo=p("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Co),Pe.init(e,t)}),Wo=p("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Mo),Pe.init(e,t)}),Yo=p("$ZodCheckIncludes",(e,t)=>{F.init(e,t);const r=pe(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(o=>{const s=o._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(n)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),qo=p("$ZodCheckStartsWith",(e,t)=>{F.init(e,t);const r=new RegExp(`^${pe(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{const o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Go=p("$ZodCheckEndsWith",(e,t)=>{F.init(e,t);const r=new RegExp(`.*${pe(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{const o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Ho=p("$ZodCheckOverwrite",(e,t)=>{F.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});class Xo{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}const n=t.split(`
4
+ `).filter(a=>a),o=Math.min(...n.map(a=>a.length-a.trimStart().length)),s=n.map(a=>a.slice(o)).map(a=>" ".repeat(this.indent*2)+a);for(const a of s)this.content.push(a)}compile(){const t=Function,r=this==null?void 0:this.args,o=[...((this==null?void 0:this.content)??[""]).map(s=>` ${s}`)];return new t(...r,o.join(`
5
+ `))}}const Qo={major:4,minor:3,patch:5},x=p("$ZodType",(e,t)=>{var o;var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Qo;const n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(const s of n)for(const a of s._zod.onattach)a(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),(o=e._zod.deferred)==null||o.push(()=>{e._zod.run=e._zod.parse});else{const s=(i,u,c)=>{let l=fe(i),d;for(const _ of u){if(_._zod.def.when){if(!_._zod.def.when(i))continue}else if(l)continue;const m=i.issues.length,I=_._zod.check(i);if(I instanceof Promise&&(c==null?void 0:c.async)===!1)throw new le;if(d||I instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await I,i.issues.length!==m&&(l||(l=fe(i,m)))});else{if(i.issues.length===m)continue;l||(l=fe(i,m))}}return d?d.then(()=>i):i},a=(i,u,c)=>{if(fe(i))return i.aborted=!0,i;const l=s(u,n,c);if(l instanceof Promise){if(c.async===!1)throw new le;return l.then(d=>e._zod.parse(d,c))}return e._zod.parse(l,c)};e._zod.run=(i,u)=>{if(u.skipChecks)return e._zod.parse(i,u);if(u.direction==="backward"){const l=e._zod.parse({value:i.value,issues:[]},{...u,skipChecks:!0});return l instanceof Promise?l.then(d=>a(d,i,u)):a(l,i,u)}const c=e._zod.parse(i,u);if(c instanceof Promise){if(u.async===!1)throw new le;return c.then(l=>s(l,n,u))}return s(c,n,u)}}O(e,"~standard",()=>({validate:s=>{var a;try{const i=ro(e,s);return i.success?{value:i.data}:{issues:(a=i.error)==null?void 0:a.issues}}catch{return no(e,s).then(u=>{var c;return u.success?{value:u.data}:{issues:(c=u.error)==null?void 0:c.issues}})}},vendor:"zod",version:1}))}),Qe=p("$ZodString",(e,t)=>{var r;x.init(e,t),e._zod.pattern=[...((r=e==null?void 0:e._zod.bag)==null?void 0:r.patterns)??[]].pop()??Ao(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}}),M=p("$ZodStringFormat",(e,t)=>{Pe.init(e,t),Qe.init(e,t)}),Ko=p("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=bo),M.init(e,t)}),es=p("$ZodUUID",(e,t)=>{if(t.version){const n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Lt(n))}else t.pattern??(t.pattern=Lt());M.init(e,t)}),ts=p("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=wo),M.init(e,t)}),rs=p("$ZodURL",(e,t)=>{M.init(e,t),e._zod.check=r=>{try{const n=r.value.trim(),o=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(o.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=o.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),ns=p("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Eo()),M.init(e,t)}),os=p("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=_o),M.init(e,t)}),ss=p("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=fo),M.init(e,t)}),as=p("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=mo),M.init(e,t)}),is=p("$ZodULID",(e,t)=>{t.pattern??(t.pattern=ho),M.init(e,t)}),cs=p("$ZodXID",(e,t)=>{t.pattern??(t.pattern=go),M.init(e,t)}),us=p("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=vo),M.init(e,t)}),ls=p("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Po(t)),M.init(e,t)}),ds=p("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=No),M.init(e,t)}),ps=p("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=To(t)),M.init(e,t)}),fs=p("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=yo),M.init(e,t)}),ms=p("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=ko),M.init(e,t),e._zod.bag.format="ipv4"}),hs=p("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=zo),M.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),gs=p("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=So),M.init(e,t)}),vs=p("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Oo),M.init(e,t),e._zod.check=r=>{const n=r.value.split("/");try{if(n.length!==2)throw new Error;const[o,s]=n;if(!s)throw new Error;const a=Number(s);if(`${a}`!==s)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${o}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function Gt(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const _s=p("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Zo),M.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{Gt(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function ys(e){if(!Vt.test(e))return!1;const t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return Gt(r)}const bs=p("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Vt),M.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{ys(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),ws=p("$ZodE164",(e,t)=>{t.pattern??(t.pattern=$o),M.init(e,t)});function Is(e,t=null){try{const r=e.split(".");if(r.length!==3)return!1;const[n]=r;if(!n)return!1;const o=JSON.parse(atob(n));return!("typ"in o&&(o==null?void 0:o.typ)!=="JWT"||!o.alg||t&&(!("alg"in o)||o.alg!==t))}catch{return!1}}const Es=p("$ZodJWT",(e,t)=>{M.init(e,t),e._zod.check=r=>{Is(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),Ht=p("$ZodNumber",(e,t)=>{x.init(e,t),e._zod.pattern=e._zod.bag.pattern??Jt,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}const o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;const s=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:e,...s?{received:s}:{}}),r}}),ks=p("$ZodNumberFormat",(e,t)=>{Uo.init(e,t),Ht.init(e,t)}),zs=p("$ZodBoolean",(e,t)=>{x.init(e,t),e._zod.pattern=xo,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}const o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:e}),r}}),Ss=p("$ZodNull",(e,t)=>{x.init(e,t),e._zod.pattern=jo,e._zod.values=new Set([null]),e._zod.parse=(r,n)=>{const o=r.value;return o===null||r.issues.push({expected:"null",code:"invalid_type",input:o,inst:e}),r}}),Os=p("$ZodUnknown",(e,t)=>{x.init(e,t),e._zod.parse=r=>r}),Zs=p("$ZodNever",(e,t)=>{x.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function Xt(e,t,r){e.issues.length&&t.issues.push(...me(r,e.issues)),t.value[r]=e.value}const $s=p("$ZodArray",(e,t)=>{x.init(e,t),e._zod.parse=(r,n)=>{const o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:e}),r;r.value=Array(o.length);const s=[];for(let a=0;a<o.length;a++){const i=o[a],u=t.element._zod.run({value:i,issues:[]},n);u instanceof Promise?s.push(u.then(c=>Xt(c,r,a))):Xt(u,r,a)}return s.length?Promise.all(s).then(()=>r):r}});function Ae(e,t,r,n,o){if(e.issues.length){if(o&&!(r in n))return;t.issues.push(...me(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}function Qt(e){var n,o,s,a;const t=Object.keys(e.shape);for(const i of t)if(!((a=(s=(o=(n=e.shape)==null?void 0:n[i])==null?void 0:o._zod)==null?void 0:s.traits)!=null&&a.has("$ZodType")))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);const r=Jn(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function Kt(e,t,r,n,o,s){const a=[],i=o.keySet,u=o.catchall._zod,c=u.def.type,l=u.optout==="optional";for(const d in t){if(i.has(d))continue;if(c==="never"){a.push(d);continue}const _=u.run({value:t[d],issues:[]},n);_ instanceof Promise?e.push(_.then(m=>Ae(m,r,d,t,l))):Ae(_,r,d,t,l)}return a.length&&r.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:s}),e.length?Promise.all(e).then(()=>r):r}const Ns=p("$ZodObject",(e,t)=>{x.init(e,t);const r=Object.getOwnPropertyDescriptor(t,"shape");if(!(r!=null&&r.get)){const i=t.shape;Object.defineProperty(t,"shape",{get:()=>{const u={...i};return Object.defineProperty(t,"shape",{value:u}),u}})}const n=Ze(()=>Qt(t));O(e._zod,"propValues",()=>{const i=t.shape,u={};for(const c in i){const l=i[c]._zod;if(l.values){u[c]??(u[c]=new Set);for(const d of l.values)u[c].add(d)}}return u});const o=_e,s=t.catchall;let a;e._zod.parse=(i,u)=>{a??(a=n.value);const c=i.value;if(!o(c))return i.issues.push({expected:"object",code:"invalid_type",input:c,inst:e}),i;i.value={};const l=[],d=a.shape;for(const _ of a.keys){const m=d[_],I=m._zod.optout==="optional",g=m._zod.run({value:c[_],issues:[]},u);g instanceof Promise?l.push(g.then(y=>Ae(y,i,_,c,I))):Ae(g,i,_,c,I)}return s?Kt(l,c,i,u,n.value,e):l.length?Promise.all(l).then(()=>i):i}}),Ts=p("$ZodObjectJIT",(e,t)=>{Ns.init(e,t);const r=e._zod.parse,n=Ze(()=>Qt(t)),o=_=>{var f;const m=new Xo(["shape","payload","ctx"]),I=n.value,g=T=>{const $=xt(T);return`shape[${$}]._zod.run({ value: input[${$}], issues: [] }, ctx)`};m.write("const input = payload.value;");const y=Object.create(null);let k=0;for(const T of I.keys)y[T]=`key_${k++}`;m.write("const newResult = {};");for(const T of I.keys){const $=y[T],S=xt(T),A=_[T],J=((f=A==null?void 0:A._zod)==null?void 0:f.optout)==="optional";m.write(`const ${$} = ${g(T)};`),J?m.write(`
6
+ if (${$}.issues.length) {
7
+ if (${S} in input) {
8
+ payload.issues = payload.issues.concat(${$}.issues.map(iss => ({
9
9
  ...iss,
10
- path: iss.path ? [${v}, ...iss.path] : [${v}]
10
+ path: iss.path ? [${S}, ...iss.path] : [${S}]
11
11
  })));
12
12
  }
13
13
  }
14
14
 
15
- if (${C}.value === undefined) {
16
- if (${v} in input) {
17
- newResult[${v}] = undefined;
15
+ if (${$}.value === undefined) {
16
+ if (${S} in input) {
17
+ newResult[${S}] = undefined;
18
18
  }
19
19
  } else {
20
- newResult[${v}] = ${C}.value;
20
+ newResult[${S}] = ${$}.value;
21
21
  }
22
22
 
23
- `):d.write(`
24
- if (${C}.issues.length) {
25
- payload.issues = payload.issues.concat(${C}.issues.map(iss => ({
23
+ `):m.write(`
24
+ if (${$}.issues.length) {
25
+ payload.issues = payload.issues.concat(${$}.issues.map(iss => ({
26
26
  ...iss,
27
- path: iss.path ? [${v}, ...iss.path] : [${v}]
27
+ path: iss.path ? [${S}, ...iss.path] : [${S}]
28
28
  })));
29
29
  }
30
30
 
31
- if (${C}.value === undefined) {
32
- if (${v} in input) {
33
- newResult[${v}] = undefined;
31
+ if (${$}.value === undefined) {
32
+ if (${S} in input) {
33
+ newResult[${S}] = undefined;
34
34
  }
35
35
  } else {
36
- newResult[${v}] = ${C}.value;
36
+ newResult[${S}] = ${$}.value;
37
37
  }
38
38
 
39
- `)}d.write("payload.value = newResult;"),d.write("return payload;");const x=d.compile();return(z,C)=>x(f,z,C)};let o;const i=fe,s=!Je.jitless,a=s&&Fn.value,L=t.catchall;let l;e._zod.parse=(f,d)=>{l??(l=n.value);const I=f.value;return i(I)?s&&a&&(d==null?void 0:d.async)===!1&&d.jitless!==!0?(o||(o=u(t.shape)),f=o(f,d),L?Kt([],I,f,d,l,e):f):r(f,d):(f.issues.push({expected:"object",code:"invalid_type",input:I,inst:e}),f)}});function er(e,t,r,n){for(const o of e)if(o.issues.length===0)return t.value=o.value,t;const u=e.filter(o=>!Me(o));return u.length===1?(t.value=u[0].value,u[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(o=>o.issues.map(i=>te(i,n,X())))}),t)}const tr=j("$ZodUnion",(e,t)=>{D.init(e,t),_(e._zod,"optin",()=>t.options.some(u=>u._zod.optin==="optional")?"optional":void 0),_(e._zod,"optout",()=>t.options.some(u=>u._zod.optout==="optional")?"optional":void 0),_(e._zod,"values",()=>{if(t.options.every(u=>u._zod.values))return new Set(t.options.flatMap(u=>Array.from(u._zod.values)))}),_(e._zod,"pattern",()=>{if(t.options.every(u=>u._zod.pattern)){const u=t.options.map(o=>o._zod.pattern);return new RegExp(`^(${u.map(o=>We(o.source)).join("|")})$`)}});const r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(u,o)=>{if(r)return n(u,o);let i=!1;const s=[];for(const c of t.options){const a=c._zod.run({value:u.value,issues:[]},o);if(a instanceof Promise)s.push(a),i=!0;else{if(a.issues.length===0)return a;s.push(a)}}return i?Promise.all(s).then(c=>er(c,u,e,o)):er(s,u,e,o)}}),wo=j("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,tr.init(e,t);const r=e._zod.parse;_(e._zod,"propValues",()=>{const u={};for(const o of t.options){const i=o._zod.propValues;if(!i||Object.keys(i).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(const[s,c]of Object.entries(i)){u[s]||(u[s]=new Set);for(const a of c)u[s].add(a)}}return u});const n=Ae(()=>{var i;const u=t.options,o=new Map;for(const s of u){const c=(i=s._zod.propValues)==null?void 0:i[t.discriminator];if(!c||c.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(const a of c){if(o.has(a))throw new Error(`Duplicate discriminator value "${String(a)}"`);o.set(a,s)}}return o});e._zod.parse=(u,o)=>{const i=u.value;if(!fe(i))return u.issues.push({code:"invalid_type",expected:"object",input:i,inst:e}),u;const s=n.value.get(i==null?void 0:i[t.discriminator]);return s?s._zod.run(u,o):t.unionFallback?r(u,o):(u.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:i,path:[t.discriminator],inst:e}),u)}}),Oo=j("$ZodIntersection",(e,t)=>{D.init(e,t),e._zod.parse=(r,n)=>{const u=r.value,o=t.left._zod.run({value:u,issues:[]},n),i=t.right._zod.run({value:u,issues:[]},n);return o instanceof Promise||i instanceof Promise?Promise.all([o,i]).then(([c,a])=>rr(r,c,a)):rr(r,o,i)}});function Ke(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(le(e)&&le(t)){const r=Object.keys(t),n=Object.keys(e).filter(o=>r.indexOf(o)!==-1),u={...e,...t};for(const o of n){const i=Ke(e[o],t[o]);if(!i.valid)return{valid:!1,mergeErrorPath:[o,...i.mergeErrorPath]};u[o]=i.data}return{valid:!0,data:u}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let n=0;n<e.length;n++){const u=e[n],o=t[n],i=Ke(u,o);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};r.push(i.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function rr(e,t,r){const n=new Map;let u;for(const s of t.issues)if(s.code==="unrecognized_keys"){u??(u=s);for(const c of s.keys)n.has(c)||n.set(c,{}),n.get(c).l=!0}else e.issues.push(s);for(const s of r.issues)if(s.code==="unrecognized_keys")for(const c of s.keys)n.has(c)||n.set(c,{}),n.get(c).r=!0;else e.issues.push(s);const o=[...n].filter(([,s])=>s.l&&s.r).map(([s])=>s);if(o.length&&u&&e.issues.push({...u,keys:o}),Me(e))return e;const i=Ke(t.value,r.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return e.value=i.data,e}const Do=j("$ZodRecord",(e,t)=>{D.init(e,t),e._zod.parse=(r,n)=>{const u=r.value;if(!le(u))return r.issues.push({expected:"record",code:"invalid_type",input:u,inst:e}),r;const o=[],i=t.keyType._zod.values;if(i){r.value={};const s=new Set;for(const a of i)if(typeof a=="string"||typeof a=="number"||typeof a=="symbol"){s.add(typeof a=="number"?a.toString():a);const L=t.valueType._zod.run({value:u[a],issues:[]},n);L instanceof Promise?o.push(L.then(l=>{l.issues.length&&r.issues.push(...de(a,l.issues)),r.value[a]=l.value})):(L.issues.length&&r.issues.push(...de(a,L.issues)),r.value[a]=L.value)}let c;for(const a in u)s.has(a)||(c=c??[],c.push(a));c&&c.length>0&&r.issues.push({code:"unrecognized_keys",input:u,inst:e,keys:c})}else{r.value={};for(const s of Reflect.ownKeys(u)){if(s==="__proto__")continue;let c=t.keyType._zod.run({value:s,issues:[]},n);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof s=="string"&&Jt.test(s)&&c.issues.length&&c.issues.some(l=>l.code==="invalid_type"&&l.expected==="number")){const l=t.keyType._zod.run({value:Number(s),issues:[]},n);if(l instanceof Promise)throw new Error("Async schemas not supported in object keys currently");l.issues.length===0&&(c=l)}if(c.issues.length){t.mode==="loose"?r.value[s]=u[s]:r.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(l=>te(l,n,X())),input:s,path:[s],inst:e});continue}const L=t.valueType._zod.run({value:u[s],issues:[]},n);L instanceof Promise?o.push(L.then(l=>{l.issues.length&&r.issues.push(...de(s,l.issues)),r.value[c.value]=l.value})):(L.issues.length&&r.issues.push(...de(s,L.issues)),r.value[c.value]=L.value)}}return o.length?Promise.all(o).then(()=>r):r}}),ko=j("$ZodEnum",(e,t)=>{D.init(e,t);const r=wt(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(u=>Jn.has(typeof u)).map(u=>typeof u=="string"?je(u):u.toString()).join("|")})$`),e._zod.parse=(u,o)=>{const i=u.value;return n.has(i)||u.issues.push({code:"invalid_value",values:r,input:i,inst:e}),u}}),Zo=j("$ZodLiteral",(e,t)=>{if(D.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?je(n):n?je(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,u)=>{const o=n.value;return r.has(o)||n.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),n}}),$o=j("$ZodTransform",(e,t)=>{D.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Tt(e.constructor.name);const u=t.transform(r.value,r);if(n.async)return(u instanceof Promise?u:Promise.resolve(u)).then(i=>(r.value=i,r));if(u instanceof Promise)throw new Le;return r.value=u,r}});function nr(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const ur=j("$ZodOptional",(e,t)=>{D.init(e,t),e._zod.optin="optional",e._zod.optout="optional",_(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),_(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${We(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){const u=t.innerType._zod.run(r,n);return u instanceof Promise?u.then(o=>nr(o,r.value)):nr(u,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}}),Po=j("$ZodExactOptional",(e,t)=>{ur.init(e,t),_(e._zod,"values",()=>t.innerType._zod.values),_(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,n)=>t.innerType._zod.run(r,n)}),Uo=j("$ZodNullable",(e,t)=>{D.init(e,t),_(e._zod,"optin",()=>t.innerType._zod.optin),_(e._zod,"optout",()=>t.innerType._zod.optout),_(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${We(r.source)}|null)$`):void 0}),_(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)}),Yo=j("$ZodDefault",(e,t)=>{D.init(e,t),e._zod.optin="optional",_(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;const u=t.innerType._zod.run(r,n);return u instanceof Promise?u.then(o=>or(o,t)):or(u,t)}});function or(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Ro=j("$ZodPrefault",(e,t)=>{D.init(e,t),e._zod.optin="optional",_(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,n))}),Qo=j("$ZodNonOptional",(e,t)=>{D.init(e,t),_(e._zod,"values",()=>{const r=t.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),e._zod.parse=(r,n)=>{const u=t.innerType._zod.run(r,n);return u instanceof Promise?u.then(o=>ir(o,e)):ir(u,e)}});function ir(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Fo=j("$ZodCatch",(e,t)=>{D.init(e,t),_(e._zod,"optin",()=>t.innerType._zod.optin),_(e._zod,"optout",()=>t.innerType._zod.optout),_(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const u=t.innerType._zod.run(r,n);return u instanceof Promise?u.then(o=>(r.value=o.value,o.issues.length&&(r.value=t.catchValue({...r,error:{issues:o.issues.map(i=>te(i,n,X()))},input:r.value}),r.issues=[]),r)):(r.value=u.value,u.issues.length&&(r.value=t.catchValue({...r,error:{issues:u.issues.map(o=>te(o,n,X()))},input:r.value}),r.issues=[]),r)}}),Jo=j("$ZodPipe",(e,t)=>{D.init(e,t),_(e._zod,"values",()=>t.in._zod.values),_(e._zod,"optin",()=>t.in._zod.optin),_(e._zod,"optout",()=>t.out._zod.optout),_(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){const o=t.out._zod.run(r,n);return o instanceof Promise?o.then(i=>Oe(i,t.in,n)):Oe(o,t.in,n)}const u=t.in._zod.run(r,n);return u instanceof Promise?u.then(o=>Oe(o,t.out,n)):Oe(u,t.out,n)}});function Oe(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}const Vo=j("$ZodReadonly",(e,t)=>{D.init(e,t),_(e._zod,"propValues",()=>t.innerType._zod.propValues),_(e._zod,"values",()=>t.innerType._zod.values),_(e._zod,"optin",()=>{var r,n;return(n=(r=t.innerType)==null?void 0:r._zod)==null?void 0:n.optin}),_(e._zod,"optout",()=>{var r,n;return(n=(r=t.innerType)==null?void 0:r._zod)==null?void 0:n.optout}),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const u=t.innerType._zod.run(r,n);return u instanceof Promise?u.then(sr):sr(u)}});function sr(e){return e.value=Object.freeze(e.value),e}const Bo=j("$ZodLazy",(e,t)=>{D.init(e,t),_(e._zod,"innerType",()=>t.getter()),_(e._zod,"pattern",()=>{var r,n;return(n=(r=e._zod.innerType)==null?void 0:r._zod)==null?void 0:n.pattern}),_(e._zod,"propValues",()=>{var r,n;return(n=(r=e._zod.innerType)==null?void 0:r._zod)==null?void 0:n.propValues}),_(e._zod,"optin",()=>{var r,n;return((n=(r=e._zod.innerType)==null?void 0:r._zod)==null?void 0:n.optin)??void 0}),_(e._zod,"optout",()=>{var r,n;return((n=(r=e._zod.innerType)==null?void 0:r._zod)==null?void 0:n.optout)??void 0}),e._zod.parse=(r,n)=>e._zod.innerType._zod.run(r,n)}),Wo=j("$ZodCustom",(e,t)=>{F.init(e,t),D.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{const n=r.value,u=t.fn(n);if(u instanceof Promise)return u.then(o=>ar(o,r,n,e));ar(u,r,n,e)}});function ar(e,t,r,n){if(!e){const u={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(u.params=n._zod.def.params),t.issues.push(ge(u))}}var cr;class Go{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){const n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){const r=t._zod.parent;if(r){const n={...this.get(r)??{}};delete n.id;const u={...n,...this._map.get(t)};return Object.keys(u).length?u:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function qo(){return new Go}(cr=globalThis).__zod_globalRegistry??(cr.__zod_globalRegistry=qo());const me=globalThis.__zod_globalRegistry;function Ho(e,t){return new e({type:"string",...m(t)})}function Xo(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...m(t)})}function Lr(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...m(t)})}function Ko(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...m(t)})}function ei(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...m(t)})}function ti(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...m(t)})}function ri(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...m(t)})}function ni(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...m(t)})}function ui(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...m(t)})}function oi(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...m(t)})}function ii(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...m(t)})}function si(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...m(t)})}function ai(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...m(t)})}function ci(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...m(t)})}function Li(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...m(t)})}function li(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...m(t)})}function ji(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...m(t)})}function Mi(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...m(t)})}function di(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...m(t)})}function Si(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...m(t)})}function pi(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...m(t)})}function yi(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...m(t)})}function fi(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...m(t)})}function gi(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...m(t)})}function mi(e,t){return new e({type:"string",format:"date",check:"string_format",...m(t)})}function hi(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...m(t)})}function Ii(e,t){return new e({type:"string",format:"duration",check:"string_format",...m(t)})}function Ei(e,t){return new e({type:"number",checks:[],...m(t)})}function Ni(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...m(t)})}function xi(e,t){return new e({type:"boolean",...m(t)})}function vi(e,t){return new e({type:"null",...m(t)})}function _i(e){return new e({type:"unknown"})}function Ai(e,t){return new e({type:"never",...m(t)})}function lr(e,t){return new Bt({check:"less_than",...m(t),value:e,inclusive:!1})}function et(e,t){return new Bt({check:"less_than",...m(t),value:e,inclusive:!0})}function jr(e,t){return new Wt({check:"greater_than",...m(t),value:e,inclusive:!1})}function tt(e,t){return new Wt({check:"greater_than",...m(t),value:e,inclusive:!0})}function Mr(e,t){return new Pu({check:"multiple_of",...m(t),value:e})}function dr(e,t){return new Yu({check:"max_length",...m(t),maximum:e})}function De(e,t){return new Ru({check:"min_length",...m(t),minimum:e})}function Sr(e,t){return new Qu({check:"length_equals",...m(t),length:e})}function Ci(e,t){return new Fu({check:"string_format",format:"regex",...m(t),pattern:e})}function bi(e){return new Ju({check:"string_format",format:"lowercase",...m(e)})}function zi(e){return new Vu({check:"string_format",format:"uppercase",...m(e)})}function Ti(e,t){return new Bu({check:"string_format",format:"includes",...m(t),includes:e})}function wi(e,t){return new Wu({check:"string_format",format:"starts_with",...m(t),prefix:e})}function Oi(e,t){return new Gu({check:"string_format",format:"ends_with",...m(t),suffix:e})}function Se(e){return new qu({check:"overwrite",tx:e})}function Di(e){return Se(t=>t.normalize(e))}function ki(){return Se(e=>e.trim())}function Zi(){return Se(e=>e.toLowerCase())}function $i(){return Se(e=>e.toUpperCase())}function Pi(){return Se(e=>Qn(e))}function Ui(e,t,r){return new e({type:"array",element:t,...m(r)})}function Yi(e,t,r){const n=m(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}function Ri(e,t,r){return new e({type:"custom",check:"custom",fn:t,...m(r)})}function Qi(e){const t=Fi(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(ge(n,r.value,t._zod.def));else{const u=n;u.fatal&&(u.continue=!1),u.code??(u.code="custom"),u.input??(u.input=r.value),u.inst??(u.inst=t),u.continue??(u.continue=!t._zod.def.abort),r.issues.push(ge(u))}},e(r.value,r)));return t}function Fi(e,t){const r=new F({check:"custom",...m(t)});return r._zod.check=e,r}function ke(e){let t=(e==null?void 0:e.target)??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:(e==null?void 0:e.metadata)??me,target:t,unrepresentable:(e==null?void 0:e.unrepresentable)??"throw",override:(e==null?void 0:e.override)??(()=>{}),io:(e==null?void 0:e.io)??"output",counter:0,seen:new Map,cycles:(e==null?void 0:e.cycles)??"ref",reused:(e==null?void 0:e.reused)??"inline",external:(e==null?void 0:e.external)??void 0}}function O(e,t,r={path:[],schemaPath:[]}){var L,l;var n;const u=e._zod.def,o=t.seen.get(e);if(o)return o.count++,r.schemaPath.includes(e)&&(o.cycle=r.path),o.schema;const i={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,i);const s=(l=(L=e._zod).toJSONSchema)==null?void 0:l.call(L);if(s)i.schema=s;else{const f={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,i.schema,f);else{const I=i.schema,p=t.processors[u.type];if(!p)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${u.type}`);p(e,t,I,f)}const d=e._zod.parent;d&&(i.ref||(i.ref=d),O(d,t,f),t.seen.get(d).isParent=!0)}const c=t.metadataRegistry.get(e);return c&&Object.assign(i.schema,c),t.io==="input"&&U(e)&&(delete i.schema.examples,delete i.schema.default),t.io==="input"&&i.schema._prefault&&((n=i.schema).default??(n.default=i.schema._prefault)),delete i.schema._prefault,t.seen.get(e).schema}function Ze(e,t){var i,s,c,a;const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=new Map;for(const L of e.seen.entries()){const l=(i=e.metadataRegistry.get(L[0]))==null?void 0:i.id;if(l){const f=n.get(l);if(f&&f!==L[0])throw new Error(`Duplicate schema id "${l}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(l,L[0])}}const u=L=>{var p;const l=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const g=(p=e.external.registry.get(L[0]))==null?void 0:p.id,N=e.external.uri??(M=>M);if(g)return{ref:N(g)};const x=L[1].defId??L[1].schema.id??`schema${e.counter++}`;return L[1].defId=x,{defId:x,ref:`${N("__shared")}#/${l}/${x}`}}if(L[1]===r)return{ref:"#"};const d=`#/${l}/`,I=L[1].schema.id??`__schema${e.counter++}`;return{defId:I,ref:d+I}},o=L=>{if(L[1].schema.$ref)return;const l=L[1],{ref:f,defId:d}=u(L);l.def={...l.schema},d&&(l.defId=d);const I=l.schema;for(const p in I)delete I[p];I.$ref=f};if(e.cycles==="throw")for(const L of e.seen.entries()){const l=L[1];if(l.cycle)throw new Error(`Cycle detected: #/${(s=l.cycle)==null?void 0:s.join("/")}/<root>
39
+ `)}m.write("payload.value = newResult;"),m.write("return payload;");const z=m.compile();return(T,$)=>z(_,T,$)};let s;const a=_e,i=!Je.jitless,c=i&&Bn.value,l=t.catchall;let d;e._zod.parse=(_,m)=>{d??(d=n.value);const I=_.value;return a(I)?i&&c&&(m==null?void 0:m.async)===!1&&m.jitless!==!0?(s||(s=o(t.shape)),_=s(_,m),l?Kt([],I,_,m,d,e):_):r(_,m):(_.issues.push({expected:"object",code:"invalid_type",input:I,inst:e}),_)}});function er(e,t,r,n){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const o=e.filter(s=>!fe(s));return o.length===1?(t.value=o[0].value,o[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(s=>s.issues.map(a=>te(a,n,Q())))}),t)}const tr=p("$ZodUnion",(e,t)=>{x.init(e,t),O(e._zod,"optin",()=>t.options.some(o=>o._zod.optin==="optional")?"optional":void 0),O(e._zod,"optout",()=>t.options.some(o=>o._zod.optout==="optional")?"optional":void 0),O(e._zod,"values",()=>{if(t.options.every(o=>o._zod.values))return new Set(t.options.flatMap(o=>Array.from(o._zod.values)))}),O(e._zod,"pattern",()=>{if(t.options.every(o=>o._zod.pattern)){const o=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${o.map(s=>qe(s.source)).join("|")})$`)}});const r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(o,s)=>{if(r)return n(o,s);let a=!1;const i=[];for(const u of t.options){const c=u._zod.run({value:o.value,issues:[]},s);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(u=>er(u,o,e,s)):er(i,o,e,s)}}),Ps=p("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,tr.init(e,t);const r=e._zod.parse;O(e._zod,"propValues",()=>{const o={};for(const s of t.options){const a=s._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(const[i,u]of Object.entries(a)){o[i]||(o[i]=new Set);for(const c of u)o[i].add(c)}}return o});const n=Ze(()=>{var a;const o=t.options,s=new Map;for(const i of o){const u=(a=i._zod.propValues)==null?void 0:a[t.discriminator];if(!u||u.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(const c of u){if(s.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);s.set(c,i)}}return s});e._zod.parse=(o,s)=>{const a=o.value;if(!_e(a))return o.issues.push({code:"invalid_type",expected:"object",input:a,inst:e}),o;const i=n.value.get(a==null?void 0:a[t.discriminator]);return i?i._zod.run(o,s):t.unionFallback?r(o,s):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:a,path:[t.discriminator],inst:e}),o)}}),As=p("$ZodIntersection",(e,t)=>{x.init(e,t),e._zod.parse=(r,n)=>{const o=r.value,s=t.left._zod.run({value:o,issues:[]},n),a=t.right._zod.run({value:o,issues:[]},n);return s instanceof Promise||a instanceof Promise?Promise.all([s,a]).then(([u,c])=>rr(r,u,c)):rr(r,s,a)}});function Ke(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(de(e)&&de(t)){const r=Object.keys(t),n=Object.keys(e).filter(s=>r.indexOf(s)!==-1),o={...e,...t};for(const s of n){const a=Ke(e[s],t[s]);if(!a.valid)return{valid:!1,mergeErrorPath:[s,...a.mergeErrorPath]};o[s]=a.data}return{valid:!0,data:o}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let n=0;n<e.length;n++){const o=e[n],s=t[n],a=Ke(o,s);if(!a.valid)return{valid:!1,mergeErrorPath:[n,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function rr(e,t,r){const n=new Map;let o;for(const i of t.issues)if(i.code==="unrecognized_keys"){o??(o=i);for(const u of i.keys)n.has(u)||n.set(u,{}),n.get(u).l=!0}else e.issues.push(i);for(const i of r.issues)if(i.code==="unrecognized_keys")for(const u of i.keys)n.has(u)||n.set(u,{}),n.get(u).r=!0;else e.issues.push(i);const s=[...n].filter(([,i])=>i.l&&i.r).map(([i])=>i);if(s.length&&o&&e.issues.push({...o,keys:s}),fe(e))return e;const a=Ke(t.value,r.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}const Rs=p("$ZodRecord",(e,t)=>{x.init(e,t),e._zod.parse=(r,n)=>{const o=r.value;if(!de(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:e}),r;const s=[],a=t.keyType._zod.values;if(a){r.value={};const i=new Set;for(const c of a)if(typeof c=="string"||typeof c=="number"||typeof c=="symbol"){i.add(typeof c=="number"?c.toString():c);const l=t.valueType._zod.run({value:o[c],issues:[]},n);l instanceof Promise?s.push(l.then(d=>{d.issues.length&&r.issues.push(...me(c,d.issues)),r.value[c]=d.value})):(l.issues.length&&r.issues.push(...me(c,l.issues)),r.value[c]=l.value)}let u;for(const c in o)i.has(c)||(u=u??[],u.push(c));u&&u.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:e,keys:u})}else{r.value={};for(const i of Reflect.ownKeys(o)){if(i==="__proto__")continue;let u=t.keyType._zod.run({value:i,issues:[]},n);if(u instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof i=="string"&&Jt.test(i)&&u.issues.length&&u.issues.some(d=>d.code==="invalid_type"&&d.expected==="number")){const d=t.keyType._zod.run({value:Number(i),issues:[]},n);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");d.issues.length===0&&(u=d)}if(u.issues.length){t.mode==="loose"?r.value[i]=o[i]:r.issues.push({code:"invalid_key",origin:"record",issues:u.issues.map(d=>te(d,n,Q())),input:i,path:[i],inst:e});continue}const l=t.valueType._zod.run({value:o[i],issues:[]},n);l instanceof Promise?s.push(l.then(d=>{d.issues.length&&r.issues.push(...me(i,d.issues)),r.value[u.value]=d.value})):(l.issues.length&&r.issues.push(...me(i,l.issues)),r.value[u.value]=l.value)}}return s.length?Promise.all(s).then(()=>r):r}}),xs=p("$ZodEnum",(e,t)=>{x.init(e,t);const r=At(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(o=>Fn.has(typeof o)).map(o=>typeof o=="string"?pe(o):o.toString()).join("|")})$`),e._zod.parse=(o,s)=>{const a=o.value;return n.has(a)||o.issues.push({code:"invalid_value",values:r,input:a,inst:e}),o}}),js=p("$ZodLiteral",(e,t)=>{if(x.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?pe(n):n?pe(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,o)=>{const s=n.value;return r.has(s)||n.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),n}}),Cs=p("$ZodTransform",(e,t)=>{x.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Pt(e.constructor.name);const o=t.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(a=>(r.value=a,r));if(o instanceof Promise)throw new le;return r.value=o,r}});function nr(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const or=p("$ZodOptional",(e,t)=>{x.init(e,t),e._zod.optin="optional",e._zod.optout="optional",O(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),O(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${qe(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>nr(s,r.value)):nr(o,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}}),Ms=p("$ZodExactOptional",(e,t)=>{or.init(e,t),O(e._zod,"values",()=>t.innerType._zod.values),O(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,n)=>t.innerType._zod.run(r,n)}),Ds=p("$ZodNullable",(e,t)=>{x.init(e,t),O(e._zod,"optin",()=>t.innerType._zod.optin),O(e._zod,"optout",()=>t.innerType._zod.optout),O(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${qe(r.source)}|null)$`):void 0}),O(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)}),Us=p("$ZodDefault",(e,t)=>{x.init(e,t),e._zod.optin="optional",O(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>sr(s,t)):sr(o,t)}});function sr(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Ls=p("$ZodPrefault",(e,t)=>{x.init(e,t),e._zod.optin="optional",O(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,n))}),Vs=p("$ZodNonOptional",(e,t)=>{x.init(e,t),O(e._zod,"values",()=>{const r=t.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),e._zod.parse=(r,n)=>{const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>ar(s,e)):ar(o,e)}});function ar(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Bs=p("$ZodCatch",(e,t)=>{x.init(e,t),O(e._zod,"optin",()=>t.innerType._zod.optin),O(e._zod,"optout",()=>t.innerType._zod.optout),O(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(s=>(r.value=s.value,s.issues.length&&(r.value=t.catchValue({...r,error:{issues:s.issues.map(a=>te(a,n,Q()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=t.catchValue({...r,error:{issues:o.issues.map(s=>te(s,n,Q()))},input:r.value}),r.issues=[]),r)}}),Fs=p("$ZodPipe",(e,t)=>{x.init(e,t),O(e._zod,"values",()=>t.in._zod.values),O(e._zod,"optin",()=>t.in._zod.optin),O(e._zod,"optout",()=>t.out._zod.optout),O(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){const s=t.out._zod.run(r,n);return s instanceof Promise?s.then(a=>Re(a,t.in,n)):Re(s,t.in,n)}const o=t.in._zod.run(r,n);return o instanceof Promise?o.then(s=>Re(s,t.out,n)):Re(o,t.out,n)}});function Re(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}const Js=p("$ZodReadonly",(e,t)=>{x.init(e,t),O(e._zod,"propValues",()=>t.innerType._zod.propValues),O(e._zod,"values",()=>t.innerType._zod.values),O(e._zod,"optin",()=>{var r,n;return(n=(r=t.innerType)==null?void 0:r._zod)==null?void 0:n.optin}),O(e._zod,"optout",()=>{var r,n;return(n=(r=t.innerType)==null?void 0:r._zod)==null?void 0:n.optout}),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const o=t.innerType._zod.run(r,n);return o instanceof Promise?o.then(ir):ir(o)}});function ir(e){return e.value=Object.freeze(e.value),e}const Ws=p("$ZodLazy",(e,t)=>{x.init(e,t),O(e._zod,"innerType",()=>t.getter()),O(e._zod,"pattern",()=>{var r,n;return(n=(r=e._zod.innerType)==null?void 0:r._zod)==null?void 0:n.pattern}),O(e._zod,"propValues",()=>{var r,n;return(n=(r=e._zod.innerType)==null?void 0:r._zod)==null?void 0:n.propValues}),O(e._zod,"optin",()=>{var r,n;return((n=(r=e._zod.innerType)==null?void 0:r._zod)==null?void 0:n.optin)??void 0}),O(e._zod,"optout",()=>{var r,n;return((n=(r=e._zod.innerType)==null?void 0:r._zod)==null?void 0:n.optout)??void 0}),e._zod.parse=(r,n)=>e._zod.innerType._zod.run(r,n)}),Ys=p("$ZodCustom",(e,t)=>{F.init(e,t),x.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{const n=r.value,o=t.fn(n);if(o instanceof Promise)return o.then(s=>cr(s,r,n,e));cr(o,r,n,e)}});function cr(e,t,r,n){if(!e){const o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),t.issues.push(ye(o))}}var ur;class qs{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){const n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){const r=t._zod.parent;if(r){const n={...this.get(r)??{}};delete n.id;const o={...n,...this._map.get(t)};return Object.keys(o).length?o:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function Gs(){return new qs}(ur=globalThis).__zod_globalRegistry??(ur.__zod_globalRegistry=Gs());const be=globalThis.__zod_globalRegistry;function Hs(e,t){return new e({type:"string",...b(t)})}function Xs(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...b(t)})}function lr(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...b(t)})}function Qs(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...b(t)})}function Ks(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...b(t)})}function ea(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...b(t)})}function ta(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...b(t)})}function ra(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...b(t)})}function na(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...b(t)})}function oa(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...b(t)})}function sa(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...b(t)})}function aa(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...b(t)})}function ia(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...b(t)})}function ca(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...b(t)})}function ua(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...b(t)})}function la(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...b(t)})}function da(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...b(t)})}function pa(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...b(t)})}function fa(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...b(t)})}function ma(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...b(t)})}function ha(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...b(t)})}function ga(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...b(t)})}function va(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...b(t)})}function _a(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...b(t)})}function ya(e,t){return new e({type:"string",format:"date",check:"string_format",...b(t)})}function ba(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...b(t)})}function wa(e,t){return new e({type:"string",format:"duration",check:"string_format",...b(t)})}function Ia(e,t){return new e({type:"number",checks:[],...b(t)})}function Ea(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...b(t)})}function ka(e,t){return new e({type:"boolean",...b(t)})}function za(e,t){return new e({type:"null",...b(t)})}function Sa(e){return new e({type:"unknown"})}function Oa(e,t){return new e({type:"never",...b(t)})}function dr(e,t){return new Yt({check:"less_than",...b(t),value:e,inclusive:!1})}function et(e,t){return new Yt({check:"less_than",...b(t),value:e,inclusive:!0})}function pr(e,t){return new qt({check:"greater_than",...b(t),value:e,inclusive:!1})}function tt(e,t){return new qt({check:"greater_than",...b(t),value:e,inclusive:!0})}function fr(e,t){return new Do({check:"multiple_of",...b(t),value:e})}function mr(e,t){return new Lo({check:"max_length",...b(t),maximum:e})}function xe(e,t){return new Vo({check:"min_length",...b(t),minimum:e})}function hr(e,t){return new Bo({check:"length_equals",...b(t),length:e})}function Za(e,t){return new Fo({check:"string_format",format:"regex",...b(t),pattern:e})}function $a(e){return new Jo({check:"string_format",format:"lowercase",...b(e)})}function Na(e){return new Wo({check:"string_format",format:"uppercase",...b(e)})}function Ta(e,t){return new Yo({check:"string_format",format:"includes",...b(t),includes:e})}function Pa(e,t){return new qo({check:"string_format",format:"starts_with",...b(t),prefix:e})}function Aa(e,t){return new Go({check:"string_format",format:"ends_with",...b(t),suffix:e})}function he(e){return new Ho({check:"overwrite",tx:e})}function Ra(e){return he(t=>t.normalize(e))}function xa(){return he(e=>e.trim())}function ja(){return he(e=>e.toLowerCase())}function Ca(){return he(e=>e.toUpperCase())}function Ma(){return he(e=>Vn(e))}function Da(e,t,r){return new e({type:"array",element:t,...b(r)})}function Ua(e,t,r){const n=b(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}function La(e,t,r){return new e({type:"custom",check:"custom",fn:t,...b(r)})}function Va(e){const t=Ba(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(ye(n,r.value,t._zod.def));else{const o=n;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=t),o.continue??(o.continue=!t._zod.def.abort),r.issues.push(ye(o))}},e(r.value,r)));return t}function Ba(e,t){const r=new F({check:"custom",...b(t)});return r._zod.check=e,r}function je(e){let t=(e==null?void 0:e.target)??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:(e==null?void 0:e.metadata)??be,target:t,unrepresentable:(e==null?void 0:e.unrepresentable)??"throw",override:(e==null?void 0:e.override)??(()=>{}),io:(e==null?void 0:e.io)??"output",counter:0,seen:new Map,cycles:(e==null?void 0:e.cycles)??"ref",reused:(e==null?void 0:e.reused)??"inline",external:(e==null?void 0:e.external)??void 0}}function R(e,t,r={path:[],schemaPath:[]}){var l,d;var n;const o=e._zod.def,s=t.seen.get(e);if(s)return s.count++,r.schemaPath.includes(e)&&(s.cycle=r.path),s.schema;const a={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,a);const i=(d=(l=e._zod).toJSONSchema)==null?void 0:d.call(l);if(i)a.schema=i;else{const _={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,_);else{const I=a.schema,g=t.processors[o.type];if(!g)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${o.type}`);g(e,t,I,_)}const m=e._zod.parent;m&&(a.ref||(a.ref=m),R(m,t,_),t.seen.get(m).isParent=!0)}const u=t.metadataRegistry.get(e);return u&&Object.assign(a.schema,u),t.io==="input"&&U(e)&&(delete a.schema.examples,delete a.schema.default),t.io==="input"&&a.schema._prefault&&((n=a.schema).default??(n.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function Ce(e,t){var a,i,u,c;const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=new Map;for(const l of e.seen.entries()){const d=(a=e.metadataRegistry.get(l[0]))==null?void 0:a.id;if(d){const _=n.get(d);if(_&&_!==l[0])throw new Error(`Duplicate schema id "${d}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(d,l[0])}}const o=l=>{var g;const d=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const y=(g=e.external.registry.get(l[0]))==null?void 0:g.id,k=e.external.uri??(f=>f);if(y)return{ref:k(y)};const z=l[1].defId??l[1].schema.id??`schema${e.counter++}`;return l[1].defId=z,{defId:z,ref:`${k("__shared")}#/${d}/${z}`}}if(l[1]===r)return{ref:"#"};const m=`#/${d}/`,I=l[1].schema.id??`__schema${e.counter++}`;return{defId:I,ref:m+I}},s=l=>{if(l[1].schema.$ref)return;const d=l[1],{ref:_,defId:m}=o(l);d.def={...d.schema},m&&(d.defId=m);const I=d.schema;for(const g in I)delete I[g];I.$ref=_};if(e.cycles==="throw")for(const l of e.seen.entries()){const d=l[1];if(d.cycle)throw new Error(`Cycle detected: #/${(i=d.cycle)==null?void 0:i.join("/")}/<root>
40
40
 
41
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const L of e.seen.entries()){const l=L[1];if(t===L[0]){o(L);continue}if(e.external){const d=(c=e.external.registry.get(L[0]))==null?void 0:c.id;if(t!==L[0]&&d){o(L);continue}}if((a=e.metadataRegistry.get(L[0]))==null?void 0:a.id){o(L);continue}if(l.cycle){o(L);continue}if(l.count>1&&e.reused==="ref"){o(L);continue}}}function $e(e,t){var i,s,c;const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=a=>{const L=e.seen.get(a);if(L.ref===null)return;const l=L.def??L.schema,f={...l},d=L.ref;if(L.ref=null,d){n(d);const p=e.seen.get(d),g=p.schema;if(g.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(l.allOf=l.allOf??[],l.allOf.push(g)):Object.assign(l,g),Object.assign(l,f),a._zod.parent===d)for(const x in l)x==="$ref"||x==="allOf"||x in f||delete l[x];if(g.$ref)for(const x in l)x==="$ref"||x==="allOf"||x in p.def&&JSON.stringify(l[x])===JSON.stringify(p.def[x])&&delete l[x]}const I=a._zod.parent;if(I&&I!==d){n(I);const p=e.seen.get(I);if(p!=null&&p.schema.$ref&&(l.$ref=p.schema.$ref,p.def))for(const g in l)g==="$ref"||g==="allOf"||g in p.def&&JSON.stringify(l[g])===JSON.stringify(p.def[g])&&delete l[g]}e.override({zodSchema:a,jsonSchema:l,path:L.path??[]})};for(const a of[...e.seen.entries()].reverse())n(a[0]);const u={};if(e.target==="draft-2020-12"?u.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?u.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?u.$schema="http://json-schema.org/draft-04/schema#":e.target,(i=e.external)!=null&&i.uri){const a=(s=e.external.registry.get(t))==null?void 0:s.id;if(!a)throw new Error("Schema is missing an `id` property");u.$id=e.external.uri(a)}Object.assign(u,r.def??r.schema);const o=((c=e.external)==null?void 0:c.defs)??{};for(const a of e.seen.entries()){const L=a[1];L.def&&L.defId&&(o[L.defId]=L.def)}e.external||Object.keys(o).length>0&&(e.target==="draft-2020-12"?u.$defs=o:u.definitions=o);try{const a=JSON.parse(JSON.stringify(u));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:Pe(t,"input",e.processors),output:Pe(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch{throw new Error("Error converting schema to JSON.")}}function U(e,t){const r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);const n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return U(n.element,r);if(n.type==="set")return U(n.valueType,r);if(n.type==="lazy")return U(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return U(n.innerType,r);if(n.type==="intersection")return U(n.left,r)||U(n.right,r);if(n.type==="record"||n.type==="map")return U(n.keyType,r)||U(n.valueType,r);if(n.type==="pipe")return U(n.in,r)||U(n.out,r);if(n.type==="object"){for(const u in n.shape)if(U(n.shape[u],r))return!0;return!1}if(n.type==="union"){for(const u of n.options)if(U(u,r))return!0;return!1}if(n.type==="tuple"){for(const u of n.items)if(U(u,r))return!0;return!!(n.rest&&U(n.rest,r))}return!1}const Ji=(e,t={})=>r=>{const n=ke({...r,processors:t});return O(e,n),Ze(n,e),$e(n,e)},Pe=(e,t,r={})=>n=>{const{libraryOptions:u,target:o}=n??{},i=ke({...u??{},target:o,io:t,processors:r});return O(e,i),Ze(i,e),$e(i,e)},Vi={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},pr=(e,t,r,n)=>{const u=r;u.type="string";const{minimum:o,maximum:i,format:s,patterns:c,contentEncoding:a}=e._zod.bag;if(typeof o=="number"&&(u.minLength=o),typeof i=="number"&&(u.maxLength=i),s&&(u.format=Vi[s]??s,u.format===""&&delete u.format,s==="time"&&delete u.format),a&&(u.contentEncoding=a),c&&c.size>0){const L=[...c];L.length===1?u.pattern=L[0].source:L.length>1&&(u.allOf=[...L.map(l=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:l.source}))])}},yr=(e,t,r,n)=>{const u=r,{minimum:o,maximum:i,format:s,multipleOf:c,exclusiveMaximum:a,exclusiveMinimum:L}=e._zod.bag;typeof s=="string"&&s.includes("int")?u.type="integer":u.type="number",typeof L=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(u.minimum=L,u.exclusiveMinimum=!0):u.exclusiveMinimum=L),typeof o=="number"&&(u.minimum=o,typeof L=="number"&&t.target!=="draft-04"&&(L>=o?delete u.minimum:delete u.exclusiveMinimum)),typeof a=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(u.maximum=a,u.exclusiveMaximum=!0):u.exclusiveMaximum=a),typeof i=="number"&&(u.maximum=i,typeof a=="number"&&t.target!=="draft-04"&&(a<=i?delete u.maximum:delete u.exclusiveMaximum)),typeof c=="number"&&(u.multipleOf=c)},fr=(e,t,r,n)=>{r.type="boolean"},Bi=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},Wi=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},gr=(e,t,r,n)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},Gi=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},qi=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},mr=(e,t,r,n)=>{r.not={}},Hi=(e,t,r,n)=>{},hr=(e,t,r,n)=>{},Xi=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},Ir=(e,t,r,n)=>{const u=e._zod.def,o=wt(u.entries);o.every(i=>typeof i=="number")&&(r.type="number"),o.every(i=>typeof i=="string")&&(r.type="string"),r.enum=o},Er=(e,t,r,n)=>{const u=e._zod.def,o=[];for(const i of u.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");o.push(Number(i))}else o.push(i);if(o.length!==0)if(o.length===1){const i=o[0];r.type=i===null?"null":typeof i,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[i]:r.const=i}else o.every(i=>typeof i=="number")&&(r.type="number"),o.every(i=>typeof i=="string")&&(r.type="string"),o.every(i=>typeof i=="boolean")&&(r.type="boolean"),o.every(i=>i===null)&&(r.type="null"),r.enum=o},Ki=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},es=(e,t,r,n)=>{const u=r,o=e._zod.pattern;if(!o)throw new Error("Pattern not found in template literal");u.type="string",u.pattern=o.source},ts=(e,t,r,n)=>{const u=r,o={type:"string",format:"binary",contentEncoding:"binary"},{minimum:i,maximum:s,mime:c}=e._zod.bag;i!==void 0&&(o.minLength=i),s!==void 0&&(o.maxLength=s),c?c.length===1?(o.contentMediaType=c[0],Object.assign(u,o)):(Object.assign(u,o),u.anyOf=c.map(a=>({contentMediaType:a}))):Object.assign(u,o)},rs=(e,t,r,n)=>{r.type="boolean"},Nr=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},ns=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},xr=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},us=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},os=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},vr=(e,t,r,n)=>{const u=r,o=e._zod.def,{minimum:i,maximum:s}=e._zod.bag;typeof i=="number"&&(u.minItems=i),typeof s=="number"&&(u.maxItems=s),u.type="array",u.items=O(o.element,t,{...n,path:[...n.path,"items"]})},_r=(e,t,r,n)=>{var a;const u=r,o=e._zod.def;u.type="object",u.properties={};const i=o.shape;for(const L in i)u.properties[L]=O(i[L],t,{...n,path:[...n.path,"properties",L]});const s=new Set(Object.keys(i)),c=new Set([...s].filter(L=>{const l=o.shape[L]._zod;return t.io==="input"?l.optin===void 0:l.optout===void 0}));c.size>0&&(u.required=Array.from(c)),((a=o.catchall)==null?void 0:a._zod.def.type)==="never"?u.additionalProperties=!1:o.catchall?o.catchall&&(u.additionalProperties=O(o.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):t.io==="output"&&(u.additionalProperties=!1)},Ar=(e,t,r,n)=>{const u=e._zod.def,o=u.inclusive===!1,i=u.options.map((s,c)=>O(s,t,{...n,path:[...n.path,o?"oneOf":"anyOf",c]}));o?r.oneOf=i:r.anyOf=i},Cr=(e,t,r,n)=>{const u=e._zod.def,o=O(u.left,t,{...n,path:[...n.path,"allOf",0]}),i=O(u.right,t,{...n,path:[...n.path,"allOf",1]}),s=a=>"allOf"in a&&Object.keys(a).length===1,c=[...s(o)?o.allOf:[o],...s(i)?i.allOf:[i]];r.allOf=c},is=(e,t,r,n)=>{const u=r,o=e._zod.def;u.type="array";const i=t.target==="draft-2020-12"?"prefixItems":"items",s=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",c=o.items.map((f,d)=>O(f,t,{...n,path:[...n.path,i,d]})),a=o.rest?O(o.rest,t,{...n,path:[...n.path,s,...t.target==="openapi-3.0"?[o.items.length]:[]]}):null;t.target==="draft-2020-12"?(u.prefixItems=c,a&&(u.items=a)):t.target==="openapi-3.0"?(u.items={anyOf:c},a&&u.items.anyOf.push(a),u.minItems=c.length,a||(u.maxItems=c.length)):(u.items=c,a&&(u.additionalItems=a));const{minimum:L,maximum:l}=e._zod.bag;typeof L=="number"&&(u.minItems=L),typeof l=="number"&&(u.maxItems=l)},br=(e,t,r,n)=>{const u=r,o=e._zod.def;u.type="object";const i=o.keyType,s=i._zod.bag,c=s==null?void 0:s.patterns;if(o.mode==="loose"&&c&&c.size>0){const L=O(o.valueType,t,{...n,path:[...n.path,"patternProperties","*"]});u.patternProperties={};for(const l of c)u.patternProperties[l.source]=L}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(u.propertyNames=O(o.keyType,t,{...n,path:[...n.path,"propertyNames"]})),u.additionalProperties=O(o.valueType,t,{...n,path:[...n.path,"additionalProperties"]});const a=i._zod.values;if(a){const L=[...a].filter(l=>typeof l=="string"||typeof l=="number");L.length>0&&(u.required=L)}},zr=(e,t,r,n)=>{const u=e._zod.def,o=O(u.innerType,t,n),i=t.seen.get(e);t.target==="openapi-3.0"?(i.ref=u.innerType,r.nullable=!0):r.anyOf=[o,{type:"null"}]},Tr=(e,t,r,n)=>{const u=e._zod.def;O(u.innerType,t,n);const o=t.seen.get(e);o.ref=u.innerType},wr=(e,t,r,n)=>{const u=e._zod.def;O(u.innerType,t,n);const o=t.seen.get(e);o.ref=u.innerType,r.default=JSON.parse(JSON.stringify(u.defaultValue))},Or=(e,t,r,n)=>{const u=e._zod.def;O(u.innerType,t,n);const o=t.seen.get(e);o.ref=u.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(u.defaultValue)))},Dr=(e,t,r,n)=>{const u=e._zod.def;O(u.innerType,t,n);const o=t.seen.get(e);o.ref=u.innerType;let i;try{i=u.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=i},kr=(e,t,r,n)=>{const u=e._zod.def,o=t.io==="input"?u.in._zod.def.type==="transform"?u.out:u.in:u.out;O(o,t,n);const i=t.seen.get(e);i.ref=o},Zr=(e,t,r,n)=>{const u=e._zod.def;O(u.innerType,t,n);const o=t.seen.get(e);o.ref=u.innerType,r.readOnly=!0},ss=(e,t,r,n)=>{const u=e._zod.def;O(u.innerType,t,n);const o=t.seen.get(e);o.ref=u.innerType},rt=(e,t,r,n)=>{const u=e._zod.def;O(u.innerType,t,n);const o=t.seen.get(e);o.ref=u.innerType},$r=(e,t,r,n)=>{const u=e._zod.innerType;O(u,t,n);const o=t.seen.get(e);o.ref=u},Pr={string:pr,number:yr,boolean:fr,bigint:Bi,symbol:Wi,null:gr,undefined:Gi,void:qi,never:mr,any:Hi,unknown:hr,date:Xi,enum:Ir,literal:Er,nan:Ki,template_literal:es,file:ts,success:rs,custom:Nr,function:ns,transform:xr,map:us,set:os,array:vr,object:_r,union:Ar,intersection:Cr,tuple:is,record:br,nullable:zr,nonoptional:Tr,default:wr,prefault:Or,catch:Dr,pipe:kr,readonly:Zr,promise:ss,optional:rt,lazy:$r};function as(e,t){if("_idmap"in e){const n=e,u=ke({...t,processors:Pr}),o={};for(const c of n._idmap.entries()){const[a,L]=c;O(L,u)}const i={},s={registry:n,uri:t==null?void 0:t.uri,defs:o};u.external=s;for(const c of n._idmap.entries()){const[a,L]=c;Ze(u,L),i[a]=$e(u,L)}if(Object.keys(o).length>0){const c=u.target==="draft-2020-12"?"$defs":"definitions";i.__shared={[c]:o}}return{schemas:i}}const r=ke({...t,processors:Pr});return O(e,r),Ze(r,e),$e(r,e)}const cs=j("ZodISODateTime",(e,t)=>{Lo.init(e,t),P.init(e,t)});function Ls(e){return gi(cs,e)}const ls=j("ZodISODate",(e,t)=>{lo.init(e,t),P.init(e,t)});function js(e){return mi(ls,e)}const Ms=j("ZodISOTime",(e,t)=>{jo.init(e,t),P.init(e,t)});function ds(e){return hi(Ms,e)}const Ss=j("ZodISODuration",(e,t)=>{Mo.init(e,t),P.init(e,t)});function ps(e){return Ii(Ss,e)}const B=j("ZodError",(e,t)=>{Pt.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>ru(e,r)},flatten:{value:r=>tu(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,Ve,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,Ve,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),ys=qe(B),fs=He(B),gs=be(B),Ur=ze(B),ms=ou(B),hs=iu(B),Is=su(B),Es=au(B),Ns=cu(B),xs=Lu(B),vs=lu(B),_s=ju(B),k=j("ZodType",(e,t)=>(D.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:Pe(e,"input"),output:Pe(e,"output")}}),e.toJSONSchema=Ji(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(K(t,{checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0}),e.with=e.check,e.clone=(r,n)=>ee(e,r,n),e.brand=()=>e,e.register=(r,n)=>(r.add(e,n),e),e.parse=(r,n)=>ys(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>gs(e,r,n),e.parseAsync=async(r,n)=>fs(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>Ur(e,r,n),e.spa=e.safeParseAsync,e.encode=(r,n)=>ms(e,r,n),e.decode=(r,n)=>hs(e,r,n),e.encodeAsync=async(r,n)=>Is(e,r,n),e.decodeAsync=async(r,n)=>Es(e,r,n),e.safeEncode=(r,n)=>Ns(e,r,n),e.safeDecode=(r,n)=>xs(e,r,n),e.safeEncodeAsync=async(r,n)=>vs(e,r,n),e.safeDecodeAsync=async(r,n)=>_s(e,r,n),e.refine=(r,n)=>e.check(Ea(r,n)),e.superRefine=r=>e.check(Na(r)),e.overwrite=r=>e.check(Se(r)),e.optional=()=>qr(e),e.exactOptional=()=>ca(e),e.nullable=()=>Hr(e),e.nullish=()=>qr(Hr(e)),e.nonoptional=r=>Sa(e,r),e.array=()=>pe(e),e.or=r=>R([e,r]),e.and=r=>na(e,r),e.transform=r=>Kr(e,sa(r)),e.default=r=>ja(e,r),e.prefault=r=>da(e,r),e.catch=r=>ya(e,r),e.pipe=r=>Kr(e,r),e.readonly=()=>ma(e),e.describe=r=>{const n=e.clone();return me.add(n,{description:r}),n},Object.defineProperty(e,"description",{get(){var r;return(r=me.get(e))==null?void 0:r.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return me.get(e);const n=e.clone();return me.add(n,r[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=r=>r(e),e)),Yr=j("_ZodString",(e,t)=>{Xe.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,u,o)=>pr(e,n,u);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...n)=>e.check(Ci(...n)),e.includes=(...n)=>e.check(Ti(...n)),e.startsWith=(...n)=>e.check(wi(...n)),e.endsWith=(...n)=>e.check(Oi(...n)),e.min=(...n)=>e.check(De(...n)),e.max=(...n)=>e.check(dr(...n)),e.length=(...n)=>e.check(Sr(...n)),e.nonempty=(...n)=>e.check(De(1,...n)),e.lowercase=n=>e.check(bi(n)),e.uppercase=n=>e.check(zi(n)),e.trim=()=>e.check(ki()),e.normalize=(...n)=>e.check(Di(...n)),e.toLowerCase=()=>e.check(Zi()),e.toUpperCase=()=>e.check($i()),e.slugify=()=>e.check(Pi())}),As=j("ZodString",(e,t)=>{Xe.init(e,t),Yr.init(e,t),e.email=r=>e.check(Xo(Cs,r)),e.url=r=>e.check(ni(bs,r)),e.jwt=r=>e.check(fi(Js,r)),e.emoji=r=>e.check(ui(zs,r)),e.guid=r=>e.check(Lr(Rr,r)),e.uuid=r=>e.check(Ko(Ue,r)),e.uuidv4=r=>e.check(ei(Ue,r)),e.uuidv6=r=>e.check(ti(Ue,r)),e.uuidv7=r=>e.check(ri(Ue,r)),e.nanoid=r=>e.check(oi(Ts,r)),e.guid=r=>e.check(Lr(Rr,r)),e.cuid=r=>e.check(ii(ws,r)),e.cuid2=r=>e.check(si(Os,r)),e.ulid=r=>e.check(ai(Ds,r)),e.base64=r=>e.check(Si(Rs,r)),e.base64url=r=>e.check(pi(Qs,r)),e.xid=r=>e.check(ci(ks,r)),e.ksuid=r=>e.check(Li(Zs,r)),e.ipv4=r=>e.check(li($s,r)),e.ipv6=r=>e.check(ji(Ps,r)),e.cidrv4=r=>e.check(Mi(Us,r)),e.cidrv6=r=>e.check(di(Ys,r)),e.e164=r=>e.check(yi(Fs,r)),e.datetime=r=>e.check(Ls(r)),e.date=r=>e.check(js(r)),e.time=r=>e.check(ds(r)),e.duration=r=>e.check(ps(r))});function y(e){return Ho(As,e)}const P=j("ZodStringFormat",(e,t)=>{$.init(e,t),Yr.init(e,t)}),Cs=j("ZodEmail",(e,t)=>{to.init(e,t),P.init(e,t)}),Rr=j("ZodGUID",(e,t)=>{Ku.init(e,t),P.init(e,t)}),Ue=j("ZodUUID",(e,t)=>{eo.init(e,t),P.init(e,t)}),bs=j("ZodURL",(e,t)=>{ro.init(e,t),P.init(e,t)}),zs=j("ZodEmoji",(e,t)=>{no.init(e,t),P.init(e,t)}),Ts=j("ZodNanoID",(e,t)=>{uo.init(e,t),P.init(e,t)}),ws=j("ZodCUID",(e,t)=>{oo.init(e,t),P.init(e,t)}),Os=j("ZodCUID2",(e,t)=>{io.init(e,t),P.init(e,t)}),Ds=j("ZodULID",(e,t)=>{so.init(e,t),P.init(e,t)}),ks=j("ZodXID",(e,t)=>{ao.init(e,t),P.init(e,t)}),Zs=j("ZodKSUID",(e,t)=>{co.init(e,t),P.init(e,t)}),$s=j("ZodIPv4",(e,t)=>{So.init(e,t),P.init(e,t)}),Ps=j("ZodIPv6",(e,t)=>{po.init(e,t),P.init(e,t)}),Us=j("ZodCIDRv4",(e,t)=>{yo.init(e,t),P.init(e,t)}),Ys=j("ZodCIDRv6",(e,t)=>{fo.init(e,t),P.init(e,t)}),Rs=j("ZodBase64",(e,t)=>{go.init(e,t),P.init(e,t)}),Qs=j("ZodBase64URL",(e,t)=>{ho.init(e,t),P.init(e,t)}),Fs=j("ZodE164",(e,t)=>{Io.init(e,t),P.init(e,t)}),Js=j("ZodJWT",(e,t)=>{No.init(e,t),P.init(e,t)}),Qr=j("ZodNumber",(e,t)=>{qt.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,u,o)=>yr(e,n,u),e.gt=(n,u)=>e.check(jr(n,u)),e.gte=(n,u)=>e.check(tt(n,u)),e.min=(n,u)=>e.check(tt(n,u)),e.lt=(n,u)=>e.check(lr(n,u)),e.lte=(n,u)=>e.check(et(n,u)),e.max=(n,u)=>e.check(et(n,u)),e.int=n=>e.check(Fr(n)),e.safe=n=>e.check(Fr(n)),e.positive=n=>e.check(jr(0,n)),e.nonnegative=n=>e.check(tt(0,n)),e.negative=n=>e.check(lr(0,n)),e.nonpositive=n=>e.check(et(0,n)),e.multipleOf=(n,u)=>e.check(Mr(n,u)),e.step=(n,u)=>e.check(Mr(n,u)),e.finite=()=>e;const r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function Vs(e){return Ei(Qr,e)}const Bs=j("ZodNumberFormat",(e,t)=>{xo.init(e,t),Qr.init(e,t)});function Fr(e){return Ni(Bs,e)}const Ws=j("ZodBoolean",(e,t)=>{vo.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,n,u)=>fr(e,r,n)});function Y(e){return xi(Ws,e)}const Gs=j("ZodNull",(e,t)=>{_o.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,n,u)=>gr(e,r,n)});function qs(e){return vi(Gs,e)}const Hs=j("ZodUnknown",(e,t)=>{Ao.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,n,u)=>hr()});function H(){return _i(Hs)}const Xs=j("ZodNever",(e,t)=>{Co.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,n,u)=>mr(e,r,n)});function Jr(e){return Ai(Xs,e)}const Ks=j("ZodArray",(e,t)=>{bo.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,n,u)=>vr(e,r,n,u),e.element=t.element,e.min=(r,n)=>e.check(De(r,n)),e.nonempty=r=>e.check(De(1,r)),e.max=(r,n)=>e.check(dr(r,n)),e.length=(r,n)=>e.check(Sr(r,n)),e.unwrap=()=>e.element});function pe(e,t){return Ui(Ks,e,t)}const Vr=j("ZodObject",(e,t)=>{To.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,n,u)=>_r(e,r,n,u),_(e,"shape",()=>t.shape),e.keyof=()=>Wr(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:H()}),e.loose=()=>e.clone({...e._zod.def,catchall:H()}),e.strict=()=>e.clone({...e._zod.def,catchall:Jr()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>qn(e,r),e.safeExtend=r=>Hn(e,r),e.merge=r=>Xn(e,r),e.pick=r=>Wn(e,r),e.omit=r=>Gn(e,r),e.partial=(...r)=>Kn(Gr,e,r[0]),e.required=(...r)=>eu(Xr,e,r[0])});function T(e,t){const r={type:"object",shape:e??{},...m(t)};return new Vr(r)}function Z(e,t){return new Vr({type:"object",shape:e,catchall:Jr(),...m(t)})}const Br=j("ZodUnion",(e,t)=>{tr.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,n,u)=>Ar(e,r,n,u),e.options=t.options});function R(e,t){return new Br({type:"union",options:e,...m(t)})}const ea=j("ZodDiscriminatedUnion",(e,t)=>{Br.init(e,t),wo.init(e,t)});function ta(e,t,r){return new ea({type:"union",options:t,discriminator:e,...m(r)})}const ra=j("ZodIntersection",(e,t)=>{Oo.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,n,u)=>Cr(e,r,n,u)});function na(e,t){return new ra({type:"intersection",left:e,right:t})}const ua=j("ZodRecord",(e,t)=>{Do.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,n,u)=>br(e,r,n,u),e.keyType=t.keyType,e.valueType=t.valueType});function he(e,t,r){return new ua({type:"record",keyType:e,valueType:t,...m(r)})}const nt=j("ZodEnum",(e,t)=>{ko.init(e,t),k.init(e,t),e._zod.processJSONSchema=(n,u,o)=>Ir(e,n,u),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(n,u)=>{const o={};for(const i of n)if(r.has(i))o[i]=t.entries[i];else throw new Error(`Key ${i} not found in enum`);return new nt({...t,checks:[],...m(u),entries:o})},e.exclude=(n,u)=>{const o={...t.entries};for(const i of n)if(r.has(i))delete o[i];else throw new Error(`Key ${i} not found in enum`);return new nt({...t,checks:[],...m(u),entries:o})}});function Wr(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new nt({type:"enum",entries:r,...m(t)})}const oa=j("ZodLiteral",(e,t)=>{Zo.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,n,u)=>Er(e,r,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function h(e,t){return new oa({type:"literal",values:Array.isArray(e)?e:[e],...m(t)})}const ia=j("ZodTransform",(e,t)=>{$o.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,n,u)=>xr(e,r),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Tt(e.constructor.name);r.addIssue=o=>{if(typeof o=="string")r.issues.push(ge(o,r.value,t));else{const i=o;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=r.value),i.inst??(i.inst=e),r.issues.push(ge(i))}};const u=t.transform(r.value,r);return u instanceof Promise?u.then(o=>(r.value=o,r)):(r.value=u,r)}});function sa(e){return new ia({type:"transform",transform:e})}const Gr=j("ZodOptional",(e,t)=>{ur.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,n,u)=>rt(e,r,n,u),e.unwrap=()=>e._zod.def.innerType});function qr(e){return new Gr({type:"optional",innerType:e})}const aa=j("ZodExactOptional",(e,t)=>{Po.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,n,u)=>rt(e,r,n,u),e.unwrap=()=>e._zod.def.innerType});function ca(e){return new aa({type:"optional",innerType:e})}const La=j("ZodNullable",(e,t)=>{Uo.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,n,u)=>zr(e,r,n,u),e.unwrap=()=>e._zod.def.innerType});function Hr(e){return new La({type:"nullable",innerType:e})}const la=j("ZodDefault",(e,t)=>{Yo.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,n,u)=>wr(e,r,n,u),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function ja(e,t){return new la({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Zt(t)}})}const Ma=j("ZodPrefault",(e,t)=>{Ro.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,n,u)=>Or(e,r,n,u),e.unwrap=()=>e._zod.def.innerType});function da(e,t){return new Ma({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Zt(t)}})}const Xr=j("ZodNonOptional",(e,t)=>{Qo.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,n,u)=>Tr(e,r,n,u),e.unwrap=()=>e._zod.def.innerType});function Sa(e,t){return new Xr({type:"nonoptional",innerType:e,...m(t)})}const pa=j("ZodCatch",(e,t)=>{Fo.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,n,u)=>Dr(e,r,n,u),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function ya(e,t){return new pa({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const fa=j("ZodPipe",(e,t)=>{Jo.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,n,u)=>kr(e,r,n,u),e.in=t.in,e.out=t.out});function Kr(e,t){return new fa({type:"pipe",in:e,out:t})}const ga=j("ZodReadonly",(e,t)=>{Vo.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,n,u)=>Zr(e,r,n,u),e.unwrap=()=>e._zod.def.innerType});function ma(e){return new ga({type:"readonly",innerType:e})}const ha=j("ZodLazy",(e,t)=>{Bo.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,n,u)=>$r(e,r,n,u),e.unwrap=()=>e._zod.def.getter()});function Ia(e){return new ha({type:"lazy",getter:e})}const ut=j("ZodCustom",(e,t)=>{Wo.init(e,t),k.init(e,t),e._zod.processJSONSchema=(r,n,u)=>Nr(e,r)});function en(e,t){return Yi(ut,e??(()=>!0),t)}function Ea(e,t={}){return Ri(ut,e,t)}function Na(e){return Qi(e)}function Ye(e,t={}){const r=new ut({type:"custom",check:"custom",fn:n=>n instanceof e,abort:!0,...m(t)});return r._zod.bag.Class=e,r._zod.check=n=>{n.value instanceof e||n.issues.push({code:"invalid_type",expected:e.name,input:n.value,inst:r,path:[...r._zod.def.path??[]]})},r}var Ie;(function(e){e.assertEqual=u=>{};function t(u){}e.assertIs=t;function r(u){throw new Error}e.assertNever=r,e.arrayToEnum=u=>{const o={};for(const i of u)o[i]=i;return o},e.getValidEnumValues=u=>{const o=e.objectKeys(u).filter(s=>typeof u[u[s]]!="number"),i={};for(const s of o)i[s]=u[s];return e.objectValues(i)},e.objectValues=u=>e.objectKeys(u).map(function(o){return u[o]}),e.objectKeys=typeof Object.keys=="function"?u=>Object.keys(u):u=>{const o=[];for(const i in u)Object.prototype.hasOwnProperty.call(u,i)&&o.push(i);return o},e.find=(u,o)=>{for(const i of u)if(o(i))return i},e.isInteger=typeof Number.isInteger=="function"?u=>Number.isInteger(u):u=>typeof u=="number"&&Number.isFinite(u)&&Math.floor(u)===u;function n(u,o=" | "){return u.map(i=>typeof i=="string"?`'${i}'`:i).join(o)}e.joinValues=n,e.jsonStringifyReplacer=(u,o)=>typeof o=="bigint"?o.toString():o})(Ie||(Ie={}));var tn;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(tn||(tn={})),Ie.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ie.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"]);class Re extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){const r=t||function(o){return o.message},n={_errors:[]},u=o=>{for(const i of o.issues)if(i.code==="invalid_union")i.unionErrors.map(u);else if(i.code==="invalid_return_type")u(i.returnTypeError);else if(i.code==="invalid_arguments")u(i.argumentsError);else if(i.path.length===0)n._errors.push(r(i));else{let s=n,c=0;for(;c<i.path.length;){const a=i.path[c];c===i.path.length-1?(s[a]=s[a]||{_errors:[]},s[a]._errors.push(r(i))):s[a]=s[a]||{_errors:[]},s=s[a],c++}}};return u(this),n}static assert(t){if(!(t instanceof Re))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ie.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){const r=Object.create(null),n=[];for(const u of this.issues)if(u.path.length>0){const o=u.path[0];r[o]=r[o]||[],r[o].push(t(u))}else n.push(t(u));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}Re.create=e=>new Re(e);var rn;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(rn||(rn={}));var 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={}));class nn extends Error{constructor(t,r){super(t),this.name="ParseError",this.type=r.type,this.field=r.field,this.value=r.value,this.line=r.line}}function ot(e){}function xa(e){if(typeof e=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:t=ot,onError:r=ot,onRetry:n=ot,onComment:u}=e;let o="",i=!0,s,c="",a="";function L(p){const g=i?p.replace(/^\xEF\xBB\xBF/,""):p,[N,x]=va(`${o}${g}`);for(const M of N)l(M);o=x,i=!1}function l(p){if(p===""){d();return}if(p.startsWith(":")){u&&u(p.slice(p.startsWith(": ")?2:1));return}const g=p.indexOf(":");if(g!==-1){const N=p.slice(0,g),x=p[g+1]===" "?2:1,M=p.slice(g+x);f(N,M,p);return}f(p,"",p)}function f(p,g,N){switch(p){case"event":a=g;break;case"data":c=`${c}${g}
42
- `;break;case"id":s=g.includes("\0")?void 0:g;break;case"retry":/^\d+$/.test(g)?n(parseInt(g,10)):r(new nn(`Invalid \`retry\` value: "${g}"`,{type:"invalid-retry",value:g,line:N}));break;default:r(new nn(`Unknown field "${p.length>20?`${p.slice(0,20)}…`:p}"`,{type:"unknown-field",field:p,value:g,line:N}));break}}function d(){c.length>0&&t({id:s,event:a||void 0,data:c.endsWith(`
43
- `)?c.slice(0,-1):c}),s=void 0,c="",a=""}function I(p={}){o&&p.consume&&l(o),i=!0,s=void 0,c="",a="",o=""}return{feed:L,reset:I}}function va(e){const t=[];let r="",n=0;for(;n<e.length;){const u=e.indexOf("\r",n),o=e.indexOf(`
44
- `,n);let i=-1;if(u!==-1&&o!==-1?i=Math.min(u,o):u!==-1?u===e.length-1?i=-1:i=u:o!==-1&&(i=o),i===-1){r=e.slice(n);break}else{const s=e.slice(n,i);t.push(s),n=i+1,e[n-1]==="\r"&&e[n]===`
45
- `&&n++}}return[t,r]}class _a extends TransformStream{constructor({onError:t,onRetry:r,onComment:n}={}){let u;super({start(o){u=xa({onEvent:i=>{o.enqueue(i)},onError(i){t==="terminate"?o.error(i):typeof t=="function"&&t(i)},onRetry:r,onComment:n})},transform(o){u.feed(o)}})}}var Ee=({prefix:e,size:t=16,alphabet:r="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:n="-"}={})=>{const u=()=>{const o=r.length,i=new Array(t);for(let s=0;s<t;s++)i[s]=r[Math.random()*o|0];return i.join("")};if(e==null)return u;if(r.includes(n))throw new Pn({argument:"separator",message:`The separator "${n}" must not be part of the alphabet "${r}".`});return()=>`${e}${n}${u()}`},Aa=Ee();function un(e=globalThis){var t,r,n;return e.window?"runtime/browser":(t=e.navigator)!=null&&t.userAgent?`runtime/${e.navigator.userAgent.toLowerCase()}`:(n=(r=e.process)==null?void 0:r.versions)!=null&&n.node?`runtime/node.js/${e.process.version.substring(0)}`:e.EdgeRuntime?"runtime/vercel-edge":"runtime/unknown"}function ie(e){if(e==null)return{};const t={};if(e instanceof Headers)e.forEach((r,n)=>{t[n.toLowerCase()]=r});else{Array.isArray(e)||(e=Object.entries(e));for(const[r,n]of e)n!=null&&(t[r.toLowerCase()]=n)}return t}function on(e,...t){const r=new Headers(ie(e)),n=r.get("user-agent")||"";return r.set("user-agent",[n,...t].filter(Boolean).join(" ")),Object.fromEntries(r.entries())}var Ca=/"__proto__"\s*:/,ba=/"constructor"\s*:/;function sn(e){const t=JSON.parse(e);return t===null||typeof t!="object"||Ca.test(e)===!1&&ba.test(e)===!1?t:za(t)}function za(e){let t=[e];for(;t.length;){const r=t;t=[];for(const n of r){if(Object.prototype.hasOwnProperty.call(n,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(n,"constructor")&&Object.prototype.hasOwnProperty.call(n.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(const u in n){const o=n[u];o&&typeof o=="object"&&t.push(o)}}}return e}function Ta(e){const{stackTraceLimit:t}=Error;try{Error.stackTraceLimit=0}catch{return sn(e)}try{return sn(e)}finally{Error.stackTraceLimit=t}}function it(e){if(e.type==="object"||Array.isArray(e.type)&&e.type.includes("object")){e.additionalProperties=!1;const{properties:r}=e;if(r!=null)for(const n of Object.keys(r))r[n]=se(r[n])}e.items!=null&&(e.items=Array.isArray(e.items)?e.items.map(se):se(e.items)),e.anyOf!=null&&(e.anyOf=e.anyOf.map(se)),e.allOf!=null&&(e.allOf=e.allOf.map(se)),e.oneOf!=null&&(e.oneOf=e.oneOf.map(se));const{definitions:t}=e;if(t!=null)for(const r of Object.keys(t))t[r]=se(t[r]);return e}function se(e){return typeof e=="boolean"?e:it(e)}var wa=Symbol("Let zodToJsonSchema decide on which parser to use"),an={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"},Oa=e=>typeof e=="string"?{...an,name:e}:{...an,...e};function V(){return{}}function Da(e,t){var r,n,u;const o={type:"array"};return(r=e.type)!=null&&r._def&&((u=(n=e.type)==null?void 0:n._def)==null?void 0:u.typeName)!==E.ZodAny&&(o.items=b(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&(o.minItems=e.minLength.value),e.maxLength&&(o.maxItems=e.maxLength.value),e.exactLength&&(o.minItems=e.exactLength.value,o.maxItems=e.exactLength.value),o}function ka(e){const t={type:"integer",format:"int64"};if(!e.checks)return t;for(const r of e.checks)switch(r.kind){case"min":r.inclusive?t.minimum=r.value:t.exclusiveMinimum=r.value;break;case"max":r.inclusive?t.maximum=r.value:t.exclusiveMaximum=r.value;break;case"multipleOf":t.multipleOf=r.value;break}return t}function Za(){return{type:"boolean"}}function cn(e,t){return b(e.type._def,t)}var $a=(e,t)=>b(e.innerType._def,t);function Ln(e,t,r){const n=r??t.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((u,o)=>Ln(e,t,u))};switch(n){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return Pa(e)}}var Pa=e=>{const t={type:"integer",format:"unix-time"};for(const r of e.checks)switch(r.kind){case"min":t.minimum=r.value;break;case"max":t.maximum=r.value;break}return t};function Ua(e,t){return{...b(e.innerType._def,t),default:e.defaultValue()}}function Ya(e,t){return t.effectStrategy==="input"?b(e.schema._def,t):V()}function Ra(e){return{type:"string",enum:Array.from(e.values)}}var Qa=e=>"type"in e&&e.type==="string"?!1:"allOf"in e;function Fa(e,t){const r=[b(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),b(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(u=>!!u),n=[];return r.forEach(u=>{if(Qa(u))n.push(...u.allOf);else{let o=u;if("additionalProperties"in u&&u.additionalProperties===!1){const{additionalProperties:i,...s}=u;o=s}n.push(o)}}),n.length?{allOf:n}:void 0}function Ja(e){const 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 st=void 0,W={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:()=>(st===void 0&&(st=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),st),uuid:/^[0-9a-fA-F]{8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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 ln(e,t){const r={type:"string"};if(e.checks)for(const n of e.checks)switch(n.kind){case"min":r.minLength=typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value;break;case"max":r.maxLength=typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value;break;case"email":switch(t.emailStrategy){case"format:email":G(r,"email",n.message,t);break;case"format:idn-email":G(r,"idn-email",n.message,t);break;case"pattern:zod":Q(r,W.email,n.message,t);break}break;case"url":G(r,"uri",n.message,t);break;case"uuid":G(r,"uuid",n.message,t);break;case"regex":Q(r,n.regex,n.message,t);break;case"cuid":Q(r,W.cuid,n.message,t);break;case"cuid2":Q(r,W.cuid2,n.message,t);break;case"startsWith":Q(r,RegExp(`^${at(n.value,t)}`),n.message,t);break;case"endsWith":Q(r,RegExp(`${at(n.value,t)}$`),n.message,t);break;case"datetime":G(r,"date-time",n.message,t);break;case"date":G(r,"date",n.message,t);break;case"time":G(r,"time",n.message,t);break;case"duration":G(r,"duration",n.message,t);break;case"length":r.minLength=typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,r.maxLength=typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value;break;case"includes":{Q(r,RegExp(at(n.value,t)),n.message,t);break}case"ip":{n.version!=="v6"&&G(r,"ipv4",n.message,t),n.version!=="v4"&&G(r,"ipv6",n.message,t);break}case"base64url":Q(r,W.base64url,n.message,t);break;case"jwt":Q(r,W.jwt,n.message,t);break;case"cidr":{n.version!=="v6"&&Q(r,W.ipv4Cidr,n.message,t),n.version!=="v4"&&Q(r,W.ipv6Cidr,n.message,t);break}case"emoji":Q(r,W.emoji(),n.message,t);break;case"ulid":{Q(r,W.ulid,n.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{G(r,"binary",n.message,t);break}case"contentEncoding:base64":{r.contentEncoding="base64";break}case"pattern:zod":{Q(r,W.base64,n.message,t);break}}break}case"nanoid":Q(r,W.nanoid,n.message,t)}return r}function at(e,t){return t.patternStrategy==="escape"?Ba(e):e}var Va=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function Ba(e){let t="";for(let r=0;r<e.length;r++)Va.has(e[r])||(t+="\\"),t+=e[r];return t}function G(e,t,r,n){var u;e.format||(u=e.anyOf)!=null&&u.some(o=>o.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format}),delete e.format),e.anyOf.push({format:t,...r&&n.errorMessages&&{errorMessage:{format:r}}})):e.format=t}function Q(e,t,r,n){var u;e.pattern||(u=e.allOf)!=null&&u.some(o=>o.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern}),delete e.pattern),e.allOf.push({pattern:jn(t,n),...r&&n.errorMessages&&{errorMessage:{pattern:r}}})):e.pattern=jn(t,n)}function jn(e,t){var r;if(!t.applyRegexFlags||!e.flags)return e.source;const n={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},u=n.i?e.source.toLowerCase():e.source;let o="",i=!1,s=!1,c=!1;for(let a=0;a<u.length;a++){if(i){o+=u[a],i=!1;continue}if(n.i){if(s){if(u[a].match(/[a-z]/)){c?(o+=u[a],o+=`${u[a-2]}-${u[a]}`.toUpperCase(),c=!1):u[a+1]==="-"&&((r=u[a+2])!=null&&r.match(/[a-z]/))?(o+=u[a],c=!0):o+=`${u[a]}${u[a].toUpperCase()}`;continue}}else if(u[a].match(/[a-z]/)){o+=`[${u[a]}${u[a].toUpperCase()}]`;continue}}if(n.m){if(u[a]==="^"){o+=`(^|(?<=[\r
46
- ]))`;continue}else if(u[a]==="$"){o+=`($|(?=[\r
47
- ]))`;continue}}if(n.s&&u[a]==="."){o+=s?`${u[a]}\r
48
- `:`[${u[a]}\r
49
- ]`;continue}o+=u[a],u[a]==="\\"?i=!0:s&&u[a]==="]"?s=!1:!s&&u[a]==="["&&(s=!0)}try{new RegExp(o)}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 o}function Mn(e,t){var r,n,u,o,i,s;const c={type:"object",additionalProperties:(r=b(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]}))!=null?r:t.allowedAdditionalProperties};if(((n=e.keyType)==null?void 0:n._def.typeName)===E.ZodString&&((u=e.keyType._def.checks)!=null&&u.length)){const{type:a,...L}=ln(e.keyType._def,t);return{...c,propertyNames:L}}else{if(((o=e.keyType)==null?void 0:o._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)){const{type:a,...L}=cn(e.keyType._def,t);return{...c,propertyNames:L}}}return c}function Wa(e,t){if(t.mapStrategy==="record")return Mn(e,t);const r=b(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||V(),n=b(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||V();return{type:"array",maxItems:125,items:{type:"array",items:[r,n],minItems:2,maxItems:2}}}function Ga(e){const t=e.values,n=Object.keys(e.values).filter(o=>typeof t[t[o]]!="number").map(o=>t[o]),u=Array.from(new Set(n.map(o=>typeof o)));return{type:u.length===1?u[0]==="string"?"string":"number":["string","number"],enum:n}}function qa(){return{not:V()}}function Ha(){return{type:"null"}}var ct={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function Xa(e,t){const r=e.options instanceof Map?Array.from(e.options.values()):e.options;if(r.every(n=>n._def.typeName in ct&&(!n._def.checks||!n._def.checks.length))){const n=r.reduce((u,o)=>{const i=ct[o._def.typeName];return i&&!u.includes(i)?[...u,i]:u},[]);return{type:n.length>1?n:n[0]}}else if(r.every(n=>n._def.typeName==="ZodLiteral"&&!n.description)){const n=r.reduce((u,o)=>{const i=typeof o._def.value;switch(i){case"string":case"number":case"boolean":return[...u,i];case"bigint":return[...u,"integer"];case"object":if(o._def.value===null)return[...u,"null"];case"symbol":case"undefined":case"function":default:return u}},[]);if(n.length===r.length){const u=n.filter((o,i,s)=>s.indexOf(o)===i);return{type:u.length>1?u:u[0],enum:r.reduce((o,i)=>o.includes(i._def.value)?o:[...o,i._def.value],[])}}}else if(r.every(n=>n._def.typeName==="ZodEnum"))return{type:"string",enum:r.reduce((n,u)=>[...n,...u._def.values.filter(o=>!n.includes(o))],[])};return Ka(e,t)}var Ka=(e,t)=>{const r=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((n,u)=>b(n._def,{...t,currentPath:[...t.currentPath,"anyOf",`${u}`]})).filter(n=>!!n&&(!t.strictUnions||typeof n=="object"&&Object.keys(n).length>0));return r.length?{anyOf:r}:void 0};function ec(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[ct[e.innerType._def.typeName],"null"]};const r=b(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return r&&{anyOf:[r,{type:"null"}]}}function tc(e){const t={type:"number"};if(!e.checks)return t;for(const r of e.checks)switch(r.kind){case"int":t.type="integer";break;case"min":r.inclusive?t.minimum=r.value:t.exclusiveMinimum=r.value;break;case"max":r.inclusive?t.maximum=r.value:t.exclusiveMaximum=r.value;break;case"multipleOf":t.multipleOf=r.value;break}return t}function rc(e,t){const r={type:"object",properties:{}},n=[],u=e.shape();for(const i in u){let s=u[i];if(s===void 0||s._def===void 0)continue;const c=uc(s),a=b(s._def,{...t,currentPath:[...t.currentPath,"properties",i],propertyPath:[...t.currentPath,"properties",i]});a!==void 0&&(r.properties[i]=a,c||n.push(i))}n.length&&(r.required=n);const o=nc(e,t);return o!==void 0&&(r.additionalProperties=o),r}function nc(e,t){if(e.catchall._def.typeName!=="ZodNever")return b(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 uc(e){try{return e.isOptional()}catch{return!0}}var oc=(e,t)=>{var r;if(t.currentPath.toString()===((r=t.propertyPath)==null?void 0:r.toString()))return b(e.innerType._def,t);const n=b(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return n?{anyOf:[{not:V()},n]}:V()},ic=(e,t)=>{if(t.pipeStrategy==="input")return b(e.in._def,t);if(t.pipeStrategy==="output")return b(e.out._def,t);const r=b(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),n=b(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",r?"1":"0"]});return{allOf:[r,n].filter(u=>u!==void 0)}};function sc(e,t){return b(e.type._def,t)}function ac(e,t){const n={type:"array",uniqueItems:!0,items:b(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&(n.minItems=e.minSize.value),e.maxSize&&(n.maxItems=e.maxSize.value),n}function cc(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((r,n)=>b(r._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[]),additionalItems:b(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((r,n)=>b(r._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[])}}function Lc(){return{not:V()}}function lc(){return V()}var jc=(e,t)=>b(e.innerType._def,t),Mc=(e,t,r)=>{switch(t){case E.ZodString:return ln(e,r);case E.ZodNumber:return tc(e);case E.ZodObject:return rc(e,r);case E.ZodBigInt:return ka(e);case E.ZodBoolean:return Za();case E.ZodDate:return Ln(e,r);case E.ZodUndefined:return Lc();case E.ZodNull:return Ha();case E.ZodArray:return Da(e,r);case E.ZodUnion:case E.ZodDiscriminatedUnion:return Xa(e,r);case E.ZodIntersection:return Fa(e,r);case E.ZodTuple:return cc(e,r);case E.ZodRecord:return Mn(e,r);case E.ZodLiteral:return Ja(e);case E.ZodEnum:return Ra(e);case E.ZodNativeEnum:return Ga(e);case E.ZodNullable:return ec(e,r);case E.ZodOptional:return oc(e,r);case E.ZodMap:return Wa(e,r);case E.ZodSet:return ac(e,r);case E.ZodLazy:return()=>e.getter()._def;case E.ZodPromise:return sc(e,r);case E.ZodNaN:case E.ZodNever:return qa();case E.ZodEffects:return Ya(e,r);case E.ZodAny:return V();case E.ZodUnknown:return lc();case E.ZodDefault:return Ua(e,r);case E.ZodBranded:return cn(e,r);case E.ZodReadonly:return jc(e,r);case E.ZodCatch:return $a(e,r);case E.ZodPipeline:return ic(e,r);case E.ZodFunction:case E.ZodVoid:case E.ZodSymbol:return;default:return(n=>{})()}},dc=(e,t)=>{let r=0;for(;r<e.length&&r<t.length&&e[r]===t[r];r++);return[(e.length-r).toString(),...t.slice(r)].join("/")};function b(e,t,r=!1){var n;const u=t.seen.get(e);if(t.override){const c=(n=t.override)==null?void 0:n.call(t,e,t,u,r);if(c!==wa)return c}if(u&&!r){const c=Sc(u,t);if(c!==void 0)return c}const o={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,o);const i=Mc(e,e.typeName,t),s=typeof i=="function"?b(i(),t):i;if(s&&pc(e,t,s),t.postProcess){const c=t.postProcess(s,e,t);return o.jsonSchema=s,c}return o.jsonSchema=s,s}var Sc=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:dc(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every((r,n)=>t.currentPath[n]===r)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),V()):t.$refStrategy==="seen"?V():void 0}},pc=(e,t,r)=>(e.description&&(r.description=e.description),r),yc=e=>{const t=Oa(e),r=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,currentPath:r,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([n,u])=>[u._def,{def:u._def,path:[...t.basePath,t.definitionPath,n],jsonSchema:void 0}]))}},fc=(e,t)=>{var r;const n=yc(t);let u=typeof t=="object"&&t.definitions?Object.entries(t.definitions).reduce((a,[L,l])=>{var f;return{...a,[L]:(f=b(l._def,{...n,currentPath:[...n.basePath,n.definitionPath,L]},!0))!=null?f:V()}},{}):void 0;const o=typeof t=="string"?t:(t==null?void 0:t.nameStrategy)==="title"||t==null?void 0:t.name,i=(r=b(e._def,o===void 0?n:{...n,currentPath:[...n.basePath,n.definitionPath,o]},!1))!=null?r:V(),s=typeof t=="object"&&t.name!==void 0&&t.nameStrategy==="title"?t.name:void 0;s!==void 0&&(i.title=s);const c=o===void 0?u?{...i,[n.definitionPath]:u}:i:{$ref:[...n.$refStrategy==="relative"?[]:n.basePath,n.definitionPath,o].join("/"),[n.definitionPath]:{...u,[o]:i}};return c.$schema="http://json-schema.org/draft-07/schema#",c},Lt=Symbol.for("vercel.ai.schema");function gc(e){let t;return()=>(t==null&&(t=e()),t)}function Qe(e,{validate:t}={}){return{[Lt]:!0,_type:void 0,get jsonSchema(){return typeof e=="function"&&(e=e()),e},validate:t}}function mc(e){return typeof e=="object"&&e!==null&&Lt in e&&e[Lt]===!0&&"jsonSchema"in e&&"validate"in e}function lt(e){return e==null?Qe({properties:{},additionalProperties:!1}):mc(e)?e:"~standard"in e?e["~standard"].vendor==="zod"?dn(e):hc(e):e()}function hc(e){return Qe(()=>it(e["~standard"].jsonSchema.input({target:"draft-07"})),{validate:async t=>{const r=await e["~standard"].validate(t);return"value"in r?{success:!0,value:r.value}:{success:!1,error:new ce({value:t,cause:r.issues})}}})}function Ic(e,t){var r;const n=(r=t==null?void 0:t.useReferences)!=null?r:!1;return Qe(()=>fc(e,{$refStrategy:n?"root":"none"}),{validate:async u=>{const o=await e.safeParseAsync(u);return o.success?{success:!0,value:o.data}:{success:!1,error:o.error}}})}function Ec(e,t){var r;const n=(r=t==null?void 0:t.useReferences)!=null?r:!1;return Qe(()=>it(as(e,{target:"draft-7",io:"input",reused:n?"ref":"inline"})),{validate:async u=>{const o=await Ur(e,u);return o.success?{success:!0,value:o.data}:{success:!1,error:o.error}}})}function Nc(e){return"_zod"in e}function dn(e,t){return Nc(e)?Ec(e,t):Ic(e,t)}async function Sn({value:e,schema:t}){const r=await Ne({value:e,schema:t});if(!r.success)throw ce.wrap({value:e,cause:r.error});return r.value}async function Ne({value:e,schema:t}){const r=lt(t);try{if(r.validate==null)return{success:!0,value:e,rawValue:e};const n=await r.validate(e);return n.success?{success:!0,value:n.value,rawValue:e}:{success:!1,error:ce.wrap({value:e,cause:n.error}),rawValue:e}}catch(n){return{success:!1,error:ce.wrap({value:e,cause:n}),rawValue:e}}}async function ae({text:e,schema:t}){try{const r=Ta(e);return t==null?{success:!0,value:r,rawValue:r}:await Ne({value:r,schema:t})}catch(r){return{success:!1,error:_t.isInstance(r)?r:new _t({text:e,cause:r}),rawValue:void 0}}}function xc({stream:e,schema:t}){return e.pipeThrough(new TextDecoderStream).pipeThrough(new _a).pipeThrough(new TransformStream({async transform({data:r},n){r!=="[DONE]"&&n.enqueue(await ae({text:r,schema:t}))}}))}async function re(e){return typeof e=="function"&&(e=e()),Promise.resolve(e)}var vc=Object.defineProperty,_c=(e,t)=>{for(var r in t)vc(e,r,{get:t[r],enumerable:!0})},pn="AI_NoObjectGeneratedError",yn=`vercel.ai.error.${pn}`,Ac=Symbol.for(yn),fn,ne=class extends q{constructor({message:e="No object generated.",cause:t,text:r,response:n,usage:u,finishReason:o}){super({name:pn,message:e,cause:t}),this[fn]=!0,this.text=r,this.response=n,this.usage=u,this.finishReason=o}static isInstance(e){return q.hasMarker(e,yn)}};fn=Ac;var gn="AI_UIMessageStreamError",mn=`vercel.ai.error.${gn}`,Cc=Symbol.for(mn),hn,ye=class extends q{constructor({chunkType:e,chunkId:t,message:r}){super({name:gn,message:r}),this[hn]=!0,this.chunkType=e,this.chunkId=t}static isInstance(e){return q.hasMarker(e,mn)}};hn=Cc;var In="6.0.42",En=R([y(),Ye(Uint8Array),Ye(ArrayBuffer),en(e=>{var t,r;return(r=(t=globalThis.Buffer)==null?void 0:t.isBuffer(e))!=null?r:!1},{message:"Must be a Buffer"})]),xe=Ia(()=>R([qs(),y(),Vs(),Y(),he(y(),xe.optional()),pe(xe)])),A=he(y(),he(y(),xe.optional())),Nn=T({type:h("text"),text:y(),providerOptions:A.optional()}),bc=T({type:h("image"),image:R([En,Ye(URL)]),mediaType:y().optional(),providerOptions:A.optional()}),xn=T({type:h("file"),data:R([En,Ye(URL)]),filename:y().optional(),mediaType:y(),providerOptions:A.optional()}),zc=T({type:h("reasoning"),text:y(),providerOptions:A.optional()}),Tc=T({type:h("tool-call"),toolCallId:y(),toolName:y(),input:H(),providerOptions:A.optional(),providerExecuted:Y().optional()}),wc=ta("type",[T({type:h("text"),value:y(),providerOptions:A.optional()}),T({type:h("json"),value:xe,providerOptions:A.optional()}),T({type:h("execution-denied"),reason:y().optional(),providerOptions:A.optional()}),T({type:h("error-text"),value:y(),providerOptions:A.optional()}),T({type:h("error-json"),value:xe,providerOptions:A.optional()}),T({type:h("content"),value:pe(R([T({type:h("text"),text:y(),providerOptions:A.optional()}),T({type:h("media"),data:y(),mediaType:y()}),T({type:h("file-data"),data:y(),mediaType:y(),filename:y().optional(),providerOptions:A.optional()}),T({type:h("file-url"),url:y(),providerOptions:A.optional()}),T({type:h("file-id"),fileId:R([y(),he(y(),y())]),providerOptions:A.optional()}),T({type:h("image-data"),data:y(),mediaType:y(),providerOptions:A.optional()}),T({type:h("image-url"),url:y(),providerOptions:A.optional()}),T({type:h("image-file-id"),fileId:R([y(),he(y(),y())]),providerOptions:A.optional()}),T({type:h("custom"),providerOptions:A.optional()})]))})]),vn=T({type:h("tool-result"),toolCallId:y(),toolName:y(),output:wc,providerOptions:A.optional()}),Oc=T({type:h("tool-approval-request"),approvalId:y(),toolCallId:y()}),Dc=T({type:h("tool-approval-response"),approvalId:y(),approved:Y(),reason:y().optional()}),kc=T({role:h("system"),content:y(),providerOptions:A.optional()}),Zc=T({role:h("user"),content:R([y(),pe(R([Nn,bc,xn]))]),providerOptions:A.optional()}),$c=T({role:h("assistant"),content:R([y(),pe(R([Nn,xn,zc,Tc,vn,Oc]))]),providerOptions:A.optional()}),Pc=T({role:h("tool"),content:pe(R([vn,Dc])),providerOptions:A.optional()});R([kc,Zc,$c,Pc]);function _n(e,t){if(e===void 0&&t===void 0)return;if(e===void 0)return t;if(t===void 0)return e;const r={...e};for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)){const u=t[n];if(u===void 0)continue;const o=n in e?e[n]:void 0,i=u!==null&&typeof u=="object"&&!Array.isArray(u)&&!(u instanceof Date)&&!(u instanceof RegExp),s=o!=null&&typeof o=="object"&&!Array.isArray(o)&&!(o instanceof Date)&&!(o instanceof RegExp);i&&s?r[n]=_n(o,u):r[n]=u}return r}var Uc={};_c(Uc,{array:()=>Fc,choice:()=>Jc,json:()=>Vc,object:()=>Qc,text:()=>Rc});function Yc(e){const t=["ROOT"];let r=-1,n=null;function u(c,a,L){switch(c){case'"':{r=a,t.pop(),t.push(L),t.push("INSIDE_STRING");break}case"f":case"t":case"n":{r=a,n=a,t.pop(),t.push(L),t.push("INSIDE_LITERAL");break}case"-":{t.pop(),t.push(L),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":{r=a,t.pop(),t.push(L),t.push("INSIDE_NUMBER");break}case"{":{r=a,t.pop(),t.push(L),t.push("INSIDE_OBJECT_START");break}case"[":{r=a,t.pop(),t.push(L),t.push("INSIDE_ARRAY_START");break}}}function o(c,a){switch(c){case",":{t.pop(),t.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{r=a,t.pop();break}}}function i(c,a){switch(c){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{r=a,t.pop();break}}}for(let c=0;c<e.length;c++){const a=e[c];switch(t[t.length-1]){case"ROOT":u(a,c,"FINISH");break;case"INSIDE_OBJECT_START":{switch(a){case'"':{t.pop(),t.push("INSIDE_OBJECT_KEY");break}case"}":{r=c,t.pop();break}}break}case"INSIDE_OBJECT_AFTER_COMMA":{switch(a){case'"':{t.pop(),t.push("INSIDE_OBJECT_KEY");break}}break}case"INSIDE_OBJECT_KEY":{switch(a){case'"':{t.pop(),t.push("INSIDE_OBJECT_AFTER_KEY");break}}break}case"INSIDE_OBJECT_AFTER_KEY":{switch(a){case":":{t.pop(),t.push("INSIDE_OBJECT_BEFORE_VALUE");break}}break}case"INSIDE_OBJECT_BEFORE_VALUE":{u(a,c,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{o(a,c);break}case"INSIDE_STRING":{switch(a){case'"':{t.pop(),r=c;break}case"\\":{t.push("INSIDE_STRING_ESCAPE");break}default:r=c}break}case"INSIDE_ARRAY_START":{switch(a){case"]":{r=c,t.pop();break}default:{r=c,u(a,c,"INSIDE_ARRAY_AFTER_VALUE");break}}break}case"INSIDE_ARRAY_AFTER_VALUE":{switch(a){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{r=c,t.pop();break}default:{r=c;break}}break}case"INSIDE_ARRAY_AFTER_COMMA":{u(a,c,"INSIDE_ARRAY_AFTER_VALUE");break}case"INSIDE_STRING_ESCAPE":{t.pop(),r=c;break}case"INSIDE_NUMBER":{switch(a){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{r=c;break}case"e":case"E":case"-":case".":break;case",":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&i(a,c),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&o(a,c);break}case"}":{t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&o(a,c);break}case"]":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&i(a,c);break}default:{t.pop();break}}break}case"INSIDE_LITERAL":{const l=e.substring(n,c+1);!"false".startsWith(l)&&!"true".startsWith(l)&&!"null".startsWith(l)?(t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?o(a,c):t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&i(a,c)):r=c;break}}}let s=e.slice(0,r+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":{const L=e.substring(n,e.length);"true".startsWith(L)?s+="true".slice(L.length):"false".startsWith(L)?s+="false".slice(L.length):"null".startsWith(L)&&(s+="null".slice(L.length))}}return s}async function ve(e){if(e===void 0)return{value:void 0,state:"undefined-input"};let t=await ae({text:e});return t.success?{value:t.value,state:"successful-parse"}:(t=await ae({text:Yc(e)}),t.success?{value:t.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}var Rc=()=>({name:"text",responseFormat:Promise.resolve({type:"text"}),async parseCompleteOutput({text:e}){return e},async parsePartialOutput({text:e}){return{partial:e}},createElementStreamTransform(){}}),Qc=({schema:e,name:t,description:r})=>{const n=lt(e);return{name:"object",responseFormat:re(n.jsonSchema).then(u=>({type:"json",schema:u,...t!=null&&{name:t},...r!=null&&{description:r}})),async parseCompleteOutput({text:u},o){const i=await ae({text:u});if(!i.success)throw new ne({message:"No object generated: could not parse the response.",cause:i.error,text:u,response:o.response,usage:o.usage,finishReason:o.finishReason});const s=await Ne({value:i.value,schema:n});if(!s.success)throw new ne({message:"No object generated: response did not match schema.",cause:s.error,text:u,response:o.response,usage:o.usage,finishReason:o.finishReason});return s.value},async parsePartialOutput({text:u}){const o=await ve(u);switch(o.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:o.value}}},createElementStreamTransform(){}}},Fc=({element:e,name:t,description:r})=>{const n=lt(e);return{name:"array",responseFormat:re(n.jsonSchema).then(u=>{const{$schema:o,...i}=u;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},...r!=null&&{description:r}}}),async parseCompleteOutput({text:u},o){const i=await ae({text:u});if(!i.success)throw new ne({message:"No object generated: could not parse the response.",cause:i.error,text:u,response:o.response,usage:o.usage,finishReason:o.finishReason});const s=i.value;if(s==null||typeof s!="object"||!("elements"in s)||!Array.isArray(s.elements))throw new ne({message:"No object generated: response did not match schema.",cause:new ce({value:s,cause:"response must be an object with an elements array"}),text:u,response:o.response,usage:o.usage,finishReason:o.finishReason});for(const c of s.elements){const a=await Ne({value:c,schema:n});if(!a.success)throw new ne({message:"No object generated: response did not match schema.",cause:a.error,text:u,response:o.response,usage:o.usage,finishReason:o.finishReason})}return s.elements},async parsePartialOutput({text:u}){const o=await ve(u);switch(o.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const i=o.value;if(i==null||typeof i!="object"||!("elements"in i)||!Array.isArray(i.elements))return;const s=o.state==="repaired-parse"&&i.elements.length>0?i.elements.slice(0,-1):i.elements,c=[];for(const a of s){const L=await Ne({value:a,schema:n});L.success&&c.push(L.value)}return{partial:c}}}},createElementStreamTransform(){let u=0;return new TransformStream({transform({partialOutput:o},i){if(o!=null)for(;u<o.length;u++)i.enqueue(o[u])}})}}},Jc=({options:e,name:t,description:r})=>({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},...r!=null&&{description:r}}),async parseCompleteOutput({text:n},u){const o=await ae({text:n});if(!o.success)throw new ne({message:"No object generated: could not parse the response.",cause:o.error,text:n,response:u.response,usage:u.usage,finishReason:u.finishReason});const i=o.value;if(i==null||typeof i!="object"||!("result"in i)||typeof i.result!="string"||!e.includes(i.result))throw new ne({message:"No object generated: response did not match schema.",cause:new ce({value:i,cause:"response must be an object that contains a choice value."}),text:n,response:u.response,usage:u.usage,finishReason:u.finishReason});return i.result},async parsePartialOutput({text:n}){const u=await ve(n);switch(u.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const o=u.value;if(o==null||typeof o!="object"||!("result"in o)||typeof o.result!="string")return;const i=e.filter(s=>s.startsWith(o.result));return u.state==="successful-parse"?i.includes(o.result)?{partial:o.result}:void 0:i.length===1?{partial:i[0]}:void 0}}},createElementStreamTransform(){}}),Vc=({name:e,description:t}={})=>({name:"json",responseFormat:Promise.resolve({type:"json",...e!=null&&{name:e},...t!=null&&{description:t}}),async parseCompleteOutput({text:r},n){const u=await ae({text:r});if(!u.success)throw new ne({message:"No object generated: could not parse the response.",cause:u.error,text:r,response:n.response,usage:n.usage,finishReason:n.finishReason});return u.value},async parsePartialOutput({text:r}){const n=await ve(r);switch(n.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return n.value===void 0?void 0:{partial:n.value}}},createElementStreamTransform(){}});Ee({prefix:"aitxt",size:24}),class extends TransformStream{constructor(){super({transform(e,t){t.enqueue(`data: ${JSON.stringify(e)}
41
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const l of e.seen.entries()){const d=l[1];if(t===l[0]){s(l);continue}if(e.external){const m=(u=e.external.registry.get(l[0]))==null?void 0:u.id;if(t!==l[0]&&m){s(l);continue}}if((c=e.metadataRegistry.get(l[0]))==null?void 0:c.id){s(l);continue}if(d.cycle){s(l);continue}if(d.count>1&&e.reused==="ref"){s(l);continue}}}function Me(e,t){var a,i,u;const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=c=>{const l=e.seen.get(c);if(l.ref===null)return;const d=l.def??l.schema,_={...d},m=l.ref;if(l.ref=null,m){n(m);const g=e.seen.get(m),y=g.schema;if(y.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(d.allOf=d.allOf??[],d.allOf.push(y)):Object.assign(d,y),Object.assign(d,_),c._zod.parent===m)for(const z in d)z==="$ref"||z==="allOf"||z in _||delete d[z];if(y.$ref)for(const z in d)z==="$ref"||z==="allOf"||z in g.def&&JSON.stringify(d[z])===JSON.stringify(g.def[z])&&delete d[z]}const I=c._zod.parent;if(I&&I!==m){n(I);const g=e.seen.get(I);if(g!=null&&g.schema.$ref&&(d.$ref=g.schema.$ref,g.def))for(const y in d)y==="$ref"||y==="allOf"||y in g.def&&JSON.stringify(d[y])===JSON.stringify(g.def[y])&&delete d[y]}e.override({zodSchema:c,jsonSchema:d,path:l.path??[]})};for(const c of[...e.seen.entries()].reverse())n(c[0]);const o={};if(e.target==="draft-2020-12"?o.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?o.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?o.$schema="http://json-schema.org/draft-04/schema#":e.target,(a=e.external)!=null&&a.uri){const c=(i=e.external.registry.get(t))==null?void 0:i.id;if(!c)throw new Error("Schema is missing an `id` property");o.$id=e.external.uri(c)}Object.assign(o,r.def??r.schema);const s=((u=e.external)==null?void 0:u.defs)??{};for(const c of e.seen.entries()){const l=c[1];l.def&&l.defId&&(s[l.defId]=l.def)}e.external||Object.keys(s).length>0&&(e.target==="draft-2020-12"?o.$defs=s:o.definitions=s);try{const c=JSON.parse(JSON.stringify(o));return Object.defineProperty(c,"~standard",{value:{...t["~standard"],jsonSchema:{input:De(t,"input",e.processors),output:De(t,"output",e.processors)}},enumerable:!1,writable:!1}),c}catch{throw new Error("Error converting schema to JSON.")}}function U(e,t){const r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);const n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return U(n.element,r);if(n.type==="set")return U(n.valueType,r);if(n.type==="lazy")return U(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return U(n.innerType,r);if(n.type==="intersection")return U(n.left,r)||U(n.right,r);if(n.type==="record"||n.type==="map")return U(n.keyType,r)||U(n.valueType,r);if(n.type==="pipe")return U(n.in,r)||U(n.out,r);if(n.type==="object"){for(const o in n.shape)if(U(n.shape[o],r))return!0;return!1}if(n.type==="union"){for(const o of n.options)if(U(o,r))return!0;return!1}if(n.type==="tuple"){for(const o of n.items)if(U(o,r))return!0;return!!(n.rest&&U(n.rest,r))}return!1}const Fa=(e,t={})=>r=>{const n=je({...r,processors:t});return R(e,n),Ce(n,e),Me(n,e)},De=(e,t,r={})=>n=>{const{libraryOptions:o,target:s}=n??{},a=je({...o??{},target:s,io:t,processors:r});return R(e,a),Ce(a,e),Me(a,e)},Ja={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},gr=(e,t,r,n)=>{const o=r;o.type="string";const{minimum:s,maximum:a,format:i,patterns:u,contentEncoding:c}=e._zod.bag;if(typeof s=="number"&&(o.minLength=s),typeof a=="number"&&(o.maxLength=a),i&&(o.format=Ja[i]??i,o.format===""&&delete o.format,i==="time"&&delete o.format),c&&(o.contentEncoding=c),u&&u.size>0){const l=[...u];l.length===1?o.pattern=l[0].source:l.length>1&&(o.allOf=[...l.map(d=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:d.source}))])}},vr=(e,t,r,n)=>{const o=r,{minimum:s,maximum:a,format:i,multipleOf:u,exclusiveMaximum:c,exclusiveMinimum:l}=e._zod.bag;typeof i=="string"&&i.includes("int")?o.type="integer":o.type="number",typeof l=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.minimum=l,o.exclusiveMinimum=!0):o.exclusiveMinimum=l),typeof s=="number"&&(o.minimum=s,typeof l=="number"&&t.target!=="draft-04"&&(l>=s?delete o.minimum:delete o.exclusiveMinimum)),typeof c=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(o.maximum=c,o.exclusiveMaximum=!0):o.exclusiveMaximum=c),typeof a=="number"&&(o.maximum=a,typeof c=="number"&&t.target!=="draft-04"&&(c<=a?delete o.maximum:delete o.exclusiveMaximum)),typeof u=="number"&&(o.multipleOf=u)},_r=(e,t,r,n)=>{r.type="boolean"},Wa=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},Ya=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},yr=(e,t,r,n)=>{t.target==="openapi-3.0"?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},qa=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},Ga=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},br=(e,t,r,n)=>{r.not={}},Ha=(e,t,r,n)=>{},wr=(e,t,r,n)=>{},Xa=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},Ir=(e,t,r,n)=>{const o=e._zod.def,s=At(o.entries);s.every(a=>typeof a=="number")&&(r.type="number"),s.every(a=>typeof a=="string")&&(r.type="string"),r.enum=s},Er=(e,t,r,n)=>{const o=e._zod.def,s=[];for(const a of o.values)if(a===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(a))}else s.push(a);if(s.length!==0)if(s.length===1){const a=s[0];r.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[a]:r.const=a}else s.every(a=>typeof a=="number")&&(r.type="number"),s.every(a=>typeof a=="string")&&(r.type="string"),s.every(a=>typeof a=="boolean")&&(r.type="boolean"),s.every(a=>a===null)&&(r.type="null"),r.enum=s},Qa=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},Ka=(e,t,r,n)=>{const o=r,s=e._zod.pattern;if(!s)throw new Error("Pattern not found in template literal");o.type="string",o.pattern=s.source},ei=(e,t,r,n)=>{const o=r,s={type:"string",format:"binary",contentEncoding:"binary"},{minimum:a,maximum:i,mime:u}=e._zod.bag;a!==void 0&&(s.minLength=a),i!==void 0&&(s.maxLength=i),u?u.length===1?(s.contentMediaType=u[0],Object.assign(o,s)):(Object.assign(o,s),o.anyOf=u.map(c=>({contentMediaType:c}))):Object.assign(o,s)},ti=(e,t,r,n)=>{r.type="boolean"},kr=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},ri=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},zr=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},ni=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},oi=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},Sr=(e,t,r,n)=>{const o=r,s=e._zod.def,{minimum:a,maximum:i}=e._zod.bag;typeof a=="number"&&(o.minItems=a),typeof i=="number"&&(o.maxItems=i),o.type="array",o.items=R(s.element,t,{...n,path:[...n.path,"items"]})},Or=(e,t,r,n)=>{var c;const o=r,s=e._zod.def;o.type="object",o.properties={};const a=s.shape;for(const l in a)o.properties[l]=R(a[l],t,{...n,path:[...n.path,"properties",l]});const i=new Set(Object.keys(a)),u=new Set([...i].filter(l=>{const d=s.shape[l]._zod;return t.io==="input"?d.optin===void 0:d.optout===void 0}));u.size>0&&(o.required=Array.from(u)),((c=s.catchall)==null?void 0:c._zod.def.type)==="never"?o.additionalProperties=!1:s.catchall?s.catchall&&(o.additionalProperties=R(s.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):t.io==="output"&&(o.additionalProperties=!1)},Zr=(e,t,r,n)=>{const o=e._zod.def,s=o.inclusive===!1,a=o.options.map((i,u)=>R(i,t,{...n,path:[...n.path,s?"oneOf":"anyOf",u]}));s?r.oneOf=a:r.anyOf=a},$r=(e,t,r,n)=>{const o=e._zod.def,s=R(o.left,t,{...n,path:[...n.path,"allOf",0]}),a=R(o.right,t,{...n,path:[...n.path,"allOf",1]}),i=c=>"allOf"in c&&Object.keys(c).length===1,u=[...i(s)?s.allOf:[s],...i(a)?a.allOf:[a]];r.allOf=u},si=(e,t,r,n)=>{const o=r,s=e._zod.def;o.type="array";const a=t.target==="draft-2020-12"?"prefixItems":"items",i=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",u=s.items.map((_,m)=>R(_,t,{...n,path:[...n.path,a,m]})),c=s.rest?R(s.rest,t,{...n,path:[...n.path,i,...t.target==="openapi-3.0"?[s.items.length]:[]]}):null;t.target==="draft-2020-12"?(o.prefixItems=u,c&&(o.items=c)):t.target==="openapi-3.0"?(o.items={anyOf:u},c&&o.items.anyOf.push(c),o.minItems=u.length,c||(o.maxItems=u.length)):(o.items=u,c&&(o.additionalItems=c));const{minimum:l,maximum:d}=e._zod.bag;typeof l=="number"&&(o.minItems=l),typeof d=="number"&&(o.maxItems=d)},Nr=(e,t,r,n)=>{const o=r,s=e._zod.def;o.type="object";const a=s.keyType,i=a._zod.bag,u=i==null?void 0:i.patterns;if(s.mode==="loose"&&u&&u.size>0){const l=R(s.valueType,t,{...n,path:[...n.path,"patternProperties","*"]});o.patternProperties={};for(const d of u)o.patternProperties[d.source]=l}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(o.propertyNames=R(s.keyType,t,{...n,path:[...n.path,"propertyNames"]})),o.additionalProperties=R(s.valueType,t,{...n,path:[...n.path,"additionalProperties"]});const c=a._zod.values;if(c){const l=[...c].filter(d=>typeof d=="string"||typeof d=="number");l.length>0&&(o.required=l)}},Tr=(e,t,r,n)=>{const o=e._zod.def,s=R(o.innerType,t,n),a=t.seen.get(e);t.target==="openapi-3.0"?(a.ref=o.innerType,r.nullable=!0):r.anyOf=[s,{type:"null"}]},Pr=(e,t,r,n)=>{const o=e._zod.def;R(o.innerType,t,n);const s=t.seen.get(e);s.ref=o.innerType},Ar=(e,t,r,n)=>{const o=e._zod.def;R(o.innerType,t,n);const s=t.seen.get(e);s.ref=o.innerType,r.default=JSON.parse(JSON.stringify(o.defaultValue))},Rr=(e,t,r,n)=>{const o=e._zod.def;R(o.innerType,t,n);const s=t.seen.get(e);s.ref=o.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(o.defaultValue)))},xr=(e,t,r,n)=>{const o=e._zod.def;R(o.innerType,t,n);const s=t.seen.get(e);s.ref=o.innerType;let a;try{a=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=a},jr=(e,t,r,n)=>{const o=e._zod.def,s=t.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;R(s,t,n);const a=t.seen.get(e);a.ref=s},Cr=(e,t,r,n)=>{const o=e._zod.def;R(o.innerType,t,n);const s=t.seen.get(e);s.ref=o.innerType,r.readOnly=!0},ai=(e,t,r,n)=>{const o=e._zod.def;R(o.innerType,t,n);const s=t.seen.get(e);s.ref=o.innerType},rt=(e,t,r,n)=>{const o=e._zod.def;R(o.innerType,t,n);const s=t.seen.get(e);s.ref=o.innerType},Mr=(e,t,r,n)=>{const o=e._zod.innerType;R(o,t,n);const s=t.seen.get(e);s.ref=o},Dr={string:gr,number:vr,boolean:_r,bigint:Wa,symbol:Ya,null:yr,undefined:qa,void:Ga,never:br,any:Ha,unknown:wr,date:Xa,enum:Ir,literal:Er,nan:Qa,template_literal:Ka,file:ei,success:ti,custom:kr,function:ri,transform:zr,map:ni,set:oi,array:Sr,object:Or,union:Zr,intersection:$r,tuple:si,record:Nr,nullable:Tr,nonoptional:Pr,default:Ar,prefault:Rr,catch:xr,pipe:jr,readonly:Cr,promise:ai,optional:rt,lazy:Mr};function ii(e,t){if("_idmap"in e){const n=e,o=je({...t,processors:Dr}),s={};for(const u of n._idmap.entries()){const[c,l]=u;R(l,o)}const a={},i={registry:n,uri:t==null?void 0:t.uri,defs:s};o.external=i;for(const u of n._idmap.entries()){const[c,l]=u;Ce(o,l),a[c]=Me(o,l)}if(Object.keys(s).length>0){const u=o.target==="draft-2020-12"?"$defs":"definitions";a.__shared={[u]:s}}return{schemas:a}}const r=je({...t,processors:Dr});return R(e,r),Ce(r,e),Me(r,e)}const ci=p("ZodISODateTime",(e,t)=>{ls.init(e,t),D.init(e,t)});function ui(e){return _a(ci,e)}const li=p("ZodISODate",(e,t)=>{ds.init(e,t),D.init(e,t)});function di(e){return ya(li,e)}const pi=p("ZodISOTime",(e,t)=>{ps.init(e,t),D.init(e,t)});function fi(e){return ba(pi,e)}const mi=p("ZodISODuration",(e,t)=>{fs.init(e,t),D.init(e,t)});function hi(e){return wa(mi,e)}const Y=p("ZodError",(e,t)=>{Dt.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>to(e,r)},flatten:{value:r=>eo(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,We,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,We,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),gi=He(Y),vi=Xe(Y),_i=Ne(Y),Ur=Te(Y),yi=oo(Y),bi=so(Y),wi=ao(Y),Ii=io(Y),Ei=co(Y),ki=uo(Y),zi=lo(Y),Si=po(Y),j=p("ZodType",(e,t)=>(x.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:De(e,"input"),output:De(e,"output")}}),e.toJSONSchema=Fa(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(K(t,{checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0}),e.with=e.check,e.clone=(r,n)=>ee(e,r,n),e.brand=()=>e,e.register=(r,n)=>(r.add(e,n),e),e.parse=(r,n)=>gi(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>_i(e,r,n),e.parseAsync=async(r,n)=>vi(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>Ur(e,r,n),e.spa=e.safeParseAsync,e.encode=(r,n)=>yi(e,r,n),e.decode=(r,n)=>bi(e,r,n),e.encodeAsync=async(r,n)=>wi(e,r,n),e.decodeAsync=async(r,n)=>Ii(e,r,n),e.safeEncode=(r,n)=>Ei(e,r,n),e.safeDecode=(r,n)=>ki(e,r,n),e.safeEncodeAsync=async(r,n)=>zi(e,r,n),e.safeDecodeAsync=async(r,n)=>Si(e,r,n),e.refine=(r,n)=>e.check(Ic(r,n)),e.superRefine=r=>e.check(Ec(r)),e.overwrite=r=>e.check(he(r)),e.optional=()=>Hr(e),e.exactOptional=()=>cc(e),e.nullable=()=>Xr(e),e.nullish=()=>Hr(Xr(e)),e.nonoptional=r=>mc(e,r),e.array=()=>ge(e),e.or=r=>V([e,r]),e.and=r=>rc(e,r),e.transform=r=>Kr(e,ac(r)),e.default=r=>dc(e,r),e.prefault=r=>fc(e,r),e.catch=r=>gc(e,r),e.pipe=r=>Kr(e,r),e.readonly=()=>yc(e),e.describe=r=>{const n=e.clone();return be.add(n,{description:r}),n},Object.defineProperty(e,"description",{get(){var r;return(r=be.get(e))==null?void 0:r.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return be.get(e);const n=e.clone();return be.add(n,r[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=r=>r(e),e)),Lr=p("_ZodString",(e,t)=>{Qe.init(e,t),j.init(e,t),e._zod.processJSONSchema=(n,o,s)=>gr(e,n,o);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...n)=>e.check(Za(...n)),e.includes=(...n)=>e.check(Ta(...n)),e.startsWith=(...n)=>e.check(Pa(...n)),e.endsWith=(...n)=>e.check(Aa(...n)),e.min=(...n)=>e.check(xe(...n)),e.max=(...n)=>e.check(mr(...n)),e.length=(...n)=>e.check(hr(...n)),e.nonempty=(...n)=>e.check(xe(1,...n)),e.lowercase=n=>e.check($a(n)),e.uppercase=n=>e.check(Na(n)),e.trim=()=>e.check(xa()),e.normalize=(...n)=>e.check(Ra(...n)),e.toLowerCase=()=>e.check(ja()),e.toUpperCase=()=>e.check(Ca()),e.slugify=()=>e.check(Ma())}),Oi=p("ZodString",(e,t)=>{Qe.init(e,t),Lr.init(e,t),e.email=r=>e.check(Xs(Zi,r)),e.url=r=>e.check(ra($i,r)),e.jwt=r=>e.check(va(Fi,r)),e.emoji=r=>e.check(na(Ni,r)),e.guid=r=>e.check(lr(Vr,r)),e.uuid=r=>e.check(Qs(Ue,r)),e.uuidv4=r=>e.check(Ks(Ue,r)),e.uuidv6=r=>e.check(ea(Ue,r)),e.uuidv7=r=>e.check(ta(Ue,r)),e.nanoid=r=>e.check(oa(Ti,r)),e.guid=r=>e.check(lr(Vr,r)),e.cuid=r=>e.check(sa(Pi,r)),e.cuid2=r=>e.check(aa(Ai,r)),e.ulid=r=>e.check(ia(Ri,r)),e.base64=r=>e.check(ma(Li,r)),e.base64url=r=>e.check(ha(Vi,r)),e.xid=r=>e.check(ca(xi,r)),e.ksuid=r=>e.check(ua(ji,r)),e.ipv4=r=>e.check(la(Ci,r)),e.ipv6=r=>e.check(da(Mi,r)),e.cidrv4=r=>e.check(pa(Di,r)),e.cidrv6=r=>e.check(fa(Ui,r)),e.e164=r=>e.check(ga(Bi,r)),e.datetime=r=>e.check(ui(r)),e.date=r=>e.check(di(r)),e.time=r=>e.check(fi(r)),e.duration=r=>e.check(hi(r))});function v(e){return Hs(Oi,e)}const D=p("ZodStringFormat",(e,t)=>{M.init(e,t),Lr.init(e,t)}),Zi=p("ZodEmail",(e,t)=>{ts.init(e,t),D.init(e,t)}),Vr=p("ZodGUID",(e,t)=>{Ko.init(e,t),D.init(e,t)}),Ue=p("ZodUUID",(e,t)=>{es.init(e,t),D.init(e,t)}),$i=p("ZodURL",(e,t)=>{rs.init(e,t),D.init(e,t)}),Ni=p("ZodEmoji",(e,t)=>{ns.init(e,t),D.init(e,t)}),Ti=p("ZodNanoID",(e,t)=>{os.init(e,t),D.init(e,t)}),Pi=p("ZodCUID",(e,t)=>{ss.init(e,t),D.init(e,t)}),Ai=p("ZodCUID2",(e,t)=>{as.init(e,t),D.init(e,t)}),Ri=p("ZodULID",(e,t)=>{is.init(e,t),D.init(e,t)}),xi=p("ZodXID",(e,t)=>{cs.init(e,t),D.init(e,t)}),ji=p("ZodKSUID",(e,t)=>{us.init(e,t),D.init(e,t)}),Ci=p("ZodIPv4",(e,t)=>{ms.init(e,t),D.init(e,t)}),Mi=p("ZodIPv6",(e,t)=>{hs.init(e,t),D.init(e,t)}),Di=p("ZodCIDRv4",(e,t)=>{gs.init(e,t),D.init(e,t)}),Ui=p("ZodCIDRv6",(e,t)=>{vs.init(e,t),D.init(e,t)}),Li=p("ZodBase64",(e,t)=>{_s.init(e,t),D.init(e,t)}),Vi=p("ZodBase64URL",(e,t)=>{bs.init(e,t),D.init(e,t)}),Bi=p("ZodE164",(e,t)=>{ws.init(e,t),D.init(e,t)}),Fi=p("ZodJWT",(e,t)=>{Es.init(e,t),D.init(e,t)}),Br=p("ZodNumber",(e,t)=>{Ht.init(e,t),j.init(e,t),e._zod.processJSONSchema=(n,o,s)=>vr(e,n,o),e.gt=(n,o)=>e.check(pr(n,o)),e.gte=(n,o)=>e.check(tt(n,o)),e.min=(n,o)=>e.check(tt(n,o)),e.lt=(n,o)=>e.check(dr(n,o)),e.lte=(n,o)=>e.check(et(n,o)),e.max=(n,o)=>e.check(et(n,o)),e.int=n=>e.check(Fr(n)),e.safe=n=>e.check(Fr(n)),e.positive=n=>e.check(pr(0,n)),e.nonnegative=n=>e.check(tt(0,n)),e.negative=n=>e.check(dr(0,n)),e.nonpositive=n=>e.check(et(0,n)),e.multipleOf=(n,o)=>e.check(fr(n,o)),e.step=(n,o)=>e.check(fr(n,o)),e.finite=()=>e;const r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function Ji(e){return Ia(Br,e)}const Wi=p("ZodNumberFormat",(e,t)=>{ks.init(e,t),Br.init(e,t)});function Fr(e){return Ea(Wi,e)}const Yi=p("ZodBoolean",(e,t)=>{zs.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>_r(e,r,n)});function L(e){return ka(Yi,e)}const qi=p("ZodNull",(e,t)=>{Ss.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>yr(e,r,n)});function Gi(e){return za(qi,e)}const Hi=p("ZodUnknown",(e,t)=>{Os.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>wr()});function X(){return Sa(Hi)}const Xi=p("ZodNever",(e,t)=>{Zs.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>br(e,r,n)});function Jr(e){return Oa(Xi,e)}const Qi=p("ZodArray",(e,t)=>{$s.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Sr(e,r,n,o),e.element=t.element,e.min=(r,n)=>e.check(xe(r,n)),e.nonempty=r=>e.check(xe(1,r)),e.max=(r,n)=>e.check(mr(r,n)),e.length=(r,n)=>e.check(hr(r,n)),e.unwrap=()=>e.element});function ge(e,t){return Da(Qi,e,t)}const Wr=p("ZodObject",(e,t)=>{Ts.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Or(e,r,n,o),O(e,"shape",()=>t.shape),e.keyof=()=>qr(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:X()}),e.loose=()=>e.clone({...e._zod.def,catchall:X()}),e.strict=()=>e.clone({...e._zod.def,catchall:Jr()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>Gn(e,r),e.safeExtend=r=>Hn(e,r),e.merge=r=>Xn(e,r),e.pick=r=>Yn(e,r),e.omit=r=>qn(e,r),e.partial=(...r)=>Qn(Gr,e,r[0]),e.required=(...r)=>Kn(Qr,e,r[0])});function P(e,t){const r={type:"object",shape:e??{},...b(t)};return new Wr(r)}function C(e,t){return new Wr({type:"object",shape:e,catchall:Jr(),...b(t)})}const Yr=p("ZodUnion",(e,t)=>{tr.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Zr(e,r,n,o),e.options=t.options});function V(e,t){return new Yr({type:"union",options:e,...b(t)})}const Ki=p("ZodDiscriminatedUnion",(e,t)=>{Yr.init(e,t),Ps.init(e,t)});function ec(e,t,r){return new Ki({type:"union",options:t,discriminator:e,...b(r)})}const tc=p("ZodIntersection",(e,t)=>{As.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>$r(e,r,n,o)});function rc(e,t){return new tc({type:"intersection",left:e,right:t})}const nc=p("ZodRecord",(e,t)=>{Rs.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Nr(e,r,n,o),e.keyType=t.keyType,e.valueType=t.valueType});function we(e,t,r){return new nc({type:"record",keyType:e,valueType:t,...b(r)})}const nt=p("ZodEnum",(e,t)=>{xs.init(e,t),j.init(e,t),e._zod.processJSONSchema=(n,o,s)=>Ir(e,n,o),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(n,o)=>{const s={};for(const a of n)if(r.has(a))s[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new nt({...t,checks:[],...b(o),entries:s})},e.exclude=(n,o)=>{const s={...t.entries};for(const a of n)if(r.has(a))delete s[a];else throw new Error(`Key ${a} not found in enum`);return new nt({...t,checks:[],...b(o),entries:s})}});function qr(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new nt({type:"enum",entries:r,...b(t)})}const oc=p("ZodLiteral",(e,t)=>{js.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Er(e,r,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function w(e,t){return new oc({type:"literal",values:Array.isArray(e)?e:[e],...b(t)})}const sc=p("ZodTransform",(e,t)=>{Cs.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>zr(e,r),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Pt(e.constructor.name);r.addIssue=s=>{if(typeof s=="string")r.issues.push(ye(s,r.value,t));else{const a=s;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=e),r.issues.push(ye(a))}};const o=t.transform(r.value,r);return o instanceof Promise?o.then(s=>(r.value=s,r)):(r.value=o,r)}});function ac(e){return new sc({type:"transform",transform:e})}const Gr=p("ZodOptional",(e,t)=>{or.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>rt(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Hr(e){return new Gr({type:"optional",innerType:e})}const ic=p("ZodExactOptional",(e,t)=>{Ms.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>rt(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function cc(e){return new ic({type:"optional",innerType:e})}const uc=p("ZodNullable",(e,t)=>{Ds.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Tr(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function Xr(e){return new uc({type:"nullable",innerType:e})}const lc=p("ZodDefault",(e,t)=>{Us.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Ar(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function dc(e,t){return new lc({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Ct(t)}})}const pc=p("ZodPrefault",(e,t)=>{Ls.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Rr(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function fc(e,t){return new pc({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Ct(t)}})}const Qr=p("ZodNonOptional",(e,t)=>{Vs.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Pr(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function mc(e,t){return new Qr({type:"nonoptional",innerType:e,...b(t)})}const hc=p("ZodCatch",(e,t)=>{Bs.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>xr(e,r,n,o),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function gc(e,t){return new hc({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const vc=p("ZodPipe",(e,t)=>{Fs.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>jr(e,r,n,o),e.in=t.in,e.out=t.out});function Kr(e,t){return new vc({type:"pipe",in:e,out:t})}const _c=p("ZodReadonly",(e,t)=>{Js.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Cr(e,r,n,o),e.unwrap=()=>e._zod.def.innerType});function yc(e){return new _c({type:"readonly",innerType:e})}const bc=p("ZodLazy",(e,t)=>{Ws.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>Mr(e,r,n,o),e.unwrap=()=>e._zod.def.getter()});function wc(e){return new bc({type:"lazy",getter:e})}const ot=p("ZodCustom",(e,t)=>{Ys.init(e,t),j.init(e,t),e._zod.processJSONSchema=(r,n,o)=>kr(e,r)});function en(e,t){return Ua(ot,e??(()=>!0),t)}function Ic(e,t={}){return La(ot,e,t)}function Ec(e){return Va(e)}function Le(e,t={}){const r=new ot({type:"custom",check:"custom",fn:n=>n instanceof e,abort:!0,...b(t)});return r._zod.bag.Class=e,r._zod.check=n=>{n.value instanceof e||n.issues.push({code:"invalid_type",expected:e.name,input:n.value,inst:r,path:[...r._zod.def.path??[]]})},r}var Ie;(function(e){e.assertEqual=o=>{};function t(o){}e.assertIs=t;function r(o){throw new Error}e.assertNever=r,e.arrayToEnum=o=>{const s={};for(const a of o)s[a]=a;return s},e.getValidEnumValues=o=>{const s=e.objectKeys(o).filter(i=>typeof o[o[i]]!="number"),a={};for(const i of s)a[i]=o[i];return e.objectValues(a)},e.objectValues=o=>e.objectKeys(o).map(function(s){return o[s]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{const s=[];for(const a in o)Object.prototype.hasOwnProperty.call(o,a)&&s.push(a);return s},e.find=(o,s)=>{for(const a of o)if(s(a))return a},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function n(o,s=" | "){return o.map(a=>typeof a=="string"?`'${a}'`:a).join(s)}e.joinValues=n,e.jsonStringifyReplacer=(o,s)=>typeof s=="bigint"?s.toString():s})(Ie||(Ie={}));var tn;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(tn||(tn={})),Ie.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ie.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"]);class Ve extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){const r=t||function(s){return s.message},n={_errors:[]},o=s=>{for(const a of s.issues)if(a.code==="invalid_union")a.unionErrors.map(o);else if(a.code==="invalid_return_type")o(a.returnTypeError);else if(a.code==="invalid_arguments")o(a.argumentsError);else if(a.path.length===0)n._errors.push(r(a));else{let i=n,u=0;for(;u<a.path.length;){const c=a.path[u];u===a.path.length-1?(i[c]=i[c]||{_errors:[]},i[c]._errors.push(r(a))):i[c]=i[c]||{_errors:[]},i=i[c],u++}}};return o(this),n}static assert(t){if(!(t instanceof Ve))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ie.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){const r=Object.create(null),n=[];for(const o of this.issues)if(o.path.length>0){const s=o.path[0];r[s]=r[s]||[],r[s].push(t(o))}else n.push(t(o));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}Ve.create=e=>new Ve(e);var rn;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(rn||(rn={}));var 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={}));class nn extends Error{constructor(t,r){super(t),this.name="ParseError",this.type=r.type,this.field=r.field,this.value=r.value,this.line=r.line}}function st(e){}function kc(e){if(typeof e=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:t=st,onError:r=st,onRetry:n=st,onComment:o}=e;let s="",a=!0,i,u="",c="";function l(g){const y=a?g.replace(/^\xEF\xBB\xBF/,""):g,[k,z]=zc(`${s}${y}`);for(const f of k)d(f);s=z,a=!1}function d(g){if(g===""){m();return}if(g.startsWith(":")){o&&o(g.slice(g.startsWith(": ")?2:1));return}const y=g.indexOf(":");if(y!==-1){const k=g.slice(0,y),z=g[y+1]===" "?2:1,f=g.slice(y+z);_(k,f,g);return}_(g,"",g)}function _(g,y,k){switch(g){case"event":c=y;break;case"data":u=`${u}${y}
42
+ `;break;case"id":i=y.includes("\0")?void 0:y;break;case"retry":/^\d+$/.test(y)?n(parseInt(y,10)):r(new nn(`Invalid \`retry\` value: "${y}"`,{type:"invalid-retry",value:y,line:k}));break;default:r(new nn(`Unknown field "${g.length>20?`${g.slice(0,20)}…`:g}"`,{type:"unknown-field",field:g,value:y,line:k}));break}}function m(){u.length>0&&t({id:i,event:c||void 0,data:u.endsWith(`
43
+ `)?u.slice(0,-1):u}),i=void 0,u="",c=""}function I(g={}){s&&g.consume&&d(s),a=!0,i=void 0,u="",c="",s=""}return{feed:l,reset:I}}function zc(e){const t=[];let r="",n=0;for(;n<e.length;){const o=e.indexOf("\r",n),s=e.indexOf(`
44
+ `,n);let a=-1;if(o!==-1&&s!==-1?a=Math.min(o,s):o!==-1?o===e.length-1?a=-1:a=o:s!==-1&&(a=s),a===-1){r=e.slice(n);break}else{const i=e.slice(n,a);t.push(i),n=a+1,e[n-1]==="\r"&&e[n]===`
45
+ `&&n++}}return[t,r]}class Sc extends TransformStream{constructor({onError:t,onRetry:r,onComment:n}={}){let o;super({start(s){o=kc({onEvent:a=>{s.enqueue(a)},onError(a){t==="terminate"?s.error(a):typeof t=="function"&&t(a)},onRetry:r,onComment:n})},transform(s){o.feed(s)}})}}var Ee=({prefix:e,size:t=16,alphabet:r="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:n="-"}={})=>{const o=()=>{const s=r.length,a=new Array(t);for(let i=0;i<t;i++)a[i]=r[Math.random()*s|0];return a.join("")};if(e==null)return o;if(r.includes(n))throw new Mn({argument:"separator",message:`The separator "${n}" must not be part of the alphabet "${r}".`});return()=>`${e}${n}${o()}`},Oc=Ee();function on(e=globalThis){var t,r,n;return e.window?"runtime/browser":(t=e.navigator)!=null&&t.userAgent?`runtime/${e.navigator.userAgent.toLowerCase()}`:(n=(r=e.process)==null?void 0:r.versions)!=null&&n.node?`runtime/node.js/${e.process.version.substring(0)}`:e.EdgeRuntime?"runtime/vercel-edge":"runtime/unknown"}function ae(e){if(e==null)return{};const t={};if(e instanceof Headers)e.forEach((r,n)=>{t[n.toLowerCase()]=r});else{Array.isArray(e)||(e=Object.entries(e));for(const[r,n]of e)n!=null&&(t[r.toLowerCase()]=n)}return t}function sn(e,...t){const r=new Headers(ae(e)),n=r.get("user-agent")||"";return r.set("user-agent",[n,...t].filter(Boolean).join(" ")),Object.fromEntries(r.entries())}var Zc=/"__proto__"\s*:/,$c=/"constructor"\s*:/;function an(e){const t=JSON.parse(e);return t===null||typeof t!="object"||Zc.test(e)===!1&&$c.test(e)===!1?t:Nc(t)}function Nc(e){let t=[e];for(;t.length;){const r=t;t=[];for(const n of r){if(Object.prototype.hasOwnProperty.call(n,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(n,"constructor")&&Object.prototype.hasOwnProperty.call(n.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(const o in n){const s=n[o];s&&typeof s=="object"&&t.push(s)}}}return e}function Tc(e){const{stackTraceLimit:t}=Error;try{Error.stackTraceLimit=0}catch{return an(e)}try{return an(e)}finally{Error.stackTraceLimit=t}}function at(e){if(e.type==="object"||Array.isArray(e.type)&&e.type.includes("object")){e.additionalProperties=!1;const{properties:r}=e;if(r!=null)for(const n of Object.keys(r))r[n]=ie(r[n])}e.items!=null&&(e.items=Array.isArray(e.items)?e.items.map(ie):ie(e.items)),e.anyOf!=null&&(e.anyOf=e.anyOf.map(ie)),e.allOf!=null&&(e.allOf=e.allOf.map(ie)),e.oneOf!=null&&(e.oneOf=e.oneOf.map(ie));const{definitions:t}=e;if(t!=null)for(const r of Object.keys(t))t[r]=ie(t[r]);return e}function ie(e){return typeof e=="boolean"?e:at(e)}var Pc=Symbol("Let zodToJsonSchema decide on which parser to use"),cn={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"},Ac=e=>typeof e=="string"?{...cn,name:e}:{...cn,...e};function W(){return{}}function Rc(e,t){var r,n,o;const s={type:"array"};return(r=e.type)!=null&&r._def&&((o=(n=e.type)==null?void 0:n._def)==null?void 0:o.typeName)!==E.ZodAny&&(s.items=N(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&(s.minItems=e.minLength.value),e.maxLength&&(s.maxItems=e.maxLength.value),e.exactLength&&(s.minItems=e.exactLength.value,s.maxItems=e.exactLength.value),s}function xc(e){const t={type:"integer",format:"int64"};if(!e.checks)return t;for(const r of e.checks)switch(r.kind){case"min":r.inclusive?t.minimum=r.value:t.exclusiveMinimum=r.value;break;case"max":r.inclusive?t.maximum=r.value:t.exclusiveMaximum=r.value;break;case"multipleOf":t.multipleOf=r.value;break}return t}function jc(){return{type:"boolean"}}function un(e,t){return N(e.type._def,t)}var Cc=(e,t)=>N(e.innerType._def,t);function ln(e,t,r){const n=r??t.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((o,s)=>ln(e,t,o))};switch(n){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return Mc(e)}}var Mc=e=>{const t={type:"integer",format:"unix-time"};for(const r of e.checks)switch(r.kind){case"min":t.minimum=r.value;break;case"max":t.maximum=r.value;break}return t};function Dc(e,t){return{...N(e.innerType._def,t),default:e.defaultValue()}}function Uc(e,t){return t.effectStrategy==="input"?N(e.schema._def,t):W()}function Lc(e){return{type:"string",enum:Array.from(e.values)}}var Vc=e=>"type"in e&&e.type==="string"?!1:"allOf"in e;function Bc(e,t){const r=[N(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),N(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(o=>!!o),n=[];return r.forEach(o=>{if(Vc(o))n.push(...o.allOf);else{let s=o;if("additionalProperties"in o&&o.additionalProperties===!1){const{additionalProperties:a,...i}=o;s=i}n.push(s)}}),n.length?{allOf:n}:void 0}function Fc(e){const 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 it=void 0,q={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:()=>(it===void 0&&(it=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),it),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}:){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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 dn(e,t){const r={type:"string"};if(e.checks)for(const n of e.checks)switch(n.kind){case"min":r.minLength=typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value;break;case"max":r.maxLength=typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value;break;case"email":switch(t.emailStrategy){case"format:email":G(r,"email",n.message,t);break;case"format:idn-email":G(r,"idn-email",n.message,t);break;case"pattern:zod":B(r,q.email,n.message,t);break}break;case"url":G(r,"uri",n.message,t);break;case"uuid":G(r,"uuid",n.message,t);break;case"regex":B(r,n.regex,n.message,t);break;case"cuid":B(r,q.cuid,n.message,t);break;case"cuid2":B(r,q.cuid2,n.message,t);break;case"startsWith":B(r,RegExp(`^${ct(n.value,t)}`),n.message,t);break;case"endsWith":B(r,RegExp(`${ct(n.value,t)}$`),n.message,t);break;case"datetime":G(r,"date-time",n.message,t);break;case"date":G(r,"date",n.message,t);break;case"time":G(r,"time",n.message,t);break;case"duration":G(r,"duration",n.message,t);break;case"length":r.minLength=typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,r.maxLength=typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value;break;case"includes":{B(r,RegExp(ct(n.value,t)),n.message,t);break}case"ip":{n.version!=="v6"&&G(r,"ipv4",n.message,t),n.version!=="v4"&&G(r,"ipv6",n.message,t);break}case"base64url":B(r,q.base64url,n.message,t);break;case"jwt":B(r,q.jwt,n.message,t);break;case"cidr":{n.version!=="v6"&&B(r,q.ipv4Cidr,n.message,t),n.version!=="v4"&&B(r,q.ipv6Cidr,n.message,t);break}case"emoji":B(r,q.emoji(),n.message,t);break;case"ulid":{B(r,q.ulid,n.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{G(r,"binary",n.message,t);break}case"contentEncoding:base64":{r.contentEncoding="base64";break}case"pattern:zod":{B(r,q.base64,n.message,t);break}}break}case"nanoid":B(r,q.nanoid,n.message,t)}return r}function ct(e,t){return t.patternStrategy==="escape"?Wc(e):e}var Jc=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function Wc(e){let t="";for(let r=0;r<e.length;r++)Jc.has(e[r])||(t+="\\"),t+=e[r];return t}function G(e,t,r,n){var o;e.format||(o=e.anyOf)!=null&&o.some(s=>s.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format}),delete e.format),e.anyOf.push({format:t,...r&&n.errorMessages&&{errorMessage:{format:r}}})):e.format=t}function B(e,t,r,n){var o;e.pattern||(o=e.allOf)!=null&&o.some(s=>s.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern}),delete e.pattern),e.allOf.push({pattern:pn(t,n),...r&&n.errorMessages&&{errorMessage:{pattern:r}}})):e.pattern=pn(t,n)}function pn(e,t){var r;if(!t.applyRegexFlags||!e.flags)return e.source;const n={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},o=n.i?e.source.toLowerCase():e.source;let s="",a=!1,i=!1,u=!1;for(let c=0;c<o.length;c++){if(a){s+=o[c],a=!1;continue}if(n.i){if(i){if(o[c].match(/[a-z]/)){u?(s+=o[c],s+=`${o[c-2]}-${o[c]}`.toUpperCase(),u=!1):o[c+1]==="-"&&((r=o[c+2])!=null&&r.match(/[a-z]/))?(s+=o[c],u=!0):s+=`${o[c]}${o[c].toUpperCase()}`;continue}}else if(o[c].match(/[a-z]/)){s+=`[${o[c]}${o[c].toUpperCase()}]`;continue}}if(n.m){if(o[c]==="^"){s+=`(^|(?<=[\r
46
+ ]))`;continue}else if(o[c]==="$"){s+=`($|(?=[\r
47
+ ]))`;continue}}if(n.s&&o[c]==="."){s+=i?`${o[c]}\r
48
+ `:`[${o[c]}\r
49
+ ]`;continue}s+=o[c],o[c]==="\\"?a=!0:i&&o[c]==="]"?i=!1:!i&&o[c]==="["&&(i=!0)}try{new RegExp(s)}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 s}function fn(e,t){var r,n,o,s,a,i;const u={type:"object",additionalProperties:(r=N(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]}))!=null?r:t.allowedAdditionalProperties};if(((n=e.keyType)==null?void 0:n._def.typeName)===E.ZodString&&((o=e.keyType._def.checks)!=null&&o.length)){const{type:c,...l}=dn(e.keyType._def,t);return{...u,propertyNames:l}}else{if(((s=e.keyType)==null?void 0:s._def.typeName)===E.ZodEnum)return{...u,propertyNames:{enum:e.keyType._def.values}};if(((a=e.keyType)==null?void 0:a._def.typeName)===E.ZodBranded&&e.keyType._def.type._def.typeName===E.ZodString&&((i=e.keyType._def.type._def.checks)!=null&&i.length)){const{type:c,...l}=un(e.keyType._def,t);return{...u,propertyNames:l}}}return u}function Yc(e,t){if(t.mapStrategy==="record")return fn(e,t);const r=N(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||W(),n=N(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||W();return{type:"array",maxItems:125,items:{type:"array",items:[r,n],minItems:2,maxItems:2}}}function qc(e){const t=e.values,n=Object.keys(e.values).filter(s=>typeof t[t[s]]!="number").map(s=>t[s]),o=Array.from(new Set(n.map(s=>typeof s)));return{type:o.length===1?o[0]==="string"?"string":"number":["string","number"],enum:n}}function Gc(){return{not:W()}}function Hc(){return{type:"null"}}var ut={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function Xc(e,t){const r=e.options instanceof Map?Array.from(e.options.values()):e.options;if(r.every(n=>n._def.typeName in ut&&(!n._def.checks||!n._def.checks.length))){const n=r.reduce((o,s)=>{const a=ut[s._def.typeName];return a&&!o.includes(a)?[...o,a]:o},[]);return{type:n.length>1?n:n[0]}}else if(r.every(n=>n._def.typeName==="ZodLiteral"&&!n.description)){const n=r.reduce((o,s)=>{const a=typeof s._def.value;switch(a){case"string":case"number":case"boolean":return[...o,a];case"bigint":return[...o,"integer"];case"object":if(s._def.value===null)return[...o,"null"];case"symbol":case"undefined":case"function":default:return o}},[]);if(n.length===r.length){const o=n.filter((s,a,i)=>i.indexOf(s)===a);return{type:o.length>1?o:o[0],enum:r.reduce((s,a)=>s.includes(a._def.value)?s:[...s,a._def.value],[])}}}else if(r.every(n=>n._def.typeName==="ZodEnum"))return{type:"string",enum:r.reduce((n,o)=>[...n,...o._def.values.filter(s=>!n.includes(s))],[])};return Qc(e,t)}var Qc=(e,t)=>{const r=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((n,o)=>N(n._def,{...t,currentPath:[...t.currentPath,"anyOf",`${o}`]})).filter(n=>!!n&&(!t.strictUnions||typeof n=="object"&&Object.keys(n).length>0));return r.length?{anyOf:r}:void 0};function Kc(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[ut[e.innerType._def.typeName],"null"]};const r=N(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return r&&{anyOf:[r,{type:"null"}]}}function eu(e){const t={type:"number"};if(!e.checks)return t;for(const r of e.checks)switch(r.kind){case"int":t.type="integer";break;case"min":r.inclusive?t.minimum=r.value:t.exclusiveMinimum=r.value;break;case"max":r.inclusive?t.maximum=r.value:t.exclusiveMaximum=r.value;break;case"multipleOf":t.multipleOf=r.value;break}return t}function tu(e,t){const r={type:"object",properties:{}},n=[],o=e.shape();for(const a in o){let i=o[a];if(i===void 0||i._def===void 0)continue;const u=nu(i),c=N(i._def,{...t,currentPath:[...t.currentPath,"properties",a],propertyPath:[...t.currentPath,"properties",a]});c!==void 0&&(r.properties[a]=c,u||n.push(a))}n.length&&(r.required=n);const s=ru(e,t);return s!==void 0&&(r.additionalProperties=s),r}function ru(e,t){if(e.catchall._def.typeName!=="ZodNever")return N(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 nu(e){try{return e.isOptional()}catch{return!0}}var ou=(e,t)=>{var r;if(t.currentPath.toString()===((r=t.propertyPath)==null?void 0:r.toString()))return N(e.innerType._def,t);const n=N(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return n?{anyOf:[{not:W()},n]}:W()},su=(e,t)=>{if(t.pipeStrategy==="input")return N(e.in._def,t);if(t.pipeStrategy==="output")return N(e.out._def,t);const r=N(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),n=N(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",r?"1":"0"]});return{allOf:[r,n].filter(o=>o!==void 0)}};function au(e,t){return N(e.type._def,t)}function iu(e,t){const n={type:"array",uniqueItems:!0,items:N(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&(n.minItems=e.minSize.value),e.maxSize&&(n.maxItems=e.maxSize.value),n}function cu(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((r,n)=>N(r._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[]),additionalItems:N(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((r,n)=>N(r._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[])}}function uu(){return{not:W()}}function lu(){return W()}var du=(e,t)=>N(e.innerType._def,t),pu=(e,t,r)=>{switch(t){case E.ZodString:return dn(e,r);case E.ZodNumber:return eu(e);case E.ZodObject:return tu(e,r);case E.ZodBigInt:return xc(e);case E.ZodBoolean:return jc();case E.ZodDate:return ln(e,r);case E.ZodUndefined:return uu();case E.ZodNull:return Hc();case E.ZodArray:return Rc(e,r);case E.ZodUnion:case E.ZodDiscriminatedUnion:return Xc(e,r);case E.ZodIntersection:return Bc(e,r);case E.ZodTuple:return cu(e,r);case E.ZodRecord:return fn(e,r);case E.ZodLiteral:return Fc(e);case E.ZodEnum:return Lc(e);case E.ZodNativeEnum:return qc(e);case E.ZodNullable:return Kc(e,r);case E.ZodOptional:return ou(e,r);case E.ZodMap:return Yc(e,r);case E.ZodSet:return iu(e,r);case E.ZodLazy:return()=>e.getter()._def;case E.ZodPromise:return au(e,r);case E.ZodNaN:case E.ZodNever:return Gc();case E.ZodEffects:return Uc(e,r);case E.ZodAny:return W();case E.ZodUnknown:return lu();case E.ZodDefault:return Dc(e,r);case E.ZodBranded:return un(e,r);case E.ZodReadonly:return du(e,r);case E.ZodCatch:return Cc(e,r);case E.ZodPipeline:return su(e,r);case E.ZodFunction:case E.ZodVoid:case E.ZodSymbol:return;default:return(n=>{})()}},fu=(e,t)=>{let r=0;for(;r<e.length&&r<t.length&&e[r]===t[r];r++);return[(e.length-r).toString(),...t.slice(r)].join("/")};function N(e,t,r=!1){var n;const o=t.seen.get(e);if(t.override){const u=(n=t.override)==null?void 0:n.call(t,e,t,o,r);if(u!==Pc)return u}if(o&&!r){const u=mu(o,t);if(u!==void 0)return u}const s={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,s);const a=pu(e,e.typeName,t),i=typeof a=="function"?N(a(),t):a;if(i&&hu(e,t,i),t.postProcess){const u=t.postProcess(i,e,t);return s.jsonSchema=i,u}return s.jsonSchema=i,i}var mu=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:fu(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every((r,n)=>t.currentPath[n]===r)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),W()):t.$refStrategy==="seen"?W():void 0}},hu=(e,t,r)=>(e.description&&(r.description=e.description),r),gu=e=>{const t=Ac(e),r=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,currentPath:r,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([n,o])=>[o._def,{def:o._def,path:[...t.basePath,t.definitionPath,n],jsonSchema:void 0}]))}},vu=(e,t)=>{var r;const n=gu(t);let o=typeof t=="object"&&t.definitions?Object.entries(t.definitions).reduce((c,[l,d])=>{var _;return{...c,[l]:(_=N(d._def,{...n,currentPath:[...n.basePath,n.definitionPath,l]},!0))!=null?_:W()}},{}):void 0;const s=typeof t=="string"?t:(t==null?void 0:t.nameStrategy)==="title"||t==null?void 0:t.name,a=(r=N(e._def,s===void 0?n:{...n,currentPath:[...n.basePath,n.definitionPath,s]},!1))!=null?r:W(),i=typeof t=="object"&&t.name!==void 0&&t.nameStrategy==="title"?t.name:void 0;i!==void 0&&(a.title=i);const u=s===void 0?o?{...a,[n.definitionPath]:o}:a:{$ref:[...n.$refStrategy==="relative"?[]:n.basePath,n.definitionPath,s].join("/"),[n.definitionPath]:{...o,[s]:a}};return u.$schema="http://json-schema.org/draft-07/schema#",u},lt=Symbol.for("vercel.ai.schema");function _u(e){let t;return()=>(t==null&&(t=e()),t)}function Be(e,{validate:t}={}){return{[lt]:!0,_type:void 0,get jsonSchema(){return typeof e=="function"&&(e=e()),e},validate:t}}function yu(e){return typeof e=="object"&&e!==null&&lt in e&&e[lt]===!0&&"jsonSchema"in e&&"validate"in e}function dt(e){return e==null?Be({properties:{},additionalProperties:!1}):yu(e)?e:"~standard"in e?e["~standard"].vendor==="zod"?mn(e):bu(e):e()}function bu(e){return Be(()=>at(e["~standard"].jsonSchema.input({target:"draft-07"})),{validate:async t=>{const r=await e["~standard"].validate(t);return"value"in r?{success:!0,value:r.value}:{success:!1,error:new ue({value:t,cause:r.issues})}}})}function wu(e,t){var r;const n=(r=t==null?void 0:t.useReferences)!=null?r:!1;return Be(()=>vu(e,{$refStrategy:n?"root":"none"}),{validate:async o=>{const s=await e.safeParseAsync(o);return s.success?{success:!0,value:s.data}:{success:!1,error:s.error}}})}function Iu(e,t){var r;const n=(r=t==null?void 0:t.useReferences)!=null?r:!1;return Be(()=>at(ii(e,{target:"draft-7",io:"input",reused:n?"ref":"inline"})),{validate:async o=>{const s=await Ur(e,o);return s.success?{success:!0,value:s.data}:{success:!1,error:s.error}}})}function Eu(e){return"_zod"in e}function mn(e,t){return Eu(e)?Iu(e,t):wu(e,t)}async function hn({value:e,schema:t}){const r=await ke({value:e,schema:t});if(!r.success)throw ue.wrap({value:e,cause:r.error});return r.value}async function ke({value:e,schema:t}){const r=dt(t);try{if(r.validate==null)return{success:!0,value:e,rawValue:e};const n=await r.validate(e);return n.success?{success:!0,value:n.value,rawValue:e}:{success:!1,error:ue.wrap({value:e,cause:n.error}),rawValue:e}}catch(n){return{success:!1,error:ue.wrap({value:e,cause:n}),rawValue:e}}}async function ce({text:e,schema:t}){try{const r=Tc(e);return t==null?{success:!0,value:r,rawValue:r}:await ke({value:r,schema:t})}catch(r){return{success:!1,error:Ot.isInstance(r)?r:new Ot({text:e,cause:r}),rawValue:void 0}}}function ku({stream:e,schema:t}){return e.pipeThrough(new TextDecoderStream).pipeThrough(new Sc).pipeThrough(new TransformStream({async transform({data:r},n){r!=="[DONE]"&&n.enqueue(await ce({text:r,schema:t}))}}))}async function re(e){return typeof e=="function"&&(e=e()),Promise.resolve(e)}var zu=Object.defineProperty,Su=(e,t)=>{for(var r in t)zu(e,r,{get:t[r],enumerable:!0})},gn="AI_NoObjectGeneratedError",vn=`vercel.ai.error.${gn}`,Ou=Symbol.for(vn),_n,ne=class extends H{constructor({message:e="No object generated.",cause:t,text:r,response:n,usage:o,finishReason:s}){super({name:gn,message:e,cause:t}),this[_n]=!0,this.text=r,this.response=n,this.usage=o,this.finishReason=s}static isInstance(e){return H.hasMarker(e,vn)}};_n=Ou;var yn="AI_UIMessageStreamError",bn=`vercel.ai.error.${yn}`,Zu=Symbol.for(bn),wn,ve=class extends H{constructor({chunkType:e,chunkId:t,message:r}){super({name:yn,message:r}),this[wn]=!0,this.chunkType=e,this.chunkId=t}static isInstance(e){return H.hasMarker(e,bn)}};wn=Zu;var In="6.0.42",En=V([v(),Le(Uint8Array),Le(ArrayBuffer),en(e=>{var t,r;return(r=(t=globalThis.Buffer)==null?void 0:t.isBuffer(e))!=null?r:!1},{message:"Must be a Buffer"})]),ze=wc(()=>V([Gi(),v(),Ji(),L(),we(v(),ze.optional()),ge(ze)])),Z=we(v(),we(v(),ze.optional())),kn=P({type:w("text"),text:v(),providerOptions:Z.optional()}),$u=P({type:w("image"),image:V([En,Le(URL)]),mediaType:v().optional(),providerOptions:Z.optional()}),zn=P({type:w("file"),data:V([En,Le(URL)]),filename:v().optional(),mediaType:v(),providerOptions:Z.optional()}),Nu=P({type:w("reasoning"),text:v(),providerOptions:Z.optional()}),Tu=P({type:w("tool-call"),toolCallId:v(),toolName:v(),input:X(),providerOptions:Z.optional(),providerExecuted:L().optional()}),Pu=ec("type",[P({type:w("text"),value:v(),providerOptions:Z.optional()}),P({type:w("json"),value:ze,providerOptions:Z.optional()}),P({type:w("execution-denied"),reason:v().optional(),providerOptions:Z.optional()}),P({type:w("error-text"),value:v(),providerOptions:Z.optional()}),P({type:w("error-json"),value:ze,providerOptions:Z.optional()}),P({type:w("content"),value:ge(V([P({type:w("text"),text:v(),providerOptions:Z.optional()}),P({type:w("media"),data:v(),mediaType:v()}),P({type:w("file-data"),data:v(),mediaType:v(),filename:v().optional(),providerOptions:Z.optional()}),P({type:w("file-url"),url:v(),providerOptions:Z.optional()}),P({type:w("file-id"),fileId:V([v(),we(v(),v())]),providerOptions:Z.optional()}),P({type:w("image-data"),data:v(),mediaType:v(),providerOptions:Z.optional()}),P({type:w("image-url"),url:v(),providerOptions:Z.optional()}),P({type:w("image-file-id"),fileId:V([v(),we(v(),v())]),providerOptions:Z.optional()}),P({type:w("custom"),providerOptions:Z.optional()})]))})]),Sn=P({type:w("tool-result"),toolCallId:v(),toolName:v(),output:Pu,providerOptions:Z.optional()}),Au=P({type:w("tool-approval-request"),approvalId:v(),toolCallId:v()}),Ru=P({type:w("tool-approval-response"),approvalId:v(),approved:L(),reason:v().optional()}),xu=P({role:w("system"),content:v(),providerOptions:Z.optional()}),ju=P({role:w("user"),content:V([v(),ge(V([kn,$u,zn]))]),providerOptions:Z.optional()}),Cu=P({role:w("assistant"),content:V([v(),ge(V([kn,zn,Nu,Tu,Sn,Au]))]),providerOptions:Z.optional()}),Mu=P({role:w("tool"),content:ge(V([Sn,Ru])),providerOptions:Z.optional()});V([xu,ju,Cu,Mu]);function On(e,t){if(e===void 0&&t===void 0)return;if(e===void 0)return t;if(t===void 0)return e;const r={...e};for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)){const o=t[n];if(o===void 0)continue;const s=n in e?e[n]:void 0,a=o!==null&&typeof o=="object"&&!Array.isArray(o)&&!(o instanceof Date)&&!(o instanceof RegExp),i=s!=null&&typeof s=="object"&&!Array.isArray(s)&&!(s instanceof Date)&&!(s instanceof RegExp);a&&i?r[n]=On(s,o):r[n]=o}return r}var Du={};Su(Du,{array:()=>Bu,choice:()=>Fu,json:()=>Ju,object:()=>Vu,text:()=>Lu});function Uu(e){const t=["ROOT"];let r=-1,n=null;function o(u,c,l){switch(u){case'"':{r=c,t.pop(),t.push(l),t.push("INSIDE_STRING");break}case"f":case"t":case"n":{r=c,n=c,t.pop(),t.push(l),t.push("INSIDE_LITERAL");break}case"-":{t.pop(),t.push(l),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":{r=c,t.pop(),t.push(l),t.push("INSIDE_NUMBER");break}case"{":{r=c,t.pop(),t.push(l),t.push("INSIDE_OBJECT_START");break}case"[":{r=c,t.pop(),t.push(l),t.push("INSIDE_ARRAY_START");break}}}function s(u,c){switch(u){case",":{t.pop(),t.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{r=c,t.pop();break}}}function a(u,c){switch(u){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{r=c,t.pop();break}}}for(let u=0;u<e.length;u++){const c=e[u];switch(t[t.length-1]){case"ROOT":o(c,u,"FINISH");break;case"INSIDE_OBJECT_START":{switch(c){case'"':{t.pop(),t.push("INSIDE_OBJECT_KEY");break}case"}":{r=u,t.pop();break}}break}case"INSIDE_OBJECT_AFTER_COMMA":{switch(c){case'"':{t.pop(),t.push("INSIDE_OBJECT_KEY");break}}break}case"INSIDE_OBJECT_KEY":{switch(c){case'"':{t.pop(),t.push("INSIDE_OBJECT_AFTER_KEY");break}}break}case"INSIDE_OBJECT_AFTER_KEY":{switch(c){case":":{t.pop(),t.push("INSIDE_OBJECT_BEFORE_VALUE");break}}break}case"INSIDE_OBJECT_BEFORE_VALUE":{o(c,u,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{s(c,u);break}case"INSIDE_STRING":{switch(c){case'"':{t.pop(),r=u;break}case"\\":{t.push("INSIDE_STRING_ESCAPE");break}default:r=u}break}case"INSIDE_ARRAY_START":{switch(c){case"]":{r=u,t.pop();break}default:{r=u,o(c,u,"INSIDE_ARRAY_AFTER_VALUE");break}}break}case"INSIDE_ARRAY_AFTER_VALUE":{switch(c){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{r=u,t.pop();break}default:{r=u;break}}break}case"INSIDE_ARRAY_AFTER_COMMA":{o(c,u,"INSIDE_ARRAY_AFTER_VALUE");break}case"INSIDE_STRING_ESCAPE":{t.pop(),r=u;break}case"INSIDE_NUMBER":{switch(c){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{r=u;break}case"e":case"E":case"-":case".":break;case",":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&a(c,u),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&s(c,u);break}case"}":{t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&s(c,u);break}case"]":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&a(c,u);break}default:{t.pop();break}}break}case"INSIDE_LITERAL":{const d=e.substring(n,u+1);!"false".startsWith(d)&&!"true".startsWith(d)&&!"null".startsWith(d)?(t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?s(c,u):t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&a(c,u)):r=u;break}}}let i=e.slice(0,r+1);for(let u=t.length-1;u>=0;u--)switch(t[u]){case"INSIDE_STRING":{i+='"';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":{i+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{i+="]";break}case"INSIDE_LITERAL":{const l=e.substring(n,e.length);"true".startsWith(l)?i+="true".slice(l.length):"false".startsWith(l)?i+="false".slice(l.length):"null".startsWith(l)&&(i+="null".slice(l.length))}}return i}async function Se(e){if(e===void 0)return{value:void 0,state:"undefined-input"};let t=await ce({text:e});return t.success?{value:t.value,state:"successful-parse"}:(t=await ce({text:Uu(e)}),t.success?{value:t.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}var Lu=()=>({name:"text",responseFormat:Promise.resolve({type:"text"}),async parseCompleteOutput({text:e}){return e},async parsePartialOutput({text:e}){return{partial:e}},createElementStreamTransform(){}}),Vu=({schema:e,name:t,description:r})=>{const n=dt(e);return{name:"object",responseFormat:re(n.jsonSchema).then(o=>({type:"json",schema:o,...t!=null&&{name:t},...r!=null&&{description:r}})),async parseCompleteOutput({text:o},s){const a=await ce({text:o});if(!a.success)throw new ne({message:"No object generated: could not parse the response.",cause:a.error,text:o,response:s.response,usage:s.usage,finishReason:s.finishReason});const i=await ke({value:a.value,schema:n});if(!i.success)throw new ne({message:"No object generated: response did not match schema.",cause:i.error,text:o,response:s.response,usage:s.usage,finishReason:s.finishReason});return i.value},async parsePartialOutput({text:o}){const s=await Se(o);switch(s.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:s.value}}},createElementStreamTransform(){}}},Bu=({element:e,name:t,description:r})=>{const n=dt(e);return{name:"array",responseFormat:re(n.jsonSchema).then(o=>{const{$schema:s,...a}=o;return{type:"json",schema:{$schema:"http://json-schema.org/draft-07/schema#",type:"object",properties:{elements:{type:"array",items:a}},required:["elements"],additionalProperties:!1},...t!=null&&{name:t},...r!=null&&{description:r}}}),async parseCompleteOutput({text:o},s){const a=await ce({text:o});if(!a.success)throw new ne({message:"No object generated: could not parse the response.",cause:a.error,text:o,response:s.response,usage:s.usage,finishReason:s.finishReason});const i=a.value;if(i==null||typeof i!="object"||!("elements"in i)||!Array.isArray(i.elements))throw new ne({message:"No object generated: response did not match schema.",cause:new ue({value:i,cause:"response must be an object with an elements array"}),text:o,response:s.response,usage:s.usage,finishReason:s.finishReason});for(const u of i.elements){const c=await ke({value:u,schema:n});if(!c.success)throw new ne({message:"No object generated: response did not match schema.",cause:c.error,text:o,response:s.response,usage:s.usage,finishReason:s.finishReason})}return i.elements},async parsePartialOutput({text:o}){const s=await Se(o);switch(s.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const a=s.value;if(a==null||typeof a!="object"||!("elements"in a)||!Array.isArray(a.elements))return;const i=s.state==="repaired-parse"&&a.elements.length>0?a.elements.slice(0,-1):a.elements,u=[];for(const c of i){const l=await ke({value:c,schema:n});l.success&&u.push(l.value)}return{partial:u}}}},createElementStreamTransform(){let o=0;return new TransformStream({transform({partialOutput:s},a){if(s!=null)for(;o<s.length;o++)a.enqueue(s[o])}})}}},Fu=({options:e,name:t,description:r})=>({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},...r!=null&&{description:r}}),async parseCompleteOutput({text:n},o){const s=await ce({text:n});if(!s.success)throw new ne({message:"No object generated: could not parse the response.",cause:s.error,text:n,response:o.response,usage:o.usage,finishReason:o.finishReason});const a=s.value;if(a==null||typeof a!="object"||!("result"in a)||typeof a.result!="string"||!e.includes(a.result))throw new ne({message:"No object generated: response did not match schema.",cause:new ue({value:a,cause:"response must be an object that contains a choice value."}),text:n,response:o.response,usage:o.usage,finishReason:o.finishReason});return a.result},async parsePartialOutput({text:n}){const o=await Se(n);switch(o.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":{const s=o.value;if(s==null||typeof s!="object"||!("result"in s)||typeof s.result!="string")return;const a=e.filter(i=>i.startsWith(s.result));return o.state==="successful-parse"?a.includes(s.result)?{partial:s.result}:void 0:a.length===1?{partial:a[0]}:void 0}}},createElementStreamTransform(){}}),Ju=({name:e,description:t}={})=>({name:"json",responseFormat:Promise.resolve({type:"json",...e!=null&&{name:e},...t!=null&&{description:t}}),async parseCompleteOutput({text:r},n){const o=await ce({text:r});if(!o.success)throw new ne({message:"No object generated: could not parse the response.",cause:o.error,text:r,response:n.response,usage:n.usage,finishReason:n.finishReason});return o.value},async parsePartialOutput({text:r}){const n=await Se(r);switch(n.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return n.value===void 0?void 0:{partial:n.value}}},createElementStreamTransform(){}});Ee({prefix:"aitxt",size:24}),class extends TransformStream{constructor(){super({transform(e,t){t.enqueue(`data: ${JSON.stringify(e)}
50
50
 
51
51
  `)},flush(e){e.enqueue(`data: [DONE]
52
52
 
53
- `)}})}};var Bc=gc(()=>dn(R([Z({type:h("text-start"),id:y(),providerMetadata:A.optional()}),Z({type:h("text-delta"),id:y(),delta:y(),providerMetadata:A.optional()}),Z({type:h("text-end"),id:y(),providerMetadata:A.optional()}),Z({type:h("error"),errorText:y()}),Z({type:h("tool-input-start"),toolCallId:y(),toolName:y(),providerExecuted:Y().optional(),providerMetadata:A.optional(),dynamic:Y().optional(),title:y().optional()}),Z({type:h("tool-input-delta"),toolCallId:y(),inputTextDelta:y()}),Z({type:h("tool-input-available"),toolCallId:y(),toolName:y(),input:H(),providerExecuted:Y().optional(),providerMetadata:A.optional(),dynamic:Y().optional(),title:y().optional()}),Z({type:h("tool-input-error"),toolCallId:y(),toolName:y(),input:H(),providerExecuted:Y().optional(),providerMetadata:A.optional(),dynamic:Y().optional(),errorText:y(),title:y().optional()}),Z({type:h("tool-approval-request"),approvalId:y(),toolCallId:y()}),Z({type:h("tool-output-available"),toolCallId:y(),output:H(),providerExecuted:Y().optional(),dynamic:Y().optional(),preliminary:Y().optional()}),Z({type:h("tool-output-error"),toolCallId:y(),errorText:y(),providerExecuted:Y().optional(),dynamic:Y().optional()}),Z({type:h("tool-output-denied"),toolCallId:y()}),Z({type:h("reasoning-start"),id:y(),providerMetadata:A.optional()}),Z({type:h("reasoning-delta"),id:y(),delta:y(),providerMetadata:A.optional()}),Z({type:h("reasoning-end"),id:y(),providerMetadata:A.optional()}),Z({type:h("source-url"),sourceId:y(),url:y(),title:y().optional(),providerMetadata:A.optional()}),Z({type:h("source-document"),sourceId:y(),mediaType:y(),title:y(),filename:y().optional(),providerMetadata:A.optional()}),Z({type:h("file"),url:y(),mediaType:y(),providerMetadata:A.optional()}),Z({type:en(e=>typeof e=="string"&&e.startsWith("data-"),{message:'Type must start with "data-"'}),id:y().optional(),data:H(),transient:Y().optional()}),Z({type:h("start-step")}),Z({type:h("finish-step")}),Z({type:h("start"),messageId:y().optional(),messageMetadata:H().optional()}),Z({type:h("finish"),finishReason:Wr(["stop","length","content-filter","tool-calls","error","other"]).optional(),messageMetadata:H().optional()}),Z({type:h("abort"),reason:y().optional()}),Z({type:h("message-metadata"),messageMetadata:H()})])));function Wc(e){return e.type.startsWith("data-")}function jt(e){return e.type.startsWith("tool-")}function Gc(e){return e.type==="dynamic-tool"}function Mt(e){return jt(e)||Gc(e)}function An(e){return e.type.split("-").slice(1).join("-")}function qc({lastMessage:e,messageId:t}){return{message:(e==null?void 0:e.role)==="assistant"?e:{id:t,metadata:void 0,role:"assistant",parts:[]},activeTextParts:{},activeReasoningParts:{},partialToolCalls:{}}}function Hc({stream:e,messageMetadataSchema:t,dataPartSchemas:r,runUpdateMessageJob:n,onError:u,onToolCall:o,onData:i}){return e.pipeThrough(new TransformStream({async transform(s,c){await n(async({state:a,write:L})=>{var l,f,d,I;function p(M){const C=a.message.parts.filter(Mt).find(v=>v.toolCallId===M);if(C==null)throw new ye({chunkType:"tool-invocation",chunkId:M,message:`No tool invocation found for tool call ID "${M}".`});return C}function g(M){var z;const C=a.message.parts.find(J=>jt(J)&&J.toolCallId===M.toolCallId),v=M,w=C;C!=null?(C.state=M.state,w.input=v.input,w.output=v.output,w.errorText=v.errorText,w.rawInput=v.rawInput,w.preliminary=v.preliminary,M.title!==void 0&&(w.title=M.title),w.providerExecuted=(z=v.providerExecuted)!=null?z:C.providerExecuted,v.providerMetadata!=null&&(C.callProviderMetadata=v.providerMetadata)):a.message.parts.push({type:`tool-${M.toolName}`,toolCallId:M.toolCallId,state:M.state,title:M.title,input:v.input,output:v.output,rawInput:v.rawInput,errorText:v.errorText,providerExecuted:v.providerExecuted,preliminary:v.preliminary,...v.providerMetadata!=null?{callProviderMetadata:v.providerMetadata}:{}})}function N(M){var z,C;const v=a.message.parts.find(wn=>wn.type==="dynamic-tool"&&wn.toolCallId===M.toolCallId),w=M,J=v;v!=null?(v.state=M.state,J.toolName=M.toolName,J.input=w.input,J.output=w.output,J.errorText=w.errorText,J.rawInput=(z=w.rawInput)!=null?z:J.rawInput,J.preliminary=w.preliminary,M.title!==void 0&&(J.title=M.title),J.providerExecuted=(C=w.providerExecuted)!=null?C:v.providerExecuted,w.providerMetadata!=null&&(v.callProviderMetadata=w.providerMetadata)):a.message.parts.push({type:"dynamic-tool",toolName:M.toolName,toolCallId:M.toolCallId,state:M.state,input:w.input,output:w.output,errorText:w.errorText,preliminary:w.preliminary,providerExecuted:w.providerExecuted,title:M.title,...w.providerMetadata!=null?{callProviderMetadata:w.providerMetadata}:{}})}async function x(M){if(M!=null){const z=a.message.metadata!=null?_n(a.message.metadata,M):M;t!=null&&await Sn({value:z,schema:t}),a.message.metadata=z}}switch(s.type){case"text-start":{const M={type:"text",text:"",providerMetadata:s.providerMetadata,state:"streaming"};a.activeTextParts[s.id]=M,a.message.parts.push(M),L();break}case"text-delta":{const M=a.activeTextParts[s.id];if(M==null)throw new ye({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.`});M.text+=s.delta,M.providerMetadata=(l=s.providerMetadata)!=null?l:M.providerMetadata,L();break}case"text-end":{const M=a.activeTextParts[s.id];if(M==null)throw new ye({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.`});M.state="done",M.providerMetadata=(f=s.providerMetadata)!=null?f:M.providerMetadata,delete a.activeTextParts[s.id],L();break}case"reasoning-start":{const M={type:"reasoning",text:"",providerMetadata:s.providerMetadata,state:"streaming"};a.activeReasoningParts[s.id]=M,a.message.parts.push(M),L();break}case"reasoning-delta":{const M=a.activeReasoningParts[s.id];if(M==null)throw new ye({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.`});M.text+=s.delta,M.providerMetadata=(d=s.providerMetadata)!=null?d:M.providerMetadata,L();break}case"reasoning-end":{const M=a.activeReasoningParts[s.id];if(M==null)throw new ye({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.`});M.providerMetadata=(I=s.providerMetadata)!=null?I:M.providerMetadata,M.state="done",delete a.activeReasoningParts[s.id],L();break}case"file":{a.message.parts.push({type:"file",mediaType:s.mediaType,url:s.url}),L();break}case"source-url":{a.message.parts.push({type:"source-url",sourceId:s.sourceId,url:s.url,title:s.title,providerMetadata:s.providerMetadata}),L();break}case"source-document":{a.message.parts.push({type:"source-document",sourceId:s.sourceId,mediaType:s.mediaType,title:s.title,filename:s.filename,providerMetadata:s.providerMetadata}),L();break}case"tool-input-start":{const M=a.message.parts.filter(jt);a.partialToolCalls[s.toolCallId]={text:"",toolName:s.toolName,index:M.length,dynamic:s.dynamic,title:s.title},s.dynamic?N({toolCallId:s.toolCallId,toolName:s.toolName,state:"input-streaming",input:void 0,providerExecuted:s.providerExecuted,title:s.title,providerMetadata:s.providerMetadata}):g({toolCallId:s.toolCallId,toolName:s.toolName,state:"input-streaming",input:void 0,providerExecuted:s.providerExecuted,title:s.title,providerMetadata:s.providerMetadata}),L();break}case"tool-input-delta":{const M=a.partialToolCalls[s.toolCallId];if(M==null)throw new ye({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.`});M.text+=s.inputTextDelta;const{value:z}=await ve(M.text);M.dynamic?N({toolCallId:s.toolCallId,toolName:M.toolName,state:"input-streaming",input:z,title:M.title}):g({toolCallId:s.toolCallId,toolName:M.toolName,state:"input-streaming",input:z,title:M.title}),L();break}case"tool-input-available":{s.dynamic?N({toolCallId:s.toolCallId,toolName:s.toolName,state:"input-available",input:s.input,providerExecuted:s.providerExecuted,providerMetadata:s.providerMetadata,title:s.title}):g({toolCallId:s.toolCallId,toolName:s.toolName,state:"input-available",input:s.input,providerExecuted:s.providerExecuted,providerMetadata:s.providerMetadata,title:s.title}),L(),o&&!s.providerExecuted&&await o({toolCall:s});break}case"tool-input-error":{s.dynamic?N({toolCallId:s.toolCallId,toolName:s.toolName,state:"output-error",input:s.input,errorText:s.errorText,providerExecuted:s.providerExecuted,providerMetadata:s.providerMetadata}):g({toolCallId:s.toolCallId,toolName:s.toolName,state:"output-error",input:void 0,rawInput:s.input,errorText:s.errorText,providerExecuted:s.providerExecuted,providerMetadata:s.providerMetadata}),L();break}case"tool-approval-request":{const M=p(s.toolCallId);M.state="approval-requested",M.approval={id:s.approvalId},L();break}case"tool-output-denied":{const M=p(s.toolCallId);M.state="output-denied",L();break}case"tool-output-available":{const M=p(s.toolCallId);M.type==="dynamic-tool"?N({toolCallId:s.toolCallId,toolName:M.toolName,state:"output-available",input:M.input,output:s.output,preliminary:s.preliminary,providerExecuted:s.providerExecuted,title:M.title}):g({toolCallId:s.toolCallId,toolName:An(M),state:"output-available",input:M.input,output:s.output,providerExecuted:s.providerExecuted,preliminary:s.preliminary,title:M.title}),L();break}case"tool-output-error":{const M=p(s.toolCallId);M.type==="dynamic-tool"?N({toolCallId:s.toolCallId,toolName:M.toolName,state:"output-error",input:M.input,errorText:s.errorText,providerExecuted:s.providerExecuted,title:M.title}):g({toolCallId:s.toolCallId,toolName:An(M),state:"output-error",input:M.input,rawInput:M.rawInput,errorText:s.errorText,providerExecuted:s.providerExecuted,title:M.title}),L();break}case"start-step":{a.message.parts.push({type:"step-start"});break}case"finish-step":{a.activeTextParts={},a.activeReasoningParts={};break}case"start":{s.messageId!=null&&(a.message.id=s.messageId),await x(s.messageMetadata),(s.messageId!=null||s.messageMetadata!=null)&&L();break}case"finish":{s.finishReason!=null&&(a.finishReason=s.finishReason),await x(s.messageMetadata),s.messageMetadata!=null&&L();break}case"message-metadata":{await x(s.messageMetadata),s.messageMetadata!=null&&L();break}case"error":{u==null||u(new Error(s.errorText));break}default:if(Wc(s)){(r==null?void 0:r[s.type])!=null&&await Sn({value:s.data,schema:r[s.type]});const M=s;if(M.transient){i==null||i(M);break}const z=M.id!=null?a.message.parts.find(C=>M.type===C.type&&M.id===C.id):void 0;z!=null?z.data=M.data:a.message.parts.push(M),i==null||i(M),L()}}c.enqueue(s)})}}))}async function Xc({stream:e,onError:t}){const r=e.getReader();try{for(;;){const{done:n}=await r.read();if(n)break}}catch(n){t==null||t(n)}finally{r.releaseLock()}}Ee({prefix:"aitxt",size:24}),Ee({prefix:"aiobj",size:24});var Kc=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,r)=>{this.queue.push(async()=>{try{await e(),t()}catch(n){r(n)}}),this.processQueue()})}};Ee({prefix:"aiobj",size:24});async function eL(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=>{const{name:r,type:n}=t,u=await new Promise((o,i)=>{const s=new FileReader;s.onload=c=>{var a;o((a=c.target)==null?void 0:a.result)},s.onerror=c=>i(c),s.readAsDataURL(t)});return{type:"file",mediaType:n,filename:r,url:u}}))}var tL=class{constructor({api:e="/api/chat",credentials:t,headers:r,body:n,fetch:u,prepareSendMessagesRequest:o,prepareReconnectToStreamRequest:i}){this.api=e,this.credentials=t,this.headers=r,this.body=n,this.fetch=u,this.prepareSendMessagesRequest=o,this.prepareReconnectToStreamRequest=i}async sendMessages({abortSignal:e,...t}){var r,n,u,o,i;const s=await re(this.body),c=await re(this.headers),a=await re(this.credentials),L={...ie(c),...ie(t.headers)},l=await((r=this.prepareSendMessagesRequest)==null?void 0:r.call(this,{api:this.api,id:t.chatId,messages:t.messages,body:{...s,...t.body},headers:L,credentials:a,requestMetadata:t.metadata,trigger:t.trigger,messageId:t.messageId})),f=(n=l==null?void 0:l.api)!=null?n:this.api,d=(l==null?void 0:l.headers)!==void 0?ie(l.headers):L,I=(l==null?void 0:l.body)!==void 0?l.body:{...s,...t.body,id:t.chatId,messages:t.messages,trigger:t.trigger,messageId:t.messageId},p=(u=l==null?void 0:l.credentials)!=null?u:a,N=await((o=this.fetch)!=null?o:globalThis.fetch)(f,{method:"POST",headers:on({"Content-Type":"application/json",...d},`ai-sdk/${In}`,un()),body:JSON.stringify(I),credentials:p,signal:e});if(!N.ok)throw new Error((i=await N.text())!=null?i:"Failed to fetch the chat response.");if(!N.body)throw new Error("The response body is empty.");return this.processResponseStream(N.body)}async reconnectToStream(e){var t,r,n,u,o;const i=await re(this.body),s=await re(this.headers),c=await re(this.credentials),a={...ie(s),...ie(e.headers)},L=await((t=this.prepareReconnectToStreamRequest)==null?void 0:t.call(this,{api:this.api,id:e.chatId,body:{...i,...e.body},headers:a,credentials:c,requestMetadata:e.metadata})),l=(r=L==null?void 0:L.api)!=null?r:`${this.api}/${e.chatId}/stream`,f=(L==null?void 0:L.headers)!==void 0?ie(L.headers):a,d=(n=L==null?void 0:L.credentials)!=null?n:c,p=await((u=this.fetch)!=null?u:globalThis.fetch)(l,{method:"GET",headers:on(f,`ai-sdk/${In}`,un()),credentials:d});if(p.status===204)return null;if(!p.ok)throw new Error((o=await p.text())!=null?o:"Failed to fetch the chat response.");if(!p.body)throw new Error("The response body is empty.");return this.processResponseStream(p.body)}},Cn=class extends tL{constructor(e={}){super(e)}processResponseStream(e){return xc({stream:e,schema:Bc}).pipeThrough(new TransformStream({async transform(t,r){if(!t.success)throw t.error;r.enqueue(t.value)}}))}},rL=class{constructor({generateId:e=Aa,id:t=e(),transport:r=new Cn,messageMetadataSchema:n,dataPartSchemas:u,state:o,onError:i,onToolCall:s,onFinish:c,onData:a,sendAutomaticallyWhen:L}){this.activeResponse=void 0,this.jobExecutor=new Kc,this.sendMessage=async(l,f)=>{var d,I,p,g;if(l==null){await this.makeRequest({trigger:"submit-message",messageId:(d=this.lastMessage)==null?void 0:d.id,...f});return}let N;if("text"in l||"files"in l?N={parts:[...Array.isArray(l.files)?l.files:await eL(l.files),..."text"in l&&l.text!=null?[{type:"text",text:l.text}]:[]]}:N=l,l.messageId!=null){const x=this.state.messages.findIndex(M=>M.id===l.messageId);if(x===-1)throw new Error(`message with id ${l.messageId} not found`);if(this.state.messages[x].role!=="user")throw new Error(`message with id ${l.messageId} is not a user message`);this.state.messages=this.state.messages.slice(0,x+1),this.state.replaceMessage(x,{...N,id:l.messageId,role:(I=N.role)!=null?I:"user",metadata:l.metadata})}else this.state.pushMessage({...N,id:(p=N.id)!=null?p:this.generateId(),role:(g=N.role)!=null?g:"user",metadata:l.metadata});await this.makeRequest({trigger:"submit-message",messageId:l.messageId,...f})},this.regenerate=async({messageId:l,...f}={})=>{const d=l==null?this.state.messages.length-1:this.state.messages.findIndex(I=>I.id===l);if(d===-1)throw new Error(`message ${l} not found`);this.state.messages=this.state.messages.slice(0,this.messages[d].role==="assistant"?d:d+1),await this.makeRequest({trigger:"regenerate-message",messageId:l,...f})},this.resumeStream=async(l={})=>{await this.makeRequest({trigger:"resume-stream",...l})},this.clearError=()=>{this.status==="error"&&(this.state.error=void 0,this.setStatus({status:"ready"}))},this.addToolApprovalResponse=async({id:l,approved:f,reason:d})=>this.jobExecutor.run(async()=>{var I,p;const g=this.state.messages,N=g[g.length-1],x=M=>Mt(M)&&M.state==="approval-requested"&&M.approval.id===l?{...M,state:"approval-responded",approval:{id:l,approved:f,reason:d}}:M;this.state.replaceMessage(g.length-1,{...N,parts:N.parts.map(x)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(x)),this.status!=="streaming"&&this.status!=="submitted"&&((I=this.sendAutomaticallyWhen)!=null&&I.call(this,{messages:this.state.messages}))&&this.makeRequest({trigger:"submit-message",messageId:(p=this.lastMessage)==null?void 0:p.id})}),this.addToolOutput=async({state:l="output-available",tool:f,toolCallId:d,output:I,errorText:p})=>this.jobExecutor.run(async()=>{var g,N;const x=this.state.messages,M=x[x.length-1],z=C=>Mt(C)&&C.toolCallId===d?{...C,state:l,output:I,errorText:p}:C;this.state.replaceMessage(x.length-1,{...M,parts:M.parts.map(z)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(z)),this.status!=="streaming"&&this.status!=="submitted"&&((g=this.sendAutomaticallyWhen)!=null&&g.call(this,{messages:this.state.messages}))&&this.makeRequest({trigger:"submit-message",messageId:(N=this.lastMessage)==null?void 0:N.id})}),this.addToolResult=this.addToolOutput,this.stop=async()=>{var l;this.status!=="streaming"&&this.status!=="submitted"||(l=this.activeResponse)!=null&&l.abortController&&this.activeResponse.abortController.abort()},this.id=t,this.transport=r,this.generateId=e,this.messageMetadataSchema=n,this.dataPartSchemas=u,this.state=o,this.onError=i,this.onToolCall=s,this.onFinish=c,this.onData=a,this.sendAutomaticallyWhen=L}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 makeRequest({trigger:e,metadata:t,headers:r,body:n,messageId:u}){var o,i,s,c;this.setStatus({status:"submitted",error:void 0});const a=this.lastMessage;let L=!1,l=!1,f=!1;try{const d={state:qc({lastMessage:this.state.snapshot(a),messageId:this.generateId()}),abortController:new AbortController};d.abortController.signal.addEventListener("abort",()=>{L=!0}),this.activeResponse=d;let I;if(e==="resume-stream"){const g=await this.transport.reconnectToStream({chatId:this.id,metadata:t,headers:r,body:n});if(g==null){this.setStatus({status:"ready"});return}I=g}else I=await this.transport.sendMessages({chatId:this.id,messages:this.state.messages,abortSignal:d.abortController.signal,metadata:t,headers:r,body:n,trigger:e,messageId:u});const p=g=>this.jobExecutor.run(()=>g({state:d.state,write:()=>{var N;this.setStatus({status:"streaming"}),d.state.message.id===((N=this.lastMessage)==null?void 0:N.id)?this.state.replaceMessage(this.state.messages.length-1,d.state.message):this.state.pushMessage(d.state.message)}}));await Xc({stream:Hc({stream:I,onToolCall:this.onToolCall,onData:this.onData,messageMetadataSchema:this.messageMetadataSchema,dataPartSchemas:this.dataPartSchemas,runUpdateMessageJob:p,onError:g=>{throw g}}),onError:g=>{throw g}}),this.setStatus({status:"ready"})}catch(d){if(L||d.name==="AbortError")return L=!0,this.setStatus({status:"ready"}),null;f=!0,d instanceof TypeError&&(d.message.toLowerCase().includes("fetch")||d.message.toLowerCase().includes("network"))&&(l=!0),this.onError&&d instanceof Error&&this.onError(d),this.setStatus({status:"error",error:d})}finally{try{(i=this.onFinish)==null||i.call(this,{message:this.activeResponse.state.message,messages:this.state.messages,isAbort:L,isDisconnect:l,isError:f,finishReason:(o=this.activeResponse)==null?void 0:o.state.finishReason})}catch(d){console.error(d)}this.activeResponse=void 0}(s=this.sendAutomaticallyWhen)!=null&&s.call(this,{messages:this.state.messages})&&!f&&await this.makeRequest({trigger:"submit-message",messageId:(c=this.lastMessage)==null?void 0:c.id,metadata:t,headers:r,body:n})}},bn=globalThis&&globalThis.__assign||function(){return bn=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var u in t)Object.prototype.hasOwnProperty.call(t,u)&&(e[u]=t[u])}return e},bn.apply(this,arguments)};globalThis&&globalThis.__awaiter,globalThis&&globalThis.__generator,globalThis&&globalThis.__read,globalThis&&globalThis.__spreadArray;var nL=class{constructor(e){this.statusRef=S.ref("ready"),this.errorRef=S.ref(void 0),this.pushMessage=t=>{this.messagesRef.value=[...this.messagesRef.value,t]},this.popMessage=()=>{this.messagesRef.value=this.messagesRef.value.slice(0,-1)},this.replaceMessage=(t,r)=>{this.messagesRef.value[t]={...r}},this.snapshot=t=>t,this.messagesRef=S.ref(e??[])}get messages(){return this.messagesRef.value}set messages(e){this.messagesRef.value=e}get status(){return this.statusRef.value}set status(e){this.statusRef.value=e}get error(){return this.errorRef.value}set error(e){this.errorRef.value=e}},uL=class extends rL{constructor({messages:e,...t}){super({...t,state:new nL(e)})}};/**
53
+ `)}})}};var Wu=_u(()=>mn(V([C({type:w("text-start"),id:v(),providerMetadata:Z.optional()}),C({type:w("text-delta"),id:v(),delta:v(),providerMetadata:Z.optional()}),C({type:w("text-end"),id:v(),providerMetadata:Z.optional()}),C({type:w("error"),errorText:v()}),C({type:w("tool-input-start"),toolCallId:v(),toolName:v(),providerExecuted:L().optional(),providerMetadata:Z.optional(),dynamic:L().optional(),title:v().optional()}),C({type:w("tool-input-delta"),toolCallId:v(),inputTextDelta:v()}),C({type:w("tool-input-available"),toolCallId:v(),toolName:v(),input:X(),providerExecuted:L().optional(),providerMetadata:Z.optional(),dynamic:L().optional(),title:v().optional()}),C({type:w("tool-input-error"),toolCallId:v(),toolName:v(),input:X(),providerExecuted:L().optional(),providerMetadata:Z.optional(),dynamic:L().optional(),errorText:v(),title:v().optional()}),C({type:w("tool-approval-request"),approvalId:v(),toolCallId:v()}),C({type:w("tool-output-available"),toolCallId:v(),output:X(),providerExecuted:L().optional(),dynamic:L().optional(),preliminary:L().optional()}),C({type:w("tool-output-error"),toolCallId:v(),errorText:v(),providerExecuted:L().optional(),dynamic:L().optional()}),C({type:w("tool-output-denied"),toolCallId:v()}),C({type:w("reasoning-start"),id:v(),providerMetadata:Z.optional()}),C({type:w("reasoning-delta"),id:v(),delta:v(),providerMetadata:Z.optional()}),C({type:w("reasoning-end"),id:v(),providerMetadata:Z.optional()}),C({type:w("source-url"),sourceId:v(),url:v(),title:v().optional(),providerMetadata:Z.optional()}),C({type:w("source-document"),sourceId:v(),mediaType:v(),title:v(),filename:v().optional(),providerMetadata:Z.optional()}),C({type:w("file"),url:v(),mediaType:v(),providerMetadata:Z.optional()}),C({type:en(e=>typeof e=="string"&&e.startsWith("data-"),{message:'Type must start with "data-"'}),id:v().optional(),data:X(),transient:L().optional()}),C({type:w("start-step")}),C({type:w("finish-step")}),C({type:w("start"),messageId:v().optional(),messageMetadata:X().optional()}),C({type:w("finish"),finishReason:qr(["stop","length","content-filter","tool-calls","error","other"]).optional(),messageMetadata:X().optional()}),C({type:w("abort"),reason:v().optional()}),C({type:w("message-metadata"),messageMetadata:X()})])));function Yu(e){return e.type.startsWith("data-")}function pt(e){return e.type.startsWith("tool-")}function qu(e){return e.type==="dynamic-tool"}function ft(e){return pt(e)||qu(e)}function Zn(e){return e.type.split("-").slice(1).join("-")}function Gu({lastMessage:e,messageId:t}){return{message:(e==null?void 0:e.role)==="assistant"?e:{id:t,metadata:void 0,role:"assistant",parts:[]},activeTextParts:{},activeReasoningParts:{},partialToolCalls:{}}}function Hu({stream:e,messageMetadataSchema:t,dataPartSchemas:r,runUpdateMessageJob:n,onError:o,onToolCall:s,onData:a}){return e.pipeThrough(new TransformStream({async transform(i,u){await n(async({state:c,write:l})=>{var d,_,m,I;function g(f){const $=c.message.parts.filter(ft).find(S=>S.toolCallId===f);if($==null)throw new ve({chunkType:"tool-invocation",chunkId:f,message:`No tool invocation found for tool call ID "${f}".`});return $}function y(f){var T;const $=c.message.parts.find(J=>pt(J)&&J.toolCallId===f.toolCallId),S=f,A=$;$!=null?($.state=f.state,A.input=S.input,A.output=S.output,A.errorText=S.errorText,A.rawInput=S.rawInput,A.preliminary=S.preliminary,f.title!==void 0&&(A.title=f.title),A.providerExecuted=(T=S.providerExecuted)!=null?T:$.providerExecuted,S.providerMetadata!=null&&($.callProviderMetadata=S.providerMetadata)):c.message.parts.push({type:`tool-${f.toolName}`,toolCallId:f.toolCallId,state:f.state,title:f.title,input:S.input,output:S.output,rawInput:S.rawInput,errorText:S.errorText,providerExecuted:S.providerExecuted,preliminary:S.preliminary,...S.providerMetadata!=null?{callProviderMetadata:S.providerMetadata}:{}})}function k(f){var T,$;const S=c.message.parts.find(An=>An.type==="dynamic-tool"&&An.toolCallId===f.toolCallId),A=f,J=S;S!=null?(S.state=f.state,J.toolName=f.toolName,J.input=A.input,J.output=A.output,J.errorText=A.errorText,J.rawInput=(T=A.rawInput)!=null?T:J.rawInput,J.preliminary=A.preliminary,f.title!==void 0&&(J.title=f.title),J.providerExecuted=($=A.providerExecuted)!=null?$:S.providerExecuted,A.providerMetadata!=null&&(S.callProviderMetadata=A.providerMetadata)):c.message.parts.push({type:"dynamic-tool",toolName:f.toolName,toolCallId:f.toolCallId,state:f.state,input:A.input,output:A.output,errorText:A.errorText,preliminary:A.preliminary,providerExecuted:A.providerExecuted,title:f.title,...A.providerMetadata!=null?{callProviderMetadata:A.providerMetadata}:{}})}async function z(f){if(f!=null){const T=c.message.metadata!=null?On(c.message.metadata,f):f;t!=null&&await hn({value:T,schema:t}),c.message.metadata=T}}switch(i.type){case"text-start":{const f={type:"text",text:"",providerMetadata:i.providerMetadata,state:"streaming"};c.activeTextParts[i.id]=f,c.message.parts.push(f),l();break}case"text-delta":{const f=c.activeTextParts[i.id];if(f==null)throw new ve({chunkType:"text-delta",chunkId:i.id,message:`Received text-delta for missing text part with ID "${i.id}". Ensure a "text-start" chunk is sent before any "text-delta" chunks.`});f.text+=i.delta,f.providerMetadata=(d=i.providerMetadata)!=null?d:f.providerMetadata,l();break}case"text-end":{const f=c.activeTextParts[i.id];if(f==null)throw new ve({chunkType:"text-end",chunkId:i.id,message:`Received text-end for missing text part with ID "${i.id}". Ensure a "text-start" chunk is sent before any "text-end" chunks.`});f.state="done",f.providerMetadata=(_=i.providerMetadata)!=null?_:f.providerMetadata,delete c.activeTextParts[i.id],l();break}case"reasoning-start":{const f={type:"reasoning",text:"",providerMetadata:i.providerMetadata,state:"streaming"};c.activeReasoningParts[i.id]=f,c.message.parts.push(f),l();break}case"reasoning-delta":{const f=c.activeReasoningParts[i.id];if(f==null)throw new ve({chunkType:"reasoning-delta",chunkId:i.id,message:`Received reasoning-delta for missing reasoning part with ID "${i.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-delta" chunks.`});f.text+=i.delta,f.providerMetadata=(m=i.providerMetadata)!=null?m:f.providerMetadata,l();break}case"reasoning-end":{const f=c.activeReasoningParts[i.id];if(f==null)throw new ve({chunkType:"reasoning-end",chunkId:i.id,message:`Received reasoning-end for missing reasoning part with ID "${i.id}". Ensure a "reasoning-start" chunk is sent before any "reasoning-end" chunks.`});f.providerMetadata=(I=i.providerMetadata)!=null?I:f.providerMetadata,f.state="done",delete c.activeReasoningParts[i.id],l();break}case"file":{c.message.parts.push({type:"file",mediaType:i.mediaType,url:i.url}),l();break}case"source-url":{c.message.parts.push({type:"source-url",sourceId:i.sourceId,url:i.url,title:i.title,providerMetadata:i.providerMetadata}),l();break}case"source-document":{c.message.parts.push({type:"source-document",sourceId:i.sourceId,mediaType:i.mediaType,title:i.title,filename:i.filename,providerMetadata:i.providerMetadata}),l();break}case"tool-input-start":{const f=c.message.parts.filter(pt);c.partialToolCalls[i.toolCallId]={text:"",toolName:i.toolName,index:f.length,dynamic:i.dynamic,title:i.title},i.dynamic?k({toolCallId:i.toolCallId,toolName:i.toolName,state:"input-streaming",input:void 0,providerExecuted:i.providerExecuted,title:i.title,providerMetadata:i.providerMetadata}):y({toolCallId:i.toolCallId,toolName:i.toolName,state:"input-streaming",input:void 0,providerExecuted:i.providerExecuted,title:i.title,providerMetadata:i.providerMetadata}),l();break}case"tool-input-delta":{const f=c.partialToolCalls[i.toolCallId];if(f==null)throw new ve({chunkType:"tool-input-delta",chunkId:i.toolCallId,message:`Received tool-input-delta for missing tool call with ID "${i.toolCallId}". Ensure a "tool-input-start" chunk is sent before any "tool-input-delta" chunks.`});f.text+=i.inputTextDelta;const{value:T}=await Se(f.text);f.dynamic?k({toolCallId:i.toolCallId,toolName:f.toolName,state:"input-streaming",input:T,title:f.title}):y({toolCallId:i.toolCallId,toolName:f.toolName,state:"input-streaming",input:T,title:f.title}),l();break}case"tool-input-available":{i.dynamic?k({toolCallId:i.toolCallId,toolName:i.toolName,state:"input-available",input:i.input,providerExecuted:i.providerExecuted,providerMetadata:i.providerMetadata,title:i.title}):y({toolCallId:i.toolCallId,toolName:i.toolName,state:"input-available",input:i.input,providerExecuted:i.providerExecuted,providerMetadata:i.providerMetadata,title:i.title}),l(),s&&!i.providerExecuted&&await s({toolCall:i});break}case"tool-input-error":{i.dynamic?k({toolCallId:i.toolCallId,toolName:i.toolName,state:"output-error",input:i.input,errorText:i.errorText,providerExecuted:i.providerExecuted,providerMetadata:i.providerMetadata}):y({toolCallId:i.toolCallId,toolName:i.toolName,state:"output-error",input:void 0,rawInput:i.input,errorText:i.errorText,providerExecuted:i.providerExecuted,providerMetadata:i.providerMetadata}),l();break}case"tool-approval-request":{const f=g(i.toolCallId);f.state="approval-requested",f.approval={id:i.approvalId},l();break}case"tool-output-denied":{const f=g(i.toolCallId);f.state="output-denied",l();break}case"tool-output-available":{const f=g(i.toolCallId);f.type==="dynamic-tool"?k({toolCallId:i.toolCallId,toolName:f.toolName,state:"output-available",input:f.input,output:i.output,preliminary:i.preliminary,providerExecuted:i.providerExecuted,title:f.title}):y({toolCallId:i.toolCallId,toolName:Zn(f),state:"output-available",input:f.input,output:i.output,providerExecuted:i.providerExecuted,preliminary:i.preliminary,title:f.title}),l();break}case"tool-output-error":{const f=g(i.toolCallId);f.type==="dynamic-tool"?k({toolCallId:i.toolCallId,toolName:f.toolName,state:"output-error",input:f.input,errorText:i.errorText,providerExecuted:i.providerExecuted,title:f.title}):y({toolCallId:i.toolCallId,toolName:Zn(f),state:"output-error",input:f.input,rawInput:f.rawInput,errorText:i.errorText,providerExecuted:i.providerExecuted,title:f.title}),l();break}case"start-step":{c.message.parts.push({type:"step-start"});break}case"finish-step":{c.activeTextParts={},c.activeReasoningParts={};break}case"start":{i.messageId!=null&&(c.message.id=i.messageId),await z(i.messageMetadata),(i.messageId!=null||i.messageMetadata!=null)&&l();break}case"finish":{i.finishReason!=null&&(c.finishReason=i.finishReason),await z(i.messageMetadata),i.messageMetadata!=null&&l();break}case"message-metadata":{await z(i.messageMetadata),i.messageMetadata!=null&&l();break}case"error":{o==null||o(new Error(i.errorText));break}default:if(Yu(i)){(r==null?void 0:r[i.type])!=null&&await hn({value:i.data,schema:r[i.type]});const f=i;if(f.transient){a==null||a(f);break}const T=f.id!=null?c.message.parts.find($=>f.type===$.type&&f.id===$.id):void 0;T!=null?T.data=f.data:c.message.parts.push(f),a==null||a(f),l()}}u.enqueue(i)})}}))}async function Xu({stream:e,onError:t}){const r=e.getReader();try{for(;;){const{done:n}=await r.read();if(n)break}}catch(n){t==null||t(n)}finally{r.releaseLock()}}Ee({prefix:"aitxt",size:24}),Ee({prefix:"aiobj",size:24});var Qu=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,r)=>{this.queue.push(async()=>{try{await e(),t()}catch(n){r(n)}}),this.processQueue()})}};Ee({prefix:"aiobj",size:24});async function Ku(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=>{const{name:r,type:n}=t,o=await new Promise((s,a)=>{const i=new FileReader;i.onload=u=>{var c;s((c=u.target)==null?void 0:c.result)},i.onerror=u=>a(u),i.readAsDataURL(t)});return{type:"file",mediaType:n,filename:r,url:o}}))}var el=class{constructor({api:e="/api/chat",credentials:t,headers:r,body:n,fetch:o,prepareSendMessagesRequest:s,prepareReconnectToStreamRequest:a}){this.api=e,this.credentials=t,this.headers=r,this.body=n,this.fetch=o,this.prepareSendMessagesRequest=s,this.prepareReconnectToStreamRequest=a}async sendMessages({abortSignal:e,...t}){var r,n,o,s,a;const i=await re(this.body),u=await re(this.headers),c=await re(this.credentials),l={...ae(u),...ae(t.headers)},d=await((r=this.prepareSendMessagesRequest)==null?void 0:r.call(this,{api:this.api,id:t.chatId,messages:t.messages,body:{...i,...t.body},headers:l,credentials:c,requestMetadata:t.metadata,trigger:t.trigger,messageId:t.messageId})),_=(n=d==null?void 0:d.api)!=null?n:this.api,m=(d==null?void 0:d.headers)!==void 0?ae(d.headers):l,I=(d==null?void 0:d.body)!==void 0?d.body:{...i,...t.body,id:t.chatId,messages:t.messages,trigger:t.trigger,messageId:t.messageId},g=(o=d==null?void 0:d.credentials)!=null?o:c,k=await((s=this.fetch)!=null?s:globalThis.fetch)(_,{method:"POST",headers:sn({"Content-Type":"application/json",...m},`ai-sdk/${In}`,on()),body:JSON.stringify(I),credentials:g,signal:e});if(!k.ok)throw new Error((a=await k.text())!=null?a:"Failed to fetch the chat response.");if(!k.body)throw new Error("The response body is empty.");return this.processResponseStream(k.body)}async reconnectToStream(e){var t,r,n,o,s;const a=await re(this.body),i=await re(this.headers),u=await re(this.credentials),c={...ae(i),...ae(e.headers)},l=await((t=this.prepareReconnectToStreamRequest)==null?void 0:t.call(this,{api:this.api,id:e.chatId,body:{...a,...e.body},headers:c,credentials:u,requestMetadata:e.metadata})),d=(r=l==null?void 0:l.api)!=null?r:`${this.api}/${e.chatId}/stream`,_=(l==null?void 0:l.headers)!==void 0?ae(l.headers):c,m=(n=l==null?void 0:l.credentials)!=null?n:u,g=await((o=this.fetch)!=null?o:globalThis.fetch)(d,{method:"GET",headers:sn(_,`ai-sdk/${In}`,on()),credentials:m});if(g.status===204)return null;if(!g.ok)throw new Error((s=await g.text())!=null?s:"Failed to fetch the chat response.");if(!g.body)throw new Error("The response body is empty.");return this.processResponseStream(g.body)}},$n=class extends el{constructor(e={}){super(e)}processResponseStream(e){return ku({stream:e,schema:Wu}).pipeThrough(new TransformStream({async transform(t,r){if(!t.success)throw t.error;r.enqueue(t.value)}}))}},tl=class{constructor({generateId:e=Oc,id:t=e(),transport:r=new $n,messageMetadataSchema:n,dataPartSchemas:o,state:s,onError:a,onToolCall:i,onFinish:u,onData:c,sendAutomaticallyWhen:l}){this.activeResponse=void 0,this.jobExecutor=new Qu,this.sendMessage=async(d,_)=>{var m,I,g,y;if(d==null){await this.makeRequest({trigger:"submit-message",messageId:(m=this.lastMessage)==null?void 0:m.id,..._});return}let k;if("text"in d||"files"in d?k={parts:[...Array.isArray(d.files)?d.files:await Ku(d.files),..."text"in d&&d.text!=null?[{type:"text",text:d.text}]:[]]}:k=d,d.messageId!=null){const z=this.state.messages.findIndex(f=>f.id===d.messageId);if(z===-1)throw new Error(`message with id ${d.messageId} not found`);if(this.state.messages[z].role!=="user")throw new Error(`message with id ${d.messageId} is not a user message`);this.state.messages=this.state.messages.slice(0,z+1),this.state.replaceMessage(z,{...k,id:d.messageId,role:(I=k.role)!=null?I:"user",metadata:d.metadata})}else this.state.pushMessage({...k,id:(g=k.id)!=null?g:this.generateId(),role:(y=k.role)!=null?y:"user",metadata:d.metadata});await this.makeRequest({trigger:"submit-message",messageId:d.messageId,..._})},this.regenerate=async({messageId:d,..._}={})=>{const m=d==null?this.state.messages.length-1:this.state.messages.findIndex(I=>I.id===d);if(m===-1)throw new Error(`message ${d} not found`);this.state.messages=this.state.messages.slice(0,this.messages[m].role==="assistant"?m:m+1),await this.makeRequest({trigger:"regenerate-message",messageId:d,..._})},this.resumeStream=async(d={})=>{await this.makeRequest({trigger:"resume-stream",...d})},this.clearError=()=>{this.status==="error"&&(this.state.error=void 0,this.setStatus({status:"ready"}))},this.addToolApprovalResponse=async({id:d,approved:_,reason:m})=>this.jobExecutor.run(async()=>{var I,g;const y=this.state.messages,k=y[y.length-1],z=f=>ft(f)&&f.state==="approval-requested"&&f.approval.id===d?{...f,state:"approval-responded",approval:{id:d,approved:_,reason:m}}:f;this.state.replaceMessage(y.length-1,{...k,parts:k.parts.map(z)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(z)),this.status!=="streaming"&&this.status!=="submitted"&&((I=this.sendAutomaticallyWhen)!=null&&I.call(this,{messages:this.state.messages}))&&this.makeRequest({trigger:"submit-message",messageId:(g=this.lastMessage)==null?void 0:g.id})}),this.addToolOutput=async({state:d="output-available",tool:_,toolCallId:m,output:I,errorText:g})=>this.jobExecutor.run(async()=>{var y,k;const z=this.state.messages,f=z[z.length-1],T=$=>ft($)&&$.toolCallId===m?{...$,state:d,output:I,errorText:g}:$;this.state.replaceMessage(z.length-1,{...f,parts:f.parts.map(T)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(T)),this.status!=="streaming"&&this.status!=="submitted"&&((y=this.sendAutomaticallyWhen)!=null&&y.call(this,{messages:this.state.messages}))&&this.makeRequest({trigger:"submit-message",messageId:(k=this.lastMessage)==null?void 0:k.id})}),this.addToolResult=this.addToolOutput,this.stop=async()=>{var d;this.status!=="streaming"&&this.status!=="submitted"||(d=this.activeResponse)!=null&&d.abortController&&this.activeResponse.abortController.abort()},this.id=t,this.transport=r,this.generateId=e,this.messageMetadataSchema=n,this.dataPartSchemas=o,this.state=s,this.onError=a,this.onToolCall=i,this.onFinish=u,this.onData=c,this.sendAutomaticallyWhen=l}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 makeRequest({trigger:e,metadata:t,headers:r,body:n,messageId:o}){var s,a,i,u;this.setStatus({status:"submitted",error:void 0});const c=this.lastMessage;let l=!1,d=!1,_=!1;try{const m={state:Gu({lastMessage:this.state.snapshot(c),messageId:this.generateId()}),abortController:new AbortController};m.abortController.signal.addEventListener("abort",()=>{l=!0}),this.activeResponse=m;let I;if(e==="resume-stream"){const y=await this.transport.reconnectToStream({chatId:this.id,metadata:t,headers:r,body:n});if(y==null){this.setStatus({status:"ready"});return}I=y}else I=await this.transport.sendMessages({chatId:this.id,messages:this.state.messages,abortSignal:m.abortController.signal,metadata:t,headers:r,body:n,trigger:e,messageId:o});const g=y=>this.jobExecutor.run(()=>y({state:m.state,write:()=>{var k;this.setStatus({status:"streaming"}),m.state.message.id===((k=this.lastMessage)==null?void 0:k.id)?this.state.replaceMessage(this.state.messages.length-1,m.state.message):this.state.pushMessage(m.state.message)}}));await Xu({stream:Hu({stream:I,onToolCall:this.onToolCall,onData:this.onData,messageMetadataSchema:this.messageMetadataSchema,dataPartSchemas:this.dataPartSchemas,runUpdateMessageJob:g,onError:y=>{throw y}}),onError:y=>{throw y}}),this.setStatus({status:"ready"})}catch(m){if(l||m.name==="AbortError")return l=!0,this.setStatus({status:"ready"}),null;_=!0,m instanceof TypeError&&(m.message.toLowerCase().includes("fetch")||m.message.toLowerCase().includes("network"))&&(d=!0),this.onError&&m instanceof Error&&this.onError(m),this.setStatus({status:"error",error:m})}finally{try{(a=this.onFinish)==null||a.call(this,{message:this.activeResponse.state.message,messages:this.state.messages,isAbort:l,isDisconnect:d,isError:_,finishReason:(s=this.activeResponse)==null?void 0:s.state.finishReason})}catch(m){console.error(m)}this.activeResponse=void 0}(i=this.sendAutomaticallyWhen)!=null&&i.call(this,{messages:this.state.messages})&&!_&&await this.makeRequest({trigger:"submit-message",messageId:(u=this.lastMessage)==null?void 0:u.id,metadata:t,headers:r,body:n})}},Nn=globalThis&&globalThis.__assign||function(){return Nn=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},Nn.apply(this,arguments)};globalThis&&globalThis.__awaiter,globalThis&&globalThis.__generator,globalThis&&globalThis.__read,globalThis&&globalThis.__spreadArray;var rl=class{constructor(e){this.statusRef=h.ref("ready"),this.errorRef=h.ref(void 0),this.pushMessage=t=>{this.messagesRef.value=[...this.messagesRef.value,t]},this.popMessage=()=>{this.messagesRef.value=this.messagesRef.value.slice(0,-1)},this.replaceMessage=(t,r)=>{this.messagesRef.value[t]={...r}},this.snapshot=t=>t,this.messagesRef=h.ref(e??[])}get messages(){return this.messagesRef.value}set messages(e){this.messagesRef.value=e}get status(){return this.statusRef.value}set status(e){this.statusRef.value=e}get error(){return this.errorRef.value}set error(e){this.errorRef.value=e}},nl=class extends tl{constructor({messages:e,...t}){super({...t,state:new rl(e)})}};/**
54
54
  * @license lucide-vue-next v0.562.0 - ISC
55
55
  *
56
56
  * This source code is licensed under the ISC license.
57
57
  * See the LICENSE file in the root directory of this source tree.
58
- */const zn=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),oL=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,n)=>n?n.toUpperCase():r.toLowerCase()),iL=e=>{const t=oL(e);return t.charAt(0).toUpperCase()+t.slice(1)},sL=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim(),Tn=e=>e==="";/**
58
+ */const Tn=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ol=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,r,n)=>n?n.toUpperCase():r.toLowerCase()),sl=e=>{const t=ol(e);return t.charAt(0).toUpperCase()+t.slice(1)},al=(...e)=>e.filter((t,r,n)=>!!t&&t.trim()!==""&&n.indexOf(t)===r).join(" ").trim(),Pn=e=>e==="";/**
59
59
  * @license lucide-vue-next v0.562.0 - ISC
60
60
  *
61
61
  * This source code is licensed under the ISC license.
62
62
  * See the LICENSE file in the root directory of this source tree.
63
- */var _e={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};/**
63
+ */var Oe={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};/**
64
64
  * @license lucide-vue-next v0.562.0 - ISC
65
65
  *
66
66
  * This source code is licensed under the ISC license.
67
67
  * See the LICENSE file in the root directory of this source tree.
68
- */const aL=({name:e,iconNode:t,absoluteStrokeWidth:r,"absolute-stroke-width":n,strokeWidth:u,"stroke-width":o,size:i=_e.width,color:s=_e.stroke,...c},{slots:a})=>S.h("svg",{..._e,...c,width:i,height:i,stroke:s,"stroke-width":Tn(r)||Tn(n)||r===!0||n===!0?Number(u||o||_e["stroke-width"])*24/Number(i):u||o||_e["stroke-width"],class:sL("lucide",c.class,...e?[`lucide-${zn(iL(e))}-icon`,`lucide-${zn(e)}`]:["lucide-icon"])},[...t.map(L=>S.h(...L)),...a.default?[a.default()]:[]]);/**
68
+ */const il=({name:e,iconNode:t,absoluteStrokeWidth:r,"absolute-stroke-width":n,strokeWidth:o,"stroke-width":s,size:a=Oe.width,color:i=Oe.stroke,...u},{slots:c})=>h.h("svg",{...Oe,...u,width:a,height:a,stroke:i,"stroke-width":Pn(r)||Pn(n)||r===!0||n===!0?Number(o||s||Oe["stroke-width"])*24/Number(a):o||s||Oe["stroke-width"],class:al("lucide",u.class,...e?[`lucide-${Tn(sl(e))}-icon`,`lucide-${Tn(e)}`]:["lucide-icon"])},[...t.map(l=>h.h(...l)),...c.default?[c.default()]:[]]);/**
69
69
  * @license lucide-vue-next v0.562.0 - ISC
70
70
  *
71
71
  * This source code is licensed under the ISC license.
72
72
  * See the LICENSE file in the root directory of this source tree.
73
- */const Fe=(e,t)=>(r,{slots:n,attrs:u})=>S.h(aL,{...u,...r,iconNode:t,name:e},n);/**
73
+ */const Fe=(e,t)=>(r,{slots:n,attrs:o})=>h.h(il,{...o,...r,iconNode:t,name:e},n);/**
74
74
  * @license lucide-vue-next v0.562.0 - ISC
75
75
  *
76
76
  * This source code is licensed under the ISC license.
77
77
  * See the LICENSE file in the root directory of this source tree.
78
- */const cL=Fe("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
78
+ */const cl=Fe("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
79
79
  * @license lucide-vue-next v0.562.0 - ISC
80
80
  *
81
81
  * This source code is licensed under the ISC license.
82
82
  * See the LICENSE file in the root directory of this source tree.
83
- */const LL=Fe("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
83
+ */const ul=Fe("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
84
84
  * @license lucide-vue-next v0.562.0 - ISC
85
85
  *
86
86
  * This source code is licensed under the ISC license.
87
87
  * See the LICENSE file in the root directory of this source tree.
88
- */const lL=Fe("message-circle",[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]]);/**
88
+ */const ll=Fe("message-circle",[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]]);/**
89
89
  * @license lucide-vue-next v0.562.0 - ISC
90
90
  *
91
91
  * This source code is licensed under the ISC license.
92
92
  * See the LICENSE file in the root directory of this source tree.
93
- */const jL=Fe("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),ML={class:"z-1000"},dL={key:0,src:Dn,alt:"",class:"absolute w-[120px] h-[120px] right-[14px] bottom-[22px]"},SL={class:"flex items-center justify-between"},pL={key:0,class:"h-full flex flex-col justify-center text-xl title-hello"},yL={class:"gradient-text text-5xl leading-[80px]"},fL={key:0,class:"flex justify-end"},gL={class:"bg-[#bedeff] px-3 py-2.5 rounded-lg max-w-[90%] overflow-wrap-anywhere"},mL={key:0},hL={key:1,class:"flex justify-start"},IL={class:"px-3 py-2.5 rounded-lg whitespace-pre-wrap overflow-wrap-anywhere"},EL={key:0},NL={key:1,src:kn,alt:"",class:"w-16"},xL=["disabled"],vL=S.defineComponent({__name:"ChatbotComponent",props:{clientId:{type:String,default:""},endpoint:{type:String,default:""},token:{type:String,default:""}},setup(e){const t=e,r=S.ref(""),n=S.ref(!1),u=S.ref(null),o=S.ref(!1),i=new uL({transport:new Cn({api:"https://ai-chat-backend.dev02.dtsmart.dev/api/chat",body:{client_id:t.clientId,mcp_token:t.token}})}),s=async L=>{try{if(!r.value.trim())return;const l=r.value.trim();r.value="",o.value=!0,L.preventDefault(),await i.sendMessage({text:l})}catch(l){console.error(l)}finally{o.value=!1}},c=()=>{n.value=!n.value},a=()=>{n.value=!1,i.messages=[]};return S.watch(()=>i.messages,async()=>{var L;await S.nextTick(),(L=u.value)==null||L.scrollTo({top:u.value.scrollHeight,behavior:"smooth"})},{deep:!0}),(L,l)=>{var f;return S.openBlock(),S.createElementBlock(S.Fragment,null,[n.value?(S.openBlock(),S.createElementBlock("div",{key:0,class:"bg-[#ffffff00] absolute w-full h-full",onClick:l[0]||(l[0]=d=>n.value=!1)})):S.createCommentVNode("",!0),S.createElementVNode("div",ML,[S.createElementVNode("div",null,[n.value?S.createCommentVNode("",!0):(S.openBlock(),S.createElementBlock("img",dL)),S.createElementVNode("button",{class:"chat-button",onClick:c},[n.value?(S.openBlock(),S.createBlock(S.unref(LL),{key:1,class:"text-white"})):(S.openBlock(),S.createBlock(S.unref(lL),{key:0,class:"text-white"}))])]),S.createElementVNode("div",{class:S.normalizeClass(["ai-card chat-popup transition-all duration-7 flex flex-col gap-y-5",{"opacity-0":!n.value,"opacity-100":n.value}])},[S.createElementVNode("div",SL,[l[2]||(l[2]=S.createElementVNode("p",{class:"ai-hello"},"Hi, I’m Boko AI",-1)),S.createElementVNode("button",{class:"ai-close",onClick:a},[S.createVNode(S.unref(jL))])]),S.createElementVNode("div",{ref_key:"scrollRef",ref:u,class:"grow h-[440px] overflow-y-auto"},[S.unref(i).messages.length===0?(S.openBlock(),S.createElementBlock("div",pL,[S.createElementVNode("div",null,[S.createElementVNode("p",yL," Hello "+S.toDisplayString(e.clientId),1),l[3]||(l[3]=S.createElementVNode("p",{class:"text-5xl text-[#2a2f3c] leading-[80px]"}," How Can I Help You Today ? ",-1))]),l[4]||(l[4]=S.createElementVNode("p",{class:"text-base text-[#545e7f]"}," I’m Boko, your friendly assistant. ",-1)),l[5]||(l[5]=S.createElementVNode("p",{class:"text-base text-[#545e7f]"}," Here to help — anytime you’re ready! ",-1))])):S.createCommentVNode("",!0),(S.openBlock(!0),S.createElementBlock(S.Fragment,null,S.renderList(S.unref(i).messages,(d,I)=>(S.openBlock(),S.createElementBlock("div",{key:d.id??I,class:"mb-3"},[(S.openBlock(!0),S.createElementBlock(S.Fragment,null,S.renderList(d==null?void 0:d.parts,(p,g)=>(S.openBlock(),S.createElementBlock(S.Fragment,{key:`${d.id}-${p.type}-${g}`},[d.role==="user"?(S.openBlock(),S.createElementBlock("div",fL,[S.createElementVNode("div",gL,[(p==null?void 0:p.type)==="text"?(S.openBlock(),S.createElementBlock("div",mL,S.toDisplayString(p==null?void 0:p.text),1)):S.createCommentVNode("",!0)])])):(S.openBlock(),S.createElementBlock("div",hL,[S.createElementVNode("div",IL,[(p==null?void 0:p.type)==="text"?(S.openBlock(),S.createElementBlock("div",EL,S.toDisplayString(p==null?void 0:p.text),1)):S.createCommentVNode("",!0)])]))],64))),128))]))),128)),o.value?(S.openBlock(),S.createElementBlock("img",NL)):S.createCommentVNode("",!0)],512),S.createElementVNode("form",{onSubmit:s,class:"ai-input-wrap"},[S.withDirectives(S.createElementVNode("input",{class:"ai-input","onUpdate:modelValue":l[1]||(l[1]=d=>r.value=d),placeholder:"Ask me anything…"},null,512),[[S.vModelText,r.value]]),S.createElementVNode("button",{class:"ai-send",disabled:!r.value||((f=r.value)==null?void 0:f.length)==0||o.value},[S.createVNode(S.unref(cL),{class:"w-5 h-5 text-white"})],8,xL)],32)],2)])],64)}}}),bL="",_L=((e,t)=>{const r=e.__vccOpts||e;for(const[n,u]of t)r[n]=u;return r})(vL,[["__scopeId","data-v-f57b1de6"]]);ue.ChatbotComponent=_L,Object.defineProperty(ue,Symbol.toStringTag,{value:"Module"})});
93
+ */const dl=Fe("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),pl={class:"z-[1000] w-fit flex flex-col items-end gap-y-5 relative"},fl={class:"flex items-center justify-between"},ml={key:0,class:"h-full flex flex-col justify-center text-xl title-hello"},hl={class:"gradient-text text-5xl leading-[80px]"},gl={key:0,class:"flex justify-end"},vl={class:"bg-[#bedeff] px-3 py-2.5 rounded-lg max-w-[90%] overflow-wrap-anywhere"},_l={key:0},yl={key:1,class:"flex justify-start"},bl={class:"px-3 py-2.5 rounded-lg whitespace-pre-wrap overflow-wrap-anywhere"},wl={key:0},Il={key:1,src:xn,alt:"",class:"w-16"},El=["disabled"],kl=h.defineComponent({__name:"ChatbotComponent",props:{clientId:{type:String,default:""},endpoint:{type:String,default:""},token:{type:String,default:""}},setup(e){const t=e,r=h.ref(""),n=h.ref(!1),o=h.ref(null),s=h.ref(!1),a=new nl({transport:new $n({api:"https://ai-chat-backend.dev02.dtsmart.dev/api/chat",body:{client_id:t.clientId,mcp_token:t.token}})}),i=async l=>{try{if(!r.value.trim())return;const d=r.value.trim();r.value="",s.value=!0,l.preventDefault(),await a.sendMessage({text:d})}catch(d){console.error(d)}finally{s.value=!1}},u=()=>{console.log("handleToggle nha"),n.value=!n.value},c=()=>{n.value=!1,a.messages=[]};return h.watch(()=>a.messages,async()=>{var l;await h.nextTick(),(l=o.value)==null||l.scrollTo({top:o.value.scrollHeight,behavior:"smooth"})},{deep:!0}),(l,d)=>{var _;return h.openBlock(),h.createElementBlock(h.Fragment,null,[n.value?(h.openBlock(),h.createElementBlock("div",{key:0,class:"bg-[#ffffff00] absolute w-full h-full",onClick:d[0]||(d[0]=m=>n.value=!1)})):h.createCommentVNode("",!0),h.createElementVNode("div",pl,[h.createTextVNode(h.toDisplayString(n.value+"aaa")+" ",1),h.createElementVNode("div",{class:h.normalizeClass(["ai-card chat-popup transition-all duration-7 gap-y-5",{"opacity-0":!n.value,"opacity-100":n.value}])},[h.createElementVNode("div",fl,[d[2]||(d[2]=h.createElementVNode("p",{class:"ai-hello"},"Hi, I’m Boko AI",-1)),h.createElementVNode("button",{class:"ai-close",onClick:c},[h.createVNode(h.unref(dl))])]),h.createElementVNode("div",{ref_key:"scrollRef",ref:o,class:"grow h-[440px] overflow-y-auto"},[h.unref(a).messages.length===0?(h.openBlock(),h.createElementBlock("div",ml,[h.createElementVNode("div",null,[h.createElementVNode("p",hl," Hello "+h.toDisplayString(e.clientId),1),d[3]||(d[3]=h.createElementVNode("p",{class:"text-5xl text-[#2a2f3c] leading-[80px]"}," How Can I Help You Today ? ",-1))]),d[4]||(d[4]=h.createElementVNode("p",{class:"text-base text-[#545e7f]"}," I’m Boko, your friendly assistant. ",-1)),d[5]||(d[5]=h.createElementVNode("p",{class:"text-base text-[#545e7f]"}," Here to help — anytime you’re ready! ",-1))])):h.createCommentVNode("",!0),(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(h.unref(a).messages,(m,I)=>(h.openBlock(),h.createElementBlock("div",{key:m.id??I,class:"mb-3"},[(h.openBlock(!0),h.createElementBlock(h.Fragment,null,h.renderList(m==null?void 0:m.parts,(g,y)=>(h.openBlock(),h.createElementBlock(h.Fragment,{key:`${m.id}-${g.type}-${y}`},[m.role==="user"?(h.openBlock(),h.createElementBlock("div",gl,[h.createElementVNode("div",vl,[(g==null?void 0:g.type)==="text"?(h.openBlock(),h.createElementBlock("div",_l,h.toDisplayString(g==null?void 0:g.text),1)):h.createCommentVNode("",!0)])])):(h.openBlock(),h.createElementBlock("div",yl,[h.createElementVNode("div",bl,[(g==null?void 0:g.type)==="text"?(h.openBlock(),h.createElementBlock("div",wl,h.toDisplayString(g==null?void 0:g.text),1)):h.createCommentVNode("",!0)])]))],64))),128))]))),128)),s.value?(h.openBlock(),h.createElementBlock("img",Il)):h.createCommentVNode("",!0)],512),h.createElementVNode("form",{onSubmit:i,class:"ai-input-wrap"},[h.withDirectives(h.createElementVNode("input",{class:"ai-input","onUpdate:modelValue":d[1]||(d[1]=m=>r.value=m),placeholder:"Ask me anything…"},null,512),[[h.vModelText,r.value]]),h.createElementVNode("button",{class:"ai-send",disabled:!r.value||((_=r.value)==null?void 0:_.length)==0||s.value},[h.createVNode(h.unref(cl),{class:"w-5 h-5 text-white"})],8,El)],32)],2),h.createElementVNode("div",null,[h.createElementVNode("button",{class:"chat-button",onClick:u},[n.value?(h.openBlock(),h.createBlock(h.unref(ul),{key:1,class:"text-white"})):(h.openBlock(),h.createBlock(h.unref(ll),{key:0,class:"text-white"}))])])])],64)}}}),Zl="",zl=((e,t)=>{const r=e.__vccOpts||e;for(const[n,o]of t)r[n]=o;return r})(kl,[["__scopeId","data-v-bffd00d6"]]);oe.ChatbotComponent=zl,Object.defineProperty(oe,Symbol.toStringTag,{value:"Module"})});