@crossmint/cli 1.1.9 → 1.1.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- var Fs=(t,e)=>()=>(t&&(e=t(t=0)),e);var Bs=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);import Dr from"path";import{fileURLToPath as Ur}from"url";var l=Fs(()=>{"use strict"});var gt=Bs((Mn,nr)=>{nr.exports={name:"@crossmint/cli",version:"1.1.9",description:"",keywords:[],repository:{type:"git",url:"https://github.com/Paella-Labs/crossbit-main"},license:"ISC",author:"",type:"module",main:"dist/bin/crossmint.js",bin:{crossmint:"dist/bin/crossmint.js"},scripts:{build:"tsup --env.NODE_ENV production","build:pkg":"NODE_ENV=production node ./build-pkg.js",dev:"tsup --watch --env.NODE_ENV development",start:"pnpm build && node dist/bin/crossmint.js","test:vitest":"vitest run","test:vitest:watch":"vitest"},dependencies:{"@crossmint/common-consts":"workspace:*","@crossmint/common-string-utils":"workspace:*","@crossmint/common-types":"workspace:*","@crossmint/data-dbs-types":"workspace:*","@crossmint/products-console-types":"workspace:*","@inquirer/prompts":"7.4.0",chalk:"4.1.2",commander:"12.0.0",keytar:"7.9.0",nanospinner:"1.2.2",open:"9.1.0"},devDependencies:{"@crossmint/tsconfig":"workspace:*","@crossmint/tsupconfig":"workspace:*","@crossmint/vitestconfig":"workspace:*","@types/node":"20.14.8","@yao-pkg/pkg":"6.5.1",esbuild:"0.25.2",vitest:"2.1.9"},pkg:{scripts:"dist/bin/crossmint.js",assets:[],targets:["node20-macos-arm64","node20-linux-x64","node20-macos-x64"],outputPath:"build"}}});l();import{program as ye}from"commander";l();l();var Ws={production:"https://www.crossmint.com",staging:"https://staging.crossmint.com",local:"http://localhost:3000"};function ae(t){return Ws[t]}l();l();import ct from"keytar";var lt="crossmint-cli";async function ve(t,e){return ct.setPassword(lt,t,e)}async function Ee(t){return ct.getPassword(lt,t)}async function Le(t){return ct.deletePassword(lt,t)}function wt(t){return ve("environment",t)}async function M(){return Ee("environment")}async function Rt(){return Le("environment")}function jt(t){return ve("sessionToken",t)}async function Nt(){return Ee("sessionToken")}async function kt(){return Le("sessionToken")}function Re(t){return ve("projectId",t)}async function F(){return Ee("projectId")}async function Ot(){return Le("projectId")}import{select as pr}from"@inquirer/prompts";l();l();l();l();l();l();var Ks=Object.defineProperty;var $e=(t,e)=>Ks(t,"name",{value:e,configurable:!0});l();function De(t){return Object.values(t)}$e(De,"objectValues");function Lt(t){return Object.keys(t)}$e(Lt,"objectKeys");function $t(t){return Object.entries(t)}$e($t,"objectEntries");l();var I;(function(t){t.assertEqual=r=>r;function e(r){}t.assertIs=e;function s(r){throw new Error}t.assertNever=s,t.arrayToEnum=r=>{let n={};for(let o of r)n[o]=o;return n},t.getValidEnumValues=r=>{let n=t.objectKeys(r).filter(i=>typeof r[r[i]]!="number"),o={};for(let i of n)o[i]=r[i];return t.objectValues(o)},t.objectValues=r=>t.objectKeys(r).map(function(n){return r[n]}),t.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{let n=[];for(let o in r)Object.prototype.hasOwnProperty.call(r,o)&&n.push(o);return n},t.find=(r,n)=>{for(let o of r)if(n(o))return o},t.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&isFinite(r)&&Math.floor(r)===r;function a(r,n=" | "){return r.map(o=>typeof o=="string"?`'${o}'`:o).join(n)}t.joinValues=a,t.jsonStringifyReplacer=(r,n)=>typeof n=="bigint"?n.toString():n})(I||(I={}));var pt;(function(t){t.mergeShapes=(e,s)=>({...e,...s})})(pt||(pt={}));var m=I.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Q=t=>{switch(typeof t){case"undefined":return m.undefined;case"string":return m.string;case"number":return isNaN(t)?m.nan:m.number;case"boolean":return m.boolean;case"function":return m.function;case"bigint":return m.bigint;case"symbol":return m.symbol;case"object":return Array.isArray(t)?m.array:t===null?m.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?m.promise:typeof Map<"u"&&t instanceof Map?m.map:typeof Set<"u"&&t instanceof Set?m.set:typeof Date<"u"&&t instanceof Date?m.date:m.object;default:return m.unknown}},p=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"]),Zs=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),U=class extends Error{constructor(e){super(),this.issues=[],this.addIssue=a=>{this.issues=[...this.issues,a]},this.addIssues=(a=[])=>{this.issues=[...this.issues,...a]};let s=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,s):this.__proto__=s,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let s=e||function(n){return n.message},a={_errors:[]},r=n=>{for(let o of n.issues)if(o.code==="invalid_union")o.unionErrors.map(r);else if(o.code==="invalid_return_type")r(o.returnTypeError);else if(o.code==="invalid_arguments")r(o.argumentsError);else if(o.path.length===0)a._errors.push(s(o));else{let i=a,d=0;for(;d<o.path.length;){let u=o.path[d];d===o.path.length-1?(i[u]=i[u]||{_errors:[]},i[u]._errors.push(s(o))):i[u]=i[u]||{_errors:[]},i=i[u],d++}}};return r(this),a}toString(){return this.message}get message(){return JSON.stringify(this.issues,I.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=s=>s.message){let s={},a=[];for(let r of this.issues)r.path.length>0?(s[r.path[0]]=s[r.path[0]]||[],s[r.path[0]].push(e(r))):a.push(e(r));return{formErrors:a,fieldErrors:s}}get formErrors(){return this.flatten()}};U.create=t=>new U(t);var je=(t,e)=>{let s;switch(t.code){case p.invalid_type:t.received===m.undefined?s="Required":s=`Expected ${t.expected}, received ${t.received}`;break;case p.invalid_literal:s=`Invalid literal value, expected ${JSON.stringify(t.expected,I.jsonStringifyReplacer)}`;break;case p.unrecognized_keys:s=`Unrecognized key(s) in object: ${I.joinValues(t.keys,", ")}`;break;case p.invalid_union:s="Invalid input";break;case p.invalid_union_discriminator:s=`Invalid discriminator value. Expected ${I.joinValues(t.options)}`;break;case p.invalid_enum_value:s=`Invalid enum value. Expected ${I.joinValues(t.options)}, received '${t.received}'`;break;case p.invalid_arguments:s="Invalid function arguments";break;case p.invalid_return_type:s="Invalid function return type";break;case p.invalid_date:s="Invalid date";break;case p.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(s=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(s=`${s} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?s=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?s=`Invalid input: must end with "${t.validation.endsWith}"`:I.assertNever(t.validation):t.validation!=="regex"?s=`Invalid ${t.validation}`:s="Invalid";break;case p.too_small:t.type==="array"?s=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?s=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?s=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?s=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:s="Invalid input";break;case p.too_big:t.type==="array"?s=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?s=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?s=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?s=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?s=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:s="Invalid input";break;case p.custom:s="Invalid input";break;case p.invalid_intersection_types:s="Intersection results could not be merged";break;case p.not_multiple_of:s=`Number must be a multiple of ${t.multipleOf}`;break;case p.not_finite:s="Number must be finite";break;default:s=e.defaultError,I.assertNever(t)}return{message:s}},Ut=je;function Hs(t){Ut=t}function Ue(){return Ut}var Ve=t=>{let{data:e,path:s,errorMaps:a,issueData:r}=t,n=[...s,...r.path||[]],o={...r,path:n},i="",d=a.filter(u=>!!u).slice().reverse();for(let u of d)i=u(o,{data:e,defaultError:i}).message;return{...r,path:n,message:r.message||i}},zs=[];function f(t,e){let s=Ve({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Ue(),je].filter(a=>!!a)});t.common.issues.push(s)}var O=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,s){let a=[];for(let r of s){if(r.status==="aborted")return E;r.status==="dirty"&&e.dirty(),a.push(r.value)}return{status:e.value,value:a}}static async mergeObjectAsync(e,s){let a=[];for(let r of s)a.push({key:await r.key,value:await r.value});return t.mergeObjectSync(e,a)}static mergeObjectSync(e,s){let a={};for(let r of s){let{key:n,value:o}=r;if(n.status==="aborted"||o.status==="aborted")return E;n.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),n.value!=="__proto__"&&(typeof o.value<"u"||r.alwaysSet)&&(a[n.value]=o.value)}return{status:e.value,value:a}}},E=Object.freeze({status:"aborted"}),Vt=t=>({status:"dirty",value:t}),L=t=>({status:"valid",value:t}),ut=t=>t.status==="aborted",mt=t=>t.status==="dirty",Ne=t=>t.status==="valid",Fe=t=>typeof Promise<"u"&&t instanceof Promise,h;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(h||(h={}));var B=class{constructor(e,s,a,r){this._cachedPath=[],this.parent=e,this.data=s,this._path=a,this._key=r}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Dt=(t,e)=>{if(Ne(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let s=new U(t.common.issues);return this._error=s,this._error}}};function T(t){if(!t)return{};let{errorMap:e,invalid_type_error:s,required_error:a,description:r}=t;if(e&&(s||a))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:r}:{errorMap:(o,i)=>o.code!=="invalid_type"?{message:i.defaultError}:typeof i.data>"u"?{message:a??i.defaultError}:{message:s??i.defaultError},description:r}}var S=class{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)}get description(){return this._def.description}_getType(e){return Q(e.data)}_getOrReturnCtx(e,s){return s||{common:e.parent.common,data:e.data,parsedType:Q(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new O,ctx:{common:e.parent.common,data:e.data,parsedType:Q(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let s=this._parse(e);if(Fe(s))throw new Error("Synchronous parse encountered promise.");return s}_parseAsync(e){let s=this._parse(e);return Promise.resolve(s)}parse(e,s){let a=this.safeParse(e,s);if(a.success)return a.data;throw a.error}safeParse(e,s){var a;let r={common:{issues:[],async:(a=s?.async)!==null&&a!==void 0?a:!1,contextualErrorMap:s?.errorMap},path:s?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Q(e)},n=this._parseSync({data:e,path:r.path,parent:r});return Dt(r,n)}async parseAsync(e,s){let a=await this.safeParseAsync(e,s);if(a.success)return a.data;throw a.error}async safeParseAsync(e,s){let a={common:{issues:[],contextualErrorMap:s?.errorMap,async:!0},path:s?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Q(e)},r=this._parse({data:e,path:a.path,parent:a}),n=await(Fe(r)?r:Promise.resolve(r));return Dt(a,n)}refine(e,s){let a=r=>typeof s=="string"||typeof s>"u"?{message:s}:typeof s=="function"?s(r):s;return this._refinement((r,n)=>{let o=e(r),i=()=>n.addIssue({code:p.custom,...a(r)});return typeof Promise<"u"&&o instanceof Promise?o.then(d=>d?!0:(i(),!1)):o?!0:(i(),!1)})}refinement(e,s){return this._refinement((a,r)=>e(a)?!0:(r.addIssue(typeof s=="function"?s(a,r):s),!1))}_refinement(e){return new V({schema:this,typeName:_.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return W.create(this,this._def)}nullable(){return q.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Y.create(this,this._def)}promise(){return te.create(this,this._def)}or(e){return de.create([this,e],this._def)}and(e){return pe.create(this,e,this._def)}transform(e){return new V({...T(this._def),schema:this,typeName:_.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let s=typeof e=="function"?e:()=>e;return new ge({...T(this._def),innerType:this,defaultValue:s,typeName:_.ZodDefault})}brand(){return new Ze({typeName:_.ZodBranded,type:this,...T(this._def)})}catch(e){let s=typeof e=="function"?e:()=>e;return new Ae({...T(this._def),innerType:this,catchValue:s,typeName:_.ZodCatch})}describe(e){let s=this.constructor;return new s({...this._def,description:e})}pipe(e){return ke.create(this,e)}readonly(){return xe.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Gs=/^c[^\s-]{8,}$/i,Ys=/^[a-z][a-z0-9]*$/,qs=/^[0-9A-HJKMNP-TV-Z]{26}$/,Js=/^[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,Qs=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Xs="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",dt,ea=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,ta=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,sa=t=>t.precision?t.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`):t.precision===0?t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function aa(t,e){return!!((e==="v4"||!e)&&ea.test(t)||(e==="v6"||!e)&&ta.test(t))}var X=class t extends S{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==m.string){let n=this._getOrReturnCtx(e);return f(n,{code:p.invalid_type,expected:m.string,received:n.parsedType}),E}let a=new O,r;for(let n of this._def.checks)if(n.kind==="min")e.data.length<n.value&&(r=this._getOrReturnCtx(e,r),f(r,{code:p.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),a.dirty());else if(n.kind==="max")e.data.length>n.value&&(r=this._getOrReturnCtx(e,r),f(r,{code:p.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),a.dirty());else if(n.kind==="length"){let o=e.data.length>n.value,i=e.data.length<n.value;(o||i)&&(r=this._getOrReturnCtx(e,r),o?f(r,{code:p.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):i&&f(r,{code:p.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),a.dirty())}else if(n.kind==="email")Qs.test(e.data)||(r=this._getOrReturnCtx(e,r),f(r,{validation:"email",code:p.invalid_string,message:n.message}),a.dirty());else if(n.kind==="emoji")dt||(dt=new RegExp(Xs,"u")),dt.test(e.data)||(r=this._getOrReturnCtx(e,r),f(r,{validation:"emoji",code:p.invalid_string,message:n.message}),a.dirty());else if(n.kind==="uuid")Js.test(e.data)||(r=this._getOrReturnCtx(e,r),f(r,{validation:"uuid",code:p.invalid_string,message:n.message}),a.dirty());else if(n.kind==="cuid")Gs.test(e.data)||(r=this._getOrReturnCtx(e,r),f(r,{validation:"cuid",code:p.invalid_string,message:n.message}),a.dirty());else if(n.kind==="cuid2")Ys.test(e.data)||(r=this._getOrReturnCtx(e,r),f(r,{validation:"cuid2",code:p.invalid_string,message:n.message}),a.dirty());else if(n.kind==="ulid")qs.test(e.data)||(r=this._getOrReturnCtx(e,r),f(r,{validation:"ulid",code:p.invalid_string,message:n.message}),a.dirty());else if(n.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),f(r,{validation:"url",code:p.invalid_string,message:n.message}),a.dirty()}else n.kind==="regex"?(n.regex.lastIndex=0,n.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),f(r,{validation:"regex",code:p.invalid_string,message:n.message}),a.dirty())):n.kind==="trim"?e.data=e.data.trim():n.kind==="includes"?e.data.includes(n.value,n.position)||(r=this._getOrReturnCtx(e,r),f(r,{code:p.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),a.dirty()):n.kind==="toLowerCase"?e.data=e.data.toLowerCase():n.kind==="toUpperCase"?e.data=e.data.toUpperCase():n.kind==="startsWith"?e.data.startsWith(n.value)||(r=this._getOrReturnCtx(e,r),f(r,{code:p.invalid_string,validation:{startsWith:n.value},message:n.message}),a.dirty()):n.kind==="endsWith"?e.data.endsWith(n.value)||(r=this._getOrReturnCtx(e,r),f(r,{code:p.invalid_string,validation:{endsWith:n.value},message:n.message}),a.dirty()):n.kind==="datetime"?sa(n).test(e.data)||(r=this._getOrReturnCtx(e,r),f(r,{code:p.invalid_string,validation:"datetime",message:n.message}),a.dirty()):n.kind==="ip"?aa(e.data,n.version)||(r=this._getOrReturnCtx(e,r),f(r,{validation:"ip",code:p.invalid_string,message:n.message}),a.dirty()):I.assertNever(n);return{status:a.value,value:e.data}}_regex(e,s,a){return this.refinement(r=>e.test(r),{validation:s,code:p.invalid_string,...h.errToObj(a)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...h.errToObj(e)})}url(e){return this._addCheck({kind:"url",...h.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...h.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...h.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...h.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...h.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...h.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...h.errToObj(e)})}datetime(e){var s;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(s=e?.offset)!==null&&s!==void 0?s:!1,...h.errToObj(e?.message)})}regex(e,s){return this._addCheck({kind:"regex",regex:e,...h.errToObj(s)})}includes(e,s){return this._addCheck({kind:"includes",value:e,position:s?.position,...h.errToObj(s?.message)})}startsWith(e,s){return this._addCheck({kind:"startsWith",value:e,...h.errToObj(s)})}endsWith(e,s){return this._addCheck({kind:"endsWith",value:e,...h.errToObj(s)})}min(e,s){return this._addCheck({kind:"min",value:e,...h.errToObj(s)})}max(e,s){return this._addCheck({kind:"max",value:e,...h.errToObj(s)})}length(e,s){return this._addCheck({kind:"length",value:e,...h.errToObj(s)})}nonempty(e){return this.min(1,h.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}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 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 minLength(){let e=null;for(let s of this._def.checks)s.kind==="min"&&(e===null||s.value>e)&&(e=s.value);return e}get maxLength(){let e=null;for(let s of this._def.checks)s.kind==="max"&&(e===null||s.value<e)&&(e=s.value);return e}};X.create=t=>{var e;return new X({checks:[],typeName:_.ZodString,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...T(t)})};function ra(t,e){let s=(t.toString().split(".")[1]||"").length,a=(e.toString().split(".")[1]||"").length,r=s>a?s:a,n=parseInt(t.toFixed(r).replace(".","")),o=parseInt(e.toFixed(r).replace(".",""));return n%o/Math.pow(10,r)}var re=class t extends S{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)!==m.number){let n=this._getOrReturnCtx(e);return f(n,{code:p.invalid_type,expected:m.number,received:n.parsedType}),E}let a,r=new O;for(let n of this._def.checks)n.kind==="int"?I.isInteger(e.data)||(a=this._getOrReturnCtx(e,a),f(a,{code:p.invalid_type,expected:"integer",received:"float",message:n.message}),r.dirty()):n.kind==="min"?(n.inclusive?e.data<n.value:e.data<=n.value)&&(a=this._getOrReturnCtx(e,a),f(a,{code:p.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty()):n.kind==="max"?(n.inclusive?e.data>n.value:e.data>=n.value)&&(a=this._getOrReturnCtx(e,a),f(a,{code:p.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty()):n.kind==="multipleOf"?ra(e.data,n.value)!==0&&(a=this._getOrReturnCtx(e,a),f(a,{code:p.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):n.kind==="finite"?Number.isFinite(e.data)||(a=this._getOrReturnCtx(e,a),f(a,{code:p.not_finite,message:n.message}),r.dirty()):I.assertNever(n);return{status:r.value,value:e.data}}gte(e,s){return this.setLimit("min",e,!0,h.toString(s))}gt(e,s){return this.setLimit("min",e,!1,h.toString(s))}lte(e,s){return this.setLimit("max",e,!0,h.toString(s))}lt(e,s){return this.setLimit("max",e,!1,h.toString(s))}setLimit(e,s,a,r){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:s,inclusive:a,message:h.toString(r)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:h.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:h.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:h.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:h.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:h.toString(e)})}multipleOf(e,s){return this._addCheck({kind:"multipleOf",value:e,message:h.toString(s)})}finite(e){return this._addCheck({kind:"finite",message:h.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:h.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:h.toString(e)})}get minValue(){let e=null;for(let s of this._def.checks)s.kind==="min"&&(e===null||s.value>e)&&(e=s.value);return e}get maxValue(){let e=null;for(let s of this._def.checks)s.kind==="max"&&(e===null||s.value<e)&&(e=s.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,s=null;for(let a of this._def.checks){if(a.kind==="finite"||a.kind==="int"||a.kind==="multipleOf")return!0;a.kind==="min"?(s===null||a.value>s)&&(s=a.value):a.kind==="max"&&(e===null||a.value<e)&&(e=a.value)}return Number.isFinite(s)&&Number.isFinite(e)}};re.create=t=>new re({checks:[],typeName:_.ZodNumber,coerce:t?.coerce||!1,...T(t)});var ne=class t extends S{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==m.bigint){let n=this._getOrReturnCtx(e);return f(n,{code:p.invalid_type,expected:m.bigint,received:n.parsedType}),E}let a,r=new O;for(let n of this._def.checks)n.kind==="min"?(n.inclusive?e.data<n.value:e.data<=n.value)&&(a=this._getOrReturnCtx(e,a),f(a,{code:p.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty()):n.kind==="max"?(n.inclusive?e.data>n.value:e.data>=n.value)&&(a=this._getOrReturnCtx(e,a),f(a,{code:p.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty()):n.kind==="multipleOf"?e.data%n.value!==BigInt(0)&&(a=this._getOrReturnCtx(e,a),f(a,{code:p.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):I.assertNever(n);return{status:r.value,value:e.data}}gte(e,s){return this.setLimit("min",e,!0,h.toString(s))}gt(e,s){return this.setLimit("min",e,!1,h.toString(s))}lte(e,s){return this.setLimit("max",e,!0,h.toString(s))}lt(e,s){return this.setLimit("max",e,!1,h.toString(s))}setLimit(e,s,a,r){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:s,inclusive:a,message:h.toString(r)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:h.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:h.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:h.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:h.toString(e)})}multipleOf(e,s){return this._addCheck({kind:"multipleOf",value:e,message:h.toString(s)})}get minValue(){let e=null;for(let s of this._def.checks)s.kind==="min"&&(e===null||s.value>e)&&(e=s.value);return e}get maxValue(){let e=null;for(let s of this._def.checks)s.kind==="max"&&(e===null||s.value<e)&&(e=s.value);return e}};ne.create=t=>{var e;return new ne({checks:[],typeName:_.ZodBigInt,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...T(t)})};var oe=class extends S{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==m.boolean){let a=this._getOrReturnCtx(e);return f(a,{code:p.invalid_type,expected:m.boolean,received:a.parsedType}),E}return L(e.data)}};oe.create=t=>new oe({typeName:_.ZodBoolean,coerce:t?.coerce||!1,...T(t)});var ie=class t extends S{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==m.date){let n=this._getOrReturnCtx(e);return f(n,{code:p.invalid_type,expected:m.date,received:n.parsedType}),E}if(isNaN(e.data.getTime())){let n=this._getOrReturnCtx(e);return f(n,{code:p.invalid_date}),E}let a=new O,r;for(let n of this._def.checks)n.kind==="min"?e.data.getTime()<n.value&&(r=this._getOrReturnCtx(e,r),f(r,{code:p.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),a.dirty()):n.kind==="max"?e.data.getTime()>n.value&&(r=this._getOrReturnCtx(e,r),f(r,{code:p.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),a.dirty()):I.assertNever(n);return{status:a.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,s){return this._addCheck({kind:"min",value:e.getTime(),message:h.toString(s)})}max(e,s){return this._addCheck({kind:"max",value:e.getTime(),message:h.toString(s)})}get minDate(){let e=null;for(let s of this._def.checks)s.kind==="min"&&(e===null||s.value>e)&&(e=s.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let s of this._def.checks)s.kind==="max"&&(e===null||s.value<e)&&(e=s.value);return e!=null?new Date(e):null}};ie.create=t=>new ie({checks:[],coerce:t?.coerce||!1,typeName:_.ZodDate,...T(t)});var Se=class extends S{_parse(e){if(this._getType(e)!==m.symbol){let a=this._getOrReturnCtx(e);return f(a,{code:p.invalid_type,expected:m.symbol,received:a.parsedType}),E}return L(e.data)}};Se.create=t=>new Se({typeName:_.ZodSymbol,...T(t)});var ce=class extends S{_parse(e){if(this._getType(e)!==m.undefined){let a=this._getOrReturnCtx(e);return f(a,{code:p.invalid_type,expected:m.undefined,received:a.parsedType}),E}return L(e.data)}};ce.create=t=>new ce({typeName:_.ZodUndefined,...T(t)});var le=class extends S{_parse(e){if(this._getType(e)!==m.null){let a=this._getOrReturnCtx(e);return f(a,{code:p.invalid_type,expected:m.null,received:a.parsedType}),E}return L(e.data)}};le.create=t=>new le({typeName:_.ZodNull,...T(t)});var ee=class extends S{constructor(){super(...arguments),this._any=!0}_parse(e){return L(e.data)}};ee.create=t=>new ee({typeName:_.ZodAny,...T(t)});var G=class extends S{constructor(){super(...arguments),this._unknown=!0}_parse(e){return L(e.data)}};G.create=t=>new G({typeName:_.ZodUnknown,...T(t)});var K=class extends S{_parse(e){let s=this._getOrReturnCtx(e);return f(s,{code:p.invalid_type,expected:m.never,received:s.parsedType}),E}};K.create=t=>new K({typeName:_.ZodNever,...T(t)});var Ce=class extends S{_parse(e){if(this._getType(e)!==m.undefined){let a=this._getOrReturnCtx(e);return f(a,{code:p.invalid_type,expected:m.void,received:a.parsedType}),E}return L(e.data)}};Ce.create=t=>new Ce({typeName:_.ZodVoid,...T(t)});var Y=class t extends S{_parse(e){let{ctx:s,status:a}=this._processInputParams(e),r=this._def;if(s.parsedType!==m.array)return f(s,{code:p.invalid_type,expected:m.array,received:s.parsedType}),E;if(r.exactLength!==null){let o=s.data.length>r.exactLength.value,i=s.data.length<r.exactLength.value;(o||i)&&(f(s,{code:o?p.too_big:p.too_small,minimum:i?r.exactLength.value:void 0,maximum:o?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),a.dirty())}if(r.minLength!==null&&s.data.length<r.minLength.value&&(f(s,{code:p.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),a.dirty()),r.maxLength!==null&&s.data.length>r.maxLength.value&&(f(s,{code:p.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),a.dirty()),s.common.async)return Promise.all([...s.data].map((o,i)=>r.type._parseAsync(new B(s,o,s.path,i)))).then(o=>O.mergeArray(a,o));let n=[...s.data].map((o,i)=>r.type._parseSync(new B(s,o,s.path,i)));return O.mergeArray(a,n)}get element(){return this._def.type}min(e,s){return new t({...this._def,minLength:{value:e,message:h.toString(s)}})}max(e,s){return new t({...this._def,maxLength:{value:e,message:h.toString(s)}})}length(e,s){return new t({...this._def,exactLength:{value:e,message:h.toString(s)}})}nonempty(e){return this.min(1,e)}};Y.create=(t,e)=>new Y({type:t,minLength:null,maxLength:null,exactLength:null,typeName:_.ZodArray,...T(e)});function Te(t){if(t instanceof $){let e={};for(let s in t.shape){let a=t.shape[s];e[s]=W.create(Te(a))}return new $({...t._def,shape:()=>e})}else return t instanceof Y?new Y({...t._def,type:Te(t.element)}):t instanceof W?W.create(Te(t.unwrap())):t instanceof q?q.create(Te(t.unwrap())):t instanceof Z?Z.create(t.items.map(e=>Te(e))):t}var $=class t extends S{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(),s=I.objectKeys(e);return this._cached={shape:e,keys:s}}_parse(e){if(this._getType(e)!==m.object){let u=this._getOrReturnCtx(e);return f(u,{code:p.invalid_type,expected:m.object,received:u.parsedType}),E}let{status:a,ctx:r}=this._processInputParams(e),{shape:n,keys:o}=this._getCached(),i=[];if(!(this._def.catchall instanceof K&&this._def.unknownKeys==="strip"))for(let u in r.data)o.includes(u)||i.push(u);let d=[];for(let u of o){let g=n[u],b=r.data[u];d.push({key:{status:"valid",value:u},value:g._parse(new B(r,b,r.path,u)),alwaysSet:u in r.data})}if(this._def.catchall instanceof K){let u=this._def.unknownKeys;if(u==="passthrough")for(let g of i)d.push({key:{status:"valid",value:g},value:{status:"valid",value:r.data[g]}});else if(u==="strict")i.length>0&&(f(r,{code:p.unrecognized_keys,keys:i}),a.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let g of i){let b=r.data[g];d.push({key:{status:"valid",value:g},value:u._parse(new B(r,b,r.path,g)),alwaysSet:g in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let u=[];for(let g of d){let b=await g.key;u.push({key:b,value:await g.value,alwaysSet:g.alwaysSet})}return u}).then(u=>O.mergeObjectSync(a,u)):O.mergeObjectSync(a,d)}get shape(){return this._def.shape()}strict(e){return h.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(s,a)=>{var r,n,o,i;let d=(o=(n=(r=this._def).errorMap)===null||n===void 0?void 0:n.call(r,s,a).message)!==null&&o!==void 0?o:a.defaultError;return s.code==="unrecognized_keys"?{message:(i=h.errToObj(e).message)!==null&&i!==void 0?i:d}:{message:d}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:_.ZodObject})}setKey(e,s){return this.augment({[e]:s})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let s={};return I.objectKeys(e).forEach(a=>{e[a]&&this.shape[a]&&(s[a]=this.shape[a])}),new t({...this._def,shape:()=>s})}omit(e){let s={};return I.objectKeys(this.shape).forEach(a=>{e[a]||(s[a]=this.shape[a])}),new t({...this._def,shape:()=>s})}deepPartial(){return Te(this)}partial(e){let s={};return I.objectKeys(this.shape).forEach(a=>{let r=this.shape[a];e&&!e[a]?s[a]=r:s[a]=r.optional()}),new t({...this._def,shape:()=>s})}required(e){let s={};return I.objectKeys(this.shape).forEach(a=>{if(e&&!e[a])s[a]=this.shape[a];else{let n=this.shape[a];for(;n instanceof W;)n=n._def.innerType;s[a]=n}}),new t({...this._def,shape:()=>s})}keyof(){return Ft(I.objectKeys(this.shape))}};$.create=(t,e)=>new $({shape:()=>t,unknownKeys:"strip",catchall:K.create(),typeName:_.ZodObject,...T(e)});$.strictCreate=(t,e)=>new $({shape:()=>t,unknownKeys:"strict",catchall:K.create(),typeName:_.ZodObject,...T(e)});$.lazycreate=(t,e)=>new $({shape:t,unknownKeys:"strip",catchall:K.create(),typeName:_.ZodObject,...T(e)});var de=class extends S{_parse(e){let{ctx:s}=this._processInputParams(e),a=this._def.options;function r(n){for(let i of n)if(i.result.status==="valid")return i.result;for(let i of n)if(i.result.status==="dirty")return s.common.issues.push(...i.ctx.common.issues),i.result;let o=n.map(i=>new U(i.ctx.common.issues));return f(s,{code:p.invalid_union,unionErrors:o}),E}if(s.common.async)return Promise.all(a.map(async n=>{let o={...s,common:{...s.common,issues:[]},parent:null};return{result:await n._parseAsync({data:s.data,path:s.path,parent:o}),ctx:o}})).then(r);{let n,o=[];for(let d of a){let u={...s,common:{...s.common,issues:[]},parent:null},g=d._parseSync({data:s.data,path:s.path,parent:u});if(g.status==="valid")return g;g.status==="dirty"&&!n&&(n={result:g,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(n)return s.common.issues.push(...n.ctx.common.issues),n.result;let i=o.map(d=>new U(d));return f(s,{code:p.invalid_union,unionErrors:i}),E}}get options(){return this._def.options}};de.create=(t,e)=>new de({options:t,typeName:_.ZodUnion,...T(e)});var Me=t=>t instanceof ue?Me(t.schema):t instanceof V?Me(t.innerType()):t instanceof me?[t.value]:t instanceof fe?t.options:t instanceof he?Object.keys(t.enum):t instanceof ge?Me(t._def.innerType):t instanceof ce?[void 0]:t instanceof le?[null]:null,Be=class t extends S{_parse(e){let{ctx:s}=this._processInputParams(e);if(s.parsedType!==m.object)return f(s,{code:p.invalid_type,expected:m.object,received:s.parsedType}),E;let a=this.discriminator,r=s.data[a],n=this.optionsMap.get(r);return n?s.common.async?n._parseAsync({data:s.data,path:s.path,parent:s}):n._parseSync({data:s.data,path:s.path,parent:s}):(f(s,{code:p.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[a]}),E)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,s,a){let r=new Map;for(let n of s){let o=Me(n.shape[e]);if(!o)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let i of o){if(r.has(i))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);r.set(i,n)}}return new t({typeName:_.ZodDiscriminatedUnion,discriminator:e,options:s,optionsMap:r,...T(a)})}};function ft(t,e){let s=Q(t),a=Q(e);if(t===e)return{valid:!0,data:t};if(s===m.object&&a===m.object){let r=I.objectKeys(e),n=I.objectKeys(t).filter(i=>r.indexOf(i)!==-1),o={...t,...e};for(let i of n){let d=ft(t[i],e[i]);if(!d.valid)return{valid:!1};o[i]=d.data}return{valid:!0,data:o}}else if(s===m.array&&a===m.array){if(t.length!==e.length)return{valid:!1};let r=[];for(let n=0;n<t.length;n++){let o=t[n],i=e[n],d=ft(o,i);if(!d.valid)return{valid:!1};r.push(d.data)}return{valid:!0,data:r}}else return s===m.date&&a===m.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var pe=class extends S{_parse(e){let{status:s,ctx:a}=this._processInputParams(e),r=(n,o)=>{if(ut(n)||ut(o))return E;let i=ft(n.value,o.value);return i.valid?((mt(n)||mt(o))&&s.dirty(),{status:s.value,value:i.data}):(f(a,{code:p.invalid_intersection_types}),E)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then(([n,o])=>r(n,o)):r(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}};pe.create=(t,e,s)=>new pe({left:t,right:e,typeName:_.ZodIntersection,...T(s)});var Z=class t extends S{_parse(e){let{status:s,ctx:a}=this._processInputParams(e);if(a.parsedType!==m.array)return f(a,{code:p.invalid_type,expected:m.array,received:a.parsedType}),E;if(a.data.length<this._def.items.length)return f(a,{code:p.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),E;!this._def.rest&&a.data.length>this._def.items.length&&(f(a,{code:p.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),s.dirty());let n=[...a.data].map((o,i)=>{let d=this._def.items[i]||this._def.rest;return d?d._parse(new B(a,o,a.path,i)):null}).filter(o=>!!o);return a.common.async?Promise.all(n).then(o=>O.mergeArray(s,o)):O.mergeArray(s,n)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};Z.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Z({items:t,typeName:_.ZodTuple,rest:null,...T(e)})};var We=class t extends S{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:s,ctx:a}=this._processInputParams(e);if(a.parsedType!==m.object)return f(a,{code:p.invalid_type,expected:m.object,received:a.parsedType}),E;let r=[],n=this._def.keyType,o=this._def.valueType;for(let i in a.data)r.push({key:n._parse(new B(a,i,a.path,i)),value:o._parse(new B(a,a.data[i],a.path,i))});return a.common.async?O.mergeObjectAsync(s,r):O.mergeObjectSync(s,r)}get element(){return this._def.valueType}static create(e,s,a){return s instanceof S?new t({keyType:e,valueType:s,typeName:_.ZodRecord,...T(a)}):new t({keyType:X.create(),valueType:e,typeName:_.ZodRecord,...T(s)})}},be=class extends S{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:s,ctx:a}=this._processInputParams(e);if(a.parsedType!==m.map)return f(a,{code:p.invalid_type,expected:m.map,received:a.parsedType}),E;let r=this._def.keyType,n=this._def.valueType,o=[...a.data.entries()].map(([i,d],u)=>({key:r._parse(new B(a,i,a.path,[u,"key"])),value:n._parse(new B(a,d,a.path,[u,"value"]))}));if(a.common.async){let i=new Map;return Promise.resolve().then(async()=>{for(let d of o){let u=await d.key,g=await d.value;if(u.status==="aborted"||g.status==="aborted")return E;(u.status==="dirty"||g.status==="dirty")&&s.dirty(),i.set(u.value,g.value)}return{status:s.value,value:i}})}else{let i=new Map;for(let d of o){let u=d.key,g=d.value;if(u.status==="aborted"||g.status==="aborted")return E;(u.status==="dirty"||g.status==="dirty")&&s.dirty(),i.set(u.value,g.value)}return{status:s.value,value:i}}}};be.create=(t,e,s)=>new be({valueType:e,keyType:t,typeName:_.ZodMap,...T(s)});var Ie=class t extends S{_parse(e){let{status:s,ctx:a}=this._processInputParams(e);if(a.parsedType!==m.set)return f(a,{code:p.invalid_type,expected:m.set,received:a.parsedType}),E;let r=this._def;r.minSize!==null&&a.data.size<r.minSize.value&&(f(a,{code:p.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),s.dirty()),r.maxSize!==null&&a.data.size>r.maxSize.value&&(f(a,{code:p.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),s.dirty());let n=this._def.valueType;function o(d){let u=new Set;for(let g of d){if(g.status==="aborted")return E;g.status==="dirty"&&s.dirty(),u.add(g.value)}return{status:s.value,value:u}}let i=[...a.data.values()].map((d,u)=>n._parse(new B(a,d,a.path,u)));return a.common.async?Promise.all(i).then(d=>o(d)):o(i)}min(e,s){return new t({...this._def,minSize:{value:e,message:h.toString(s)}})}max(e,s){return new t({...this._def,maxSize:{value:e,message:h.toString(s)}})}size(e,s){return this.min(e,s).max(e,s)}nonempty(e){return this.min(1,e)}};Ie.create=(t,e)=>new Ie({valueType:t,minSize:null,maxSize:null,typeName:_.ZodSet,...T(e)});var Ke=class t extends S{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:s}=this._processInputParams(e);if(s.parsedType!==m.function)return f(s,{code:p.invalid_type,expected:m.function,received:s.parsedType}),E;function a(i,d){return Ve({data:i,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,Ue(),je].filter(u=>!!u),issueData:{code:p.invalid_arguments,argumentsError:d}})}function r(i,d){return Ve({data:i,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,Ue(),je].filter(u=>!!u),issueData:{code:p.invalid_return_type,returnTypeError:d}})}let n={errorMap:s.common.contextualErrorMap},o=s.data;if(this._def.returns instanceof te){let i=this;return L(async function(...d){let u=new U([]),g=await i._def.args.parseAsync(d,n).catch(_e=>{throw u.addIssue(a(d,_e)),u}),b=await Reflect.apply(o,this,g);return await i._def.returns._def.type.parseAsync(b,n).catch(_e=>{throw u.addIssue(r(b,_e)),u})})}else{let i=this;return L(function(...d){let u=i._def.args.safeParse(d,n);if(!u.success)throw new U([a(d,u.error)]);let g=Reflect.apply(o,this,u.data),b=i._def.returns.safeParse(g,n);if(!b.success)throw new U([r(g,b.error)]);return b.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:Z.create(e).rest(G.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,s,a){return new t({args:e||Z.create([]).rest(G.create()),returns:s||G.create(),typeName:_.ZodFunction,...T(a)})}},ue=class extends S{get schema(){return this._def.getter()}_parse(e){let{ctx:s}=this._processInputParams(e);return this._def.getter()._parse({data:s.data,path:s.path,parent:s})}};ue.create=(t,e)=>new ue({getter:t,typeName:_.ZodLazy,...T(e)});var me=class extends S{_parse(e){if(e.data!==this._def.value){let s=this._getOrReturnCtx(e);return f(s,{received:s.data,code:p.invalid_literal,expected:this._def.value}),E}return{status:"valid",value:e.data}}get value(){return this._def.value}};me.create=(t,e)=>new me({value:t,typeName:_.ZodLiteral,...T(e)});function Ft(t,e){return new fe({values:t,typeName:_.ZodEnum,...T(e)})}var fe=class t extends S{_parse(e){if(typeof e.data!="string"){let s=this._getOrReturnCtx(e),a=this._def.values;return f(s,{expected:I.joinValues(a),received:s.parsedType,code:p.invalid_type}),E}if(this._def.values.indexOf(e.data)===-1){let s=this._getOrReturnCtx(e),a=this._def.values;return f(s,{received:s.data,code:p.invalid_enum_value,options:a}),E}return L(e.data)}get options(){return this._def.values}get enum(){let e={};for(let s of this._def.values)e[s]=s;return e}get Values(){let e={};for(let s of this._def.values)e[s]=s;return e}get Enum(){let e={};for(let s of this._def.values)e[s]=s;return e}extract(e){return t.create(e)}exclude(e){return t.create(this.options.filter(s=>!e.includes(s)))}};fe.create=Ft;var he=class extends S{_parse(e){let s=I.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(e);if(a.parsedType!==m.string&&a.parsedType!==m.number){let r=I.objectValues(s);return f(a,{expected:I.joinValues(r),received:a.parsedType,code:p.invalid_type}),E}if(s.indexOf(e.data)===-1){let r=I.objectValues(s);return f(a,{received:a.data,code:p.invalid_enum_value,options:r}),E}return L(e.data)}get enum(){return this._def.values}};he.create=(t,e)=>new he({values:t,typeName:_.ZodNativeEnum,...T(e)});var te=class extends S{unwrap(){return this._def.type}_parse(e){let{ctx:s}=this._processInputParams(e);if(s.parsedType!==m.promise&&s.common.async===!1)return f(s,{code:p.invalid_type,expected:m.promise,received:s.parsedType}),E;let a=s.parsedType===m.promise?s.data:Promise.resolve(s.data);return L(a.then(r=>this._def.type.parseAsync(r,{path:s.path,errorMap:s.common.contextualErrorMap})))}};te.create=(t,e)=>new te({type:t,typeName:_.ZodPromise,...T(e)});var V=class extends S{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===_.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:s,ctx:a}=this._processInputParams(e),r=this._def.effect||null,n={addIssue:o=>{f(a,o),o.fatal?s.abort():s.dirty()},get path(){return a.path}};if(n.addIssue=n.addIssue.bind(n),r.type==="preprocess"){let o=r.transform(a.data,n);return a.common.issues.length?{status:"dirty",value:a.data}:a.common.async?Promise.resolve(o).then(i=>this._def.schema._parseAsync({data:i,path:a.path,parent:a})):this._def.schema._parseSync({data:o,path:a.path,parent:a})}if(r.type==="refinement"){let o=i=>{let d=r.refinement(i,n);if(a.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return i};if(a.common.async===!1){let i=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return i.status==="aborted"?E:(i.status==="dirty"&&s.dirty(),o(i.value),{status:s.value,value:i.value})}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(i=>i.status==="aborted"?E:(i.status==="dirty"&&s.dirty(),o(i.value).then(()=>({status:s.value,value:i.value}))))}if(r.type==="transform")if(a.common.async===!1){let o=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!Ne(o))return o;let i=r.transform(o.value,n);if(i instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:s.value,value:i}}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(o=>Ne(o)?Promise.resolve(r.transform(o.value,n)).then(i=>({status:s.value,value:i})):o);I.assertNever(r)}};V.create=(t,e,s)=>new V({schema:t,typeName:_.ZodEffects,effect:e,...T(s)});V.createWithPreprocess=(t,e,s)=>new V({schema:e,effect:{type:"preprocess",transform:t},typeName:_.ZodEffects,...T(s)});var W=class extends S{_parse(e){return this._getType(e)===m.undefined?L(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};W.create=(t,e)=>new W({innerType:t,typeName:_.ZodOptional,...T(e)});var q=class extends S{_parse(e){return this._getType(e)===m.null?L(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};q.create=(t,e)=>new q({innerType:t,typeName:_.ZodNullable,...T(e)});var ge=class extends S{_parse(e){let{ctx:s}=this._processInputParams(e),a=s.data;return s.parsedType===m.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:s.path,parent:s})}removeDefault(){return this._def.innerType}};ge.create=(t,e)=>new ge({innerType:t,typeName:_.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...T(e)});var Ae=class extends S{_parse(e){let{ctx:s}=this._processInputParams(e),a={...s,common:{...s.common,issues:[]}},r=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return Fe(r)?r.then(n=>({status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new U(a.common.issues)},input:a.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new U(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}};Ae.create=(t,e)=>new Ae({innerType:t,typeName:_.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...T(e)});var Pe=class extends S{_parse(e){if(this._getType(e)!==m.nan){let a=this._getOrReturnCtx(e);return f(a,{code:p.invalid_type,expected:m.nan,received:a.parsedType}),E}return{status:"valid",value:e.data}}};Pe.create=t=>new Pe({typeName:_.ZodNaN,...T(t)});var na=Symbol("zod_brand"),Ze=class extends S{_parse(e){let{ctx:s}=this._processInputParams(e),a=s.data;return this._def.type._parse({data:a,path:s.path,parent:s})}unwrap(){return this._def.type}},ke=class t extends S{_parse(e){let{status:s,ctx:a}=this._processInputParams(e);if(a.common.async)return(async()=>{let n=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return n.status==="aborted"?E:n.status==="dirty"?(s.dirty(),Vt(n.value)):this._def.out._parseAsync({data:n.value,path:a.path,parent:a})})();{let r=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return r.status==="aborted"?E:r.status==="dirty"?(s.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:a.path,parent:a})}}static create(e,s){return new t({in:e,out:s,typeName:_.ZodPipeline})}},xe=class extends S{_parse(e){let s=this._def.innerType._parse(e);return Ne(s)&&(s.value=Object.freeze(s.value)),s}};xe.create=(t,e)=>new xe({innerType:t,typeName:_.ZodReadonly,...T(e)});var Bt=(t,e={},s)=>t?ee.create().superRefine((a,r)=>{var n,o;if(!t(a)){let i=typeof e=="function"?e(a):typeof e=="string"?{message:e}:e,d=(o=(n=i.fatal)!==null&&n!==void 0?n:s)!==null&&o!==void 0?o:!0,u=typeof i=="string"?{message:i}:i;r.addIssue({code:"custom",...u,fatal:d})}}):ee.create(),oa={object:$.lazycreate},_;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(_||(_={}));var ia=(t,e={message:`Input not instance of ${t.name}`})=>Bt(s=>s instanceof t,e),Wt=X.create,Kt=re.create,ca=Pe.create,la=ne.create,Zt=oe.create,da=ie.create,pa=Se.create,ua=ce.create,ma=le.create,fa=ee.create,ha=G.create,ga=K.create,ya=Ce.create,_a=Y.create,va=$.create,Ea=$.strictCreate,Ta=de.create,Sa=Be.create,Ca=pe.create,ba=Z.create,Ia=We.create,Aa=be.create,Pa=Ie.create,xa=Ke.create,wa=ue.create,Ra=me.create,ja=fe.create,Na=he.create,ka=te.create,Mt=V.create,Oa=W.create,La=q.create,$a=V.createWithPreprocess,Da=ke.create,Ma=()=>Wt().optional(),Ua=()=>Kt().optional(),Va=()=>Zt().optional(),Fa={string:t=>X.create({...t,coerce:!0}),number:t=>re.create({...t,coerce:!0}),boolean:t=>oe.create({...t,coerce:!0}),bigint:t=>ne.create({...t,coerce:!0}),date:t=>ie.create({...t,coerce:!0})},Ba=E,v=Object.freeze({__proto__:null,defaultErrorMap:je,setErrorMap:Hs,getErrorMap:Ue,makeIssue:Ve,EMPTY_PATH:zs,addIssueToContext:f,ParseStatus:O,INVALID:E,DIRTY:Vt,OK:L,isAborted:ut,isDirty:mt,isValid:Ne,isAsync:Fe,get util(){return I},get objectUtil(){return pt},ZodParsedType:m,getParsedType:Q,ZodType:S,ZodString:X,ZodNumber:re,ZodBigInt:ne,ZodBoolean:oe,ZodDate:ie,ZodSymbol:Se,ZodUndefined:ce,ZodNull:le,ZodAny:ee,ZodUnknown:G,ZodNever:K,ZodVoid:Ce,ZodArray:Y,ZodObject:$,ZodUnion:de,ZodDiscriminatedUnion:Be,ZodIntersection:pe,ZodTuple:Z,ZodRecord:We,ZodMap:be,ZodSet:Ie,ZodFunction:Ke,ZodLazy:ue,ZodLiteral:me,ZodEnum:fe,ZodNativeEnum:he,ZodPromise:te,ZodEffects:V,ZodTransformer:V,ZodOptional:W,ZodNullable:q,ZodDefault:ge,ZodCatch:Ae,ZodNaN:Pe,BRAND:na,ZodBranded:Ze,ZodPipeline:ke,ZodReadonly:xe,custom:Bt,Schema:S,ZodSchema:S,late:oa,get ZodFirstPartyTypeKind(){return _},coerce:Fa,any:fa,array:_a,bigint:la,boolean:Zt,date:da,discriminatedUnion:Sa,effect:Mt,enum:ja,function:xa,instanceof:ia,intersection:Ca,lazy:wa,literal:Ra,map:Aa,nan:ca,nativeEnum:Na,never:ga,null:ma,nullable:La,number:Kt,object:va,oboolean:Va,onumber:Ua,optional:Oa,ostring:Ma,pipeline:Da,preprocess:$a,promise:ka,record:Ia,set:Pa,strictObject:Ea,string:Wt,symbol:pa,transformer:Mt,tuple:ba,undefined:ua,union:Ta,unknown:ha,void:ya,NEVER:Ba,ZodIssueCode:p,quotelessJson:Zs,ZodError:U});l();l();var Ht={CROSSMINT_EUROPE:"crossmint-europe",CROSSMINT_HORIZON:"crossmint-horizon"};l();var Wa=v.object({providerType:v.literal("openpayd"),providerClientId:v.string(),providerAccountId:v.string()}),zt=v.discriminatedUnion("providerType",[Wa]);l();var Ka=v.object({providerType:v.literal("openpayd"),providerBeneficiaryId:v.string().uuid()}),Gt=v.discriminatedUnion("providerType",[Ka]);var Za=v.object({whitelabelWalletAPI:v.boolean(),whitelabelCheckoutAPI:v.boolean(),billingAPI:v.boolean(),ethereumMintAPI:v.boolean(),baseMintAPI:v.boolean().optional(),subprojectCreation:v.object({enabled:v.boolean(),KYCOwnership:v.enum(["crossmint","developer"])}).optional(),mintAPIBYOC:v.boolean().optional(),mintAPITransferable:v.boolean().optional(),mintAPIUserIdBasedMintRecipient:v.boolean().optional(),embeddedCheckout:v.boolean().optional(),batchMintAPI:v.boolean().optional(),spamPlan:v.enum(["simple","advanced"]).optional(),paymentsMintToProjectScopedWallets:v.boolean().optional(),nonCustodialWallets:v.boolean().optional(),registerExternalCollections:v.boolean().optional(),mintAPIMaxReuploadFileSizeMB:v.number().optional(),solanaNonCompressedMint:v.boolean().optional(),solanaSFTMint:v.boolean().optional(),subscriptions:v.boolean().optional(),memeTokensCheckout:v.boolean().optional(),onrampCheckout:v.boolean().optional(),worldstore:v.object({sellerId:v.string().optional()}).optional(),onrampB2B:v.object({legalEntityName:v.string(),crossmintEntity:v.nativeEnum(Ht),crossmintReference:v.string().regex(/^\d{3}$/),provider:zt}).optional(),offrampB2B:v.object({provider:Gt,transactionLimit:v.number().min(1)}).optional(),payWithCryptoNativePassthrough:v.boolean().optional(),tokenizedCard:v.boolean().optional(),walletsMoneyTransfers:v.boolean().optional(),checkoutEnabled:v.boolean(),treasuryWallets:v.boolean().optional()}),J=(t=>(t.WHITELABEL_WALLET_API="whitelabelWalletAPI",t.WHITELABEL_CHECKOUT_API="whitelabelCheckoutAPI",t.BILLING_API="billingAPI",t.SUBSCRIPTIONS="subscriptions",t.PROJECT_TRANSFERS="walletsMoneyTransfers",t))(J||{});var N={GET:"GET",POST:"POST",PUT:"PUT",DELETE:"DELETE",PATCH:"PATCH",HEAD:"HEAD",OPTIONS:"OPTIONS",CONNECT:"CONNECT",TRACE:"TRACE"},Ha=De(N);l();l();var za=Object.defineProperty,c=(t,e)=>za(t,"name",{value:e,configurable:!0});l();l();var Ga=Object.defineProperty,C=(t,e)=>Ga(t,"name",{value:e,configurable:!0});function H(t){return t.charAt(0).toUpperCase()+t.slice(1)}C(H,"capitalizeFirstLetter");function z(t){return!t||t.length===0||t.trim().length===0}C(z,"isEmpty");function qt(t,e){return t.length<=e?t:t.slice(0,e)+"\u2026"}C(qt,"cutAndAddEllipsis");function Jt(t,e=4,s=4){return t.length<=e+s?t:t.slice(0,e)+"\u2026"+t.slice(s*-1)}C(Jt,"cutMiddleAndAddEllipsis");function Qt(){return(Math.random()+1).toString(36).substring(7)}C(Qt,"randomString");function Xt(t){let e=t.length,s=0,a=0;if(e>0)for(;a<e;)s=(s<<5)-s+t.charCodeAt(a++)|0;return s}C(Xt,"hashCode");var Yt=1e3;function es(t){return t.length<=Yt?t:t.slice(0,Yt)+"<truncated>"}C(es,"truncateForLog");function ts(t){return!t||typeof t!="string"?!1:t.toLowerCase()==="true"}C(ts,"parseBoolean");function ss(t){return/^-?\d+$/.test(t)}C(ss,"containsInteger");function as(t){if(t.length===0)return"";if(t.length===1)return t[0];let e=t.slice(0,t.length-1),s=t[t.length-1];return e.join(", ")+" and "+s}C(as,"makeFormattedEnglishList");function rs(t){return z(t)?"":t.split(" ").map(e=>e?H(e):"").join(" ")}C(rs,"capitalizeFirstLetterOfEachWord");function ns(t){return t.replace(/\s/g,"")}C(ns,"removeAllWhitespaces");function os(t){if(z(t))return 0;let e=C((s,a)=>{let r=(a.charCodeAt(0)-48)/74;return(s+r)%1},"base58Reduction");return t.split("").reduce(e,0)}C(os,"normalizeBase58String");function is(t,e=100){if(!z(t))return t.substring(0,e)}C(is,"trimIfDefined");function cs(t){return t.replace(/(\r\n|\n|\r)/g," ").replace(/[\x00-\x1F\x7F-\uFFFF]/g,"")}C(cs,"sanitizeStringToValidHTTPHeaderValue");function ls(t){try{JSON.parse(t)}catch{return!1}return!0}C(ls,"isStringifiedJson");function ds(t,e){if(!z(t))try{return JSON.parse(t)}catch(s){console.error(`safeJSONParse failed: ${e??""}`,s);return}}C(ds,"safeJSONParse");function ps(t,e){return t?.toLowerCase()===e?.toLowerCase()}C(ps,"equalsIgnoreCase");function us(t){return t.map(e=>`'${e}'`).join(" | ")}C(us,"arrayToUnionString");function ms(t){return t.startsWith("0x")?t:`0x${t}`}C(ms,"addHexIndicator");function fs(t){return Number.parseFloat(t).toString()}C(fs,"removeTrailingZeros");function hs(){let t="9876543210",e="";for(let s=0;s<4;s++)e+=t[Math.floor(Math.random()*10)];return e}C(hs,"generateOTP");function gs(t){return t&&t.includes("@")?t.split("@")[0]:t??""}C(gs,"getNameFromEmail");function ys(t){return t!=null?`@${t.split("@").pop()}`:""}C(ys,"getDomainFromEmail");function _s(t){return H(t.toLowerCase().replace(/([-_][a-z])/g,e=>e.toUpperCase().replace("-","").replace("_","")))}C(_s,"snakeToUpperCamel");function vs(t){return t[0].toLowerCase()+t.slice(1,t.length).replace(/[A-Z]/g,e=>`_${e.toLowerCase()}`)}C(vs,"upperCamelToSnake");function Es(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}C(Es,"slugify");var Ya=C(t=>t.startsWith("0x")?t.slice(2):t,"trimHexIndicator");function ht(t){return new TextEncoder().encode(t).length}C(ht,"utf8Size");function Ts(t){return ht(JSON.stringify(t))}C(Ts,"serializedSize");function Ss(t){let e=unescape(encodeURIComponent(t)),s=new Uint8Array(e.length);for(let a=0;a<e.length;a++)s[a]=e.charCodeAt(a);return s}C(Ss,"stringToUtf8ByteArray");function Cs(t){return t.split("_").map(e=>H(e)).join(" ")}C(Cs,"capitalizeAndRemoveUnderscores");function bs(t){return t.split("-").map(e=>H(e)).join(" ")}C(bs,"capitalizeAndRemoveDashes");function Is(t){if(typeof t!="string")return t;let e=t;for(;;)try{let s=JSON.parse(e);if(typeof s=="string")e=s;else return s}catch{return e}}C(Is,"multiParse");function As(t,e=1){let s=["gmail.com","hotmail.com","outlook.com","live.com"],[a,r]=t.split("@"),[n,o]=r.split("."),i,d;return a.length<=3?i="*".repeat(a.length):i=a.length<=e?a:a[0]+"*".repeat(a.length-e-1)+a.slice(-e),s.includes(`${n}.${o}`)?d=`${n}.${o}`:d=`${n.length>1?n[0]+"*".repeat(n.length-2)+n.slice(-1):n}.${o}`,`${i}@${d}`}C(As,"obfuscateEmail");function Ps(t){return t.includes("*")}C(Ps,"isObfuscated");function xs(t){return t===null?!1:/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t||"")}C(xs,"isEmail");function ws(...t){for(let e of t)if(!z(e))return e;throw new Error("All values are empty")}C(ws,"getFirstNonEmpty");function Rs(t){return t.endsWith(".")?t.slice(0,-1):t}C(Rs,"removeTrailingDecimal");var js={admin:{index:"/console/admin",enterpriseClient:{index:"/console/admin/enterprise-clients",withId:c(t=>`/console/admin/enterprise-clients/${t}`,"withId"),details:c(t=>`/console/admin/enterprise-clients/${t}/details`,"details"),onrampB2B:c(t=>`/console/admin/enterprise-clients/${t}/onrampb2b`,"onrampB2B")},quickstarts:{index:"/console/admin/quickstarts",new:"/console/admin/quickstarts/new",edit:c(t=>`/console/admin/quickstarts/${t}`,"edit")}},billing:{index:"/console/billing",planDetails:"/console/billing/plan-details"},overview:{index:"/console/overview"},orders:{index:"/console/orders",orderDetails:c(t=>`/console/orders/${t}`,"orderDetails")},createAccount:"/console/create-account",onboarding:"/console/onboarding",collections:{index:"/console/collections",create:"/console/create-collection",dashboard:c(t=>`/console/collections/${t}/dashboard`,"dashboard"),details:c(t=>`/console/collections/${t}/details`,"details"),branding:c(t=>`/console/collections/${t}/branding`,"branding"),contract:c(t=>`/console/collections/${t}/contract`,"contract"),payments:c(t=>`/console/collections/${t}/payments`,"payments"),orders:c(t=>`/console/collections/${t}/orders`,"orders"),orderDetails:c((t,e)=>`/console/collections/${t}/orders/${e}`,"orderDetails"),payouts:{index:c(t=>`/console/collections/${t}/payouts`,"index"),details:c((t,e)=>`/console/collections/${t}/payouts/${e}`,"details"),scheduled:c((t,e)=>`/console/collections/${t}/payouts/scheduled/${e}`,"scheduled")},registeredNfts:c(t=>`/console/collections/${t}/registered/nfts`,"registeredNfts"),createdNfts:c(t=>`/console/collections/${t}/created/nfts`,"createdNfts")},wallets:{company:{index:"/console/wallets/company",walletDetails:c(t=>`/console/wallets/company/${t}`,"walletDetails")},index:"/console/wallets",address:c((t,e)=>`/console/wallets/${t}?${e}`,"address")},prepay:{create:c(t=>`/console/collections/create-prepay/${t}`,"create"),details:c(t=>`/console/collections/prepay/${t}/details`,"details"),update:c(t=>`/console/collections/prepay/${t}/update`,"update")},projects:{index:"/console/projects",addMember:"/console/projects/addMember",apiKeys:{index:"/console/projects/apiKeys",edit:c((t,e)=>`/console/projects/${t}/APIKeys/Create?apiKeyId=${e}`,"edit")},projectId:c(t=>`/console/projects/${t}`,"projectId"),withId:c(t=>`/console/projects/${t}`,"withId"),branding:c(t=>`/console/projects/${t}/branding`,"branding"),settings:c(t=>`/console/projects/${t}/settings`,"settings"),walletsSettings:c(t=>`/console/projects/${t}/settings/wallets`,"walletsSettings")},webhooks:{index:"/console/webhooks"},domains:{index:"/console/domains"},applePayDomains:{index:"/console/apple-pay-domains"},account:{index:"/console/account"},mintingApi:{index:"/console/minting-api"},authorizeDevice:{index:c(t=>`/console/authorize-device?${new URLSearchParams(t).toString()}`,"index"),success:"/console/authorize-device/success"}};function He(t,e){return e?`${t}?clientId=${e}`:t}c(He,"appendClientId");var qa={console:{collections:{new:{chooseAction:c(t=>He("/alpha/console/collections/new/choose-action",t),"chooseAction"),details:c(t=>`/alpha/console/collections/new/details?${new URLSearchParams({...z(t)?{}:{clientId:t}}).toString()}`,"details"),registerCollection:c(t=>He("/alpha/console/collections/new/register-collection",t),"registerCollection"),smartContract:c(t=>He("/alpha/console/collections/new/smart-contract",t),"smartContract")}}}},Ja={admin:{godmode:{info:c(t=>`/api/admin/godmode/info?userId=${t}`,"info"),relatedEntities:c(t=>`/api/admin/godmode/related-entities?identifier=${t}`,"relatedEntities"),impersonate:c((t,e)=>`/api/admin/godmode/impersonate?entityId=${t}&type=${e}`,"impersonate"),gatherInfo:c((t,e)=>`/api/admin/godmode/gather-info/${t}/${e}`,"gatherInfo"),enterpriseData:c(t=>`/api/admin/godmode/enterprise-data?identifier=${t}`,"enterpriseData")}},auth:{callback:{email:"/api/auth/callback/email"}},internal:{transfer:{confirmation:"/api/internal/transfer/confirmation"},transaction:{confirmation:"/api/internal/transaction/confirmation"}},"v1-alpha1":{wallets:{transaction:{getViewInfo:c(t=>`/api/v1-alpha1/wallets/transaction/getViewInfo/${t}`,"getViewInfo")},nfts:c(t=>`api/v1-alpha1/wallets/${t}/nfts`,"nfts"),getViewInfo:c(t=>`api/v1-alpha1/wallets/transfers/getViewInfo/${t}`,"getViewInfo")},collections:{index:"/api/v1-alpha1/collections",mints:c((t,e,s)=>`/api/v1-alpha1/collections/${t}/mints?projectId=${e}${s?`&cursor=${s}`:""}`,"mints")},minting:{collections:{nfts:c((t,e)=>`/api/v1-alpha1/minting/collections/${t}/nfts?projectId=${e}`,"nfts")}},project:{branding:c(t=>`/api/v1-alpha1/projects/${t}/branding`,"branding"),usage:c((t,e,s)=>`/api/v1-alpha1/projects/${t}/usage?dimension=${e}&startDate=${s}`,"usage"),walletsCreated:c(t=>`/api/v1-alpha1/projects/${t}/wallets-created`,"walletsCreated")}},blockchain:{price:c(t=>`/api/blockchain/${t}/price`,"price")},console:{billing:{details:c(t=>`/api/billing/${t}`,"details"),addPaymentMethodUrl:c(t=>`/api/billing/addPaymentInfoUrl/${t}`,"addPaymentMethodUrl"),getCurrentBalance:c(t=>`/api/billing/${t}/balance`,"getCurrentBalance"),paymentMethods:c(t=>`/api/billing/${t}/paymentMethods`,"paymentMethods")},collections:{index:c(t=>`/api/collections?projectId=${t}`,"index"),indexPaginated:c((t,e,s,a=!1)=>`/api/v1-alpha1/collections?${new URLSearchParams({projectId:t,page:e.toString(),perPage:s.toString(),hideDrafts:a?"true":"false"})}`,"indexPaginated"),byClientId:c((t,e)=>`/api/console/collections/${t}?projectId=${e}`,"byClientId"),requestVerification:c((t,e)=>`/api/console/collections/${t}/request-verification?projectId=${e}`,"requestVerification"),mintableTemplates:c((t,e,s,a=20)=>`/api/console/collections/${t}/templates/mintable?projectId=${e}&page=${s}&perPage=${a}`,"mintableTemplates"),templateSupply:c((t,e)=>`/api/console/collections/${t}/templates/supply?projectId=${e}`,"templateSupply"),payments:{parameters:c((t,e)=>`/api/console/collections/${t}/payments/parameters?projectId=${e}`,"parameters")},orders:{stats:c((t,e)=>`/api/collections/${t}/orders/stats?projectId=${e}`,"stats"),index:c((t,e,s)=>{let a=new URLSearchParams({projectId:e,...s});return`/api/collections/${t}/orders?${a}`},"index"),order:c((t,e,s)=>`/api/collections/${t}/orders/${s}?projectId=${e}`,"order")},register:{evm:{contract:{getInfo:c((t,e)=>`/api/console/collections/register/evm/contract/${t}/get-info?chain=${e}`,"getInfo")},getThirdwebParams:c((t,e)=>`/api/console/collections/register/evm/contract/get-thirdweb-params?projectId=${t}&clientId=${e}`,"getThirdwebParams")}},batchUpload:c((t,e,s)=>`/api/console/collections/${t}/batchUpload?projectId=${e}&batchIdentifier=${s}`,"batchUpload"),batchUploadStatus:c((t,e,s,a)=>`/api/console/collections/${t}/batchUpload?projectId=${e}&batchIdentifier=${s}&workflowId=${a}`,"batchUploadStatus")},getProject:c(t=>`/api/console/projects?projectId=${t}`,"getProject"),projects:{index:`/api/${js.projects.index}`,exportCsv:c((t,e)=>`/api/export-csv?projectId=${t}&clientId=${e}`,"exportCsv"),apiKeys:c((t,e)=>`/api/console/projects/${t}/apiKeys${z(e)?"":`?keyId=${e}`}`,"apiKeys"),webhook:c(t=>`/api/console/projects/${t}/webhook`,"webhook"),members:"/api/console/projects/members",billing:{paymentMethods:c(t=>`/api/console/projects/${t}/billing/paymentMethods`,"paymentMethods"),balance:c(t=>`/api/console/projects/${t}/billing/balance`,"balance"),subscription:c(t=>`/api/console/projects/${t}/billing/subscription`,"subscription"),pricing:c(t=>`/api/console/projects/${t}/billing/pricing`,"pricing"),apiActionEnabled:c((t,e,s)=>`/api/console/projects/${t}/billing/apiActionEnabled?apiAction=${e}&chain=${s}`,"apiActionEnabled"),usage:c(t=>`/api/console/projects/${t}/billing/usage`,"usage"),autoRecharge:c(t=>`/api/console/projects/${t}/billing/autoRecharge`,"autoRecharge"),redeemCoupon:c(t=>`/api/console/projects/${t}/billing/redeemCoupon`,"redeemCoupon"),payments:c(t=>`/api/console/projects/${t}/billing/payments`,"payments"),topupStatus:c((t,e)=>`/api/console/projects/${t}/billing/topupStatus?requestId=${e}`,"topupStatus"),billingInformation:c(t=>`/api/console/projects/${t}/billing/billingInformation`,"billingInformation")},privacyPolicy:c(t=>`/api/console/project/${t}/privacy-policy`,"privacyPolicy")},webhook:{index:c(t=>`/api/console/webhook?projectId=${t}`,"index"),attempts:c(t=>`/api/console/webhook/attempts?projectId=${t}`,"attempts"),svix:{appPortal:"/api/console/webhook/svix/app-portal"}},domains:{createUpdateDelete:c((t,e)=>`/api/v1-alpha1/projects/${t}/domains/${e}`,"createUpdateDelete")},applePayDomains:{list:c(t=>`/api/v1-alpha1/projects/${t}/apple-pay-domains`,"list"),register:c((t,e)=>`/api/v1-alpha1/projects/${t}/apple-pay-domains/${e}`,"register"),deregister:c((t,e)=>`/api/v1-alpha1/projects/${t}/apple-pay-domains/${e}`,"deregister")},accesslist:{discordInfo:c((t,e)=>`/api/console/collections/${t}/accesslists/discord?projectId=${e}`,"discordInfo"),validateTwitter:c((t,e,s)=>`/api/console/collections/${t}/accesslists/twitter?username=${s}&projectId=${e}`,"validateTwitter"),accesslists:c((t,e)=>`/api/console/collections/${t}/accesslists?projectId=${e}`,"accesslists")},developerAccount:{get:c(t=>`/api/console/developer-account?projectId=${t}`,"get")},mintingApi:{hasMinted:c(t=>`/api/console/minting-api/hasMinted?projectId=${t}`,"hasMinted")},payments:{hostedSalesPage:{index:c((t,e)=>`/api/console/collections/${t}/payments/hostedSalesPage?projectId=${e}`,"index")},enable:c((t,e)=>`/api/console/collections/${t}/payments/enable?projectId=${e}`,"enable")},branding:c((t,e)=>`/api/console/collections/${t}/branding?projectId=${e}`,"branding"),registerContract:c((t,e)=>`/api/console/collections/${t}/register-contract?projectId=${e}`,"registerContract"),dashboard:{revenue:c((t,e,s,a,r)=>`/api/console/collections/${t}/dashboard/revenue/?projectId=${e}&after=${s}&before=${a}&periodInMS=${r}`,"revenue"),sales:c((t,e,s,a)=>`/api/console/collections/${t}/dashboard/sales/?projectId=${e}&after=${s}&before=${a}`,"sales")},contactSales:{upgradePlanSubmission:c(t=>`/api/console/contact-sales/upgrade-plan-submission?projectId=${t}`,"upgradePlanSubmission")}},developerAccount:"/api/developeraccount",contactSales:{upgradePlanSubmission:c(t=>`/api/console/contact-sales/upgrade-plan-submission?projectId=${t}`,"upgradePlanSubmission")},crossmint:{user:{discord:{index:"/api/crossmint/user/discord"}}},projects:"/api/projects",verification:{otp:c((t,e,s)=>`/api/verifyOTP?${new URLSearchParams({exportId:t,otp:e,uuid:s}).toString()}`,"otp"),getStatusByEntityId:c(t=>`/api/verification/${t}/status`,"getStatusByEntityId"),getCollectionStatus:c((t,e)=>`/api/verification/${t}/collectionStatus?projectId=${e}`,"getCollectionStatus")},prepays:{details:c(t=>`/api/prepays/${t}`,"details")},hostedSalesPage:{mintStatus:c(({clientId:t,isConsole:e,quantity:s,projectId:a,currency:r,price:n})=>`/api/collections/drop/mintStatus?clientId=${t}&quantity=${s}&currency=${r}&price=${n}&isConsole=${e}${a?`&projectId=${a}`:""}`,"mintStatus"),index:c(t=>`/api/collections/drop?slug=${t}`,"index"),context:c(t=>`/api/collections/drop/context?slug=${t}`,"context")},claim:{index:"/api/collections/claim",context:c(t=>`/api/collections/claim/context?slug=${t}`,"context"),pageStatus:c(({clientId:t,projectId:e})=>`/api/collections/claim/pageStatus?clientId=${t}&projectId=${e}`,"pageStatus"),supply:c(({clientId:t,projectId:e})=>`/api/collections/claim/supply?clientId=${t}&projectId=${e}`,"supply"),status:c(({clientId:t,projectId:e,requestId:s})=>`/api/collections/claim/status?clientId=${t}&projectId=${e}&requestId=${s}`,"status")},walletConnect:{signMessage:"/api/walletConnect"},transactions:{nft:c(t=>`/api/transactions/${t}/nft`,"nft")},"2023-06-09":{crossmint:{connect:c((t,{forceWalletSelection:e,projectId:s,showAAWallets:a})=>{let r=e?"&forceWalletSelection=true":"",n=s?`&projectId=${s}`:"";return`/api/2023-06-09/crossmint/connect?chain=${t}${r}${n}${a?"&showAAWallets=true":""}`},"connect")}},"2022-06-09":{minting:{collections:{index:c(t=>`/api/2022-06-09/minting/collections?projectId=${t}`,"index"),collectionId:c((t,e)=>`/api/2022-06-09/minting/collections/${t}${e?`?projectId=${e}`:""}`,"collectionId"),templates:c((t,e)=>`/api/2022-06-09/minting/collections/${t}/templates?projectId=${e}`,"templates"),nfts:c((t,e)=>`/api/2022-06-09/minting/collections/${t}/nfts?projectId=${e}`,"nfts"),template:c((t,e,s)=>`/api/2022-06-09/minting/collections/${t}/templates/${e}?projectId=${s}`,"template")}},wallets:{index:c(t=>`/api/2022-06-09/wallets?projectId=${t}`,"index")}},wallets:{get(t,e,s,a){return`/api/unstable/wallets?${new URLSearchParams({projectId:t,page:e.toString(),perPage:s.toString(),...a})}`},index:c(t=>`/api/v1-alpha1/wallets?projectId=${t}`,"index")},services:{aws:{s3:{presignedPutObject:c((t,e,s,a)=>`/api/services/aws/s3/presignedPutObject?${new URLSearchParams({clientId:t,projectId:s,batchIdentifier:e,bucketName:a}).toString()}`,"presignedPutObject")}}}},Qa={referralProgramAgreement:"/legal/referral-program-agreement",contentPolicy:"/content-policy",termsOfService:"/legal/terms-of-service",msa:"/master-services-agreement",privacyPolicy:"/legal/privacy-policy"},Xa={claim:c(t=>`/collections/${t}/claim`,"claim")},er={getSession:"/api/session",signOut:"/api/session/signout",oauthSessionAuthenticate:"/api/session/authenticate",authenticate:"/api/session/authenticate",oauthSessionAuthenticateAuthSDK:"/api/2024-09-26/session/sdk/auth/authenticate",stytchGetOrCreateUser:"/api/sdk/auth/user/get-or-create",exchangeAccessToken:"/api/session/exchange-access-token",sendOtp:"/api/session/send/otp"},tr={support:"https://help.crossmint.com/hc/en-us/requests/new",collectionVerificationFAQ:"https://help.crossmint.com/hc/en-us/articles/17367432791053-Crossmint-Collection-Review",sales:"/contact/sales",index:"/contact"},sr={contract:c(t=>`/claim/contract/${t}`,"contract")},ar={index:"https://docs.crossmint.com",changelog:{index:"https://docs.crossmint.com/changelog",article:c(t=>`https://docs.crossmint.com/changelog/${t}`,"article")},payments:{index:"https://docs.crossmint.com/payments/introduction"}},rr={index:"/cli-signin",success:"/cli-signin/success"},x={cliSignin:rr,console:js,api:Ja,alpha:qa,legal:Qa,collection:Xa,authentication:er,notFound:"/404",contact:tr,claim:sr,docs:ar,pricing:"/pricing"};import Ns from"os";var ks=gt().version,Os="@crossmint/cli";function or(){let t=Ns.platform(),e=Ns.arch(),s=process.version;return`${Os} ${ks} (${t} ${e}) Node.js/${s} (production)`}function ir(){return{"user-agent":or(),"x-client-name":Os,"x-client-version":ks}}async function k(t,e=N.GET,s){let a=await Nt(),r=await M();a||(console.error("\u274C Session not found, please run crossmint login"),process.exit(1)),r||(console.error("\u274C Environment not found, please run crossmint login"),process.exit(1));let n=`${ae(r)}${t}`;return ze(n,e,s,{Cookie:`sessionToken=${a}`})}async function Ls(t,e=N.GET,s){let a=await M();a||(console.error("\u274C Environment not found"),process.exit(1));let r=`${ae(a)}${t}`;return ze(r,e,s)}async function ze(t,e=N.GET,s,a){let r={method:e,headers:{"Content-Type":"application/json",...ir(),...a}};s&&(r.body=JSON.stringify(s));let n=await fetch(t,r);if(n.status>=400){let o=await n.json();throw new Error(`${o.message}`)}return await n.json()}import{select as lr}from"@inquirer/prompts";l();import{createSpinner as cr}from"nanospinner";function D(t){let e=cr(t),s={start:a=>(e.start({text:a}),s),succeed:a=>(e.success({text:a}),s),fail:a=>(e.error({text:a}),s)};return s}l();var yt="crossmint",A={LOGIN:"login",LOGOUT:"logout",WHOAMI:"whoami",KEYS:"keys",PROJECTS:"projects",CREATE:"create",DELETE:"delete",EDIT:"edit",LIST:"list",SELECT:"select",DETAILS:"details"};function w(t){return[yt,...t].join(" ")}var R={login:[A.LOGIN],logout:[A.LOGOUT],whoami:[A.WHOAMI],projects:{select:[A.PROJECTS,A.SELECT],create:[A.PROJECTS,A.CREATE],details:[A.PROJECTS,A.DETAILS]},keys:{create:[A.KEYS,A.CREATE],delete:[A.KEYS,A.DELETE],edit:[A.KEYS,A.EDIT],list:[A.KEYS,A.LIST]}};async function we(){let t=D("Fetching projects...").start();try{let e=await k(x.api.projects);if(!e||e.length===0)return t.fail(`No projects found. Create a new project using \`${w(R.projects.create)}\``),process.exit(0);if(t.succeed("Fetched projects"),e.length===1){let a=e[0];return console.log(`You only have one project: ${a.name}`),console.log(`To create another project, run \`${w(R.projects.create)}\``),await Re(a.id),console.log(`\u2705 Project ${a.name} selected`),process.exit(0)}let s=await lr({message:"Select a project:",choices:e.map(a=>({name:a.name,value:a,description:a.description}))});await Re(s.id),console.log(`\u2705 Project ${s.name} selected`),process.exit(0)}catch{t.fail("Failed to fetch projects"),process.exit(1)}}import ur from"open";l();import $s from"crypto";async function Ds(){let e=$s.randomBytes(32).toString("base64url"),a=$s.createHash("sha256").update(e).digest().toString("base64url");return await ve("pkceCodeVerifier",e),a}async function Ms(){return await Ee("pkceCodeVerifier")}l();import dr from"http";l();async function Ge(){let t=await M();return t||(console.error("\u274C Environment not found"),process.exit(1)),t==="local"?{uri:"test.stytch.com",projectId:"project-test-8eb55d3d-949f-4e0f-aea6-c9ba740f7813",clientId:"connected-app-test-4d27d6d8-3491-45c8-9bb0-b05f89cb7a1a"}:t==="staging"?{uri:"api.stytch.com",projectId:"project-live-b7c564af-0c0d-4662-bfc0-72bed1049cfe",clientId:"connected-app-live-47cd5bf1-c155-42c1-9f36-5d35853b34a7"}:{uri:"api.stytch.com",projectId:"project-live-7a1cb98d-b8b7-4471-aaf6-f8af67a0df94",clientId:"connected-app-live-a72edd7e-6ff3-4002-a13a-e7ca66354bd1"}}async function _t(t){return new Promise((e,s)=>{let a=dr.createServer(async(n,o)=>{try{let d=new URL(n.url||"",`http://${n.headers.host}`).searchParams.get("code");if(!d){o.writeHead(400,{"Content-Type":"text/plain"}),o.end("No code provided");return}let u=await Ge(),g=await ze(`https://${u.uri}/v1/public/${u.projectId}/oauth2/token`,N.POST,{grant_type:"authorization_code",code:d,client_id:u.clientId,redirect_uri:"http://127.0.0.1:3456/callback",code_verifier:await Ms()}),b=await Ls(x.authentication.exchangeAccessToken,N.POST,{accessToken:g.access_token});await jt(b.sessionToken),o.writeHead(302,{Location:`${ae(t)}${x.console.authorizeDevice.success}`}),o.end(),a.close(),e(g)}catch(i){o.writeHead(500,{"Content-Type":"text/plain"}),o.end("Error during authentication"),a.close(),s(i)}});a.listen(3456)})}var mr=!1;async function vt(){try{console.log("\u{1F510} Crossmint CLI - Login");let t=await pr({message:"Select environment:",choices:[{name:"Production",value:"production"},{name:"Staging",value:"staging"},...mr?[{name:"Local",value:"local"}]:[]]}),e=ae(t);e||(console.error(`Error: No URL found for ${t} environment`),process.exit(1)),await wt(t);let s=_t(t),{clientId:a}=await Ge(),n={code_challenge:await Ds(),code_challenge_method:"S256",scope:"full_access",response_type:"code",grant_type:"authorization_code",redirect_uri:"http://127.0.0.1:3456/callback",client_id:a},o=`${e}${x.console.authorizeDevice.index(n)}`;console.log("Opening browser for authentication..."),ur(o),await s,console.log(`\u2705 Login successful! You are now authenticated in the ${t} environment.`),await we()}catch{console.error("\u274C Login failed, please try again."),process.exit(1)}}l();l();async function se(t){return(await k(x.api.projects)).find(a=>a.id===t)}async function Et(){let t=await M(),e=await F(),s=await se(e||""),a=await k(x.authentication.getSession);console.log(`You are logged in to \u{1F340}Crossmint as: ${a.user.email} - Environment: ${H(t)} - ${s?`Project: ${s.name}`:"No project selected"}`),process.exit(0)}l();async function Tt(){await kt(),await Rt(),await Ot(),console.log("Logged out"),process.exit(0)}l();l();import{confirm as fr,input as hr}from"@inquirer/prompts";async function Ye(t={}){let e=D();try{let s=t.name;s||(s=await hr({message:"Enter project name:",validate:o=>o.length>0||"Project name is required"})),e.start(`\u{1F680} Creating project "${s}" with Smart Wallets...`);let a=await k(x.api.console.projects.index,N.POST,{name:s,walletType:"smart_wallet",storageProvider:"ipfs",projectThumbnail:""}),r=JSON.parse(a);e.succeed(`\u2705 Project created successfully!
2
+ var Fs=(t,e)=>()=>(t&&(e=t(t=0)),e);var Bs=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);import Dr from"path";import{fileURLToPath as Ur}from"url";var l=Fs(()=>{"use strict"});var gt=Bs((Mn,nr)=>{nr.exports={name:"@crossmint/cli",version:"1.1.12",description:"",keywords:[],repository:{type:"git",url:"https://github.com/Paella-Labs/crossbit-main"},license:"ISC",author:"",type:"module",main:"dist/bin/crossmint.js",bin:{crossmint:"dist/bin/crossmint.js"},scripts:{build:"tsup --env.NODE_ENV production","build:pkg":"NODE_ENV=production node ./build-pkg.js",dev:"tsup --watch --env.NODE_ENV development",start:"pnpm build && node dist/bin/crossmint.js","test:vitest":"vitest run","test:vitest:watch":"vitest"},dependencies:{"@crossmint/common-consts":"workspace:*","@crossmint/common-string-utils":"workspace:*","@crossmint/common-types":"workspace:*","@crossmint/data-dbs-types":"workspace:*","@crossmint/products-console-types":"workspace:*","@inquirer/prompts":"7.4.0",chalk:"4.1.2",commander:"12.0.0",keytar:"7.9.0",nanospinner:"1.2.2",open:"9.1.0"},devDependencies:{"@crossmint/tsconfig":"workspace:*","@crossmint/tsupconfig":"workspace:*","@crossmint/vitestconfig":"workspace:*","@types/node":"20.14.8","@yao-pkg/pkg":"6.5.1",esbuild:"0.25.2",vitest:"2.1.9"},pkg:{scripts:"dist/bin/crossmint.js",assets:[],targets:["node20-macos-arm64","node20-linux-x64","node20-macos-x64"],outputPath:"build"}}});l();import{program as ye}from"commander";l();l();var Ws={production:"https://www.crossmint.com",staging:"https://staging.crossmint.com",local:"http://localhost:3000"};function ae(t){return Ws[t]}l();l();import ct from"keytar";var lt="crossmint-cli";async function ve(t,e){return ct.setPassword(lt,t,e)}async function Ee(t){return ct.getPassword(lt,t)}async function Le(t){return ct.deletePassword(lt,t)}function wt(t){return ve("environment",t)}async function M(){return Ee("environment")}async function Rt(){return Le("environment")}function jt(t){return ve("sessionToken",t)}async function Nt(){return Ee("sessionToken")}async function kt(){return Le("sessionToken")}function Re(t){return ve("projectId",t)}async function F(){return Ee("projectId")}async function Ot(){return Le("projectId")}import{select as pr}from"@inquirer/prompts";l();l();l();l();l();l();var Ks=Object.defineProperty;var $e=(t,e)=>Ks(t,"name",{value:e,configurable:!0});l();function De(t){return Object.values(t)}$e(De,"objectValues");function Lt(t){return Object.keys(t)}$e(Lt,"objectKeys");function $t(t){return Object.entries(t)}$e($t,"objectEntries");l();var I;(function(t){t.assertEqual=r=>r;function e(r){}t.assertIs=e;function s(r){throw new Error}t.assertNever=s,t.arrayToEnum=r=>{let n={};for(let o of r)n[o]=o;return n},t.getValidEnumValues=r=>{let n=t.objectKeys(r).filter(i=>typeof r[r[i]]!="number"),o={};for(let i of n)o[i]=r[i];return t.objectValues(o)},t.objectValues=r=>t.objectKeys(r).map(function(n){return r[n]}),t.objectKeys=typeof Object.keys=="function"?r=>Object.keys(r):r=>{let n=[];for(let o in r)Object.prototype.hasOwnProperty.call(r,o)&&n.push(o);return n},t.find=(r,n)=>{for(let o of r)if(n(o))return o},t.isInteger=typeof Number.isInteger=="function"?r=>Number.isInteger(r):r=>typeof r=="number"&&isFinite(r)&&Math.floor(r)===r;function a(r,n=" | "){return r.map(o=>typeof o=="string"?`'${o}'`:o).join(n)}t.joinValues=a,t.jsonStringifyReplacer=(r,n)=>typeof n=="bigint"?n.toString():n})(I||(I={}));var pt;(function(t){t.mergeShapes=(e,s)=>({...e,...s})})(pt||(pt={}));var m=I.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Q=t=>{switch(typeof t){case"undefined":return m.undefined;case"string":return m.string;case"number":return isNaN(t)?m.nan:m.number;case"boolean":return m.boolean;case"function":return m.function;case"bigint":return m.bigint;case"symbol":return m.symbol;case"object":return Array.isArray(t)?m.array:t===null?m.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?m.promise:typeof Map<"u"&&t instanceof Map?m.map:typeof Set<"u"&&t instanceof Set?m.set:typeof Date<"u"&&t instanceof Date?m.date:m.object;default:return m.unknown}},p=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"]),Zs=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),U=class extends Error{constructor(e){super(),this.issues=[],this.addIssue=a=>{this.issues=[...this.issues,a]},this.addIssues=(a=[])=>{this.issues=[...this.issues,...a]};let s=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,s):this.__proto__=s,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let s=e||function(n){return n.message},a={_errors:[]},r=n=>{for(let o of n.issues)if(o.code==="invalid_union")o.unionErrors.map(r);else if(o.code==="invalid_return_type")r(o.returnTypeError);else if(o.code==="invalid_arguments")r(o.argumentsError);else if(o.path.length===0)a._errors.push(s(o));else{let i=a,d=0;for(;d<o.path.length;){let u=o.path[d];d===o.path.length-1?(i[u]=i[u]||{_errors:[]},i[u]._errors.push(s(o))):i[u]=i[u]||{_errors:[]},i=i[u],d++}}};return r(this),a}toString(){return this.message}get message(){return JSON.stringify(this.issues,I.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=s=>s.message){let s={},a=[];for(let r of this.issues)r.path.length>0?(s[r.path[0]]=s[r.path[0]]||[],s[r.path[0]].push(e(r))):a.push(e(r));return{formErrors:a,fieldErrors:s}}get formErrors(){return this.flatten()}};U.create=t=>new U(t);var je=(t,e)=>{let s;switch(t.code){case p.invalid_type:t.received===m.undefined?s="Required":s=`Expected ${t.expected}, received ${t.received}`;break;case p.invalid_literal:s=`Invalid literal value, expected ${JSON.stringify(t.expected,I.jsonStringifyReplacer)}`;break;case p.unrecognized_keys:s=`Unrecognized key(s) in object: ${I.joinValues(t.keys,", ")}`;break;case p.invalid_union:s="Invalid input";break;case p.invalid_union_discriminator:s=`Invalid discriminator value. Expected ${I.joinValues(t.options)}`;break;case p.invalid_enum_value:s=`Invalid enum value. Expected ${I.joinValues(t.options)}, received '${t.received}'`;break;case p.invalid_arguments:s="Invalid function arguments";break;case p.invalid_return_type:s="Invalid function return type";break;case p.invalid_date:s="Invalid date";break;case p.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(s=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(s=`${s} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?s=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?s=`Invalid input: must end with "${t.validation.endsWith}"`:I.assertNever(t.validation):t.validation!=="regex"?s=`Invalid ${t.validation}`:s="Invalid";break;case p.too_small:t.type==="array"?s=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?s=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?s=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?s=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:s="Invalid input";break;case p.too_big:t.type==="array"?s=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?s=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?s=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?s=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?s=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:s="Invalid input";break;case p.custom:s="Invalid input";break;case p.invalid_intersection_types:s="Intersection results could not be merged";break;case p.not_multiple_of:s=`Number must be a multiple of ${t.multipleOf}`;break;case p.not_finite:s="Number must be finite";break;default:s=e.defaultError,I.assertNever(t)}return{message:s}},Ut=je;function Hs(t){Ut=t}function Ue(){return Ut}var Ve=t=>{let{data:e,path:s,errorMaps:a,issueData:r}=t,n=[...s,...r.path||[]],o={...r,path:n},i="",d=a.filter(u=>!!u).slice().reverse();for(let u of d)i=u(o,{data:e,defaultError:i}).message;return{...r,path:n,message:r.message||i}},zs=[];function f(t,e){let s=Ve({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Ue(),je].filter(a=>!!a)});t.common.issues.push(s)}var O=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,s){let a=[];for(let r of s){if(r.status==="aborted")return E;r.status==="dirty"&&e.dirty(),a.push(r.value)}return{status:e.value,value:a}}static async mergeObjectAsync(e,s){let a=[];for(let r of s)a.push({key:await r.key,value:await r.value});return t.mergeObjectSync(e,a)}static mergeObjectSync(e,s){let a={};for(let r of s){let{key:n,value:o}=r;if(n.status==="aborted"||o.status==="aborted")return E;n.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),n.value!=="__proto__"&&(typeof o.value<"u"||r.alwaysSet)&&(a[n.value]=o.value)}return{status:e.value,value:a}}},E=Object.freeze({status:"aborted"}),Vt=t=>({status:"dirty",value:t}),L=t=>({status:"valid",value:t}),ut=t=>t.status==="aborted",mt=t=>t.status==="dirty",Ne=t=>t.status==="valid",Fe=t=>typeof Promise<"u"&&t instanceof Promise,h;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(h||(h={}));var B=class{constructor(e,s,a,r){this._cachedPath=[],this.parent=e,this.data=s,this._path=a,this._key=r}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Dt=(t,e)=>{if(Ne(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let s=new U(t.common.issues);return this._error=s,this._error}}};function T(t){if(!t)return{};let{errorMap:e,invalid_type_error:s,required_error:a,description:r}=t;if(e&&(s||a))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:r}:{errorMap:(o,i)=>o.code!=="invalid_type"?{message:i.defaultError}:typeof i.data>"u"?{message:a??i.defaultError}:{message:s??i.defaultError},description:r}}var S=class{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)}get description(){return this._def.description}_getType(e){return Q(e.data)}_getOrReturnCtx(e,s){return s||{common:e.parent.common,data:e.data,parsedType:Q(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new O,ctx:{common:e.parent.common,data:e.data,parsedType:Q(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let s=this._parse(e);if(Fe(s))throw new Error("Synchronous parse encountered promise.");return s}_parseAsync(e){let s=this._parse(e);return Promise.resolve(s)}parse(e,s){let a=this.safeParse(e,s);if(a.success)return a.data;throw a.error}safeParse(e,s){var a;let r={common:{issues:[],async:(a=s?.async)!==null&&a!==void 0?a:!1,contextualErrorMap:s?.errorMap},path:s?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Q(e)},n=this._parseSync({data:e,path:r.path,parent:r});return Dt(r,n)}async parseAsync(e,s){let a=await this.safeParseAsync(e,s);if(a.success)return a.data;throw a.error}async safeParseAsync(e,s){let a={common:{issues:[],contextualErrorMap:s?.errorMap,async:!0},path:s?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Q(e)},r=this._parse({data:e,path:a.path,parent:a}),n=await(Fe(r)?r:Promise.resolve(r));return Dt(a,n)}refine(e,s){let a=r=>typeof s=="string"||typeof s>"u"?{message:s}:typeof s=="function"?s(r):s;return this._refinement((r,n)=>{let o=e(r),i=()=>n.addIssue({code:p.custom,...a(r)});return typeof Promise<"u"&&o instanceof Promise?o.then(d=>d?!0:(i(),!1)):o?!0:(i(),!1)})}refinement(e,s){return this._refinement((a,r)=>e(a)?!0:(r.addIssue(typeof s=="function"?s(a,r):s),!1))}_refinement(e){return new V({schema:this,typeName:_.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return W.create(this,this._def)}nullable(){return q.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Y.create(this,this._def)}promise(){return te.create(this,this._def)}or(e){return de.create([this,e],this._def)}and(e){return pe.create(this,e,this._def)}transform(e){return new V({...T(this._def),schema:this,typeName:_.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let s=typeof e=="function"?e:()=>e;return new ge({...T(this._def),innerType:this,defaultValue:s,typeName:_.ZodDefault})}brand(){return new Ze({typeName:_.ZodBranded,type:this,...T(this._def)})}catch(e){let s=typeof e=="function"?e:()=>e;return new Ae({...T(this._def),innerType:this,catchValue:s,typeName:_.ZodCatch})}describe(e){let s=this.constructor;return new s({...this._def,description:e})}pipe(e){return ke.create(this,e)}readonly(){return xe.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Gs=/^c[^\s-]{8,}$/i,Ys=/^[a-z][a-z0-9]*$/,qs=/^[0-9A-HJKMNP-TV-Z]{26}$/,Js=/^[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,Qs=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Xs="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",dt,ea=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,ta=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,sa=t=>t.precision?t.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${t.precision}}Z$`):t.precision===0?t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):t.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");function aa(t,e){return!!((e==="v4"||!e)&&ea.test(t)||(e==="v6"||!e)&&ta.test(t))}var X=class t extends S{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==m.string){let n=this._getOrReturnCtx(e);return f(n,{code:p.invalid_type,expected:m.string,received:n.parsedType}),E}let a=new O,r;for(let n of this._def.checks)if(n.kind==="min")e.data.length<n.value&&(r=this._getOrReturnCtx(e,r),f(r,{code:p.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),a.dirty());else if(n.kind==="max")e.data.length>n.value&&(r=this._getOrReturnCtx(e,r),f(r,{code:p.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),a.dirty());else if(n.kind==="length"){let o=e.data.length>n.value,i=e.data.length<n.value;(o||i)&&(r=this._getOrReturnCtx(e,r),o?f(r,{code:p.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):i&&f(r,{code:p.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),a.dirty())}else if(n.kind==="email")Qs.test(e.data)||(r=this._getOrReturnCtx(e,r),f(r,{validation:"email",code:p.invalid_string,message:n.message}),a.dirty());else if(n.kind==="emoji")dt||(dt=new RegExp(Xs,"u")),dt.test(e.data)||(r=this._getOrReturnCtx(e,r),f(r,{validation:"emoji",code:p.invalid_string,message:n.message}),a.dirty());else if(n.kind==="uuid")Js.test(e.data)||(r=this._getOrReturnCtx(e,r),f(r,{validation:"uuid",code:p.invalid_string,message:n.message}),a.dirty());else if(n.kind==="cuid")Gs.test(e.data)||(r=this._getOrReturnCtx(e,r),f(r,{validation:"cuid",code:p.invalid_string,message:n.message}),a.dirty());else if(n.kind==="cuid2")Ys.test(e.data)||(r=this._getOrReturnCtx(e,r),f(r,{validation:"cuid2",code:p.invalid_string,message:n.message}),a.dirty());else if(n.kind==="ulid")qs.test(e.data)||(r=this._getOrReturnCtx(e,r),f(r,{validation:"ulid",code:p.invalid_string,message:n.message}),a.dirty());else if(n.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),f(r,{validation:"url",code:p.invalid_string,message:n.message}),a.dirty()}else n.kind==="regex"?(n.regex.lastIndex=0,n.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),f(r,{validation:"regex",code:p.invalid_string,message:n.message}),a.dirty())):n.kind==="trim"?e.data=e.data.trim():n.kind==="includes"?e.data.includes(n.value,n.position)||(r=this._getOrReturnCtx(e,r),f(r,{code:p.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),a.dirty()):n.kind==="toLowerCase"?e.data=e.data.toLowerCase():n.kind==="toUpperCase"?e.data=e.data.toUpperCase():n.kind==="startsWith"?e.data.startsWith(n.value)||(r=this._getOrReturnCtx(e,r),f(r,{code:p.invalid_string,validation:{startsWith:n.value},message:n.message}),a.dirty()):n.kind==="endsWith"?e.data.endsWith(n.value)||(r=this._getOrReturnCtx(e,r),f(r,{code:p.invalid_string,validation:{endsWith:n.value},message:n.message}),a.dirty()):n.kind==="datetime"?sa(n).test(e.data)||(r=this._getOrReturnCtx(e,r),f(r,{code:p.invalid_string,validation:"datetime",message:n.message}),a.dirty()):n.kind==="ip"?aa(e.data,n.version)||(r=this._getOrReturnCtx(e,r),f(r,{validation:"ip",code:p.invalid_string,message:n.message}),a.dirty()):I.assertNever(n);return{status:a.value,value:e.data}}_regex(e,s,a){return this.refinement(r=>e.test(r),{validation:s,code:p.invalid_string,...h.errToObj(a)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...h.errToObj(e)})}url(e){return this._addCheck({kind:"url",...h.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...h.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...h.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...h.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...h.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...h.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...h.errToObj(e)})}datetime(e){var s;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(s=e?.offset)!==null&&s!==void 0?s:!1,...h.errToObj(e?.message)})}regex(e,s){return this._addCheck({kind:"regex",regex:e,...h.errToObj(s)})}includes(e,s){return this._addCheck({kind:"includes",value:e,position:s?.position,...h.errToObj(s?.message)})}startsWith(e,s){return this._addCheck({kind:"startsWith",value:e,...h.errToObj(s)})}endsWith(e,s){return this._addCheck({kind:"endsWith",value:e,...h.errToObj(s)})}min(e,s){return this._addCheck({kind:"min",value:e,...h.errToObj(s)})}max(e,s){return this._addCheck({kind:"max",value:e,...h.errToObj(s)})}length(e,s){return this._addCheck({kind:"length",value:e,...h.errToObj(s)})}nonempty(e){return this.min(1,h.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}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 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 minLength(){let e=null;for(let s of this._def.checks)s.kind==="min"&&(e===null||s.value>e)&&(e=s.value);return e}get maxLength(){let e=null;for(let s of this._def.checks)s.kind==="max"&&(e===null||s.value<e)&&(e=s.value);return e}};X.create=t=>{var e;return new X({checks:[],typeName:_.ZodString,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...T(t)})};function ra(t,e){let s=(t.toString().split(".")[1]||"").length,a=(e.toString().split(".")[1]||"").length,r=s>a?s:a,n=parseInt(t.toFixed(r).replace(".","")),o=parseInt(e.toFixed(r).replace(".",""));return n%o/Math.pow(10,r)}var re=class t extends S{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)!==m.number){let n=this._getOrReturnCtx(e);return f(n,{code:p.invalid_type,expected:m.number,received:n.parsedType}),E}let a,r=new O;for(let n of this._def.checks)n.kind==="int"?I.isInteger(e.data)||(a=this._getOrReturnCtx(e,a),f(a,{code:p.invalid_type,expected:"integer",received:"float",message:n.message}),r.dirty()):n.kind==="min"?(n.inclusive?e.data<n.value:e.data<=n.value)&&(a=this._getOrReturnCtx(e,a),f(a,{code:p.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty()):n.kind==="max"?(n.inclusive?e.data>n.value:e.data>=n.value)&&(a=this._getOrReturnCtx(e,a),f(a,{code:p.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty()):n.kind==="multipleOf"?ra(e.data,n.value)!==0&&(a=this._getOrReturnCtx(e,a),f(a,{code:p.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):n.kind==="finite"?Number.isFinite(e.data)||(a=this._getOrReturnCtx(e,a),f(a,{code:p.not_finite,message:n.message}),r.dirty()):I.assertNever(n);return{status:r.value,value:e.data}}gte(e,s){return this.setLimit("min",e,!0,h.toString(s))}gt(e,s){return this.setLimit("min",e,!1,h.toString(s))}lte(e,s){return this.setLimit("max",e,!0,h.toString(s))}lt(e,s){return this.setLimit("max",e,!1,h.toString(s))}setLimit(e,s,a,r){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:s,inclusive:a,message:h.toString(r)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:h.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:h.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:h.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:h.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:h.toString(e)})}multipleOf(e,s){return this._addCheck({kind:"multipleOf",value:e,message:h.toString(s)})}finite(e){return this._addCheck({kind:"finite",message:h.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:h.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:h.toString(e)})}get minValue(){let e=null;for(let s of this._def.checks)s.kind==="min"&&(e===null||s.value>e)&&(e=s.value);return e}get maxValue(){let e=null;for(let s of this._def.checks)s.kind==="max"&&(e===null||s.value<e)&&(e=s.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,s=null;for(let a of this._def.checks){if(a.kind==="finite"||a.kind==="int"||a.kind==="multipleOf")return!0;a.kind==="min"?(s===null||a.value>s)&&(s=a.value):a.kind==="max"&&(e===null||a.value<e)&&(e=a.value)}return Number.isFinite(s)&&Number.isFinite(e)}};re.create=t=>new re({checks:[],typeName:_.ZodNumber,coerce:t?.coerce||!1,...T(t)});var ne=class t extends S{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==m.bigint){let n=this._getOrReturnCtx(e);return f(n,{code:p.invalid_type,expected:m.bigint,received:n.parsedType}),E}let a,r=new O;for(let n of this._def.checks)n.kind==="min"?(n.inclusive?e.data<n.value:e.data<=n.value)&&(a=this._getOrReturnCtx(e,a),f(a,{code:p.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty()):n.kind==="max"?(n.inclusive?e.data>n.value:e.data>=n.value)&&(a=this._getOrReturnCtx(e,a),f(a,{code:p.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty()):n.kind==="multipleOf"?e.data%n.value!==BigInt(0)&&(a=this._getOrReturnCtx(e,a),f(a,{code:p.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):I.assertNever(n);return{status:r.value,value:e.data}}gte(e,s){return this.setLimit("min",e,!0,h.toString(s))}gt(e,s){return this.setLimit("min",e,!1,h.toString(s))}lte(e,s){return this.setLimit("max",e,!0,h.toString(s))}lt(e,s){return this.setLimit("max",e,!1,h.toString(s))}setLimit(e,s,a,r){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:s,inclusive:a,message:h.toString(r)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:h.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:h.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:h.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:h.toString(e)})}multipleOf(e,s){return this._addCheck({kind:"multipleOf",value:e,message:h.toString(s)})}get minValue(){let e=null;for(let s of this._def.checks)s.kind==="min"&&(e===null||s.value>e)&&(e=s.value);return e}get maxValue(){let e=null;for(let s of this._def.checks)s.kind==="max"&&(e===null||s.value<e)&&(e=s.value);return e}};ne.create=t=>{var e;return new ne({checks:[],typeName:_.ZodBigInt,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...T(t)})};var oe=class extends S{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==m.boolean){let a=this._getOrReturnCtx(e);return f(a,{code:p.invalid_type,expected:m.boolean,received:a.parsedType}),E}return L(e.data)}};oe.create=t=>new oe({typeName:_.ZodBoolean,coerce:t?.coerce||!1,...T(t)});var ie=class t extends S{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==m.date){let n=this._getOrReturnCtx(e);return f(n,{code:p.invalid_type,expected:m.date,received:n.parsedType}),E}if(isNaN(e.data.getTime())){let n=this._getOrReturnCtx(e);return f(n,{code:p.invalid_date}),E}let a=new O,r;for(let n of this._def.checks)n.kind==="min"?e.data.getTime()<n.value&&(r=this._getOrReturnCtx(e,r),f(r,{code:p.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),a.dirty()):n.kind==="max"?e.data.getTime()>n.value&&(r=this._getOrReturnCtx(e,r),f(r,{code:p.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),a.dirty()):I.assertNever(n);return{status:a.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,s){return this._addCheck({kind:"min",value:e.getTime(),message:h.toString(s)})}max(e,s){return this._addCheck({kind:"max",value:e.getTime(),message:h.toString(s)})}get minDate(){let e=null;for(let s of this._def.checks)s.kind==="min"&&(e===null||s.value>e)&&(e=s.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let s of this._def.checks)s.kind==="max"&&(e===null||s.value<e)&&(e=s.value);return e!=null?new Date(e):null}};ie.create=t=>new ie({checks:[],coerce:t?.coerce||!1,typeName:_.ZodDate,...T(t)});var Se=class extends S{_parse(e){if(this._getType(e)!==m.symbol){let a=this._getOrReturnCtx(e);return f(a,{code:p.invalid_type,expected:m.symbol,received:a.parsedType}),E}return L(e.data)}};Se.create=t=>new Se({typeName:_.ZodSymbol,...T(t)});var ce=class extends S{_parse(e){if(this._getType(e)!==m.undefined){let a=this._getOrReturnCtx(e);return f(a,{code:p.invalid_type,expected:m.undefined,received:a.parsedType}),E}return L(e.data)}};ce.create=t=>new ce({typeName:_.ZodUndefined,...T(t)});var le=class extends S{_parse(e){if(this._getType(e)!==m.null){let a=this._getOrReturnCtx(e);return f(a,{code:p.invalid_type,expected:m.null,received:a.parsedType}),E}return L(e.data)}};le.create=t=>new le({typeName:_.ZodNull,...T(t)});var ee=class extends S{constructor(){super(...arguments),this._any=!0}_parse(e){return L(e.data)}};ee.create=t=>new ee({typeName:_.ZodAny,...T(t)});var G=class extends S{constructor(){super(...arguments),this._unknown=!0}_parse(e){return L(e.data)}};G.create=t=>new G({typeName:_.ZodUnknown,...T(t)});var K=class extends S{_parse(e){let s=this._getOrReturnCtx(e);return f(s,{code:p.invalid_type,expected:m.never,received:s.parsedType}),E}};K.create=t=>new K({typeName:_.ZodNever,...T(t)});var Ce=class extends S{_parse(e){if(this._getType(e)!==m.undefined){let a=this._getOrReturnCtx(e);return f(a,{code:p.invalid_type,expected:m.void,received:a.parsedType}),E}return L(e.data)}};Ce.create=t=>new Ce({typeName:_.ZodVoid,...T(t)});var Y=class t extends S{_parse(e){let{ctx:s,status:a}=this._processInputParams(e),r=this._def;if(s.parsedType!==m.array)return f(s,{code:p.invalid_type,expected:m.array,received:s.parsedType}),E;if(r.exactLength!==null){let o=s.data.length>r.exactLength.value,i=s.data.length<r.exactLength.value;(o||i)&&(f(s,{code:o?p.too_big:p.too_small,minimum:i?r.exactLength.value:void 0,maximum:o?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),a.dirty())}if(r.minLength!==null&&s.data.length<r.minLength.value&&(f(s,{code:p.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),a.dirty()),r.maxLength!==null&&s.data.length>r.maxLength.value&&(f(s,{code:p.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),a.dirty()),s.common.async)return Promise.all([...s.data].map((o,i)=>r.type._parseAsync(new B(s,o,s.path,i)))).then(o=>O.mergeArray(a,o));let n=[...s.data].map((o,i)=>r.type._parseSync(new B(s,o,s.path,i)));return O.mergeArray(a,n)}get element(){return this._def.type}min(e,s){return new t({...this._def,minLength:{value:e,message:h.toString(s)}})}max(e,s){return new t({...this._def,maxLength:{value:e,message:h.toString(s)}})}length(e,s){return new t({...this._def,exactLength:{value:e,message:h.toString(s)}})}nonempty(e){return this.min(1,e)}};Y.create=(t,e)=>new Y({type:t,minLength:null,maxLength:null,exactLength:null,typeName:_.ZodArray,...T(e)});function Te(t){if(t instanceof $){let e={};for(let s in t.shape){let a=t.shape[s];e[s]=W.create(Te(a))}return new $({...t._def,shape:()=>e})}else return t instanceof Y?new Y({...t._def,type:Te(t.element)}):t instanceof W?W.create(Te(t.unwrap())):t instanceof q?q.create(Te(t.unwrap())):t instanceof Z?Z.create(t.items.map(e=>Te(e))):t}var $=class t extends S{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(),s=I.objectKeys(e);return this._cached={shape:e,keys:s}}_parse(e){if(this._getType(e)!==m.object){let u=this._getOrReturnCtx(e);return f(u,{code:p.invalid_type,expected:m.object,received:u.parsedType}),E}let{status:a,ctx:r}=this._processInputParams(e),{shape:n,keys:o}=this._getCached(),i=[];if(!(this._def.catchall instanceof K&&this._def.unknownKeys==="strip"))for(let u in r.data)o.includes(u)||i.push(u);let d=[];for(let u of o){let g=n[u],b=r.data[u];d.push({key:{status:"valid",value:u},value:g._parse(new B(r,b,r.path,u)),alwaysSet:u in r.data})}if(this._def.catchall instanceof K){let u=this._def.unknownKeys;if(u==="passthrough")for(let g of i)d.push({key:{status:"valid",value:g},value:{status:"valid",value:r.data[g]}});else if(u==="strict")i.length>0&&(f(r,{code:p.unrecognized_keys,keys:i}),a.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let g of i){let b=r.data[g];d.push({key:{status:"valid",value:g},value:u._parse(new B(r,b,r.path,g)),alwaysSet:g in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let u=[];for(let g of d){let b=await g.key;u.push({key:b,value:await g.value,alwaysSet:g.alwaysSet})}return u}).then(u=>O.mergeObjectSync(a,u)):O.mergeObjectSync(a,d)}get shape(){return this._def.shape()}strict(e){return h.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(s,a)=>{var r,n,o,i;let d=(o=(n=(r=this._def).errorMap)===null||n===void 0?void 0:n.call(r,s,a).message)!==null&&o!==void 0?o:a.defaultError;return s.code==="unrecognized_keys"?{message:(i=h.errToObj(e).message)!==null&&i!==void 0?i:d}:{message:d}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:_.ZodObject})}setKey(e,s){return this.augment({[e]:s})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let s={};return I.objectKeys(e).forEach(a=>{e[a]&&this.shape[a]&&(s[a]=this.shape[a])}),new t({...this._def,shape:()=>s})}omit(e){let s={};return I.objectKeys(this.shape).forEach(a=>{e[a]||(s[a]=this.shape[a])}),new t({...this._def,shape:()=>s})}deepPartial(){return Te(this)}partial(e){let s={};return I.objectKeys(this.shape).forEach(a=>{let r=this.shape[a];e&&!e[a]?s[a]=r:s[a]=r.optional()}),new t({...this._def,shape:()=>s})}required(e){let s={};return I.objectKeys(this.shape).forEach(a=>{if(e&&!e[a])s[a]=this.shape[a];else{let n=this.shape[a];for(;n instanceof W;)n=n._def.innerType;s[a]=n}}),new t({...this._def,shape:()=>s})}keyof(){return Ft(I.objectKeys(this.shape))}};$.create=(t,e)=>new $({shape:()=>t,unknownKeys:"strip",catchall:K.create(),typeName:_.ZodObject,...T(e)});$.strictCreate=(t,e)=>new $({shape:()=>t,unknownKeys:"strict",catchall:K.create(),typeName:_.ZodObject,...T(e)});$.lazycreate=(t,e)=>new $({shape:t,unknownKeys:"strip",catchall:K.create(),typeName:_.ZodObject,...T(e)});var de=class extends S{_parse(e){let{ctx:s}=this._processInputParams(e),a=this._def.options;function r(n){for(let i of n)if(i.result.status==="valid")return i.result;for(let i of n)if(i.result.status==="dirty")return s.common.issues.push(...i.ctx.common.issues),i.result;let o=n.map(i=>new U(i.ctx.common.issues));return f(s,{code:p.invalid_union,unionErrors:o}),E}if(s.common.async)return Promise.all(a.map(async n=>{let o={...s,common:{...s.common,issues:[]},parent:null};return{result:await n._parseAsync({data:s.data,path:s.path,parent:o}),ctx:o}})).then(r);{let n,o=[];for(let d of a){let u={...s,common:{...s.common,issues:[]},parent:null},g=d._parseSync({data:s.data,path:s.path,parent:u});if(g.status==="valid")return g;g.status==="dirty"&&!n&&(n={result:g,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(n)return s.common.issues.push(...n.ctx.common.issues),n.result;let i=o.map(d=>new U(d));return f(s,{code:p.invalid_union,unionErrors:i}),E}}get options(){return this._def.options}};de.create=(t,e)=>new de({options:t,typeName:_.ZodUnion,...T(e)});var Me=t=>t instanceof ue?Me(t.schema):t instanceof V?Me(t.innerType()):t instanceof me?[t.value]:t instanceof fe?t.options:t instanceof he?Object.keys(t.enum):t instanceof ge?Me(t._def.innerType):t instanceof ce?[void 0]:t instanceof le?[null]:null,Be=class t extends S{_parse(e){let{ctx:s}=this._processInputParams(e);if(s.parsedType!==m.object)return f(s,{code:p.invalid_type,expected:m.object,received:s.parsedType}),E;let a=this.discriminator,r=s.data[a],n=this.optionsMap.get(r);return n?s.common.async?n._parseAsync({data:s.data,path:s.path,parent:s}):n._parseSync({data:s.data,path:s.path,parent:s}):(f(s,{code:p.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[a]}),E)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,s,a){let r=new Map;for(let n of s){let o=Me(n.shape[e]);if(!o)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let i of o){if(r.has(i))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);r.set(i,n)}}return new t({typeName:_.ZodDiscriminatedUnion,discriminator:e,options:s,optionsMap:r,...T(a)})}};function ft(t,e){let s=Q(t),a=Q(e);if(t===e)return{valid:!0,data:t};if(s===m.object&&a===m.object){let r=I.objectKeys(e),n=I.objectKeys(t).filter(i=>r.indexOf(i)!==-1),o={...t,...e};for(let i of n){let d=ft(t[i],e[i]);if(!d.valid)return{valid:!1};o[i]=d.data}return{valid:!0,data:o}}else if(s===m.array&&a===m.array){if(t.length!==e.length)return{valid:!1};let r=[];for(let n=0;n<t.length;n++){let o=t[n],i=e[n],d=ft(o,i);if(!d.valid)return{valid:!1};r.push(d.data)}return{valid:!0,data:r}}else return s===m.date&&a===m.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var pe=class extends S{_parse(e){let{status:s,ctx:a}=this._processInputParams(e),r=(n,o)=>{if(ut(n)||ut(o))return E;let i=ft(n.value,o.value);return i.valid?((mt(n)||mt(o))&&s.dirty(),{status:s.value,value:i.data}):(f(a,{code:p.invalid_intersection_types}),E)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then(([n,o])=>r(n,o)):r(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}};pe.create=(t,e,s)=>new pe({left:t,right:e,typeName:_.ZodIntersection,...T(s)});var Z=class t extends S{_parse(e){let{status:s,ctx:a}=this._processInputParams(e);if(a.parsedType!==m.array)return f(a,{code:p.invalid_type,expected:m.array,received:a.parsedType}),E;if(a.data.length<this._def.items.length)return f(a,{code:p.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),E;!this._def.rest&&a.data.length>this._def.items.length&&(f(a,{code:p.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),s.dirty());let n=[...a.data].map((o,i)=>{let d=this._def.items[i]||this._def.rest;return d?d._parse(new B(a,o,a.path,i)):null}).filter(o=>!!o);return a.common.async?Promise.all(n).then(o=>O.mergeArray(s,o)):O.mergeArray(s,n)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};Z.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Z({items:t,typeName:_.ZodTuple,rest:null,...T(e)})};var We=class t extends S{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:s,ctx:a}=this._processInputParams(e);if(a.parsedType!==m.object)return f(a,{code:p.invalid_type,expected:m.object,received:a.parsedType}),E;let r=[],n=this._def.keyType,o=this._def.valueType;for(let i in a.data)r.push({key:n._parse(new B(a,i,a.path,i)),value:o._parse(new B(a,a.data[i],a.path,i))});return a.common.async?O.mergeObjectAsync(s,r):O.mergeObjectSync(s,r)}get element(){return this._def.valueType}static create(e,s,a){return s instanceof S?new t({keyType:e,valueType:s,typeName:_.ZodRecord,...T(a)}):new t({keyType:X.create(),valueType:e,typeName:_.ZodRecord,...T(s)})}},be=class extends S{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:s,ctx:a}=this._processInputParams(e);if(a.parsedType!==m.map)return f(a,{code:p.invalid_type,expected:m.map,received:a.parsedType}),E;let r=this._def.keyType,n=this._def.valueType,o=[...a.data.entries()].map(([i,d],u)=>({key:r._parse(new B(a,i,a.path,[u,"key"])),value:n._parse(new B(a,d,a.path,[u,"value"]))}));if(a.common.async){let i=new Map;return Promise.resolve().then(async()=>{for(let d of o){let u=await d.key,g=await d.value;if(u.status==="aborted"||g.status==="aborted")return E;(u.status==="dirty"||g.status==="dirty")&&s.dirty(),i.set(u.value,g.value)}return{status:s.value,value:i}})}else{let i=new Map;for(let d of o){let u=d.key,g=d.value;if(u.status==="aborted"||g.status==="aborted")return E;(u.status==="dirty"||g.status==="dirty")&&s.dirty(),i.set(u.value,g.value)}return{status:s.value,value:i}}}};be.create=(t,e,s)=>new be({valueType:e,keyType:t,typeName:_.ZodMap,...T(s)});var Ie=class t extends S{_parse(e){let{status:s,ctx:a}=this._processInputParams(e);if(a.parsedType!==m.set)return f(a,{code:p.invalid_type,expected:m.set,received:a.parsedType}),E;let r=this._def;r.minSize!==null&&a.data.size<r.minSize.value&&(f(a,{code:p.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),s.dirty()),r.maxSize!==null&&a.data.size>r.maxSize.value&&(f(a,{code:p.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),s.dirty());let n=this._def.valueType;function o(d){let u=new Set;for(let g of d){if(g.status==="aborted")return E;g.status==="dirty"&&s.dirty(),u.add(g.value)}return{status:s.value,value:u}}let i=[...a.data.values()].map((d,u)=>n._parse(new B(a,d,a.path,u)));return a.common.async?Promise.all(i).then(d=>o(d)):o(i)}min(e,s){return new t({...this._def,minSize:{value:e,message:h.toString(s)}})}max(e,s){return new t({...this._def,maxSize:{value:e,message:h.toString(s)}})}size(e,s){return this.min(e,s).max(e,s)}nonempty(e){return this.min(1,e)}};Ie.create=(t,e)=>new Ie({valueType:t,minSize:null,maxSize:null,typeName:_.ZodSet,...T(e)});var Ke=class t extends S{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:s}=this._processInputParams(e);if(s.parsedType!==m.function)return f(s,{code:p.invalid_type,expected:m.function,received:s.parsedType}),E;function a(i,d){return Ve({data:i,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,Ue(),je].filter(u=>!!u),issueData:{code:p.invalid_arguments,argumentsError:d}})}function r(i,d){return Ve({data:i,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,Ue(),je].filter(u=>!!u),issueData:{code:p.invalid_return_type,returnTypeError:d}})}let n={errorMap:s.common.contextualErrorMap},o=s.data;if(this._def.returns instanceof te){let i=this;return L(async function(...d){let u=new U([]),g=await i._def.args.parseAsync(d,n).catch(_e=>{throw u.addIssue(a(d,_e)),u}),b=await Reflect.apply(o,this,g);return await i._def.returns._def.type.parseAsync(b,n).catch(_e=>{throw u.addIssue(r(b,_e)),u})})}else{let i=this;return L(function(...d){let u=i._def.args.safeParse(d,n);if(!u.success)throw new U([a(d,u.error)]);let g=Reflect.apply(o,this,u.data),b=i._def.returns.safeParse(g,n);if(!b.success)throw new U([r(g,b.error)]);return b.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:Z.create(e).rest(G.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,s,a){return new t({args:e||Z.create([]).rest(G.create()),returns:s||G.create(),typeName:_.ZodFunction,...T(a)})}},ue=class extends S{get schema(){return this._def.getter()}_parse(e){let{ctx:s}=this._processInputParams(e);return this._def.getter()._parse({data:s.data,path:s.path,parent:s})}};ue.create=(t,e)=>new ue({getter:t,typeName:_.ZodLazy,...T(e)});var me=class extends S{_parse(e){if(e.data!==this._def.value){let s=this._getOrReturnCtx(e);return f(s,{received:s.data,code:p.invalid_literal,expected:this._def.value}),E}return{status:"valid",value:e.data}}get value(){return this._def.value}};me.create=(t,e)=>new me({value:t,typeName:_.ZodLiteral,...T(e)});function Ft(t,e){return new fe({values:t,typeName:_.ZodEnum,...T(e)})}var fe=class t extends S{_parse(e){if(typeof e.data!="string"){let s=this._getOrReturnCtx(e),a=this._def.values;return f(s,{expected:I.joinValues(a),received:s.parsedType,code:p.invalid_type}),E}if(this._def.values.indexOf(e.data)===-1){let s=this._getOrReturnCtx(e),a=this._def.values;return f(s,{received:s.data,code:p.invalid_enum_value,options:a}),E}return L(e.data)}get options(){return this._def.values}get enum(){let e={};for(let s of this._def.values)e[s]=s;return e}get Values(){let e={};for(let s of this._def.values)e[s]=s;return e}get Enum(){let e={};for(let s of this._def.values)e[s]=s;return e}extract(e){return t.create(e)}exclude(e){return t.create(this.options.filter(s=>!e.includes(s)))}};fe.create=Ft;var he=class extends S{_parse(e){let s=I.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(e);if(a.parsedType!==m.string&&a.parsedType!==m.number){let r=I.objectValues(s);return f(a,{expected:I.joinValues(r),received:a.parsedType,code:p.invalid_type}),E}if(s.indexOf(e.data)===-1){let r=I.objectValues(s);return f(a,{received:a.data,code:p.invalid_enum_value,options:r}),E}return L(e.data)}get enum(){return this._def.values}};he.create=(t,e)=>new he({values:t,typeName:_.ZodNativeEnum,...T(e)});var te=class extends S{unwrap(){return this._def.type}_parse(e){let{ctx:s}=this._processInputParams(e);if(s.parsedType!==m.promise&&s.common.async===!1)return f(s,{code:p.invalid_type,expected:m.promise,received:s.parsedType}),E;let a=s.parsedType===m.promise?s.data:Promise.resolve(s.data);return L(a.then(r=>this._def.type.parseAsync(r,{path:s.path,errorMap:s.common.contextualErrorMap})))}};te.create=(t,e)=>new te({type:t,typeName:_.ZodPromise,...T(e)});var V=class extends S{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===_.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:s,ctx:a}=this._processInputParams(e),r=this._def.effect||null,n={addIssue:o=>{f(a,o),o.fatal?s.abort():s.dirty()},get path(){return a.path}};if(n.addIssue=n.addIssue.bind(n),r.type==="preprocess"){let o=r.transform(a.data,n);return a.common.issues.length?{status:"dirty",value:a.data}:a.common.async?Promise.resolve(o).then(i=>this._def.schema._parseAsync({data:i,path:a.path,parent:a})):this._def.schema._parseSync({data:o,path:a.path,parent:a})}if(r.type==="refinement"){let o=i=>{let d=r.refinement(i,n);if(a.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return i};if(a.common.async===!1){let i=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return i.status==="aborted"?E:(i.status==="dirty"&&s.dirty(),o(i.value),{status:s.value,value:i.value})}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(i=>i.status==="aborted"?E:(i.status==="dirty"&&s.dirty(),o(i.value).then(()=>({status:s.value,value:i.value}))))}if(r.type==="transform")if(a.common.async===!1){let o=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!Ne(o))return o;let i=r.transform(o.value,n);if(i instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:s.value,value:i}}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(o=>Ne(o)?Promise.resolve(r.transform(o.value,n)).then(i=>({status:s.value,value:i})):o);I.assertNever(r)}};V.create=(t,e,s)=>new V({schema:t,typeName:_.ZodEffects,effect:e,...T(s)});V.createWithPreprocess=(t,e,s)=>new V({schema:e,effect:{type:"preprocess",transform:t},typeName:_.ZodEffects,...T(s)});var W=class extends S{_parse(e){return this._getType(e)===m.undefined?L(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};W.create=(t,e)=>new W({innerType:t,typeName:_.ZodOptional,...T(e)});var q=class extends S{_parse(e){return this._getType(e)===m.null?L(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};q.create=(t,e)=>new q({innerType:t,typeName:_.ZodNullable,...T(e)});var ge=class extends S{_parse(e){let{ctx:s}=this._processInputParams(e),a=s.data;return s.parsedType===m.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:s.path,parent:s})}removeDefault(){return this._def.innerType}};ge.create=(t,e)=>new ge({innerType:t,typeName:_.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...T(e)});var Ae=class extends S{_parse(e){let{ctx:s}=this._processInputParams(e),a={...s,common:{...s.common,issues:[]}},r=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return Fe(r)?r.then(n=>({status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new U(a.common.issues)},input:a.data})})):{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new U(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}};Ae.create=(t,e)=>new Ae({innerType:t,typeName:_.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...T(e)});var Pe=class extends S{_parse(e){if(this._getType(e)!==m.nan){let a=this._getOrReturnCtx(e);return f(a,{code:p.invalid_type,expected:m.nan,received:a.parsedType}),E}return{status:"valid",value:e.data}}};Pe.create=t=>new Pe({typeName:_.ZodNaN,...T(t)});var na=Symbol("zod_brand"),Ze=class extends S{_parse(e){let{ctx:s}=this._processInputParams(e),a=s.data;return this._def.type._parse({data:a,path:s.path,parent:s})}unwrap(){return this._def.type}},ke=class t extends S{_parse(e){let{status:s,ctx:a}=this._processInputParams(e);if(a.common.async)return(async()=>{let n=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return n.status==="aborted"?E:n.status==="dirty"?(s.dirty(),Vt(n.value)):this._def.out._parseAsync({data:n.value,path:a.path,parent:a})})();{let r=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return r.status==="aborted"?E:r.status==="dirty"?(s.dirty(),{status:"dirty",value:r.value}):this._def.out._parseSync({data:r.value,path:a.path,parent:a})}}static create(e,s){return new t({in:e,out:s,typeName:_.ZodPipeline})}},xe=class extends S{_parse(e){let s=this._def.innerType._parse(e);return Ne(s)&&(s.value=Object.freeze(s.value)),s}};xe.create=(t,e)=>new xe({innerType:t,typeName:_.ZodReadonly,...T(e)});var Bt=(t,e={},s)=>t?ee.create().superRefine((a,r)=>{var n,o;if(!t(a)){let i=typeof e=="function"?e(a):typeof e=="string"?{message:e}:e,d=(o=(n=i.fatal)!==null&&n!==void 0?n:s)!==null&&o!==void 0?o:!0,u=typeof i=="string"?{message:i}:i;r.addIssue({code:"custom",...u,fatal:d})}}):ee.create(),oa={object:$.lazycreate},_;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(_||(_={}));var ia=(t,e={message:`Input not instance of ${t.name}`})=>Bt(s=>s instanceof t,e),Wt=X.create,Kt=re.create,ca=Pe.create,la=ne.create,Zt=oe.create,da=ie.create,pa=Se.create,ua=ce.create,ma=le.create,fa=ee.create,ha=G.create,ga=K.create,ya=Ce.create,_a=Y.create,va=$.create,Ea=$.strictCreate,Ta=de.create,Sa=Be.create,Ca=pe.create,ba=Z.create,Ia=We.create,Aa=be.create,Pa=Ie.create,xa=Ke.create,wa=ue.create,Ra=me.create,ja=fe.create,Na=he.create,ka=te.create,Mt=V.create,Oa=W.create,La=q.create,$a=V.createWithPreprocess,Da=ke.create,Ma=()=>Wt().optional(),Ua=()=>Kt().optional(),Va=()=>Zt().optional(),Fa={string:t=>X.create({...t,coerce:!0}),number:t=>re.create({...t,coerce:!0}),boolean:t=>oe.create({...t,coerce:!0}),bigint:t=>ne.create({...t,coerce:!0}),date:t=>ie.create({...t,coerce:!0})},Ba=E,v=Object.freeze({__proto__:null,defaultErrorMap:je,setErrorMap:Hs,getErrorMap:Ue,makeIssue:Ve,EMPTY_PATH:zs,addIssueToContext:f,ParseStatus:O,INVALID:E,DIRTY:Vt,OK:L,isAborted:ut,isDirty:mt,isValid:Ne,isAsync:Fe,get util(){return I},get objectUtil(){return pt},ZodParsedType:m,getParsedType:Q,ZodType:S,ZodString:X,ZodNumber:re,ZodBigInt:ne,ZodBoolean:oe,ZodDate:ie,ZodSymbol:Se,ZodUndefined:ce,ZodNull:le,ZodAny:ee,ZodUnknown:G,ZodNever:K,ZodVoid:Ce,ZodArray:Y,ZodObject:$,ZodUnion:de,ZodDiscriminatedUnion:Be,ZodIntersection:pe,ZodTuple:Z,ZodRecord:We,ZodMap:be,ZodSet:Ie,ZodFunction:Ke,ZodLazy:ue,ZodLiteral:me,ZodEnum:fe,ZodNativeEnum:he,ZodPromise:te,ZodEffects:V,ZodTransformer:V,ZodOptional:W,ZodNullable:q,ZodDefault:ge,ZodCatch:Ae,ZodNaN:Pe,BRAND:na,ZodBranded:Ze,ZodPipeline:ke,ZodReadonly:xe,custom:Bt,Schema:S,ZodSchema:S,late:oa,get ZodFirstPartyTypeKind(){return _},coerce:Fa,any:fa,array:_a,bigint:la,boolean:Zt,date:da,discriminatedUnion:Sa,effect:Mt,enum:ja,function:xa,instanceof:ia,intersection:Ca,lazy:wa,literal:Ra,map:Aa,nan:ca,nativeEnum:Na,never:ga,null:ma,nullable:La,number:Kt,object:va,oboolean:Va,onumber:Ua,optional:Oa,ostring:Ma,pipeline:Da,preprocess:$a,promise:ka,record:Ia,set:Pa,strictObject:Ea,string:Wt,symbol:pa,transformer:Mt,tuple:ba,undefined:ua,union:Ta,unknown:ha,void:ya,NEVER:Ba,ZodIssueCode:p,quotelessJson:Zs,ZodError:U});l();l();var Ht={CROSSMINT_EUROPE:"crossmint-europe",CROSSMINT_HORIZON:"crossmint-horizon"};l();var Wa=v.object({providerType:v.literal("openpayd"),providerClientId:v.string(),providerAccountId:v.string()}),zt=v.discriminatedUnion("providerType",[Wa]);l();var Ka=v.object({providerType:v.literal("openpayd"),providerBeneficiaryId:v.string().uuid()}),Gt=v.discriminatedUnion("providerType",[Ka]);var Za=v.object({whitelabelWalletAPI:v.boolean(),whitelabelCheckoutAPI:v.boolean(),billingAPI:v.boolean(),ethereumMintAPI:v.boolean(),baseMintAPI:v.boolean().optional(),subprojectCreation:v.object({enabled:v.boolean(),KYCOwnership:v.enum(["crossmint","developer"])}).optional(),mintAPIBYOC:v.boolean().optional(),mintAPITransferable:v.boolean().optional(),mintAPIUserIdBasedMintRecipient:v.boolean().optional(),embeddedCheckout:v.boolean().optional(),batchMintAPI:v.boolean().optional(),spamPlan:v.enum(["simple","advanced"]).optional(),paymentsMintToProjectScopedWallets:v.boolean().optional(),nonCustodialWallets:v.boolean().optional(),registerExternalCollections:v.boolean().optional(),mintAPIMaxReuploadFileSizeMB:v.number().optional(),solanaNonCompressedMint:v.boolean().optional(),solanaSFTMint:v.boolean().optional(),subscriptions:v.boolean().optional(),memeTokensCheckout:v.boolean().optional(),onrampCheckout:v.boolean().optional(),worldstore:v.object({sellerId:v.string().optional()}).optional(),onrampB2B:v.object({legalEntityName:v.string(),crossmintEntity:v.nativeEnum(Ht),crossmintReference:v.string().regex(/^\d{3}$/),provider:zt}).optional(),offrampB2B:v.object({provider:Gt,transactionLimit:v.number().min(1)}).optional(),payWithCryptoNativePassthrough:v.boolean().optional(),tokenizedCard:v.boolean().optional(),walletsMoneyTransfers:v.boolean().optional(),checkoutEnabled:v.boolean(),treasuryWallets:v.boolean().optional()}),J=(t=>(t.WHITELABEL_WALLET_API="whitelabelWalletAPI",t.WHITELABEL_CHECKOUT_API="whitelabelCheckoutAPI",t.BILLING_API="billingAPI",t.SUBSCRIPTIONS="subscriptions",t.PROJECT_TRANSFERS="walletsMoneyTransfers",t))(J||{});var N={GET:"GET",POST:"POST",PUT:"PUT",DELETE:"DELETE",PATCH:"PATCH",HEAD:"HEAD",OPTIONS:"OPTIONS",CONNECT:"CONNECT",TRACE:"TRACE"},Ha=De(N);l();l();var za=Object.defineProperty,c=(t,e)=>za(t,"name",{value:e,configurable:!0});l();l();var Ga=Object.defineProperty,C=(t,e)=>Ga(t,"name",{value:e,configurable:!0});function H(t){return t.charAt(0).toUpperCase()+t.slice(1)}C(H,"capitalizeFirstLetter");function z(t){return!t||t.length===0||t.trim().length===0}C(z,"isEmpty");function qt(t,e){return t.length<=e?t:t.slice(0,e)+"\u2026"}C(qt,"cutAndAddEllipsis");function Jt(t,e=4,s=4){return t.length<=e+s?t:t.slice(0,e)+"\u2026"+t.slice(s*-1)}C(Jt,"cutMiddleAndAddEllipsis");function Qt(){return(Math.random()+1).toString(36).substring(7)}C(Qt,"randomString");function Xt(t){let e=t.length,s=0,a=0;if(e>0)for(;a<e;)s=(s<<5)-s+t.charCodeAt(a++)|0;return s}C(Xt,"hashCode");var Yt=1e3;function es(t){return t.length<=Yt?t:t.slice(0,Yt)+"<truncated>"}C(es,"truncateForLog");function ts(t){return!t||typeof t!="string"?!1:t.toLowerCase()==="true"}C(ts,"parseBoolean");function ss(t){return/^-?\d+$/.test(t)}C(ss,"containsInteger");function as(t){if(t.length===0)return"";if(t.length===1)return t[0];let e=t.slice(0,t.length-1),s=t[t.length-1];return e.join(", ")+" and "+s}C(as,"makeFormattedEnglishList");function rs(t){return z(t)?"":t.split(" ").map(e=>e?H(e):"").join(" ")}C(rs,"capitalizeFirstLetterOfEachWord");function ns(t){return t.replace(/\s/g,"")}C(ns,"removeAllWhitespaces");function os(t){if(z(t))return 0;let e=C((s,a)=>{let r=(a.charCodeAt(0)-48)/74;return(s+r)%1},"base58Reduction");return t.split("").reduce(e,0)}C(os,"normalizeBase58String");function is(t,e=100){if(!z(t))return t.substring(0,e)}C(is,"trimIfDefined");function cs(t){return t.replace(/(\r\n|\n|\r)/g," ").replace(/[\x00-\x1F\x7F-\uFFFF]/g,"")}C(cs,"sanitizeStringToValidHTTPHeaderValue");function ls(t){try{JSON.parse(t)}catch{return!1}return!0}C(ls,"isStringifiedJson");function ds(t,e){if(!z(t))try{return JSON.parse(t)}catch(s){console.error(`safeJSONParse failed: ${e??""}`,s);return}}C(ds,"safeJSONParse");function ps(t,e){return t?.toLowerCase()===e?.toLowerCase()}C(ps,"equalsIgnoreCase");function us(t){return t.map(e=>`'${e}'`).join(" | ")}C(us,"arrayToUnionString");function ms(t){return t.startsWith("0x")?t:`0x${t}`}C(ms,"addHexIndicator");function fs(t){return Number.parseFloat(t).toString()}C(fs,"removeTrailingZeros");function hs(){let t="9876543210",e="";for(let s=0;s<4;s++)e+=t[Math.floor(Math.random()*10)];return e}C(hs,"generateOTP");function gs(t){return t&&t.includes("@")?t.split("@")[0]:t??""}C(gs,"getNameFromEmail");function ys(t){return t!=null?`@${t.split("@").pop()}`:""}C(ys,"getDomainFromEmail");function _s(t){return H(t.toLowerCase().replace(/([-_][a-z])/g,e=>e.toUpperCase().replace("-","").replace("_","")))}C(_s,"snakeToUpperCamel");function vs(t){return t[0].toLowerCase()+t.slice(1,t.length).replace(/[A-Z]/g,e=>`_${e.toLowerCase()}`)}C(vs,"upperCamelToSnake");function Es(t){return t.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}C(Es,"slugify");var Ya=C(t=>t.startsWith("0x")?t.slice(2):t,"trimHexIndicator");function ht(t){return new TextEncoder().encode(t).length}C(ht,"utf8Size");function Ts(t){return ht(JSON.stringify(t))}C(Ts,"serializedSize");function Ss(t){let e=unescape(encodeURIComponent(t)),s=new Uint8Array(e.length);for(let a=0;a<e.length;a++)s[a]=e.charCodeAt(a);return s}C(Ss,"stringToUtf8ByteArray");function Cs(t){return t.split("_").map(e=>H(e)).join(" ")}C(Cs,"capitalizeAndRemoveUnderscores");function bs(t){return t.split("-").map(e=>H(e)).join(" ")}C(bs,"capitalizeAndRemoveDashes");function Is(t){if(typeof t!="string")return t;let e=t;for(;;)try{let s=JSON.parse(e);if(typeof s=="string")e=s;else return s}catch{return e}}C(Is,"multiParse");function As(t,e=1){let s=["gmail.com","hotmail.com","outlook.com","live.com"],[a,r]=t.split("@"),[n,o]=r.split("."),i,d;return a.length<=3?i="*".repeat(a.length):i=a.length<=e?a:a[0]+"*".repeat(a.length-e-1)+a.slice(-e),s.includes(`${n}.${o}`)?d=`${n}.${o}`:d=`${n.length>1?n[0]+"*".repeat(n.length-2)+n.slice(-1):n}.${o}`,`${i}@${d}`}C(As,"obfuscateEmail");function Ps(t){return t.includes("*")}C(Ps,"isObfuscated");function xs(t){return t===null?!1:/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t||"")}C(xs,"isEmail");function ws(...t){for(let e of t)if(!z(e))return e;throw new Error("All values are empty")}C(ws,"getFirstNonEmpty");function Rs(t){return t.endsWith(".")?t.slice(0,-1):t}C(Rs,"removeTrailingDecimal");var js={admin:{index:"/console/admin",enterpriseClient:{index:"/console/admin/enterprise-clients",withId:c(t=>`/console/admin/enterprise-clients/${t}`,"withId"),details:c(t=>`/console/admin/enterprise-clients/${t}/details`,"details"),onrampB2B:c(t=>`/console/admin/enterprise-clients/${t}/onrampb2b`,"onrampB2B")},quickstarts:{index:"/console/admin/quickstarts",new:"/console/admin/quickstarts/new",edit:c(t=>`/console/admin/quickstarts/${t}`,"edit")}},billing:{index:"/console/billing",planDetails:"/console/billing/plan-details"},overview:{index:"/console/overview"},orders:{index:"/console/orders",orderDetails:c(t=>`/console/orders/${t}`,"orderDetails")},createAccount:"/console/create-account",onboarding:"/console/onboarding",collections:{index:"/console/collections",create:"/console/create-collection",dashboard:c(t=>`/console/collections/${t}/dashboard`,"dashboard"),details:c(t=>`/console/collections/${t}/details`,"details"),branding:c(t=>`/console/collections/${t}/branding`,"branding"),contract:c(t=>`/console/collections/${t}/contract`,"contract"),payments:c(t=>`/console/collections/${t}/payments`,"payments"),orders:c(t=>`/console/collections/${t}/orders`,"orders"),orderDetails:c((t,e)=>`/console/collections/${t}/orders/${e}`,"orderDetails"),payouts:{index:c(t=>`/console/collections/${t}/payouts`,"index"),details:c((t,e)=>`/console/collections/${t}/payouts/${e}`,"details"),scheduled:c((t,e)=>`/console/collections/${t}/payouts/scheduled/${e}`,"scheduled")},registeredNfts:c(t=>`/console/collections/${t}/registered/nfts`,"registeredNfts"),createdNfts:c(t=>`/console/collections/${t}/created/nfts`,"createdNfts")},wallets:{company:{index:"/console/wallets/company",walletDetails:c(t=>`/console/wallets/company/${t}`,"walletDetails")},index:"/console/wallets",address:c((t,e)=>`/console/wallets/${t}?${e}`,"address")},prepay:{create:c(t=>`/console/collections/create-prepay/${t}`,"create"),details:c(t=>`/console/collections/prepay/${t}/details`,"details"),update:c(t=>`/console/collections/prepay/${t}/update`,"update")},projects:{index:"/console/projects",addMember:"/console/projects/addMember",apiKeys:{index:"/console/projects/apiKeys",edit:c((t,e)=>`/console/projects/${t}/APIKeys/Create?apiKeyId=${e}`,"edit")},projectId:c(t=>`/console/projects/${t}`,"projectId"),withId:c(t=>`/console/projects/${t}`,"withId"),branding:c(t=>`/console/projects/${t}/branding`,"branding"),settings:c(t=>`/console/projects/${t}/settings`,"settings"),walletsSettings:c(t=>`/console/projects/${t}/settings/wallets`,"walletsSettings")},webhooks:{index:"/console/webhooks"},domains:{index:"/console/domains"},applePayDomains:{index:"/console/apple-pay-domains"},account:{index:"/console/account"},mintingApi:{index:"/console/minting-api"},authorizeDevice:{index:c(t=>`/console/authorize-device?${new URLSearchParams(t).toString()}`,"index"),success:"/console/authorize-device/success"}};function He(t,e){return e?`${t}?clientId=${e}`:t}c(He,"appendClientId");var qa={console:{collections:{new:{chooseAction:c(t=>He("/alpha/console/collections/new/choose-action",t),"chooseAction"),details:c(t=>`/alpha/console/collections/new/details?${new URLSearchParams({...z(t)?{}:{clientId:t}}).toString()}`,"details"),registerCollection:c(t=>He("/alpha/console/collections/new/register-collection",t),"registerCollection"),smartContract:c(t=>He("/alpha/console/collections/new/smart-contract",t),"smartContract")}}}},Ja={admin:{godmode:{info:c(t=>`/api/admin/godmode/info?userId=${t}`,"info"),relatedEntities:c(t=>`/api/admin/godmode/related-entities?identifier=${t}`,"relatedEntities"),impersonate:c((t,e)=>`/api/admin/godmode/impersonate?entityId=${t}&type=${e}`,"impersonate"),gatherInfo:c((t,e)=>`/api/admin/godmode/gather-info/${t}/${e}`,"gatherInfo"),enterpriseData:c(t=>`/api/admin/godmode/enterprise-data?identifier=${t}`,"enterpriseData")}},auth:{callback:{email:"/api/auth/callback/email"}},internal:{transfer:{confirmation:"/api/internal/transfer/confirmation"},transaction:{confirmation:"/api/internal/transaction/confirmation"}},"v1-alpha1":{wallets:{transaction:{getViewInfo:c(t=>`/api/v1-alpha1/wallets/transaction/getViewInfo/${t}`,"getViewInfo")},nfts:c(t=>`api/v1-alpha1/wallets/${t}/nfts`,"nfts"),getViewInfo:c(t=>`api/v1-alpha1/wallets/transfers/getViewInfo/${t}`,"getViewInfo")},collections:{index:"/api/v1-alpha1/collections",mints:c((t,e,s)=>`/api/v1-alpha1/collections/${t}/mints?projectId=${e}${s?`&cursor=${s}`:""}`,"mints")},minting:{collections:{nfts:c((t,e)=>`/api/v1-alpha1/minting/collections/${t}/nfts?projectId=${e}`,"nfts")}},project:{branding:c(t=>`/api/v1-alpha1/projects/${t}/branding`,"branding"),usage:c((t,e,s)=>`/api/v1-alpha1/projects/${t}/usage?dimension=${e}&startDate=${s}`,"usage"),walletsCreated:c(t=>`/api/v1-alpha1/projects/${t}/wallets-created`,"walletsCreated")}},blockchain:{price:c(t=>`/api/blockchain/${t}/price`,"price")},console:{billing:{details:c(t=>`/api/billing/${t}`,"details"),addPaymentMethodUrl:c(t=>`/api/billing/addPaymentInfoUrl/${t}`,"addPaymentMethodUrl"),getCurrentBalance:c(t=>`/api/billing/${t}/balance`,"getCurrentBalance"),paymentMethods:c(t=>`/api/billing/${t}/paymentMethods`,"paymentMethods")},collections:{index:c(t=>`/api/collections?projectId=${t}`,"index"),indexPaginated:c((t,e,s,a=!1)=>`/api/v1-alpha1/collections?${new URLSearchParams({projectId:t,page:e.toString(),perPage:s.toString(),hideDrafts:a?"true":"false"})}`,"indexPaginated"),byClientId:c((t,e)=>`/api/console/collections/${t}?projectId=${e}`,"byClientId"),requestVerification:c((t,e)=>`/api/console/collections/${t}/request-verification?projectId=${e}`,"requestVerification"),mintableTemplates:c((t,e,s,a=20)=>`/api/console/collections/${t}/templates/mintable?projectId=${e}&page=${s}&perPage=${a}`,"mintableTemplates"),templateSupply:c((t,e)=>`/api/console/collections/${t}/templates/supply?projectId=${e}`,"templateSupply"),payments:{parameters:c((t,e)=>`/api/console/collections/${t}/payments/parameters?projectId=${e}`,"parameters")},orders:{stats:c((t,e)=>`/api/collections/${t}/orders/stats?projectId=${e}`,"stats"),index:c((t,e,s)=>{let a=new URLSearchParams({projectId:e,...s});return`/api/collections/${t}/orders?${a}`},"index"),order:c((t,e,s)=>`/api/collections/${t}/orders/${s}?projectId=${e}`,"order")},register:{evm:{contract:{getInfo:c((t,e)=>`/api/console/collections/register/evm/contract/${t}/get-info?chain=${e}`,"getInfo")},getThirdwebParams:c((t,e)=>`/api/console/collections/register/evm/contract/get-thirdweb-params?projectId=${t}&clientId=${e}`,"getThirdwebParams")}},batchUpload:c((t,e,s)=>`/api/console/collections/${t}/batchUpload?projectId=${e}&batchIdentifier=${s}`,"batchUpload"),batchUploadStatus:c((t,e,s,a)=>`/api/console/collections/${t}/batchUpload?projectId=${e}&batchIdentifier=${s}&workflowId=${a}`,"batchUploadStatus")},getProject:c(t=>`/api/console/projects?projectId=${t}`,"getProject"),projects:{index:`/api/${js.projects.index}`,exportCsv:c((t,e)=>`/api/export-csv?projectId=${t}&clientId=${e}`,"exportCsv"),apiKeys:c((t,e)=>`/api/console/projects/${t}/apiKeys${z(e)?"":`?keyId=${e}`}`,"apiKeys"),webhook:c(t=>`/api/console/projects/${t}/webhook`,"webhook"),members:"/api/console/projects/members",billing:{paymentMethods:c(t=>`/api/console/projects/${t}/billing/paymentMethods`,"paymentMethods"),balance:c(t=>`/api/console/projects/${t}/billing/balance`,"balance"),subscription:c(t=>`/api/console/projects/${t}/billing/subscription`,"subscription"),pricing:c(t=>`/api/console/projects/${t}/billing/pricing`,"pricing"),apiActionEnabled:c((t,e,s)=>`/api/console/projects/${t}/billing/apiActionEnabled?apiAction=${e}&chain=${s}`,"apiActionEnabled"),usage:c(t=>`/api/console/projects/${t}/billing/usage`,"usage"),autoRecharge:c(t=>`/api/console/projects/${t}/billing/autoRecharge`,"autoRecharge"),redeemCoupon:c(t=>`/api/console/projects/${t}/billing/redeemCoupon`,"redeemCoupon"),payments:c(t=>`/api/console/projects/${t}/billing/payments`,"payments"),topupStatus:c((t,e)=>`/api/console/projects/${t}/billing/topupStatus?requestId=${e}`,"topupStatus"),billingInformation:c(t=>`/api/console/projects/${t}/billing/billingInformation`,"billingInformation")},privacyPolicy:c(t=>`/api/console/project/${t}/privacy-policy`,"privacyPolicy")},webhook:{index:c(t=>`/api/console/webhook?projectId=${t}`,"index"),attempts:c(t=>`/api/console/webhook/attempts?projectId=${t}`,"attempts"),svix:{appPortal:"/api/console/webhook/svix/app-portal"}},domains:{createUpdateDelete:c((t,e)=>`/api/v1-alpha1/projects/${t}/domains/${e}`,"createUpdateDelete")},applePayDomains:{list:c(t=>`/api/v1-alpha1/projects/${t}/apple-pay-domains`,"list"),register:c((t,e)=>`/api/v1-alpha1/projects/${t}/apple-pay-domains/${e}`,"register"),deregister:c((t,e)=>`/api/v1-alpha1/projects/${t}/apple-pay-domains/${e}`,"deregister")},accesslist:{discordInfo:c((t,e)=>`/api/console/collections/${t}/accesslists/discord?projectId=${e}`,"discordInfo"),validateTwitter:c((t,e,s)=>`/api/console/collections/${t}/accesslists/twitter?username=${s}&projectId=${e}`,"validateTwitter"),accesslists:c((t,e)=>`/api/console/collections/${t}/accesslists?projectId=${e}`,"accesslists")},developerAccount:{get:c(t=>`/api/console/developer-account?projectId=${t}`,"get")},mintingApi:{hasMinted:c(t=>`/api/console/minting-api/hasMinted?projectId=${t}`,"hasMinted")},payments:{hostedSalesPage:{index:c((t,e)=>`/api/console/collections/${t}/payments/hostedSalesPage?projectId=${e}`,"index")},enable:c((t,e)=>`/api/console/collections/${t}/payments/enable?projectId=${e}`,"enable")},branding:c((t,e)=>`/api/console/collections/${t}/branding?projectId=${e}`,"branding"),registerContract:c((t,e)=>`/api/console/collections/${t}/register-contract?projectId=${e}`,"registerContract"),dashboard:{revenue:c((t,e,s,a,r)=>`/api/console/collections/${t}/dashboard/revenue/?projectId=${e}&after=${s}&before=${a}&periodInMS=${r}`,"revenue"),sales:c((t,e,s,a)=>`/api/console/collections/${t}/dashboard/sales/?projectId=${e}&after=${s}&before=${a}`,"sales")},contactSales:{upgradePlanSubmission:c(t=>`/api/console/contact-sales/upgrade-plan-submission?projectId=${t}`,"upgradePlanSubmission")}},developerAccount:"/api/developeraccount",contactSales:{upgradePlanSubmission:c(t=>`/api/console/contact-sales/upgrade-plan-submission?projectId=${t}`,"upgradePlanSubmission")},crossmint:{user:{discord:{index:"/api/crossmint/user/discord"}}},projects:"/api/projects",verification:{otp:c((t,e,s)=>`/api/verifyOTP?${new URLSearchParams({exportId:t,otp:e,uuid:s}).toString()}`,"otp"),getStatusByEntityId:c(t=>`/api/verification/${t}/status`,"getStatusByEntityId"),getCollectionStatus:c((t,e)=>`/api/verification/${t}/collectionStatus?projectId=${e}`,"getCollectionStatus")},prepays:{details:c(t=>`/api/prepays/${t}`,"details")},hostedSalesPage:{mintStatus:c(({clientId:t,isConsole:e,quantity:s,projectId:a,currency:r,price:n})=>`/api/collections/drop/mintStatus?clientId=${t}&quantity=${s}&currency=${r}&price=${n}&isConsole=${e}${a?`&projectId=${a}`:""}`,"mintStatus"),index:c(t=>`/api/collections/drop?slug=${t}`,"index"),context:c(t=>`/api/collections/drop/context?slug=${t}`,"context")},claim:{index:"/api/collections/claim",context:c(t=>`/api/collections/claim/context?slug=${t}`,"context"),pageStatus:c(({clientId:t,projectId:e})=>`/api/collections/claim/pageStatus?clientId=${t}&projectId=${e}`,"pageStatus"),supply:c(({clientId:t,projectId:e})=>`/api/collections/claim/supply?clientId=${t}&projectId=${e}`,"supply"),status:c(({clientId:t,projectId:e,requestId:s})=>`/api/collections/claim/status?clientId=${t}&projectId=${e}&requestId=${s}`,"status")},walletConnect:{signMessage:"/api/walletConnect"},transactions:{nft:c(t=>`/api/transactions/${t}/nft`,"nft")},"2023-06-09":{crossmint:{connect:c((t,{forceWalletSelection:e,projectId:s,showAAWallets:a})=>{let r=e?"&forceWalletSelection=true":"",n=s?`&projectId=${s}`:"";return`/api/2023-06-09/crossmint/connect?chain=${t}${r}${n}${a?"&showAAWallets=true":""}`},"connect")}},"2022-06-09":{minting:{collections:{index:c(t=>`/api/2022-06-09/minting/collections?projectId=${t}`,"index"),collectionId:c((t,e)=>`/api/2022-06-09/minting/collections/${t}${e?`?projectId=${e}`:""}`,"collectionId"),templates:c((t,e)=>`/api/2022-06-09/minting/collections/${t}/templates?projectId=${e}`,"templates"),nfts:c((t,e)=>`/api/2022-06-09/minting/collections/${t}/nfts?projectId=${e}`,"nfts"),template:c((t,e,s)=>`/api/2022-06-09/minting/collections/${t}/templates/${e}?projectId=${s}`,"template")}},wallets:{index:c(t=>`/api/2022-06-09/wallets?projectId=${t}`,"index")}},wallets:{get(t,e,s,a){return`/api/unstable/wallets?${new URLSearchParams({projectId:t,page:e.toString(),perPage:s.toString(),...a})}`},index:c(t=>`/api/v1-alpha1/wallets?projectId=${t}`,"index")},services:{aws:{s3:{presignedPutObject:c((t,e,s,a)=>`/api/services/aws/s3/presignedPutObject?${new URLSearchParams({clientId:t,projectId:s,batchIdentifier:e,bucketName:a}).toString()}`,"presignedPutObject")}}}},Qa={referralProgramAgreement:"/legal/referral-program-agreement",contentPolicy:"/content-policy",termsOfService:"/legal/terms-of-service",msa:"/master-services-agreement",privacyPolicy:"/legal/privacy-policy"},Xa={claim:c(t=>`/collections/${t}/claim`,"claim")},er={getSession:"/api/session",signOut:"/api/session/signout",oauthSessionAuthenticate:"/api/session/authenticate",authenticate:"/api/session/authenticate",oauthSessionAuthenticateAuthSDK:"/api/2024-09-26/session/sdk/auth/authenticate",stytchGetOrCreateUser:"/api/sdk/auth/user/get-or-create",exchangeAccessToken:"/api/session/exchange-access-token",sendOtp:"/api/session/send/otp"},tr={support:"https://help.crossmint.com/hc/en-us/requests/new",collectionVerificationFAQ:"https://help.crossmint.com/hc/en-us/articles/17367432791053-Crossmint-Collection-Review",sales:"/contact/sales",index:"/contact"},sr={contract:c(t=>`/claim/contract/${t}`,"contract")},ar={index:"https://docs.crossmint.com",changelog:{index:"https://docs.crossmint.com/changelog",article:c(t=>`https://docs.crossmint.com/changelog/${t}`,"article")},payments:{index:"https://docs.crossmint.com/payments/introduction"}},rr={index:"/cli-signin",success:"/cli-signin/success"},x={cliSignin:rr,console:js,api:Ja,alpha:qa,legal:Qa,collection:Xa,authentication:er,notFound:"/404",contact:tr,claim:sr,docs:ar,pricing:"/pricing"};import Ns from"os";var ks=gt().version,Os="@crossmint/cli";function or(){let t=Ns.platform(),e=Ns.arch(),s=process.version;return`${Os} ${ks} (${t} ${e}) Node.js/${s} (production)`}function ir(){return{"user-agent":or(),"x-client-name":Os,"x-client-version":ks}}async function k(t,e=N.GET,s){let a=await Nt(),r=await M();a||(console.error("\u274C Session not found, please run crossmint login"),process.exit(1)),r||(console.error("\u274C Environment not found, please run crossmint login"),process.exit(1));let n=`${ae(r)}${t}`;return ze(n,e,s,{Cookie:`sessionToken=${a}`})}async function Ls(t,e=N.GET,s){let a=await M();a||(console.error("\u274C Environment not found"),process.exit(1));let r=`${ae(a)}${t}`;return ze(r,e,s)}async function ze(t,e=N.GET,s,a){let r={method:e,headers:{"Content-Type":"application/json",...ir(),...a}};s&&(r.body=JSON.stringify(s));let n=await fetch(t,r);if(n.status>=400){let o=await n.json();throw new Error(`${o.message}`)}return await n.json()}import{select as lr}from"@inquirer/prompts";l();import{createSpinner as cr}from"nanospinner";function D(t){let e=cr(t),s={start:a=>(e.start({text:a}),s),succeed:a=>(e.success({text:a}),s),fail:a=>(e.error({text:a}),s)};return s}l();var yt="crossmint",A={LOGIN:"login",LOGOUT:"logout",WHOAMI:"whoami",KEYS:"keys",PROJECTS:"projects",CREATE:"create",DELETE:"delete",EDIT:"edit",LIST:"list",SELECT:"select",DETAILS:"details"};function w(t){return[yt,...t].join(" ")}var R={login:[A.LOGIN],logout:[A.LOGOUT],whoami:[A.WHOAMI],projects:{select:[A.PROJECTS,A.SELECT],create:[A.PROJECTS,A.CREATE],details:[A.PROJECTS,A.DETAILS]},keys:{create:[A.KEYS,A.CREATE],delete:[A.KEYS,A.DELETE],edit:[A.KEYS,A.EDIT],list:[A.KEYS,A.LIST]}};async function we(){let t=D("Fetching projects...").start();try{let e=await k(x.api.projects);if(!e||e.length===0)return t.fail(`No projects found. Create a new project using \`${w(R.projects.create)}\``),process.exit(0);if(t.succeed("Fetched projects"),e.length===1){let a=e[0];return console.log(`You only have one project: ${a.name}`),console.log(`To create another project, run \`${w(R.projects.create)}\``),await Re(a.id),console.log(`\u2705 Project ${a.name} selected`),process.exit(0)}let s=await lr({message:"Select a project:",choices:e.map(a=>({name:a.name,value:a,description:a.description}))});await Re(s.id),console.log(`\u2705 Project ${s.name} selected`),process.exit(0)}catch{t.fail("Failed to fetch projects"),process.exit(1)}}import ur from"open";l();import $s from"crypto";async function Ds(){let e=$s.randomBytes(32).toString("base64url"),a=$s.createHash("sha256").update(e).digest().toString("base64url");return await ve("pkceCodeVerifier",e),a}async function Ms(){return await Ee("pkceCodeVerifier")}l();import dr from"http";l();async function Ge(){let t=await M();return t||(console.error("\u274C Environment not found"),process.exit(1)),t==="local"?{uri:"test.stytch.com",projectId:"project-test-8eb55d3d-949f-4e0f-aea6-c9ba740f7813",clientId:"connected-app-test-4d27d6d8-3491-45c8-9bb0-b05f89cb7a1a"}:t==="staging"?{uri:"api.stytch.com",projectId:"project-live-b7c564af-0c0d-4662-bfc0-72bed1049cfe",clientId:"connected-app-live-47cd5bf1-c155-42c1-9f36-5d35853b34a7"}:{uri:"api.stytch.com",projectId:"project-live-7a1cb98d-b8b7-4471-aaf6-f8af67a0df94",clientId:"connected-app-live-a72edd7e-6ff3-4002-a13a-e7ca66354bd1"}}async function _t(t){return new Promise((e,s)=>{let a=dr.createServer(async(n,o)=>{try{let d=new URL(n.url||"",`http://${n.headers.host}`).searchParams.get("code");if(!d){o.writeHead(400,{"Content-Type":"text/plain"}),o.end("No code provided");return}let u=await Ge(),g=await ze(`https://${u.uri}/v1/public/${u.projectId}/oauth2/token`,N.POST,{grant_type:"authorization_code",code:d,client_id:u.clientId,redirect_uri:"http://127.0.0.1:3456/callback",code_verifier:await Ms()}),b=await Ls(x.authentication.exchangeAccessToken,N.POST,{accessToken:g.access_token});await jt(b.sessionToken),o.writeHead(302,{Location:`${ae(t)}${x.console.authorizeDevice.success}`}),o.end(),a.close(),e(g)}catch(i){o.writeHead(500,{"Content-Type":"text/plain"}),o.end("Error during authentication"),a.close(),s(i)}});a.listen(3456)})}var mr=!1;async function vt(){try{console.log("\u{1F510} Crossmint CLI - Login");let t=await pr({message:"Select environment:",choices:[{name:"Production",value:"production"},{name:"Staging",value:"staging"},...mr?[{name:"Local",value:"local"}]:[]]}),e=ae(t);e||(console.error(`Error: No URL found for ${t} environment`),process.exit(1)),await wt(t);let s=_t(t),{clientId:a}=await Ge(),n={code_challenge:await Ds(),code_challenge_method:"S256",scope:"full_access",response_type:"code",grant_type:"authorization_code",redirect_uri:"http://127.0.0.1:3456/callback",client_id:a},o=`${e}${x.console.authorizeDevice.index(n)}`;console.log("Opening browser for authentication..."),ur(o),await s,console.log(`\u2705 Login successful! You are now authenticated in the ${t} environment.`),await we()}catch{console.error("\u274C Login failed, please try again."),process.exit(1)}}l();l();async function se(t){return(await k(x.api.projects)).find(a=>a.id===t)}async function Et(){let t=await M(),e=await F(),s=await se(e||""),a=await k(x.authentication.getSession);console.log(`You are logged in to \u{1F340}Crossmint as: ${a.user.email} - Environment: ${H(t)} - ${s?`Project: ${s.name}`:"No project selected"}`),process.exit(0)}l();async function Tt(){await kt(),await Rt(),await Ot(),console.log("Logged out"),process.exit(0)}l();l();import{confirm as fr,input as hr}from"@inquirer/prompts";async function Ye(t={}){let e=D();try{let s=t.name;s||(s=await hr({message:"Enter project name:",validate:o=>o.length>0||"Project name is required"})),e.start(`\u{1F680} Creating project "${s}" with Smart Wallets...`);let a=await k(x.api.console.projects.index,N.POST,{name:s,walletType:"smart_wallet",storageProvider:"ipfs",projectThumbnail:""}),r=JSON.parse(a);e.succeed(`\u2705 Project created successfully!
3
3
 
4
4
  `),console.log(`\u{1F4CC} Project Details:
5
5
  Name: ${s}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crossmint/cli",
3
- "version": "1.1.9",
3
+ "version": "1.1.12",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "repository": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crossmint/cli",
3
- "version": "1.1.9",
3
+ "version": "1.1.12",
4
4
  "description": "",
5
5
  "keywords": [],
6
6
  "repository": {