@n8x/react-form-utils 1.0.0 → 1.0.1

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.js CHANGED
@@ -7,5 +7,5 @@
7
7
  *
8
8
  * This source code is licensed under the MIT license found in the
9
9
  * LICENSE file in the root directory of this source tree.
10
- */function d(){return s||(s=1,"production"!==process.env.NODE_ENV&&function(){function e(t){if(null==t)return null;if("function"==typeof t)return t.$$typeof===T?null:t.displayName||t.name||null;if("string"==typeof t)return t;switch(t){case m:return"Fragment";case v:return"Profiler";case y:return"StrictMode";case x:return"Suspense";case k:return"SuspenseList";case O:return"Activity"}if("object"==typeof t)switch("number"==typeof t.tag&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),t.$$typeof){case f:return"Portal";case _:return t.displayName||"Context";case g:return(t._context.displayName||"Context")+".Consumer";case b:var a=t.render;return(t=t.displayName)||(t=""!==(t=a.displayName||a.name||"")?"ForwardRef("+t+")":"ForwardRef"),t;case w:return null!==(a=t.displayName||null)?a:e(t.type)||"Memo";case S:a=t._payload,t=t._init;try{return e(t(a))}catch(e){}}return null}function a(e){return""+e}function r(e){try{a(e);var t=!1}catch(e){t=!0}if(t){var r=(t=console).error,n="function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return r.call(t,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",n),a(e)}}function n(t){if(t===m)return"<>";if("object"==typeof t&&null!==t&&t.$$typeof===S)return"<...>";try{var a=e(t);return a?"<"+a+">":"<...>"}catch(e){return"<...>"}}function s(){return Error("react-stack-top-frame")}function i(){var t=e(this.type);return C[t]||(C[t]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),void 0!==(t=this.props.ref)?t:null}function d(t,a,n,s,o,d){var u,p=a.children;if(void 0!==p)if(s)if(N(p)){for(s=0;s<p.length;s++)c(p[s]);Object.freeze&&Object.freeze(p)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else c(p);if(Z.call(a,"key")){p=e(t);var f=Object.keys(a).filter(function(e){return"key"!==e});s=0<f.length?"{key: someKey, "+f.join(": ..., ")+": ...}":"{key: someKey}",I[p+s]||(f=0<f.length?"{"+f.join(": ..., ")+": ...}":"{}",console.error('A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',s,p,f,p),I[p+s]=!0)}if(p=null,void 0!==n&&(r(n),p=""+n),function(e){if(Z.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}(a)&&(r(a.key),p=""+a.key),"key"in a)for(var m in n={},a)"key"!==m&&(n[m]=a[m]);else n=a;return p&&function(e,t){function a(){l||(l=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",t))}a.isReactWarning=!0,Object.defineProperty(e,"key",{get:a,configurable:!0})}(n,"function"==typeof t?t.displayName||t.name||"Unknown":t),function(e,t,a,r,n,s){var o=a.ref;return e={$$typeof:h,type:e,key:t,props:a,_owner:r},null!==(void 0!==o?o:null)?Object.defineProperty(e,"ref",{enumerable:!1,get:i}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:n}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:s}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}(t,p,n,null===(u=j.A)?null:u.getOwner(),o,d)}function c(e){u(e)?e._store&&(e._store.validated=1):"object"==typeof e&&null!==e&&e.$$typeof===S&&("fulfilled"===e._payload.status?u(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function u(e){return"object"==typeof e&&null!==e&&e.$$typeof===h}var l,p=t,h=Symbol.for("react.transitional.element"),f=Symbol.for("react.portal"),m=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),g=Symbol.for("react.consumer"),_=Symbol.for("react.context"),b=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),w=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),O=Symbol.for("react.activity"),T=Symbol.for("react.client.reference"),j=p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z=Object.prototype.hasOwnProperty,N=Array.isArray,A=console.createTask?console.createTask:function(){return null},C={},E=(p={react_stack_bottom_frame:function(e){return e()}}).react_stack_bottom_frame.bind(p,s)(),R=A(n(s)),I={};o.Fragment=m,o.jsx=function(e,t,a){var r=1e4>j.recentlyCreatedOwnerStacks++;return d(e,t,a,!1,r?Error("react-stack-top-frame"):E,r?A(n(e)):R)},o.jsxs=function(e,t,a){var r=1e4>j.recentlyCreatedOwnerStacks++;return d(e,t,a,!0,r?Error("react-stack-top-frame"):E,r?A(n(e)):R)}}()),o}var c,u,l,p=(i||(i=1,"production"===process.env.NODE_ENV?r.exports=function(){if(e)return n;e=1;var t=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function r(e,a,r){var n=null;if(void 0!==r&&(n=""+r),void 0!==a.key&&(n=""+a.key),"key"in a)for(var s in r={},a)"key"!==s&&(r[s]=a[s]);else r=a;return a=r.ref,{$$typeof:t,type:e,key:n,ref:void 0!==a?a:null,props:r}}return n.Fragment=a,n.jsx=r,n.jsxs=r,n}():r.exports=d()),r.exports);exports.EDefaultFieldStyles=void 0,(c=exports.EDefaultFieldStyles||(exports.EDefaultFieldStyles={})).CLEAN="\n w-full\n bg-white\n border border-zinc-300\n rounded-lg\n px-4 py-2.5\n text-sm\n text-zinc-800\n placeholder:text-zinc-400\n outline-none\n transition-all\n focus:border-zinc-900\n focus:ring-2\n focus:ring-zinc-900/10\n ",c.SOFT_GLASS="\n w-full\n bg-zinc-50\n border border-zinc-200\n rounded-xl\n px-4 py-2.5\n text-sm\n text-zinc-800\n placeholder:text-zinc-400\n outline-none\n transition-all duration-200\n focus:bg-white\n focus:border-zinc-900\n focus:ring-4\n focus:ring-zinc-900/5\n ",c.DARK="\n w-full\n bg-zinc-900\n border border-zinc-700\n rounded-lg\n px-4 py-2.5\n text-sm\n text-zinc-100\n placeholder:text-zinc-500\n outline-none\n transition-all\n focus:border-zinc-400\n focus:ring-2\n focus:ring-zinc-400/20\n ",c.FLOATING_LABEL="\n peer\n w-full\n bg-transparent\n border-b border-zinc-300\n px-0 py-2\n text-sm\n text-zinc-800\n placeholder-transparent\n outline-none\n transition-all\n focus:border-zinc-900\n ",exports.FormFieldTypes=void 0,(u=exports.FormFieldTypes||(exports.FormFieldTypes={})).TEXT="text",u.NUMBER="number",u.EMAIL="email",u.PASSWORD="password",u.SELECT="select",u.RADIO="radio",u.CHECKBOX="checkbox",u.TEXTAREA="textarea",u.DATE="date",u.FILE="file",u.SUBMIT="submit",exports.FormFieldWidth=void 0,(l=exports.FormFieldWidth||(exports.FormFieldWidth={})).FULL="col-span-4",l.HALF="col-span-2",l.THIRD="col-span-3",l.QUARTER="col-span-1";var h=function(){return h=Object.assign||function(e){for(var t,a=1,r=arguments.length;a<r;a++)for(var n in t=arguments[a])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},h.apply(this,arguments)};function f(e,t,a,r){return new(a||(a=Promise))(function(n,s){function i(e){try{d(r.next(e))}catch(e){s(e)}}function o(e){try{d(r.throw(e))}catch(e){s(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof a?t:new a(function(e){e(t)})).then(i,o)}d((r=r.apply(e,t||[])).next())})}function m(e,t){var a,r,n,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=o(0),i.throw=o(1),i.return=o(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function o(o){return function(d){return function(o){if(a)throw new TypeError("Generator is already executing.");for(;i&&(i=0,o[0]&&(s=0)),s;)try{if(a=1,r&&(n=2&o[0]?r.return:o[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,o[1])).done)return n;switch(r=0,n&&(o=[2&o[0],n.value]),o[0]){case 0:case 1:n=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(n=s.trys,(n=n.length>0&&n[n.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!n||o[1]>n[0]&&o[1]<n[3])){s.label=o[1];break}if(6===o[0]&&s.label<n[1]){s.label=n[1],n=o;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(o);break}n[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{a=n=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,d])}}}function y(e,t,a){if(a||2===arguments.length)for(var r,n=0,s=t.length;n<s;n++)!r&&n in t||(r||(r=Array.prototype.slice.call(t,0,n)),r[n]=t[n]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var v,g,_=function(e,a,r,n,s){var i,o,d,c,u,l,f,m;switch(e.type){case"select":return p.jsxs("div",{className:"".concat(e.width||""," flex flex-col gap-1"),children:[e.label&&p.jsx("label",{htmlFor:e.name,children:e.label}),p.jsxs("select",h({defaultValue:e.default,className:"".concat(e._className||a),required:e.required},r(e.name),{children:[null===(i=e.options)||void 0===i?void 0:i.map(function(e){return p.jsx("option",{value:e.value,children:e.label},e.value)}),n&&Object.keys(n).includes(e.name)?p.jsx("p",{className:"text-red-500 text-sm",children:null===(o=n[e.name])||void 0===o?void 0:o.message}):""]}),e.name)]},e.name);case"radio":return p.jsxs("div",{className:"".concat(e.width||""," flex flex-col gap-1"),children:[e.label&&p.jsx("label",{children:e.label}),p.jsxs("div",{className:"flex gap-4 flex-wra text-sm",children:[null===(d=e.options)||void 0===d?void 0:d.map(function(t){return p.jsxs("label",{className:"flex items-center gap-1 border border-zinc-200 rounded-full px-2 py-1",children:[p.jsx("input",h({},r(e.name),{type:"radio",name:e.name,value:t.value,required:e.required})),t.label]},t.value)}),n&&Object.keys(n).includes(e.name)?p.jsx("p",{className:"text-red-500 text-sm",children:null===(c=n[e.name])||void 0===c?void 0:c.message}):""]})]},e.name);case"checkbox":return p.jsxs("div",{className:"".concat(e.width||""," flex flex-col gap-1"),children:[e.label&&p.jsx("label",{children:e.label}),p.jsxs("div",{className:"flex gap-4 flex-wrap text-sm",children:[null===(u=e.options)||void 0===u?void 0:u.map(function(t){return p.jsxs("label",{className:"flex items-center gap-1 border border-zinc-200 rounded-full px-2 py-1",children:[p.jsx("input",h({},r(e.name),{type:"checkbox",name:e.name,value:t.value})),t.label]},t.value)}),n&&Object.keys(n).includes(e.name)?p.jsx("p",{className:"text-red-500 text-sm",children:null===(l=n[e.name])||void 0===l?void 0:l.message}):""]})]},e.name);case"textarea":return p.jsxs("div",{className:"".concat(e.width||""," flex flex-col gap-1"),children:[e.label&&p.jsx("label",{htmlFor:e.name,children:e.label}),t.createElement("textarea",h({},r(e.name),{key:e.name,name:e.name,defaultValue:e.default,className:"".concat(e._className||a," resize-none"),placeholder:e.placeholder,required:e.required})),n&&Object.keys(n).includes(e.name)?p.jsx("p",{className:"text-red-500 text-sm",children:null===(f=n[e.name])||void 0===f?void 0:f.message}):""]},e.name);case"submit":return p.jsx("div",{className:"".concat(s?e.width+"bg-zinc-400":e.width||""," flex flex-col gap-1"),children:p.jsx("button",{disabled:s,type:"submit",className:"".concat(e._className||a," flex justify-center items-center"),children:s?p.jsx("p",{className:"w-4 h-4 p-1 border-2 border-t-0 animate-spin rounded-full"}):e.label||"Submit"})},e.name);default:return p.jsxs("div",{className:"".concat(e.width||""," flex flex-col gap-1"),children:[e.label&&p.jsx("label",{htmlFor:e.name,children:e.label}),t.createElement("input",h({},r(e.name),{key:e.name,name:e.name,defaultValue:e.default,min:e.min,max:e.max,type:e.type,className:"".concat(e._className||a),placeholder:e.placeholder,required:e.required})),n&&Object.keys(n).includes(e.name)?p.jsx("p",{className:"text-red-500 text-sm",children:null===(m=n[e.name])||void 0===m?void 0:m.message}):""]},e.name)}},b=t.createContext(null);!function(e){e.assertEqual=e=>{},e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const a of e)t[a]=a;return t},e.getValidEnumValues=t=>{const a=e.objectKeys(t).filter(e=>"number"!=typeof t[t[e]]),r={};for(const e of a)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.push(a);return t},e.find=(e,t)=>{for(const a of e)if(t(a))return a},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(v||(v={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(g||(g={}));const x=v.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),k=e=>{switch(typeof e){case"undefined":return x.undefined;case"string":return x.string;case"number":return Number.isNaN(e)?x.nan:x.number;case"boolean":return x.boolean;case"function":return x.function;case"bigint":return x.bigint;case"symbol":return x.symbol;case"object":return Array.isArray(e)?x.array:null===e?x.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?x.promise:"undefined"!=typeof Map&&e instanceof Map?x.map:"undefined"!=typeof Set&&e instanceof Set?x.set:"undefined"!=typeof Date&&e instanceof Date?x.date:x.object;default:return x.unknown}},w=v.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class S 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]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(e){return e.message},a={_errors:[]},r=e=>{for(const n of e.issues)if("invalid_union"===n.code)n.unionErrors.map(r);else if("invalid_return_type"===n.code)r(n.returnTypeError);else if("invalid_arguments"===n.code)r(n.argumentsError);else if(0===n.path.length)a._errors.push(t(n));else{let e=a,r=0;for(;r<n.path.length;){const a=n.path[r];r===n.path.length-1?(e[a]=e[a]||{_errors:[]},e[a]._errors.push(t(n))):e[a]=e[a]||{_errors:[]},e=e[a],r++}}};return r(this),a}static assert(e){if(!(e instanceof S))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,v.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t=Object.create(null),a=[];for(const r of this.issues)if(r.path.length>0){const a=r.path[0];t[a]=t[a]||[],t[a].push(e(r))}else a.push(e(r));return{formErrors:a,fieldErrors:t}}get formErrors(){return this.flatten()}}S.create=e=>new S(e);const O=(e,t)=>{let a;switch(e.code){case w.invalid_type:a=e.received===x.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case w.invalid_literal:a=`Invalid literal value, expected ${JSON.stringify(e.expected,v.jsonStringifyReplacer)}`;break;case w.unrecognized_keys:a=`Unrecognized key(s) in object: ${v.joinValues(e.keys,", ")}`;break;case w.invalid_union:a="Invalid input";break;case w.invalid_union_discriminator:a=`Invalid discriminator value. Expected ${v.joinValues(e.options)}`;break;case w.invalid_enum_value:a=`Invalid enum value. Expected ${v.joinValues(e.options)}, received '${e.received}'`;break;case w.invalid_arguments:a="Invalid function arguments";break;case w.invalid_return_type:a="Invalid function return type";break;case w.invalid_date:a="Invalid date";break;case w.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(a=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(a=`${a} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?a=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?a=`Invalid input: must end with "${e.validation.endsWith}"`:v.assertNever(e.validation):a="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case w.too_small:a="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type||"bigint"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`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 w.too_big:a="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case w.custom:a="Invalid input";break;case w.invalid_intersection_types:a="Intersection results could not be merged";break;case w.not_multiple_of:a=`Number must be a multiple of ${e.multipleOf}`;break;case w.not_finite:a="Number must be finite";break;default:a=t.defaultError,v.assertNever(e)}return{message:a}};let T=O;function j(){return T}const Z=e=>{const{data:t,path:a,errorMaps:r,issueData:n}=e,s=[...a,...n.path||[]],i={...n,path:s};if(void 0!==n.message)return{...n,path:s,message:n.message};let o="";const d=r.filter(e=>!!e).slice().reverse();for(const e of d)o=e(i,{data:t,defaultError:o}).message;return{...n,path:s,message:o}};function N(e,t){const a=j(),r=Z({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,a,a===O?void 0:O].filter(e=>!!e)});e.common.issues.push(r)}class A{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const a=[];for(const r of t){if("aborted"===r.status)return C;"dirty"===r.status&&e.dirty(),a.push(r.value)}return{status:e.value,value:a}}static async mergeObjectAsync(e,t){const a=[];for(const e of t){const t=await e.key,r=await e.value;a.push({key:t,value:r})}return A.mergeObjectSync(e,a)}static mergeObjectSync(e,t){const a={};for(const r of t){const{key:t,value:n}=r;if("aborted"===t.status)return C;if("aborted"===n.status)return C;"dirty"===t.status&&e.dirty(),"dirty"===n.status&&e.dirty(),"__proto__"===t.value||void 0===n.value&&!r.alwaysSet||(a[t.value]=n.value)}return{status:e.value,value:a}}}const C=Object.freeze({status:"aborted"}),E=e=>({status:"dirty",value:e}),R=e=>({status:"valid",value:e}),I=e=>"aborted"===e.status,P=e=>"dirty"===e.status,F=e=>"valid"===e.status,$=e=>"undefined"!=typeof Promise&&e instanceof Promise;var L;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:e?.message}(L||(L={}));class z{constructor(e,t,a,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=a,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 M=(e,t)=>{if(F(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new S(e.common.issues);return this._error=t,this._error}}};function D(e){if(!e)return{};const{errorMap:t,invalid_type_error:a,required_error:r,description:n}=e;if(t&&(a||r))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(t)return{errorMap:t,description:n};return{errorMap:(t,n)=>{const{message:s}=e;return"invalid_enum_value"===t.code?{message:s??n.defaultError}:void 0===n.data?{message:s??r??n.defaultError}:"invalid_type"!==t.code?{message:n.defaultError}:{message:s??a??n.defaultError}},description:n}}class U{get description(){return this._def.description}_getType(e){return k(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:k(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new A,ctx:{common:e.parent.common,data:e.data,parsedType:k(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if($(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const a=this.safeParse(e,t);if(a.success)return a.data;throw a.error}safeParse(e,t){const a={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:k(e)},r=this._parseSync({data:e,path:a.path,parent:a});return M(a,r)}"~validate"(e){const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:k(e)};if(!this["~standard"].async)try{const a=this._parseSync({data:e,path:[],parent:t});return F(a)?{value:a.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=>F(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){const a=await this.safeParseAsync(e,t);if(a.success)return a.data;throw a.error}async safeParseAsync(e,t){const a={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:k(e)},r=this._parse({data:e,path:a.path,parent:a}),n=await($(r)?r:Promise.resolve(r));return M(a,n)}refine(e,t){const a=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement((t,r)=>{const n=e(t),s=()=>r.addIssue({code:w.custom,...a(t)});return"undefined"!=typeof Promise&&n instanceof Promise?n.then(e=>!!e||(s(),!1)):!!n||(s(),!1)})}refinement(e,t){return this._refinement((a,r)=>!!e(a)||(r.addIssue("function"==typeof t?t(a,r):t),!1))}_refinement(e){return new Ke({schema:this,typeName:rt.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 Be.create(this,this._def)}nullable(){return qe.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Oe.create(this)}promise(){return Ve.create(this,this._def)}or(e){return Ze.create([this,e],this._def)}and(e){return Ee.create(this,e,this._def)}transform(e){return new Ke({...D(this._def),schema:this,typeName:rt.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new We({...D(this._def),innerType:this,defaultValue:t,typeName:rt.ZodDefault})}brand(){return new Xe({typeName:rt.ZodBranded,type:this,...D(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new Je({...D(this._def),innerType:this,catchValue:t,typeName:rt.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return Ye.create(this,e)}readonly(){return Qe.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const V=/^c[^\s-]{8,}$/i,K=/^[0-9a-z]+$/,B=/^[0-9A-HJKMNP-TV-Z]{26}$/i,q=/^[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,W=/^[a-z0-9_-]{21}$/i,J=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,H=/^[-+]?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)?)??$/,G=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let X;const Y=/^(?:(?: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])$/,Q=/^(?:(?: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])$/,ee=/^(([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]))$/,te=/^(([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])$/,ae=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,re=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ne="((\\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])))",se=new RegExp(`^${ne}$`);function ie(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`);return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${e.precision?"+":"?"}`}function oe(e){return new RegExp(`^${ie(e)}$`)}function de(e){let t=`${ne}T${ie(e)}`;const a=[];return a.push(e.local?"Z?":"Z"),e.offset&&a.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${a.join("|")})`,new RegExp(`^${t}$`)}function ce(e,t){return!("v4"!==t&&t||!Y.test(e))||!("v6"!==t&&t||!ee.test(e))}function ue(e,t){if(!J.test(e))return!1;try{const[a]=e.split(".");if(!a)return!1;const r=a.replace(/-/g,"+").replace(/_/g,"/").padEnd(a.length+(4-a.length%4)%4,"="),n=JSON.parse(atob(r));return"object"==typeof n&&null!==n&&((!("typ"in n)||"JWT"===n?.typ)&&(!!n.alg&&(!t||n.alg===t)))}catch{return!1}}function le(e,t){return!("v4"!==t&&t||!Q.test(e))||!("v6"!==t&&t||!te.test(e))}class pe extends U{_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==x.string){const t=this._getOrReturnCtx(e);return N(t,{code:w.invalid_type,expected:x.string,received:t.parsedType}),C}const t=new A;let a;for(const r of this._def.checks)if("min"===r.kind)e.data.length<r.value&&(a=this._getOrReturnCtx(e,a),N(a,{code:w.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),t.dirty());else if("max"===r.kind)e.data.length>r.value&&(a=this._getOrReturnCtx(e,a),N(a,{code:w.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),t.dirty());else if("length"===r.kind){const n=e.data.length>r.value,s=e.data.length<r.value;(n||s)&&(a=this._getOrReturnCtx(e,a),n?N(a,{code:w.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}):s&&N(a,{code:w.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}),t.dirty())}else if("email"===r.kind)G.test(e.data)||(a=this._getOrReturnCtx(e,a),N(a,{validation:"email",code:w.invalid_string,message:r.message}),t.dirty());else if("emoji"===r.kind)X||(X=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),X.test(e.data)||(a=this._getOrReturnCtx(e,a),N(a,{validation:"emoji",code:w.invalid_string,message:r.message}),t.dirty());else if("uuid"===r.kind)q.test(e.data)||(a=this._getOrReturnCtx(e,a),N(a,{validation:"uuid",code:w.invalid_string,message:r.message}),t.dirty());else if("nanoid"===r.kind)W.test(e.data)||(a=this._getOrReturnCtx(e,a),N(a,{validation:"nanoid",code:w.invalid_string,message:r.message}),t.dirty());else if("cuid"===r.kind)V.test(e.data)||(a=this._getOrReturnCtx(e,a),N(a,{validation:"cuid",code:w.invalid_string,message:r.message}),t.dirty());else if("cuid2"===r.kind)K.test(e.data)||(a=this._getOrReturnCtx(e,a),N(a,{validation:"cuid2",code:w.invalid_string,message:r.message}),t.dirty());else if("ulid"===r.kind)B.test(e.data)||(a=this._getOrReturnCtx(e,a),N(a,{validation:"ulid",code:w.invalid_string,message:r.message}),t.dirty());else if("url"===r.kind)try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),N(a,{validation:"url",code:w.invalid_string,message:r.message}),t.dirty()}else if("regex"===r.kind){r.regex.lastIndex=0;r.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),N(a,{validation:"regex",code:w.invalid_string,message:r.message}),t.dirty())}else if("trim"===r.kind)e.data=e.data.trim();else if("includes"===r.kind)e.data.includes(r.value,r.position)||(a=this._getOrReturnCtx(e,a),N(a,{code:w.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),t.dirty());else if("toLowerCase"===r.kind)e.data=e.data.toLowerCase();else if("toUpperCase"===r.kind)e.data=e.data.toUpperCase();else if("startsWith"===r.kind)e.data.startsWith(r.value)||(a=this._getOrReturnCtx(e,a),N(a,{code:w.invalid_string,validation:{startsWith:r.value},message:r.message}),t.dirty());else if("endsWith"===r.kind)e.data.endsWith(r.value)||(a=this._getOrReturnCtx(e,a),N(a,{code:w.invalid_string,validation:{endsWith:r.value},message:r.message}),t.dirty());else if("datetime"===r.kind){de(r).test(e.data)||(a=this._getOrReturnCtx(e,a),N(a,{code:w.invalid_string,validation:"datetime",message:r.message}),t.dirty())}else if("date"===r.kind){se.test(e.data)||(a=this._getOrReturnCtx(e,a),N(a,{code:w.invalid_string,validation:"date",message:r.message}),t.dirty())}else if("time"===r.kind){oe(r).test(e.data)||(a=this._getOrReturnCtx(e,a),N(a,{code:w.invalid_string,validation:"time",message:r.message}),t.dirty())}else"duration"===r.kind?H.test(e.data)||(a=this._getOrReturnCtx(e,a),N(a,{validation:"duration",code:w.invalid_string,message:r.message}),t.dirty()):"ip"===r.kind?ce(e.data,r.version)||(a=this._getOrReturnCtx(e,a),N(a,{validation:"ip",code:w.invalid_string,message:r.message}),t.dirty()):"jwt"===r.kind?ue(e.data,r.alg)||(a=this._getOrReturnCtx(e,a),N(a,{validation:"jwt",code:w.invalid_string,message:r.message}),t.dirty()):"cidr"===r.kind?le(e.data,r.version)||(a=this._getOrReturnCtx(e,a),N(a,{validation:"cidr",code:w.invalid_string,message:r.message}),t.dirty()):"base64"===r.kind?ae.test(e.data)||(a=this._getOrReturnCtx(e,a),N(a,{validation:"base64",code:w.invalid_string,message:r.message}),t.dirty()):"base64url"===r.kind?re.test(e.data)||(a=this._getOrReturnCtx(e,a),N(a,{validation:"base64url",code:w.invalid_string,message:r.message}),t.dirty()):v.assertNever(r);return{status:t.value,value:e.data}}_regex(e,t,a){return this.refinement(t=>e.test(t),{validation:t,code:w.invalid_string,...L.errToObj(a)})}_addCheck(e){return new pe({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...L.errToObj(e)})}url(e){return this._addCheck({kind:"url",...L.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...L.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...L.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...L.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...L.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...L.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...L.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...L.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...L.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...L.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...L.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...L.errToObj(e)})}datetime(e){return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===e?.precision?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...L.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===e?.precision?null:e?.precision,...L.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...L.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...L.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...L.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...L.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...L.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...L.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...L.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...L.errToObj(t)})}nonempty(e){return this.min(1,L.errToObj(e))}trim(){return new pe({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new pe({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new pe({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>"datetime"===e.kind)}get isDate(){return!!this._def.checks.find(e=>"date"===e.kind)}get isTime(){return!!this._def.checks.find(e=>"time"===e.kind)}get isDuration(){return!!this._def.checks.find(e=>"duration"===e.kind)}get isEmail(){return!!this._def.checks.find(e=>"email"===e.kind)}get isURL(){return!!this._def.checks.find(e=>"url"===e.kind)}get isEmoji(){return!!this._def.checks.find(e=>"emoji"===e.kind)}get isUUID(){return!!this._def.checks.find(e=>"uuid"===e.kind)}get isNANOID(){return!!this._def.checks.find(e=>"nanoid"===e.kind)}get isCUID(){return!!this._def.checks.find(e=>"cuid"===e.kind)}get isCUID2(){return!!this._def.checks.find(e=>"cuid2"===e.kind)}get isULID(){return!!this._def.checks.find(e=>"ulid"===e.kind)}get isIP(){return!!this._def.checks.find(e=>"ip"===e.kind)}get isCIDR(){return!!this._def.checks.find(e=>"cidr"===e.kind)}get isBase64(){return!!this._def.checks.find(e=>"base64"===e.kind)}get isBase64url(){return!!this._def.checks.find(e=>"base64url"===e.kind)}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function he(e,t){const a=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,n=a>r?a:r;return Number.parseInt(e.toFixed(n).replace(".",""))%Number.parseInt(t.toFixed(n).replace(".",""))/10**n}pe.create=e=>new pe({checks:[],typeName:rt.ZodString,coerce:e?.coerce??!1,...D(e)});class fe extends U{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){this._def.coerce&&(e.data=Number(e.data));if(this._getType(e)!==x.number){const t=this._getOrReturnCtx(e);return N(t,{code:w.invalid_type,expected:x.number,received:t.parsedType}),C}let t;const a=new A;for(const r of this._def.checks)if("int"===r.kind)v.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),N(t,{code:w.invalid_type,expected:"integer",received:"float",message:r.message}),a.dirty());else if("min"===r.kind){(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),N(t,{code:w.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),a.dirty())}else if("max"===r.kind){(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),N(t,{code:w.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),a.dirty())}else"multipleOf"===r.kind?0!==he(e.data,r.value)&&(t=this._getOrReturnCtx(e,t),N(t,{code:w.not_multiple_of,multipleOf:r.value,message:r.message}),a.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),N(t,{code:w.not_finite,message:r.message}),a.dirty()):v.assertNever(r);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,L.toString(t))}gt(e,t){return this.setLimit("min",e,!1,L.toString(t))}lte(e,t){return this.setLimit("max",e,!0,L.toString(t))}lt(e,t){return this.setLimit("max",e,!1,L.toString(t))}setLimit(e,t,a,r){return new fe({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:L.toString(r)}]})}_addCheck(e){return new fe({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:L.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:L.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:L.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:L.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:L.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:L.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:L.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:L.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:L.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>"int"===e.kind||"multipleOf"===e.kind&&v.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const a of this._def.checks){if("finite"===a.kind||"int"===a.kind||"multipleOf"===a.kind)return!0;"min"===a.kind?(null===t||a.value>t)&&(t=a.value):"max"===a.kind&&(null===e||a.value<e)&&(e=a.value)}return Number.isFinite(t)&&Number.isFinite(e)}}fe.create=e=>new fe({checks:[],typeName:rt.ZodNumber,coerce:e?.coerce||!1,...D(e)});class me extends U{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)!==x.bigint)return this._getInvalidInput(e);let t;const a=new A;for(const r of this._def.checks)if("min"===r.kind){(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),N(t,{code:w.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),a.dirty())}else if("max"===r.kind){(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),N(t,{code:w.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),a.dirty())}else"multipleOf"===r.kind?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),N(t,{code:w.not_multiple_of,multipleOf:r.value,message:r.message}),a.dirty()):v.assertNever(r);return{status:a.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return N(t,{code:w.invalid_type,expected:x.bigint,received:t.parsedType}),C}gte(e,t){return this.setLimit("min",e,!0,L.toString(t))}gt(e,t){return this.setLimit("min",e,!1,L.toString(t))}lte(e,t){return this.setLimit("max",e,!0,L.toString(t))}lt(e,t){return this.setLimit("max",e,!1,L.toString(t))}setLimit(e,t,a,r){return new me({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:L.toString(r)}]})}_addCheck(e){return new me({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:L.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:L.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:L.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:L.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:L.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}me.create=e=>new me({checks:[],typeName:rt.ZodBigInt,coerce:e?.coerce??!1,...D(e)});class ye extends U{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==x.boolean){const t=this._getOrReturnCtx(e);return N(t,{code:w.invalid_type,expected:x.boolean,received:t.parsedType}),C}return R(e.data)}}ye.create=e=>new ye({typeName:rt.ZodBoolean,coerce:e?.coerce||!1,...D(e)});class ve extends U{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==x.date){const t=this._getOrReturnCtx(e);return N(t,{code:w.invalid_type,expected:x.date,received:t.parsedType}),C}if(Number.isNaN(e.data.getTime())){return N(this._getOrReturnCtx(e),{code:w.invalid_date}),C}const t=new A;let a;for(const r of this._def.checks)"min"===r.kind?e.data.getTime()<r.value&&(a=this._getOrReturnCtx(e,a),N(a,{code:w.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),t.dirty()):"max"===r.kind?e.data.getTime()>r.value&&(a=this._getOrReturnCtx(e,a),N(a,{code:w.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):v.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new ve({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:L.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:L.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}ve.create=e=>new ve({checks:[],coerce:e?.coerce||!1,typeName:rt.ZodDate,...D(e)});class ge extends U{_parse(e){if(this._getType(e)!==x.symbol){const t=this._getOrReturnCtx(e);return N(t,{code:w.invalid_type,expected:x.symbol,received:t.parsedType}),C}return R(e.data)}}ge.create=e=>new ge({typeName:rt.ZodSymbol,...D(e)});class _e extends U{_parse(e){if(this._getType(e)!==x.undefined){const t=this._getOrReturnCtx(e);return N(t,{code:w.invalid_type,expected:x.undefined,received:t.parsedType}),C}return R(e.data)}}_e.create=e=>new _e({typeName:rt.ZodUndefined,...D(e)});class be extends U{_parse(e){if(this._getType(e)!==x.null){const t=this._getOrReturnCtx(e);return N(t,{code:w.invalid_type,expected:x.null,received:t.parsedType}),C}return R(e.data)}}be.create=e=>new be({typeName:rt.ZodNull,...D(e)});class xe extends U{constructor(){super(...arguments),this._any=!0}_parse(e){return R(e.data)}}xe.create=e=>new xe({typeName:rt.ZodAny,...D(e)});class ke extends U{constructor(){super(...arguments),this._unknown=!0}_parse(e){return R(e.data)}}ke.create=e=>new ke({typeName:rt.ZodUnknown,...D(e)});class we extends U{_parse(e){const t=this._getOrReturnCtx(e);return N(t,{code:w.invalid_type,expected:x.never,received:t.parsedType}),C}}we.create=e=>new we({typeName:rt.ZodNever,...D(e)});class Se extends U{_parse(e){if(this._getType(e)!==x.undefined){const t=this._getOrReturnCtx(e);return N(t,{code:w.invalid_type,expected:x.void,received:t.parsedType}),C}return R(e.data)}}Se.create=e=>new Se({typeName:rt.ZodVoid,...D(e)});class Oe extends U{_parse(e){const{ctx:t,status:a}=this._processInputParams(e),r=this._def;if(t.parsedType!==x.array)return N(t,{code:w.invalid_type,expected:x.array,received:t.parsedType}),C;if(null!==r.exactLength){const e=t.data.length>r.exactLength.value,n=t.data.length<r.exactLength.value;(e||n)&&(N(t,{code:e?w.too_big:w.too_small,minimum:n?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),a.dirty())}if(null!==r.minLength&&t.data.length<r.minLength.value&&(N(t,{code:w.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),a.dirty()),null!==r.maxLength&&t.data.length>r.maxLength.value&&(N(t,{code:w.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),a.dirty()),t.common.async)return Promise.all([...t.data].map((e,a)=>r.type._parseAsync(new z(t,e,t.path,a)))).then(e=>A.mergeArray(a,e));const n=[...t.data].map((e,a)=>r.type._parseSync(new z(t,e,t.path,a)));return A.mergeArray(a,n)}get element(){return this._def.type}min(e,t){return new Oe({...this._def,minLength:{value:e,message:L.toString(t)}})}max(e,t){return new Oe({...this._def,maxLength:{value:e,message:L.toString(t)}})}length(e,t){return new Oe({...this._def,exactLength:{value:e,message:L.toString(t)}})}nonempty(e){return this.min(1,e)}}function Te(e){if(e instanceof je){const t={};for(const a in e.shape){const r=e.shape[a];t[a]=Be.create(Te(r))}return new je({...e._def,shape:()=>t})}return e instanceof Oe?new Oe({...e._def,type:Te(e.element)}):e instanceof Be?Be.create(Te(e.unwrap())):e instanceof qe?qe.create(Te(e.unwrap())):e instanceof Re?Re.create(e.items.map(e=>Te(e))):e}Oe.create=(e,t)=>new Oe({type:e,minLength:null,maxLength:null,exactLength:null,typeName:rt.ZodArray,...D(t)});class je extends U{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=v.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==x.object){const t=this._getOrReturnCtx(e);return N(t,{code:w.invalid_type,expected:x.object,received:t.parsedType}),C}const{status:t,ctx:a}=this._processInputParams(e),{shape:r,keys:n}=this._getCached(),s=[];if(!(this._def.catchall instanceof we&&"strip"===this._def.unknownKeys))for(const e in a.data)n.includes(e)||s.push(e);const i=[];for(const e of n){const t=r[e],n=a.data[e];i.push({key:{status:"valid",value:e},value:t._parse(new z(a,n,a.path,e)),alwaysSet:e in a.data})}if(this._def.catchall instanceof we){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of s)i.push({key:{status:"valid",value:e},value:{status:"valid",value:a.data[e]}});else if("strict"===e)s.length>0&&(N(a,{code:w.unrecognized_keys,keys:s}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of s){const r=a.data[t];i.push({key:{status:"valid",value:t},value:e._parse(new z(a,r,a.path,t)),alwaysSet:t in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const e=[];for(const t of i){const a=await t.key,r=await t.value;e.push({key:a,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>A.mergeObjectSync(t,e)):A.mergeObjectSync(t,i)}get shape(){return this._def.shape()}strict(e){return L.errToObj,new je({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,a)=>{const r=this._def.errorMap?.(t,a).message??a.defaultError;return"unrecognized_keys"===t.code?{message:L.errToObj(e).message??r}:{message:r}}}:{}})}strip(){return new je({...this._def,unknownKeys:"strip"})}passthrough(){return new je({...this._def,unknownKeys:"passthrough"})}extend(e){return new je({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new je({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:rt.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new je({...this._def,catchall:e})}pick(e){const t={};for(const a of v.objectKeys(e))e[a]&&this.shape[a]&&(t[a]=this.shape[a]);return new je({...this._def,shape:()=>t})}omit(e){const t={};for(const a of v.objectKeys(this.shape))e[a]||(t[a]=this.shape[a]);return new je({...this._def,shape:()=>t})}deepPartial(){return Te(this)}partial(e){const t={};for(const a of v.objectKeys(this.shape)){const r=this.shape[a];e&&!e[a]?t[a]=r:t[a]=r.optional()}return new je({...this._def,shape:()=>t})}required(e){const t={};for(const a of v.objectKeys(this.shape))if(e&&!e[a])t[a]=this.shape[a];else{let e=this.shape[a];for(;e instanceof Be;)e=e._def.innerType;t[a]=e}return new je({...this._def,shape:()=>t})}keyof(){return Me(v.objectKeys(this.shape))}}je.create=(e,t)=>new je({shape:()=>e,unknownKeys:"strip",catchall:we.create(),typeName:rt.ZodObject,...D(t)}),je.strictCreate=(e,t)=>new je({shape:()=>e,unknownKeys:"strict",catchall:we.create(),typeName:rt.ZodObject,...D(t)}),je.lazycreate=(e,t)=>new je({shape:e,unknownKeys:"strip",catchall:we.create(),typeName:rt.ZodObject,...D(t)});class Ze extends U{_parse(e){const{ctx:t}=this._processInputParams(e),a=this._def.options;if(t.common.async)return Promise.all(a.map(async e=>{const a={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:a}),ctx:a}})).then(function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const a of e)if("dirty"===a.result.status)return t.common.issues.push(...a.ctx.common.issues),a.result;const a=e.map(e=>new S(e.ctx.common.issues));return N(t,{code:w.invalid_union,unionErrors:a}),C});{let e;const r=[];for(const n of a){const a={...t,common:{...t.common,issues:[]},parent:null},s=n._parseSync({data:t.data,path:t.path,parent:a});if("valid"===s.status)return s;"dirty"!==s.status||e||(e={result:s,ctx:a}),a.common.issues.length&&r.push(a.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const n=r.map(e=>new S(e));return N(t,{code:w.invalid_union,unionErrors:n}),C}}get options(){return this._def.options}}Ze.create=(e,t)=>new Ze({options:e,typeName:rt.ZodUnion,...D(t)});const Ne=e=>e instanceof Le?Ne(e.schema):e instanceof Ke?Ne(e.innerType()):e instanceof ze?[e.value]:e instanceof De?e.options:e instanceof Ue?v.objectValues(e.enum):e instanceof We?Ne(e._def.innerType):e instanceof _e?[void 0]:e instanceof be?[null]:e instanceof Be?[void 0,...Ne(e.unwrap())]:e instanceof qe?[null,...Ne(e.unwrap())]:e instanceof Xe||e instanceof Qe?Ne(e.unwrap()):e instanceof Je?Ne(e._def.innerType):[];class Ae extends U{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==x.object)return N(t,{code:w.invalid_type,expected:x.object,received:t.parsedType}),C;const a=this.discriminator,r=t.data[a],n=this.optionsMap.get(r);return n?t.common.async?n._parseAsync({data:t.data,path:t.path,parent:t}):n._parseSync({data:t.data,path:t.path,parent:t}):(N(t,{code:w.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[a]}),C)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,a){const r=new Map;for(const a of t){const t=Ne(a.shape[e]);if(!t.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const n of t){if(r.has(n))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(n)}`);r.set(n,a)}}return new Ae({typeName:rt.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...D(a)})}}function Ce(e,t){const a=k(e),r=k(t);if(e===t)return{valid:!0,data:e};if(a===x.object&&r===x.object){const a=v.objectKeys(t),r=v.objectKeys(e).filter(e=>-1!==a.indexOf(e)),n={...e,...t};for(const a of r){const r=Ce(e[a],t[a]);if(!r.valid)return{valid:!1};n[a]=r.data}return{valid:!0,data:n}}if(a===x.array&&r===x.array){if(e.length!==t.length)return{valid:!1};const a=[];for(let r=0;r<e.length;r++){const n=Ce(e[r],t[r]);if(!n.valid)return{valid:!1};a.push(n.data)}return{valid:!0,data:a}}return a===x.date&&r===x.date&&+e===+t?{valid:!0,data:e}:{valid:!1}}class Ee extends U{_parse(e){const{status:t,ctx:a}=this._processInputParams(e),r=(e,r)=>{if(I(e)||I(r))return C;const n=Ce(e.value,r.value);return n.valid?((P(e)||P(r))&&t.dirty(),{status:t.value,value:n.data}):(N(a,{code:w.invalid_intersection_types}),C)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then(([e,t])=>r(e,t)):r(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}}Ee.create=(e,t,a)=>new Ee({left:e,right:t,typeName:rt.ZodIntersection,...D(a)});class Re extends U{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==x.array)return N(a,{code:w.invalid_type,expected:x.array,received:a.parsedType}),C;if(a.data.length<this._def.items.length)return N(a,{code:w.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),C;!this._def.rest&&a.data.length>this._def.items.length&&(N(a,{code:w.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const r=[...a.data].map((e,t)=>{const r=this._def.items[t]||this._def.rest;return r?r._parse(new z(a,e,a.path,t)):null}).filter(e=>!!e);return a.common.async?Promise.all(r).then(e=>A.mergeArray(t,e)):A.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new Re({...this._def,rest:e})}}Re.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Re({items:e,typeName:rt.ZodTuple,rest:null,...D(t)})};class Ie extends U{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==x.object)return N(a,{code:w.invalid_type,expected:x.object,received:a.parsedType}),C;const r=[],n=this._def.keyType,s=this._def.valueType;for(const e in a.data)r.push({key:n._parse(new z(a,e,a.path,e)),value:s._parse(new z(a,a.data[e],a.path,e)),alwaysSet:e in a.data});return a.common.async?A.mergeObjectAsync(t,r):A.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,a){return new Ie(t instanceof U?{keyType:e,valueType:t,typeName:rt.ZodRecord,...D(a)}:{keyType:pe.create(),valueType:e,typeName:rt.ZodRecord,...D(t)})}}class Pe extends U{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==x.map)return N(a,{code:w.invalid_type,expected:x.map,received:a.parsedType}),C;const r=this._def.keyType,n=this._def.valueType,s=[...a.data.entries()].map(([e,t],s)=>({key:r._parse(new z(a,e,a.path,[s,"key"])),value:n._parse(new z(a,t,a.path,[s,"value"]))}));if(a.common.async){const e=new Map;return Promise.resolve().then(async()=>{for(const a of s){const r=await a.key,n=await a.value;if("aborted"===r.status||"aborted"===n.status)return C;"dirty"!==r.status&&"dirty"!==n.status||t.dirty(),e.set(r.value,n.value)}return{status:t.value,value:e}})}{const e=new Map;for(const a of s){const r=a.key,n=a.value;if("aborted"===r.status||"aborted"===n.status)return C;"dirty"!==r.status&&"dirty"!==n.status||t.dirty(),e.set(r.value,n.value)}return{status:t.value,value:e}}}}Pe.create=(e,t,a)=>new Pe({valueType:t,keyType:e,typeName:rt.ZodMap,...D(a)});class Fe extends U{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==x.set)return N(a,{code:w.invalid_type,expected:x.set,received:a.parsedType}),C;const r=this._def;null!==r.minSize&&a.data.size<r.minSize.value&&(N(a,{code:w.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),null!==r.maxSize&&a.data.size>r.maxSize.value&&(N(a,{code:w.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());const n=this._def.valueType;function s(e){const a=new Set;for(const r of e){if("aborted"===r.status)return C;"dirty"===r.status&&t.dirty(),a.add(r.value)}return{status:t.value,value:a}}const i=[...a.data.values()].map((e,t)=>n._parse(new z(a,e,a.path,t)));return a.common.async?Promise.all(i).then(e=>s(e)):s(i)}min(e,t){return new Fe({...this._def,minSize:{value:e,message:L.toString(t)}})}max(e,t){return new Fe({...this._def,maxSize:{value:e,message:L.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Fe.create=(e,t)=>new Fe({valueType:e,minSize:null,maxSize:null,typeName:rt.ZodSet,...D(t)});class $e extends U{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==x.function)return N(t,{code:w.invalid_type,expected:x.function,received:t.parsedType}),C;function a(e,a){return Z({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,j(),O].filter(e=>!!e),issueData:{code:w.invalid_arguments,argumentsError:a}})}function r(e,a){return Z({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,j(),O].filter(e=>!!e),issueData:{code:w.invalid_return_type,returnTypeError:a}})}const n={errorMap:t.common.contextualErrorMap},s=t.data;if(this._def.returns instanceof Ve){const e=this;return R(async function(...t){const i=new S([]),o=await e._def.args.parseAsync(t,n).catch(e=>{throw i.addIssue(a(t,e)),i}),d=await Reflect.apply(s,this,o);return await e._def.returns._def.type.parseAsync(d,n).catch(e=>{throw i.addIssue(r(d,e)),i})})}{const e=this;return R(function(...t){const i=e._def.args.safeParse(t,n);if(!i.success)throw new S([a(t,i.error)]);const o=Reflect.apply(s,this,i.data),d=e._def.returns.safeParse(o,n);if(!d.success)throw new S([r(o,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new $e({...this._def,args:Re.create(e).rest(ke.create())})}returns(e){return new $e({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,a){return new $e({args:e||Re.create([]).rest(ke.create()),returns:t||ke.create(),typeName:rt.ZodFunction,...D(a)})}}class Le extends U{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}Le.create=(e,t)=>new Le({getter:e,typeName:rt.ZodLazy,...D(t)});class ze extends U{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return N(t,{received:t.data,code:w.invalid_literal,expected:this._def.value}),C}return{status:"valid",value:e.data}}get value(){return this._def.value}}function Me(e,t){return new De({values:e,typeName:rt.ZodEnum,...D(t)})}ze.create=(e,t)=>new ze({value:e,typeName:rt.ZodLiteral,...D(t)});class De extends U{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),a=this._def.values;return N(t,{expected:v.joinValues(a),received:t.parsedType,code:w.invalid_type}),C}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),a=this._def.values;return N(t,{received:t.data,code:w.invalid_enum_value,options:a}),C}return R(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return De.create(e,{...this._def,...t})}exclude(e,t=this._def){return De.create(this.options.filter(t=>!e.includes(t)),{...this._def,...t})}}De.create=Me;class Ue extends U{_parse(e){const t=v.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(e);if(a.parsedType!==x.string&&a.parsedType!==x.number){const e=v.objectValues(t);return N(a,{expected:v.joinValues(e),received:a.parsedType,code:w.invalid_type}),C}if(this._cache||(this._cache=new Set(v.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const e=v.objectValues(t);return N(a,{received:a.data,code:w.invalid_enum_value,options:e}),C}return R(e.data)}get enum(){return this._def.values}}Ue.create=(e,t)=>new Ue({values:e,typeName:rt.ZodNativeEnum,...D(t)});class Ve extends U{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==x.promise&&!1===t.common.async)return N(t,{code:w.invalid_type,expected:x.promise,received:t.parsedType}),C;const a=t.parsedType===x.promise?t.data:Promise.resolve(t.data);return R(a.then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}}Ve.create=(e,t)=>new Ve({type:e,typeName:rt.ZodPromise,...D(t)});class Ke extends U{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===rt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:a}=this._processInputParams(e),r=this._def.effect||null,n={addIssue:e=>{N(a,e),e.fatal?t.abort():t.dirty()},get path(){return a.path}};if(n.addIssue=n.addIssue.bind(n),"preprocess"===r.type){const e=r.transform(a.data,n);if(a.common.async)return Promise.resolve(e).then(async e=>{if("aborted"===t.value)return C;const r=await this._def.schema._parseAsync({data:e,path:a.path,parent:a});return"aborted"===r.status?C:"dirty"===r.status||"dirty"===t.value?E(r.value):r});{if("aborted"===t.value)return C;const r=this._def.schema._parseSync({data:e,path:a.path,parent:a});return"aborted"===r.status?C:"dirty"===r.status||"dirty"===t.value?E(r.value):r}}if("refinement"===r.type){const e=e=>{const t=r.refinement(e,n);if(a.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===a.common.async){const r=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return"aborted"===r.status?C:("dirty"===r.status&&t.dirty(),e(r.value),{status:t.value,value:r.value})}return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(a=>"aborted"===a.status?C:("dirty"===a.status&&t.dirty(),e(a.value).then(()=>({status:t.value,value:a.value}))))}if("transform"===r.type){if(!1===a.common.async){const e=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!F(e))return C;const s=r.transform(e.value,n);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:s}}return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(e=>F(e)?Promise.resolve(r.transform(e.value,n)).then(e=>({status:t.value,value:e})):C)}v.assertNever(r)}}Ke.create=(e,t,a)=>new Ke({schema:e,typeName:rt.ZodEffects,effect:t,...D(a)}),Ke.createWithPreprocess=(e,t,a)=>new Ke({schema:t,effect:{type:"preprocess",transform:e},typeName:rt.ZodEffects,...D(a)});class Be extends U{_parse(e){return this._getType(e)===x.undefined?R(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Be.create=(e,t)=>new Be({innerType:e,typeName:rt.ZodOptional,...D(t)});class qe extends U{_parse(e){return this._getType(e)===x.null?R(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}qe.create=(e,t)=>new qe({innerType:e,typeName:rt.ZodNullable,...D(t)});class We extends U{_parse(e){const{ctx:t}=this._processInputParams(e);let a=t.data;return t.parsedType===x.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}We.create=(e,t)=>new We({innerType:e,typeName:rt.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...D(t)});class Je extends U{_parse(e){const{ctx:t}=this._processInputParams(e),a={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return $(r)?r.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new S(a.common.issues)},input:a.data})})):{status:"valid",value:"valid"===r.status?r.value:this._def.catchValue({get error(){return new S(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}}Je.create=(e,t)=>new Je({innerType:e,typeName:rt.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...D(t)});class He extends U{_parse(e){if(this._getType(e)!==x.nan){const t=this._getOrReturnCtx(e);return N(t,{code:w.invalid_type,expected:x.nan,received:t.parsedType}),C}return{status:"valid",value:e.data}}}He.create=e=>new He({typeName:rt.ZodNaN,...D(e)});const Ge=Symbol("zod_brand");class Xe extends U{_parse(e){const{ctx:t}=this._processInputParams(e),a=t.data;return this._def.type._parse({data:a,path:t.path,parent:t})}unwrap(){return this._def.type}}class Ye extends U{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.common.async){return(async()=>{const e=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return"aborted"===e.status?C:"dirty"===e.status?(t.dirty(),E(e.value)):this._def.out._parseAsync({data:e.value,path:a.path,parent:a})})()}{const e=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return"aborted"===e.status?C:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:a.path,parent:a})}}static create(e,t){return new Ye({in:e,out:t,typeName:rt.ZodPipeline})}}class Qe extends U{_parse(e){const t=this._def.innerType._parse(e),a=e=>(F(e)&&(e.value=Object.freeze(e.value)),e);return $(t)?t.then(e=>a(e)):a(t)}unwrap(){return this._def.innerType}}function et(e,t){const a="function"==typeof e?e(t):"string"==typeof e?{message:e}:e;return"string"==typeof a?{message:a}:a}function tt(e,t={},a){return e?xe.create().superRefine((r,n)=>{const s=e(r);if(s instanceof Promise)return s.then(e=>{if(!e){const e=et(t,r),s=e.fatal??a??!0;n.addIssue({code:"custom",...e,fatal:s})}});if(!s){const e=et(t,r),s=e.fatal??a??!0;n.addIssue({code:"custom",...e,fatal:s})}}):xe.create()}Qe.create=(e,t)=>new Qe({innerType:e,typeName:rt.ZodReadonly,...D(t)});const at={object:je.lazycreate};var rt;!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"}(rt||(rt={}));const nt=pe.create,st=fe.create,it=He.create,ot=me.create,dt=ye.create,ct=ve.create,ut=ge.create,lt=_e.create,pt=be.create,ht=xe.create,ft=ke.create,mt=we.create,yt=Se.create,vt=Oe.create,gt=je.create,_t=je.strictCreate,bt=Ze.create,xt=Ae.create,kt=Ee.create,wt=Re.create,St=Ie.create,Ot=Pe.create,Tt=Fe.create,jt=$e.create,Zt=Le.create,Nt=ze.create,At=De.create,Ct=Ue.create,Et=Ve.create,Rt=Ke.create,It=Be.create,Pt=qe.create,Ft=Ke.createWithPreprocess,$t=Ye.create,Lt={string:e=>pe.create({...e,coerce:!0}),number:e=>fe.create({...e,coerce:!0}),boolean:e=>ye.create({...e,coerce:!0}),bigint:e=>me.create({...e,coerce:!0}),date:e=>ve.create({...e,coerce:!0})},zt=C;var Mt=Object.freeze({__proto__:null,BRAND:Ge,DIRTY:E,EMPTY_PATH:[],INVALID:C,NEVER:zt,OK:R,ParseStatus:A,Schema:U,ZodAny:xe,ZodArray:Oe,ZodBigInt:me,ZodBoolean:ye,ZodBranded:Xe,ZodCatch:Je,ZodDate:ve,ZodDefault:We,ZodDiscriminatedUnion:Ae,ZodEffects:Ke,ZodEnum:De,ZodError:S,get ZodFirstPartyTypeKind(){return rt},ZodFunction:$e,ZodIntersection:Ee,ZodIssueCode:w,ZodLazy:Le,ZodLiteral:ze,ZodMap:Pe,ZodNaN:He,ZodNativeEnum:Ue,ZodNever:we,ZodNull:be,ZodNullable:qe,ZodNumber:fe,ZodObject:je,ZodOptional:Be,ZodParsedType:x,ZodPipeline:Ye,ZodPromise:Ve,ZodReadonly:Qe,ZodRecord:Ie,ZodSchema:U,ZodSet:Fe,ZodString:pe,ZodSymbol:ge,ZodTransformer:Ke,ZodTuple:Re,ZodType:U,ZodUndefined:_e,ZodUnion:Ze,ZodUnknown:ke,ZodVoid:Se,addIssueToContext:N,any:ht,array:vt,bigint:ot,boolean:dt,coerce:Lt,custom:tt,date:ct,datetimeRegex:de,defaultErrorMap:O,discriminatedUnion:xt,effect:Rt,enum:At,function:jt,getErrorMap:j,getParsedType:k,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>tt(t=>t instanceof e,t),intersection:kt,isAborted:I,isAsync:$,isDirty:P,isValid:F,late:at,lazy:Zt,literal:Nt,makeIssue:Z,map:Ot,nan:it,nativeEnum:Ct,never:mt,null:pt,nullable:Pt,number:st,object:gt,get objectUtil(){return g},oboolean:()=>dt().optional(),onumber:()=>st().optional(),optional:It,ostring:()=>nt().optional(),pipeline:$t,preprocess:Ft,promise:Et,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),record:St,set:Tt,setErrorMap:function(e){T=e},strictObject:_t,string:nt,symbol:ut,transformer:Rt,tuple:wt,undefined:lt,union:bt,unknown:ft,get util(){return v},void:yt}),Dt={isLoading:!1,error:"",data:null},Ut=function(e,t){switch(t.type){case"CALL":return h(h({},e),{isLoading:!0,error:""});case"ERROR":return h(h({},e),{isLoading:!1,error:t.payload});case"SUCCESS":return h(h({},e),{isLoading:!1,data:t.payload});default:return e}},Vt={isLoading:!1,error:"",data:null},Kt=function(e,t){switch(t.type){case"CALL":return h(h({},e),{isLoading:!0,error:""});case"ERROR":return h(h({},e),{isLoading:!1,error:t.payload});case"SUCCESS":return h(h({},e),{isLoading:!1,data:t.payload});default:return e}};exports.FormContext=b,exports.N8xForm=function(e){var a=e.fields,r=e.defaultFieldStyles,n=e.onShubmit,s=e.mode,i=e.children,o=t.useContext(b),d=o.setMode,c=o.formUtils,u=o.setValidationSchema,l=c.register,h=c.handleSubmit,f=c.formState,m=f.errors,y=f.isSubmitting,v=Object.keys(a),g=!Array.isArray(a),x=r||exports.EDefaultFieldStyles.SOFT_GLASS,k=t.useMemo(function(){return g?v.flatMap(function(e){return a[e]}):a},[a,g,v]),w=t.useMemo(function(){var e=Object.fromEntries(k.filter(function(e){return!!e.validationScheme}).map(function(e){return[e.name,e.validationScheme]}));return Mt.object(e)},[k]);return t.useEffect(function(){u(w),d(s||"onChange")},[w,s]),t.useEffect(function(){c.reset()},[a,c]),p.jsx("div",{className:"w-full py-4",children:p.jsxs("form",{className:"grid grid-cols-4 gap-4",onSubmit:h(n),children:[g?v.map(function(e,t){return p.jsxs("div",{className:" grid grid-cols-4 gap-4 col-span-4",children:[p.jsx("h1",{className:"col-span-4 border-b border-zinc-200 py-2 text-xl",children:e}),a[e].map(function(e){return _(e,x,l,m,y)})]},t)}):a.map(function(e){return _(e,x,l,m,y)}),i]})})},exports.useN8xFormQuery=function(e){var r=t.useReducer(Ut,Dt),n=r[0],s=r[1];return h(h({},n),{execute:function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return f(void 0,void 0,void 0,function(){var r,n,i,o,d,c,u,l,p,h;return m(this,function(f){switch(f.label){case 0:r=new AbortController,s({type:"CALL"}),f.label=1;case 1:return f.trys.push([1,3,,4]),[4,e.apply(void 0,y(y([],t,!1),[{signal:r.signal}],!1))];case 2:return n=f.sent(),s({type:"SUCCESS",payload:n.data}),[3,4];case 3:return i=f.sent(),o="",a.isAxiosError(i)?o=Array.isArray(null===(d=i.response)||void 0===d?void 0:d.data.message)?null===(l=null===(u=null===(c=i.response)||void 0===c?void 0:c.data)||void 0===u?void 0:u.message)||void 0===l?void 0:l[0]:(null===(h=null===(p=i.response)||void 0===p?void 0:p.data)||void 0===h?void 0:h.message)||i.message:i instanceof Error&&(o=i.message),a.isCancel(i)?(s({type:"ERROR",payload:"Request Canceled"}),[2]):(i instanceof Error&&s({type:"ERROR",payload:o}),[3,4]);case 4:return[2,function(){return r.abort()}]}})})}})},exports.useN8xQuery=function(e){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];var s=t.useReducer(Kt,Vt),i=s[0],o=s[1];return t.useEffect(function(){var t=new AbortController;return o({type:"CALL"}),f(void 0,void 0,void 0,function(){var n,s,i,d,c,u,l,p,h;return m(this,function(f){switch(f.label){case 0:return f.trys.push([0,2,,3]),[4,e.apply(void 0,y(y([],r,!1),[{signal:t.signal}],!1))];case 1:return n=f.sent(),o({type:"SUCCESS",payload:n.data}),[3,3];case 2:return s=f.sent(),i="",a.isAxiosError(s)?i=Array.isArray(null===(d=s.response)||void 0===d?void 0:d.data.message)?null===(l=null===(u=null===(c=s.response)||void 0===c?void 0:c.data)||void 0===u?void 0:u.message)||void 0===l?void 0:l[0]:(null===(h=null===(p=s.response)||void 0===p?void 0:p.data)||void 0===h?void 0:h.message)||s.message:s instanceof Error&&(i=s.message),a.isCancel(s)?(o({type:"ERROR",payload:"Request Canceled"}),[2]):(s instanceof Error&&o({type:"ERROR",payload:i}),[3,3]);case 3:return[2]}})}),function(){return t.abort()}},[]),h({},i)},exports.z=Mt;
10
+ */function d(){return s||(s=1,"production"!==process.env.NODE_ENV&&function(){function e(t){if(null==t)return null;if("function"==typeof t)return t.$$typeof===T?null:t.displayName||t.name||null;if("string"==typeof t)return t;switch(t){case m:return"Fragment";case v:return"Profiler";case y:return"StrictMode";case x:return"Suspense";case k:return"SuspenseList";case O:return"Activity"}if("object"==typeof t)switch("number"==typeof t.tag&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),t.$$typeof){case f:return"Portal";case _:return t.displayName||"Context";case g:return(t._context.displayName||"Context")+".Consumer";case b:var a=t.render;return(t=t.displayName)||(t=""!==(t=a.displayName||a.name||"")?"ForwardRef("+t+")":"ForwardRef"),t;case w:return null!==(a=t.displayName||null)?a:e(t.type)||"Memo";case S:a=t._payload,t=t._init;try{return e(t(a))}catch(e){}}return null}function a(e){return""+e}function r(e){try{a(e);var t=!1}catch(e){t=!0}if(t){var r=(t=console).error,n="function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return r.call(t,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",n),a(e)}}function n(t){if(t===m)return"<>";if("object"==typeof t&&null!==t&&t.$$typeof===S)return"<...>";try{var a=e(t);return a?"<"+a+">":"<...>"}catch(e){return"<...>"}}function s(){return Error("react-stack-top-frame")}function i(){var t=e(this.type);return C[t]||(C[t]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),void 0!==(t=this.props.ref)?t:null}function d(t,a,n,s,o,d){var u,p=a.children;if(void 0!==p)if(s)if(N(p)){for(s=0;s<p.length;s++)c(p[s]);Object.freeze&&Object.freeze(p)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else c(p);if(Z.call(a,"key")){p=e(t);var f=Object.keys(a).filter(function(e){return"key"!==e});s=0<f.length?"{key: someKey, "+f.join(": ..., ")+": ...}":"{key: someKey}",I[p+s]||(f=0<f.length?"{"+f.join(": ..., ")+": ...}":"{}",console.error('A props object containing a "key" prop is being spread into JSX:\n let props = %s;\n <%s {...props} />\nReact keys must be passed directly to JSX without using spread:\n let props = %s;\n <%s key={someKey} {...props} />',s,p,f,p),I[p+s]=!0)}if(p=null,void 0!==n&&(r(n),p=""+n),function(e){if(Z.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}(a)&&(r(a.key),p=""+a.key),"key"in a)for(var m in n={},a)"key"!==m&&(n[m]=a[m]);else n=a;return p&&function(e,t){function a(){l||(l=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",t))}a.isReactWarning=!0,Object.defineProperty(e,"key",{get:a,configurable:!0})}(n,"function"==typeof t?t.displayName||t.name||"Unknown":t),function(e,t,a,r,n,s){var o=a.ref;return e={$$typeof:h,type:e,key:t,props:a,_owner:r},null!==(void 0!==o?o:null)?Object.defineProperty(e,"ref",{enumerable:!1,get:i}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:n}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:s}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}(t,p,n,null===(u=j.A)?null:u.getOwner(),o,d)}function c(e){u(e)?e._store&&(e._store.validated=1):"object"==typeof e&&null!==e&&e.$$typeof===S&&("fulfilled"===e._payload.status?u(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function u(e){return"object"==typeof e&&null!==e&&e.$$typeof===h}var l,p=t,h=Symbol.for("react.transitional.element"),f=Symbol.for("react.portal"),m=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),g=Symbol.for("react.consumer"),_=Symbol.for("react.context"),b=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),w=Symbol.for("react.memo"),S=Symbol.for("react.lazy"),O=Symbol.for("react.activity"),T=Symbol.for("react.client.reference"),j=p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z=Object.prototype.hasOwnProperty,N=Array.isArray,A=console.createTask?console.createTask:function(){return null},C={},E=(p={react_stack_bottom_frame:function(e){return e()}}).react_stack_bottom_frame.bind(p,s)(),R=A(n(s)),I={};o.Fragment=m,o.jsx=function(e,t,a){var r=1e4>j.recentlyCreatedOwnerStacks++;return d(e,t,a,!1,r?Error("react-stack-top-frame"):E,r?A(n(e)):R)},o.jsxs=function(e,t,a){var r=1e4>j.recentlyCreatedOwnerStacks++;return d(e,t,a,!0,r?Error("react-stack-top-frame"):E,r?A(n(e)):R)}}()),o}var c,u,l,p=(i||(i=1,"production"===process.env.NODE_ENV?r.exports=function(){if(e)return n;e=1;var t=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function r(e,a,r){var n=null;if(void 0!==r&&(n=""+r),void 0!==a.key&&(n=""+a.key),"key"in a)for(var s in r={},a)"key"!==s&&(r[s]=a[s]);else r=a;return a=r.ref,{$$typeof:t,type:e,key:n,ref:void 0!==a?a:null,props:r}}return n.Fragment=a,n.jsx=r,n.jsxs=r,n}():r.exports=d()),r.exports);exports.EDefaultFieldStyles=void 0,(c=exports.EDefaultFieldStyles||(exports.EDefaultFieldStyles={})).CLEAN="\n w-full\n bg-white\n border border-zinc-300\n rounded-lg\n px-4 py-2.5\n text-sm\n text-zinc-800\n placeholder:text-zinc-400\n outline-none\n transition-all\n focus:border-zinc-900\n focus:ring-2\n focus:ring-zinc-900/10\n ",c.SOFT_GLASS="\n w-full\n bg-zinc-50\n border border-zinc-200\n rounded-xl\n px-4 py-2.5\n text-sm\n text-zinc-800\n placeholder:text-zinc-400\n outline-none\n transition-all duration-200\n focus:bg-white\n focus:border-zinc-900\n focus:ring-4\n focus:ring-zinc-900/5\n ",c.DARK="\n w-full\n bg-zinc-900\n border border-zinc-700\n rounded-lg\n px-4 py-2.5\n text-sm\n text-zinc-100\n placeholder:text-zinc-500\n outline-none\n transition-all\n focus:border-zinc-400\n focus:ring-2\n focus:ring-zinc-400/20\n ",c.FLOATING_LABEL="\n peer\n w-full\n bg-transparent\n border-b border-zinc-300\n px-0 py-2\n text-sm\n text-zinc-800\n placeholder-transparent\n outline-none\n transition-all\n focus:border-zinc-900\n ",exports.FormFieldTypes=void 0,(u=exports.FormFieldTypes||(exports.FormFieldTypes={})).TEXT="text",u.NUMBER="number",u.EMAIL="email",u.PASSWORD="password",u.SELECT="select",u.RADIO="radio",u.CHECKBOX="checkbox",u.TEXTAREA="textarea",u.DATE="date",u.FILE="file",u.SUBMIT="submit",exports.FormFieldWidth=void 0,(l=exports.FormFieldWidth||(exports.FormFieldWidth={})).FULL="col-span-4",l.HALF="col-span-2",l.THIRD="col-span-3",l.QUARTER="col-span-1";var h=function(){return h=Object.assign||function(e){for(var t,a=1,r=arguments.length;a<r;a++)for(var n in t=arguments[a])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},h.apply(this,arguments)};function f(e,t,a,r){return new(a||(a=Promise))(function(n,s){function i(e){try{d(r.next(e))}catch(e){s(e)}}function o(e){try{d(r.throw(e))}catch(e){s(e)}}function d(e){var t;e.done?n(e.value):(t=e.value,t instanceof a?t:new a(function(e){e(t)})).then(i,o)}d((r=r.apply(e,t||[])).next())})}function m(e,t){var a,r,n,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return i.next=o(0),i.throw=o(1),i.return=o(2),"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function o(o){return function(d){return function(o){if(a)throw new TypeError("Generator is already executing.");for(;i&&(i=0,o[0]&&(s=0)),s;)try{if(a=1,r&&(n=2&o[0]?r.return:o[0]?r.throw||((n=r.return)&&n.call(r),0):r.next)&&!(n=n.call(r,o[1])).done)return n;switch(r=0,n&&(o=[2&o[0],n.value]),o[0]){case 0:case 1:n=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(n=s.trys,(n=n.length>0&&n[n.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!n||o[1]>n[0]&&o[1]<n[3])){s.label=o[1];break}if(6===o[0]&&s.label<n[1]){s.label=n[1],n=o;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(o);break}n[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],r=0}finally{a=n=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,d])}}}function y(e,t,a){if(a||2===arguments.length)for(var r,n=0,s=t.length;n<s;n++)!r&&n in t||(r||(r=Array.prototype.slice.call(t,0,n)),r[n]=t[n]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var v,g,_=function(e,a,r,n,s){var i,o,d,c,u,l,f,m;switch(e.type){case"select":return p.jsxs("div",{className:"".concat(e.width||""," flex flex-col gap-1"),children:[e.label&&p.jsx("label",{htmlFor:e.name,children:e.label}),p.jsxs("select",h({defaultValue:e.default,className:"".concat(e._className||a),required:e.required},r(e.name),{children:[null===(i=e.options)||void 0===i?void 0:i.map(function(e){return p.jsx("option",{value:e.value,children:e.label},e.value)}),n&&Object.keys(n).includes(e.name)?p.jsx("p",{className:"text-red-500 text-sm",children:null===(o=n[e.name])||void 0===o?void 0:o.message}):""]}),e.name)]},e.name);case"radio":return p.jsxs("div",{className:"".concat(e.width||""," flex flex-col gap-1"),children:[e.label&&p.jsx("label",{children:e.label}),p.jsxs("div",{className:"flex gap-4 flex-wra text-sm",children:[null===(d=e.options)||void 0===d?void 0:d.map(function(t){return p.jsxs("label",{className:"flex items-center gap-1 border border-zinc-200 rounded-full px-2 py-1",children:[p.jsx("input",h({},r(e.name),{type:"radio",name:e.name,value:t.value,required:e.required})),t.label]},t.value)}),n&&Object.keys(n).includes(e.name)?p.jsx("p",{className:"text-red-500 text-sm",children:null===(c=n[e.name])||void 0===c?void 0:c.message}):""]})]},e.name);case"checkbox":return p.jsxs("div",{className:"".concat(e.width||""," flex flex-col gap-1"),children:[e.label&&p.jsx("label",{children:e.label}),p.jsxs("div",{className:"flex gap-4 flex-wrap text-sm",children:[null===(u=e.options)||void 0===u?void 0:u.map(function(t){return p.jsxs("label",{className:"flex items-center gap-1 border border-zinc-200 rounded-full px-2 py-1",children:[p.jsx("input",h({},r(e.name),{type:"checkbox",name:e.name,value:t.value})),t.label]},t.value)}),n&&Object.keys(n).includes(e.name)?p.jsx("p",{className:"text-red-500 text-sm",children:null===(l=n[e.name])||void 0===l?void 0:l.message}):""]})]},e.name);case"textarea":return p.jsxs("div",{className:"".concat(e.width||""," flex flex-col gap-1"),children:[e.label&&p.jsx("label",{htmlFor:e.name,children:e.label}),t.createElement("textarea",h({},r(e.name),{key:e.name,name:e.name,defaultValue:e.default,className:"".concat(e._className||a," resize-none"),placeholder:e.placeholder,required:e.required})),n&&Object.keys(n).includes(e.name)?p.jsx("p",{className:"text-red-500 text-sm",children:null===(f=n[e.name])||void 0===f?void 0:f.message}):""]},e.name);case"submit":return p.jsx("div",{className:"".concat(s?e.width+"bg-zinc-400":e.width||""," flex flex-col gap-1"),children:p.jsx("button",{disabled:s,type:"submit",className:"".concat(e._className||a," flex justify-center items-center"),children:s?p.jsx("p",{className:"w-4 h-4 p-1 border-2 border-t-0 animate-spin rounded-full"}):e.label||"Submit"})},e.name);default:return p.jsxs("div",{className:"".concat(e.width||""," flex flex-col gap-1"),children:[e.label&&p.jsx("label",{htmlFor:e.name,children:e.label}),t.createElement("input",h({},r(e.name),{key:e.name,name:e.name,defaultValue:e.default,min:e.min,max:e.max,type:e.type,className:"".concat(e._className||a),placeholder:e.placeholder,required:e.required})),n&&Object.keys(n).includes(e.name)?p.jsx("p",{className:"text-red-500 text-sm",children:null===(m=n[e.name])||void 0===m?void 0:m.message}):""]},e.name)}},b=t.createContext(null);!function(e){e.assertEqual=e=>{},e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const a of e)t[a]=a;return t},e.getValidEnumValues=t=>{const a=e.objectKeys(t).filter(e=>"number"!=typeof t[t[e]]),r={};for(const e of a)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.push(a);return t},e.find=(e,t)=>{for(const a of e)if(t(a))return a},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(v||(v={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(g||(g={}));const x=v.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),k=e=>{switch(typeof e){case"undefined":return x.undefined;case"string":return x.string;case"number":return Number.isNaN(e)?x.nan:x.number;case"boolean":return x.boolean;case"function":return x.function;case"bigint":return x.bigint;case"symbol":return x.symbol;case"object":return Array.isArray(e)?x.array:null===e?x.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?x.promise:"undefined"!=typeof Map&&e instanceof Map?x.map:"undefined"!=typeof Set&&e instanceof Set?x.set:"undefined"!=typeof Date&&e instanceof Date?x.date:x.object;default:return x.unknown}},w=v.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class S 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]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(e){return e.message},a={_errors:[]},r=e=>{for(const n of e.issues)if("invalid_union"===n.code)n.unionErrors.map(r);else if("invalid_return_type"===n.code)r(n.returnTypeError);else if("invalid_arguments"===n.code)r(n.argumentsError);else if(0===n.path.length)a._errors.push(t(n));else{let e=a,r=0;for(;r<n.path.length;){const a=n.path[r];r===n.path.length-1?(e[a]=e[a]||{_errors:[]},e[a]._errors.push(t(n))):e[a]=e[a]||{_errors:[]},e=e[a],r++}}};return r(this),a}static assert(e){if(!(e instanceof S))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,v.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t=Object.create(null),a=[];for(const r of this.issues)if(r.path.length>0){const a=r.path[0];t[a]=t[a]||[],t[a].push(e(r))}else a.push(e(r));return{formErrors:a,fieldErrors:t}}get formErrors(){return this.flatten()}}S.create=e=>new S(e);const O=(e,t)=>{let a;switch(e.code){case w.invalid_type:a=e.received===x.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case w.invalid_literal:a=`Invalid literal value, expected ${JSON.stringify(e.expected,v.jsonStringifyReplacer)}`;break;case w.unrecognized_keys:a=`Unrecognized key(s) in object: ${v.joinValues(e.keys,", ")}`;break;case w.invalid_union:a="Invalid input";break;case w.invalid_union_discriminator:a=`Invalid discriminator value. Expected ${v.joinValues(e.options)}`;break;case w.invalid_enum_value:a=`Invalid enum value. Expected ${v.joinValues(e.options)}, received '${e.received}'`;break;case w.invalid_arguments:a="Invalid function arguments";break;case w.invalid_return_type:a="Invalid function return type";break;case w.invalid_date:a="Invalid date";break;case w.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(a=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(a=`${a} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?a=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?a=`Invalid input: must end with "${e.validation.endsWith}"`:v.assertNever(e.validation):a="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case w.too_small:a="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type||"bigint"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`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 w.too_big:a="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case w.custom:a="Invalid input";break;case w.invalid_intersection_types:a="Intersection results could not be merged";break;case w.not_multiple_of:a=`Number must be a multiple of ${e.multipleOf}`;break;case w.not_finite:a="Number must be finite";break;default:a=t.defaultError,v.assertNever(e)}return{message:a}};let T=O;function j(){return T}const Z=e=>{const{data:t,path:a,errorMaps:r,issueData:n}=e,s=[...a,...n.path||[]],i={...n,path:s};if(void 0!==n.message)return{...n,path:s,message:n.message};let o="";const d=r.filter(e=>!!e).slice().reverse();for(const e of d)o=e(i,{data:t,defaultError:o}).message;return{...n,path:s,message:o}};function N(e,t){const a=j(),r=Z({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,a,a===O?void 0:O].filter(e=>!!e)});e.common.issues.push(r)}class A{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const a=[];for(const r of t){if("aborted"===r.status)return C;"dirty"===r.status&&e.dirty(),a.push(r.value)}return{status:e.value,value:a}}static async mergeObjectAsync(e,t){const a=[];for(const e of t){const t=await e.key,r=await e.value;a.push({key:t,value:r})}return A.mergeObjectSync(e,a)}static mergeObjectSync(e,t){const a={};for(const r of t){const{key:t,value:n}=r;if("aborted"===t.status)return C;if("aborted"===n.status)return C;"dirty"===t.status&&e.dirty(),"dirty"===n.status&&e.dirty(),"__proto__"===t.value||void 0===n.value&&!r.alwaysSet||(a[t.value]=n.value)}return{status:e.value,value:a}}}const C=Object.freeze({status:"aborted"}),E=e=>({status:"dirty",value:e}),R=e=>({status:"valid",value:e}),I=e=>"aborted"===e.status,P=e=>"dirty"===e.status,F=e=>"valid"===e.status,$=e=>"undefined"!=typeof Promise&&e instanceof Promise;var L;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:e?.message}(L||(L={}));class z{constructor(e,t,a,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=a,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 M=(e,t)=>{if(F(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new S(e.common.issues);return this._error=t,this._error}}};function D(e){if(!e)return{};const{errorMap:t,invalid_type_error:a,required_error:r,description:n}=e;if(t&&(a||r))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(t)return{errorMap:t,description:n};return{errorMap:(t,n)=>{const{message:s}=e;return"invalid_enum_value"===t.code?{message:s??n.defaultError}:void 0===n.data?{message:s??r??n.defaultError}:"invalid_type"!==t.code?{message:n.defaultError}:{message:s??a??n.defaultError}},description:n}}class U{get description(){return this._def.description}_getType(e){return k(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:k(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new A,ctx:{common:e.parent.common,data:e.data,parsedType:k(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if($(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const a=this.safeParse(e,t);if(a.success)return a.data;throw a.error}safeParse(e,t){const a={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:k(e)},r=this._parseSync({data:e,path:a.path,parent:a});return M(a,r)}"~validate"(e){const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:k(e)};if(!this["~standard"].async)try{const a=this._parseSync({data:e,path:[],parent:t});return F(a)?{value:a.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=>F(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){const a=await this.safeParseAsync(e,t);if(a.success)return a.data;throw a.error}async safeParseAsync(e,t){const a={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:k(e)},r=this._parse({data:e,path:a.path,parent:a}),n=await($(r)?r:Promise.resolve(r));return M(a,n)}refine(e,t){const a=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement((t,r)=>{const n=e(t),s=()=>r.addIssue({code:w.custom,...a(t)});return"undefined"!=typeof Promise&&n instanceof Promise?n.then(e=>!!e||(s(),!1)):!!n||(s(),!1)})}refinement(e,t){return this._refinement((a,r)=>!!e(a)||(r.addIssue("function"==typeof t?t(a,r):t),!1))}_refinement(e){return new Ke({schema:this,typeName:rt.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 Be.create(this,this._def)}nullable(){return qe.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Oe.create(this)}promise(){return Ve.create(this,this._def)}or(e){return Ze.create([this,e],this._def)}and(e){return Ee.create(this,e,this._def)}transform(e){return new Ke({...D(this._def),schema:this,typeName:rt.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new We({...D(this._def),innerType:this,defaultValue:t,typeName:rt.ZodDefault})}brand(){return new Xe({typeName:rt.ZodBranded,type:this,...D(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new Je({...D(this._def),innerType:this,catchValue:t,typeName:rt.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return Ye.create(this,e)}readonly(){return Qe.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const V=/^c[^\s-]{8,}$/i,K=/^[0-9a-z]+$/,B=/^[0-9A-HJKMNP-TV-Z]{26}$/i,q=/^[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,W=/^[a-z0-9_-]{21}$/i,J=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,H=/^[-+]?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)?)??$/,G=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let X;const Y=/^(?:(?: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])$/,Q=/^(?:(?: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])$/,ee=/^(([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]))$/,te=/^(([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])$/,ae=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,re=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ne="((\\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])))",se=new RegExp(`^${ne}$`);function ie(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`);return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${e.precision?"+":"?"}`}function oe(e){return new RegExp(`^${ie(e)}$`)}function de(e){let t=`${ne}T${ie(e)}`;const a=[];return a.push(e.local?"Z?":"Z"),e.offset&&a.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${a.join("|")})`,new RegExp(`^${t}$`)}function ce(e,t){return!("v4"!==t&&t||!Y.test(e))||!("v6"!==t&&t||!ee.test(e))}function ue(e,t){if(!J.test(e))return!1;try{const[a]=e.split(".");if(!a)return!1;const r=a.replace(/-/g,"+").replace(/_/g,"/").padEnd(a.length+(4-a.length%4)%4,"="),n=JSON.parse(atob(r));return"object"==typeof n&&null!==n&&((!("typ"in n)||"JWT"===n?.typ)&&(!!n.alg&&(!t||n.alg===t)))}catch{return!1}}function le(e,t){return!("v4"!==t&&t||!Q.test(e))||!("v6"!==t&&t||!te.test(e))}class pe extends U{_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==x.string){const t=this._getOrReturnCtx(e);return N(t,{code:w.invalid_type,expected:x.string,received:t.parsedType}),C}const t=new A;let a;for(const r of this._def.checks)if("min"===r.kind)e.data.length<r.value&&(a=this._getOrReturnCtx(e,a),N(a,{code:w.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),t.dirty());else if("max"===r.kind)e.data.length>r.value&&(a=this._getOrReturnCtx(e,a),N(a,{code:w.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!1,message:r.message}),t.dirty());else if("length"===r.kind){const n=e.data.length>r.value,s=e.data.length<r.value;(n||s)&&(a=this._getOrReturnCtx(e,a),n?N(a,{code:w.too_big,maximum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}):s&&N(a,{code:w.too_small,minimum:r.value,type:"string",inclusive:!0,exact:!0,message:r.message}),t.dirty())}else if("email"===r.kind)G.test(e.data)||(a=this._getOrReturnCtx(e,a),N(a,{validation:"email",code:w.invalid_string,message:r.message}),t.dirty());else if("emoji"===r.kind)X||(X=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),X.test(e.data)||(a=this._getOrReturnCtx(e,a),N(a,{validation:"emoji",code:w.invalid_string,message:r.message}),t.dirty());else if("uuid"===r.kind)q.test(e.data)||(a=this._getOrReturnCtx(e,a),N(a,{validation:"uuid",code:w.invalid_string,message:r.message}),t.dirty());else if("nanoid"===r.kind)W.test(e.data)||(a=this._getOrReturnCtx(e,a),N(a,{validation:"nanoid",code:w.invalid_string,message:r.message}),t.dirty());else if("cuid"===r.kind)V.test(e.data)||(a=this._getOrReturnCtx(e,a),N(a,{validation:"cuid",code:w.invalid_string,message:r.message}),t.dirty());else if("cuid2"===r.kind)K.test(e.data)||(a=this._getOrReturnCtx(e,a),N(a,{validation:"cuid2",code:w.invalid_string,message:r.message}),t.dirty());else if("ulid"===r.kind)B.test(e.data)||(a=this._getOrReturnCtx(e,a),N(a,{validation:"ulid",code:w.invalid_string,message:r.message}),t.dirty());else if("url"===r.kind)try{new URL(e.data)}catch{a=this._getOrReturnCtx(e,a),N(a,{validation:"url",code:w.invalid_string,message:r.message}),t.dirty()}else if("regex"===r.kind){r.regex.lastIndex=0;r.regex.test(e.data)||(a=this._getOrReturnCtx(e,a),N(a,{validation:"regex",code:w.invalid_string,message:r.message}),t.dirty())}else if("trim"===r.kind)e.data=e.data.trim();else if("includes"===r.kind)e.data.includes(r.value,r.position)||(a=this._getOrReturnCtx(e,a),N(a,{code:w.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),t.dirty());else if("toLowerCase"===r.kind)e.data=e.data.toLowerCase();else if("toUpperCase"===r.kind)e.data=e.data.toUpperCase();else if("startsWith"===r.kind)e.data.startsWith(r.value)||(a=this._getOrReturnCtx(e,a),N(a,{code:w.invalid_string,validation:{startsWith:r.value},message:r.message}),t.dirty());else if("endsWith"===r.kind)e.data.endsWith(r.value)||(a=this._getOrReturnCtx(e,a),N(a,{code:w.invalid_string,validation:{endsWith:r.value},message:r.message}),t.dirty());else if("datetime"===r.kind){de(r).test(e.data)||(a=this._getOrReturnCtx(e,a),N(a,{code:w.invalid_string,validation:"datetime",message:r.message}),t.dirty())}else if("date"===r.kind){se.test(e.data)||(a=this._getOrReturnCtx(e,a),N(a,{code:w.invalid_string,validation:"date",message:r.message}),t.dirty())}else if("time"===r.kind){oe(r).test(e.data)||(a=this._getOrReturnCtx(e,a),N(a,{code:w.invalid_string,validation:"time",message:r.message}),t.dirty())}else"duration"===r.kind?H.test(e.data)||(a=this._getOrReturnCtx(e,a),N(a,{validation:"duration",code:w.invalid_string,message:r.message}),t.dirty()):"ip"===r.kind?ce(e.data,r.version)||(a=this._getOrReturnCtx(e,a),N(a,{validation:"ip",code:w.invalid_string,message:r.message}),t.dirty()):"jwt"===r.kind?ue(e.data,r.alg)||(a=this._getOrReturnCtx(e,a),N(a,{validation:"jwt",code:w.invalid_string,message:r.message}),t.dirty()):"cidr"===r.kind?le(e.data,r.version)||(a=this._getOrReturnCtx(e,a),N(a,{validation:"cidr",code:w.invalid_string,message:r.message}),t.dirty()):"base64"===r.kind?ae.test(e.data)||(a=this._getOrReturnCtx(e,a),N(a,{validation:"base64",code:w.invalid_string,message:r.message}),t.dirty()):"base64url"===r.kind?re.test(e.data)||(a=this._getOrReturnCtx(e,a),N(a,{validation:"base64url",code:w.invalid_string,message:r.message}),t.dirty()):v.assertNever(r);return{status:t.value,value:e.data}}_regex(e,t,a){return this.refinement(t=>e.test(t),{validation:t,code:w.invalid_string,...L.errToObj(a)})}_addCheck(e){return new pe({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...L.errToObj(e)})}url(e){return this._addCheck({kind:"url",...L.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...L.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...L.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...L.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...L.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...L.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...L.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...L.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...L.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...L.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...L.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...L.errToObj(e)})}datetime(e){return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===e?.precision?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...L.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===e?.precision?null:e?.precision,...L.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...L.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...L.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...L.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...L.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...L.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...L.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...L.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...L.errToObj(t)})}nonempty(e){return this.min(1,L.errToObj(e))}trim(){return new pe({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new pe({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new pe({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>"datetime"===e.kind)}get isDate(){return!!this._def.checks.find(e=>"date"===e.kind)}get isTime(){return!!this._def.checks.find(e=>"time"===e.kind)}get isDuration(){return!!this._def.checks.find(e=>"duration"===e.kind)}get isEmail(){return!!this._def.checks.find(e=>"email"===e.kind)}get isURL(){return!!this._def.checks.find(e=>"url"===e.kind)}get isEmoji(){return!!this._def.checks.find(e=>"emoji"===e.kind)}get isUUID(){return!!this._def.checks.find(e=>"uuid"===e.kind)}get isNANOID(){return!!this._def.checks.find(e=>"nanoid"===e.kind)}get isCUID(){return!!this._def.checks.find(e=>"cuid"===e.kind)}get isCUID2(){return!!this._def.checks.find(e=>"cuid2"===e.kind)}get isULID(){return!!this._def.checks.find(e=>"ulid"===e.kind)}get isIP(){return!!this._def.checks.find(e=>"ip"===e.kind)}get isCIDR(){return!!this._def.checks.find(e=>"cidr"===e.kind)}get isBase64(){return!!this._def.checks.find(e=>"base64"===e.kind)}get isBase64url(){return!!this._def.checks.find(e=>"base64url"===e.kind)}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function he(e,t){const a=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,n=a>r?a:r;return Number.parseInt(e.toFixed(n).replace(".",""))%Number.parseInt(t.toFixed(n).replace(".",""))/10**n}pe.create=e=>new pe({checks:[],typeName:rt.ZodString,coerce:e?.coerce??!1,...D(e)});class fe extends U{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){this._def.coerce&&(e.data=Number(e.data));if(this._getType(e)!==x.number){const t=this._getOrReturnCtx(e);return N(t,{code:w.invalid_type,expected:x.number,received:t.parsedType}),C}let t;const a=new A;for(const r of this._def.checks)if("int"===r.kind)v.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),N(t,{code:w.invalid_type,expected:"integer",received:"float",message:r.message}),a.dirty());else if("min"===r.kind){(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),N(t,{code:w.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),a.dirty())}else if("max"===r.kind){(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),N(t,{code:w.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),a.dirty())}else"multipleOf"===r.kind?0!==he(e.data,r.value)&&(t=this._getOrReturnCtx(e,t),N(t,{code:w.not_multiple_of,multipleOf:r.value,message:r.message}),a.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),N(t,{code:w.not_finite,message:r.message}),a.dirty()):v.assertNever(r);return{status:a.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,L.toString(t))}gt(e,t){return this.setLimit("min",e,!1,L.toString(t))}lte(e,t){return this.setLimit("max",e,!0,L.toString(t))}lt(e,t){return this.setLimit("max",e,!1,L.toString(t))}setLimit(e,t,a,r){return new fe({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:L.toString(r)}]})}_addCheck(e){return new fe({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:L.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:L.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:L.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:L.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:L.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:L.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:L.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:L.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:L.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>"int"===e.kind||"multipleOf"===e.kind&&v.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const a of this._def.checks){if("finite"===a.kind||"int"===a.kind||"multipleOf"===a.kind)return!0;"min"===a.kind?(null===t||a.value>t)&&(t=a.value):"max"===a.kind&&(null===e||a.value<e)&&(e=a.value)}return Number.isFinite(t)&&Number.isFinite(e)}}fe.create=e=>new fe({checks:[],typeName:rt.ZodNumber,coerce:e?.coerce||!1,...D(e)});class me extends U{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)!==x.bigint)return this._getInvalidInput(e);let t;const a=new A;for(const r of this._def.checks)if("min"===r.kind){(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),N(t,{code:w.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),a.dirty())}else if("max"===r.kind){(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),N(t,{code:w.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),a.dirty())}else"multipleOf"===r.kind?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),N(t,{code:w.not_multiple_of,multipleOf:r.value,message:r.message}),a.dirty()):v.assertNever(r);return{status:a.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return N(t,{code:w.invalid_type,expected:x.bigint,received:t.parsedType}),C}gte(e,t){return this.setLimit("min",e,!0,L.toString(t))}gt(e,t){return this.setLimit("min",e,!1,L.toString(t))}lte(e,t){return this.setLimit("max",e,!0,L.toString(t))}lt(e,t){return this.setLimit("max",e,!1,L.toString(t))}setLimit(e,t,a,r){return new me({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:L.toString(r)}]})}_addCheck(e){return new me({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:L.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:L.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:L.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:L.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:L.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}me.create=e=>new me({checks:[],typeName:rt.ZodBigInt,coerce:e?.coerce??!1,...D(e)});class ye extends U{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==x.boolean){const t=this._getOrReturnCtx(e);return N(t,{code:w.invalid_type,expected:x.boolean,received:t.parsedType}),C}return R(e.data)}}ye.create=e=>new ye({typeName:rt.ZodBoolean,coerce:e?.coerce||!1,...D(e)});class ve extends U{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==x.date){const t=this._getOrReturnCtx(e);return N(t,{code:w.invalid_type,expected:x.date,received:t.parsedType}),C}if(Number.isNaN(e.data.getTime())){return N(this._getOrReturnCtx(e),{code:w.invalid_date}),C}const t=new A;let a;for(const r of this._def.checks)"min"===r.kind?e.data.getTime()<r.value&&(a=this._getOrReturnCtx(e,a),N(a,{code:w.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),t.dirty()):"max"===r.kind?e.data.getTime()>r.value&&(a=this._getOrReturnCtx(e,a),N(a,{code:w.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):v.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new ve({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:L.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:L.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}ve.create=e=>new ve({checks:[],coerce:e?.coerce||!1,typeName:rt.ZodDate,...D(e)});class ge extends U{_parse(e){if(this._getType(e)!==x.symbol){const t=this._getOrReturnCtx(e);return N(t,{code:w.invalid_type,expected:x.symbol,received:t.parsedType}),C}return R(e.data)}}ge.create=e=>new ge({typeName:rt.ZodSymbol,...D(e)});class _e extends U{_parse(e){if(this._getType(e)!==x.undefined){const t=this._getOrReturnCtx(e);return N(t,{code:w.invalid_type,expected:x.undefined,received:t.parsedType}),C}return R(e.data)}}_e.create=e=>new _e({typeName:rt.ZodUndefined,...D(e)});class be extends U{_parse(e){if(this._getType(e)!==x.null){const t=this._getOrReturnCtx(e);return N(t,{code:w.invalid_type,expected:x.null,received:t.parsedType}),C}return R(e.data)}}be.create=e=>new be({typeName:rt.ZodNull,...D(e)});class xe extends U{constructor(){super(...arguments),this._any=!0}_parse(e){return R(e.data)}}xe.create=e=>new xe({typeName:rt.ZodAny,...D(e)});class ke extends U{constructor(){super(...arguments),this._unknown=!0}_parse(e){return R(e.data)}}ke.create=e=>new ke({typeName:rt.ZodUnknown,...D(e)});class we extends U{_parse(e){const t=this._getOrReturnCtx(e);return N(t,{code:w.invalid_type,expected:x.never,received:t.parsedType}),C}}we.create=e=>new we({typeName:rt.ZodNever,...D(e)});class Se extends U{_parse(e){if(this._getType(e)!==x.undefined){const t=this._getOrReturnCtx(e);return N(t,{code:w.invalid_type,expected:x.void,received:t.parsedType}),C}return R(e.data)}}Se.create=e=>new Se({typeName:rt.ZodVoid,...D(e)});class Oe extends U{_parse(e){const{ctx:t,status:a}=this._processInputParams(e),r=this._def;if(t.parsedType!==x.array)return N(t,{code:w.invalid_type,expected:x.array,received:t.parsedType}),C;if(null!==r.exactLength){const e=t.data.length>r.exactLength.value,n=t.data.length<r.exactLength.value;(e||n)&&(N(t,{code:e?w.too_big:w.too_small,minimum:n?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),a.dirty())}if(null!==r.minLength&&t.data.length<r.minLength.value&&(N(t,{code:w.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),a.dirty()),null!==r.maxLength&&t.data.length>r.maxLength.value&&(N(t,{code:w.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),a.dirty()),t.common.async)return Promise.all([...t.data].map((e,a)=>r.type._parseAsync(new z(t,e,t.path,a)))).then(e=>A.mergeArray(a,e));const n=[...t.data].map((e,a)=>r.type._parseSync(new z(t,e,t.path,a)));return A.mergeArray(a,n)}get element(){return this._def.type}min(e,t){return new Oe({...this._def,minLength:{value:e,message:L.toString(t)}})}max(e,t){return new Oe({...this._def,maxLength:{value:e,message:L.toString(t)}})}length(e,t){return new Oe({...this._def,exactLength:{value:e,message:L.toString(t)}})}nonempty(e){return this.min(1,e)}}function Te(e){if(e instanceof je){const t={};for(const a in e.shape){const r=e.shape[a];t[a]=Be.create(Te(r))}return new je({...e._def,shape:()=>t})}return e instanceof Oe?new Oe({...e._def,type:Te(e.element)}):e instanceof Be?Be.create(Te(e.unwrap())):e instanceof qe?qe.create(Te(e.unwrap())):e instanceof Re?Re.create(e.items.map(e=>Te(e))):e}Oe.create=(e,t)=>new Oe({type:e,minLength:null,maxLength:null,exactLength:null,typeName:rt.ZodArray,...D(t)});class je extends U{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=v.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==x.object){const t=this._getOrReturnCtx(e);return N(t,{code:w.invalid_type,expected:x.object,received:t.parsedType}),C}const{status:t,ctx:a}=this._processInputParams(e),{shape:r,keys:n}=this._getCached(),s=[];if(!(this._def.catchall instanceof we&&"strip"===this._def.unknownKeys))for(const e in a.data)n.includes(e)||s.push(e);const i=[];for(const e of n){const t=r[e],n=a.data[e];i.push({key:{status:"valid",value:e},value:t._parse(new z(a,n,a.path,e)),alwaysSet:e in a.data})}if(this._def.catchall instanceof we){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of s)i.push({key:{status:"valid",value:e},value:{status:"valid",value:a.data[e]}});else if("strict"===e)s.length>0&&(N(a,{code:w.unrecognized_keys,keys:s}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of s){const r=a.data[t];i.push({key:{status:"valid",value:t},value:e._parse(new z(a,r,a.path,t)),alwaysSet:t in a.data})}}return a.common.async?Promise.resolve().then(async()=>{const e=[];for(const t of i){const a=await t.key,r=await t.value;e.push({key:a,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>A.mergeObjectSync(t,e)):A.mergeObjectSync(t,i)}get shape(){return this._def.shape()}strict(e){return L.errToObj,new je({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,a)=>{const r=this._def.errorMap?.(t,a).message??a.defaultError;return"unrecognized_keys"===t.code?{message:L.errToObj(e).message??r}:{message:r}}}:{}})}strip(){return new je({...this._def,unknownKeys:"strip"})}passthrough(){return new je({...this._def,unknownKeys:"passthrough"})}extend(e){return new je({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new je({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:rt.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new je({...this._def,catchall:e})}pick(e){const t={};for(const a of v.objectKeys(e))e[a]&&this.shape[a]&&(t[a]=this.shape[a]);return new je({...this._def,shape:()=>t})}omit(e){const t={};for(const a of v.objectKeys(this.shape))e[a]||(t[a]=this.shape[a]);return new je({...this._def,shape:()=>t})}deepPartial(){return Te(this)}partial(e){const t={};for(const a of v.objectKeys(this.shape)){const r=this.shape[a];e&&!e[a]?t[a]=r:t[a]=r.optional()}return new je({...this._def,shape:()=>t})}required(e){const t={};for(const a of v.objectKeys(this.shape))if(e&&!e[a])t[a]=this.shape[a];else{let e=this.shape[a];for(;e instanceof Be;)e=e._def.innerType;t[a]=e}return new je({...this._def,shape:()=>t})}keyof(){return Me(v.objectKeys(this.shape))}}je.create=(e,t)=>new je({shape:()=>e,unknownKeys:"strip",catchall:we.create(),typeName:rt.ZodObject,...D(t)}),je.strictCreate=(e,t)=>new je({shape:()=>e,unknownKeys:"strict",catchall:we.create(),typeName:rt.ZodObject,...D(t)}),je.lazycreate=(e,t)=>new je({shape:e,unknownKeys:"strip",catchall:we.create(),typeName:rt.ZodObject,...D(t)});class Ze extends U{_parse(e){const{ctx:t}=this._processInputParams(e),a=this._def.options;if(t.common.async)return Promise.all(a.map(async e=>{const a={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:a}),ctx:a}})).then(function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const a of e)if("dirty"===a.result.status)return t.common.issues.push(...a.ctx.common.issues),a.result;const a=e.map(e=>new S(e.ctx.common.issues));return N(t,{code:w.invalid_union,unionErrors:a}),C});{let e;const r=[];for(const n of a){const a={...t,common:{...t.common,issues:[]},parent:null},s=n._parseSync({data:t.data,path:t.path,parent:a});if("valid"===s.status)return s;"dirty"!==s.status||e||(e={result:s,ctx:a}),a.common.issues.length&&r.push(a.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const n=r.map(e=>new S(e));return N(t,{code:w.invalid_union,unionErrors:n}),C}}get options(){return this._def.options}}Ze.create=(e,t)=>new Ze({options:e,typeName:rt.ZodUnion,...D(t)});const Ne=e=>e instanceof Le?Ne(e.schema):e instanceof Ke?Ne(e.innerType()):e instanceof ze?[e.value]:e instanceof De?e.options:e instanceof Ue?v.objectValues(e.enum):e instanceof We?Ne(e._def.innerType):e instanceof _e?[void 0]:e instanceof be?[null]:e instanceof Be?[void 0,...Ne(e.unwrap())]:e instanceof qe?[null,...Ne(e.unwrap())]:e instanceof Xe||e instanceof Qe?Ne(e.unwrap()):e instanceof Je?Ne(e._def.innerType):[];class Ae extends U{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==x.object)return N(t,{code:w.invalid_type,expected:x.object,received:t.parsedType}),C;const a=this.discriminator,r=t.data[a],n=this.optionsMap.get(r);return n?t.common.async?n._parseAsync({data:t.data,path:t.path,parent:t}):n._parseSync({data:t.data,path:t.path,parent:t}):(N(t,{code:w.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[a]}),C)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,a){const r=new Map;for(const a of t){const t=Ne(a.shape[e]);if(!t.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const n of t){if(r.has(n))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(n)}`);r.set(n,a)}}return new Ae({typeName:rt.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...D(a)})}}function Ce(e,t){const a=k(e),r=k(t);if(e===t)return{valid:!0,data:e};if(a===x.object&&r===x.object){const a=v.objectKeys(t),r=v.objectKeys(e).filter(e=>-1!==a.indexOf(e)),n={...e,...t};for(const a of r){const r=Ce(e[a],t[a]);if(!r.valid)return{valid:!1};n[a]=r.data}return{valid:!0,data:n}}if(a===x.array&&r===x.array){if(e.length!==t.length)return{valid:!1};const a=[];for(let r=0;r<e.length;r++){const n=Ce(e[r],t[r]);if(!n.valid)return{valid:!1};a.push(n.data)}return{valid:!0,data:a}}return a===x.date&&r===x.date&&+e===+t?{valid:!0,data:e}:{valid:!1}}class Ee extends U{_parse(e){const{status:t,ctx:a}=this._processInputParams(e),r=(e,r)=>{if(I(e)||I(r))return C;const n=Ce(e.value,r.value);return n.valid?((P(e)||P(r))&&t.dirty(),{status:t.value,value:n.data}):(N(a,{code:w.invalid_intersection_types}),C)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then(([e,t])=>r(e,t)):r(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}}Ee.create=(e,t,a)=>new Ee({left:e,right:t,typeName:rt.ZodIntersection,...D(a)});class Re extends U{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==x.array)return N(a,{code:w.invalid_type,expected:x.array,received:a.parsedType}),C;if(a.data.length<this._def.items.length)return N(a,{code:w.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),C;!this._def.rest&&a.data.length>this._def.items.length&&(N(a,{code:w.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const r=[...a.data].map((e,t)=>{const r=this._def.items[t]||this._def.rest;return r?r._parse(new z(a,e,a.path,t)):null}).filter(e=>!!e);return a.common.async?Promise.all(r).then(e=>A.mergeArray(t,e)):A.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new Re({...this._def,rest:e})}}Re.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Re({items:e,typeName:rt.ZodTuple,rest:null,...D(t)})};class Ie extends U{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==x.object)return N(a,{code:w.invalid_type,expected:x.object,received:a.parsedType}),C;const r=[],n=this._def.keyType,s=this._def.valueType;for(const e in a.data)r.push({key:n._parse(new z(a,e,a.path,e)),value:s._parse(new z(a,a.data[e],a.path,e)),alwaysSet:e in a.data});return a.common.async?A.mergeObjectAsync(t,r):A.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,a){return new Ie(t instanceof U?{keyType:e,valueType:t,typeName:rt.ZodRecord,...D(a)}:{keyType:pe.create(),valueType:e,typeName:rt.ZodRecord,...D(t)})}}class Pe extends U{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==x.map)return N(a,{code:w.invalid_type,expected:x.map,received:a.parsedType}),C;const r=this._def.keyType,n=this._def.valueType,s=[...a.data.entries()].map(([e,t],s)=>({key:r._parse(new z(a,e,a.path,[s,"key"])),value:n._parse(new z(a,t,a.path,[s,"value"]))}));if(a.common.async){const e=new Map;return Promise.resolve().then(async()=>{for(const a of s){const r=await a.key,n=await a.value;if("aborted"===r.status||"aborted"===n.status)return C;"dirty"!==r.status&&"dirty"!==n.status||t.dirty(),e.set(r.value,n.value)}return{status:t.value,value:e}})}{const e=new Map;for(const a of s){const r=a.key,n=a.value;if("aborted"===r.status||"aborted"===n.status)return C;"dirty"!==r.status&&"dirty"!==n.status||t.dirty(),e.set(r.value,n.value)}return{status:t.value,value:e}}}}Pe.create=(e,t,a)=>new Pe({valueType:t,keyType:e,typeName:rt.ZodMap,...D(a)});class Fe extends U{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.parsedType!==x.set)return N(a,{code:w.invalid_type,expected:x.set,received:a.parsedType}),C;const r=this._def;null!==r.minSize&&a.data.size<r.minSize.value&&(N(a,{code:w.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),null!==r.maxSize&&a.data.size>r.maxSize.value&&(N(a,{code:w.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());const n=this._def.valueType;function s(e){const a=new Set;for(const r of e){if("aborted"===r.status)return C;"dirty"===r.status&&t.dirty(),a.add(r.value)}return{status:t.value,value:a}}const i=[...a.data.values()].map((e,t)=>n._parse(new z(a,e,a.path,t)));return a.common.async?Promise.all(i).then(e=>s(e)):s(i)}min(e,t){return new Fe({...this._def,minSize:{value:e,message:L.toString(t)}})}max(e,t){return new Fe({...this._def,maxSize:{value:e,message:L.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}Fe.create=(e,t)=>new Fe({valueType:e,minSize:null,maxSize:null,typeName:rt.ZodSet,...D(t)});class $e extends U{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==x.function)return N(t,{code:w.invalid_type,expected:x.function,received:t.parsedType}),C;function a(e,a){return Z({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,j(),O].filter(e=>!!e),issueData:{code:w.invalid_arguments,argumentsError:a}})}function r(e,a){return Z({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,j(),O].filter(e=>!!e),issueData:{code:w.invalid_return_type,returnTypeError:a}})}const n={errorMap:t.common.contextualErrorMap},s=t.data;if(this._def.returns instanceof Ve){const e=this;return R(async function(...t){const i=new S([]),o=await e._def.args.parseAsync(t,n).catch(e=>{throw i.addIssue(a(t,e)),i}),d=await Reflect.apply(s,this,o);return await e._def.returns._def.type.parseAsync(d,n).catch(e=>{throw i.addIssue(r(d,e)),i})})}{const e=this;return R(function(...t){const i=e._def.args.safeParse(t,n);if(!i.success)throw new S([a(t,i.error)]);const o=Reflect.apply(s,this,i.data),d=e._def.returns.safeParse(o,n);if(!d.success)throw new S([r(o,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new $e({...this._def,args:Re.create(e).rest(ke.create())})}returns(e){return new $e({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,a){return new $e({args:e||Re.create([]).rest(ke.create()),returns:t||ke.create(),typeName:rt.ZodFunction,...D(a)})}}class Le extends U{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}Le.create=(e,t)=>new Le({getter:e,typeName:rt.ZodLazy,...D(t)});class ze extends U{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return N(t,{received:t.data,code:w.invalid_literal,expected:this._def.value}),C}return{status:"valid",value:e.data}}get value(){return this._def.value}}function Me(e,t){return new De({values:e,typeName:rt.ZodEnum,...D(t)})}ze.create=(e,t)=>new ze({value:e,typeName:rt.ZodLiteral,...D(t)});class De extends U{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),a=this._def.values;return N(t,{expected:v.joinValues(a),received:t.parsedType,code:w.invalid_type}),C}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),a=this._def.values;return N(t,{received:t.data,code:w.invalid_enum_value,options:a}),C}return R(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return De.create(e,{...this._def,...t})}exclude(e,t=this._def){return De.create(this.options.filter(t=>!e.includes(t)),{...this._def,...t})}}De.create=Me;class Ue extends U{_parse(e){const t=v.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(e);if(a.parsedType!==x.string&&a.parsedType!==x.number){const e=v.objectValues(t);return N(a,{expected:v.joinValues(e),received:a.parsedType,code:w.invalid_type}),C}if(this._cache||(this._cache=new Set(v.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const e=v.objectValues(t);return N(a,{received:a.data,code:w.invalid_enum_value,options:e}),C}return R(e.data)}get enum(){return this._def.values}}Ue.create=(e,t)=>new Ue({values:e,typeName:rt.ZodNativeEnum,...D(t)});class Ve extends U{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==x.promise&&!1===t.common.async)return N(t,{code:w.invalid_type,expected:x.promise,received:t.parsedType}),C;const a=t.parsedType===x.promise?t.data:Promise.resolve(t.data);return R(a.then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}}Ve.create=(e,t)=>new Ve({type:e,typeName:rt.ZodPromise,...D(t)});class Ke extends U{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===rt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:a}=this._processInputParams(e),r=this._def.effect||null,n={addIssue:e=>{N(a,e),e.fatal?t.abort():t.dirty()},get path(){return a.path}};if(n.addIssue=n.addIssue.bind(n),"preprocess"===r.type){const e=r.transform(a.data,n);if(a.common.async)return Promise.resolve(e).then(async e=>{if("aborted"===t.value)return C;const r=await this._def.schema._parseAsync({data:e,path:a.path,parent:a});return"aborted"===r.status?C:"dirty"===r.status||"dirty"===t.value?E(r.value):r});{if("aborted"===t.value)return C;const r=this._def.schema._parseSync({data:e,path:a.path,parent:a});return"aborted"===r.status?C:"dirty"===r.status||"dirty"===t.value?E(r.value):r}}if("refinement"===r.type){const e=e=>{const t=r.refinement(e,n);if(a.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===a.common.async){const r=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return"aborted"===r.status?C:("dirty"===r.status&&t.dirty(),e(r.value),{status:t.value,value:r.value})}return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(a=>"aborted"===a.status?C:("dirty"===a.status&&t.dirty(),e(a.value).then(()=>({status:t.value,value:a.value}))))}if("transform"===r.type){if(!1===a.common.async){const e=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!F(e))return C;const s=r.transform(e.value,n);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:s}}return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(e=>F(e)?Promise.resolve(r.transform(e.value,n)).then(e=>({status:t.value,value:e})):C)}v.assertNever(r)}}Ke.create=(e,t,a)=>new Ke({schema:e,typeName:rt.ZodEffects,effect:t,...D(a)}),Ke.createWithPreprocess=(e,t,a)=>new Ke({schema:t,effect:{type:"preprocess",transform:e},typeName:rt.ZodEffects,...D(a)});class Be extends U{_parse(e){return this._getType(e)===x.undefined?R(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Be.create=(e,t)=>new Be({innerType:e,typeName:rt.ZodOptional,...D(t)});class qe extends U{_parse(e){return this._getType(e)===x.null?R(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}qe.create=(e,t)=>new qe({innerType:e,typeName:rt.ZodNullable,...D(t)});class We extends U{_parse(e){const{ctx:t}=this._processInputParams(e);let a=t.data;return t.parsedType===x.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}We.create=(e,t)=>new We({innerType:e,typeName:rt.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...D(t)});class Je extends U{_parse(e){const{ctx:t}=this._processInputParams(e),a={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return $(r)?r.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new S(a.common.issues)},input:a.data})})):{status:"valid",value:"valid"===r.status?r.value:this._def.catchValue({get error(){return new S(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}}Je.create=(e,t)=>new Je({innerType:e,typeName:rt.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...D(t)});class He extends U{_parse(e){if(this._getType(e)!==x.nan){const t=this._getOrReturnCtx(e);return N(t,{code:w.invalid_type,expected:x.nan,received:t.parsedType}),C}return{status:"valid",value:e.data}}}He.create=e=>new He({typeName:rt.ZodNaN,...D(e)});const Ge=Symbol("zod_brand");class Xe extends U{_parse(e){const{ctx:t}=this._processInputParams(e),a=t.data;return this._def.type._parse({data:a,path:t.path,parent:t})}unwrap(){return this._def.type}}class Ye extends U{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.common.async){return(async()=>{const e=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return"aborted"===e.status?C:"dirty"===e.status?(t.dirty(),E(e.value)):this._def.out._parseAsync({data:e.value,path:a.path,parent:a})})()}{const e=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return"aborted"===e.status?C:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:a.path,parent:a})}}static create(e,t){return new Ye({in:e,out:t,typeName:rt.ZodPipeline})}}class Qe extends U{_parse(e){const t=this._def.innerType._parse(e),a=e=>(F(e)&&(e.value=Object.freeze(e.value)),e);return $(t)?t.then(e=>a(e)):a(t)}unwrap(){return this._def.innerType}}function et(e,t){const a="function"==typeof e?e(t):"string"==typeof e?{message:e}:e;return"string"==typeof a?{message:a}:a}function tt(e,t={},a){return e?xe.create().superRefine((r,n)=>{const s=e(r);if(s instanceof Promise)return s.then(e=>{if(!e){const e=et(t,r),s=e.fatal??a??!0;n.addIssue({code:"custom",...e,fatal:s})}});if(!s){const e=et(t,r),s=e.fatal??a??!0;n.addIssue({code:"custom",...e,fatal:s})}}):xe.create()}Qe.create=(e,t)=>new Qe({innerType:e,typeName:rt.ZodReadonly,...D(t)});const at={object:je.lazycreate};var rt;!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"}(rt||(rt={}));const nt=pe.create,st=fe.create,it=He.create,ot=me.create,dt=ye.create,ct=ve.create,ut=ge.create,lt=_e.create,pt=be.create,ht=xe.create,ft=ke.create,mt=we.create,yt=Se.create,vt=Oe.create,gt=je.create,_t=je.strictCreate,bt=Ze.create,xt=Ae.create,kt=Ee.create,wt=Re.create,St=Ie.create,Ot=Pe.create,Tt=Fe.create,jt=$e.create,Zt=Le.create,Nt=ze.create,At=De.create,Ct=Ue.create,Et=Ve.create,Rt=Ke.create,It=Be.create,Pt=qe.create,Ft=Ke.createWithPreprocess,$t=Ye.create,Lt={string:e=>pe.create({...e,coerce:!0}),number:e=>fe.create({...e,coerce:!0}),boolean:e=>ye.create({...e,coerce:!0}),bigint:e=>me.create({...e,coerce:!0}),date:e=>ve.create({...e,coerce:!0})},zt=C;var Mt=Object.freeze({__proto__:null,BRAND:Ge,DIRTY:E,EMPTY_PATH:[],INVALID:C,NEVER:zt,OK:R,ParseStatus:A,Schema:U,ZodAny:xe,ZodArray:Oe,ZodBigInt:me,ZodBoolean:ye,ZodBranded:Xe,ZodCatch:Je,ZodDate:ve,ZodDefault:We,ZodDiscriminatedUnion:Ae,ZodEffects:Ke,ZodEnum:De,ZodError:S,get ZodFirstPartyTypeKind(){return rt},ZodFunction:$e,ZodIntersection:Ee,ZodIssueCode:w,ZodLazy:Le,ZodLiteral:ze,ZodMap:Pe,ZodNaN:He,ZodNativeEnum:Ue,ZodNever:we,ZodNull:be,ZodNullable:qe,ZodNumber:fe,ZodObject:je,ZodOptional:Be,ZodParsedType:x,ZodPipeline:Ye,ZodPromise:Ve,ZodReadonly:Qe,ZodRecord:Ie,ZodSchema:U,ZodSet:Fe,ZodString:pe,ZodSymbol:ge,ZodTransformer:Ke,ZodTuple:Re,ZodType:U,ZodUndefined:_e,ZodUnion:Ze,ZodUnknown:ke,ZodVoid:Se,addIssueToContext:N,any:ht,array:vt,bigint:ot,boolean:dt,coerce:Lt,custom:tt,date:ct,datetimeRegex:de,defaultErrorMap:O,discriminatedUnion:xt,effect:Rt,enum:At,function:jt,getErrorMap:j,getParsedType:k,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>tt(t=>t instanceof e,t),intersection:kt,isAborted:I,isAsync:$,isDirty:P,isValid:F,late:at,lazy:Zt,literal:Nt,makeIssue:Z,map:Ot,nan:it,nativeEnum:Ct,never:mt,null:pt,nullable:Pt,number:st,object:gt,get objectUtil(){return g},oboolean:()=>dt().optional(),onumber:()=>st().optional(),optional:It,ostring:()=>nt().optional(),pipeline:$t,preprocess:Ft,promise:Et,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),record:St,set:Tt,setErrorMap:function(e){T=e},strictObject:_t,string:nt,symbol:ut,transformer:Rt,tuple:wt,undefined:lt,union:bt,unknown:ft,get util(){return v},void:yt}),Dt={isLoading:!1,error:"",data:null},Ut=function(e,t){switch(t.type){case"CALL":return h(h({},e),{isLoading:!0,error:""});case"ERROR":return h(h({},e),{isLoading:!1,error:t.payload});case"SUCCESS":return h(h({},e),{isLoading:!1,data:t.payload});default:return e}},Vt={isLoading:!1,error:"",data:null},Kt=function(e,t){switch(t.type){case"CALL":return h(h({},e),{isLoading:!0,error:""});case"ERROR":return h(h({},e),{isLoading:!1,error:t.payload});case"SUCCESS":return h(h({},e),{isLoading:!1,data:t.payload});default:return e}};exports.FormContext=b,exports.N8xForm=function(e){var a=e.fields,r=e.defaultFieldStyles,n=e.onShubmit,s=e.mode,i=void 0===s?"onChange":s,o=e.children,d=t.useContext(b),c=d.setMode,u=d.formUtils,l=d.setValidationSchema,h=u.register,f=u.handleSubmit,m=u.formState,y=m.errors,v=m.isSubmitting,g=Object.keys(a),x=!Array.isArray(a),k=r||exports.EDefaultFieldStyles.SOFT_GLASS,w=t.useMemo(function(){return x?g.flatMap(function(e){return a[e]}):a},[a,x,g]),S=t.useMemo(function(){var e=Object.fromEntries(w.filter(function(e){return!!e.validationScheme}).map(function(e){return[e.name,e.validationScheme]}));return Mt.object(e)},[w]);return t.useEffect(function(){l(S),c(i||"onChange")},[S,i]),t.useEffect(function(){u.reset()},[a,u]),p.jsx("div",{className:"w-full py-4",children:p.jsxs("form",{className:"grid grid-cols-4 gap-4",onSubmit:f(n),children:[x?g.map(function(e,t){return p.jsxs("div",{className:" grid grid-cols-4 gap-4 col-span-4",children:[p.jsx("h1",{className:"col-span-4 border-b border-zinc-200 py-2 text-xl",children:e}),a[e].map(function(e){return _(e,k,h,y,v)})]},t)}):a.map(function(e){return _(e,k,h,y,v)}),o]})})},exports.useN8xFormQuery=function(e){var r=t.useReducer(Ut,Dt),n=r[0],s=r[1];return h(h({},n),{execute:function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return f(void 0,void 0,void 0,function(){var r,n,i,o,d,c,u,l,p,h;return m(this,function(f){switch(f.label){case 0:r=new AbortController,s({type:"CALL"}),f.label=1;case 1:return f.trys.push([1,3,,4]),[4,e.apply(void 0,y(y([],t,!1),[{signal:r.signal}],!1))];case 2:return n=f.sent(),s({type:"SUCCESS",payload:n.data}),[3,4];case 3:return i=f.sent(),o="",a.isAxiosError(i)?o=Array.isArray(null===(d=i.response)||void 0===d?void 0:d.data.message)?null===(l=null===(u=null===(c=i.response)||void 0===c?void 0:c.data)||void 0===u?void 0:u.message)||void 0===l?void 0:l[0]:(null===(h=null===(p=i.response)||void 0===p?void 0:p.data)||void 0===h?void 0:h.message)||i.message:i instanceof Error&&(o=i.message),a.isCancel(i)?(s({type:"ERROR",payload:"Request Canceled"}),[2]):(i instanceof Error&&s({type:"ERROR",payload:o}),[3,4]);case 4:return[2,function(){return r.abort()}]}})})}})},exports.useN8xQuery=function(e){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];var s=t.useReducer(Kt,Vt),i=s[0],o=s[1];return t.useEffect(function(){var t=new AbortController;return o({type:"CALL"}),f(void 0,void 0,void 0,function(){var n,s,i,d,c,u,l,p,h;return m(this,function(f){switch(f.label){case 0:return f.trys.push([0,2,,3]),[4,e.apply(void 0,y(y([],r,!1),[{signal:t.signal}],!1))];case 1:return n=f.sent(),o({type:"SUCCESS",payload:n.data}),[3,3];case 2:return s=f.sent(),i="",a.isAxiosError(s)?i=Array.isArray(null===(d=s.response)||void 0===d?void 0:d.data.message)?null===(l=null===(u=null===(c=s.response)||void 0===c?void 0:c.data)||void 0===u?void 0:u.message)||void 0===l?void 0:l[0]:(null===(h=null===(p=s.response)||void 0===p?void 0:p.data)||void 0===h?void 0:h.message)||s.message:s instanceof Error&&(i=s.message),a.isCancel(s)?(o({type:"ERROR",payload:"Request Canceled"}),[2]):(s instanceof Error&&o({type:"ERROR",payload:i}),[3,3]);case 3:return[2]}})}),function(){return t.abort()}},[]),h({},i)},exports.z=Mt;
11
11
  //# sourceMappingURL=index.js.map