@jsrepo/shadcn 0.0.10 → 0.0.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.
- package/dist/{index.d.ts → index.d.mts} +3 -3
- package/dist/index.mjs +2 -0
- package/dist/output-CH39YQsU.mjs +2 -0
- package/dist/{output-DR1ZWDBj.d.ts → output.d.mts} +2 -2
- package/dist/output.mjs +1 -0
- package/dist/{provider-v0pBRKCX.d.ts → provider.d.mts} +2 -2
- package/dist/{provider-w0GjKOJb.js → provider.mjs} +2 -2
- package/package.json +14 -14
- package/dist/index.js +0 -2
- package/dist/output-oZQMHaJS.js +0 -2
- package/dist/output.d.ts +0 -2
- package/dist/output.js +0 -1
- package/dist/provider.d.ts +0 -2
- package/dist/provider.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { OutputOptions, output } from "./output.mjs";
|
|
2
|
+
import { provider } from "./provider.mjs";
|
|
3
3
|
import { Output, RegistryConfig } from "jsrepo";
|
|
4
4
|
import { registryItemTypeSchema } from "shadcn/schema";
|
|
5
5
|
|
|
@@ -53,4 +53,4 @@ type ShadcnRegistryItem = {
|
|
|
53
53
|
declare function defineShadcnRegistry(registry: ShadcnRegistry): RegistryConfig;
|
|
54
54
|
//#endregion
|
|
55
55
|
export { OutputOptions, ShadcnRegistry, ShadcnRegistryItem, ShadcnRegistryItemType, provider as default, defineShadcnRegistry, output };
|
|
56
|
-
//# sourceMappingURL=index.d.
|
|
56
|
+
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{t as e}from"./output-CH39YQsU.mjs";import{provider as t}from"./provider.mjs";import{JsrepoError as n}from"jsrepo";const r=/^(@[^/]+\/[^@/]+)(?:@([^/]+))?(\/.*)?$/,i=/^([^@/]+)(?:@([^/]+))?(\/.*)?$/;function a(e){let t=r.exec(e)||i.exec(e);if(t)return{name:t[1]||``,version:t[2]||void 0,path:t[3]||``}}function o(e){return{...e,items:e.items.map(e=>({...e,dependencies:e.dependencies?.map(e=>{let t=a(e);if(t===void 0)throw new n(`Invalid package name: ${e}`,{suggestion:`Please provide a valid package name.`});return{ecosystem:`js`,name:t.name,version:t.version}})}))}}export{t as default,o as defineShadcnRegistry,e as output};
|
|
2
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{JsrepoError as e}from"jsrepo";import t from"node:fs";import n from"node:path";var r;(function(e){e.assertEqual=e=>{};function t(e){}e.assertIs=t;function n(e){throw Error()}e.assertNever=n,e.arrayToEnum=e=>{let t={};for(let n of e)t[n]=n;return t},e.getValidEnumValues=t=>{let n=e.objectKeys(t).filter(e=>typeof t[t[e]]!=`number`),r={};for(let e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys=typeof Object.keys==`function`?e=>Object.keys(e):e=>{let t=[];for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(let n of e)if(t(n))return n},e.isInteger=typeof Number.isInteger==`function`?e=>Number.isInteger(e):e=>typeof e==`number`&&Number.isFinite(e)&&Math.floor(e)===e;function r(e,t=` | `){return e.map(e=>typeof e==`string`?`'${e}'`:e).join(t)}e.joinValues=r,e.jsonStringifyReplacer=(e,t)=>typeof t==`bigint`?t.toString():t})(r||={});var i;(function(e){e.mergeShapes=(e,t)=>({...e,...t})})(i||={});const a=r.arrayToEnum([`string`,`nan`,`number`,`integer`,`float`,`boolean`,`date`,`bigint`,`symbol`,`function`,`undefined`,`null`,`array`,`object`,`unknown`,`promise`,`void`,`never`,`map`,`set`]),o=e=>{switch(typeof e){case`undefined`:return a.undefined;case`string`:return a.string;case`number`:return Number.isNaN(e)?a.nan:a.number;case`boolean`:return a.boolean;case`function`:return a.function;case`bigint`:return a.bigint;case`symbol`:return a.symbol;case`object`:return Array.isArray(e)?a.array:e===null?a.null:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?a.promise:typeof Map<`u`&&e instanceof Map?a.map:typeof Set<`u`&&e instanceof Set?a.set:typeof Date<`u`&&e instanceof Date?a.date:a.object;default:return a.unknown}},s=r.arrayToEnum([`invalid_type`,`invalid_literal`,`custom`,`invalid_union`,`invalid_union_discriminator`,`invalid_enum_value`,`unrecognized_keys`,`invalid_arguments`,`invalid_return_type`,`invalid_date`,`invalid_string`,`too_small`,`too_big`,`invalid_intersection_types`,`not_multiple_of`,`not_finite`]);var c=class e extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name=`ZodError`,this.issues=e}format(e){let t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`)i.unionErrors.map(r);else if(i.code===`invalid_return_type`)r(i.returnTypeError);else if(i.code===`invalid_arguments`)r(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}static assert(t){if(!(t instanceof e))throw Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,r.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=e=>e.message){let t={},n=[];for(let r of this.issues)if(r.path.length>0){let n=r.path[0];t[n]=t[n]||[],t[n].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};c.create=e=>new c(e);var l=(e,t)=>{let n;switch(e.code){case s.invalid_type:n=e.received===a.undefined?`Required`:`Expected ${e.expected}, received ${e.received}`;break;case s.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,r.jsonStringifyReplacer)}`;break;case s.unrecognized_keys:n=`Unrecognized key(s) in object: ${r.joinValues(e.keys,`, `)}`;break;case s.invalid_union:n=`Invalid input`;break;case s.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${r.joinValues(e.options)}`;break;case s.invalid_enum_value:n=`Invalid enum value. Expected ${r.joinValues(e.options)}, received '${e.received}'`;break;case s.invalid_arguments:n=`Invalid function arguments`;break;case s.invalid_return_type:n=`Invalid function return type`;break;case s.invalid_date:n=`Invalid date`;break;case s.invalid_string:typeof e.validation==`object`?`includes`in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==`number`&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):`startsWith`in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:`endsWith`in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:r.assertNever(e.validation):n=e.validation===`regex`?`Invalid`:`Invalid ${e.validation}`;break;case s.too_small:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at least`:`more than`} ${e.minimum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at least`:`over`} ${e.minimum} character(s)`:e.type===`number`||e.type===`bigint`?`Number must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${e.minimum}`:e.type===`date`?`Date must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${new Date(Number(e.minimum))}`:`Invalid input`;break;case s.too_big:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at most`:`less than`} ${e.maximum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at most`:`under`} ${e.maximum} character(s)`:e.type===`number`?`Number must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`bigint`?`BigInt must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`date`?`Date must be ${e.exact?`exactly`:e.inclusive?`smaller than or equal to`:`smaller than`} ${new Date(Number(e.maximum))}`:`Invalid input`;break;case s.custom:n=`Invalid input`;break;case s.invalid_intersection_types:n=`Intersection results could not be merged`;break;case s.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case s.not_finite:n=`Number must be finite`;break;default:n=t.defaultError,r.assertNever(e)}return{message:n}};let ee=l;function te(){return ee}const ne=e=>{let{data:t,path:n,errorMaps:r,issueData:i}=e,a=[...n,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s=``,c=r.filter(e=>!!e).slice().reverse();for(let e of c)s=e(o,{data:t,defaultError:s}).message;return{...i,path:a,message:s}};function u(e,t){let n=te(),r=ne({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===l?void 0:l].filter(e=>!!e)});e.common.issues.push(r)}var d=class e{constructor(){this.value=`valid`}dirty(){this.value===`valid`&&(this.value=`dirty`)}abort(){this.value!==`aborted`&&(this.value=`aborted`)}static mergeArray(e,t){let n=[];for(let r of t){if(r.status===`aborted`)return f;r.status===`dirty`&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(t,n){let r=[];for(let e of n){let t=await e.key,n=await e.value;r.push({key:t,value:n})}return e.mergeObjectSync(t,r)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:t,value:i}=r;if(t.status===`aborted`||i.status===`aborted`)return f;t.status===`dirty`&&e.dirty(),i.status===`dirty`&&e.dirty(),t.value!==`__proto__`&&(i.value!==void 0||r.alwaysSet)&&(n[t.value]=i.value)}return{status:e.value,value:n}}};const f=Object.freeze({status:`aborted`}),re=e=>({status:`dirty`,value:e}),p=e=>({status:`valid`,value:e}),ie=e=>e.status===`aborted`,ae=e=>e.status===`dirty`,m=e=>e.status===`valid`,h=e=>typeof Promise<`u`&&e instanceof Promise;var g;(function(e){e.errToObj=e=>typeof e==`string`?{message:e}:e||{},e.toString=e=>typeof e==`string`?e:e?.message})(g||={});var _=class{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}};const oe=(e,t)=>{if(m(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error(`Validation failed but no issues detected.`);return{success:!1,get error(){return this._error||=new c(e.common.issues),this._error}}};function v(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{let{message:a}=e;return t.code===`invalid_enum_value`?{message:a??i.defaultError}:i.data===void 0?{message:a??r??i.defaultError}:t.code===`invalid_type`?{message:a??n??i.defaultError}:{message:i.defaultError}},description:i}}var y=class{get description(){return this._def.description}_getType(e){return o(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:o(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new d,ctx:{common:e.parent.common,data:e.data,parsedType:o(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(h(t))throw Error(`Synchronous parse encountered promise.`);return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:o(e)};return oe(n,this._parseSync({data:e,path:n.path,parent:n}))}"~validate"(e){let t={common:{issues:[],async:!!this[`~standard`].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:o(e)};if(!this[`~standard`].async)try{let n=this._parseSync({data:e,path:[],parent:t});return m(n)?{value:n.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes(`encountered`)&&(this[`~standard`].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>m(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:o(e)},r=this._parse({data:e,path:n.path,parent:n});return oe(n,await(h(r)?r:Promise.resolve(r)))}refine(e,t){let n=e=>typeof t==`string`||t===void 0?{message:t}:typeof t==`function`?t(e):t;return this._refinement((t,r)=>{let i=e(t),a=()=>r.addIssue({code:s.custom,...n(t)});return typeof Promise<`u`&&i instanceof Promise?i.then(e=>e?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,t){return this._refinement((n,r)=>e(n)?!0:(r.addIssue(typeof t==`function`?t(n,r):t),!1))}_refinement(e){return new B({schema:this,typeName:K.ZodEffects,effect:{type:`refinement`,refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this[`~standard`]={version:1,vendor:`zod`,validate:e=>this[`~validate`](e)}}optional(){return V.create(this,this._def)}nullable(){return H.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return O.create(this)}promise(){return z.create(this,this._def)}or(e){return j.create([this,e],this._def)}and(e){return N.create(this,e,this._def)}transform(e){return new B({...v(this._def),schema:this,typeName:K.ZodEffects,effect:{type:`transform`,transform:e}})}default(e){let t=typeof e==`function`?e:()=>e;return new U({...v(this._def),innerType:this,defaultValue:t,typeName:K.ZodDefault})}brand(){return new Ue({typeName:K.ZodBranded,type:this,...v(this._def)})}catch(e){let t=typeof e==`function`?e:()=>e;return new W({...v(this._def),innerType:this,catchValue:t,typeName:K.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return We.create(this,e)}readonly(){return G.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};const se=/^c[^\s-]{8,}$/i,ce=/^[0-9a-z]+$/,le=/^[0-9A-HJKMNP-TV-Z]{26}$/i,ue=/^[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,de=/^[a-z0-9_-]{21}$/i,fe=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,pe=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,me=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let he;const ge=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,_e=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ve=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,ye=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,be=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,xe=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Se=`((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`,Ce=RegExp(`^${Se}$`);function we(e){let t=`[0-5]\\d`;e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision??(t=`${t}(\\.\\d+)?`);let n=e.precision?`+`:`?`;return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function Te(e){return RegExp(`^${we(e)}$`)}function Ee(e){let t=`${Se}T${we(e)}`,n=[];return n.push(e.local?`Z?`:`Z`),e.offset&&n.push(`([+-]\\d{2}:?\\d{2})`),t=`${t}(${n.join(`|`)})`,RegExp(`^${t}$`)}function De(e,t){return!!((t===`v4`||!t)&&ge.test(e)||(t===`v6`||!t)&&ve.test(e))}function Oe(e,t){if(!fe.test(e))return!1;try{let[n]=e.split(`.`);if(!n)return!1;let r=n.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(n.length+(4-n.length%4)%4,`=`),i=JSON.parse(atob(r));return!(typeof i!=`object`||!i||`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&i.alg!==t)}catch{return!1}}function ke(e,t){return!!((t===`v4`||!t)&&_e.test(e)||(t===`v6`||!t)&&ye.test(e))}var b=class e extends y{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==a.string){let t=this._getOrReturnCtx(e);return u(t,{code:s.invalid_type,expected:a.string,received:t.parsedType}),f}let t=new d,n;for(let i of this._def.checks)if(i.kind===`min`)e.data.length<i.value&&(n=this._getOrReturnCtx(e,n),u(n,{code:s.too_small,minimum:i.value,type:`string`,inclusive:!0,exact:!1,message:i.message}),t.dirty());else if(i.kind===`max`)e.data.length>i.value&&(n=this._getOrReturnCtx(e,n),u(n,{code:s.too_big,maximum:i.value,type:`string`,inclusive:!0,exact:!1,message:i.message}),t.dirty());else if(i.kind===`length`){let r=e.data.length>i.value,a=e.data.length<i.value;(r||a)&&(n=this._getOrReturnCtx(e,n),r?u(n,{code:s.too_big,maximum:i.value,type:`string`,inclusive:!0,exact:!0,message:i.message}):a&&u(n,{code:s.too_small,minimum:i.value,type:`string`,inclusive:!0,exact:!0,message:i.message}),t.dirty())}else if(i.kind===`email`)me.test(e.data)||(n=this._getOrReturnCtx(e,n),u(n,{validation:`email`,code:s.invalid_string,message:i.message}),t.dirty());else if(i.kind===`emoji`)he||=RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`),he.test(e.data)||(n=this._getOrReturnCtx(e,n),u(n,{validation:`emoji`,code:s.invalid_string,message:i.message}),t.dirty());else if(i.kind===`uuid`)ue.test(e.data)||(n=this._getOrReturnCtx(e,n),u(n,{validation:`uuid`,code:s.invalid_string,message:i.message}),t.dirty());else if(i.kind===`nanoid`)de.test(e.data)||(n=this._getOrReturnCtx(e,n),u(n,{validation:`nanoid`,code:s.invalid_string,message:i.message}),t.dirty());else if(i.kind===`cuid`)se.test(e.data)||(n=this._getOrReturnCtx(e,n),u(n,{validation:`cuid`,code:s.invalid_string,message:i.message}),t.dirty());else if(i.kind===`cuid2`)ce.test(e.data)||(n=this._getOrReturnCtx(e,n),u(n,{validation:`cuid2`,code:s.invalid_string,message:i.message}),t.dirty());else if(i.kind===`ulid`)le.test(e.data)||(n=this._getOrReturnCtx(e,n),u(n,{validation:`ulid`,code:s.invalid_string,message:i.message}),t.dirty());else if(i.kind===`url`)try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),u(n,{validation:`url`,code:s.invalid_string,message:i.message}),t.dirty()}else i.kind===`regex`?(i.regex.lastIndex=0,i.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),u(n,{validation:`regex`,code:s.invalid_string,message:i.message}),t.dirty())):i.kind===`trim`?e.data=e.data.trim():i.kind===`includes`?e.data.includes(i.value,i.position)||(n=this._getOrReturnCtx(e,n),u(n,{code:s.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),t.dirty()):i.kind===`toLowerCase`?e.data=e.data.toLowerCase():i.kind===`toUpperCase`?e.data=e.data.toUpperCase():i.kind===`startsWith`?e.data.startsWith(i.value)||(n=this._getOrReturnCtx(e,n),u(n,{code:s.invalid_string,validation:{startsWith:i.value},message:i.message}),t.dirty()):i.kind===`endsWith`?e.data.endsWith(i.value)||(n=this._getOrReturnCtx(e,n),u(n,{code:s.invalid_string,validation:{endsWith:i.value},message:i.message}),t.dirty()):i.kind===`datetime`?Ee(i).test(e.data)||(n=this._getOrReturnCtx(e,n),u(n,{code:s.invalid_string,validation:`datetime`,message:i.message}),t.dirty()):i.kind===`date`?Ce.test(e.data)||(n=this._getOrReturnCtx(e,n),u(n,{code:s.invalid_string,validation:`date`,message:i.message}),t.dirty()):i.kind===`time`?Te(i).test(e.data)||(n=this._getOrReturnCtx(e,n),u(n,{code:s.invalid_string,validation:`time`,message:i.message}),t.dirty()):i.kind===`duration`?pe.test(e.data)||(n=this._getOrReturnCtx(e,n),u(n,{validation:`duration`,code:s.invalid_string,message:i.message}),t.dirty()):i.kind===`ip`?De(e.data,i.version)||(n=this._getOrReturnCtx(e,n),u(n,{validation:`ip`,code:s.invalid_string,message:i.message}),t.dirty()):i.kind===`jwt`?Oe(e.data,i.alg)||(n=this._getOrReturnCtx(e,n),u(n,{validation:`jwt`,code:s.invalid_string,message:i.message}),t.dirty()):i.kind===`cidr`?ke(e.data,i.version)||(n=this._getOrReturnCtx(e,n),u(n,{validation:`cidr`,code:s.invalid_string,message:i.message}),t.dirty()):i.kind===`base64`?be.test(e.data)||(n=this._getOrReturnCtx(e,n),u(n,{validation:`base64`,code:s.invalid_string,message:i.message}),t.dirty()):i.kind===`base64url`?xe.test(e.data)||(n=this._getOrReturnCtx(e,n),u(n,{validation:`base64url`,code:s.invalid_string,message:i.message}),t.dirty()):r.assertNever(i);return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement(t=>e.test(t),{validation:t,code:s.invalid_string,...g.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(e){return this._addCheck({kind:`email`,...g.errToObj(e)})}url(e){return this._addCheck({kind:`url`,...g.errToObj(e)})}emoji(e){return this._addCheck({kind:`emoji`,...g.errToObj(e)})}uuid(e){return this._addCheck({kind:`uuid`,...g.errToObj(e)})}nanoid(e){return this._addCheck({kind:`nanoid`,...g.errToObj(e)})}cuid(e){return this._addCheck({kind:`cuid`,...g.errToObj(e)})}cuid2(e){return this._addCheck({kind:`cuid2`,...g.errToObj(e)})}ulid(e){return this._addCheck({kind:`ulid`,...g.errToObj(e)})}base64(e){return this._addCheck({kind:`base64`,...g.errToObj(e)})}base64url(e){return this._addCheck({kind:`base64url`,...g.errToObj(e)})}jwt(e){return this._addCheck({kind:`jwt`,...g.errToObj(e)})}ip(e){return this._addCheck({kind:`ip`,...g.errToObj(e)})}cidr(e){return this._addCheck({kind:`cidr`,...g.errToObj(e)})}datetime(e){return typeof e==`string`?this._addCheck({kind:`datetime`,precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:`datetime`,precision:e?.precision===void 0?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...g.errToObj(e?.message)})}date(e){return this._addCheck({kind:`date`,message:e})}time(e){return typeof e==`string`?this._addCheck({kind:`time`,precision:null,message:e}):this._addCheck({kind:`time`,precision:e?.precision===void 0?null:e?.precision,...g.errToObj(e?.message)})}duration(e){return this._addCheck({kind:`duration`,...g.errToObj(e)})}regex(e,t){return this._addCheck({kind:`regex`,regex:e,...g.errToObj(t)})}includes(e,t){return this._addCheck({kind:`includes`,value:e,position:t?.position,...g.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:`startsWith`,value:e,...g.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:`endsWith`,value:e,...g.errToObj(t)})}min(e,t){return this._addCheck({kind:`min`,value:e,...g.errToObj(t)})}max(e,t){return this._addCheck({kind:`max`,value:e,...g.errToObj(t)})}length(e,t){return this._addCheck({kind:`length`,value:e,...g.errToObj(t)})}nonempty(e){return this.min(1,g.errToObj(e))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:`trim`}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toLowerCase`}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toUpperCase`}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind===`datetime`)}get isDate(){return!!this._def.checks.find(e=>e.kind===`date`)}get isTime(){return!!this._def.checks.find(e=>e.kind===`time`)}get isDuration(){return!!this._def.checks.find(e=>e.kind===`duration`)}get isEmail(){return!!this._def.checks.find(e=>e.kind===`email`)}get isURL(){return!!this._def.checks.find(e=>e.kind===`url`)}get isEmoji(){return!!this._def.checks.find(e=>e.kind===`emoji`)}get isUUID(){return!!this._def.checks.find(e=>e.kind===`uuid`)}get isNANOID(){return!!this._def.checks.find(e=>e.kind===`nanoid`)}get isCUID(){return!!this._def.checks.find(e=>e.kind===`cuid`)}get isCUID2(){return!!this._def.checks.find(e=>e.kind===`cuid2`)}get isULID(){return!!this._def.checks.find(e=>e.kind===`ulid`)}get isIP(){return!!this._def.checks.find(e=>e.kind===`ip`)}get isCIDR(){return!!this._def.checks.find(e=>e.kind===`cidr`)}get isBase64(){return!!this._def.checks.find(e=>e.kind===`base64`)}get isBase64url(){return!!this._def.checks.find(e=>e.kind===`base64url`)}get minLength(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};b.create=e=>new b({checks:[],typeName:K.ZodString,coerce:e?.coerce??!1,...v(e)});function Ae(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=n>r?n:r;return Number.parseInt(e.toFixed(i).replace(`.`,``))%Number.parseInt(t.toFixed(i).replace(`.`,``))/10**i}var x=class e extends y{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)!==a.number){let t=this._getOrReturnCtx(e);return u(t,{code:s.invalid_type,expected:a.number,received:t.parsedType}),f}let t,n=new d;for(let i of this._def.checks)i.kind===`int`?r.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),u(t,{code:s.invalid_type,expected:`integer`,received:`float`,message:i.message}),n.dirty()):i.kind===`min`?(i.inclusive?e.data<i.value:e.data<=i.value)&&(t=this._getOrReturnCtx(e,t),u(t,{code:s.too_small,minimum:i.value,type:`number`,inclusive:i.inclusive,exact:!1,message:i.message}),n.dirty()):i.kind===`max`?(i.inclusive?e.data>i.value:e.data>=i.value)&&(t=this._getOrReturnCtx(e,t),u(t,{code:s.too_big,maximum:i.value,type:`number`,inclusive:i.inclusive,exact:!1,message:i.message}),n.dirty()):i.kind===`multipleOf`?Ae(e.data,i.value)!==0&&(t=this._getOrReturnCtx(e,t),u(t,{code:s.not_multiple_of,multipleOf:i.value,message:i.message}),n.dirty()):i.kind===`finite`?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),u(t,{code:s.not_finite,message:i.message}),n.dirty()):r.assertNever(i);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit(`min`,e,!0,g.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,g.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,g.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,g.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:g.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(e){return this._addCheck({kind:`int`,message:g.toString(e)})}positive(e){return this._addCheck({kind:`min`,value:0,inclusive:!1,message:g.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:0,inclusive:!1,message:g.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:0,inclusive:!0,message:g.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:0,inclusive:!0,message:g.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:g.toString(t)})}finite(e){return this._addCheck({kind:`finite`,message:g.toString(e)})}safe(e){return this._addCheck({kind:`min`,inclusive:!0,value:-(2**53-1),message:g.toString(e)})._addCheck({kind:`max`,inclusive:!0,value:2**53-1,message:g.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind===`int`||e.kind===`multipleOf`&&r.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks)if(n.kind===`finite`||n.kind===`int`||n.kind===`multipleOf`)return!0;else n.kind===`min`?(t===null||n.value>t)&&(t=n.value):n.kind===`max`&&(e===null||n.value<e)&&(e=n.value);return Number.isFinite(t)&&Number.isFinite(e)}};x.create=e=>new x({checks:[],typeName:K.ZodNumber,coerce:e?.coerce||!1,...v(e)});var S=class e extends y{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==a.bigint)return this._getInvalidInput(e);let t,n=new d;for(let i of this._def.checks)i.kind===`min`?(i.inclusive?e.data<i.value:e.data<=i.value)&&(t=this._getOrReturnCtx(e,t),u(t,{code:s.too_small,type:`bigint`,minimum:i.value,inclusive:i.inclusive,message:i.message}),n.dirty()):i.kind===`max`?(i.inclusive?e.data>i.value:e.data>=i.value)&&(t=this._getOrReturnCtx(e,t),u(t,{code:s.too_big,type:`bigint`,maximum:i.value,inclusive:i.inclusive,message:i.message}),n.dirty()):i.kind===`multipleOf`?e.data%i.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),u(t,{code:s.not_multiple_of,multipleOf:i.value,message:i.message}),n.dirty()):r.assertNever(i);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return u(t,{code:s.invalid_type,expected:a.bigint,received:t.parsedType}),f}gte(e,t){return this.setLimit(`min`,e,!0,g.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,g.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,g.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,g.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:g.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!1,message:g.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!1,message:g.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!0,message:g.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!0,message:g.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:g.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};S.create=e=>new S({checks:[],typeName:K.ZodBigInt,coerce:e?.coerce??!1,...v(e)});var C=class extends y{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==a.boolean){let t=this._getOrReturnCtx(e);return u(t,{code:s.invalid_type,expected:a.boolean,received:t.parsedType}),f}return p(e.data)}};C.create=e=>new C({typeName:K.ZodBoolean,coerce:e?.coerce||!1,...v(e)});var je=class e extends y{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==a.date){let t=this._getOrReturnCtx(e);return u(t,{code:s.invalid_type,expected:a.date,received:t.parsedType}),f}if(Number.isNaN(e.data.getTime()))return u(this._getOrReturnCtx(e),{code:s.invalid_date}),f;let t=new d,n;for(let i of this._def.checks)i.kind===`min`?e.data.getTime()<i.value&&(n=this._getOrReturnCtx(e,n),u(n,{code:s.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:`date`}),t.dirty()):i.kind===`max`?e.data.getTime()>i.value&&(n=this._getOrReturnCtx(e,n),u(n,{code:s.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:`date`}),t.dirty()):r.assertNever(i);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(e,t){return this._addCheck({kind:`min`,value:e.getTime(),message:g.toString(t)})}max(e,t){return this._addCheck({kind:`max`,value:e.getTime(),message:g.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e==null?null:new Date(e)}get maxDate(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e==null?null:new Date(e)}};je.create=e=>new je({checks:[],coerce:e?.coerce||!1,typeName:K.ZodDate,...v(e)});var Me=class extends y{_parse(e){if(this._getType(e)!==a.symbol){let t=this._getOrReturnCtx(e);return u(t,{code:s.invalid_type,expected:a.symbol,received:t.parsedType}),f}return p(e.data)}};Me.create=e=>new Me({typeName:K.ZodSymbol,...v(e)});var w=class extends y{_parse(e){if(this._getType(e)!==a.undefined){let t=this._getOrReturnCtx(e);return u(t,{code:s.invalid_type,expected:a.undefined,received:t.parsedType}),f}return p(e.data)}};w.create=e=>new w({typeName:K.ZodUndefined,...v(e)});var T=class extends y{_parse(e){if(this._getType(e)!==a.null){let t=this._getOrReturnCtx(e);return u(t,{code:s.invalid_type,expected:a.null,received:t.parsedType}),f}return p(e.data)}};T.create=e=>new T({typeName:K.ZodNull,...v(e)});var Ne=class extends y{constructor(){super(...arguments),this._any=!0}_parse(e){return p(e.data)}};Ne.create=e=>new Ne({typeName:K.ZodAny,...v(e)});var E=class extends y{constructor(){super(...arguments),this._unknown=!0}_parse(e){return p(e.data)}};E.create=e=>new E({typeName:K.ZodUnknown,...v(e)});var D=class extends y{_parse(e){let t=this._getOrReturnCtx(e);return u(t,{code:s.invalid_type,expected:a.never,received:t.parsedType}),f}};D.create=e=>new D({typeName:K.ZodNever,...v(e)});var Pe=class extends y{_parse(e){if(this._getType(e)!==a.undefined){let t=this._getOrReturnCtx(e);return u(t,{code:s.invalid_type,expected:a.void,received:t.parsedType}),f}return p(e.data)}};Pe.create=e=>new Pe({typeName:K.ZodVoid,...v(e)});var O=class e extends y{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==a.array)return u(t,{code:s.invalid_type,expected:a.array,received:t.parsedType}),f;if(r.exactLength!==null){let e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(u(t,{code:e?s.too_big:s.too_small,minimum:i?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:`array`,inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(r.minLength!==null&&t.data.length<r.minLength.value&&(u(t,{code:s.too_small,minimum:r.minLength.value,type:`array`,inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&(u(t,{code:s.too_big,maximum:r.maxLength.value,type:`array`,inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((e,n)=>r.type._parseAsync(new _(t,e,t.path,n)))).then(e=>d.mergeArray(n,e));let i=[...t.data].map((e,n)=>r.type._parseSync(new _(t,e,t.path,n)));return d.mergeArray(n,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:g.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:g.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:g.toString(n)}})}nonempty(e){return this.min(1,e)}};O.create=(e,t)=>new O({type:e,minLength:null,maxLength:null,exactLength:null,typeName:K.ZodArray,...v(t)});function k(e){if(e instanceof A){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=V.create(k(r))}return new A({...e._def,shape:()=>t})}else if(e instanceof O)return new O({...e._def,type:k(e.element)});else if(e instanceof V)return V.create(k(e.unwrap()));else if(e instanceof H)return H.create(k(e.unwrap()));else if(e instanceof P)return P.create(e.items.map(e=>k(e)));else return e}var A=class e extends y{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();return this._cached={shape:e,keys:r.objectKeys(e)},this._cached}_parse(e){if(this._getType(e)!==a.object){let t=this._getOrReturnCtx(e);return u(t,{code:s.invalid_type,expected:a.object,received:t.parsedType}),f}let{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof D&&this._def.unknownKeys===`strip`))for(let e in n.data)i.includes(e)||o.push(e);let c=[];for(let e of i){let t=r[e],i=n.data[e];c.push({key:{status:`valid`,value:e},value:t._parse(new _(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof D){let e=this._def.unknownKeys;if(e===`passthrough`)for(let e of o)c.push({key:{status:`valid`,value:e},value:{status:`valid`,value:n.data[e]}});else if(e===`strict`)o.length>0&&(u(n,{code:s.unrecognized_keys,keys:o}),t.dirty());else if(e!==`strip`)throw Error(`Internal ZodObject error: invalid unknownKeys value.`)}else{let e=this._def.catchall;for(let t of o){let r=n.data[t];c.push({key:{status:`valid`,value:t},value:e._parse(new _(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of c){let n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>d.mergeObjectSync(t,e)):d.mergeObjectSync(t,c)}get shape(){return this._def.shape()}strict(t){return g.errToObj,new e({...this._def,unknownKeys:`strict`,...t===void 0?{}:{errorMap:(e,n)=>{let r=this._def.errorMap?.(e,n).message??n.defaultError;return e.code===`unrecognized_keys`?{message:g.errToObj(t).message??r}:{message:r}}}})}strip(){return new e({...this._def,unknownKeys:`strip`})}passthrough(){return new e({...this._def,unknownKeys:`passthrough`})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:K.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let e of r.objectKeys(t))t[e]&&this.shape[e]&&(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let e of r.objectKeys(this.shape))t[e]||(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}deepPartial(){return k(this)}partial(t){let n={};for(let e of r.objectKeys(this.shape)){let r=this.shape[e];t&&!t[e]?n[e]=r:n[e]=r.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let e of r.objectKeys(this.shape))if(t&&!t[e])n[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof V;)t=t._def.innerType;n[e]=t}return new e({...this._def,shape:()=>n})}keyof(){return Ve(r.objectKeys(this.shape))}};A.create=(e,t)=>new A({shape:()=>e,unknownKeys:`strip`,catchall:D.create(),typeName:K.ZodObject,...v(t)}),A.strictCreate=(e,t)=>new A({shape:()=>e,unknownKeys:`strict`,catchall:D.create(),typeName:K.ZodObject,...v(t)}),A.lazycreate=(e,t)=>new A({shape:e,unknownKeys:`strip`,catchall:D.create(),typeName:K.ZodObject,...v(t)});var j=class extends y{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function r(e){for(let t of e)if(t.result.status===`valid`)return t.result;for(let n of e)if(n.result.status===`dirty`)return t.common.issues.push(...n.ctx.common.issues),n.result;let n=e.map(e=>new c(e.ctx.common.issues));return u(t,{code:s.invalid_union,unionErrors:n}),f}if(t.common.async)return Promise.all(n.map(async e=>{let n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}})).then(r);{let e,r=[];for(let i of n){let n={...t,common:{...t.common,issues:[]},parent:null},a=i._parseSync({data:t.data,path:t.path,parent:n});if(a.status===`valid`)return a;a.status===`dirty`&&!e&&(e={result:a,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let i=r.map(e=>new c(e));return u(t,{code:s.invalid_union,unionErrors:i}),f}}get options(){return this._def.options}};j.create=(e,t)=>new j({options:e,typeName:K.ZodUnion,...v(t)});const M=e=>e instanceof F?M(e.schema):e instanceof B?M(e.innerType()):e instanceof I?[e.value]:e instanceof L?e.options:e instanceof R?r.objectValues(e.enum):e instanceof U?M(e._def.innerType):e instanceof w?[void 0]:e instanceof T?[null]:e instanceof V?[void 0,...M(e.unwrap())]:e instanceof H?[null,...M(e.unwrap())]:e instanceof Ue||e instanceof G?M(e.unwrap()):e instanceof W?M(e._def.innerType):[];var Fe=class e extends y{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==a.object)return u(t,{code:s.invalid_type,expected:a.object,received:t.parsedType}),f;let n=this.discriminator,r=t.data[n],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(u(t,{code:s.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),f)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){let i=new Map;for(let e of n){let n=M(e.shape[t]);if(!n.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let r of n){if(i.has(r))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(r)}`);i.set(r,e)}}return new e({typeName:K.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...v(r)})}};function Ie(e,t){let n=o(e),i=o(t);if(e===t)return{valid:!0,data:e};if(n===a.object&&i===a.object){let n=r.objectKeys(t),i=r.objectKeys(e).filter(e=>n.indexOf(e)!==-1),a={...e,...t};for(let n of i){let r=Ie(e[n],t[n]);if(!r.valid)return{valid:!1};a[n]=r.data}return{valid:!0,data:a}}else if(n===a.array&&i===a.array){if(e.length!==t.length)return{valid:!1};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Ie(i,a);if(!o.valid)return{valid:!1};n.push(o.data)}return{valid:!0,data:n}}else if(n===a.date&&i===a.date&&+e==+t)return{valid:!0,data:e};else return{valid:!1}}var N=class extends y{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(ie(e)||ie(r))return f;let i=Ie(e.value,r.value);return i.valid?((ae(e)||ae(r))&&t.dirty(),{status:t.value,value:i.data}):(u(n,{code:s.invalid_intersection_types}),f)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([e,t])=>r(e,t)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};N.create=(e,t,n)=>new N({left:e,right:t,typeName:K.ZodIntersection,...v(n)});var P=class e extends y{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==a.array)return u(n,{code:s.invalid_type,expected:a.array,received:n.parsedType}),f;if(n.data.length<this._def.items.length)return u(n,{code:s.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),f;!this._def.rest&&n.data.length>this._def.items.length&&(u(n,{code:s.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),t.dirty());let r=[...n.data].map((e,t)=>{let r=this._def.items[t]||this._def.rest;return r?r._parse(new _(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(r).then(e=>d.mergeArray(t,e)):d.mergeArray(t,r)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};P.create=(e,t)=>{if(!Array.isArray(e))throw Error(`You must pass an array of schemas to z.tuple([ ... ])`);return new P({items:e,typeName:K.ZodTuple,rest:null,...v(t)})};var Le=class e extends y{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==a.object)return u(n,{code:s.invalid_type,expected:a.object,received:n.parsedType}),f;let r=[],i=this._def.keyType,o=this._def.valueType;for(let e in n.data)r.push({key:i._parse(new _(n,e,n.path,e)),value:o._parse(new _(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?d.mergeObjectAsync(t,r):d.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof y?new e({keyType:t,valueType:n,typeName:K.ZodRecord,...v(r)}):new e({keyType:b.create(),valueType:t,typeName:K.ZodRecord,...v(n)})}},Re=class extends y{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==a.map)return u(n,{code:s.invalid_type,expected:a.map,received:n.parsedType}),f;let r=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map(([e,t],a)=>({key:r._parse(new _(n,e,n.path,[a,`key`])),value:i._parse(new _(n,t,n.path,[a,`value`]))}));if(n.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let n of o){let r=await n.key,i=await n.value;if(r.status===`aborted`||i.status===`aborted`)return f;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}})}else{let e=new Map;for(let n of o){let r=n.key,i=n.value;if(r.status===`aborted`||i.status===`aborted`)return f;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}};Re.create=(e,t,n)=>new Re({valueType:t,keyType:e,typeName:K.ZodMap,...v(n)});var ze=class e extends y{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==a.set)return u(n,{code:s.invalid_type,expected:a.set,received:n.parsedType}),f;let r=this._def;r.minSize!==null&&n.data.size<r.minSize.value&&(u(n,{code:s.too_small,minimum:r.minSize.value,type:`set`,inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),r.maxSize!==null&&n.data.size>r.maxSize.value&&(u(n,{code:s.too_big,maximum:r.maxSize.value,type:`set`,inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());let i=this._def.valueType;function o(e){let n=new Set;for(let r of e){if(r.status===`aborted`)return f;r.status===`dirty`&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}let c=[...n.data.values()].map((e,t)=>i._parse(new _(n,e,n.path,t)));return n.common.async?Promise.all(c).then(e=>o(e)):o(c)}min(t,n){return new e({...this._def,minSize:{value:t,message:g.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:g.toString(n)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};ze.create=(e,t)=>new ze({valueType:e,minSize:null,maxSize:null,typeName:K.ZodSet,...v(t)});var Be=class e extends y{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==a.function)return u(t,{code:s.invalid_type,expected:a.function,received:t.parsedType}),f;function n(e,n){return ne({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,te(),l].filter(e=>!!e),issueData:{code:s.invalid_arguments,argumentsError:n}})}function r(e,n){return ne({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,te(),l].filter(e=>!!e),issueData:{code:s.invalid_return_type,returnTypeError:n}})}let i={errorMap:t.common.contextualErrorMap},o=t.data;if(this._def.returns instanceof z){let e=this;return p(async function(...t){let a=new c([]),s=await e._def.args.parseAsync(t,i).catch(e=>{throw a.addIssue(n(t,e)),a}),l=await Reflect.apply(o,this,s);return await e._def.returns._def.type.parseAsync(l,i).catch(e=>{throw a.addIssue(r(l,e)),a})})}else{let e=this;return p(function(...t){let a=e._def.args.safeParse(t,i);if(!a.success)throw new c([n(t,a.error)]);let s=Reflect.apply(o,this,a.data),l=e._def.returns.safeParse(s,i);if(!l.success)throw new c([r(s,l.error)]);return l.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:P.create(t).rest(E.create())})}returns(t){return new e({...this._def,returns:t})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(t,n,r){return new e({args:t||P.create([]).rest(E.create()),returns:n||E.create(),typeName:K.ZodFunction,...v(r)})}},F=class extends y{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};F.create=(e,t)=>new F({getter:e,typeName:K.ZodLazy,...v(t)});var I=class extends y{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return u(t,{received:t.data,code:s.invalid_literal,expected:this._def.value}),f}return{status:`valid`,value:e.data}}get value(){return this._def.value}};I.create=(e,t)=>new I({value:e,typeName:K.ZodLiteral,...v(t)});function Ve(e,t){return new L({values:e,typeName:K.ZodEnum,...v(t)})}var L=class e extends y{_parse(e){if(typeof e.data!=`string`){let t=this._getOrReturnCtx(e),n=this._def.values;return u(t,{expected:r.joinValues(n),received:t.parsedType,code:s.invalid_type}),f}if(this._cache||=new Set(this._def.values),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return u(t,{received:t.data,code:s.invalid_enum_value,options:n}),f}return p(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(e=>!t.includes(e)),{...this._def,...n})}};L.create=Ve;var R=class extends y{_parse(e){let t=r.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==a.string&&n.parsedType!==a.number){let e=r.objectValues(t);return u(n,{expected:r.joinValues(e),received:n.parsedType,code:s.invalid_type}),f}if(this._cache||=new Set(r.getValidEnumValues(this._def.values)),!this._cache.has(e.data)){let e=r.objectValues(t);return u(n,{received:n.data,code:s.invalid_enum_value,options:e}),f}return p(e.data)}get enum(){return this._def.values}};R.create=(e,t)=>new R({values:e,typeName:K.ZodNativeEnum,...v(t)});var z=class extends y{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==a.promise&&t.common.async===!1?(u(t,{code:s.invalid_type,expected:a.promise,received:t.parsedType}),f):p((t.parsedType===a.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}};z.create=(e,t)=>new z({type:e,typeName:K.ZodPromise,...v(t)});var B=class extends y{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===K.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),i=this._def.effect||null,a={addIssue:e=>{u(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),i.type===`preprocess`){let e=i.transform(n.data,a);if(n.common.async)return Promise.resolve(e).then(async e=>{if(t.value===`aborted`)return f;let r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return r.status===`aborted`?f:r.status===`dirty`||t.value===`dirty`?re(r.value):r});{if(t.value===`aborted`)return f;let r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return r.status===`aborted`?f:r.status===`dirty`||t.value===`dirty`?re(r.value):r}}if(i.type===`refinement`){let e=e=>{let t=i.refinement(e,a);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error(`Async refinement encountered during synchronous parse operation. Use .parseAsync instead.`);return e};if(n.common.async===!1){let r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return r.status===`aborted`?f:(r.status===`dirty`&&t.dirty(),e(r.value),{status:t.value,value:r.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(n=>n.status===`aborted`?f:(n.status===`dirty`&&t.dirty(),e(n.value).then(()=>({status:t.value,value:n.value}))))}if(i.type===`transform`)if(n.common.async===!1){let e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!m(e))return f;let r=i.transform(e.value,a);if(r instanceof Promise)throw Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);return{status:t.value,value:r}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(e=>m(e)?Promise.resolve(i.transform(e.value,a)).then(e=>({status:t.value,value:e})):f);r.assertNever(i)}};B.create=(e,t,n)=>new B({schema:e,typeName:K.ZodEffects,effect:t,...v(n)}),B.createWithPreprocess=(e,t,n)=>new B({schema:t,effect:{type:`preprocess`,transform:e},typeName:K.ZodEffects,...v(n)});var V=class extends y{_parse(e){return this._getType(e)===a.undefined?p(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};V.create=(e,t)=>new V({innerType:e,typeName:K.ZodOptional,...v(t)});var H=class extends y{_parse(e){return this._getType(e)===a.null?p(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};H.create=(e,t)=>new H({innerType:e,typeName:K.ZodNullable,...v(t)});var U=class extends y{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===a.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};U.create=(e,t)=>new U({innerType:e,typeName:K.ZodDefault,defaultValue:typeof t.default==`function`?t.default:()=>t.default,...v(t)});var W=class extends y{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return h(r)?r.then(e=>({status:`valid`,value:e.status===`valid`?e.value:this._def.catchValue({get error(){return new c(n.common.issues)},input:n.data})})):{status:`valid`,value:r.status===`valid`?r.value:this._def.catchValue({get error(){return new c(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};W.create=(e,t)=>new W({innerType:e,typeName:K.ZodCatch,catchValue:typeof t.catch==`function`?t.catch:()=>t.catch,...v(t)});var He=class extends y{_parse(e){if(this._getType(e)!==a.nan){let t=this._getOrReturnCtx(e);return u(t,{code:s.invalid_type,expected:a.nan,received:t.parsedType}),f}return{status:`valid`,value:e.data}}};He.create=e=>new He({typeName:K.ZodNaN,...v(e)});var Ue=class extends y{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},We=class e extends y{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?f:e.status===`dirty`?(t.dirty(),re(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{let e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?f:e.status===`dirty`?(t.dirty(),{status:`dirty`,value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(t,n){return new e({in:t,out:n,typeName:K.ZodPipeline})}},G=class extends y{_parse(e){let t=this._def.innerType._parse(e),n=e=>(m(e)&&(e.value=Object.freeze(e.value)),e);return h(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}};G.create=(e,t)=>new G({innerType:e,typeName:K.ZodReadonly,...v(t)}),A.lazycreate;var K;(function(e){e.ZodString=`ZodString`,e.ZodNumber=`ZodNumber`,e.ZodNaN=`ZodNaN`,e.ZodBigInt=`ZodBigInt`,e.ZodBoolean=`ZodBoolean`,e.ZodDate=`ZodDate`,e.ZodSymbol=`ZodSymbol`,e.ZodUndefined=`ZodUndefined`,e.ZodNull=`ZodNull`,e.ZodAny=`ZodAny`,e.ZodUnknown=`ZodUnknown`,e.ZodNever=`ZodNever`,e.ZodVoid=`ZodVoid`,e.ZodArray=`ZodArray`,e.ZodObject=`ZodObject`,e.ZodUnion=`ZodUnion`,e.ZodDiscriminatedUnion=`ZodDiscriminatedUnion`,e.ZodIntersection=`ZodIntersection`,e.ZodTuple=`ZodTuple`,e.ZodRecord=`ZodRecord`,e.ZodMap=`ZodMap`,e.ZodSet=`ZodSet`,e.ZodFunction=`ZodFunction`,e.ZodLazy=`ZodLazy`,e.ZodLiteral=`ZodLiteral`,e.ZodEnum=`ZodEnum`,e.ZodEffects=`ZodEffects`,e.ZodNativeEnum=`ZodNativeEnum`,e.ZodOptional=`ZodOptional`,e.ZodNullable=`ZodNullable`,e.ZodDefault=`ZodDefault`,e.ZodCatch=`ZodCatch`,e.ZodPromise=`ZodPromise`,e.ZodBranded=`ZodBranded`,e.ZodPipeline=`ZodPipeline`,e.ZodReadonly=`ZodReadonly`})(K||={});const q=b.create,Ge=x.create;He.create,S.create;const Ke=C.create;je.create,Me.create,w.create,T.create;const qe=Ne.create;E.create,D.create,Pe.create;const J=O.create,Y=A.create;A.strictCreate;const Je=j.create,Ye=Fe.create;N.create,P.create;const X=Le.create;Re.create,ze.create,Be.create;const Xe=F.create,Ze=I.create,Z=L.create;R.create,z.create,B.create,V.create,H.create,B.createWithPreprocess,We.create;const Qe={string:(e=>b.create({...e,coerce:!0})),number:(e=>x.create({...e,coerce:!0})),boolean:(e=>C.create({...e,coerce:!0})),bigint:(e=>S.create({...e,coerce:!0})),date:(e=>je.create({...e,coerce:!0}))};var $e=Je([q().refine(e=>e.includes(`{name}`),{message:`Registry URL must include {name} placeholder`}),Y({url:q().refine(e=>e.includes(`{name}`),{message:`Registry URL must include {name} placeholder`}),params:X(q(),q()).optional(),headers:X(q(),q()).optional()})]),et=X(q().refine(e=>e.startsWith(`@`),{message:`Registry names must start with @ (e.g., @v0, @acme)`}),$e),tt=Y({$schema:q().optional(),style:q(),rsc:Qe.boolean().default(!1),tsx:Qe.boolean().default(!0),tailwind:Y({config:q().optional(),css:q(),baseColor:q(),cssVariables:Ke().default(!0),prefix:q().default(``).optional()}),iconLibrary:q().optional(),menuColor:Z([`default`,`inverted`]).default(`default`).optional(),menuAccent:Z([`subtle`,`bold`]).default(`subtle`).optional(),aliases:Y({components:q(),utils:q(),ui:q().optional(),lib:q().optional(),hooks:q().optional()}),registries:et.optional()}).strict();X(tt.extend({resolvedPaths:Y({cwd:q(),tailwindConfig:q(),tailwindCss:q(),utils:q(),components:q(),lib:q(),hooks:q(),ui:q()})}));var nt=Z([`registry:lib`,`registry:block`,`registry:component`,`registry:ui`,`registry:hook`,`registry:page`,`registry:file`,`registry:theme`,`registry:style`,`registry:item`,`registry:base`,`registry:font`,`registry:example`,`registry:internal`]),rt=Ye(`type`,[Y({path:q(),content:q().optional(),type:Z([`registry:file`,`registry:page`]),target:q()}),Y({path:q(),content:q().optional(),type:nt.exclude([`registry:file`,`registry:page`]),target:q().optional()})]),it=Y({config:Y({content:J(q()).optional(),theme:X(q(),qe()).optional(),plugins:J(q()).optional()}).optional()}),at=Y({theme:X(q(),q()).optional(),light:X(q(),q()).optional(),dark:X(q(),q()).optional()}),ot=Xe(()=>Je([q(),J(Je([q(),X(q(),q())])),X(q(),ot)])),st=X(q(),ot),ct=X(q(),q()),lt=Y({family:q(),provider:Ze(`google`),import:q(),variable:q(),weight:J(q()).optional(),subsets:J(q()).optional()}),Q=Y({$schema:q().optional(),extends:q().optional(),name:q(),title:q().optional(),author:q().min(2).optional(),description:q().optional(),dependencies:J(q()).optional(),devDependencies:J(q()).optional(),registryDependencies:J(q()).optional(),files:J(rt).optional(),tailwind:it.optional(),cssVars:at.optional(),css:st.optional(),envVars:ct.optional(),meta:X(q(),qe()).optional(),docs:q().optional(),categories:J(q()).optional()}),ut=Ye(`type`,[Q.extend({type:Ze(`registry:base`),config:tt.deepPartial().optional()}),Q.extend({type:Ze(`registry:font`),font:lt}),Q.extend({type:nt.exclude([`registry:base`,`registry:font`])})]),dt=Y({name:q(),homepage:q(),items:J(ut)});J(ut),J(Y({name:q(),label:q()})),X(q(),X(q(),q())),Y({inlineColors:Y({light:X(q(),q()),dark:X(q(),q())}),cssVars:at,cssVarsV4:at.optional(),inlineColorsTemplate:q(),cssVarsTemplate:q()}),Q.pick({dependencies:!0,devDependencies:!0,files:!0,tailwind:!0,cssVars:!0,css:!0,envVars:!0,docs:!0}).extend({fonts:J(Q.extend({type:Ze(`registry:font`),font:lt})).optional()});var ft=Y({name:q(),type:q().optional(),description:q().optional(),registry:q(),addCommandArgument:q()});Y({pagination:Y({total:Ge(),offset:Ge(),limit:Ge(),hasMore:Ke()}),items:J(ft)}),X(q().regex(/^@[a-zA-Z0-9][a-zA-Z0-9-_]*$/),q()),Y({presets:J(Y({name:q(),title:q(),description:q(),base:q(),style:q(),baseColor:q(),theme:q(),iconLibrary:q(),font:q(),menuAccent:Z([`subtle`,`bold`]),menuColor:Z([`default`,`inverted`]),radius:q()}))});function pt(r){return{output:async(i,{cwd:a})=>{if(i.homepage===void 0)throw new e(`No homepage was provided for ${i.name}`,{suggestion:`Please provide a homepage in your config.`});for(let t of i.items){let n=$(t.type);if(n===`registry:base`||n===`registry:font`)throw new e(`${t.name} is of type ${n} and cannot be added to the registry.`,{suggestion:`Please remove the item from the registry.`});if(!nt.safeParse(n).success)throw new e(`Invalid item type: ${n} for ${t.name}. Expected one of: ${nt.options.join(`, `)}`,{suggestion:`Please use a valid item type.`})}let o={$schema:`https://ui.shadcn.com/schema/registry.json`,name:i.name,homepage:i.homepage,items:i.items.map(t=>({name:t.name,title:t.title,description:t.description,type:$(t.type),envVars:t.envVars,dependencies:t.dependencies?.map(e=>`${e.name}${e.version?`@${e.version}`:``}`),registryDependencies:t.registryDependencies,files:t.files.map(n=>{let r=$(n.type);if((r===`registry:page`||r===`registry:file`)&&n.target===void 0)throw new e(`Target is required for registry items with type ${r}. Please provide a target for ${n.path} on ${t.name}`,{suggestion:`Please provide a target for the file.`});return{type:r,path:n.path,target:n.target}})}))},s=i.items.map(e=>({$schema:`https://ui.shadcn.com/schema/registry-item.json`,name:e.name,title:e.title,description:e.description,type:$(e.type),files:e.files.map(e=>({type:$(e.type),path:e.path,target:e.target,content:e.content})),envVars:e.envVars,registryDependencies:e.registryDependencies,dependencies:e.dependencies?.map(e=>`${e.name}${e.version?`@${e.version}`:``}`)})),c=dt.safeParse(o);if(!c.success)throw new e(`Invalid registry ${o.name}: ${c.error.message}`,{suggestion:`This one's on us. Please file an issue at https://github.com/jsrepojs/jsrepo/issues`});for(let t of s){let n=ut.safeParse(t);if(!n.success)throw new e(`Invalid item ${t.name}: ${n.error.message}`,{suggestion:`This one's on us. Please file an issue at https://github.com/jsrepojs/jsrepo/issues`})}let l=n.join(a,r.dir);t.existsSync(l)||t.mkdirSync(l,{recursive:!0}),t.writeFileSync(n.join(l,`registry.json`),mt(o,{format:r.format}));for(let e of s)t.writeFileSync(n.join(l,`${e.name}.json`),mt(e,{format:r.format}))},clean:async({cwd:e})=>{let i=n.join(e,r.dir);t.existsSync(i)&&t.rmSync(n.join(e,r.dir),{recursive:!0})}}}function $(e){return e?e.startsWith(`registry:`)?e:`registry:${e}`:`registry:ui`}function mt(e,t={}){return JSON.stringify(e,null,t.format?` `:void 0)}export{pt as t};
|
|
2
|
+
//# sourceMappingURL=output-CH39YQsU.mjs.map
|
|
@@ -7,5 +7,5 @@ type OutputOptions = {
|
|
|
7
7
|
};
|
|
8
8
|
declare function output(options: OutputOptions): Output;
|
|
9
9
|
//#endregion
|
|
10
|
-
export {
|
|
11
|
-
//# sourceMappingURL=output
|
|
10
|
+
export { OutputOptions, output };
|
|
11
|
+
//# sourceMappingURL=output.d.mts.map
|
package/dist/output.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./output-CH39YQsU.mjs";export{e as output};
|
|
@@ -31,5 +31,5 @@ type ShadcnOptions = {
|
|
|
31
31
|
*/
|
|
32
32
|
declare function provider(options?: ShadcnOptions): ProviderFactory;
|
|
33
33
|
//#endregion
|
|
34
|
-
export {
|
|
35
|
-
//# sourceMappingURL=provider
|
|
34
|
+
export { ShadcnOptions, provider };
|
|
35
|
+
//# sourceMappingURL=provider.d.mts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{JsrepoError as e,ProviderFetchError as t}from"jsrepo/errors";function n(e={}){return{name:`shadcn`,matches:e=>e.startsWith(`shadcn:`),create:(t,n)=>r.create(t,e,n)}}var r=class n{constructor(e,t){this.state=e,this.opts=t}async fetch(e,{fetch:n=fetch}){let r=this.state.registryUrl.replace(`{name}`,e.replace(`.json`,``));try{let e=await n(r.toString());if(!e.ok)throw e.headers.get(`content-type`)?.includes(`application/json`)?new t(`${e.status} ${(await e.json()).message??e.statusText}`,r.toString()):new t(`${e.status} ${e.statusText}`,r.toString());return await e.text()}catch(e){throw e instanceof t?new t(e.originalMessage,r.toString()):new t(`${e instanceof Error?e.message:String(e)}`,r.toString())}}static async create(t,r,{fetch:i=fetch}){let a=t.slice(7),o=r.registryIndexUrl??`https://ui.shadcn.com/r/registries.json`;try{let t=await i(o);if(!t.ok)throw new e(`Failed to fetch registry index ${t.status} ${t.statusText}`,{suggestion:`Please try again`});let s=(await t.json())[a];if(!s)throw new e(`Registry ${a} not found in registry index`,{suggestion:`Please check the registry name`});return new n({registryUrl:s},r)}catch{throw new e(`Failed to fetch registry index at ${o}`,{suggestion:`Please try again`})}}};export{n as
|
|
2
|
-
//# sourceMappingURL=provider
|
|
1
|
+
import{JsrepoError as e,ProviderFetchError as t}from"jsrepo/errors";function n(e={}){return{name:`shadcn`,matches:e=>e.startsWith(`shadcn:`),create:(t,n)=>r.create(t,e,n)}}var r=class n{constructor(e,t){this.state=e,this.opts=t}async fetch(e,{fetch:n=fetch}){let r=this.state.registryUrl.replace(`{name}`,e.replace(`.json`,``));try{let e=await n(r.toString());if(!e.ok)throw e.headers.get(`content-type`)?.includes(`application/json`)?new t(`${e.status} ${(await e.json()).message??e.statusText}`,r.toString()):new t(`${e.status} ${e.statusText}`,r.toString());return await e.text()}catch(e){throw e instanceof t?new t(e.originalMessage,r.toString()):new t(`${e instanceof Error?e.message:String(e)}`,r.toString())}}static async create(t,r,{fetch:i=fetch}){let a=t.slice(7),o=r.registryIndexUrl??`https://ui.shadcn.com/r/registries.json`;try{let t=await i(o);if(!t.ok)throw new e(`Failed to fetch registry index ${t.status} ${t.statusText}`,{suggestion:`Please try again`});let s=(await t.json())[a];if(!s)throw new e(`Registry ${a} not found in registry index`,{suggestion:`Please check the registry name`});return new n({registryUrl:s},r)}catch{throw new e(`Failed to fetch registry index at ${o}`,{suggestion:`Please try again`})}}};export{n as provider};
|
|
2
|
+
//# sourceMappingURL=provider.mjs.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsrepo/shadcn",
|
|
3
3
|
"description": "A package to help you distribute your jsrepo registry as a shadcn registry.",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.12",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://jsrepo.dev/docs/outputs/shadcn",
|
|
7
7
|
"author": {
|
|
@@ -25,37 +25,37 @@
|
|
|
25
25
|
"type": "module",
|
|
26
26
|
"exports": {
|
|
27
27
|
".": {
|
|
28
|
-
"types": "./dist/index.d.
|
|
29
|
-
"default": "./dist/index.
|
|
28
|
+
"types": "./dist/index.d.mts",
|
|
29
|
+
"default": "./dist/index.mjs"
|
|
30
30
|
},
|
|
31
31
|
"./output": {
|
|
32
|
-
"types": "./dist/output.d.
|
|
33
|
-
"default": "./dist/output.
|
|
32
|
+
"types": "./dist/output.d.mts",
|
|
33
|
+
"default": "./dist/output.mjs"
|
|
34
34
|
},
|
|
35
35
|
"./provider": {
|
|
36
|
-
"types": "./dist/provider.d.
|
|
37
|
-
"default": "./dist/provider.
|
|
36
|
+
"types": "./dist/provider.d.mts",
|
|
37
|
+
"default": "./dist/provider.mjs"
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
|
-
"main": "./dist/index.
|
|
40
|
+
"main": "./dist/index.mjs",
|
|
41
41
|
"files": [
|
|
42
42
|
"dist/**/*",
|
|
43
43
|
"!dist/**/*.map"
|
|
44
44
|
],
|
|
45
45
|
"peerDependencies": {
|
|
46
|
-
"jsrepo": "3.0.
|
|
46
|
+
"jsrepo": "3.0.11"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@types/node": "^
|
|
50
|
-
"shadcn": "^3.
|
|
51
|
-
"tsdown": "
|
|
49
|
+
"@types/node": "^25.0.3",
|
|
50
|
+
"shadcn": "^3.6.3",
|
|
51
|
+
"tsdown": "0.19.0-beta.3",
|
|
52
52
|
"typescript": "^5.9.3",
|
|
53
|
-
"zod": "^4.
|
|
53
|
+
"zod": "^4.3.5"
|
|
54
54
|
},
|
|
55
55
|
"scripts": {
|
|
56
56
|
"build": "tsdown",
|
|
57
57
|
"dev": "tsdown --watch",
|
|
58
58
|
"check": "tsc --noEmit",
|
|
59
|
-
"bundle-analyze": "FORCE_COLOR=1 node ../../bundle-analyzer/dist/index.
|
|
59
|
+
"bundle-analyze": "FORCE_COLOR=1 node ../../bundle-analyzer/dist/index.mjs analyze ."
|
|
60
60
|
}
|
|
61
61
|
}
|
package/dist/index.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./output-oZQMHaJS.js";import{t}from"./provider-w0GjKOJb.js";import{JsrepoError as n}from"jsrepo";const r=/^(@[^/]+\/[^@/]+)(?:@([^/]+))?(\/.*)?$/,i=/^([^@/]+)(?:@([^/]+))?(\/.*)?$/;function a(e){let t=r.exec(e)||i.exec(e);if(t)return{name:t[1]||``,version:t[2]||void 0,path:t[3]||``}}function o(e){return{...e,items:e.items.map(e=>({...e,dependencies:e.dependencies?.map(e=>{let t=a(e);if(t===void 0)throw new n(`Invalid package name: ${e}`,{suggestion:`Please provide a valid package name.`});return{ecosystem:`js`,name:t.name,version:t.version}})}))}}export{t as default,o as defineShadcnRegistry,e as output};
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
package/dist/output-oZQMHaJS.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{JsrepoError as e}from"jsrepo";import t from"node:fs";import n from"node:path";var r;(function(e){e.assertEqual=e=>{};function t(e){}e.assertIs=t;function n(e){throw Error()}e.assertNever=n,e.arrayToEnum=e=>{let t={};for(let n of e)t[n]=n;return t},e.getValidEnumValues=t=>{let n=e.objectKeys(t).filter(e=>typeof t[t[e]]!=`number`),r={};for(let e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys=typeof Object.keys==`function`?e=>Object.keys(e):e=>{let t=[];for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(let n of e)if(t(n))return n},e.isInteger=typeof Number.isInteger==`function`?e=>Number.isInteger(e):e=>typeof e==`number`&&Number.isFinite(e)&&Math.floor(e)===e;function r(e,t=` | `){return e.map(e=>typeof e==`string`?`'${e}'`:e).join(t)}e.joinValues=r,e.jsonStringifyReplacer=(e,t)=>typeof t==`bigint`?t.toString():t})(r||={});var i;(function(e){e.mergeShapes=(e,t)=>({...e,...t})})(i||={});const a=r.arrayToEnum([`string`,`nan`,`number`,`integer`,`float`,`boolean`,`date`,`bigint`,`symbol`,`function`,`undefined`,`null`,`array`,`object`,`unknown`,`promise`,`void`,`never`,`map`,`set`]),o=e=>{switch(typeof e){case`undefined`:return a.undefined;case`string`:return a.string;case`number`:return Number.isNaN(e)?a.nan:a.number;case`boolean`:return a.boolean;case`function`:return a.function;case`bigint`:return a.bigint;case`symbol`:return a.symbol;case`object`:return Array.isArray(e)?a.array:e===null?a.null:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?a.promise:typeof Map<`u`&&e instanceof Map?a.map:typeof Set<`u`&&e instanceof Set?a.set:typeof Date<`u`&&e instanceof Date?a.date:a.object;default:return a.unknown}},s=r.arrayToEnum([`invalid_type`,`invalid_literal`,`custom`,`invalid_union`,`invalid_union_discriminator`,`invalid_enum_value`,`unrecognized_keys`,`invalid_arguments`,`invalid_return_type`,`invalid_date`,`invalid_string`,`too_small`,`too_big`,`invalid_intersection_types`,`not_multiple_of`,`not_finite`]);var c=class e extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name=`ZodError`,this.issues=e}format(e){let t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`)i.unionErrors.map(r);else if(i.code===`invalid_return_type`)r(i.returnTypeError);else if(i.code===`invalid_arguments`)r(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}static assert(t){if(!(t instanceof e))throw Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,r.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=e=>e.message){let t={},n=[];for(let r of this.issues)if(r.path.length>0){let n=r.path[0];t[n]=t[n]||[],t[n].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};c.create=e=>new c(e);var l=(e,t)=>{let n;switch(e.code){case s.invalid_type:n=e.received===a.undefined?`Required`:`Expected ${e.expected}, received ${e.received}`;break;case s.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,r.jsonStringifyReplacer)}`;break;case s.unrecognized_keys:n=`Unrecognized key(s) in object: ${r.joinValues(e.keys,`, `)}`;break;case s.invalid_union:n=`Invalid input`;break;case s.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${r.joinValues(e.options)}`;break;case s.invalid_enum_value:n=`Invalid enum value. Expected ${r.joinValues(e.options)}, received '${e.received}'`;break;case s.invalid_arguments:n=`Invalid function arguments`;break;case s.invalid_return_type:n=`Invalid function return type`;break;case s.invalid_date:n=`Invalid date`;break;case s.invalid_string:typeof e.validation==`object`?`includes`in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==`number`&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):`startsWith`in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:`endsWith`in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:r.assertNever(e.validation):n=e.validation===`regex`?`Invalid`:`Invalid ${e.validation}`;break;case s.too_small:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at least`:`more than`} ${e.minimum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at least`:`over`} ${e.minimum} character(s)`:e.type===`number`||e.type===`bigint`?`Number must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${e.minimum}`:e.type===`date`?`Date must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${new Date(Number(e.minimum))}`:`Invalid input`;break;case s.too_big:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at most`:`less than`} ${e.maximum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at most`:`under`} ${e.maximum} character(s)`:e.type===`number`?`Number must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`bigint`?`BigInt must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`date`?`Date must be ${e.exact?`exactly`:e.inclusive?`smaller than or equal to`:`smaller than`} ${new Date(Number(e.maximum))}`:`Invalid input`;break;case s.custom:n=`Invalid input`;break;case s.invalid_intersection_types:n=`Intersection results could not be merged`;break;case s.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case s.not_finite:n=`Number must be finite`;break;default:n=t.defaultError,r.assertNever(e)}return{message:n}};let ee=l;function te(){return ee}const ne=e=>{let{data:t,path:n,errorMaps:r,issueData:i}=e,a=[...n,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s=``,c=r.filter(e=>!!e).slice().reverse();for(let e of c)s=e(o,{data:t,defaultError:s}).message;return{...i,path:a,message:s}};function u(e,t){let n=te(),r=ne({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===l?void 0:l].filter(e=>!!e)});e.common.issues.push(r)}var d=class e{constructor(){this.value=`valid`}dirty(){this.value===`valid`&&(this.value=`dirty`)}abort(){this.value!==`aborted`&&(this.value=`aborted`)}static mergeArray(e,t){let n=[];for(let r of t){if(r.status===`aborted`)return f;r.status===`dirty`&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(t,n){let r=[];for(let e of n){let t=await e.key,n=await e.value;r.push({key:t,value:n})}return e.mergeObjectSync(t,r)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:t,value:i}=r;if(t.status===`aborted`||i.status===`aborted`)return f;t.status===`dirty`&&e.dirty(),i.status===`dirty`&&e.dirty(),t.value!==`__proto__`&&(i.value!==void 0||r.alwaysSet)&&(n[t.value]=i.value)}return{status:e.value,value:n}}};const f=Object.freeze({status:`aborted`}),re=e=>({status:`dirty`,value:e}),p=e=>({status:`valid`,value:e}),ie=e=>e.status===`aborted`,ae=e=>e.status===`dirty`,m=e=>e.status===`valid`,h=e=>typeof Promise<`u`&&e instanceof Promise;var g;(function(e){e.errToObj=e=>typeof e==`string`?{message:e}:e||{},e.toString=e=>typeof e==`string`?e:e?.message})(g||={});var _=class{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}};const oe=(e,t)=>{if(m(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error(`Validation failed but no issues detected.`);return{success:!1,get error(){return this._error||=new c(e.common.issues),this._error}}};function v(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{let{message:a}=e;return t.code===`invalid_enum_value`?{message:a??i.defaultError}:i.data===void 0?{message:a??r??i.defaultError}:t.code===`invalid_type`?{message:a??n??i.defaultError}:{message:i.defaultError}},description:i}}var y=class{get description(){return this._def.description}_getType(e){return o(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:o(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new d,ctx:{common:e.parent.common,data:e.data,parsedType:o(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(h(t))throw Error(`Synchronous parse encountered promise.`);return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:o(e)};return oe(n,this._parseSync({data:e,path:n.path,parent:n}))}"~validate"(e){let t={common:{issues:[],async:!!this[`~standard`].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:o(e)};if(!this[`~standard`].async)try{let n=this._parseSync({data:e,path:[],parent:t});return m(n)?{value:n.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes(`encountered`)&&(this[`~standard`].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>m(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:o(e)},r=this._parse({data:e,path:n.path,parent:n});return oe(n,await(h(r)?r:Promise.resolve(r)))}refine(e,t){let n=e=>typeof t==`string`||t===void 0?{message:t}:typeof t==`function`?t(e):t;return this._refinement((t,r)=>{let i=e(t),a=()=>r.addIssue({code:s.custom,...n(t)});return typeof Promise<`u`&&i instanceof Promise?i.then(e=>e?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,t){return this._refinement((n,r)=>e(n)?!0:(r.addIssue(typeof t==`function`?t(n,r):t),!1))}_refinement(e){return new V({schema:this,typeName:q.ZodEffects,effect:{type:`refinement`,refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this[`~standard`]={version:1,vendor:`zod`,validate:e=>this[`~validate`](e)}}optional(){return H.create(this,this._def)}nullable(){return U.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return k.create(this)}promise(){return B.create(this,this._def)}or(e){return M.create([this,e],this._def)}and(e){return P.create(this,e,this._def)}transform(e){return new V({...v(this._def),schema:this,typeName:q.ZodEffects,effect:{type:`transform`,transform:e}})}default(e){let t=typeof e==`function`?e:()=>e;return new W({...v(this._def),innerType:this,defaultValue:t,typeName:q.ZodDefault})}brand(){return new He({typeName:q.ZodBranded,type:this,...v(this._def)})}catch(e){let t=typeof e==`function`?e:()=>e;return new G({...v(this._def),innerType:this,catchValue:t,typeName:q.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Ue.create(this,e)}readonly(){return K.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}};const se=/^c[^\s-]{8,}$/i,ce=/^[0-9a-z]+$/,le=/^[0-9A-HJKMNP-TV-Z]{26}$/i,ue=/^[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,de=/^[a-z0-9_-]{21}$/i,fe=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,pe=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,me=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let he;const ge=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,_e=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ve=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,ye=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,be=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,xe=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Se=`((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`,Ce=RegExp(`^${Se}$`);function we(e){let t=`[0-5]\\d`;e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision??(t=`${t}(\\.\\d+)?`);let n=e.precision?`+`:`?`;return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function Te(e){return RegExp(`^${we(e)}$`)}function Ee(e){let t=`${Se}T${we(e)}`,n=[];return n.push(e.local?`Z?`:`Z`),e.offset&&n.push(`([+-]\\d{2}:?\\d{2})`),t=`${t}(${n.join(`|`)})`,RegExp(`^${t}$`)}function De(e,t){return!!((t===`v4`||!t)&&ge.test(e)||(t===`v6`||!t)&&ve.test(e))}function Oe(e,t){if(!fe.test(e))return!1;try{let[n]=e.split(`.`);if(!n)return!1;let r=n.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(n.length+(4-n.length%4)%4,`=`),i=JSON.parse(atob(r));return!(typeof i!=`object`||!i||`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&i.alg!==t)}catch{return!1}}function ke(e,t){return!!((t===`v4`||!t)&&_e.test(e)||(t===`v6`||!t)&&ye.test(e))}var b=class e extends y{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==a.string){let t=this._getOrReturnCtx(e);return u(t,{code:s.invalid_type,expected:a.string,received:t.parsedType}),f}let t=new d,n;for(let i of this._def.checks)if(i.kind===`min`)e.data.length<i.value&&(n=this._getOrReturnCtx(e,n),u(n,{code:s.too_small,minimum:i.value,type:`string`,inclusive:!0,exact:!1,message:i.message}),t.dirty());else if(i.kind===`max`)e.data.length>i.value&&(n=this._getOrReturnCtx(e,n),u(n,{code:s.too_big,maximum:i.value,type:`string`,inclusive:!0,exact:!1,message:i.message}),t.dirty());else if(i.kind===`length`){let r=e.data.length>i.value,a=e.data.length<i.value;(r||a)&&(n=this._getOrReturnCtx(e,n),r?u(n,{code:s.too_big,maximum:i.value,type:`string`,inclusive:!0,exact:!0,message:i.message}):a&&u(n,{code:s.too_small,minimum:i.value,type:`string`,inclusive:!0,exact:!0,message:i.message}),t.dirty())}else if(i.kind===`email`)me.test(e.data)||(n=this._getOrReturnCtx(e,n),u(n,{validation:`email`,code:s.invalid_string,message:i.message}),t.dirty());else if(i.kind===`emoji`)he||=RegExp(`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,`u`),he.test(e.data)||(n=this._getOrReturnCtx(e,n),u(n,{validation:`emoji`,code:s.invalid_string,message:i.message}),t.dirty());else if(i.kind===`uuid`)ue.test(e.data)||(n=this._getOrReturnCtx(e,n),u(n,{validation:`uuid`,code:s.invalid_string,message:i.message}),t.dirty());else if(i.kind===`nanoid`)de.test(e.data)||(n=this._getOrReturnCtx(e,n),u(n,{validation:`nanoid`,code:s.invalid_string,message:i.message}),t.dirty());else if(i.kind===`cuid`)se.test(e.data)||(n=this._getOrReturnCtx(e,n),u(n,{validation:`cuid`,code:s.invalid_string,message:i.message}),t.dirty());else if(i.kind===`cuid2`)ce.test(e.data)||(n=this._getOrReturnCtx(e,n),u(n,{validation:`cuid2`,code:s.invalid_string,message:i.message}),t.dirty());else if(i.kind===`ulid`)le.test(e.data)||(n=this._getOrReturnCtx(e,n),u(n,{validation:`ulid`,code:s.invalid_string,message:i.message}),t.dirty());else if(i.kind===`url`)try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),u(n,{validation:`url`,code:s.invalid_string,message:i.message}),t.dirty()}else i.kind===`regex`?(i.regex.lastIndex=0,i.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),u(n,{validation:`regex`,code:s.invalid_string,message:i.message}),t.dirty())):i.kind===`trim`?e.data=e.data.trim():i.kind===`includes`?e.data.includes(i.value,i.position)||(n=this._getOrReturnCtx(e,n),u(n,{code:s.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),t.dirty()):i.kind===`toLowerCase`?e.data=e.data.toLowerCase():i.kind===`toUpperCase`?e.data=e.data.toUpperCase():i.kind===`startsWith`?e.data.startsWith(i.value)||(n=this._getOrReturnCtx(e,n),u(n,{code:s.invalid_string,validation:{startsWith:i.value},message:i.message}),t.dirty()):i.kind===`endsWith`?e.data.endsWith(i.value)||(n=this._getOrReturnCtx(e,n),u(n,{code:s.invalid_string,validation:{endsWith:i.value},message:i.message}),t.dirty()):i.kind===`datetime`?Ee(i).test(e.data)||(n=this._getOrReturnCtx(e,n),u(n,{code:s.invalid_string,validation:`datetime`,message:i.message}),t.dirty()):i.kind===`date`?Ce.test(e.data)||(n=this._getOrReturnCtx(e,n),u(n,{code:s.invalid_string,validation:`date`,message:i.message}),t.dirty()):i.kind===`time`?Te(i).test(e.data)||(n=this._getOrReturnCtx(e,n),u(n,{code:s.invalid_string,validation:`time`,message:i.message}),t.dirty()):i.kind===`duration`?pe.test(e.data)||(n=this._getOrReturnCtx(e,n),u(n,{validation:`duration`,code:s.invalid_string,message:i.message}),t.dirty()):i.kind===`ip`?De(e.data,i.version)||(n=this._getOrReturnCtx(e,n),u(n,{validation:`ip`,code:s.invalid_string,message:i.message}),t.dirty()):i.kind===`jwt`?Oe(e.data,i.alg)||(n=this._getOrReturnCtx(e,n),u(n,{validation:`jwt`,code:s.invalid_string,message:i.message}),t.dirty()):i.kind===`cidr`?ke(e.data,i.version)||(n=this._getOrReturnCtx(e,n),u(n,{validation:`cidr`,code:s.invalid_string,message:i.message}),t.dirty()):i.kind===`base64`?be.test(e.data)||(n=this._getOrReturnCtx(e,n),u(n,{validation:`base64`,code:s.invalid_string,message:i.message}),t.dirty()):i.kind===`base64url`?xe.test(e.data)||(n=this._getOrReturnCtx(e,n),u(n,{validation:`base64url`,code:s.invalid_string,message:i.message}),t.dirty()):r.assertNever(i);return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement(t=>e.test(t),{validation:t,code:s.invalid_string,...g.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(e){return this._addCheck({kind:`email`,...g.errToObj(e)})}url(e){return this._addCheck({kind:`url`,...g.errToObj(e)})}emoji(e){return this._addCheck({kind:`emoji`,...g.errToObj(e)})}uuid(e){return this._addCheck({kind:`uuid`,...g.errToObj(e)})}nanoid(e){return this._addCheck({kind:`nanoid`,...g.errToObj(e)})}cuid(e){return this._addCheck({kind:`cuid`,...g.errToObj(e)})}cuid2(e){return this._addCheck({kind:`cuid2`,...g.errToObj(e)})}ulid(e){return this._addCheck({kind:`ulid`,...g.errToObj(e)})}base64(e){return this._addCheck({kind:`base64`,...g.errToObj(e)})}base64url(e){return this._addCheck({kind:`base64url`,...g.errToObj(e)})}jwt(e){return this._addCheck({kind:`jwt`,...g.errToObj(e)})}ip(e){return this._addCheck({kind:`ip`,...g.errToObj(e)})}cidr(e){return this._addCheck({kind:`cidr`,...g.errToObj(e)})}datetime(e){return typeof e==`string`?this._addCheck({kind:`datetime`,precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:`datetime`,precision:e?.precision===void 0?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...g.errToObj(e?.message)})}date(e){return this._addCheck({kind:`date`,message:e})}time(e){return typeof e==`string`?this._addCheck({kind:`time`,precision:null,message:e}):this._addCheck({kind:`time`,precision:e?.precision===void 0?null:e?.precision,...g.errToObj(e?.message)})}duration(e){return this._addCheck({kind:`duration`,...g.errToObj(e)})}regex(e,t){return this._addCheck({kind:`regex`,regex:e,...g.errToObj(t)})}includes(e,t){return this._addCheck({kind:`includes`,value:e,position:t?.position,...g.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:`startsWith`,value:e,...g.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:`endsWith`,value:e,...g.errToObj(t)})}min(e,t){return this._addCheck({kind:`min`,value:e,...g.errToObj(t)})}max(e,t){return this._addCheck({kind:`max`,value:e,...g.errToObj(t)})}length(e,t){return this._addCheck({kind:`length`,value:e,...g.errToObj(t)})}nonempty(e){return this.min(1,g.errToObj(e))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:`trim`}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toLowerCase`}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toUpperCase`}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind===`datetime`)}get isDate(){return!!this._def.checks.find(e=>e.kind===`date`)}get isTime(){return!!this._def.checks.find(e=>e.kind===`time`)}get isDuration(){return!!this._def.checks.find(e=>e.kind===`duration`)}get isEmail(){return!!this._def.checks.find(e=>e.kind===`email`)}get isURL(){return!!this._def.checks.find(e=>e.kind===`url`)}get isEmoji(){return!!this._def.checks.find(e=>e.kind===`emoji`)}get isUUID(){return!!this._def.checks.find(e=>e.kind===`uuid`)}get isNANOID(){return!!this._def.checks.find(e=>e.kind===`nanoid`)}get isCUID(){return!!this._def.checks.find(e=>e.kind===`cuid`)}get isCUID2(){return!!this._def.checks.find(e=>e.kind===`cuid2`)}get isULID(){return!!this._def.checks.find(e=>e.kind===`ulid`)}get isIP(){return!!this._def.checks.find(e=>e.kind===`ip`)}get isCIDR(){return!!this._def.checks.find(e=>e.kind===`cidr`)}get isBase64(){return!!this._def.checks.find(e=>e.kind===`base64`)}get isBase64url(){return!!this._def.checks.find(e=>e.kind===`base64url`)}get minLength(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};b.create=e=>new b({checks:[],typeName:q.ZodString,coerce:e?.coerce??!1,...v(e)});function Ae(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=n>r?n:r;return Number.parseInt(e.toFixed(i).replace(`.`,``))%Number.parseInt(t.toFixed(i).replace(`.`,``))/10**i}var x=class e extends y{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)!==a.number){let t=this._getOrReturnCtx(e);return u(t,{code:s.invalid_type,expected:a.number,received:t.parsedType}),f}let t,n=new d;for(let i of this._def.checks)i.kind===`int`?r.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),u(t,{code:s.invalid_type,expected:`integer`,received:`float`,message:i.message}),n.dirty()):i.kind===`min`?(i.inclusive?e.data<i.value:e.data<=i.value)&&(t=this._getOrReturnCtx(e,t),u(t,{code:s.too_small,minimum:i.value,type:`number`,inclusive:i.inclusive,exact:!1,message:i.message}),n.dirty()):i.kind===`max`?(i.inclusive?e.data>i.value:e.data>=i.value)&&(t=this._getOrReturnCtx(e,t),u(t,{code:s.too_big,maximum:i.value,type:`number`,inclusive:i.inclusive,exact:!1,message:i.message}),n.dirty()):i.kind===`multipleOf`?Ae(e.data,i.value)!==0&&(t=this._getOrReturnCtx(e,t),u(t,{code:s.not_multiple_of,multipleOf:i.value,message:i.message}),n.dirty()):i.kind===`finite`?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),u(t,{code:s.not_finite,message:i.message}),n.dirty()):r.assertNever(i);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit(`min`,e,!0,g.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,g.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,g.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,g.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:g.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(e){return this._addCheck({kind:`int`,message:g.toString(e)})}positive(e){return this._addCheck({kind:`min`,value:0,inclusive:!1,message:g.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:0,inclusive:!1,message:g.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:0,inclusive:!0,message:g.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:0,inclusive:!0,message:g.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:g.toString(t)})}finite(e){return this._addCheck({kind:`finite`,message:g.toString(e)})}safe(e){return this._addCheck({kind:`min`,inclusive:!0,value:-(2**53-1),message:g.toString(e)})._addCheck({kind:`max`,inclusive:!0,value:2**53-1,message:g.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind===`int`||e.kind===`multipleOf`&&r.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks)if(n.kind===`finite`||n.kind===`int`||n.kind===`multipleOf`)return!0;else n.kind===`min`?(t===null||n.value>t)&&(t=n.value):n.kind===`max`&&(e===null||n.value<e)&&(e=n.value);return Number.isFinite(t)&&Number.isFinite(e)}};x.create=e=>new x({checks:[],typeName:q.ZodNumber,coerce:e?.coerce||!1,...v(e)});var S=class e extends y{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==a.bigint)return this._getInvalidInput(e);let t,n=new d;for(let i of this._def.checks)i.kind===`min`?(i.inclusive?e.data<i.value:e.data<=i.value)&&(t=this._getOrReturnCtx(e,t),u(t,{code:s.too_small,type:`bigint`,minimum:i.value,inclusive:i.inclusive,message:i.message}),n.dirty()):i.kind===`max`?(i.inclusive?e.data>i.value:e.data>=i.value)&&(t=this._getOrReturnCtx(e,t),u(t,{code:s.too_big,type:`bigint`,maximum:i.value,inclusive:i.inclusive,message:i.message}),n.dirty()):i.kind===`multipleOf`?e.data%i.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),u(t,{code:s.not_multiple_of,multipleOf:i.value,message:i.message}),n.dirty()):r.assertNever(i);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return u(t,{code:s.invalid_type,expected:a.bigint,received:t.parsedType}),f}gte(e,t){return this.setLimit(`min`,e,!0,g.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,g.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,g.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,g.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:g.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!1,message:g.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!1,message:g.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!0,message:g.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!0,message:g.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:g.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};S.create=e=>new S({checks:[],typeName:q.ZodBigInt,coerce:e?.coerce??!1,...v(e)});var C=class extends y{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==a.boolean){let t=this._getOrReturnCtx(e);return u(t,{code:s.invalid_type,expected:a.boolean,received:t.parsedType}),f}return p(e.data)}};C.create=e=>new C({typeName:q.ZodBoolean,coerce:e?.coerce||!1,...v(e)});var w=class e extends y{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==a.date){let t=this._getOrReturnCtx(e);return u(t,{code:s.invalid_type,expected:a.date,received:t.parsedType}),f}if(Number.isNaN(e.data.getTime()))return u(this._getOrReturnCtx(e),{code:s.invalid_date}),f;let t=new d,n;for(let i of this._def.checks)i.kind===`min`?e.data.getTime()<i.value&&(n=this._getOrReturnCtx(e,n),u(n,{code:s.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:`date`}),t.dirty()):i.kind===`max`?e.data.getTime()>i.value&&(n=this._getOrReturnCtx(e,n),u(n,{code:s.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:`date`}),t.dirty()):r.assertNever(i);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(e,t){return this._addCheck({kind:`min`,value:e.getTime(),message:g.toString(t)})}max(e,t){return this._addCheck({kind:`max`,value:e.getTime(),message:g.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e==null?null:new Date(e)}get maxDate(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e==null?null:new Date(e)}};w.create=e=>new w({checks:[],coerce:e?.coerce||!1,typeName:q.ZodDate,...v(e)});var je=class extends y{_parse(e){if(this._getType(e)!==a.symbol){let t=this._getOrReturnCtx(e);return u(t,{code:s.invalid_type,expected:a.symbol,received:t.parsedType}),f}return p(e.data)}};je.create=e=>new je({typeName:q.ZodSymbol,...v(e)});var T=class extends y{_parse(e){if(this._getType(e)!==a.undefined){let t=this._getOrReturnCtx(e);return u(t,{code:s.invalid_type,expected:a.undefined,received:t.parsedType}),f}return p(e.data)}};T.create=e=>new T({typeName:q.ZodUndefined,...v(e)});var E=class extends y{_parse(e){if(this._getType(e)!==a.null){let t=this._getOrReturnCtx(e);return u(t,{code:s.invalid_type,expected:a.null,received:t.parsedType}),f}return p(e.data)}};E.create=e=>new E({typeName:q.ZodNull,...v(e)});var Me=class extends y{constructor(){super(...arguments),this._any=!0}_parse(e){return p(e.data)}};Me.create=e=>new Me({typeName:q.ZodAny,...v(e)});var D=class extends y{constructor(){super(...arguments),this._unknown=!0}_parse(e){return p(e.data)}};D.create=e=>new D({typeName:q.ZodUnknown,...v(e)});var O=class extends y{_parse(e){let t=this._getOrReturnCtx(e);return u(t,{code:s.invalid_type,expected:a.never,received:t.parsedType}),f}};O.create=e=>new O({typeName:q.ZodNever,...v(e)});var Ne=class extends y{_parse(e){if(this._getType(e)!==a.undefined){let t=this._getOrReturnCtx(e);return u(t,{code:s.invalid_type,expected:a.void,received:t.parsedType}),f}return p(e.data)}};Ne.create=e=>new Ne({typeName:q.ZodVoid,...v(e)});var k=class e extends y{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==a.array)return u(t,{code:s.invalid_type,expected:a.array,received:t.parsedType}),f;if(r.exactLength!==null){let e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(u(t,{code:e?s.too_big:s.too_small,minimum:i?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:`array`,inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(r.minLength!==null&&t.data.length<r.minLength.value&&(u(t,{code:s.too_small,minimum:r.minLength.value,type:`array`,inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&(u(t,{code:s.too_big,maximum:r.maxLength.value,type:`array`,inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((e,n)=>r.type._parseAsync(new _(t,e,t.path,n)))).then(e=>d.mergeArray(n,e));let i=[...t.data].map((e,n)=>r.type._parseSync(new _(t,e,t.path,n)));return d.mergeArray(n,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:g.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:g.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:g.toString(n)}})}nonempty(e){return this.min(1,e)}};k.create=(e,t)=>new k({type:e,minLength:null,maxLength:null,exactLength:null,typeName:q.ZodArray,...v(t)});function A(e){if(e instanceof j){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=H.create(A(r))}return new j({...e._def,shape:()=>t})}else if(e instanceof k)return new k({...e._def,type:A(e.element)});else if(e instanceof H)return H.create(A(e.unwrap()));else if(e instanceof U)return U.create(A(e.unwrap()));else if(e instanceof F)return F.create(e.items.map(e=>A(e)));else return e}var j=class e extends y{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();return this._cached={shape:e,keys:r.objectKeys(e)},this._cached}_parse(e){if(this._getType(e)!==a.object){let t=this._getOrReturnCtx(e);return u(t,{code:s.invalid_type,expected:a.object,received:t.parsedType}),f}let{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof O&&this._def.unknownKeys===`strip`))for(let e in n.data)i.includes(e)||o.push(e);let c=[];for(let e of i){let t=r[e],i=n.data[e];c.push({key:{status:`valid`,value:e},value:t._parse(new _(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof O){let e=this._def.unknownKeys;if(e===`passthrough`)for(let e of o)c.push({key:{status:`valid`,value:e},value:{status:`valid`,value:n.data[e]}});else if(e===`strict`)o.length>0&&(u(n,{code:s.unrecognized_keys,keys:o}),t.dirty());else if(e!==`strip`)throw Error(`Internal ZodObject error: invalid unknownKeys value.`)}else{let e=this._def.catchall;for(let t of o){let r=n.data[t];c.push({key:{status:`valid`,value:t},value:e._parse(new _(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of c){let n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>d.mergeObjectSync(t,e)):d.mergeObjectSync(t,c)}get shape(){return this._def.shape()}strict(t){return g.errToObj,new e({...this._def,unknownKeys:`strict`,...t===void 0?{}:{errorMap:(e,n)=>{let r=this._def.errorMap?.(e,n).message??n.defaultError;return e.code===`unrecognized_keys`?{message:g.errToObj(t).message??r}:{message:r}}}})}strip(){return new e({...this._def,unknownKeys:`strip`})}passthrough(){return new e({...this._def,unknownKeys:`passthrough`})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:q.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let e of r.objectKeys(t))t[e]&&this.shape[e]&&(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let e of r.objectKeys(this.shape))t[e]||(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}deepPartial(){return A(this)}partial(t){let n={};for(let e of r.objectKeys(this.shape)){let r=this.shape[e];t&&!t[e]?n[e]=r:n[e]=r.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let e of r.objectKeys(this.shape))if(t&&!t[e])n[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof H;)t=t._def.innerType;n[e]=t}return new e({...this._def,shape:()=>n})}keyof(){return Be(r.objectKeys(this.shape))}};j.create=(e,t)=>new j({shape:()=>e,unknownKeys:`strip`,catchall:O.create(),typeName:q.ZodObject,...v(t)}),j.strictCreate=(e,t)=>new j({shape:()=>e,unknownKeys:`strict`,catchall:O.create(),typeName:q.ZodObject,...v(t)}),j.lazycreate=(e,t)=>new j({shape:e,unknownKeys:`strip`,catchall:O.create(),typeName:q.ZodObject,...v(t)});var M=class extends y{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function r(e){for(let t of e)if(t.result.status===`valid`)return t.result;for(let n of e)if(n.result.status===`dirty`)return t.common.issues.push(...n.ctx.common.issues),n.result;let n=e.map(e=>new c(e.ctx.common.issues));return u(t,{code:s.invalid_union,unionErrors:n}),f}if(t.common.async)return Promise.all(n.map(async e=>{let n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}})).then(r);{let e,r=[];for(let i of n){let n={...t,common:{...t.common,issues:[]},parent:null},a=i._parseSync({data:t.data,path:t.path,parent:n});if(a.status===`valid`)return a;a.status===`dirty`&&!e&&(e={result:a,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let i=r.map(e=>new c(e));return u(t,{code:s.invalid_union,unionErrors:i}),f}}get options(){return this._def.options}};M.create=(e,t)=>new M({options:e,typeName:q.ZodUnion,...v(t)});const N=e=>e instanceof I?N(e.schema):e instanceof V?N(e.innerType()):e instanceof L?[e.value]:e instanceof R?e.options:e instanceof z?r.objectValues(e.enum):e instanceof W?N(e._def.innerType):e instanceof T?[void 0]:e instanceof E?[null]:e instanceof H?[void 0,...N(e.unwrap())]:e instanceof U?[null,...N(e.unwrap())]:e instanceof He||e instanceof K?N(e.unwrap()):e instanceof G?N(e._def.innerType):[];var Pe=class e extends y{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==a.object)return u(t,{code:s.invalid_type,expected:a.object,received:t.parsedType}),f;let n=this.discriminator,r=t.data[n],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(u(t,{code:s.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),f)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){let i=new Map;for(let e of n){let n=N(e.shape[t]);if(!n.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let r of n){if(i.has(r))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(r)}`);i.set(r,e)}}return new e({typeName:q.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...v(r)})}};function Fe(e,t){let n=o(e),i=o(t);if(e===t)return{valid:!0,data:e};if(n===a.object&&i===a.object){let n=r.objectKeys(t),i=r.objectKeys(e).filter(e=>n.indexOf(e)!==-1),a={...e,...t};for(let n of i){let r=Fe(e[n],t[n]);if(!r.valid)return{valid:!1};a[n]=r.data}return{valid:!0,data:a}}else if(n===a.array&&i===a.array){if(e.length!==t.length)return{valid:!1};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Fe(i,a);if(!o.valid)return{valid:!1};n.push(o.data)}return{valid:!0,data:n}}else if(n===a.date&&i===a.date&&+e==+t)return{valid:!0,data:e};else return{valid:!1}}var P=class extends y{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(ie(e)||ie(r))return f;let i=Fe(e.value,r.value);return i.valid?((ae(e)||ae(r))&&t.dirty(),{status:t.value,value:i.data}):(u(n,{code:s.invalid_intersection_types}),f)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([e,t])=>r(e,t)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};P.create=(e,t,n)=>new P({left:e,right:t,typeName:q.ZodIntersection,...v(n)});var F=class e extends y{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==a.array)return u(n,{code:s.invalid_type,expected:a.array,received:n.parsedType}),f;if(n.data.length<this._def.items.length)return u(n,{code:s.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),f;!this._def.rest&&n.data.length>this._def.items.length&&(u(n,{code:s.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),t.dirty());let r=[...n.data].map((e,t)=>{let r=this._def.items[t]||this._def.rest;return r?r._parse(new _(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(r).then(e=>d.mergeArray(t,e)):d.mergeArray(t,r)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};F.create=(e,t)=>{if(!Array.isArray(e))throw Error(`You must pass an array of schemas to z.tuple([ ... ])`);return new F({items:e,typeName:q.ZodTuple,rest:null,...v(t)})};var Ie=class e extends y{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==a.object)return u(n,{code:s.invalid_type,expected:a.object,received:n.parsedType}),f;let r=[],i=this._def.keyType,o=this._def.valueType;for(let e in n.data)r.push({key:i._parse(new _(n,e,n.path,e)),value:o._parse(new _(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?d.mergeObjectAsync(t,r):d.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof y?new e({keyType:t,valueType:n,typeName:q.ZodRecord,...v(r)}):new e({keyType:b.create(),valueType:t,typeName:q.ZodRecord,...v(n)})}},Le=class extends y{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==a.map)return u(n,{code:s.invalid_type,expected:a.map,received:n.parsedType}),f;let r=this._def.keyType,i=this._def.valueType,o=[...n.data.entries()].map(([e,t],a)=>({key:r._parse(new _(n,e,n.path,[a,`key`])),value:i._parse(new _(n,t,n.path,[a,`value`]))}));if(n.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let n of o){let r=await n.key,i=await n.value;if(r.status===`aborted`||i.status===`aborted`)return f;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}})}else{let e=new Map;for(let n of o){let r=n.key,i=n.value;if(r.status===`aborted`||i.status===`aborted`)return f;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}};Le.create=(e,t,n)=>new Le({valueType:t,keyType:e,typeName:q.ZodMap,...v(n)});var Re=class e extends y{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==a.set)return u(n,{code:s.invalid_type,expected:a.set,received:n.parsedType}),f;let r=this._def;r.minSize!==null&&n.data.size<r.minSize.value&&(u(n,{code:s.too_small,minimum:r.minSize.value,type:`set`,inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),r.maxSize!==null&&n.data.size>r.maxSize.value&&(u(n,{code:s.too_big,maximum:r.maxSize.value,type:`set`,inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());let i=this._def.valueType;function o(e){let n=new Set;for(let r of e){if(r.status===`aborted`)return f;r.status===`dirty`&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}let c=[...n.data.values()].map((e,t)=>i._parse(new _(n,e,n.path,t)));return n.common.async?Promise.all(c).then(e=>o(e)):o(c)}min(t,n){return new e({...this._def,minSize:{value:t,message:g.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:g.toString(n)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};Re.create=(e,t)=>new Re({valueType:e,minSize:null,maxSize:null,typeName:q.ZodSet,...v(t)});var ze=class e extends y{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==a.function)return u(t,{code:s.invalid_type,expected:a.function,received:t.parsedType}),f;function n(e,n){return ne({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,te(),l].filter(e=>!!e),issueData:{code:s.invalid_arguments,argumentsError:n}})}function r(e,n){return ne({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,te(),l].filter(e=>!!e),issueData:{code:s.invalid_return_type,returnTypeError:n}})}let i={errorMap:t.common.contextualErrorMap},o=t.data;if(this._def.returns instanceof B){let e=this;return p(async function(...t){let a=new c([]),s=await e._def.args.parseAsync(t,i).catch(e=>{throw a.addIssue(n(t,e)),a}),l=await Reflect.apply(o,this,s);return await e._def.returns._def.type.parseAsync(l,i).catch(e=>{throw a.addIssue(r(l,e)),a})})}else{let e=this;return p(function(...t){let a=e._def.args.safeParse(t,i);if(!a.success)throw new c([n(t,a.error)]);let s=Reflect.apply(o,this,a.data),l=e._def.returns.safeParse(s,i);if(!l.success)throw new c([r(s,l.error)]);return l.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:F.create(t).rest(D.create())})}returns(t){return new e({...this._def,returns:t})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(t,n,r){return new e({args:t||F.create([]).rest(D.create()),returns:n||D.create(),typeName:q.ZodFunction,...v(r)})}},I=class extends y{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};I.create=(e,t)=>new I({getter:e,typeName:q.ZodLazy,...v(t)});var L=class extends y{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return u(t,{received:t.data,code:s.invalid_literal,expected:this._def.value}),f}return{status:`valid`,value:e.data}}get value(){return this._def.value}};L.create=(e,t)=>new L({value:e,typeName:q.ZodLiteral,...v(t)});function Be(e,t){return new R({values:e,typeName:q.ZodEnum,...v(t)})}var R=class e extends y{_parse(e){if(typeof e.data!=`string`){let t=this._getOrReturnCtx(e),n=this._def.values;return u(t,{expected:r.joinValues(n),received:t.parsedType,code:s.invalid_type}),f}if(this._cache||=new Set(this._def.values),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return u(t,{received:t.data,code:s.invalid_enum_value,options:n}),f}return p(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(e=>!t.includes(e)),{...this._def,...n})}};R.create=Be;var z=class extends y{_parse(e){let t=r.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==a.string&&n.parsedType!==a.number){let e=r.objectValues(t);return u(n,{expected:r.joinValues(e),received:n.parsedType,code:s.invalid_type}),f}if(this._cache||=new Set(r.getValidEnumValues(this._def.values)),!this._cache.has(e.data)){let e=r.objectValues(t);return u(n,{received:n.data,code:s.invalid_enum_value,options:e}),f}return p(e.data)}get enum(){return this._def.values}};z.create=(e,t)=>new z({values:e,typeName:q.ZodNativeEnum,...v(t)});var B=class extends y{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==a.promise&&t.common.async===!1?(u(t,{code:s.invalid_type,expected:a.promise,received:t.parsedType}),f):p((t.parsedType===a.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}};B.create=(e,t)=>new B({type:e,typeName:q.ZodPromise,...v(t)});var V=class extends y{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===q.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),i=this._def.effect||null,a={addIssue:e=>{u(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),i.type===`preprocess`){let e=i.transform(n.data,a);if(n.common.async)return Promise.resolve(e).then(async e=>{if(t.value===`aborted`)return f;let r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return r.status===`aborted`?f:r.status===`dirty`||t.value===`dirty`?re(r.value):r});{if(t.value===`aborted`)return f;let r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return r.status===`aborted`?f:r.status===`dirty`||t.value===`dirty`?re(r.value):r}}if(i.type===`refinement`){let e=e=>{let t=i.refinement(e,a);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error(`Async refinement encountered during synchronous parse operation. Use .parseAsync instead.`);return e};if(n.common.async===!1){let r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return r.status===`aborted`?f:(r.status===`dirty`&&t.dirty(),e(r.value),{status:t.value,value:r.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(n=>n.status===`aborted`?f:(n.status===`dirty`&&t.dirty(),e(n.value).then(()=>({status:t.value,value:n.value}))))}if(i.type===`transform`)if(n.common.async===!1){let e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!m(e))return f;let r=i.transform(e.value,a);if(r instanceof Promise)throw Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);return{status:t.value,value:r}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(e=>m(e)?Promise.resolve(i.transform(e.value,a)).then(e=>({status:t.value,value:e})):f);r.assertNever(i)}};V.create=(e,t,n)=>new V({schema:e,typeName:q.ZodEffects,effect:t,...v(n)}),V.createWithPreprocess=(e,t,n)=>new V({schema:t,effect:{type:`preprocess`,transform:e},typeName:q.ZodEffects,...v(n)});var H=class extends y{_parse(e){return this._getType(e)===a.undefined?p(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};H.create=(e,t)=>new H({innerType:e,typeName:q.ZodOptional,...v(t)});var U=class extends y{_parse(e){return this._getType(e)===a.null?p(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};U.create=(e,t)=>new U({innerType:e,typeName:q.ZodNullable,...v(t)});var W=class extends y{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===a.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};W.create=(e,t)=>new W({innerType:e,typeName:q.ZodDefault,defaultValue:typeof t.default==`function`?t.default:()=>t.default,...v(t)});var G=class extends y{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return h(r)?r.then(e=>({status:`valid`,value:e.status===`valid`?e.value:this._def.catchValue({get error(){return new c(n.common.issues)},input:n.data})})):{status:`valid`,value:r.status===`valid`?r.value:this._def.catchValue({get error(){return new c(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};G.create=(e,t)=>new G({innerType:e,typeName:q.ZodCatch,catchValue:typeof t.catch==`function`?t.catch:()=>t.catch,...v(t)});var Ve=class extends y{_parse(e){if(this._getType(e)!==a.nan){let t=this._getOrReturnCtx(e);return u(t,{code:s.invalid_type,expected:a.nan,received:t.parsedType}),f}return{status:`valid`,value:e.data}}};Ve.create=e=>new Ve({typeName:q.ZodNaN,...v(e)});var He=class extends y{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},Ue=class e extends y{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?f:e.status===`dirty`?(t.dirty(),re(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{let e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?f:e.status===`dirty`?(t.dirty(),{status:`dirty`,value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(t,n){return new e({in:t,out:n,typeName:q.ZodPipeline})}},K=class extends y{_parse(e){let t=this._def.innerType._parse(e),n=e=>(m(e)&&(e.value=Object.freeze(e.value)),e);return h(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}};K.create=(e,t)=>new K({innerType:e,typeName:q.ZodReadonly,...v(t)}),j.lazycreate;var q;(function(e){e.ZodString=`ZodString`,e.ZodNumber=`ZodNumber`,e.ZodNaN=`ZodNaN`,e.ZodBigInt=`ZodBigInt`,e.ZodBoolean=`ZodBoolean`,e.ZodDate=`ZodDate`,e.ZodSymbol=`ZodSymbol`,e.ZodUndefined=`ZodUndefined`,e.ZodNull=`ZodNull`,e.ZodAny=`ZodAny`,e.ZodUnknown=`ZodUnknown`,e.ZodNever=`ZodNever`,e.ZodVoid=`ZodVoid`,e.ZodArray=`ZodArray`,e.ZodObject=`ZodObject`,e.ZodUnion=`ZodUnion`,e.ZodDiscriminatedUnion=`ZodDiscriminatedUnion`,e.ZodIntersection=`ZodIntersection`,e.ZodTuple=`ZodTuple`,e.ZodRecord=`ZodRecord`,e.ZodMap=`ZodMap`,e.ZodSet=`ZodSet`,e.ZodFunction=`ZodFunction`,e.ZodLazy=`ZodLazy`,e.ZodLiteral=`ZodLiteral`,e.ZodEnum=`ZodEnum`,e.ZodEffects=`ZodEffects`,e.ZodNativeEnum=`ZodNativeEnum`,e.ZodOptional=`ZodOptional`,e.ZodNullable=`ZodNullable`,e.ZodDefault=`ZodDefault`,e.ZodCatch=`ZodCatch`,e.ZodPromise=`ZodPromise`,e.ZodBranded=`ZodBranded`,e.ZodPipeline=`ZodPipeline`,e.ZodReadonly=`ZodReadonly`})(q||={});const J=b.create,We=x.create;Ve.create,S.create;const Ge=C.create;w.create,je.create,T.create,E.create;const Ke=Me.create;D.create,O.create,Ne.create;const Y=k.create,X=j.create;j.strictCreate;const qe=M.create,Je=Pe.create;P.create,F.create;const Z=Ie.create;Le.create,Re.create,ze.create;const Ye=I.create;L.create;const Xe=R.create;z.create,B.create,V.create,H.create,U.create,V.createWithPreprocess,Ue.create;const Ze={string:(e=>b.create({...e,coerce:!0})),number:(e=>x.create({...e,coerce:!0})),boolean:(e=>C.create({...e,coerce:!0})),bigint:(e=>S.create({...e,coerce:!0})),date:(e=>w.create({...e,coerce:!0}))};var Q=Xe([`registry:lib`,`registry:block`,`registry:component`,`registry:ui`,`registry:hook`,`registry:page`,`registry:file`,`registry:theme`,`registry:style`,`registry:item`,`registry:example`,`registry:internal`]),Qe=Je(`type`,[X({path:J(),content:J().optional(),type:Xe([`registry:file`,`registry:page`]),target:J()}),X({path:J(),content:J().optional(),type:Q.exclude([`registry:file`,`registry:page`]),target:J().optional()})]),$e=X({config:X({content:Y(J()).optional(),theme:Z(J(),Ke()).optional(),plugins:Y(J()).optional()}).optional()}),et=X({theme:Z(J(),J()).optional(),light:Z(J(),J()).optional(),dark:Z(J(),J()).optional()}),tt=Ye(()=>qe([J(),Z(J(),tt)])),nt=Z(J(),tt),rt=Z(J(),J()),it=X({$schema:J().optional(),extends:J().optional(),name:J(),type:Q,title:J().optional(),author:J().min(2).optional(),description:J().optional(),dependencies:Y(J()).optional(),devDependencies:Y(J()).optional(),registryDependencies:Y(J()).optional(),files:Y(Qe).optional(),tailwind:$e.optional(),cssVars:et.optional(),css:nt.optional(),envVars:rt.optional(),meta:Z(J(),Ke()).optional(),docs:J().optional(),categories:Y(J()).optional()}),at=X({name:J(),homepage:J(),items:Y(it)});Y(it),Y(X({name:J(),label:J()})),Z(J(),Z(J(),J())),X({inlineColors:X({light:Z(J(),J()),dark:Z(J(),J())}),cssVars:et,cssVarsV4:et.optional(),inlineColorsTemplate:J(),cssVarsTemplate:J()}),it.pick({dependencies:!0,devDependencies:!0,files:!0,tailwind:!0,cssVars:!0,css:!0,envVars:!0,docs:!0});var ot=qe([J().refine(e=>e.includes(`{name}`),{message:`Registry URL must include {name} placeholder`}),X({url:J().refine(e=>e.includes(`{name}`),{message:`Registry URL must include {name} placeholder`}),params:Z(J(),J()).optional(),headers:Z(J(),J()).optional()})]),st=Z(J().refine(e=>e.startsWith(`@`),{message:`Registry names must start with @ (e.g., @v0, @acme)`}),ot);Z(X({$schema:J().optional(),style:J(),rsc:Ze.boolean().default(!1),tsx:Ze.boolean().default(!0),tailwind:X({config:J().optional(),css:J(),baseColor:J(),cssVariables:Ge().default(!0),prefix:J().default(``).optional()}),iconLibrary:J().optional(),aliases:X({components:J(),utils:J(),ui:J().optional(),lib:J().optional(),hooks:J().optional()}),registries:st.optional()}).strict().extend({resolvedPaths:X({cwd:J(),tailwindConfig:J(),tailwindCss:J(),utils:J(),components:J(),lib:J(),hooks:J(),ui:J()})}));var ct=X({name:J(),type:J().optional(),description:J().optional(),registry:J(),addCommandArgument:J()});X({pagination:X({total:We(),offset:We(),limit:We(),hasMore:Ge()}),items:Y(ct)}),Z(J().regex(/^@[a-zA-Z0-9][a-zA-Z0-9-_]*$/),J());function lt(r){return{output:async(i,{cwd:a})=>{if(i.homepage===void 0)throw new e(`No homepage was provided for ${i.name}`,{suggestion:`Please provide a homepage in your config.`});for(let t of i.items){let n=$(t.type);if(!Q.safeParse(n).success)throw new e(`Invalid item type: ${n} for ${t.name}. Expected one of: ${Q.options.join(`, `)}`,{suggestion:`Please use a valid item type.`})}let o={$schema:`https://ui.shadcn.com/schema/registry.json`,name:i.name,homepage:i.homepage,items:i.items.map(t=>({name:t.name,title:t.title,description:t.description,type:$(t.type),envVars:t.envVars,dependencies:t.dependencies?.map(e=>`${e.name}${e.version?`@${e.version}`:``}`),registryDependencies:t.registryDependencies,files:t.files.map(n=>{let r=$(n.type);if((r===`registry:page`||r===`registry:file`)&&n.target===void 0)throw new e(`Target is required for registry items with type ${r}. Please provide a target for ${n.path} on ${t.name}`,{suggestion:`Please provide a target for the file.`});return{type:r,path:n.path,target:n.target}})}))},s=i.items.map(e=>({$schema:`https://ui.shadcn.com/schema/registry-item.json`,name:e.name,title:e.title,description:e.description,type:$(e.type),files:e.files.map(e=>({type:$(e.type),path:e.path,target:e.target,content:e.content})),envVars:e.envVars,registryDependencies:e.registryDependencies,dependencies:e.dependencies?.map(e=>`${e.name}${e.version?`@${e.version}`:``}`)})),c=at.safeParse(o);if(!c.success)throw new e(`Invalid registry ${o.name}: ${c.error.message}`,{suggestion:`This one's on us. Please file an issue at https://github.com/jsrepojs/jsrepo/issues`});for(let t of s){let n=it.safeParse(t);if(!n.success)throw new e(`Invalid item ${t.name}: ${n.error.message}`,{suggestion:`This one's on us. Please file an issue at https://github.com/jsrepojs/jsrepo/issues`})}let l=n.join(a,r.dir);t.existsSync(l)||t.mkdirSync(l,{recursive:!0}),t.writeFileSync(n.join(l,`registry.json`),ut(o,{format:r.format}));for(let e of s)t.writeFileSync(n.join(l,`${e.name}.json`),ut(e,{format:r.format}))},clean:async({cwd:e})=>{let i=n.join(e,r.dir);t.existsSync(i)&&t.rmSync(n.join(e,r.dir),{recursive:!0})}}}function $(e){return e?e.startsWith(`registry:`)?e:`registry:${e}`:`registry:ui`}function ut(e,t={}){return JSON.stringify(e,null,t.format?` `:void 0)}export{lt as t};
|
|
2
|
-
//# sourceMappingURL=output-oZQMHaJS.js.map
|
package/dist/output.d.ts
DELETED
package/dist/output.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./output-oZQMHaJS.js";export{e as output};
|
package/dist/provider.d.ts
DELETED
package/dist/provider.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./provider-w0GjKOJb.js";export{e as provider};
|