@fern-api/java-dynamic-snippets 3.22.0 → 3.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/cjs/DynamicSnippetsGenerator.cjs +1 -1
  2. package/cjs/DynamicSnippetsGenerator.cjs.map +1 -1
  3. package/cjs/context/DynamicSnippetsGeneratorContext.cjs +1 -1
  4. package/cjs/context/DynamicSnippetsGeneratorContext.cjs.map +1 -1
  5. package/cjs/index.cjs +1 -1
  6. package/cjs/index.cjs.map +1 -1
  7. package/esm/DynamicSnippetsGenerator.js +1 -1
  8. package/esm/EndpointSnippetGenerator.js +1 -1
  9. package/esm/{chunk-3GRWXKJQ.js → chunk-C7RK7JUC.js} +2 -2
  10. package/esm/{chunk-AFF2W4ET.js → chunk-FDN2HGWE.js} +2 -2
  11. package/esm/{chunk-3RPV4P2N.js → chunk-FNREWPPJ.js} +2 -2
  12. package/esm/{chunk-BMMM5LLV.js → chunk-JBCRNEMV.js} +2 -2
  13. package/esm/{chunk-GX6CC3QQ.js → chunk-OHA6X7RF.js} +2 -2
  14. package/esm/{chunk-RJC322RM.js → chunk-PUKCM72D.js} +2 -2
  15. package/esm/chunk-PUKCM72D.js.map +1 -0
  16. package/esm/{chunk-3YTGXHIU.js → chunk-WBDN7N7M.js} +2 -2
  17. package/esm/{chunk-I6IKEGKL.js → chunk-YVHD2ESF.js} +2 -2
  18. package/esm/context/DynamicSnippetsGeneratorContext.js +1 -1
  19. package/esm/context/DynamicTypeLiteralMapper.js +1 -1
  20. package/esm/context/DynamicTypeMapper.js +1 -1
  21. package/esm/context/FilePropertyMapper.js +1 -1
  22. package/esm/index.js +1 -1
  23. package/package.json +1 -1
  24. package/esm/chunk-RJC322RM.js.map +0 -1
  25. /package/esm/{chunk-3GRWXKJQ.js.map → chunk-C7RK7JUC.js.map} +0 -0
  26. /package/esm/{chunk-AFF2W4ET.js.map → chunk-FDN2HGWE.js.map} +0 -0
  27. /package/esm/{chunk-3RPV4P2N.js.map → chunk-FNREWPPJ.js.map} +0 -0
  28. /package/esm/{chunk-BMMM5LLV.js.map → chunk-JBCRNEMV.js.map} +0 -0
  29. /package/esm/{chunk-GX6CC3QQ.js.map → chunk-OHA6X7RF.js.map} +0 -0
  30. /package/esm/{chunk-3YTGXHIU.js.map → chunk-WBDN7N7M.js.map} +0 -0
  31. /package/esm/{chunk-I6IKEGKL.js.map → chunk-YVHD2ESF.js.map} +0 -0
@@ -19,7 +19,7 @@ ${e}`)}return e}getContent(){let e=`package ${this.packageName};
19
19
  `,t=this.stringifyImports();return t.length>0?`${e}${t}
20
20
 
21
21
  ${this.buffer}`:e+this.buffer}stringifyImports(){return Array.from(this.imports).filter(e=>e!==this.packageName).map(e=>`import ${e};`).sort().join(`
22
- `)}};l();c();l();c();var E={};Wt(E,{BRAND:()=>bo,DIRTY:()=>_e,EMPTY_PATH:()=>Xs,INVALID:()=>k,NEVER:()=>iu,OK:()=>M,ParseStatus:()=>P,Schema:()=>A,ZodAny:()=>he,ZodArray:()=>le,ZodBigInt:()=>ke,ZodBoolean:()=>Ne,ZodBranded:()=>ft,ZodCatch:()=>je,ZodDate:()=>Re,ZodDefault:()=>Fe,ZodDiscriminatedUnion:()=>St,ZodEffects:()=>Y,ZodEnum:()=>Oe,ZodError:()=>D,ZodFirstPartyTypeKind:()=>N,ZodFunction:()=>Lt,ZodIntersection:()=>Se,ZodIssueCode:()=>h,ZodLazy:()=>Ce,ZodLiteral:()=>Le,ZodMap:()=>Xe,ZodNaN:()=>et,ZodNativeEnum:()=>Ue,ZodNever:()=>G,ZodNull:()=>Ie,ZodNullable:()=>ee,ZodNumber:()=>Te,ZodObject:()=>$,ZodOptional:()=>Z,ZodParsedType:()=>w,ZodPipeline:()=>pt,ZodPromise:()=>ye,ZodReadonly:()=>Pe,ZodRecord:()=>Ct,ZodSchema:()=>A,ZodSet:()=>Qe,ZodString:()=>me,ZodSymbol:()=>He,ZodTransformer:()=>Y,ZodTuple:()=>Q,ZodType:()=>A,ZodUndefined:()=>Ae,ZodUnion:()=>Ee,ZodUnknown:()=>ue,ZodVoid:()=>Ke,addIssueToContext:()=>v,any:()=>So,array:()=>Uo,bigint:()=>No,boolean:()=>Jn,coerce:()=>au,custom:()=>Yn,date:()=>Ro,datetimeRegex:()=>Zn,defaultErrorMap:()=>se,discriminatedUnion:()=>Mo,effect:()=>Ho,enum:()=>qo,function:()=>Zo,getErrorMap:()=>qe,getParsedType:()=>X,instanceof:()=>To,intersection:()=>Bo,isAborted:()=>It,isAsync:()=>Ge,isDirty:()=>Et,isValid:()=>de,late:()=>_o,lazy:()=>zo,literal:()=>Yo,makeIssue:()=>ct,map:()=>Vo,nan:()=>ko,nativeEnum:()=>Go,never:()=>Lo,null:()=>Eo,nullable:()=>Xo,number:()=>Gn,object:()=>Fo,objectUtil:()=>er,oboolean:()=>nu,onumber:()=>ru,optional:()=>Ko,ostring:()=>tu,pipeline:()=>eu,preprocess:()=>Qo,promise:()=>Jo,quotelessJson:()=>Js,record:()=>$o,set:()=>Wo,setErrorMap:()=>Ks,strictObject:()=>jo,string:()=>qn,symbol:()=>Ao,transformer:()=>Ho,tuple:()=>Do,undefined:()=>Io,union:()=>Po,unknown:()=>Co,util:()=>I,void:()=>Oo});l();c();l();c();l();c();l();c();l();c();var I;(function(r){r.assertEqual=a=>{};function e(a){}r.assertIs=e;function t(a){throw new Error}r.assertNever=t,r.arrayToEnum=a=>{let i={};for(let s of a)i[s]=s;return i},r.getValidEnumValues=a=>{let i=r.objectKeys(a).filter(o=>typeof a[a[o]]!="number"),s={};for(let o of i)s[o]=a[o];return r.objectValues(s)},r.objectValues=a=>r.objectKeys(a).map(function(i){return a[i]}),r.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{let i=[];for(let s in a)Object.prototype.hasOwnProperty.call(a,s)&&i.push(s);return i},r.find=(a,i)=>{for(let s of a)if(i(s))return s},r.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function n(a,i=" | "){return a.map(s=>typeof s=="string"?`'${s}'`:s).join(i)}r.joinValues=n,r.jsonStringifyReplacer=(a,i)=>typeof i=="bigint"?i.toString():i})(I||(I={}));var er;(function(r){r.mergeShapes=(e,t)=>d(d({},e),t)})(er||(er={}));var w=I.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),X=r=>{switch(typeof r){case"undefined":return w.undefined;case"string":return w.string;case"number":return Number.isNaN(r)?w.nan:w.number;case"boolean":return w.boolean;case"function":return w.function;case"bigint":return w.bigint;case"symbol":return w.symbol;case"object":return Array.isArray(r)?w.array:r===null?w.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?w.promise:typeof Map!="undefined"&&r instanceof Map?w.map:typeof Set!="undefined"&&r instanceof Set?w.set:typeof Date!="undefined"&&r instanceof Date?w.date:w.object;default:return w.unknown}};var h=I.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"]),Js=r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:"),D=class r extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){let t=e||function(i){return i.message},n={_errors:[]},a=i=>{for(let s of i.issues)if(s.code==="invalid_union")s.unionErrors.map(a);else if(s.code==="invalid_return_type")a(s.returnTypeError);else if(s.code==="invalid_arguments")a(s.argumentsError);else if(s.path.length===0)n._errors.push(t(s));else{let o=n,f=0;for(;f<s.path.length;){let p=s.path[f];f===s.path.length-1?(o[p]=o[p]||{_errors:[]},o[p]._errors.push(t(s))):o[p]=o[p]||{_errors:[]},o=o[p],f++}}};return a(this),n}static assert(e){if(!(e instanceof r))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,I.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){let t={},n=[];for(let a of this.issues)if(a.path.length>0){let i=a.path[0];t[i]=t[i]||[],t[i].push(e(a))}else n.push(e(a));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};D.create=r=>new D(r);var Hs=(r,e)=>{let t;switch(r.code){case h.invalid_type:r.received===w.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case h.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,I.jsonStringifyReplacer)}`;break;case h.unrecognized_keys:t=`Unrecognized key(s) in object: ${I.joinValues(r.keys,", ")}`;break;case h.invalid_union:t="Invalid input";break;case h.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${I.joinValues(r.options)}`;break;case h.invalid_enum_value:t=`Invalid enum value. Expected ${I.joinValues(r.options)}, received '${r.received}'`;break;case h.invalid_arguments:t="Invalid function arguments";break;case h.invalid_return_type:t="Invalid function return type";break;case h.invalid_date:t="Invalid date";break;case h.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(t=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?t=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?t=`Invalid input: must end with "${r.validation.endsWith}"`:I.assertNever(r.validation):r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case h.too_small:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="bigint"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:t="Invalid input";break;case h.too_big:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="bigint"?t=`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.maximum))}`:t="Invalid input";break;case h.custom:t="Invalid input";break;case h.invalid_intersection_types:t="Intersection results could not be merged";break;case h.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;case h.not_finite:t="Number must be finite";break;default:t=e.defaultError,I.assertNever(r)}return{message:t}},se=Hs;var Bn=se;function Ks(r){Bn=r}function qe(){return Bn}l();c();var ct=r=>{let{data:e,path:t,errorMaps:n,issueData:a}=r,i=[...t,...a.path||[]],s=T(d({},a),{path:i});if(a.message!==void 0)return T(d({},a),{path:i,message:a.message});let o="",f=n.filter(p=>!!p).slice().reverse();for(let p of f)o=p(s,{data:e,defaultError:o}).message;return T(d({},a),{path:i,message:o})},Xs=[];function v(r,e){let t=qe(),n=ct({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===se?void 0:se].filter(a=>!!a)});r.common.issues.push(n)}var P=class r{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){let n=[];for(let a of t){if(a.status==="aborted")return k;a.status==="dirty"&&e.dirty(),n.push(a.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){let n=[];for(let a of t){let i=await a.key,s=await a.value;n.push({key:i,value:s})}return r.mergeObjectSync(e,n)}static mergeObjectSync(e,t){let n={};for(let a of t){let{key:i,value:s}=a;if(i.status==="aborted"||s.status==="aborted")return k;i.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof s.value!="undefined"||a.alwaysSet)&&(n[i.value]=s.value)}return{status:e.value,value:n}}},k=Object.freeze({status:"aborted"}),_e=r=>({status:"dirty",value:r}),M=r=>({status:"valid",value:r}),It=r=>r.status==="aborted",Et=r=>r.status==="dirty",de=r=>r.status==="valid",Ge=r=>typeof Promise!="undefined"&&r instanceof Promise;l();c();l();c();var b;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(b||(b={}));var z=class{constructor(e,t,n,a){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=a}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Dn=(r,e)=>{if(de(e))return{success:!0,data:e.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new D(r.common.issues);return this._error=t,this._error}}};function R(r){if(!r)return{};let{errorMap:e,invalid_type_error:t,required_error:n,description:a}=r;if(e&&(t||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:a}:{errorMap:(s,o)=>{var p,y;let{message:f}=r;return s.code==="invalid_enum_value"?{message:f!=null?f:o.defaultError}:typeof o.data=="undefined"?{message:(p=f!=null?f:n)!=null?p:o.defaultError}:s.code!=="invalid_type"?{message:o.defaultError}:{message:(y=f!=null?f:t)!=null?y:o.defaultError}},description:a}}var A=class{get description(){return this._def.description}_getType(e){return X(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:X(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new P,ctx:{common:e.parent.common,data:e.data,parsedType:X(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(Ge(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var i;let n={common:{issues:[],async:(i=t==null?void 0:t.async)!=null?i:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:X(e)},a=this._parseSync({data:e,path:n.path,parent:n});return Dn(n,a)}"~validate"(e){var n,a;let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:X(e)};if(!this["~standard"].async)try{let i=this._parseSync({data:e,path:[],parent:t});return de(i)?{value:i.value}:{issues:t.common.issues}}catch(i){(a=(n=i==null?void 0:i.message)==null?void 0:n.toLowerCase())!=null&&a.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(i=>de(i)?{value:i.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:X(e)},a=this._parse({data:e,path:n.path,parent:n}),i=await(Ge(a)?a:Promise.resolve(a));return Dn(n,i)}refine(e,t){let n=a=>typeof t=="string"||typeof t=="undefined"?{message:t}:typeof t=="function"?t(a):t;return this._refinement((a,i)=>{let s=e(a),o=()=>i.addIssue(d({code:h.custom},n(a)));return typeof Promise!="undefined"&&s instanceof Promise?s.then(f=>f?!0:(o(),!1)):s?!0:(o(),!1)})}refinement(e,t){return this._refinement((n,a)=>e(n)?!0:(a.addIssue(typeof t=="function"?t(n,a):t),!1))}_refinement(e){return new Y({schema:this,typeName:N.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return Z.create(this,this._def)}nullable(){return ee.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return le.create(this)}promise(){return ye.create(this,this._def)}or(e){return Ee.create([this,e],this._def)}and(e){return Se.create(this,e,this._def)}transform(e){return new Y(T(d({},R(this._def)),{schema:this,typeName:N.ZodEffects,effect:{type:"transform",transform:e}}))}default(e){let t=typeof e=="function"?e:()=>e;return new Fe(T(d({},R(this._def)),{innerType:this,defaultValue:t,typeName:N.ZodDefault}))}brand(){return new ft(d({typeName:N.ZodBranded,type:this},R(this._def)))}catch(e){let t=typeof e=="function"?e:()=>e;return new je(T(d({},R(this._def)),{innerType:this,catchValue:t,typeName:N.ZodCatch}))}describe(e){let t=this.constructor;return new t(T(d({},this._def),{description:e}))}pipe(e){return pt.create(this,e)}readonly(){return Pe.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Qs=/^c[^\s-]{8,}$/i,eo=/^[0-9a-z]+$/,to=/^[0-9A-HJKMNP-TV-Z]{26}$/i,ro=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,no=/^[a-z0-9_-]{21}$/i,ao=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,io=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,so=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,oo="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",tr,uo=/^(?:(?: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])$/,lo=/^(?:(?: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])$/,co=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,fo=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,po=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,mo=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Vn="((\\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])))",ho=new RegExp(`^${Vn}$`);function Wn(r){let e="[0-5]\\d";r.precision?e=`${e}\\.\\d{${r.precision}}`:r.precision==null&&(e=`${e}(\\.\\d+)?`);let t=r.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function yo(r){return new RegExp(`^${Wn(r)}$`)}function Zn(r){let e=`${Vn}T${Wn(r)}`,t=[];return t.push(r.local?"Z?":"Z"),r.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function go(r,e){return!!((e==="v4"||!e)&&uo.test(r)||(e==="v6"||!e)&&co.test(r))}function xo(r,e){if(!ao.test(r))return!1;try{let[t]=r.split(".");if(!t)return!1;let n=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),a=JSON.parse(atob(n));return!(typeof a!="object"||a===null||"typ"in a&&(a==null?void 0:a.typ)!=="JWT"||!a.alg||e&&a.alg!==e)}catch(t){return!1}}function vo(r,e){return!!((e==="v4"||!e)&&lo.test(r)||(e==="v6"||!e)&&fo.test(r))}var me=class r extends A{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==w.string){let i=this._getOrReturnCtx(e);return v(i,{code:h.invalid_type,expected:w.string,received:i.parsedType}),k}let n=new P,a;for(let i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(a=this._getOrReturnCtx(e,a),v(a,{code:h.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")e.data.length>i.value&&(a=this._getOrReturnCtx(e,a),v(a,{code:h.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){let s=e.data.length>i.value,o=e.data.length<i.value;(s||o)&&(a=this._getOrReturnCtx(e,a),s?v(a,{code:h.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):o&&v(a,{code:h.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")so.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"email",code:h.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")tr||(tr=new RegExp(oo,"u")),tr.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"emoji",code:h.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")ro.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"uuid",code:h.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")no.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"nanoid",code:h.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")Qs.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"cuid",code:h.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")eo.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"cuid2",code:h.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")to.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"ulid",code:h.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(e.data)}catch(s){a=this._getOrReturnCtx(e,a),v(a,{validation:"url",code:h.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"regex",code:h.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(a=this._getOrReturnCtx(e,a),v(a,{code:h.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(a=this._getOrReturnCtx(e,a),v(a,{code:h.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(a=this._getOrReturnCtx(e,a),v(a,{code:h.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?Zn(i).test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{code:h.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?ho.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{code:h.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?yo(i).test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{code:h.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?io.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"duration",code:h.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?go(e.data,i.version)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"ip",code:h.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?xo(e.data,i.alg)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"jwt",code:h.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?vo(e.data,i.version)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"cidr",code:h.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?po.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"base64",code:h.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?mo.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"base64url",code:h.invalid_string,message:i.message}),n.dirty()):I.assertNever(i);return{status:n.value,value:e.data}}_regex(e,t,n){return this.refinement(a=>e.test(a),d({validation:t,code:h.invalid_string},b.errToObj(n)))}_addCheck(e){return new r(T(d({},this._def),{checks:[...this._def.checks,e]}))}email(e){return this._addCheck(d({kind:"email"},b.errToObj(e)))}url(e){return this._addCheck(d({kind:"url"},b.errToObj(e)))}emoji(e){return this._addCheck(d({kind:"emoji"},b.errToObj(e)))}uuid(e){return this._addCheck(d({kind:"uuid"},b.errToObj(e)))}nanoid(e){return this._addCheck(d({kind:"nanoid"},b.errToObj(e)))}cuid(e){return this._addCheck(d({kind:"cuid"},b.errToObj(e)))}cuid2(e){return this._addCheck(d({kind:"cuid2"},b.errToObj(e)))}ulid(e){return this._addCheck(d({kind:"ulid"},b.errToObj(e)))}base64(e){return this._addCheck(d({kind:"base64"},b.errToObj(e)))}base64url(e){return this._addCheck(d({kind:"base64url"},b.errToObj(e)))}jwt(e){return this._addCheck(d({kind:"jwt"},b.errToObj(e)))}ip(e){return this._addCheck(d({kind:"ip"},b.errToObj(e)))}cidr(e){return this._addCheck(d({kind:"cidr"},b.errToObj(e)))}datetime(e){var t,n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck(d({kind:"datetime",precision:typeof(e==null?void 0:e.precision)=="undefined"?null:e==null?void 0:e.precision,offset:(t=e==null?void 0:e.offset)!=null?t:!1,local:(n=e==null?void 0:e.local)!=null?n:!1},b.errToObj(e==null?void 0:e.message)))}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck(d({kind:"time",precision:typeof(e==null?void 0:e.precision)=="undefined"?null:e==null?void 0:e.precision},b.errToObj(e==null?void 0:e.message)))}duration(e){return this._addCheck(d({kind:"duration"},b.errToObj(e)))}regex(e,t){return this._addCheck(d({kind:"regex",regex:e},b.errToObj(t)))}includes(e,t){return this._addCheck(d({kind:"includes",value:e,position:t==null?void 0:t.position},b.errToObj(t==null?void 0:t.message)))}startsWith(e,t){return this._addCheck(d({kind:"startsWith",value:e},b.errToObj(t)))}endsWith(e,t){return this._addCheck(d({kind:"endsWith",value:e},b.errToObj(t)))}min(e,t){return this._addCheck(d({kind:"min",value:e},b.errToObj(t)))}max(e,t){return this._addCheck(d({kind:"max",value:e},b.errToObj(t)))}length(e,t){return this._addCheck(d({kind:"length",value:e},b.errToObj(t)))}nonempty(e){return this.min(1,b.errToObj(e))}trim(){return new r(T(d({},this._def),{checks:[...this._def.checks,{kind:"trim"}]}))}toLowerCase(){return new r(T(d({},this._def),{checks:[...this._def.checks,{kind:"toLowerCase"}]}))}toUpperCase(){return new r(T(d({},this._def),{checks:[...this._def.checks,{kind:"toUpperCase"}]}))}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};me.create=r=>{var e;return new me(d({checks:[],typeName:N.ZodString,coerce:(e=r==null?void 0:r.coerce)!=null?e:!1},R(r)))};function wo(r,e){let t=(r.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,a=t>n?t:n,i=Number.parseInt(r.toFixed(a).replace(".","")),s=Number.parseInt(e.toFixed(a).replace(".",""));return i%s/10**a}var Te=class r extends A{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==w.number){let i=this._getOrReturnCtx(e);return v(i,{code:h.invalid_type,expected:w.number,received:i.parsedType}),k}let n,a=new P;for(let i of this._def.checks)i.kind==="int"?I.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),v(n,{code:h.invalid_type,expected:"integer",received:"float",message:i.message}),a.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),v(n,{code:h.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),v(n,{code:h.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="multipleOf"?wo(e.data,i.value)!==0&&(n=this._getOrReturnCtx(e,n),v(n,{code:h.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),v(n,{code:h.not_finite,message:i.message}),a.dirty()):I.assertNever(i);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,b.toString(t))}gt(e,t){return this.setLimit("min",e,!1,b.toString(t))}lte(e,t){return this.setLimit("max",e,!0,b.toString(t))}lt(e,t){return this.setLimit("max",e,!1,b.toString(t))}setLimit(e,t,n,a){return new r(T(d({},this._def),{checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:b.toString(a)}]}))}_addCheck(e){return new r(T(d({},this._def),{checks:[...this._def.checks,e]}))}int(e){return this._addCheck({kind:"int",message:b.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:b.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:b.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:b.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:b.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:b.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:b.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:b.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:b.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&I.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(t===null||n.value>t)&&(t=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}};Te.create=r=>new Te(d({checks:[],typeName:N.ZodNumber,coerce:(r==null?void 0:r.coerce)||!1},R(r)));var ke=class r extends A{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch(i){return this._getInvalidInput(e)}if(this._getType(e)!==w.bigint)return this._getInvalidInput(e);let n,a=new P;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),v(n,{code:h.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),v(n,{code:h.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),v(n,{code:h.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):I.assertNever(i);return{status:a.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return v(t,{code:h.invalid_type,expected:w.bigint,received:t.parsedType}),k}gte(e,t){return this.setLimit("min",e,!0,b.toString(t))}gt(e,t){return this.setLimit("min",e,!1,b.toString(t))}lte(e,t){return this.setLimit("max",e,!0,b.toString(t))}lt(e,t){return this.setLimit("max",e,!1,b.toString(t))}setLimit(e,t,n,a){return new r(T(d({},this._def),{checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:b.toString(a)}]}))}_addCheck(e){return new r(T(d({},this._def),{checks:[...this._def.checks,e]}))}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:b.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:b.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:b.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:b.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:b.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};ke.create=r=>{var e;return new ke(d({checks:[],typeName:N.ZodBigInt,coerce:(e=r==null?void 0:r.coerce)!=null?e:!1},R(r)))};var Ne=class extends A{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==w.boolean){let n=this._getOrReturnCtx(e);return v(n,{code:h.invalid_type,expected:w.boolean,received:n.parsedType}),k}return M(e.data)}};Ne.create=r=>new Ne(d({typeName:N.ZodBoolean,coerce:(r==null?void 0:r.coerce)||!1},R(r)));var Re=class r extends A{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==w.date){let i=this._getOrReturnCtx(e);return v(i,{code:h.invalid_type,expected:w.date,received:i.parsedType}),k}if(Number.isNaN(e.data.getTime())){let i=this._getOrReturnCtx(e);return v(i,{code:h.invalid_date}),k}let n=new P,a;for(let i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(a=this._getOrReturnCtx(e,a),v(a,{code:h.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(a=this._getOrReturnCtx(e,a),v(a,{code:h.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):I.assertNever(i);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new r(T(d({},this._def),{checks:[...this._def.checks,e]}))}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:b.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:b.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}};Re.create=r=>new Re(d({checks:[],coerce:(r==null?void 0:r.coerce)||!1,typeName:N.ZodDate},R(r)));var He=class extends A{_parse(e){if(this._getType(e)!==w.symbol){let n=this._getOrReturnCtx(e);return v(n,{code:h.invalid_type,expected:w.symbol,received:n.parsedType}),k}return M(e.data)}};He.create=r=>new He(d({typeName:N.ZodSymbol},R(r)));var Ae=class extends A{_parse(e){if(this._getType(e)!==w.undefined){let n=this._getOrReturnCtx(e);return v(n,{code:h.invalid_type,expected:w.undefined,received:n.parsedType}),k}return M(e.data)}};Ae.create=r=>new Ae(d({typeName:N.ZodUndefined},R(r)));var Ie=class extends A{_parse(e){if(this._getType(e)!==w.null){let n=this._getOrReturnCtx(e);return v(n,{code:h.invalid_type,expected:w.null,received:n.parsedType}),k}return M(e.data)}};Ie.create=r=>new Ie(d({typeName:N.ZodNull},R(r)));var he=class extends A{constructor(){super(...arguments),this._any=!0}_parse(e){return M(e.data)}};he.create=r=>new he(d({typeName:N.ZodAny},R(r)));var ue=class extends A{constructor(){super(...arguments),this._unknown=!0}_parse(e){return M(e.data)}};ue.create=r=>new ue(d({typeName:N.ZodUnknown},R(r)));var G=class extends A{_parse(e){let t=this._getOrReturnCtx(e);return v(t,{code:h.invalid_type,expected:w.never,received:t.parsedType}),k}};G.create=r=>new G(d({typeName:N.ZodNever},R(r)));var Ke=class extends A{_parse(e){if(this._getType(e)!==w.undefined){let n=this._getOrReturnCtx(e);return v(n,{code:h.invalid_type,expected:w.void,received:n.parsedType}),k}return M(e.data)}};Ke.create=r=>new Ke(d({typeName:N.ZodVoid},R(r)));var le=class r extends A{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),a=this._def;if(t.parsedType!==w.array)return v(t,{code:h.invalid_type,expected:w.array,received:t.parsedType}),k;if(a.exactLength!==null){let s=t.data.length>a.exactLength.value,o=t.data.length<a.exactLength.value;(s||o)&&(v(t,{code:s?h.too_big:h.too_small,minimum:o?a.exactLength.value:void 0,maximum:s?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),n.dirty())}if(a.minLength!==null&&t.data.length<a.minLength.value&&(v(t,{code:h.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),n.dirty()),a.maxLength!==null&&t.data.length>a.maxLength.value&&(v(t,{code:h.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((s,o)=>a.type._parseAsync(new z(t,s,t.path,o)))).then(s=>P.mergeArray(n,s));let i=[...t.data].map((s,o)=>a.type._parseSync(new z(t,s,t.path,o)));return P.mergeArray(n,i)}get element(){return this._def.type}min(e,t){return new r(T(d({},this._def),{minLength:{value:e,message:b.toString(t)}}))}max(e,t){return new r(T(d({},this._def),{maxLength:{value:e,message:b.toString(t)}}))}length(e,t){return new r(T(d({},this._def),{exactLength:{value:e,message:b.toString(t)}}))}nonempty(e){return this.min(1,e)}};le.create=(r,e)=>new le(d({type:r,minLength:null,maxLength:null,exactLength:null,typeName:N.ZodArray},R(e)));function Je(r){if(r instanceof $){let e={};for(let t in r.shape){let n=r.shape[t];e[t]=Z.create(Je(n))}return new $(T(d({},r._def),{shape:()=>e}))}else return r instanceof le?new le(T(d({},r._def),{type:Je(r.element)})):r instanceof Z?Z.create(Je(r.unwrap())):r instanceof ee?ee.create(Je(r.unwrap())):r instanceof Q?Q.create(r.items.map(e=>Je(e))):r}var $=class r extends A{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=I.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==w.object){let p=this._getOrReturnCtx(e);return v(p,{code:h.invalid_type,expected:w.object,received:p.parsedType}),k}let{status:n,ctx:a}=this._processInputParams(e),{shape:i,keys:s}=this._getCached(),o=[];if(!(this._def.catchall instanceof G&&this._def.unknownKeys==="strip"))for(let p in a.data)s.includes(p)||o.push(p);let f=[];for(let p of s){let y=i[p],_=a.data[p];f.push({key:{status:"valid",value:p},value:y._parse(new z(a,_,a.path,p)),alwaysSet:p in a.data})}if(this._def.catchall instanceof G){let p=this._def.unknownKeys;if(p==="passthrough")for(let y of o)f.push({key:{status:"valid",value:y},value:{status:"valid",value:a.data[y]}});else if(p==="strict")o.length>0&&(v(a,{code:h.unrecognized_keys,keys:o}),n.dirty());else if(p!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let p=this._def.catchall;for(let y of o){let _=a.data[y];f.push({key:{status:"valid",value:y},value:p._parse(new z(a,_,a.path,y)),alwaysSet:y in a.data})}}return a.common.async?Promise.resolve().then(async()=>{let p=[];for(let y of f){let _=await y.key,S=await y.value;p.push({key:_,value:S,alwaysSet:y.alwaysSet})}return p}).then(p=>P.mergeObjectSync(n,p)):P.mergeObjectSync(n,f)}get shape(){return this._def.shape()}strict(e){return b.errToObj,new r(d(T(d({},this._def),{unknownKeys:"strict"}),e!==void 0?{errorMap:(t,n)=>{var i,s,o,f;let a=(o=(s=(i=this._def).errorMap)==null?void 0:s.call(i,t,n).message)!=null?o:n.defaultError;return t.code==="unrecognized_keys"?{message:(f=b.errToObj(e).message)!=null?f:a}:{message:a}}}:{}))}strip(){return new r(T(d({},this._def),{unknownKeys:"strip"}))}passthrough(){return new r(T(d({},this._def),{unknownKeys:"passthrough"}))}extend(e){return new r(T(d({},this._def),{shape:()=>d(d({},this._def.shape()),e)}))}merge(e){return new r({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>d(d({},this._def.shape()),e._def.shape()),typeName:N.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new r(T(d({},this._def),{catchall:e}))}pick(e){let t={};for(let n of I.objectKeys(e))e[n]&&this.shape[n]&&(t[n]=this.shape[n]);return new r(T(d({},this._def),{shape:()=>t}))}omit(e){let t={};for(let n of I.objectKeys(this.shape))e[n]||(t[n]=this.shape[n]);return new r(T(d({},this._def),{shape:()=>t}))}deepPartial(){return Je(this)}partial(e){let t={};for(let n of I.objectKeys(this.shape)){let a=this.shape[n];e&&!e[n]?t[n]=a:t[n]=a.optional()}return new r(T(d({},this._def),{shape:()=>t}))}required(e){let t={};for(let n of I.objectKeys(this.shape))if(e&&!e[n])t[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof Z;)i=i._def.innerType;t[n]=i}return new r(T(d({},this._def),{shape:()=>t}))}keyof(){return zn(I.objectKeys(this.shape))}};$.create=(r,e)=>new $(d({shape:()=>r,unknownKeys:"strip",catchall:G.create(),typeName:N.ZodObject},R(e)));$.strictCreate=(r,e)=>new $(d({shape:()=>r,unknownKeys:"strict",catchall:G.create(),typeName:N.ZodObject},R(e)));$.lazycreate=(r,e)=>new $(d({shape:r,unknownKeys:"strip",catchall:G.create(),typeName:N.ZodObject},R(e)));var Ee=class extends A{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function a(i){for(let o of i)if(o.result.status==="valid")return o.result;for(let o of i)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;let s=i.map(o=>new D(o.ctx.common.issues));return v(t,{code:h.invalid_union,unionErrors:s}),k}if(t.common.async)return Promise.all(n.map(async i=>{let s=T(d({},t),{common:T(d({},t.common),{issues:[]}),parent:null});return{result:await i._parseAsync({data:t.data,path:t.path,parent:s}),ctx:s}})).then(a);{let i,s=[];for(let f of n){let p=T(d({},t),{common:T(d({},t.common),{issues:[]}),parent:null}),y=f._parseSync({data:t.data,path:t.path,parent:p});if(y.status==="valid")return y;y.status==="dirty"&&!i&&(i={result:y,ctx:p}),p.common.issues.length&&s.push(p.common.issues)}if(i)return t.common.issues.push(...i.ctx.common.issues),i.result;let o=s.map(f=>new D(f));return v(t,{code:h.invalid_union,unionErrors:o}),k}}get options(){return this._def.options}};Ee.create=(r,e)=>new Ee(d({options:r,typeName:N.ZodUnion},R(e)));var oe=r=>r instanceof Ce?oe(r.schema):r instanceof Y?oe(r.innerType()):r instanceof Le?[r.value]:r instanceof Oe?r.options:r instanceof Ue?I.objectValues(r.enum):r instanceof Fe?oe(r._def.innerType):r instanceof Ae?[void 0]:r instanceof Ie?[null]:r instanceof Z?[void 0,...oe(r.unwrap())]:r instanceof ee?[null,...oe(r.unwrap())]:r instanceof ft||r instanceof Pe?oe(r.unwrap()):r instanceof je?oe(r._def.innerType):[],St=class r extends A{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==w.object)return v(t,{code:h.invalid_type,expected:w.object,received:t.parsedType}),k;let n=this.discriminator,a=t.data[n],i=this.optionsMap.get(a);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(v(t,{code:h.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),k)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){let a=new Map;for(let i of t){let s=oe(i.shape[e]);if(!s.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let o of s){if(a.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);a.set(o,i)}}return new r(d({typeName:N.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:a},R(n)))}};function rr(r,e){let t=X(r),n=X(e);if(r===e)return{valid:!0,data:r};if(t===w.object&&n===w.object){let a=I.objectKeys(e),i=I.objectKeys(r).filter(o=>a.indexOf(o)!==-1),s=d(d({},r),e);for(let o of i){let f=rr(r[o],e[o]);if(!f.valid)return{valid:!1};s[o]=f.data}return{valid:!0,data:s}}else if(t===w.array&&n===w.array){if(r.length!==e.length)return{valid:!1};let a=[];for(let i=0;i<r.length;i++){let s=r[i],o=e[i],f=rr(s,o);if(!f.valid)return{valid:!1};a.push(f.data)}return{valid:!0,data:a}}else return t===w.date&&n===w.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}var Se=class extends A{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),a=(i,s)=>{if(It(i)||It(s))return k;let o=rr(i.value,s.value);return o.valid?((Et(i)||Et(s))&&t.dirty(),{status:t.value,value:o.data}):(v(n,{code:h.invalid_intersection_types}),k)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,s])=>a(i,s)):a(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};Se.create=(r,e,t)=>new Se(d({left:r,right:e,typeName:N.ZodIntersection},R(t)));var Q=class r extends A{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==w.array)return v(n,{code:h.invalid_type,expected:w.array,received:n.parsedType}),k;if(n.data.length<this._def.items.length)return v(n,{code:h.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),k;!this._def.rest&&n.data.length>this._def.items.length&&(v(n,{code:h.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let i=[...n.data].map((s,o)=>{let f=this._def.items[o]||this._def.rest;return f?f._parse(new z(n,s,n.path,o)):null}).filter(s=>!!s);return n.common.async?Promise.all(i).then(s=>P.mergeArray(t,s)):P.mergeArray(t,i)}get items(){return this._def.items}rest(e){return new r(T(d({},this._def),{rest:e}))}};Q.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Q(d({items:r,typeName:N.ZodTuple,rest:null},R(e)))};var Ct=class r extends A{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==w.object)return v(n,{code:h.invalid_type,expected:w.object,received:n.parsedType}),k;let a=[],i=this._def.keyType,s=this._def.valueType;for(let o in n.data)a.push({key:i._parse(new z(n,o,n.path,o)),value:s._parse(new z(n,n.data[o],n.path,o)),alwaysSet:o in n.data});return n.common.async?P.mergeObjectAsync(t,a):P.mergeObjectSync(t,a)}get element(){return this._def.valueType}static create(e,t,n){return t instanceof A?new r(d({keyType:e,valueType:t,typeName:N.ZodRecord},R(n))):new r(d({keyType:me.create(),valueType:e,typeName:N.ZodRecord},R(t)))}},Xe=class extends A{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==w.map)return v(n,{code:h.invalid_type,expected:w.map,received:n.parsedType}),k;let a=this._def.keyType,i=this._def.valueType,s=[...n.data.entries()].map(([o,f],p)=>({key:a._parse(new z(n,o,n.path,[p,"key"])),value:i._parse(new z(n,f,n.path,[p,"value"]))}));if(n.common.async){let o=new Map;return Promise.resolve().then(async()=>{for(let f of s){let p=await f.key,y=await f.value;if(p.status==="aborted"||y.status==="aborted")return k;(p.status==="dirty"||y.status==="dirty")&&t.dirty(),o.set(p.value,y.value)}return{status:t.value,value:o}})}else{let o=new Map;for(let f of s){let p=f.key,y=f.value;if(p.status==="aborted"||y.status==="aborted")return k;(p.status==="dirty"||y.status==="dirty")&&t.dirty(),o.set(p.value,y.value)}return{status:t.value,value:o}}}};Xe.create=(r,e,t)=>new Xe(d({valueType:e,keyType:r,typeName:N.ZodMap},R(t)));var Qe=class r extends A{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==w.set)return v(n,{code:h.invalid_type,expected:w.set,received:n.parsedType}),k;let a=this._def;a.minSize!==null&&n.data.size<a.minSize.value&&(v(n,{code:h.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),t.dirty()),a.maxSize!==null&&n.data.size>a.maxSize.value&&(v(n,{code:h.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),t.dirty());let i=this._def.valueType;function s(f){let p=new Set;for(let y of f){if(y.status==="aborted")return k;y.status==="dirty"&&t.dirty(),p.add(y.value)}return{status:t.value,value:p}}let o=[...n.data.values()].map((f,p)=>i._parse(new z(n,f,n.path,p)));return n.common.async?Promise.all(o).then(f=>s(f)):s(o)}min(e,t){return new r(T(d({},this._def),{minSize:{value:e,message:b.toString(t)}}))}max(e,t){return new r(T(d({},this._def),{maxSize:{value:e,message:b.toString(t)}}))}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};Qe.create=(r,e)=>new Qe(d({valueType:r,minSize:null,maxSize:null,typeName:N.ZodSet},R(e)));var Lt=class r extends A{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==w.function)return v(t,{code:h.invalid_type,expected:w.function,received:t.parsedType}),k;function n(o,f){return ct({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,qe(),se].filter(p=>!!p),issueData:{code:h.invalid_arguments,argumentsError:f}})}function a(o,f){return ct({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,qe(),se].filter(p=>!!p),issueData:{code:h.invalid_return_type,returnTypeError:f}})}let i={errorMap:t.common.contextualErrorMap},s=t.data;if(this._def.returns instanceof ye){let o=this;return M(async function(...f){let p=new D([]),y=await o._def.args.parseAsync(f,i).catch(U=>{throw p.addIssue(n(f,U)),p}),_=await Reflect.apply(s,this,y);return await o._def.returns._def.type.parseAsync(_,i).catch(U=>{throw p.addIssue(a(_,U)),p})})}else{let o=this;return M(function(...f){let p=o._def.args.safeParse(f,i);if(!p.success)throw new D([n(f,p.error)]);let y=Reflect.apply(s,this,p.data),_=o._def.returns.safeParse(y,i);if(!_.success)throw new D([a(y,_.error)]);return _.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new r(T(d({},this._def),{args:Q.create(e).rest(ue.create())}))}returns(e){return new r(T(d({},this._def),{returns:e}))}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new r(d({args:e||Q.create([]).rest(ue.create()),returns:t||ue.create(),typeName:N.ZodFunction},R(n)))}},Ce=class extends A{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};Ce.create=(r,e)=>new Ce(d({getter:r,typeName:N.ZodLazy},R(e)));var Le=class extends A{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return v(t,{received:t.data,code:h.invalid_literal,expected:this._def.value}),k}return{status:"valid",value:e.data}}get value(){return this._def.value}};Le.create=(r,e)=>new Le(d({value:r,typeName:N.ZodLiteral},R(e)));function zn(r,e){return new Oe(d({values:r,typeName:N.ZodEnum},R(e)))}var Oe=class r extends A{_parse(e){if(typeof e.data!="string"){let t=this._getOrReturnCtx(e),n=this._def.values;return v(t,{expected:I.joinValues(n),received:t.parsedType,code:h.invalid_type}),k}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return v(t,{received:t.data,code:h.invalid_enum_value,options:n}),k}return M(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return r.create(e,d(d({},this._def),t))}exclude(e,t=this._def){return r.create(this.options.filter(n=>!e.includes(n)),d(d({},this._def),t))}};Oe.create=zn;var Ue=class extends A{_parse(e){let t=I.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==w.string&&n.parsedType!==w.number){let a=I.objectValues(t);return v(n,{expected:I.joinValues(a),received:n.parsedType,code:h.invalid_type}),k}if(this._cache||(this._cache=new Set(I.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let a=I.objectValues(t);return v(n,{received:n.data,code:h.invalid_enum_value,options:a}),k}return M(e.data)}get enum(){return this._def.values}};Ue.create=(r,e)=>new Ue(d({values:r,typeName:N.ZodNativeEnum},R(e)));var ye=class extends A{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==w.promise&&t.common.async===!1)return v(t,{code:h.invalid_type,expected:w.promise,received:t.parsedType}),k;let n=t.parsedType===w.promise?t.data:Promise.resolve(t.data);return M(n.then(a=>this._def.type.parseAsync(a,{path:t.path,errorMap:t.common.contextualErrorMap})))}};ye.create=(r,e)=>new ye(d({type:r,typeName:N.ZodPromise},R(e)));var Y=class extends A{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===N.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),a=this._def.effect||null,i={addIssue:s=>{v(n,s),s.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),a.type==="preprocess"){let s=a.transform(n.data,i);if(n.common.async)return Promise.resolve(s).then(async o=>{if(t.value==="aborted")return k;let f=await this._def.schema._parseAsync({data:o,path:n.path,parent:n});return f.status==="aborted"?k:f.status==="dirty"?_e(f.value):t.value==="dirty"?_e(f.value):f});{if(t.value==="aborted")return k;let o=this._def.schema._parseSync({data:s,path:n.path,parent:n});return o.status==="aborted"?k:o.status==="dirty"?_e(o.value):t.value==="dirty"?_e(o.value):o}}if(a.type==="refinement"){let s=o=>{let f=a.refinement(o,i);if(n.common.async)return Promise.resolve(f);if(f instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(n.common.async===!1){let o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?k:(o.status==="dirty"&&t.dirty(),s(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>o.status==="aborted"?k:(o.status==="dirty"&&t.dirty(),s(o.value).then(()=>({status:t.value,value:o.value}))))}if(a.type==="transform")if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!de(s))return k;let o=a.transform(s.value,i);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>de(s)?Promise.resolve(a.transform(s.value,i)).then(o=>({status:t.value,value:o})):k);I.assertNever(a)}};Y.create=(r,e,t)=>new Y(d({schema:r,typeName:N.ZodEffects,effect:e},R(t)));Y.createWithPreprocess=(r,e,t)=>new Y(d({schema:e,effect:{type:"preprocess",transform:r},typeName:N.ZodEffects},R(t)));var Z=class extends A{_parse(e){return this._getType(e)===w.undefined?M(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Z.create=(r,e)=>new Z(d({innerType:r,typeName:N.ZodOptional},R(e)));var ee=class extends A{_parse(e){return this._getType(e)===w.null?M(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ee.create=(r,e)=>new ee(d({innerType:r,typeName:N.ZodNullable},R(e)));var Fe=class extends A{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===w.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};Fe.create=(r,e)=>new Fe(d({innerType:r,typeName:N.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default},R(e)));var je=class extends A{_parse(e){let{ctx:t}=this._processInputParams(e),n=T(d({},t),{common:T(d({},t.common),{issues:[]})}),a=this._def.innerType._parse({data:n.data,path:n.path,parent:d({},n)});return Ge(a)?a.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new D(n.common.issues)},input:n.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new D(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};je.create=(r,e)=>new je(d({innerType:r,typeName:N.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch},R(e)));var et=class extends A{_parse(e){if(this._getType(e)!==w.nan){let n=this._getOrReturnCtx(e);return v(n,{code:h.invalid_type,expected:w.nan,received:n.parsedType}),k}return{status:"valid",value:e.data}}};et.create=r=>new et(d({typeName:N.ZodNaN},R(r)));var bo=Symbol("zod_brand"),ft=class extends A{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},pt=class r extends A{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?k:i.status==="dirty"?(t.dirty(),_e(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{let a=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?k:a.status==="dirty"?(t.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:n.path,parent:n})}}static create(e,t){return new r({in:e,out:t,typeName:N.ZodPipeline})}},Pe=class extends A{_parse(e){let t=this._def.innerType._parse(e),n=a=>(de(a)&&(a.value=Object.freeze(a.value)),a);return Ge(t)?t.then(a=>n(a)):n(t)}unwrap(){return this._def.innerType}};Pe.create=(r,e)=>new Pe(d({innerType:r,typeName:N.ZodReadonly},R(e)));function $n(r,e){let t=typeof r=="function"?r(e):typeof r=="string"?{message:r}:r;return typeof t=="string"?{message:t}:t}function Yn(r,e={},t){return r?he.create().superRefine((n,a)=>{var s,o;let i=r(n);if(i instanceof Promise)return i.then(f=>{var p,y;if(!f){let _=$n(e,n),S=(y=(p=_.fatal)!=null?p:t)!=null?y:!0;a.addIssue(T(d({code:"custom"},_),{fatal:S}))}});if(!i){let f=$n(e,n),p=(o=(s=f.fatal)!=null?s:t)!=null?o:!0;a.addIssue(T(d({code:"custom"},f),{fatal:p}))}}):he.create()}var _o={object:$.lazycreate},N;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(N||(N={}));var To=(r,e={message:`Input not instance of ${r.name}`})=>Yn(t=>t instanceof r,e),qn=me.create,Gn=Te.create,ko=et.create,No=ke.create,Jn=Ne.create,Ro=Re.create,Ao=He.create,Io=Ae.create,Eo=Ie.create,So=he.create,Co=ue.create,Lo=G.create,Oo=Ke.create,Uo=le.create,Fo=$.create,jo=$.strictCreate,Po=Ee.create,Mo=St.create,Bo=Se.create,Do=Q.create,$o=Ct.create,Vo=Xe.create,Wo=Qe.create,Zo=Lt.create,zo=Ce.create,Yo=Le.create,qo=Oe.create,Go=Ue.create,Jo=ye.create,Ho=Y.create,Ko=Z.create,Xo=ee.create,Qo=Y.createWithPreprocess,eu=pt.create,tu=()=>qn().optional(),ru=()=>Gn().optional(),nu=()=>Jn().optional(),au={string:(r=>me.create(T(d({},r),{coerce:!0}))),number:(r=>Te.create(T(d({},r),{coerce:!0}))),boolean:(r=>Ne.create(T(d({},r),{coerce:!0}))),bigint:(r=>ke.create(T(d({},r),{coerce:!0}))),date:(r=>Re.create(T(d({},r),{coerce:!0})))};var iu=k;l();c();var Hn=E.strictObject({title:E.string(),content:E.string()});var nr=E.object({"base-api-exception-class-name":E.string().optional(),"base-exception-class-name":E.string().optional(),"client-class-name":E.string().optional(),"inline-file-properties":E.boolean().optional(),"inline-path-parameters":E.boolean().optional(),"package-layout":E.enum(["flat","nested"]).optional(),"package-prefix":E.string().optional(),"use-local-date-for-dates":E.boolean().optional(),"custom-dependencies":E.array(E.string()).optional(),"disable-required-property-builder-checks":E.boolean().optional(),"enable-forward-compatible-enums":E.boolean().optional(),"enable-inline-types":E.boolean().optional(),"enable-public-constructors":E.boolean().optional(),"generate-unknown-as-json-node":E.boolean().optional(),"json-include":E.enum(["non-absent","non-empty"]).optional(),"enable-extensible-builders":E.boolean().optional(),"use-default-request-parameter-values":E.boolean().optional(),"enable-wire-tests":E.boolean().default(!1),"collapse-optional-nullable":E.boolean().optional(),"custom-readme-sections":E.array(Hn).optional(),"custom-pager-name":E.string().optional(),"wrapped-aliases":E.boolean().optional()});var m={};Wt(m,{Access:()=>ar,AstNode:()=>F,Class:()=>Me,ClassInstantiation:()=>Be,ClassReference:()=>L,CodeBlock:()=>De,Method:()=>$e,MethodInvocation:()=>Ve,Parameter:()=>We,Type:()=>dt,TypeLiteral:()=>V,Writer:()=>be,classReference:()=>Ru,class_:()=>Nu,codeblock:()=>ku,instantiateClass:()=>Au,invokeMethod:()=>Iu,method:()=>Eu,parameter:()=>Su});l();c();l();c();l();c();var ar={Public:"public",Protected:"protected",Private:"private"};l();c();l();c();var F=class extends we{async toStringAsync({packageName:e,customConfig:t,formatter:n}){let a=new lt({packageName:e,customConfig:t,formatter:n});return this.write(a),a.toStringAsync()}toString({packageName:e,customConfig:t,formatter:n}){let a=new lt({packageName:e,customConfig:t,formatter:n});return this.write(a),a.toString()}};var Me=class extends F{constructor({name:t,access:n}){super();x(this,"name");x(this,"access");x(this,"methods",[]);this.name=t,this.access=n}write(t){if(t.write(`${this.access} class ${this.name}`),this.isEmpty()){t.writeLine(" {}");return}t.writeLine(" {"),t.indent();for(let n of this.methods)t.writeNode(n),t.newLine();t.dedent(),t.write("}")}addMethod(t){this.methods.push(t)}isEmpty(){return this.methods.length===0}};l();c();l();c();l();c();l();c();var L=class extends F{constructor({name:t,packageName:n,fullyQualified:a}){super();x(this,"name");x(this,"packageName");x(this,"fullyQualified");this.name=t,this.packageName=n,this.fullyQualified=a!=null?a:!1}write(t){if(t.addImport(`${this.packageName}.${this.name}`),this.fullyQualified){t.write(`${this.packageName}.${this.name}`);return}t.write(this.name)}};l();c();var dt=class extends F{constructor(t){super();x(this,"internalType");this.internalType=t}write(t){switch(this.internalType.type){case"array":t.writeNode(this.internalType.value),t.write("[]");break;case"bigInteger":t.writeNode(su);break;case"boolean":t.write("Boolean");break;case"bytes":t.write("byte[]");break;case"date":t.write("String");break;case"dateTime":t.writeNode(lu);break;case"double":t.write("Double");break;case"float":t.write("Float");break;case"generic":t.writeNode(this.internalType.value),t.write("<");for(let[n,a]of this.internalType.parameters.entries())t.writeNode(a),n<this.internalType.parameters.length-1&&t.write(", ");t.write(">");break;case"inputStream":t.writeNode(pu);break;case"integer":t.write("Integer");break;case"iterable":this.writeIterable({writer:t,iterable:this.internalType});break;case"list":{this.writeList({writer:t,list:this.internalType});break}case"long":{t.write("Long");break}case"map":{this.writeMap({writer:t,map:this.internalType});break}case"object":{t.write("Object");break}case"optional":{this.writeOptional({writer:t,optional:this.internalType});break}case"reference":t.writeNode(this.internalType.value);break;case"set":{this.writeSet({writer:t,set:this.internalType});break}case"string":t.write("String");break;case"uuid":t.writeNode(fu);break;case"void":t.write("Void");break;default:C(this.internalType)}}isOptional(){return this.internalType.type==="optional"}static array(t){return new this({type:"array",value:t})}static bigInteger(){return new this({type:"bigInteger"})}static boolean(){return new this({type:"boolean"})}static bytes(){return new this({type:"bytes"})}static date(){return new this({type:"date"})}static dateTime(){return new this({type:"dateTime"})}static double(){return new this({type:"double"})}static float(){return new this({type:"float"})}static integer(){return new this({type:"integer"})}static list(t){return new this({type:"list",value:t})}static long(){return new this({type:"long"})}static map(t,n){return new this({type:"map",keyType:t,valueType:n})}static object(){return new this({type:"object"})}static optional(t){return this.isAlreadyOptional(t)?t:new this({type:"optional",value:t})}static reference(t){return new this({type:"reference",value:t})}static generic(t,n){return new this({type:"generic",value:t,parameters:n})}static set(t){return new this({type:"set",value:t})}static string(){return new this({type:"string"})}static uuid(){return new this({type:"uuid"})}static void(){return new this({type:"void"})}static iterable(t){return new this({type:"iterable",value:t})}static inputStream(){return new this({type:"inputStream"})}writeList({writer:t,list:n}){t.writeNode(ou),t.write("<"),n.value.write(t),t.write(">")}writeMap({writer:t,map:n}){t.writeNode(uu),t.write("<"),n.keyType.write(t),t.write(", "),n.valueType.write(t),t.write(">")}writeOptional({writer:t,optional:n}){t.writeNode(Ot),t.write("<"),n.value.write(t),t.write(">")}writeIterable({writer:t,iterable:n}){t.writeNode(Ot),t.write("<"),n.value.write(t),t.write(">")}writeSet({writer:t,set:n}){t.writeNode(cu),t.write("<"),n.value.write(t),t.write(">")}static isAlreadyOptional(t){return t.internalType.type==="optional"}},Ut=new L({name:"Arrays",packageName:"java.util"}),su=new L({name:"BigInteger",packageName:"java.math"}),bm=new L({name:"HashMap",packageName:"java.util"}),ou=new L({name:"List",packageName:"java.util"}),uu=new L({name:"Map",packageName:"java.util"}),lu=new L({name:"OffsetDateTime",packageName:"java.time"}),Ot=new L({name:"Optional",packageName:"java.util"}),cu=new L({name:"Set",packageName:"java.util"}),fu=new L({name:"UUID",packageName:"java.util"}),pu=new L({name:"InputStream",packageName:"java.io"});var V=class r extends F{constructor(t){super();x(this,"internalType");this.internalType=t}write(t){switch(this.internalType.type){case"bigInteger":this.writeBigInteger({writer:t,bigInteger:this.internalType});break;case"boolean":t.write(this.internalType.value.toString());break;case"builder":this.writeBuilder({writer:t,builder:this.internalType});break;case"bytes":t.write(`"${this.internalType.value}".getBytes()`);break;case"class":{this.writeClass({writer:t,class_:this.internalType});break}case"date":this.writeDate({writer:t,date:this.internalType});break;case"dateTime":this.writeDateTime({writer:t,dateTime:this.internalType});break;case"double":{let n=this.internalType.value.toString();!n.includes(".")&&!n.includes("e")&&!n.includes("E")?t.write(`${n}.0`):t.write(n);break}case"enum":this.writeEnum({writer:t,enum_:this.internalType});break;case"float":t.write(`${this.internalType.value}f`);break;case"integer":t.write(Math.floor(this.internalType.value).toString());break;case"list":{this.writeList({writer:t,list:this.internalType});break}case"long":{t.write(`${Math.floor(this.internalType.value)}L`);break}case"map":{this.writeMap({writer:t,map:this.internalType});break}case"optional":{this.writeOptional({writer:t,optional:this.internalType});break}case"raw":{this.internalType.value instanceof F?t.writeNode(this.internalType.value):t.write(this.internalType.value);break}case"reference":t.writeNode(this.internalType.value);break;case"set":{this.writeSet({writer:t,set:this.internalType});break}case"string":t.write(`"${this.escapeString(this.internalType.value)}"`);break;case"unknown":this.writeUnknown({writer:t,value:this.internalType.value});break;case"uuid":this.writeUUID({writer:t,uuid:this.internalType});break;case"nop":break;default:C(this.internalType)}}isOptional(){return this.internalType.type==="optional"}static bigInteger(t){return new this({type:"bigInteger",value:t})}static boolean(t){return new this({type:"boolean",value:t})}static builder({classReference:t,parameters:n}){return new this({type:"builder",classReference:t,parameters:n})}static bytes(t){return new this({type:"bytes",value:t})}static class_({reference:t,parameters:n}){return new this({type:"class",reference:t,parameters:n})}static date(t){return new this({type:"date",value:t})}static dateTime(t){return new this({type:"dateTime",value:t})}static double(t){return new this({type:"double",value:t})}static enum_({classReference:t,value:n}){return new this({type:"enum",classReference:t,value:n})}static float(t){return new this({type:"float",value:t})}static integer(t){return new this({type:"integer",value:t})}static list({valueType:t,values:n,isParameter:a}){return new this({type:"list",valueType:t,values:n,isParameter:a})}static long(t){return new this({type:"long",value:t})}static map({keyType:t,valueType:n,entries:a}){return new this({type:"map",keyType:t,valueType:n,entries:a})}static optional({value:t,useOf:n}){return this.isAlreadyOptional(t)?t:new this({type:"optional",value:t,useOf:n})}static raw(t){return new this({type:"raw",value:t})}static reference(t){return new this({type:"reference",value:t})}static set({valueType:t,values:n}){return new this({type:"set",valueType:t,values:n})}static string(t){return new this({type:"string",value:t})}static unknown(t){return new this({type:"unknown",value:t})}static uuid(t){return new this({type:"uuid",value:t})}static nop(){return new this({type:"nop"})}static isNop(t){return t.internalType.type==="nop"}shouldWriteInLine(){switch(this.internalType.type){case"bigInteger":case"boolean":case"bytes":case"date":case"dateTime":case"double":case"enum":case"float":case"integer":case"long":case"nop":case"raw":case"string":case"unknown":case"uuid":return!0;case"optional":return this.internalType.value.shouldWriteInLine();case"builder":case"class":case"list":case"map":case"reference":case"set":return!1;default:C(this.internalType)}}writeBigInteger({writer:t,bigInteger:n}){t.write("new "),t.writeNode(m.instantiateClass({classReference:du,arguments_:[r.string(n.value)]}))}writeBuilder({writer:t,builder:n}){t.writeNode(n.classReference),t.writeNewLineIfLastLineNot(),t.indent(),this.writeBuilderParameters({writer:t,parameters:this.orderBuilderParameters(vu({parameters:n.parameters}))}),t.dedent()}writeBuilderParameters({writer:t,parameters:n}){t.writeLine(".builder()");for(let a of n)t.write(`.${a.name}(`),a.value.shouldWriteInLine()||t.newLine(),t.indent(),t.writeNode(a.value),t.dedent(),a.value.shouldWriteInLine()||t.newLine(),t.writeLine(")");t.writeNewLineIfLastLineNot(),t.write(".build()")}orderBuilderParameters(t){return t.some(a=>!a.value.isOptional()&&!this.isCollection(a.value))?t.sort((a,i)=>{let s=this.isNonRequired(a.value),o=this.isNonRequired(i.value);return s&&!o?1:!s&&o?-1:0}):t.sort((a,i)=>{let s=a.value.isOptional(),o=i.value.isOptional();return s&&!o?1:!s&&o?-1:0})}isCollection(t){let n=t.internalType.type;return n==="list"||n==="set"||n==="map"}isNonRequired(t){return t.isOptional()||this.isCollection(t)}writeClass({writer:t,class_:n}){let a=xu({parameters:n.parameters});t.writeNode(m.instantiateClass({classReference:n.reference,arguments_:a.map(i=>i.value)}))}writeDate({writer:t,date:n}){t.writeNode(m.invokeMethod({on:hu,method:"parse",arguments_:[r.string(n.value)]}))}writeDateTime({writer:t,dateTime:n}){t.writeNode(m.invokeMethod({on:yu,method:"parse",arguments_:[r.string(n.value)]}))}writeEnum({writer:t,enum_:n}){t.writeNode(n.classReference),t.write("."+n.value)}writeList({writer:t,list:n}){this.writeIterable({writer:t,iterable:n})}writeMap({writer:t,map:n}){let a=wu({entries:n.entries});if(a.length===0){t.write("new "),t.writeNode(Ft),t.write("<"),t.writeNode(n.keyType),t.write(", "),t.writeNode(n.valueType),t.write(">()");return}t.write("new "),t.writeNode(Ft),t.write("<"),t.writeNode(n.keyType),t.write(", "),t.writeNode(n.valueType),t.writeLine(">() {{"),t.indent();for(let i of a)t.write("put("),t.writeNode(i.key),t.write(", "),t.writeNode(i.value),t.writeLine(");");t.dedent(),t.write("}}")}writeOptional({writer:t,optional:n}){if(!n.useOf){t.writeNode(n.value);return}t.writeNode(m.invokeMethod({on:Ot,method:"of",arguments_:[n.value]}))}writeSet({writer:t,set:n}){this.writeIterable({writer:t,iterable:n})}writeIterable({writer:t,iterable:n}){let a=n.type==="list"?ir:mu,i=bu({values:n.values});if(n.type==="list"&&n.isParameter&&i.length>0){t.writeNode(m.invokeMethod({on:Ut,method:"asList",arguments_:i}));return}if(i.length===0){t.write(`new ${a.name}<`),t.writeNode(n.valueType),t.write(">()");return}t.write("new "),t.writeNode(a),t.write("<"),t.writeNode(n.valueType),t.writeLine(">("),t.indent(),t.writeNode(m.invokeMethod({on:Ut,method:"asList",arguments_:i})),t.writeNewLineIfLastLineNot(),t.dedent(),t.write(")")}writeUnknown({writer:t,value:n}){switch(typeof n){case"boolean":t.write(n.toString());return;case"string":t.write(`"${this.escapeString(n)}"`);return;case"number":t.write(n.toString());return;case"object":if(n==null){t.write("null");return}if(Array.isArray(n)){this.writeUnknownArray({writer:t,value:n});return}this.writeUnknownMap({writer:t,value:n});return;default:throw new Error(`Internal error; unsupported unknown type: ${typeof n}`)}}writeUnknownArray({writer:t,value:n}){if(n.length===0){t.write("new "),t.writeNode(ir),t.write("<Object>()");return}t.write("new "),t.writeNode(ir),t.write("<Object>("),t.writeNode(m.invokeMethod({on:Ut,method:"asList",arguments_:n.map(a=>r.unknown(a))})),t.write(")")}writeUnknownMap({writer:t,value:n}){let a=Object.entries(n);if(a.length===0){t.write("new "),t.writeNode(Ft),t.write("<String, Object>()");return}t.writeLine("new "),t.writeNode(Ft),t.write("<String, Object>() {{"),t.indent();for(let[i,s]of a)t.write(`put("${i}", `),t.writeNode(r.unknown(s)),t.writeLine(");");t.dedent(),t.write("}}")}writeUUID({writer:t,uuid:n}){t.writeNode(m.invokeMethod({on:gu,method:"fromString",arguments_:[r.string(n.value)]}))}escapeString(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}static isAlreadyOptional(t){return t.internalType.type==="optional"}},ir=new L({name:"ArrayList",packageName:"java.util"}),du=new L({name:"BigInteger",packageName:"java.math"}),Ft=new L({name:"HashMap",packageName:"java.util"}),mu=new L({name:"HashSet",packageName:"java.util"}),Cm=new L({name:"List",packageName:"java.util"}),hu=new L({name:"LocalDate",packageName:"java.time"}),Lm=new L({name:"Map",packageName:"java.util"}),yu=new L({name:"OffsetDateTime",packageName:"java.time"}),Om=new L({name:"Set",packageName:"java.util"}),gu=new L({name:"UUID",packageName:"java.util"});function xu({parameters:r}){return r.filter(e=>!V.isNop(e.value))}function vu({parameters:r}){return r.filter(e=>!V.isNop(e.value))}function wu({entries:r}){return r.filter(e=>!V.isNop(e.key)&&!V.isNop(e.value))}function bu({values:r}){return r.filter(e=>!V.isNop(e))}function jt({writer:r,arguments_:e}){let t=Tu(e);if(t.length===0){r.write("()");return}if(t.some(a=>a instanceof V&&!a.shouldWriteInLine())){_u({writer:r,arguments_:t});return}r.write("("),t.forEach((a,i)=>{i>0&&r.write(", "),Kn({writer:r,argument:a})}),r.write(")")}function _u({writer:r,arguments_:e}){r.writeLine("("),r.indent(),e.forEach((t,n)=>{n>0&&r.writeLine(","),Kn({writer:r,argument:t})}),r.dedent(),e.length>0&&r.newLine(),r.write(")")}function Kn({writer:r,argument:e}){Qt(e)?r.writeNodeOrString(e.assignment):e.write(r)}function Tu(r){return r.filter(e=>!(e instanceof V&&V.isNop(e)))}var Be=class extends F{constructor({classReference:t,arguments_:n}){super();x(this,"classReference");x(this,"arguments_");this.classReference=t,this.arguments_=n}write(t){t.writeNode(this.classReference),jt({writer:t,arguments_:this.arguments_})}};l();c();var De=class extends F{constructor(t){super();x(this,"arg");this.arg=t}write(t){return new q(this.arg).write(t)}};l();c();var $e=class extends F{constructor({name:t,access:n,parameters:a,body:i,static_:s,return_:o}){super();x(this,"name");x(this,"access");x(this,"parameters");x(this,"body");x(this,"return_");x(this,"static_");this.name=t,this.access=n,this.parameters=a,this.body=i,this.return_=o,this.static_=s!=null?s:!1}write(t){if(t.write(`${this.access} `),this.static_&&t.write("static "),this.return_!=null?t.writeNode(this.return_):t.write("void"),t.write(` ${this.name}`),this.parameters.length===0)t.write("()");else if(this.parameters.length===1){if(t.write("("),this.parameters[0]==null)throw new Error("Cannot render parameter "+this.parameters[0]);t.writeNode(this.parameters[0]),t.write(")")}else t.writeLine("("),t.indent(),this.parameters.forEach((n,a)=>{a>0&&t.writeLine(", "),t.writeNode(n)}),t.dedent(),t.write(")");if(this.body==null){t.write(";");return}t.writeLine(" {"),t.indent(),t.writeNode(this.body),t.writeNewLineIfLastLineNot(),t.dedent(),t.write("}")}};l();c();var Ve=class extends F{constructor({method:t,arguments_:n,on:a}){super();x(this,"on");x(this,"method");x(this,"arguments_");this.on=a,this.method=t,this.arguments_=n}write(t){this.on.write(t),t.write("."),t.write(this.method),jt({writer:t,arguments_:this.arguments_})}};l();c();var We=class extends F{constructor({name:t,type:n}){super();x(this,"name");x(this,"type");this.name=t,this.type=n}write(t){t.writeNode(this.type),t.write(` ${this.name}`)}};function ku(r){return new De(r)}function Nu(r){return new Me(r)}function Ru(r){return new L(r)}function Au(r){return new Be(r)}function Iu(r){return new Ve(r)}function Eu(r){return new $e(r)}function Su(r){return new We(r)}l();c();var Pt=class{constructor({context:e}){x(this,"context");this.context=e}isNopTypeLiteral(e){var n;return((n=e.internalType)==null?void 0:n.type)==="nop"}usesOptionalNullable(){var e;return((e=this.context.customConfig)==null?void 0:e["collapse-optional-nullable"])===!0}wrapInOptionalIfNotNop(e,t=!1){return this.isNopTypeLiteral(e)?e:this.usesOptionalNullable()?this.context.getOptionalNullableOf(e):m.TypeLiteral.optional({value:e,useOf:t})}convert(e){if(e.value===null)return this.context.isNullable(e.typeReference)?this.context.getNullableOfNull():(this.context.errors.add({severity:O.Critical,message:"Expected non-null value, but got null"}),m.TypeLiteral.nop());if(e.value===void 0)return m.TypeLiteral.nop();switch(e.typeReference.type){case"list":return this.convertList({list:e.typeReference.value,value:e.value,as:e.as});case"literal":return this.convertLiteral({literal:e.typeReference.value,value:e.value});case"map":return this.convertMap({map:e.typeReference,value:e.value,as:e.as});case"named":{let t=this.context.resolveNamedType({typeId:e.typeReference.value});return t==null?m.TypeLiteral.nop():this.convertNamed({named:t,value:e.value,as:e.as,inUndiscriminatedUnion:e.inUndiscriminatedUnion})}case"nullable":case"optional":{if(e.value===void 0||typeof e.value=="object"&&e.value!==null&&Object.keys(e.value).length===0&&e.typeReference.value.type==="named")return this.usesOptionalNullable()?this.context.getOptionalNullableAbsent():m.TypeLiteral.reference(m.invokeMethod({on:m.classReference({name:"Optional",packageName:"java.util"}),method:"empty",arguments_:[]}));if(e.typeReference.value.type==="list"){let a=this.convertList({list:e.typeReference.value.value,value:e.value});return this.wrapInOptionalIfNotNop(a,!0)}if(this.usesOptionalNullable()&&(e.typeReference.value.type==="optional"||e.typeReference.value.type==="nullable"))return this.convert({typeReference:e.typeReference.value,value:e.value,as:e.as,inUndiscriminatedUnion:e.inUndiscriminatedUnion});let t=this.convert({typeReference:e.typeReference.value,value:e.value,as:e.as,inUndiscriminatedUnion:e.inUndiscriminatedUnion}),n=e.as==="mapValue"||e.inUndiscriminatedUnion===!0;return this.wrapInOptionalIfNotNop(t,n)}case"primitive":return this.convertPrimitive({primitive:e.typeReference.value,value:e.value,as:e.as});case"set":return this.convertSet({set:e.typeReference.value,value:e.value,as:e.as});case"unknown":return this.convertUnknown({value:e.value});default:C(e.typeReference)}}convertList({list:e,value:t,as:n}){if(!Array.isArray(t))return this.context.errors.add({severity:O.Critical,message:`Expected array but got: ${typeof t}`}),m.TypeLiteral.nop();let a=e.type==="optional"||e.type==="nullable";return m.TypeLiteral.list({valueType:this.context.dynamicTypeMapper.convert({typeReference:e}),values:t.map((i,s)=>{this.context.errors.scope({index:s});try{if(a){let o=this.convert({typeReference:e.value,value:i,as:n});return this.wrapInOptionalIfNotNop(o,!0)}return this.convert({typeReference:e,value:i,as:n})}finally{this.context.errors.unscope()}}),isParameter:!0})}convertLiteral({literal:e,value:t}){switch(e.type){case"boolean":{let n=this.context.getValueAsBoolean({value:t});return n==null?m.TypeLiteral.nop():m.TypeLiteral.boolean(n)}case"string":{let n=this.context.getValueAsString({value:t});return n==null?m.TypeLiteral.nop():m.TypeLiteral.string(n)}default:C(e)}}convertSet({set:e,value:t,as:n}){return Array.isArray(t)?m.TypeLiteral.set({valueType:this.context.dynamicTypeMapper.convert({typeReference:e}),values:t.map((a,i)=>{this.context.errors.scope({index:i});try{return this.convert({typeReference:e,value:a,as:n})}finally{this.context.errors.unscope()}})}):(this.context.errors.add({severity:O.Critical,message:`Expected array but got: ${typeof t}`}),m.TypeLiteral.nop())}convertMap({map:e,value:t,as:n}){return typeof t!="object"||t==null?(this.context.errors.add({severity:O.Critical,message:`Expected object but got: ${t==null?"null":typeof t}`}),m.TypeLiteral.nop()):m.TypeLiteral.map({keyType:this.context.dynamicTypeMapper.convert({typeReference:e.key}),valueType:this.context.dynamicTypeMapper.convert({typeReference:e.value}),entries:Object.entries(t).map(([a,i])=>{this.context.errors.scope(a);try{return{key:this.convert({typeReference:e.key,value:a,as:"mapKey"}),value:this.convert({typeReference:e.value,value:i,as:"mapValue"})}}finally{this.context.errors.unscope()}})})}convertNamed({named:e,value:t,as:n,inUndiscriminatedUnion:a}){switch(e.type){case"alias":return this.convert({typeReference:e.typeReference,value:t,as:n,inUndiscriminatedUnion:a});case"discriminatedUnion":return this.convertDiscriminatedUnion({discriminatedUnion:e,value:t});case"enum":return this.convertEnum({enum_:e,value:t});case"object":return this.convertObject({object_:e,value:t,as:n});case"undiscriminatedUnion":return this.convertUndiscriminatedUnion({undiscriminatedUnion:e,value:t});default:C(e)}}convertDiscriminatedUnion({discriminatedUnion:e,value:t}){let n=this.context.getJavaClassReferenceFromDeclaration({declaration:e.declaration}),a=this.context.resolveDiscriminatedUnionTypeInstance({discriminatedUnion:e,value:t});if(a==null)return m.TypeLiteral.nop();let i=a.singleDiscriminatedUnionType;switch(i.type){case"samePropertiesAsObject":{let s=this.context.resolveNamedType({typeId:i.typeId});return s==null?m.TypeLiteral.nop():m.TypeLiteral.reference(m.invokeMethod({on:n,method:this.context.getPropertyName(i.discriminantValue.name),arguments_:[this.convertNamed({named:s,value:a.value})]}))}case"singleProperty":{let s=this.context.getRecord(a.value);if(s==null)return m.TypeLiteral.nop();try{return this.context.errors.scope(i.discriminantValue.wireValue),m.TypeLiteral.reference(m.invokeMethod({on:n,method:this.context.getPropertyName(i.discriminantValue.name),arguments_:[this.convert({typeReference:i.typeReference,value:s["value"]})]}))}finally{this.context.errors.unscope()}}case"noProperties":return m.TypeLiteral.reference(m.invokeMethod({on:n,method:this.context.getPropertyName(i.discriminantValue.name),arguments_:[]}));default:C(i)}}convertObject({object_:e,value:t,as:n}){var s;let a=this.context.associateByWireValue({parameters:e.properties,values:(s=this.context.getRecord(t))!=null?s:{}}),i=n==="request"?a.filter(o=>!this.context.isDirectLiteral(o.typeReference)):a;return m.TypeLiteral.builder({classReference:this.context.getJavaClassReferenceFromDeclaration({declaration:e.declaration}),parameters:i.map(o=>{this.context.errors.scope(o.name.wireValue);try{return{name:this.context.getMethodName(o.name.name),value:this.convert({typeReference:o.typeReference,value:o.value,as:n})}}finally{this.context.errors.unscope()}})})}convertEnum({enum_:e,value:t}){let n=this.getEnumValueName({enum_:e,value:t});return n==null?m.TypeLiteral.nop():m.TypeLiteral.enum_({classReference:this.context.getJavaClassReferenceFromDeclaration({declaration:e.declaration}),value:n})}getEnumValueName({enum_:e,value:t}){if(typeof t!="string"){this.context.errors.add({severity:O.Critical,message:`Expected enum value string, got: ${typeof t}`});return}let n=e.values.find(a=>a.wireValue===t);if(n==null){this.context.errors.add({severity:O.Critical,message:`An enum value named "${t}" does not exist in this context`});return}return this.context.getEnumName(n.name)}convertUndiscriminatedUnion({undiscriminatedUnion:e,value:t}){let n=this.findMatchingUndiscriminatedUnionType({undiscriminatedUnion:e,value:t});return n==null?m.TypeLiteral.nop():this.context.isPrimitive(n.valueTypeReference)?m.TypeLiteral.reference(m.invokeMethod({on:this.context.getJavaClassReferenceFromDeclaration({declaration:e.declaration}),method:"of",arguments_:[n.typeInstantiation]})):m.TypeLiteral.reference(m.invokeMethod({on:this.context.getJavaClassReferenceFromDeclaration({declaration:e.declaration}),method:"of",arguments_:[n.typeInstantiation]}))}findMatchingUndiscriminatedUnionType({undiscriminatedUnion:e,value:t}){var o;let n=[],a=[];for(let f of e.types)try{n.push(JSON.stringify(f));let p=this.convert({typeReference:f,value:t,inUndiscriminatedUnion:!0});return{valueTypeReference:f,typeInstantiation:p}}catch(p){a.push(`Type ${JSON.stringify(f)}: ${p instanceof Error?p.message:String(p)}`);continue}this.context.errors.add({severity:O.Critical,message:`None of the types in the undiscriminated union matched the given "${typeof t}" value. Tried ${n.length} variants. Errors: ${a.join("; ")}`});let i=(o=e.declaration.name)!=null?o:"UnknownUnion",s=a.map((f,p)=>` ${p+1}. ${f}`).join(`
22
+ `)}};l();c();l();c();var E={};Wt(E,{BRAND:()=>bo,DIRTY:()=>_e,EMPTY_PATH:()=>Xs,INVALID:()=>k,NEVER:()=>iu,OK:()=>M,ParseStatus:()=>P,Schema:()=>A,ZodAny:()=>he,ZodArray:()=>le,ZodBigInt:()=>ke,ZodBoolean:()=>Ne,ZodBranded:()=>ft,ZodCatch:()=>je,ZodDate:()=>Re,ZodDefault:()=>Fe,ZodDiscriminatedUnion:()=>St,ZodEffects:()=>Y,ZodEnum:()=>Oe,ZodError:()=>D,ZodFirstPartyTypeKind:()=>N,ZodFunction:()=>Lt,ZodIntersection:()=>Se,ZodIssueCode:()=>h,ZodLazy:()=>Ce,ZodLiteral:()=>Le,ZodMap:()=>Xe,ZodNaN:()=>et,ZodNativeEnum:()=>Ue,ZodNever:()=>G,ZodNull:()=>Ie,ZodNullable:()=>ee,ZodNumber:()=>Te,ZodObject:()=>$,ZodOptional:()=>Z,ZodParsedType:()=>w,ZodPipeline:()=>pt,ZodPromise:()=>ye,ZodReadonly:()=>Pe,ZodRecord:()=>Ct,ZodSchema:()=>A,ZodSet:()=>Qe,ZodString:()=>me,ZodSymbol:()=>He,ZodTransformer:()=>Y,ZodTuple:()=>Q,ZodType:()=>A,ZodUndefined:()=>Ae,ZodUnion:()=>Ee,ZodUnknown:()=>ue,ZodVoid:()=>Ke,addIssueToContext:()=>v,any:()=>So,array:()=>Uo,bigint:()=>No,boolean:()=>Jn,coerce:()=>au,custom:()=>Yn,date:()=>Ro,datetimeRegex:()=>Zn,defaultErrorMap:()=>se,discriminatedUnion:()=>Mo,effect:()=>Ho,enum:()=>qo,function:()=>Zo,getErrorMap:()=>qe,getParsedType:()=>X,instanceof:()=>To,intersection:()=>Bo,isAborted:()=>It,isAsync:()=>Ge,isDirty:()=>Et,isValid:()=>de,late:()=>_o,lazy:()=>zo,literal:()=>Yo,makeIssue:()=>ct,map:()=>Vo,nan:()=>ko,nativeEnum:()=>Go,never:()=>Lo,null:()=>Eo,nullable:()=>Xo,number:()=>Gn,object:()=>Fo,objectUtil:()=>er,oboolean:()=>nu,onumber:()=>ru,optional:()=>Ko,ostring:()=>tu,pipeline:()=>eu,preprocess:()=>Qo,promise:()=>Jo,quotelessJson:()=>Js,record:()=>$o,set:()=>Wo,setErrorMap:()=>Ks,strictObject:()=>jo,string:()=>qn,symbol:()=>Ao,transformer:()=>Ho,tuple:()=>Do,undefined:()=>Io,union:()=>Po,unknown:()=>Co,util:()=>I,void:()=>Oo});l();c();l();c();l();c();l();c();l();c();var I;(function(r){r.assertEqual=a=>{};function e(a){}r.assertIs=e;function t(a){throw new Error}r.assertNever=t,r.arrayToEnum=a=>{let i={};for(let s of a)i[s]=s;return i},r.getValidEnumValues=a=>{let i=r.objectKeys(a).filter(o=>typeof a[a[o]]!="number"),s={};for(let o of i)s[o]=a[o];return r.objectValues(s)},r.objectValues=a=>r.objectKeys(a).map(function(i){return a[i]}),r.objectKeys=typeof Object.keys=="function"?a=>Object.keys(a):a=>{let i=[];for(let s in a)Object.prototype.hasOwnProperty.call(a,s)&&i.push(s);return i},r.find=(a,i)=>{for(let s of a)if(i(s))return s},r.isInteger=typeof Number.isInteger=="function"?a=>Number.isInteger(a):a=>typeof a=="number"&&Number.isFinite(a)&&Math.floor(a)===a;function n(a,i=" | "){return a.map(s=>typeof s=="string"?`'${s}'`:s).join(i)}r.joinValues=n,r.jsonStringifyReplacer=(a,i)=>typeof i=="bigint"?i.toString():i})(I||(I={}));var er;(function(r){r.mergeShapes=(e,t)=>d(d({},e),t)})(er||(er={}));var w=I.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),X=r=>{switch(typeof r){case"undefined":return w.undefined;case"string":return w.string;case"number":return Number.isNaN(r)?w.nan:w.number;case"boolean":return w.boolean;case"function":return w.function;case"bigint":return w.bigint;case"symbol":return w.symbol;case"object":return Array.isArray(r)?w.array:r===null?w.null:r.then&&typeof r.then=="function"&&r.catch&&typeof r.catch=="function"?w.promise:typeof Map!="undefined"&&r instanceof Map?w.map:typeof Set!="undefined"&&r instanceof Set?w.set:typeof Date!="undefined"&&r instanceof Date?w.date:w.object;default:return w.unknown}};var h=I.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"]),Js=r=>JSON.stringify(r,null,2).replace(/"([^"]+)":/g,"$1:"),D=class r extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){let t=e||function(i){return i.message},n={_errors:[]},a=i=>{for(let s of i.issues)if(s.code==="invalid_union")s.unionErrors.map(a);else if(s.code==="invalid_return_type")a(s.returnTypeError);else if(s.code==="invalid_arguments")a(s.argumentsError);else if(s.path.length===0)n._errors.push(t(s));else{let o=n,f=0;for(;f<s.path.length;){let p=s.path[f];f===s.path.length-1?(o[p]=o[p]||{_errors:[]},o[p]._errors.push(t(s))):o[p]=o[p]||{_errors:[]},o=o[p],f++}}};return a(this),n}static assert(e){if(!(e instanceof r))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,I.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=t=>t.message){let t={},n=[];for(let a of this.issues)if(a.path.length>0){let i=a.path[0];t[i]=t[i]||[],t[i].push(e(a))}else n.push(e(a));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};D.create=r=>new D(r);var Hs=(r,e)=>{let t;switch(r.code){case h.invalid_type:r.received===w.undefined?t="Required":t=`Expected ${r.expected}, received ${r.received}`;break;case h.invalid_literal:t=`Invalid literal value, expected ${JSON.stringify(r.expected,I.jsonStringifyReplacer)}`;break;case h.unrecognized_keys:t=`Unrecognized key(s) in object: ${I.joinValues(r.keys,", ")}`;break;case h.invalid_union:t="Invalid input";break;case h.invalid_union_discriminator:t=`Invalid discriminator value. Expected ${I.joinValues(r.options)}`;break;case h.invalid_enum_value:t=`Invalid enum value. Expected ${I.joinValues(r.options)}, received '${r.received}'`;break;case h.invalid_arguments:t="Invalid function arguments";break;case h.invalid_return_type:t="Invalid function return type";break;case h.invalid_date:t="Invalid date";break;case h.invalid_string:typeof r.validation=="object"?"includes"in r.validation?(t=`Invalid input: must include "${r.validation.includes}"`,typeof r.validation.position=="number"&&(t=`${t} at one or more positions greater than or equal to ${r.validation.position}`)):"startsWith"in r.validation?t=`Invalid input: must start with "${r.validation.startsWith}"`:"endsWith"in r.validation?t=`Invalid input: must end with "${r.validation.endsWith}"`:I.assertNever(r.validation):r.validation!=="regex"?t=`Invalid ${r.validation}`:t="Invalid";break;case h.too_small:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at least":"more than"} ${r.minimum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at least":"over"} ${r.minimum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="bigint"?t=`Number must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${r.minimum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly equal to ":r.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(r.minimum))}`:t="Invalid input";break;case h.too_big:r.type==="array"?t=`Array must contain ${r.exact?"exactly":r.inclusive?"at most":"less than"} ${r.maximum} element(s)`:r.type==="string"?t=`String must contain ${r.exact?"exactly":r.inclusive?"at most":"under"} ${r.maximum} character(s)`:r.type==="number"?t=`Number must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="bigint"?t=`BigInt must be ${r.exact?"exactly":r.inclusive?"less than or equal to":"less than"} ${r.maximum}`:r.type==="date"?t=`Date must be ${r.exact?"exactly":r.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(r.maximum))}`:t="Invalid input";break;case h.custom:t="Invalid input";break;case h.invalid_intersection_types:t="Intersection results could not be merged";break;case h.not_multiple_of:t=`Number must be a multiple of ${r.multipleOf}`;break;case h.not_finite:t="Number must be finite";break;default:t=e.defaultError,I.assertNever(r)}return{message:t}},se=Hs;var Bn=se;function Ks(r){Bn=r}function qe(){return Bn}l();c();var ct=r=>{let{data:e,path:t,errorMaps:n,issueData:a}=r,i=[...t,...a.path||[]],s=T(d({},a),{path:i});if(a.message!==void 0)return T(d({},a),{path:i,message:a.message});let o="",f=n.filter(p=>!!p).slice().reverse();for(let p of f)o=p(s,{data:e,defaultError:o}).message;return T(d({},a),{path:i,message:o})},Xs=[];function v(r,e){let t=qe(),n=ct({issueData:e,data:r.data,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,t,t===se?void 0:se].filter(a=>!!a)});r.common.issues.push(n)}var P=class r{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,t){let n=[];for(let a of t){if(a.status==="aborted")return k;a.status==="dirty"&&e.dirty(),n.push(a.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){let n=[];for(let a of t){let i=await a.key,s=await a.value;n.push({key:i,value:s})}return r.mergeObjectSync(e,n)}static mergeObjectSync(e,t){let n={};for(let a of t){let{key:i,value:s}=a;if(i.status==="aborted"||s.status==="aborted")return k;i.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof s.value!="undefined"||a.alwaysSet)&&(n[i.value]=s.value)}return{status:e.value,value:n}}},k=Object.freeze({status:"aborted"}),_e=r=>({status:"dirty",value:r}),M=r=>({status:"valid",value:r}),It=r=>r.status==="aborted",Et=r=>r.status==="dirty",de=r=>r.status==="valid",Ge=r=>typeof Promise!="undefined"&&r instanceof Promise;l();c();l();c();var b;(function(r){r.errToObj=e=>typeof e=="string"?{message:e}:e||{},r.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(b||(b={}));var z=class{constructor(e,t,n,a){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=a}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Dn=(r,e)=>{if(de(e))return{success:!0,data:e.value};if(!r.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new D(r.common.issues);return this._error=t,this._error}}};function R(r){if(!r)return{};let{errorMap:e,invalid_type_error:t,required_error:n,description:a}=r;if(e&&(t||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:a}:{errorMap:(s,o)=>{var p,y;let{message:f}=r;return s.code==="invalid_enum_value"?{message:f!=null?f:o.defaultError}:typeof o.data=="undefined"?{message:(p=f!=null?f:n)!=null?p:o.defaultError}:s.code!=="invalid_type"?{message:o.defaultError}:{message:(y=f!=null?f:t)!=null?y:o.defaultError}},description:a}}var A=class{get description(){return this._def.description}_getType(e){return X(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:X(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new P,ctx:{common:e.parent.common,data:e.data,parsedType:X(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(Ge(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var i;let n={common:{issues:[],async:(i=t==null?void 0:t.async)!=null?i:!1,contextualErrorMap:t==null?void 0:t.errorMap},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:X(e)},a=this._parseSync({data:e,path:n.path,parent:n});return Dn(n,a)}"~validate"(e){var n,a;let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:X(e)};if(!this["~standard"].async)try{let i=this._parseSync({data:e,path:[],parent:t});return de(i)?{value:i.value}:{issues:t.common.issues}}catch(i){(a=(n=i==null?void 0:i.message)==null?void 0:n.toLowerCase())!=null&&a.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(i=>de(i)?{value:i.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t==null?void 0:t.errorMap,async:!0},path:(t==null?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:X(e)},a=this._parse({data:e,path:n.path,parent:n}),i=await(Ge(a)?a:Promise.resolve(a));return Dn(n,i)}refine(e,t){let n=a=>typeof t=="string"||typeof t=="undefined"?{message:t}:typeof t=="function"?t(a):t;return this._refinement((a,i)=>{let s=e(a),o=()=>i.addIssue(d({code:h.custom},n(a)));return typeof Promise!="undefined"&&s instanceof Promise?s.then(f=>f?!0:(o(),!1)):s?!0:(o(),!1)})}refinement(e,t){return this._refinement((n,a)=>e(n)?!0:(a.addIssue(typeof t=="function"?t(n,a):t),!1))}_refinement(e){return new Y({schema:this,typeName:N.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:t=>this["~validate"](t)}}optional(){return Z.create(this,this._def)}nullable(){return ee.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return le.create(this)}promise(){return ye.create(this,this._def)}or(e){return Ee.create([this,e],this._def)}and(e){return Se.create(this,e,this._def)}transform(e){return new Y(T(d({},R(this._def)),{schema:this,typeName:N.ZodEffects,effect:{type:"transform",transform:e}}))}default(e){let t=typeof e=="function"?e:()=>e;return new Fe(T(d({},R(this._def)),{innerType:this,defaultValue:t,typeName:N.ZodDefault}))}brand(){return new ft(d({typeName:N.ZodBranded,type:this},R(this._def)))}catch(e){let t=typeof e=="function"?e:()=>e;return new je(T(d({},R(this._def)),{innerType:this,catchValue:t,typeName:N.ZodCatch}))}describe(e){let t=this.constructor;return new t(T(d({},this._def),{description:e}))}pipe(e){return pt.create(this,e)}readonly(){return Pe.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Qs=/^c[^\s-]{8,}$/i,eo=/^[0-9a-z]+$/,to=/^[0-9A-HJKMNP-TV-Z]{26}$/i,ro=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,no=/^[a-z0-9_-]{21}$/i,ao=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,io=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,so=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,oo="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",tr,uo=/^(?:(?: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])$/,lo=/^(?:(?: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])$/,co=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,fo=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,po=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,mo=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Vn="((\\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])))",ho=new RegExp(`^${Vn}$`);function Wn(r){let e="[0-5]\\d";r.precision?e=`${e}\\.\\d{${r.precision}}`:r.precision==null&&(e=`${e}(\\.\\d+)?`);let t=r.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${t}`}function yo(r){return new RegExp(`^${Wn(r)}$`)}function Zn(r){let e=`${Vn}T${Wn(r)}`,t=[];return t.push(r.local?"Z?":"Z"),r.offset&&t.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${t.join("|")})`,new RegExp(`^${e}$`)}function go(r,e){return!!((e==="v4"||!e)&&uo.test(r)||(e==="v6"||!e)&&co.test(r))}function xo(r,e){if(!ao.test(r))return!1;try{let[t]=r.split(".");if(!t)return!1;let n=t.replace(/-/g,"+").replace(/_/g,"/").padEnd(t.length+(4-t.length%4)%4,"="),a=JSON.parse(atob(n));return!(typeof a!="object"||a===null||"typ"in a&&(a==null?void 0:a.typ)!=="JWT"||!a.alg||e&&a.alg!==e)}catch(t){return!1}}function vo(r,e){return!!((e==="v4"||!e)&&lo.test(r)||(e==="v6"||!e)&&fo.test(r))}var me=class r extends A{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==w.string){let i=this._getOrReturnCtx(e);return v(i,{code:h.invalid_type,expected:w.string,received:i.parsedType}),k}let n=new P,a;for(let i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(a=this._getOrReturnCtx(e,a),v(a,{code:h.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")e.data.length>i.value&&(a=this._getOrReturnCtx(e,a),v(a,{code:h.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){let s=e.data.length>i.value,o=e.data.length<i.value;(s||o)&&(a=this._getOrReturnCtx(e,a),s?v(a,{code:h.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):o&&v(a,{code:h.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")so.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"email",code:h.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")tr||(tr=new RegExp(oo,"u")),tr.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"emoji",code:h.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")ro.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"uuid",code:h.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")no.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"nanoid",code:h.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")Qs.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"cuid",code:h.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")eo.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"cuid2",code:h.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")to.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"ulid",code:h.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(e.data)}catch(s){a=this._getOrReturnCtx(e,a),v(a,{validation:"url",code:h.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"regex",code:h.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(a=this._getOrReturnCtx(e,a),v(a,{code:h.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(a=this._getOrReturnCtx(e,a),v(a,{code:h.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(a=this._getOrReturnCtx(e,a),v(a,{code:h.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?Zn(i).test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{code:h.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?ho.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{code:h.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?yo(i).test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{code:h.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?io.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"duration",code:h.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?go(e.data,i.version)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"ip",code:h.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?xo(e.data,i.alg)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"jwt",code:h.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?vo(e.data,i.version)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"cidr",code:h.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?po.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"base64",code:h.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?mo.test(e.data)||(a=this._getOrReturnCtx(e,a),v(a,{validation:"base64url",code:h.invalid_string,message:i.message}),n.dirty()):I.assertNever(i);return{status:n.value,value:e.data}}_regex(e,t,n){return this.refinement(a=>e.test(a),d({validation:t,code:h.invalid_string},b.errToObj(n)))}_addCheck(e){return new r(T(d({},this._def),{checks:[...this._def.checks,e]}))}email(e){return this._addCheck(d({kind:"email"},b.errToObj(e)))}url(e){return this._addCheck(d({kind:"url"},b.errToObj(e)))}emoji(e){return this._addCheck(d({kind:"emoji"},b.errToObj(e)))}uuid(e){return this._addCheck(d({kind:"uuid"},b.errToObj(e)))}nanoid(e){return this._addCheck(d({kind:"nanoid"},b.errToObj(e)))}cuid(e){return this._addCheck(d({kind:"cuid"},b.errToObj(e)))}cuid2(e){return this._addCheck(d({kind:"cuid2"},b.errToObj(e)))}ulid(e){return this._addCheck(d({kind:"ulid"},b.errToObj(e)))}base64(e){return this._addCheck(d({kind:"base64"},b.errToObj(e)))}base64url(e){return this._addCheck(d({kind:"base64url"},b.errToObj(e)))}jwt(e){return this._addCheck(d({kind:"jwt"},b.errToObj(e)))}ip(e){return this._addCheck(d({kind:"ip"},b.errToObj(e)))}cidr(e){return this._addCheck(d({kind:"cidr"},b.errToObj(e)))}datetime(e){var t,n;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck(d({kind:"datetime",precision:typeof(e==null?void 0:e.precision)=="undefined"?null:e==null?void 0:e.precision,offset:(t=e==null?void 0:e.offset)!=null?t:!1,local:(n=e==null?void 0:e.local)!=null?n:!1},b.errToObj(e==null?void 0:e.message)))}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck(d({kind:"time",precision:typeof(e==null?void 0:e.precision)=="undefined"?null:e==null?void 0:e.precision},b.errToObj(e==null?void 0:e.message)))}duration(e){return this._addCheck(d({kind:"duration"},b.errToObj(e)))}regex(e,t){return this._addCheck(d({kind:"regex",regex:e},b.errToObj(t)))}includes(e,t){return this._addCheck(d({kind:"includes",value:e,position:t==null?void 0:t.position},b.errToObj(t==null?void 0:t.message)))}startsWith(e,t){return this._addCheck(d({kind:"startsWith",value:e},b.errToObj(t)))}endsWith(e,t){return this._addCheck(d({kind:"endsWith",value:e},b.errToObj(t)))}min(e,t){return this._addCheck(d({kind:"min",value:e},b.errToObj(t)))}max(e,t){return this._addCheck(d({kind:"max",value:e},b.errToObj(t)))}length(e,t){return this._addCheck(d({kind:"length",value:e},b.errToObj(t)))}nonempty(e){return this.min(1,b.errToObj(e))}trim(){return new r(T(d({},this._def),{checks:[...this._def.checks,{kind:"trim"}]}))}toLowerCase(){return new r(T(d({},this._def),{checks:[...this._def.checks,{kind:"toLowerCase"}]}))}toUpperCase(){return new r(T(d({},this._def),{checks:[...this._def.checks,{kind:"toUpperCase"}]}))}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};me.create=r=>{var e;return new me(d({checks:[],typeName:N.ZodString,coerce:(e=r==null?void 0:r.coerce)!=null?e:!1},R(r)))};function wo(r,e){let t=(r.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,a=t>n?t:n,i=Number.parseInt(r.toFixed(a).replace(".","")),s=Number.parseInt(e.toFixed(a).replace(".",""));return i%s/10**a}var Te=class r extends A{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==w.number){let i=this._getOrReturnCtx(e);return v(i,{code:h.invalid_type,expected:w.number,received:i.parsedType}),k}let n,a=new P;for(let i of this._def.checks)i.kind==="int"?I.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),v(n,{code:h.invalid_type,expected:"integer",received:"float",message:i.message}),a.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),v(n,{code:h.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),v(n,{code:h.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),a.dirty()):i.kind==="multipleOf"?wo(e.data,i.value)!==0&&(n=this._getOrReturnCtx(e,n),v(n,{code:h.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),v(n,{code:h.not_finite,message:i.message}),a.dirty()):I.assertNever(i);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,b.toString(t))}gt(e,t){return this.setLimit("min",e,!1,b.toString(t))}lte(e,t){return this.setLimit("max",e,!0,b.toString(t))}lt(e,t){return this.setLimit("max",e,!1,b.toString(t))}setLimit(e,t,n,a){return new r(T(d({},this._def),{checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:b.toString(a)}]}))}_addCheck(e){return new r(T(d({},this._def),{checks:[...this._def.checks,e]}))}int(e){return this._addCheck({kind:"int",message:b.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:b.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:b.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:b.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:b.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:b.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:b.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:b.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:b.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&I.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(t===null||n.value>t)&&(t=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}};Te.create=r=>new Te(d({checks:[],typeName:N.ZodNumber,coerce:(r==null?void 0:r.coerce)||!1},R(r)));var ke=class r extends A{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch(i){return this._getInvalidInput(e)}if(this._getType(e)!==w.bigint)return this._getInvalidInput(e);let n,a=new P;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),v(n,{code:h.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),v(n,{code:h.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),a.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),v(n,{code:h.not_multiple_of,multipleOf:i.value,message:i.message}),a.dirty()):I.assertNever(i);return{status:a.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return v(t,{code:h.invalid_type,expected:w.bigint,received:t.parsedType}),k}gte(e,t){return this.setLimit("min",e,!0,b.toString(t))}gt(e,t){return this.setLimit("min",e,!1,b.toString(t))}lte(e,t){return this.setLimit("max",e,!0,b.toString(t))}lt(e,t){return this.setLimit("max",e,!1,b.toString(t))}setLimit(e,t,n,a){return new r(T(d({},this._def),{checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:b.toString(a)}]}))}_addCheck(e){return new r(T(d({},this._def),{checks:[...this._def.checks,e]}))}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:b.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:b.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:b.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:b.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:b.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e}};ke.create=r=>{var e;return new ke(d({checks:[],typeName:N.ZodBigInt,coerce:(e=r==null?void 0:r.coerce)!=null?e:!1},R(r)))};var Ne=class extends A{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==w.boolean){let n=this._getOrReturnCtx(e);return v(n,{code:h.invalid_type,expected:w.boolean,received:n.parsedType}),k}return M(e.data)}};Ne.create=r=>new Ne(d({typeName:N.ZodBoolean,coerce:(r==null?void 0:r.coerce)||!1},R(r)));var Re=class r extends A{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==w.date){let i=this._getOrReturnCtx(e);return v(i,{code:h.invalid_type,expected:w.date,received:i.parsedType}),k}if(Number.isNaN(e.data.getTime())){let i=this._getOrReturnCtx(e);return v(i,{code:h.invalid_date}),k}let n=new P,a;for(let i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(a=this._getOrReturnCtx(e,a),v(a,{code:h.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(a=this._getOrReturnCtx(e,a),v(a,{code:h.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):I.assertNever(i);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new r(T(d({},this._def),{checks:[...this._def.checks,e]}))}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:b.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:b.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind==="min"&&(e===null||t.value>e)&&(e=t.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)t.kind==="max"&&(e===null||t.value<e)&&(e=t.value);return e!=null?new Date(e):null}};Re.create=r=>new Re(d({checks:[],coerce:(r==null?void 0:r.coerce)||!1,typeName:N.ZodDate},R(r)));var He=class extends A{_parse(e){if(this._getType(e)!==w.symbol){let n=this._getOrReturnCtx(e);return v(n,{code:h.invalid_type,expected:w.symbol,received:n.parsedType}),k}return M(e.data)}};He.create=r=>new He(d({typeName:N.ZodSymbol},R(r)));var Ae=class extends A{_parse(e){if(this._getType(e)!==w.undefined){let n=this._getOrReturnCtx(e);return v(n,{code:h.invalid_type,expected:w.undefined,received:n.parsedType}),k}return M(e.data)}};Ae.create=r=>new Ae(d({typeName:N.ZodUndefined},R(r)));var Ie=class extends A{_parse(e){if(this._getType(e)!==w.null){let n=this._getOrReturnCtx(e);return v(n,{code:h.invalid_type,expected:w.null,received:n.parsedType}),k}return M(e.data)}};Ie.create=r=>new Ie(d({typeName:N.ZodNull},R(r)));var he=class extends A{constructor(){super(...arguments),this._any=!0}_parse(e){return M(e.data)}};he.create=r=>new he(d({typeName:N.ZodAny},R(r)));var ue=class extends A{constructor(){super(...arguments),this._unknown=!0}_parse(e){return M(e.data)}};ue.create=r=>new ue(d({typeName:N.ZodUnknown},R(r)));var G=class extends A{_parse(e){let t=this._getOrReturnCtx(e);return v(t,{code:h.invalid_type,expected:w.never,received:t.parsedType}),k}};G.create=r=>new G(d({typeName:N.ZodNever},R(r)));var Ke=class extends A{_parse(e){if(this._getType(e)!==w.undefined){let n=this._getOrReturnCtx(e);return v(n,{code:h.invalid_type,expected:w.void,received:n.parsedType}),k}return M(e.data)}};Ke.create=r=>new Ke(d({typeName:N.ZodVoid},R(r)));var le=class r extends A{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),a=this._def;if(t.parsedType!==w.array)return v(t,{code:h.invalid_type,expected:w.array,received:t.parsedType}),k;if(a.exactLength!==null){let s=t.data.length>a.exactLength.value,o=t.data.length<a.exactLength.value;(s||o)&&(v(t,{code:s?h.too_big:h.too_small,minimum:o?a.exactLength.value:void 0,maximum:s?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),n.dirty())}if(a.minLength!==null&&t.data.length<a.minLength.value&&(v(t,{code:h.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),n.dirty()),a.maxLength!==null&&t.data.length>a.maxLength.value&&(v(t,{code:h.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((s,o)=>a.type._parseAsync(new z(t,s,t.path,o)))).then(s=>P.mergeArray(n,s));let i=[...t.data].map((s,o)=>a.type._parseSync(new z(t,s,t.path,o)));return P.mergeArray(n,i)}get element(){return this._def.type}min(e,t){return new r(T(d({},this._def),{minLength:{value:e,message:b.toString(t)}}))}max(e,t){return new r(T(d({},this._def),{maxLength:{value:e,message:b.toString(t)}}))}length(e,t){return new r(T(d({},this._def),{exactLength:{value:e,message:b.toString(t)}}))}nonempty(e){return this.min(1,e)}};le.create=(r,e)=>new le(d({type:r,minLength:null,maxLength:null,exactLength:null,typeName:N.ZodArray},R(e)));function Je(r){if(r instanceof $){let e={};for(let t in r.shape){let n=r.shape[t];e[t]=Z.create(Je(n))}return new $(T(d({},r._def),{shape:()=>e}))}else return r instanceof le?new le(T(d({},r._def),{type:Je(r.element)})):r instanceof Z?Z.create(Je(r.unwrap())):r instanceof ee?ee.create(Je(r.unwrap())):r instanceof Q?Q.create(r.items.map(e=>Je(e))):r}var $=class r extends A{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=I.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==w.object){let p=this._getOrReturnCtx(e);return v(p,{code:h.invalid_type,expected:w.object,received:p.parsedType}),k}let{status:n,ctx:a}=this._processInputParams(e),{shape:i,keys:s}=this._getCached(),o=[];if(!(this._def.catchall instanceof G&&this._def.unknownKeys==="strip"))for(let p in a.data)s.includes(p)||o.push(p);let f=[];for(let p of s){let y=i[p],_=a.data[p];f.push({key:{status:"valid",value:p},value:y._parse(new z(a,_,a.path,p)),alwaysSet:p in a.data})}if(this._def.catchall instanceof G){let p=this._def.unknownKeys;if(p==="passthrough")for(let y of o)f.push({key:{status:"valid",value:y},value:{status:"valid",value:a.data[y]}});else if(p==="strict")o.length>0&&(v(a,{code:h.unrecognized_keys,keys:o}),n.dirty());else if(p!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let p=this._def.catchall;for(let y of o){let _=a.data[y];f.push({key:{status:"valid",value:y},value:p._parse(new z(a,_,a.path,y)),alwaysSet:y in a.data})}}return a.common.async?Promise.resolve().then(async()=>{let p=[];for(let y of f){let _=await y.key,S=await y.value;p.push({key:_,value:S,alwaysSet:y.alwaysSet})}return p}).then(p=>P.mergeObjectSync(n,p)):P.mergeObjectSync(n,f)}get shape(){return this._def.shape()}strict(e){return b.errToObj,new r(d(T(d({},this._def),{unknownKeys:"strict"}),e!==void 0?{errorMap:(t,n)=>{var i,s,o,f;let a=(o=(s=(i=this._def).errorMap)==null?void 0:s.call(i,t,n).message)!=null?o:n.defaultError;return t.code==="unrecognized_keys"?{message:(f=b.errToObj(e).message)!=null?f:a}:{message:a}}}:{}))}strip(){return new r(T(d({},this._def),{unknownKeys:"strip"}))}passthrough(){return new r(T(d({},this._def),{unknownKeys:"passthrough"}))}extend(e){return new r(T(d({},this._def),{shape:()=>d(d({},this._def.shape()),e)}))}merge(e){return new r({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>d(d({},this._def.shape()),e._def.shape()),typeName:N.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new r(T(d({},this._def),{catchall:e}))}pick(e){let t={};for(let n of I.objectKeys(e))e[n]&&this.shape[n]&&(t[n]=this.shape[n]);return new r(T(d({},this._def),{shape:()=>t}))}omit(e){let t={};for(let n of I.objectKeys(this.shape))e[n]||(t[n]=this.shape[n]);return new r(T(d({},this._def),{shape:()=>t}))}deepPartial(){return Je(this)}partial(e){let t={};for(let n of I.objectKeys(this.shape)){let a=this.shape[n];e&&!e[n]?t[n]=a:t[n]=a.optional()}return new r(T(d({},this._def),{shape:()=>t}))}required(e){let t={};for(let n of I.objectKeys(this.shape))if(e&&!e[n])t[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof Z;)i=i._def.innerType;t[n]=i}return new r(T(d({},this._def),{shape:()=>t}))}keyof(){return zn(I.objectKeys(this.shape))}};$.create=(r,e)=>new $(d({shape:()=>r,unknownKeys:"strip",catchall:G.create(),typeName:N.ZodObject},R(e)));$.strictCreate=(r,e)=>new $(d({shape:()=>r,unknownKeys:"strict",catchall:G.create(),typeName:N.ZodObject},R(e)));$.lazycreate=(r,e)=>new $(d({shape:r,unknownKeys:"strip",catchall:G.create(),typeName:N.ZodObject},R(e)));var Ee=class extends A{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function a(i){for(let o of i)if(o.result.status==="valid")return o.result;for(let o of i)if(o.result.status==="dirty")return t.common.issues.push(...o.ctx.common.issues),o.result;let s=i.map(o=>new D(o.ctx.common.issues));return v(t,{code:h.invalid_union,unionErrors:s}),k}if(t.common.async)return Promise.all(n.map(async i=>{let s=T(d({},t),{common:T(d({},t.common),{issues:[]}),parent:null});return{result:await i._parseAsync({data:t.data,path:t.path,parent:s}),ctx:s}})).then(a);{let i,s=[];for(let f of n){let p=T(d({},t),{common:T(d({},t.common),{issues:[]}),parent:null}),y=f._parseSync({data:t.data,path:t.path,parent:p});if(y.status==="valid")return y;y.status==="dirty"&&!i&&(i={result:y,ctx:p}),p.common.issues.length&&s.push(p.common.issues)}if(i)return t.common.issues.push(...i.ctx.common.issues),i.result;let o=s.map(f=>new D(f));return v(t,{code:h.invalid_union,unionErrors:o}),k}}get options(){return this._def.options}};Ee.create=(r,e)=>new Ee(d({options:r,typeName:N.ZodUnion},R(e)));var oe=r=>r instanceof Ce?oe(r.schema):r instanceof Y?oe(r.innerType()):r instanceof Le?[r.value]:r instanceof Oe?r.options:r instanceof Ue?I.objectValues(r.enum):r instanceof Fe?oe(r._def.innerType):r instanceof Ae?[void 0]:r instanceof Ie?[null]:r instanceof Z?[void 0,...oe(r.unwrap())]:r instanceof ee?[null,...oe(r.unwrap())]:r instanceof ft||r instanceof Pe?oe(r.unwrap()):r instanceof je?oe(r._def.innerType):[],St=class r extends A{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==w.object)return v(t,{code:h.invalid_type,expected:w.object,received:t.parsedType}),k;let n=this.discriminator,a=t.data[n],i=this.optionsMap.get(a);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(v(t,{code:h.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),k)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){let a=new Map;for(let i of t){let s=oe(i.shape[e]);if(!s.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let o of s){if(a.has(o))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(o)}`);a.set(o,i)}}return new r(d({typeName:N.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:a},R(n)))}};function rr(r,e){let t=X(r),n=X(e);if(r===e)return{valid:!0,data:r};if(t===w.object&&n===w.object){let a=I.objectKeys(e),i=I.objectKeys(r).filter(o=>a.indexOf(o)!==-1),s=d(d({},r),e);for(let o of i){let f=rr(r[o],e[o]);if(!f.valid)return{valid:!1};s[o]=f.data}return{valid:!0,data:s}}else if(t===w.array&&n===w.array){if(r.length!==e.length)return{valid:!1};let a=[];for(let i=0;i<r.length;i++){let s=r[i],o=e[i],f=rr(s,o);if(!f.valid)return{valid:!1};a.push(f.data)}return{valid:!0,data:a}}else return t===w.date&&n===w.date&&+r==+e?{valid:!0,data:r}:{valid:!1}}var Se=class extends A{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),a=(i,s)=>{if(It(i)||It(s))return k;let o=rr(i.value,s.value);return o.valid?((Et(i)||Et(s))&&t.dirty(),{status:t.value,value:o.data}):(v(n,{code:h.invalid_intersection_types}),k)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,s])=>a(i,s)):a(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};Se.create=(r,e,t)=>new Se(d({left:r,right:e,typeName:N.ZodIntersection},R(t)));var Q=class r extends A{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==w.array)return v(n,{code:h.invalid_type,expected:w.array,received:n.parsedType}),k;if(n.data.length<this._def.items.length)return v(n,{code:h.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),k;!this._def.rest&&n.data.length>this._def.items.length&&(v(n,{code:h.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let i=[...n.data].map((s,o)=>{let f=this._def.items[o]||this._def.rest;return f?f._parse(new z(n,s,n.path,o)):null}).filter(s=>!!s);return n.common.async?Promise.all(i).then(s=>P.mergeArray(t,s)):P.mergeArray(t,i)}get items(){return this._def.items}rest(e){return new r(T(d({},this._def),{rest:e}))}};Q.create=(r,e)=>{if(!Array.isArray(r))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Q(d({items:r,typeName:N.ZodTuple,rest:null},R(e)))};var Ct=class r extends A{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==w.object)return v(n,{code:h.invalid_type,expected:w.object,received:n.parsedType}),k;let a=[],i=this._def.keyType,s=this._def.valueType;for(let o in n.data)a.push({key:i._parse(new z(n,o,n.path,o)),value:s._parse(new z(n,n.data[o],n.path,o)),alwaysSet:o in n.data});return n.common.async?P.mergeObjectAsync(t,a):P.mergeObjectSync(t,a)}get element(){return this._def.valueType}static create(e,t,n){return t instanceof A?new r(d({keyType:e,valueType:t,typeName:N.ZodRecord},R(n))):new r(d({keyType:me.create(),valueType:e,typeName:N.ZodRecord},R(t)))}},Xe=class extends A{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==w.map)return v(n,{code:h.invalid_type,expected:w.map,received:n.parsedType}),k;let a=this._def.keyType,i=this._def.valueType,s=[...n.data.entries()].map(([o,f],p)=>({key:a._parse(new z(n,o,n.path,[p,"key"])),value:i._parse(new z(n,f,n.path,[p,"value"]))}));if(n.common.async){let o=new Map;return Promise.resolve().then(async()=>{for(let f of s){let p=await f.key,y=await f.value;if(p.status==="aborted"||y.status==="aborted")return k;(p.status==="dirty"||y.status==="dirty")&&t.dirty(),o.set(p.value,y.value)}return{status:t.value,value:o}})}else{let o=new Map;for(let f of s){let p=f.key,y=f.value;if(p.status==="aborted"||y.status==="aborted")return k;(p.status==="dirty"||y.status==="dirty")&&t.dirty(),o.set(p.value,y.value)}return{status:t.value,value:o}}}};Xe.create=(r,e,t)=>new Xe(d({valueType:e,keyType:r,typeName:N.ZodMap},R(t)));var Qe=class r extends A{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==w.set)return v(n,{code:h.invalid_type,expected:w.set,received:n.parsedType}),k;let a=this._def;a.minSize!==null&&n.data.size<a.minSize.value&&(v(n,{code:h.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),t.dirty()),a.maxSize!==null&&n.data.size>a.maxSize.value&&(v(n,{code:h.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),t.dirty());let i=this._def.valueType;function s(f){let p=new Set;for(let y of f){if(y.status==="aborted")return k;y.status==="dirty"&&t.dirty(),p.add(y.value)}return{status:t.value,value:p}}let o=[...n.data.values()].map((f,p)=>i._parse(new z(n,f,n.path,p)));return n.common.async?Promise.all(o).then(f=>s(f)):s(o)}min(e,t){return new r(T(d({},this._def),{minSize:{value:e,message:b.toString(t)}}))}max(e,t){return new r(T(d({},this._def),{maxSize:{value:e,message:b.toString(t)}}))}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};Qe.create=(r,e)=>new Qe(d({valueType:r,minSize:null,maxSize:null,typeName:N.ZodSet},R(e)));var Lt=class r extends A{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==w.function)return v(t,{code:h.invalid_type,expected:w.function,received:t.parsedType}),k;function n(o,f){return ct({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,qe(),se].filter(p=>!!p),issueData:{code:h.invalid_arguments,argumentsError:f}})}function a(o,f){return ct({data:o,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,qe(),se].filter(p=>!!p),issueData:{code:h.invalid_return_type,returnTypeError:f}})}let i={errorMap:t.common.contextualErrorMap},s=t.data;if(this._def.returns instanceof ye){let o=this;return M(async function(...f){let p=new D([]),y=await o._def.args.parseAsync(f,i).catch(U=>{throw p.addIssue(n(f,U)),p}),_=await Reflect.apply(s,this,y);return await o._def.returns._def.type.parseAsync(_,i).catch(U=>{throw p.addIssue(a(_,U)),p})})}else{let o=this;return M(function(...f){let p=o._def.args.safeParse(f,i);if(!p.success)throw new D([n(f,p.error)]);let y=Reflect.apply(s,this,p.data),_=o._def.returns.safeParse(y,i);if(!_.success)throw new D([a(y,_.error)]);return _.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new r(T(d({},this._def),{args:Q.create(e).rest(ue.create())}))}returns(e){return new r(T(d({},this._def),{returns:e}))}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new r(d({args:e||Q.create([]).rest(ue.create()),returns:t||ue.create(),typeName:N.ZodFunction},R(n)))}},Ce=class extends A{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};Ce.create=(r,e)=>new Ce(d({getter:r,typeName:N.ZodLazy},R(e)));var Le=class extends A{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return v(t,{received:t.data,code:h.invalid_literal,expected:this._def.value}),k}return{status:"valid",value:e.data}}get value(){return this._def.value}};Le.create=(r,e)=>new Le(d({value:r,typeName:N.ZodLiteral},R(e)));function zn(r,e){return new Oe(d({values:r,typeName:N.ZodEnum},R(e)))}var Oe=class r extends A{_parse(e){if(typeof e.data!="string"){let t=this._getOrReturnCtx(e),n=this._def.values;return v(t,{expected:I.joinValues(n),received:t.parsedType,code:h.invalid_type}),k}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return v(t,{received:t.data,code:h.invalid_enum_value,options:n}),k}return M(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return r.create(e,d(d({},this._def),t))}exclude(e,t=this._def){return r.create(this.options.filter(n=>!e.includes(n)),d(d({},this._def),t))}};Oe.create=zn;var Ue=class extends A{_parse(e){let t=I.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==w.string&&n.parsedType!==w.number){let a=I.objectValues(t);return v(n,{expected:I.joinValues(a),received:n.parsedType,code:h.invalid_type}),k}if(this._cache||(this._cache=new Set(I.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let a=I.objectValues(t);return v(n,{received:n.data,code:h.invalid_enum_value,options:a}),k}return M(e.data)}get enum(){return this._def.values}};Ue.create=(r,e)=>new Ue(d({values:r,typeName:N.ZodNativeEnum},R(e)));var ye=class extends A{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==w.promise&&t.common.async===!1)return v(t,{code:h.invalid_type,expected:w.promise,received:t.parsedType}),k;let n=t.parsedType===w.promise?t.data:Promise.resolve(t.data);return M(n.then(a=>this._def.type.parseAsync(a,{path:t.path,errorMap:t.common.contextualErrorMap})))}};ye.create=(r,e)=>new ye(d({type:r,typeName:N.ZodPromise},R(e)));var Y=class extends A{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===N.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),a=this._def.effect||null,i={addIssue:s=>{v(n,s),s.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),a.type==="preprocess"){let s=a.transform(n.data,i);if(n.common.async)return Promise.resolve(s).then(async o=>{if(t.value==="aborted")return k;let f=await this._def.schema._parseAsync({data:o,path:n.path,parent:n});return f.status==="aborted"?k:f.status==="dirty"?_e(f.value):t.value==="dirty"?_e(f.value):f});{if(t.value==="aborted")return k;let o=this._def.schema._parseSync({data:s,path:n.path,parent:n});return o.status==="aborted"?k:o.status==="dirty"?_e(o.value):t.value==="dirty"?_e(o.value):o}}if(a.type==="refinement"){let s=o=>{let f=a.refinement(o,i);if(n.common.async)return Promise.resolve(f);if(f instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(n.common.async===!1){let o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?k:(o.status==="dirty"&&t.dirty(),s(o.value),{status:t.value,value:o.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>o.status==="aborted"?k:(o.status==="dirty"&&t.dirty(),s(o.value).then(()=>({status:t.value,value:o.value}))))}if(a.type==="transform")if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!de(s))return k;let o=a.transform(s.value,i);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:o}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>de(s)?Promise.resolve(a.transform(s.value,i)).then(o=>({status:t.value,value:o})):k);I.assertNever(a)}};Y.create=(r,e,t)=>new Y(d({schema:r,typeName:N.ZodEffects,effect:e},R(t)));Y.createWithPreprocess=(r,e,t)=>new Y(d({schema:e,effect:{type:"preprocess",transform:r},typeName:N.ZodEffects},R(t)));var Z=class extends A{_parse(e){return this._getType(e)===w.undefined?M(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Z.create=(r,e)=>new Z(d({innerType:r,typeName:N.ZodOptional},R(e)));var ee=class extends A{_parse(e){return this._getType(e)===w.null?M(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};ee.create=(r,e)=>new ee(d({innerType:r,typeName:N.ZodNullable},R(e)));var Fe=class extends A{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===w.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};Fe.create=(r,e)=>new Fe(d({innerType:r,typeName:N.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default},R(e)));var je=class extends A{_parse(e){let{ctx:t}=this._processInputParams(e),n=T(d({},t),{common:T(d({},t.common),{issues:[]})}),a=this._def.innerType._parse({data:n.data,path:n.path,parent:d({},n)});return Ge(a)?a.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new D(n.common.issues)},input:n.data})})):{status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new D(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};je.create=(r,e)=>new je(d({innerType:r,typeName:N.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch},R(e)));var et=class extends A{_parse(e){if(this._getType(e)!==w.nan){let n=this._getOrReturnCtx(e);return v(n,{code:h.invalid_type,expected:w.nan,received:n.parsedType}),k}return{status:"valid",value:e.data}}};et.create=r=>new et(d({typeName:N.ZodNaN},R(r)));var bo=Symbol("zod_brand"),ft=class extends A{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},pt=class r extends A{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?k:i.status==="dirty"?(t.dirty(),_e(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{let a=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?k:a.status==="dirty"?(t.dirty(),{status:"dirty",value:a.value}):this._def.out._parseSync({data:a.value,path:n.path,parent:n})}}static create(e,t){return new r({in:e,out:t,typeName:N.ZodPipeline})}},Pe=class extends A{_parse(e){let t=this._def.innerType._parse(e),n=a=>(de(a)&&(a.value=Object.freeze(a.value)),a);return Ge(t)?t.then(a=>n(a)):n(t)}unwrap(){return this._def.innerType}};Pe.create=(r,e)=>new Pe(d({innerType:r,typeName:N.ZodReadonly},R(e)));function $n(r,e){let t=typeof r=="function"?r(e):typeof r=="string"?{message:r}:r;return typeof t=="string"?{message:t}:t}function Yn(r,e={},t){return r?he.create().superRefine((n,a)=>{var s,o;let i=r(n);if(i instanceof Promise)return i.then(f=>{var p,y;if(!f){let _=$n(e,n),S=(y=(p=_.fatal)!=null?p:t)!=null?y:!0;a.addIssue(T(d({code:"custom"},_),{fatal:S}))}});if(!i){let f=$n(e,n),p=(o=(s=f.fatal)!=null?s:t)!=null?o:!0;a.addIssue(T(d({code:"custom"},f),{fatal:p}))}}):he.create()}var _o={object:$.lazycreate},N;(function(r){r.ZodString="ZodString",r.ZodNumber="ZodNumber",r.ZodNaN="ZodNaN",r.ZodBigInt="ZodBigInt",r.ZodBoolean="ZodBoolean",r.ZodDate="ZodDate",r.ZodSymbol="ZodSymbol",r.ZodUndefined="ZodUndefined",r.ZodNull="ZodNull",r.ZodAny="ZodAny",r.ZodUnknown="ZodUnknown",r.ZodNever="ZodNever",r.ZodVoid="ZodVoid",r.ZodArray="ZodArray",r.ZodObject="ZodObject",r.ZodUnion="ZodUnion",r.ZodDiscriminatedUnion="ZodDiscriminatedUnion",r.ZodIntersection="ZodIntersection",r.ZodTuple="ZodTuple",r.ZodRecord="ZodRecord",r.ZodMap="ZodMap",r.ZodSet="ZodSet",r.ZodFunction="ZodFunction",r.ZodLazy="ZodLazy",r.ZodLiteral="ZodLiteral",r.ZodEnum="ZodEnum",r.ZodEffects="ZodEffects",r.ZodNativeEnum="ZodNativeEnum",r.ZodOptional="ZodOptional",r.ZodNullable="ZodNullable",r.ZodDefault="ZodDefault",r.ZodCatch="ZodCatch",r.ZodPromise="ZodPromise",r.ZodBranded="ZodBranded",r.ZodPipeline="ZodPipeline",r.ZodReadonly="ZodReadonly"})(N||(N={}));var To=(r,e={message:`Input not instance of ${r.name}`})=>Yn(t=>t instanceof r,e),qn=me.create,Gn=Te.create,ko=et.create,No=ke.create,Jn=Ne.create,Ro=Re.create,Ao=He.create,Io=Ae.create,Eo=Ie.create,So=he.create,Co=ue.create,Lo=G.create,Oo=Ke.create,Uo=le.create,Fo=$.create,jo=$.strictCreate,Po=Ee.create,Mo=St.create,Bo=Se.create,Do=Q.create,$o=Ct.create,Vo=Xe.create,Wo=Qe.create,Zo=Lt.create,zo=Ce.create,Yo=Le.create,qo=Oe.create,Go=Ue.create,Jo=ye.create,Ho=Y.create,Ko=Z.create,Xo=ee.create,Qo=Y.createWithPreprocess,eu=pt.create,tu=()=>qn().optional(),ru=()=>Gn().optional(),nu=()=>Jn().optional(),au={string:(r=>me.create(T(d({},r),{coerce:!0}))),number:(r=>Te.create(T(d({},r),{coerce:!0}))),boolean:(r=>Ne.create(T(d({},r),{coerce:!0}))),bigint:(r=>ke.create(T(d({},r),{coerce:!0}))),date:(r=>Re.create(T(d({},r),{coerce:!0})))};var iu=k;l();c();var Hn=E.strictObject({title:E.string(),content:E.string()});var nr=E.object({"base-api-exception-class-name":E.string().optional(),"base-exception-class-name":E.string().optional(),"client-class-name":E.string().optional(),"inline-file-properties":E.boolean().optional(),"inline-path-parameters":E.boolean().optional(),"package-layout":E.enum(["flat","nested"]).optional(),"package-prefix":E.string().optional(),"use-local-date-for-dates":E.boolean().optional(),"custom-dependencies":E.array(E.string()).optional(),"disable-required-property-builder-checks":E.boolean().optional(),"enable-forward-compatible-enums":E.boolean().optional(),"enable-inline-types":E.boolean().optional(),"enable-public-constructors":E.boolean().optional(),"generate-unknown-as-json-node":E.boolean().optional(),"json-include":E.enum(["non-absent","non-empty"]).optional(),"enable-extensible-builders":E.boolean().optional(),"use-default-request-parameter-values":E.boolean().optional(),"enable-wire-tests":E.boolean().default(!1),"collapse-optional-nullable":E.boolean().optional(),"custom-readme-sections":E.array(Hn).optional(),"custom-pager-name":E.string().optional(),"oauth-token-override":E.boolean().optional(),"wrapped-aliases":E.boolean().optional()});var m={};Wt(m,{Access:()=>ar,AstNode:()=>F,Class:()=>Me,ClassInstantiation:()=>Be,ClassReference:()=>L,CodeBlock:()=>De,Method:()=>$e,MethodInvocation:()=>Ve,Parameter:()=>We,Type:()=>dt,TypeLiteral:()=>V,Writer:()=>be,classReference:()=>Ru,class_:()=>Nu,codeblock:()=>ku,instantiateClass:()=>Au,invokeMethod:()=>Iu,method:()=>Eu,parameter:()=>Su});l();c();l();c();l();c();var ar={Public:"public",Protected:"protected",Private:"private"};l();c();l();c();var F=class extends we{async toStringAsync({packageName:e,customConfig:t,formatter:n}){let a=new lt({packageName:e,customConfig:t,formatter:n});return this.write(a),a.toStringAsync()}toString({packageName:e,customConfig:t,formatter:n}){let a=new lt({packageName:e,customConfig:t,formatter:n});return this.write(a),a.toString()}};var Me=class extends F{constructor({name:t,access:n}){super();x(this,"name");x(this,"access");x(this,"methods",[]);this.name=t,this.access=n}write(t){if(t.write(`${this.access} class ${this.name}`),this.isEmpty()){t.writeLine(" {}");return}t.writeLine(" {"),t.indent();for(let n of this.methods)t.writeNode(n),t.newLine();t.dedent(),t.write("}")}addMethod(t){this.methods.push(t)}isEmpty(){return this.methods.length===0}};l();c();l();c();l();c();l();c();var L=class extends F{constructor({name:t,packageName:n,fullyQualified:a}){super();x(this,"name");x(this,"packageName");x(this,"fullyQualified");this.name=t,this.packageName=n,this.fullyQualified=a!=null?a:!1}write(t){if(t.addImport(`${this.packageName}.${this.name}`),this.fullyQualified){t.write(`${this.packageName}.${this.name}`);return}t.write(this.name)}};l();c();var dt=class extends F{constructor(t){super();x(this,"internalType");this.internalType=t}write(t){switch(this.internalType.type){case"array":t.writeNode(this.internalType.value),t.write("[]");break;case"bigInteger":t.writeNode(su);break;case"boolean":t.write("Boolean");break;case"bytes":t.write("byte[]");break;case"date":t.write("String");break;case"dateTime":t.writeNode(lu);break;case"double":t.write("Double");break;case"float":t.write("Float");break;case"generic":t.writeNode(this.internalType.value),t.write("<");for(let[n,a]of this.internalType.parameters.entries())t.writeNode(a),n<this.internalType.parameters.length-1&&t.write(", ");t.write(">");break;case"inputStream":t.writeNode(pu);break;case"integer":t.write("Integer");break;case"iterable":this.writeIterable({writer:t,iterable:this.internalType});break;case"list":{this.writeList({writer:t,list:this.internalType});break}case"long":{t.write("Long");break}case"map":{this.writeMap({writer:t,map:this.internalType});break}case"object":{t.write("Object");break}case"optional":{this.writeOptional({writer:t,optional:this.internalType});break}case"reference":t.writeNode(this.internalType.value);break;case"set":{this.writeSet({writer:t,set:this.internalType});break}case"string":t.write("String");break;case"uuid":t.writeNode(fu);break;case"void":t.write("Void");break;default:C(this.internalType)}}isOptional(){return this.internalType.type==="optional"}static array(t){return new this({type:"array",value:t})}static bigInteger(){return new this({type:"bigInteger"})}static boolean(){return new this({type:"boolean"})}static bytes(){return new this({type:"bytes"})}static date(){return new this({type:"date"})}static dateTime(){return new this({type:"dateTime"})}static double(){return new this({type:"double"})}static float(){return new this({type:"float"})}static integer(){return new this({type:"integer"})}static list(t){return new this({type:"list",value:t})}static long(){return new this({type:"long"})}static map(t,n){return new this({type:"map",keyType:t,valueType:n})}static object(){return new this({type:"object"})}static optional(t){return this.isAlreadyOptional(t)?t:new this({type:"optional",value:t})}static reference(t){return new this({type:"reference",value:t})}static generic(t,n){return new this({type:"generic",value:t,parameters:n})}static set(t){return new this({type:"set",value:t})}static string(){return new this({type:"string"})}static uuid(){return new this({type:"uuid"})}static void(){return new this({type:"void"})}static iterable(t){return new this({type:"iterable",value:t})}static inputStream(){return new this({type:"inputStream"})}writeList({writer:t,list:n}){t.writeNode(ou),t.write("<"),n.value.write(t),t.write(">")}writeMap({writer:t,map:n}){t.writeNode(uu),t.write("<"),n.keyType.write(t),t.write(", "),n.valueType.write(t),t.write(">")}writeOptional({writer:t,optional:n}){t.writeNode(Ot),t.write("<"),n.value.write(t),t.write(">")}writeIterable({writer:t,iterable:n}){t.writeNode(Ot),t.write("<"),n.value.write(t),t.write(">")}writeSet({writer:t,set:n}){t.writeNode(cu),t.write("<"),n.value.write(t),t.write(">")}static isAlreadyOptional(t){return t.internalType.type==="optional"}},Ut=new L({name:"Arrays",packageName:"java.util"}),su=new L({name:"BigInteger",packageName:"java.math"}),bm=new L({name:"HashMap",packageName:"java.util"}),ou=new L({name:"List",packageName:"java.util"}),uu=new L({name:"Map",packageName:"java.util"}),lu=new L({name:"OffsetDateTime",packageName:"java.time"}),Ot=new L({name:"Optional",packageName:"java.util"}),cu=new L({name:"Set",packageName:"java.util"}),fu=new L({name:"UUID",packageName:"java.util"}),pu=new L({name:"InputStream",packageName:"java.io"});var V=class r extends F{constructor(t){super();x(this,"internalType");this.internalType=t}write(t){switch(this.internalType.type){case"bigInteger":this.writeBigInteger({writer:t,bigInteger:this.internalType});break;case"boolean":t.write(this.internalType.value.toString());break;case"builder":this.writeBuilder({writer:t,builder:this.internalType});break;case"bytes":t.write(`"${this.internalType.value}".getBytes()`);break;case"class":{this.writeClass({writer:t,class_:this.internalType});break}case"date":this.writeDate({writer:t,date:this.internalType});break;case"dateTime":this.writeDateTime({writer:t,dateTime:this.internalType});break;case"double":{let n=this.internalType.value.toString();!n.includes(".")&&!n.includes("e")&&!n.includes("E")?t.write(`${n}.0`):t.write(n);break}case"enum":this.writeEnum({writer:t,enum_:this.internalType});break;case"float":t.write(`${this.internalType.value}f`);break;case"integer":t.write(Math.floor(this.internalType.value).toString());break;case"list":{this.writeList({writer:t,list:this.internalType});break}case"long":{t.write(`${Math.floor(this.internalType.value)}L`);break}case"map":{this.writeMap({writer:t,map:this.internalType});break}case"optional":{this.writeOptional({writer:t,optional:this.internalType});break}case"raw":{this.internalType.value instanceof F?t.writeNode(this.internalType.value):t.write(this.internalType.value);break}case"reference":t.writeNode(this.internalType.value);break;case"set":{this.writeSet({writer:t,set:this.internalType});break}case"string":t.write(`"${this.escapeString(this.internalType.value)}"`);break;case"unknown":this.writeUnknown({writer:t,value:this.internalType.value});break;case"uuid":this.writeUUID({writer:t,uuid:this.internalType});break;case"nop":break;default:C(this.internalType)}}isOptional(){return this.internalType.type==="optional"}static bigInteger(t){return new this({type:"bigInteger",value:t})}static boolean(t){return new this({type:"boolean",value:t})}static builder({classReference:t,parameters:n}){return new this({type:"builder",classReference:t,parameters:n})}static bytes(t){return new this({type:"bytes",value:t})}static class_({reference:t,parameters:n}){return new this({type:"class",reference:t,parameters:n})}static date(t){return new this({type:"date",value:t})}static dateTime(t){return new this({type:"dateTime",value:t})}static double(t){return new this({type:"double",value:t})}static enum_({classReference:t,value:n}){return new this({type:"enum",classReference:t,value:n})}static float(t){return new this({type:"float",value:t})}static integer(t){return new this({type:"integer",value:t})}static list({valueType:t,values:n,isParameter:a}){return new this({type:"list",valueType:t,values:n,isParameter:a})}static long(t){return new this({type:"long",value:t})}static map({keyType:t,valueType:n,entries:a}){return new this({type:"map",keyType:t,valueType:n,entries:a})}static optional({value:t,useOf:n}){return this.isAlreadyOptional(t)?t:new this({type:"optional",value:t,useOf:n})}static raw(t){return new this({type:"raw",value:t})}static reference(t){return new this({type:"reference",value:t})}static set({valueType:t,values:n}){return new this({type:"set",valueType:t,values:n})}static string(t){return new this({type:"string",value:t})}static unknown(t){return new this({type:"unknown",value:t})}static uuid(t){return new this({type:"uuid",value:t})}static nop(){return new this({type:"nop"})}static isNop(t){return t.internalType.type==="nop"}shouldWriteInLine(){switch(this.internalType.type){case"bigInteger":case"boolean":case"bytes":case"date":case"dateTime":case"double":case"enum":case"float":case"integer":case"long":case"nop":case"raw":case"string":case"unknown":case"uuid":return!0;case"optional":return this.internalType.value.shouldWriteInLine();case"builder":case"class":case"list":case"map":case"reference":case"set":return!1;default:C(this.internalType)}}writeBigInteger({writer:t,bigInteger:n}){t.write("new "),t.writeNode(m.instantiateClass({classReference:du,arguments_:[r.string(n.value)]}))}writeBuilder({writer:t,builder:n}){t.writeNode(n.classReference),t.writeNewLineIfLastLineNot(),t.indent(),this.writeBuilderParameters({writer:t,parameters:this.orderBuilderParameters(vu({parameters:n.parameters}))}),t.dedent()}writeBuilderParameters({writer:t,parameters:n}){t.writeLine(".builder()");for(let a of n)t.write(`.${a.name}(`),a.value.shouldWriteInLine()||t.newLine(),t.indent(),t.writeNode(a.value),t.dedent(),a.value.shouldWriteInLine()||t.newLine(),t.writeLine(")");t.writeNewLineIfLastLineNot(),t.write(".build()")}orderBuilderParameters(t){return t.some(a=>!a.value.isOptional()&&!this.isCollection(a.value))?t.sort((a,i)=>{let s=this.isNonRequired(a.value),o=this.isNonRequired(i.value);return s&&!o?1:!s&&o?-1:0}):t.sort((a,i)=>{let s=a.value.isOptional(),o=i.value.isOptional();return s&&!o?1:!s&&o?-1:0})}isCollection(t){let n=t.internalType.type;return n==="list"||n==="set"||n==="map"}isNonRequired(t){return t.isOptional()||this.isCollection(t)}writeClass({writer:t,class_:n}){let a=xu({parameters:n.parameters});t.writeNode(m.instantiateClass({classReference:n.reference,arguments_:a.map(i=>i.value)}))}writeDate({writer:t,date:n}){t.writeNode(m.invokeMethod({on:hu,method:"parse",arguments_:[r.string(n.value)]}))}writeDateTime({writer:t,dateTime:n}){t.writeNode(m.invokeMethod({on:yu,method:"parse",arguments_:[r.string(n.value)]}))}writeEnum({writer:t,enum_:n}){t.writeNode(n.classReference),t.write("."+n.value)}writeList({writer:t,list:n}){this.writeIterable({writer:t,iterable:n})}writeMap({writer:t,map:n}){let a=wu({entries:n.entries});if(a.length===0){t.write("new "),t.writeNode(Ft),t.write("<"),t.writeNode(n.keyType),t.write(", "),t.writeNode(n.valueType),t.write(">()");return}t.write("new "),t.writeNode(Ft),t.write("<"),t.writeNode(n.keyType),t.write(", "),t.writeNode(n.valueType),t.writeLine(">() {{"),t.indent();for(let i of a)t.write("put("),t.writeNode(i.key),t.write(", "),t.writeNode(i.value),t.writeLine(");");t.dedent(),t.write("}}")}writeOptional({writer:t,optional:n}){if(!n.useOf){t.writeNode(n.value);return}t.writeNode(m.invokeMethod({on:Ot,method:"of",arguments_:[n.value]}))}writeSet({writer:t,set:n}){this.writeIterable({writer:t,iterable:n})}writeIterable({writer:t,iterable:n}){let a=n.type==="list"?ir:mu,i=bu({values:n.values});if(n.type==="list"&&n.isParameter&&i.length>0){t.writeNode(m.invokeMethod({on:Ut,method:"asList",arguments_:i}));return}if(i.length===0){t.write(`new ${a.name}<`),t.writeNode(n.valueType),t.write(">()");return}t.write("new "),t.writeNode(a),t.write("<"),t.writeNode(n.valueType),t.writeLine(">("),t.indent(),t.writeNode(m.invokeMethod({on:Ut,method:"asList",arguments_:i})),t.writeNewLineIfLastLineNot(),t.dedent(),t.write(")")}writeUnknown({writer:t,value:n}){switch(typeof n){case"boolean":t.write(n.toString());return;case"string":t.write(`"${this.escapeString(n)}"`);return;case"number":t.write(n.toString());return;case"object":if(n==null){t.write("null");return}if(Array.isArray(n)){this.writeUnknownArray({writer:t,value:n});return}this.writeUnknownMap({writer:t,value:n});return;default:throw new Error(`Internal error; unsupported unknown type: ${typeof n}`)}}writeUnknownArray({writer:t,value:n}){if(n.length===0){t.write("new "),t.writeNode(ir),t.write("<Object>()");return}t.write("new "),t.writeNode(ir),t.write("<Object>("),t.writeNode(m.invokeMethod({on:Ut,method:"asList",arguments_:n.map(a=>r.unknown(a))})),t.write(")")}writeUnknownMap({writer:t,value:n}){let a=Object.entries(n);if(a.length===0){t.write("new "),t.writeNode(Ft),t.write("<String, Object>()");return}t.writeLine("new "),t.writeNode(Ft),t.write("<String, Object>() {{"),t.indent();for(let[i,s]of a)t.write(`put("${i}", `),t.writeNode(r.unknown(s)),t.writeLine(");");t.dedent(),t.write("}}")}writeUUID({writer:t,uuid:n}){t.writeNode(m.invokeMethod({on:gu,method:"fromString",arguments_:[r.string(n.value)]}))}escapeString(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}static isAlreadyOptional(t){return t.internalType.type==="optional"}},ir=new L({name:"ArrayList",packageName:"java.util"}),du=new L({name:"BigInteger",packageName:"java.math"}),Ft=new L({name:"HashMap",packageName:"java.util"}),mu=new L({name:"HashSet",packageName:"java.util"}),Cm=new L({name:"List",packageName:"java.util"}),hu=new L({name:"LocalDate",packageName:"java.time"}),Lm=new L({name:"Map",packageName:"java.util"}),yu=new L({name:"OffsetDateTime",packageName:"java.time"}),Om=new L({name:"Set",packageName:"java.util"}),gu=new L({name:"UUID",packageName:"java.util"});function xu({parameters:r}){return r.filter(e=>!V.isNop(e.value))}function vu({parameters:r}){return r.filter(e=>!V.isNop(e.value))}function wu({entries:r}){return r.filter(e=>!V.isNop(e.key)&&!V.isNop(e.value))}function bu({values:r}){return r.filter(e=>!V.isNop(e))}function jt({writer:r,arguments_:e}){let t=Tu(e);if(t.length===0){r.write("()");return}if(t.some(a=>a instanceof V&&!a.shouldWriteInLine())){_u({writer:r,arguments_:t});return}r.write("("),t.forEach((a,i)=>{i>0&&r.write(", "),Kn({writer:r,argument:a})}),r.write(")")}function _u({writer:r,arguments_:e}){r.writeLine("("),r.indent(),e.forEach((t,n)=>{n>0&&r.writeLine(","),Kn({writer:r,argument:t})}),r.dedent(),e.length>0&&r.newLine(),r.write(")")}function Kn({writer:r,argument:e}){Qt(e)?r.writeNodeOrString(e.assignment):e.write(r)}function Tu(r){return r.filter(e=>!(e instanceof V&&V.isNop(e)))}var Be=class extends F{constructor({classReference:t,arguments_:n}){super();x(this,"classReference");x(this,"arguments_");this.classReference=t,this.arguments_=n}write(t){t.writeNode(this.classReference),jt({writer:t,arguments_:this.arguments_})}};l();c();var De=class extends F{constructor(t){super();x(this,"arg");this.arg=t}write(t){return new q(this.arg).write(t)}};l();c();var $e=class extends F{constructor({name:t,access:n,parameters:a,body:i,static_:s,return_:o}){super();x(this,"name");x(this,"access");x(this,"parameters");x(this,"body");x(this,"return_");x(this,"static_");this.name=t,this.access=n,this.parameters=a,this.body=i,this.return_=o,this.static_=s!=null?s:!1}write(t){if(t.write(`${this.access} `),this.static_&&t.write("static "),this.return_!=null?t.writeNode(this.return_):t.write("void"),t.write(` ${this.name}`),this.parameters.length===0)t.write("()");else if(this.parameters.length===1){if(t.write("("),this.parameters[0]==null)throw new Error("Cannot render parameter "+this.parameters[0]);t.writeNode(this.parameters[0]),t.write(")")}else t.writeLine("("),t.indent(),this.parameters.forEach((n,a)=>{a>0&&t.writeLine(", "),t.writeNode(n)}),t.dedent(),t.write(")");if(this.body==null){t.write(";");return}t.writeLine(" {"),t.indent(),t.writeNode(this.body),t.writeNewLineIfLastLineNot(),t.dedent(),t.write("}")}};l();c();var Ve=class extends F{constructor({method:t,arguments_:n,on:a}){super();x(this,"on");x(this,"method");x(this,"arguments_");this.on=a,this.method=t,this.arguments_=n}write(t){this.on.write(t),t.write("."),t.write(this.method),jt({writer:t,arguments_:this.arguments_})}};l();c();var We=class extends F{constructor({name:t,type:n}){super();x(this,"name");x(this,"type");this.name=t,this.type=n}write(t){t.writeNode(this.type),t.write(` ${this.name}`)}};function ku(r){return new De(r)}function Nu(r){return new Me(r)}function Ru(r){return new L(r)}function Au(r){return new Be(r)}function Iu(r){return new Ve(r)}function Eu(r){return new $e(r)}function Su(r){return new We(r)}l();c();var Pt=class{constructor({context:e}){x(this,"context");this.context=e}isNopTypeLiteral(e){var n;return((n=e.internalType)==null?void 0:n.type)==="nop"}usesOptionalNullable(){var e;return((e=this.context.customConfig)==null?void 0:e["collapse-optional-nullable"])===!0}wrapInOptionalIfNotNop(e,t=!1){return this.isNopTypeLiteral(e)?e:this.usesOptionalNullable()?this.context.getOptionalNullableOf(e):m.TypeLiteral.optional({value:e,useOf:t})}convert(e){if(e.value===null)return this.context.isNullable(e.typeReference)?this.context.getNullableOfNull():(this.context.errors.add({severity:O.Critical,message:"Expected non-null value, but got null"}),m.TypeLiteral.nop());if(e.value===void 0)return m.TypeLiteral.nop();switch(e.typeReference.type){case"list":return this.convertList({list:e.typeReference.value,value:e.value,as:e.as});case"literal":return this.convertLiteral({literal:e.typeReference.value,value:e.value});case"map":return this.convertMap({map:e.typeReference,value:e.value,as:e.as});case"named":{let t=this.context.resolveNamedType({typeId:e.typeReference.value});return t==null?m.TypeLiteral.nop():this.convertNamed({named:t,value:e.value,as:e.as,inUndiscriminatedUnion:e.inUndiscriminatedUnion})}case"nullable":case"optional":{if(e.value===void 0||typeof e.value=="object"&&e.value!==null&&Object.keys(e.value).length===0&&e.typeReference.value.type==="named")return this.usesOptionalNullable()?this.context.getOptionalNullableAbsent():m.TypeLiteral.reference(m.invokeMethod({on:m.classReference({name:"Optional",packageName:"java.util"}),method:"empty",arguments_:[]}));if(e.typeReference.value.type==="list"){let a=this.convertList({list:e.typeReference.value.value,value:e.value});return this.wrapInOptionalIfNotNop(a,!0)}if(this.usesOptionalNullable()&&(e.typeReference.value.type==="optional"||e.typeReference.value.type==="nullable"))return this.convert({typeReference:e.typeReference.value,value:e.value,as:e.as,inUndiscriminatedUnion:e.inUndiscriminatedUnion});let t=this.convert({typeReference:e.typeReference.value,value:e.value,as:e.as,inUndiscriminatedUnion:e.inUndiscriminatedUnion}),n=e.as==="mapValue"||e.inUndiscriminatedUnion===!0;return this.wrapInOptionalIfNotNop(t,n)}case"primitive":return this.convertPrimitive({primitive:e.typeReference.value,value:e.value,as:e.as});case"set":return this.convertSet({set:e.typeReference.value,value:e.value,as:e.as});case"unknown":return this.convertUnknown({value:e.value});default:C(e.typeReference)}}convertList({list:e,value:t,as:n}){if(!Array.isArray(t))return this.context.errors.add({severity:O.Critical,message:`Expected array but got: ${typeof t}`}),m.TypeLiteral.nop();let a=e.type==="optional"||e.type==="nullable";return m.TypeLiteral.list({valueType:this.context.dynamicTypeMapper.convert({typeReference:e}),values:t.map((i,s)=>{this.context.errors.scope({index:s});try{if(a){let o=this.convert({typeReference:e.value,value:i,as:n});return this.wrapInOptionalIfNotNop(o,!0)}return this.convert({typeReference:e,value:i,as:n})}finally{this.context.errors.unscope()}}),isParameter:!0})}convertLiteral({literal:e,value:t}){switch(e.type){case"boolean":{let n=this.context.getValueAsBoolean({value:t});return n==null?m.TypeLiteral.nop():m.TypeLiteral.boolean(n)}case"string":{let n=this.context.getValueAsString({value:t});return n==null?m.TypeLiteral.nop():m.TypeLiteral.string(n)}default:C(e)}}convertSet({set:e,value:t,as:n}){return Array.isArray(t)?m.TypeLiteral.set({valueType:this.context.dynamicTypeMapper.convert({typeReference:e}),values:t.map((a,i)=>{this.context.errors.scope({index:i});try{return this.convert({typeReference:e,value:a,as:n})}finally{this.context.errors.unscope()}})}):(this.context.errors.add({severity:O.Critical,message:`Expected array but got: ${typeof t}`}),m.TypeLiteral.nop())}convertMap({map:e,value:t,as:n}){return typeof t!="object"||t==null?(this.context.errors.add({severity:O.Critical,message:`Expected object but got: ${t==null?"null":typeof t}`}),m.TypeLiteral.nop()):m.TypeLiteral.map({keyType:this.context.dynamicTypeMapper.convert({typeReference:e.key}),valueType:this.context.dynamicTypeMapper.convert({typeReference:e.value}),entries:Object.entries(t).map(([a,i])=>{this.context.errors.scope(a);try{return{key:this.convert({typeReference:e.key,value:a,as:"mapKey"}),value:this.convert({typeReference:e.value,value:i,as:"mapValue"})}}finally{this.context.errors.unscope()}})})}convertNamed({named:e,value:t,as:n,inUndiscriminatedUnion:a}){switch(e.type){case"alias":return this.convert({typeReference:e.typeReference,value:t,as:n,inUndiscriminatedUnion:a});case"discriminatedUnion":return this.convertDiscriminatedUnion({discriminatedUnion:e,value:t});case"enum":return this.convertEnum({enum_:e,value:t});case"object":return this.convertObject({object_:e,value:t,as:n});case"undiscriminatedUnion":return this.convertUndiscriminatedUnion({undiscriminatedUnion:e,value:t});default:C(e)}}convertDiscriminatedUnion({discriminatedUnion:e,value:t}){let n=this.context.getJavaClassReferenceFromDeclaration({declaration:e.declaration}),a=this.context.resolveDiscriminatedUnionTypeInstance({discriminatedUnion:e,value:t});if(a==null)return m.TypeLiteral.nop();let i=a.singleDiscriminatedUnionType;switch(i.type){case"samePropertiesAsObject":{let s=this.context.resolveNamedType({typeId:i.typeId});return s==null?m.TypeLiteral.nop():m.TypeLiteral.reference(m.invokeMethod({on:n,method:this.context.getPropertyName(i.discriminantValue.name),arguments_:[this.convertNamed({named:s,value:a.value})]}))}case"singleProperty":{let s=this.context.getRecord(a.value);if(s==null)return m.TypeLiteral.nop();try{return this.context.errors.scope(i.discriminantValue.wireValue),m.TypeLiteral.reference(m.invokeMethod({on:n,method:this.context.getPropertyName(i.discriminantValue.name),arguments_:[this.convert({typeReference:i.typeReference,value:s["value"]})]}))}finally{this.context.errors.unscope()}}case"noProperties":return m.TypeLiteral.reference(m.invokeMethod({on:n,method:this.context.getPropertyName(i.discriminantValue.name),arguments_:[]}));default:C(i)}}convertObject({object_:e,value:t,as:n}){var s;let a=this.context.associateByWireValue({parameters:e.properties,values:(s=this.context.getRecord(t))!=null?s:{}}),i=n==="request"?a.filter(o=>!this.context.isDirectLiteral(o.typeReference)):a;return m.TypeLiteral.builder({classReference:this.context.getJavaClassReferenceFromDeclaration({declaration:e.declaration}),parameters:i.map(o=>{this.context.errors.scope(o.name.wireValue);try{return{name:this.context.getMethodName(o.name.name),value:this.convert({typeReference:o.typeReference,value:o.value,as:n})}}finally{this.context.errors.unscope()}})})}convertEnum({enum_:e,value:t}){let n=this.getEnumValueName({enum_:e,value:t});return n==null?m.TypeLiteral.nop():m.TypeLiteral.enum_({classReference:this.context.getJavaClassReferenceFromDeclaration({declaration:e.declaration}),value:n})}getEnumValueName({enum_:e,value:t}){if(typeof t!="string"){this.context.errors.add({severity:O.Critical,message:`Expected enum value string, got: ${typeof t}`});return}let n=e.values.find(a=>a.wireValue===t);if(n==null){this.context.errors.add({severity:O.Critical,message:`An enum value named "${t}" does not exist in this context`});return}return this.context.getEnumName(n.name)}convertUndiscriminatedUnion({undiscriminatedUnion:e,value:t}){let n=this.findMatchingUndiscriminatedUnionType({undiscriminatedUnion:e,value:t});return n==null?m.TypeLiteral.nop():this.context.isPrimitive(n.valueTypeReference)?m.TypeLiteral.reference(m.invokeMethod({on:this.context.getJavaClassReferenceFromDeclaration({declaration:e.declaration}),method:"of",arguments_:[n.typeInstantiation]})):m.TypeLiteral.reference(m.invokeMethod({on:this.context.getJavaClassReferenceFromDeclaration({declaration:e.declaration}),method:"of",arguments_:[n.typeInstantiation]}))}findMatchingUndiscriminatedUnionType({undiscriminatedUnion:e,value:t}){var o;let n=[],a=[];for(let f of e.types)try{n.push(JSON.stringify(f));let p=this.convert({typeReference:f,value:t,inUndiscriminatedUnion:!0});return{valueTypeReference:f,typeInstantiation:p}}catch(p){a.push(`Type ${JSON.stringify(f)}: ${p instanceof Error?p.message:String(p)}`);continue}this.context.errors.add({severity:O.Critical,message:`None of the types in the undiscriminated union matched the given "${typeof t}" value. Tried ${n.length} variants. Errors: ${a.join("; ")}`});let i=(o=e.declaration.name)!=null?o:"UnknownUnion",s=a.map((f,p)=>` ${p+1}. ${f}`).join(`
23
23
  `);throw new Error(`Failed to match undiscriminated union "${i}" for ${typeof t} value.
24
24
  Value: ${JSON.stringify(t)}
25
25
  Attempted ${n.length} variants: