PageSourceSearch

https://myechoboard.com/assets/Auth-BkRzGtav.js

js myechoboard.com collected 2026-09-24 13:48:23 UTC 68,907 bytes, 1 lines download raw bytes

1import{r as e,j as t}from"./vendor-react-C9yDzYQD.js";import{supabase as s}from"./supabase-client-_h80EYw_.js";import{B as a}from"./button-CcIRk75H.js";import{I as r}from"./input-CJADGzyX.js";import{u as i,a as n}from"./useAuth-Dz3EPsxs.js";import{C as o,B as d}from"./vendor-capacitor-8exTJy5k.js";import{S as c}from"./SEOHead-DUUd-RUG.js";import{f as u,b as l,c as h}from"./fullApp-Ij3xCJOB.js";import{v as m,p,F as f}from"./useUserSettings-COPNty3J.js";import{A as v}from"./AnimatedLogo-BHNlQQ7J.js";import g from"./NativeAuthBootstrap-B9Wd4wdC.js";import{r as y}from"./authEmailCode-DGb-Vfkf.js";import{u as _}from"./vendor-router-X7RJKav4.js";import{U as x}from"./user-DrHqDh0A.js";import{M as w}from"./mail-BW3XjlGt.js";import{L as b}from"./lock-Dh-2FzOx.js";import{K as k}from"./key-round-xXFdwuBw.js";import{L as j}from"./loader-circle-CWK_zhHB.js";import{A as N}from"./arrow-right-Cz_6W8wx.js";var C,S,Z;(S=C||(C={})).assertEqual=e=>{},S.assertIs=function(e){},S.assertNever=function(e){throw new Error},S.arrayToEnum=e=>{const t={};for(const s of e)t[s]=s;return t},S.getValidEnumValues=e=>{const t=S.objectKeys(e).filter(t=>"number"!=typeof e[e[t]]),s={};for(const a of t)s[a]=e[a];return S.objectValues(s)},S.objectValues=e=>S.objectKeys(e).map(function(t){return e[t]}),S.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.push(s);return t},S.find=(e,t)=>{for(const s of e)if(t(s))return s},S.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,S.joinValues=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},S.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t,(Z||(Z={})).mergeShapes=(e,t)=>({...e,...t});const O=C.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),T=e=>{switch(typeof e){case"undefined":return O.undefined;case"string":return O.string;case"number":return Number.isNaN(e)?O.nan:O.number;case"boolean":return O.boolean;case"function":return O.function;case"bigint":return O.bigint;case"symbol":return O.symbol;case"object":return Array.isArray(e)?O.array:null===e?O.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?O.promise:"undefined"!=typeof Map&&e instanceof Map?O.map:"undefined"!=typeof Set&&e instanceof Set?O.set:"undefined"!=typeof Date&&e instanceof Date?O.date:O.object;default:return O.unknown}}
vendor: 4,213 bytes, line 1
1,A=C.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 E extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};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},s={_errors:[]},a=e=>{for(const r of e.issues)if("invalid_union"===r.code)r.unionErrors.map(a);else if("invalid_return_type"===r.code)a(r.returnTypeError);else if("invalid_arguments"===r.code)a(r.argumentsError);else if(0===r.path.length)s._errors.push(t(r));else{let e=s,a=0;for(;a<r.path.length;){const s=r.path[a];a===r.path.length-1?(e[s]=e[s]||{_errors:[]},e[s]._errors.push(t(r))):e[s]=e[s]||{_errors:[]},e=e[s],a++}}};return a(this),s}static assert(e){if(!(e instanceof E))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,C.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},s=[];for(const a of this.issues)if(a.path.length>0){const s=a.path[0];t[s]=t[s]||[],t[s].push(e(a))}else s.push(e(a));return{formErrors:s,fieldErrors:t}}get formErrors(){return this.flatten()}}E.create=e=>new E(e);const P=(e,t)=>{let s;switch(e.code){case A.invalid_type:s=e.received===O.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case A.invalid_literal:s=`Invalid literal value, expected ${JSON.stringify(e.expected,C.jsonStringifyReplacer)}`;break;case A.unrecognized_keys:s=`Unrecognized key(s) in object: ${C.joinValues(e.keys,", ")}`;break;case A.invalid_union:s="Invalid input";break;case A.invalid_union_discriminator:s=`Invalid discriminator value. Expected ${C.joinValues(e.options)}`;break;case A.invalid_enum_value:s=`Invalid enum value. Expected ${C.joinValues(e.options)}, received '${e.received}'`;break;case A.invalid_arguments:s="Invalid function arguments";break;case A.invalid_return_type:s="Invalid function return type";break;case A.invalid_date:s="Invalid date";break;case A.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(s=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(s=`${s} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?s=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?s=`Invalid input: must end with "${e.validation.endsWith}"`:C.assertNever(e.validation):s="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case A.too_small:s="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 A.too_big:s="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 A.custom:s="Invalid input";break;
1case A.invalid_intersection_types:s="Intersection results could not be merged";break;case A.not_multiple_of:s=`Number must be a multiple of ${e.multipleOf}`;break;case A.not_finite:s="Number must be finite";break;default:s=t.defaultError,C.assertNever(e)}return{message:s}};let I=P;function R(e,t){const s=I,a=(e=>{const{data:t,path:s,errorMaps:a,issueData:r}=e,i=[...s,...r.path||[]],n={...r,path:i};if(void 0!==r.message)return{...r,path:i,message:r.message};let o="";const d=a.filter(e=>!!e).slice().reverse();for(const c of d)o=c(n,{data:t,defaultError:o}).message;return{...r,path:i,message:o}})({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,s,s===P?void 0:P].filter(e=>!!e)});e.common.issues.push(a)}class ${constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const s=[];for(const a of t){if("aborted"===a.status)return F;"dirty"===a.status&&e.dirty(),s.push(a.value)}return{status:e.value,value:s}}static async mergeObjectAsync(e,t){const s=[];for(const a of t){const e=await a.key,t=await a.value;s.push({key:e,value:t})}return $.mergeObjectSync(e,s)}static mergeObjectSync(e,t){const s={};for(const a of t){const{key:t,value:r}=a;if("aborted"===t.status)return F;if("aborted"===r.status)return F;"dirty"===t.status&&e.dirty(),"dirty"===r.status&&e.dirty(),"__proto__"===t.value||void 0===r.value&&!a.alwaysSet||(s[t.value]=r.value)}return{status:e.value,value:s}}}const F=Object.freeze({status:"aborted"}),L=e=>({status:"dirty",value:e}),M=e=>({status:"valid",value:e}),z=e=>"aborted"===e.status,D=e=>"dirty"===e.status,U=e=>"valid"===e.status,V=e=>"undefined"!=typeof Promise&&e instanceof Promise;var B,K;(K=B||(B={})).errToObj=e=>"string"==typeof e?{message:e}:e||{},K.toString=e=>"string"==typeof e?e:null==e?void 0:e.message;class W{constructor(e,t,s,a){this._cachedPath=[],this.parent=e,this.data=t,this._path=s,this._key=a}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const q=(e,t)=>{if(U(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 E(e.common.issues);return this._error=t,this._error}}};function H(e){if(!e)return{};const{errorMap:t,invalid_type_error:s,required_error:a,description:r}=e;if(t&&(s||a))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:r}:{errorMap:(t,r)=>{const{message:i}=e;return"invalid_enum_value"===t.code?{message:i??r.defaultError}:void 0===r.data?{message:i??a??r.defaultError}:"invalid_type"!==t.code?{message:r.defaultError}:{message:i??s??r.defaultError}},description:r}}class J{get description(){return this._def.description}_getType(e){return T(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:T(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new $,ctx:{common:e.parent.common,data:e.data,parsedType:T(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(V(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 s=this.safeParse(e,t);if(s.success)return s.data;throw s.error}safeParse(e,t){const s={common:{issues:[],async:(null==t?void 0:t.async)??!1,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:T(e)},a=this._parseSync({data:e,path:s.path,parent:s});return q(s,a)}"~validate"(e){var t,s;const a={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:T(e)};if(!this["~standard"].async)try{const t=this._parseSync({data:e,path:[],parent:a});return U(t)?{value:t.value}:{issues:a.common.issues}}catch(r){(null==(s=null==(t=null==r?void 0:r.message)?void 0:t.toLowerCase())?void 0:s.includes("encountered"))&&(this["~standard"].async=!0),a.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:a}).then(e=>U(e)?{value:e.value}:{issues:a.common.issues})}async parseAsync(e,t){const s=await this.safeParseAsync(e,t);if(s.success)return s.data;throw s.error}async safeParseAsync(e,t){const s={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:T(e)},a=this._parse({data:e,path:s.path,parent:s}),r=await(V(a)?a:Promise.resolve(a));return q(s,r)}refine(e,t){const s=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement((t,a)=>{const r=e(t),i=()=>a.addIssue({code:A.custom,...s(t)});return"undefined"!=typeof Promise&&r instanceof Promise?r.then(e=>!!e||(i(),!1)):!!r||(i(),!1)})}refinement(e,t){return this._refinement((s,a)=>!!e(s)||(a.addIssue("function"==typeof t?t(s,a):t),!1))}_refinement(e){return new qe({schema:this,typeName:st.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 He.create(this,this._def)}nullable(){return Je.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ee.create(this)}promise(){return We.create(this,this._def)}or(e){return Re.create([this,e],this._def)}and(e){return Fe.create(this,e,this._def)}transform(e){return new qe({...H(this._def),schema:this,typeName:st.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new Ye({...H(this._def),innerType:this,defaultValue:t,typeName:st.ZodDefault})}brand(){return new Qe({typeName:st.ZodBranded,type:this,...H(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new Ge({...H(this._def),innerType:this,catchValue:t,typeName:st.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return et.create(this,e)}readonly(){return tt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Y=/^c[^\s-]{8,}
vendor: 10,531 bytes, line 1
1$/i,G=/^[0-9a-z]+$/,X=/^[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,ee=/^[a-z0-9_-]{21}$/i,te=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,se=/^[-+]?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)?)??$/,ae=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let re;const ie=/^(?:(?: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])$/,ne=/^(?:(?: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])$/,oe=/^(([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]))$/,de=/^(([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])$/,ce=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,ue=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,le="((\\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])))",he=new RegExp(`^${le}$`);function me(e){let t="[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),`([01]\\d|2[0-3]):[0-5]\\d(:${t})${e.precision?"+":"?"}`}function pe(e){return new RegExp(`^${me(e)}$`)}function fe(e){let t=`${le}T${me(e)}`;const s=[];return s.push(e.local?"Z?":"Z"),e.offset&&s.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${s.join("|")})`,new RegExp(`^${t}$`)}function ve(e,t){return!("v4"!==t&&t||!ie.test(e))||!("v6"!==t&&t||!oe.test(e))}function ge(e,t){if(!te.test(e))return!1;try{const[s]=e.split(".");if(!s)return!1;const a=s.replace(/-/g,"+").replace(/_/g,"/").padEnd(s.length+(4-s.length%4)%4,"="),r=JSON.parse(atob(a));return!("object"!=typeof r||null===r||"typ"in r&&"JWT"!==(null==r?void 0:r.typ)||!r.alg||t&&r.alg!==t)}catch{return!1}}function ye(e,t){return!("v4"!==t&&t||!ne.test(e))||!("v6"!==t&&t||!de.test(e))}class _e extends J{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==O.string){const t=this._getOrReturnCtx(e);return R(t,{code:A.invalid_type,expected:O.string,received:t.parsedType}),F}const t=new $;let s;for(const a of this._def.checks)if("min"===a.kind)e.data.length<a.value&&(s=this._getOrReturnCtx(e,s),R(s,{code:A.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),t.dirty());else if("max"===a.kind)e.data.length>a.value&&(s=this._getOrReturnCtx(e,s),R(s,{code:A.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),t.dirty());else if("length"===a.kind){const r=e.data.length>a.value,i=e.data.length<a.value;(r||i)&&(s=this._getOrReturnCtx(e,s),r?R(s,{code:A.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):i&&R(s,{code:A.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),t.dirty())}else if("email"===a.kind)ae.test(e.data)||(s=this._getOrReturnCtx(e,s),R(s,{validation:"email",code:A.invalid_string,message:a.message}),t.dirty());else if("emoji"===a.kind)re||(re=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),re.test(e.data)||(s=this._getOrReturnCtx(e,s),R(s,{validation:"emoji",code:A.invalid_string,message:a.message}),t.dirty());else if("uuid"===a.kind)Q.test(e.data)||(s=this._getOrReturnCtx(e,s),R(s,{validation:"uuid",code:A.invalid_string,message:a.message}),t.dirty());else if("nanoid"===a.kind)ee.test(e.data)||(s=this._getOrReturnCtx(e,s),R(s,{validation:"nanoid",code:A.invalid_string,message:a.message}),t.dirty());else if("cuid"===a.kind)Y.test(e.data)||(s=this._getOrReturnCtx(e,s),R(s,{validation:"cuid",code:A.invalid_string,message:a.message}),t.dirty());else if("cuid2"===a.kind)G.test(e.data)||(s=this._getOrReturnCtx(e,s),R(s,{validation:"cuid2",code:A.invalid_string,message:a.message}),t.dirty());else if("ulid"===a.kind)X.test(e.data)||(s=this._getOrReturnCtx(e,s),R(s,{validation:"ulid",code:A.invalid_string,message:a.message}),t.dirty());else if("url"===a.kind)try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),R(s,{validation:"url",code:A.invalid_string,message:a.message}),t.dirty()}else"regex"===a.kind?(a.regex.lastIndex=0,a.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),R(s,{validation:"regex",code:A.invalid_string,message:a.message}),t.dirty())):"trim"===a.kind?e.data=e.data.trim():"includes"===a.kind?e.data.includes(a.value,a.position)||(s=this._getOrReturnCtx(e,s),R(s,{code:A.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),t.dirty()):"toLowerCase"===a.kind?e.data=e.data.toLowerCase():"toUpperCase"===a.kind?e.data=e.data.toUpperCase():"startsWith"===a.kind?e.data.startsWith(a.value)||(s=this._getOrReturnCtx(e,s),R(s,{code:A.invalid_string,validation:{startsWith:a.value},message:a.message}),t.dirty()):"endsWith"===a.kind?e.data.endsWith(a.value)||(s=this._getOrReturnCtx(e,s),R(s,{code:A.invalid_string,validation:{endsWith:a.value},message:a.message}),t.dirty()):"datetime"===a.kind?fe(a).test(e.data)||(s=this._getOrReturnCtx(e,s),R(s,{code:A.invalid_string,validation:"datetime",message:a.message}),t.dirty()):"date"===a.kind?he.test(e.data)||(s=this._getOrReturnCtx(e,s),R(s,{code:A.invalid_string,validation:"date",message:a.message}),t.dirty()):"time"===a.kind?pe(a).test(e.data)||(s=this._getOrReturnCtx(e,s),R(s,{code:A.invalid_string,validation:"time",message:a.message}),t.dirty()):"duration"===a.kind?se.test(e.data)||(s=this._getOrReturnCtx(e,s),R(s,{validation:"duration",code:A.invalid_string,message:a.message}),t.dirty()):"ip"===a.kind?ve(e.data,a.version)||(s=this._getOrReturnCtx(e,s),R(s,{validation:"ip",code:A.invalid_string,message:a.message}),t.dirty()):"jwt"===a.kind?ge(e.data,a.alg)||(s=this._getOrReturnCtx(e,s),R(s,{validation:"jwt",code:A.invalid_string,message:a.message}),t.dirty()):"cidr"===a.kind?ye(e.data,a.version)||(s=this._getOrReturnCtx(e,s),R(s,{validation:"cidr",code:A.invalid_string,message:a.message}),t.dirty()):"base64"===a.kind?ce.test(e.data)||(s=this._getOrReturnCtx(e,s),R(s,{validation:"base64",code:A.invalid_string,message:a.message}),t.dirty()):"base64url"===a.kind?ue.test(e.data)||(s=this._getOrReturnCtx(e,s),R(s,{validation:"base64url",code:A.invalid_string,message:a.message}),t.dirty()):C.assertNever(a);return{status:t.value,value:e.data}}_regex(e,t,s){return this.refinement(t=>e.test(t),{validation:t,code:A.invalid_string,...B.errToObj(s)})}_addCheck(e){return new _e({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...B.errToObj(e)})}url(e){return this._addCheck({kind:"url",...B.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...B.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...B.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...B.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...B.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...B.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...B.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...B.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...B.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...B.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...B.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...B.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===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:(null==e?void 0:e.offset)??!1,local:(null==e?void 0:e.local)??!1,...B.errToObj(null==e?void 0: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===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,...B.errToObj(null==e?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...B.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...B.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...B.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...B.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...B.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...B.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...B.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...B.errToObj(t)})}nonempty(e){return this.min(1,B.errToObj(e))}trim(){return new _e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new _e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new _e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>"datetime"===e.kind)}
1get 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 xe(e,t){const s=(e.toString().split(".")[1]||"").length,a=(t.toString().split(".")[1]||"").length,r=s>a?s:a;return Number.parseInt(e.toFixed(r).replace(".",""))%Number.parseInt(t.toFixed(r).replace(".",""))/10**r}_e.create=e=>new _e({checks:[],typeName:st.ZodString,coerce:(null==e?void 0:e.coerce)??!1,...H(e)});class we extends J{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==O.
vendor: 4,453 bytes, line 1
1number){const t=this._getOrReturnCtx(e);return R(t,{code:A.invalid_type,expected:O.number,received:t.parsedType}),F}let t;const s=new $;for(const a of this._def.checks)"int"===a.kind?C.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),R(t,{code:A.invalid_type,expected:"integer",received:"float",message:a.message}),s.dirty()):"min"===a.kind?(a.inclusive?e.data<a.value:e.data<=a.value)&&(t=this._getOrReturnCtx(e,t),R(t,{code:A.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):"max"===a.kind?(a.inclusive?e.data>a.value:e.data>=a.value)&&(t=this._getOrReturnCtx(e,t),R(t,{code:A.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),s.dirty()):"multipleOf"===a.kind?0!==xe(e.data,a.value)&&(t=this._getOrReturnCtx(e,t),R(t,{code:A.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):"finite"===a.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),R(t,{code:A.not_finite,message:a.message}),s.dirty()):C.assertNever(a);return{status:s.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,B.toString(t))}gt(e,t){return this.setLimit("min",e,!1,B.toString(t))}lte(e,t){return this.setLimit("max",e,!0,B.toString(t))}lt(e,t){return this.setLimit("max",e,!1,B.toString(t))}setLimit(e,t,s,a){return new we({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:B.toString(a)}]})}_addCheck(e){return new we({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:B.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:B.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:B.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:B.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:B.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:B.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:B.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:B.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:B.toString(e)})}get minValue(){let e=null;for(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&&C.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const s of this._def.checks){if("finite"===s.kind||"int"===s.kind||"multipleOf"===s.kind)return!0;"min"===s.kind?(null===t||s.value>t)&&(t=s.value):"max"===s.kind&&(null===e||s.value<e)&&(e=s.value)}return Number.isFinite(t)&&Number.isFinite(e)}}we.create=e=>new we({checks:[],typeName:st.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...H(e)});class be extends J{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)!==O.bigint)return this._getInvalidInput(e);let t;const s=new $;for(const a of this._def.checks)"min"===a.kind?(a.inclusive?e.data<a.value:e.data<=a.value)&&(t=this._getOrReturnCtx(e,t),R(t,{code:A.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):"max"===a.kind?(a.inclusive?e.data>a.value:e.data>=a.value)&&(t=this._getOrReturnCtx(e,t),R(t,{code:A.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),s.dirty()):"multipleOf"===a.kind?e.data%a.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),R(t,{code:A.not_multiple_of,multipleOf:a.value,message:a.message}),s.dirty()):C.assertNever(a);return{status:s.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return R(t,{code:A.invalid_type,expected:O.bigint,received:t.parsedType}),F}gte(e,t){return this.setLimit("min",e,!0,B.toString(t))}gt(e,t){return this.setLimit("min",e,!1,B.toString(t))}lte(e,t){return this.setLimit("max",e,!0,B.toString(t))}lt(e,t){return this.setLimit("max",e,!1,B.toString(t))}setLimit(e,t,s,a){return new be({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:s,message:B.toString(a)}]})}_addCheck(e){return new be({...this._def,checks:[...this._def.checks,e]})}
1positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:B.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:B.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:B.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:B.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:B.toString(t)})}get minValue(){let e=null;for(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}}be.create=e=>new be({checks:[],typeName:st.ZodBigInt,coerce:(null==e?void 0:e.coerce)??!1,...H(e)});class ke extends J{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==O.boolean){const t=this._getOrReturnCtx(e);return R(t,{code:A.invalid_type,expected:O.boolean,received:t.parsedType}),F}return M(e.data)}}ke.create=e=>new ke({typeName:st.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...H(e)});
vendor: 7,736 bytes, line 1
1class je extends J{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==O.date){const t=this._getOrReturnCtx(e);return R(t,{code:A.invalid_type,expected:O.date,received:t.parsedType}),F}if(Number.isNaN(e.data.getTime()))return R(this._getOrReturnCtx(e),{code:A.invalid_date}),F;const t=new $;let s;for(const a of this._def.checks)"min"===a.kind?e.data.getTime()<a.value&&(s=this._getOrReturnCtx(e,s),R(s,{code:A.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),t.dirty()):"max"===a.kind?e.data.getTime()>a.value&&(s=this._getOrReturnCtx(e,s),R(s,{code:A.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),t.dirty()):C.assertNever(a);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new je({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:B.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:B.toString(t)})}get minDate(){let e=null;for(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}}je.create=e=>new je({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:st.ZodDate,...H(e)});class Ne extends J{_parse(e){if(this._getType(e)!==O.symbol){const t=this._getOrReturnCtx(e);return R(t,{code:A.invalid_type,expected:O.symbol,received:t.parsedType}),F}return M(e.data)}}Ne.create=e=>new Ne({typeName:st.ZodSymbol,...H(e)});class Ce extends J{_parse(e){if(this._getType(e)!==O.undefined){const t=this._getOrReturnCtx(e);return R(t,{code:A.invalid_type,expected:O.undefined,received:t.parsedType}),F}return M(e.data)}}Ce.create=e=>new Ce({typeName:st.ZodUndefined,...H(e)});class Se extends J{_parse(e){if(this._getType(e)!==O.null){const t=this._getOrReturnCtx(e);return R(t,{code:A.invalid_type,expected:O.null,received:t.parsedType}),F}return M(e.data)}}Se.create=e=>new Se({typeName:st.ZodNull,...H(e)});class Ze extends J{constructor(){super(...arguments),this._any=!0}_parse(e){return M(e.data)}}Ze.create=e=>new Ze({typeName:st.ZodAny,...H(e)});class Oe extends J{constructor(){super(...arguments),this._unknown=!0}_parse(e){return M(e.data)}}Oe.create=e=>new Oe({typeName:st.ZodUnknown,...H(e)});class Te extends J{_parse(e){const t=this._getOrReturnCtx(e);return R(t,{code:A.invalid_type,expected:O.never,received:t.parsedType}),F}}Te.create=e=>new Te({typeName:st.ZodNever,...H(e)});class Ae extends J{_parse(e){if(this._getType(e)!==O.undefined){const t=this._getOrReturnCtx(e);return R(t,{code:A.invalid_type,expected:O.void,received:t.parsedType}),F}return M(e.data)}}Ae.create=e=>new Ae({typeName:st.ZodVoid,...H(e)});class Ee extends J{_parse(e){const{ctx:t,status:s}=this._processInputParams(e),a=this._def;if(t.parsedType!==O.array)return R(t,{code:A.invalid_type,expected:O.array,received:t.parsedType}),F;if(null!==a.exactLength){const e=t.data.length>a.exactLength.value,r=t.data.length<a.exactLength.value;(e||r)&&(R(t,{code:e?A.too_big:A.too_small,minimum:r?a.exactLength.value:void 0,maximum:e?a.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:a.exactLength.message}),s.dirty())}if(null!==a.minLength&&t.data.length<a.minLength.value&&(R(t,{code:A.too_small,minimum:a.minLength.value,type:"array",inclusive:!0,exact:!1,message:a.minLength.message}),s.dirty()),null!==a.maxLength&&t.data.length>a.maxLength.value&&(R(t,{code:A.too_big,maximum:a.maxLength.value,type:"array",inclusive:!0,exact:!1,message:a.maxLength.message}),s.dirty()),t.common.async)return Promise.all([...t.data].map((e,s)=>a.type._parseAsync(new W(t,e,t.path,s)))).then(e=>$.mergeArray(s,e));const r=[...t.data].map((e,s)=>a.type._parseSync(new W(t,e,t.path,s)));return $.mergeArray(s,r)}get element(){return this._def.type}min(e,t){return new Ee({...this._def,minLength:{value:e,message:B.toString(t)}})}max(e,t){return new Ee({...this._def,maxLength:{value:e,message:B.toString(t)}})}length(e,t){return new Ee({...this._def,exactLength:{value:e,message:B.toString(t)}})}nonempty(e){return this.min(1,e)}}function Pe(e){if(e instanceof Ie){const t={};for(const s in e.shape){const a=e.shape[s];t[s]=He.create(Pe(a))}return new Ie({...e._def,shape:()=>t})}return e instanceof Ee?new Ee({...e._def,type:Pe(e.element)}):e instanceof He?He.create(Pe(e.unwrap())):e instanceof Je?Je.create(Pe(e.unwrap())):e instanceof Le?Le.create(e.items.map(e=>Pe(e))):e}Ee.create=(e,t)=>new Ee({type:e,minLength:null,maxLength:null,exactLength:null,typeName:st.ZodArray,...H(t)});class Ie extends J{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=C.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==O.object){const t=this._getOrReturnCtx(e);return R(t,{code:A.invalid_type,expected:O.object,received:t.parsedType}),F}const{status:t,ctx:s}=this._processInputParams(e),{shape:a,keys:r}=this._getCached(),i=[];if(!(this._def.catchall instanceof Te&&"strip"===this._def.unknownKeys))for(const o in s.data)r.includes(o)||i.push(o);const n=[];for(const o of r){const e=a[o],t=s.data[o];n.push({key:{status:"valid",value:o},value:e._parse(new W(s,t,s.path,o)),alwaysSet:o in s.data})}if(this._def.catchall instanceof Te){const e=this._def.unknownKeys;if("passthrough"===e)for(const t of i)n.push({key:{status:"valid",value:t},value:{status:"valid",value:s.data[t]}});else if("strict"===e)i.length>0&&(R(s,{code:A.unrecognized_keys,keys:i}),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 i){const a=s.data[t];n.push({key:{status:"valid",value:t},value:e._parse(new W(s,a,s.path,t)),alwaysSet:t in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const e=[];for(const t of n){const s=await t.key,a=await t.value;e.push({key:s,value:a,alwaysSet:t.alwaysSet})}return e}).then(e=>$.mergeObjectSync(t,e)):$.mergeObjectSync(t,n)}get shape(){return this._def.shape()}strict(e){return B.errToObj,new Ie({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,s)=>{var a,r;const i=(null==(r=(a=this._def).errorMap)?void 0:r.call(a,t,s).message)??s.defaultError;return"unrecognized_keys"===t.code?{message:B.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new Ie({...this._def,unknownKeys:"strip"})}passthrough(){return new Ie({...this._def,unknownKeys:"passthrough"})}extend(e){return new Ie({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Ie({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:st.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Ie({...this._def,catchall:e})}pick(e){const t={};for(const s of C.objectKeys(e))e[s]&&this.shape[s]&&(t[s]=this.shape[s]);return new Ie({...this._def,shape:()=>t})}omit(e){const t={};for(const s of C.objectKeys(this.shape))e[s]||(t[s]=this.shape[s]);return new Ie({...this._def,shape:()=>t})}deepPartial(){return Pe(this)}partial(e){const t={};for(const s of C.objectKeys(this.shape)){const a=this.shape[s];e&&!e[s]?t[s]=a:t[s]=a.optional()}return new Ie({...this._def,shape:()=>t})}required(e){const t={};for(const s of C.objectKeys(this.shape))if(e&&!e[s])t[s]=this.shape[s];else{let e=this.shape[s];for(;e instanceof He;)e=e._def.innerType;t[s]=e}return new Ie({...this._def,shape:()=>t})}keyof(){return Ve(C.objectKeys(this.shape))}}Ie.create=(e,t)=>
1new Ie({shape:()=>e,unknownKeys:"strip",catchall:Te.create(),typeName:st.ZodObject,...H(t)}),Ie.strictCreate=(e,t)=>new Ie({shape:()=>e,unknownKeys:"strict",catchall:Te.create(),typeName:st.ZodObject,...H(t)}),Ie.lazycreate=(e,t)=>new Ie({shape:e,unknownKeys:"strip",catchall:Te.create(),typeName:st.ZodObject,...H(t)});class Re extends J{_parse(e){const{ctx:t}=this._processInputParams(e),s=this._def.options;if(t.common.async)return Promise.all(s.map(async e=>{const s={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:s}),ctx:s}})).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 s=e.map(e=>new E(e.ctx.common.issues));return R(t,{code:A.invalid_union,unionErrors:s}),F});{let e;const a=[];for(const i of s){const s={...t,common:{...t.common,issues:[]},parent:null},r=i._parseSync({data:t.data,path:t.path,parent:s});if("valid"===r.status)return r;"dirty"!==r.status||e||(e={result:r,ctx:s}),s.common.issues.length&&a.push(s.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const r=a.map(e=>new E(e));return R(t,{code:A.invalid_union,unionErrors:r}),F}}get options(){return this._def.options}}function $e(e,t){const s=T(e),a=T(t);if(e===t)return{valid:!0,data:e};if(s===O.object&&a===O.object){const s=C.objectKeys(t),a=C.objectKeys(e).filter(e=>-1!==s.indexOf(e)),r={...e,...t};for(const i of a){const s=$e(e[i],t[i]);if(!s.valid)return{valid:!1};r[i]=s.data}return{valid:!0,data:r}}if(s===O.array&&a===O.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let a=0;a<e.length;a++){const r=$e(e[a],t[a]);if(!r.valid)return{valid:!1};s.push(r.data)}return{valid:!0,data:s}}return s===O.date&&a===O.date&&+e===+t?{valid:!0,data:e}:{valid:!1}}Re.create=(e,t)=>new Re({options:e,typeName:st.ZodUnion,...H(t)});class Fe extends J{_parse(e){const{status:t,ctx:s}=this._processInputParams(e),a=(e,a)=>{if(z(e)||z(a))return F;const r=$e(e.value,a.value);return r.valid?((D(e)||D(a))&&t.dirty(),{status:t.value,value:r.data}):(R(s,{code:A.invalid_intersection_types}),F)};return s.common.async?Promise.all([this._def.left._parseAsync({data:s.data,path:s.path,parent:s}),this._def.right._parseAsync({data:s.data,path:s.path,parent:s})]).then(([e,t])=>a(e,t)):a(this._def.left._parseSync({data:s.data,path:s.path,parent:s}),this._def.right._parseSync({data:s.data,path:s.path,parent:s}))}}Fe.create=(e,t,s)=>new Fe({left:e,right:t,typeName:st.ZodIntersection,...H(s)});class Le extends J{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==O.array)return R(s,{code:A.invalid_type,expected:O.array,received:s.parsedType}),F;if(s.data.length<this._def.items.length)return R(s,{code:A.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),F;!this._def.rest&&s.data.length>this._def.items.length&&(R(s,{code:A.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const a=[...s.data].map((e,t)=>{const a=this._def.items[t]||this._def.rest;return a?a._parse(new W(s,e,s.path,t)):null}).filter(e=>!!e);return s.common.async?Promise.all(a).then(e=>$.mergeArray(t,e)):$.mergeArray(t,a)}get items(){return this._def.items}rest(e){return new Le({...this._def,rest:e})}}Le.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Le({items:e,typeName:st.ZodTuple,rest:null,...H(t)})};class Me extends J{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==O.map)return R(s,{code:A.invalid_type,expected:O.map,received:s.parsedType}),F;const a=this._def.keyType,r=this._def.valueType,i=[...s.data.entries()].map(([e,t],i)=>({key:a._parse(new W(s,e,s.path,[i,"key"])),value:r._parse(new W(s,t,s.path,[i,"value"]))}));if(s.common.async){const e=new Map;return Promise.resolve().then(async()=>{for(const s of i){const a=await s.key,r=await s.value;if("aborted"===a.status||"aborted"===r.status)return F;"dirty"!==a.status&&"dirty"!==r.status||t.dirty(),e.set(a.value,r.value)}return{status:t.value,value:e}})}{const e=new Map;for(const s of i){const a=s.key,r=s.value;if("aborted"===a.status||"aborted"===r.status)return F;"dirty"!==a.status&&"dirty"!==r.status||t.dirty(),e.set(a.value,r.value)}return{status:t.value,value:e}}}}Me.create=(e,t,s)=>new Me({valueType:t,keyType:e,typeName:st.ZodMap,...H(s)});class ze extends J{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==O.set)return R(s,{code:A.invalid_type,expected:O.set,received:s.parsedType}),F;const a=this._def;null!==a.minSize&&s.data.size<a.minSize.value&&(R(s,{code:A.too_small,minimum:a.minSize.value,type:"set",inclusive:!0,exact:!1,message:a.minSize.message}),t.dirty()),null!==a.maxSize&&s.data.size>a.maxSize.value&&(R(s,{code:A.too_big,maximum:a.maxSize.value,type:"set",inclusive:!0,exact:!1,message:a.maxSize.message}),t.dirty());const r=this._def.valueType;function i(e){const s=new Set;for(const a of e){if("aborted"===a.status)return F;"dirty"===a.status&&t.dirty(),s.add(a.value)}return{status:t.value,value:s}}const n=[...s.data.values()].map((e,t)=>r._parse(new W(s,e,s.path,t)));return s.common.async?Promise.all(n).then(e=>i(e)):i(n)}min(e,t){return new ze({...this._def,minSize:{value:e,message:B.toString(t)}})}max(e,t){return new ze({...this._def,maxSize:{value:e,message:B.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}ze.create=(e,t)=>
1new ze({valueType:e,minSize:null,maxSize:null,typeName:st.ZodSet,...H(t)});class De extends J{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})}}De.create=(e,t)=>new De({getter:e,typeName:st.ZodLazy,...H(t)});class Ue extends J{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return R(t,{received:t.data,code:A.invalid_literal,expected:this._def.value}),F}return{status:"valid",value:e.data}}get value(){return this._def.value}}function Ve(e,t){return new Be({values:e,typeName:st.ZodEnum,...H(t)})}Ue.create=(e,t)=>new Ue({value:e,typeName:st.ZodLiteral,...H(t)});class Be extends J{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),s=this._def.values;return R(t,{expected:C.joinValues(s),received:t.parsedType,code:A.invalid_type}),F}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),s=this._def.values;return R(t,{received:t.data,code:A.invalid_enum_value,options:s}),F}return M(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 Be.create(e,{...this._def,...t})}exclude(e,t=this._def){return Be.create(this.options.filter(t=>!e.includes(t)),{...this._def,...t})}}Be.create=Ve;class Ke extends J{_parse(e){const t=C.getValidEnumValues(this._def.values),s=this._getOrReturnCtx(e);if(s.parsedType!==O.string&&s.parsedType!==O.number){const e=C.objectValues(t);return R(s,{expected:C.joinValues(e),received:s.parsedType,code:A.invalid_type}),F}if(this._cache||(this._cache=new Set(C.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const e=C.objectValues(t);return R(s,{received:s.data,code:A.invalid_enum_value,options:e}),F}return M(e.data)}get enum(){return this._def.values}}Ke.create=(e,t)=>new Ke({values:e,typeName:st.ZodNativeEnum,...H(t)});class We extends J{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==O.promise&&!1===t.common.async)return R(t,{code:A.invalid_type,expected:O.promise,received:t.parsedType}),F;const s=t.parsedType===O.promise?t.data:Promise.resolve(t.data);return M(s.then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}}We.create=(e,t)=>new We({type:e,typeName:st.ZodPromise,...H(t)});class qe extends J{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===st.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:s}=this._processInputParams(e),a=this._def.effect||null,r={addIssue:e=>{R(s,e),e.fatal?t.abort():t.dirty()},get path(){return s.path}};if(r.addIssue=r.addIssue.bind(r),"preprocess"===a.type){const e=a.transform(s.data,r);if(s.common.async)return Promise.resolve(e).then(async e=>{if("aborted"===t.value)return F;const a=await this._def.schema._parseAsync({data:e,path:s.path,parent:s});return"aborted"===a.status?F:"dirty"===a.status||"dirty"===t.value?L(a.value):a});{if("aborted"===t.value)return F;const a=this._def.schema._parseSync({data:e,path:s.path,parent:s});return"aborted"===a.status?F:"dirty"===a.status||"dirty"===t.value?L(a.value):a}}if("refinement"===a.type){const e=e=>{const t=a.refinement(e,r);if(s.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===s.common.async){const a=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return"aborted"===a.status?F:("dirty"===a.status&&t.dirty(),e(a.value),{status:t.value,value:a.value})}return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(s=>"aborted"===s.status?F:("dirty"===s.status&&t.dirty(),e(s.value).then(()=>({status:t.value,value:s.value}))))}if("transform"===a.type){if(!1===s.common.async){const e=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!U(e))return F;const i=a.transform(e.value,r);if(i instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:i}}return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(e=>U(e)?Promise.resolve(a.transform(e.value,r)).then(e=>({status:t.value,value:e})):F)}C.assertNever(a)}}qe.create=(e,t,s)=>new qe({schema:e,typeName:st.ZodEffects,effect:t,...H(s)}),qe.createWithPreprocess=(e,t,s)=>new qe({schema:t,effect:{type:"preprocess",transform:e},typeName:st.ZodEffects,...H(s)});class He extends J{_parse(e){return this._getType(e)===O.undefined?M(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}He.create=(e,t)=>
vendor: 1,280 bytes, line 1
1new He({innerType:e,typeName:st.ZodOptional,...H(t)});class Je extends J{_parse(e){return this._getType(e)===O.null?M(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Je.create=(e,t)=>new Je({innerType:e,typeName:st.ZodNullable,...H(t)});class Ye extends J{_parse(e){const{ctx:t}=this._processInputParams(e);let s=t.data;return t.parsedType===O.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Ye.create=(e,t)=>new Ye({innerType:e,typeName:st.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...H(t)});class Ge extends J{_parse(e){const{ctx:t}=this._processInputParams(e),s={...t,common:{...t.common,issues:[]}},a=this._def.innerType._parse({data:s.data,path:s.path,parent:{...s}});return V(a)?a.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new E(s.common.issues)},input:s.data})})):{status:"valid",value:"valid"===a.status?a.value:this._def.catchValue({get error(){return new E(s.common.issues)},input:s.data})}}removeCatch(){return this._def.innerType}}Ge.create=(e,t)=>new Ge({innerType:e,typeName:st.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...H(t)});
1class Xe extends J{_parse(e){if(this._getType(e)!==O.nan){const t=this._getOrReturnCtx(e);return R(t,{code:A.invalid_type,expected:O.nan,received:t.parsedType}),F}return{status:"valid",value:e.data}}}Xe.create=e=>new Xe({typeName:st.ZodNaN,...H(e)});class Qe extends J{_parse(e){const{ctx:t}=this._processInputParams(e),s=t.data;return this._def.type._parse({data:s,path:t.path,parent:t})}unwrap(){return this._def.type}}class et extends J{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.common.async)return(async()=>{const e=await this._def.in._parseAsync({data:s.data,path:s.path,parent:s});return"aborted"===e.status?F:"dirty"===e.status?(t.dirty(),L(e.value)):this._def.out._parseAsync({data:e.value,path:s.path,parent:s})})();{const e=this._def.in._parseSync({data:s.data,path:s.path,parent:s});return"aborted"===e.status?F:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:s.path,parent:s})}}static create(e,t){return new et({in:e,out:t,typeName:st.ZodPipeline})}}class tt extends J{_parse(e){const t=this._def.innerType._parse(e),s=e=>(U(e)&&(e.value=Object.freeze(e.value)),e);return V(t)?t.then(e=>s(e)):s(t)}unwrap(){return this._def.innerType}}var st,at;tt.create=(e,t)=>new tt({innerType:e,typeName:st.ZodReadonly,...H(t)}),(at=st||(st={})).ZodString="ZodString",at.ZodNumber="ZodNumber",at.ZodNaN="ZodNaN",at.ZodBigInt="ZodBigInt",at.ZodBoolean="ZodBoolean",at.ZodDate="ZodDate",at.ZodSymbol="ZodSymbol",at.ZodUndefined="ZodUndefined",at.ZodNull="ZodNull",at.ZodAny="ZodAny",at.ZodUnknown="ZodUnknown",at.ZodNever="ZodNever",at.ZodVoid="ZodVoid",at.ZodArray="ZodArray",at.ZodObject="ZodObject",at.ZodUnion="ZodUnion",at.ZodDiscriminatedUnion="ZodDiscriminatedUnion",at.ZodIntersection="ZodIntersection",at.ZodTuple="ZodTuple",at.ZodRecord="ZodRecord",at.ZodMap="ZodMap",at.ZodSet="ZodSet",at.ZodFunction="ZodFunction",at.ZodLazy="ZodLazy",at.ZodLiteral="ZodLiteral",at.ZodEnum="ZodEnum",at.ZodEffects="ZodEffects",at.ZodNativeEnum="ZodNativeEnum",at.ZodOptional="ZodOptional",at.ZodNullable="ZodNullable",at.ZodDefault="ZodDefault",at.ZodCatch="ZodCatch",at.ZodPromise="ZodPromise",at.ZodBranded="ZodBranded",at.ZodPipeline="ZodPipeline",at.ZodReadonly="ZodReadonly";const rt=_e.create;Te.create,Ee.create;const it=Ie.create;Re.create,Fe.create,Le.create,Be.create,We.create,He.create,Je.create;const nt=it({email:rt().email("Invalid email address")}),ot=nt.extend({fullName:rt().min(1,"Name is required")}),dt=e=>{const t=Number(e);return Number.isInteger(t)&&t>=4&&t<=10?t:null},ct="echo:auth-email-code-draft",ut=()=>{if("undefined"!=typeof window)try{window.localStorage.removeItem(ct)}catch{}},lt=it({password:rt().min(6,"Password must be at least 6 characters"),confirmPassword:rt().min(6,"Password must be at least 6 characters")}).refine(e=>e.password===e.confirmPassword,{message:"Passwords do not match",path:["confirmPassword"]}),ht=()=>{if("undefined"==typeof window)return!1;const e=new URLSearchParams(window.location.search),t=new URLSearchParams(window.location.hash.replace(/^#/,"")),s=e.get("mode"),a=t.get("type");return"recovery"===s||"recovery"===a},mt=async e=>{if(e&&"object"==typeof e&&"context"in e){const t=e.context;if(t instanceof Response)try{const e=await t.clone().json();if("string"==typeof(null==e?void 0:e.error))return e.error;if("string"==typeof(null==e?void 0:e.message))return e.message}catch{try{const e=await t.clone().text();if(e)return e}catch{}}}return e instanceof Error?e.message:"An error occurred"};function pt(){const C=o.getPlatform(),S=o.isNativePlatform()&&"ios"===C,Z="android"!==C,[O,T]=e.useState(()=>"signup"!==new URLSearchParams(window.location.search).get("mode")),[A,P]=e.useState(""),[I,R]=e.useState(""),[$,F]=e.useState(""),[L,M]=e.useState(""),[z,D]=e.useState(null),[U,V]=e.useState(!1),[B,K]=e.useState(""),[W,q]=e.useState(()=>"signup"===new URLSearchParams(window.location.search).get("mode")?"signup":"login"),[H,J]=e.useState(""),[Y,G]=e.useState(!1),[X,Q]=e.useState({}),[ee,te]=e.useState(()=>ht()),se=e.useRef(!1),ae=e.useRef(!1),re=e.useRef(""),ie=_(),{toast:ne}=i(),{isAuthenticated:oe}=n();e.useEffect(()=>{if(ee)return;const e=(()=>
1{if("undefined"==typeof window)return null;try{const e=window.localStorage.getItem(ct);if(!e)return null;const t=JSON.parse(e),s="string"==typeof t.email?t.email.trim().toLowerCase():"",a=Number(t.createdAt),r="signup"===t.intent?"signup":"login",i=dt(t.codeLength);if(!s||!Number.isFinite(a)||Date.now()-a>9e5){try{window.localStorage.removeItem(ct)}catch{}return null}return{email:s,codeLength:i,intent:r,createdAt:a}}catch{try{window.localStorage.removeItem(ct)}catch{}return null}})();e&&(P(e.email),K(e.email),D(e.codeLength),q(e.intent),T("login"===e.intent),V(!0))},[ee]);const de=new URLSearchParams(window.location.search).get("returnTo");e.useEffect(()=>{oe&&!ee&&ie(de||"/",{replace:!0})},[oe,ee,ie,de]),e.useEffect(()=>{const e=()=>te(ht());return e(),window.addEventListener("hashchange",e),()=>{window.removeEventListener("hashchange",e)}},[]);const ce=async e=>{if("apple"!==e||Z){G(!0);try{sessionStorage.setItem("echo_oauth_provider",e),sessionStorage.setItem("echo_oauth_intent",O?"login":"signup"),u("oauth_start",{provider:e,native:o.isNativePlatform()});const t=o.isNativePlatform()?l(e):null,{data:a,error:r}=await s.auth.signInWithOAuth({provider:e,options:{redirectTo:t??`${window.location.origin}/`,skipBrowserRedirect:o.isNativePlatform()}});if(r)throw r;o.isNativePlatform()&&(null==a?void 0:a.url)&&(await d.open({url:a.url,windowName:"_self"}),u("oauth_browser_opened",{provider:e,surface:"in_app"}))}catch(t){o.isNativePlatform()&&h(),sessionStorage.removeItem("echo_oauth_intent"),sessionStorage.removeItem("echo_oauth_provider"),u("oauth_exchange_failed",{provider:e,reason:t instanceof Error?t.message:"unknown"}),ne({title:"Login Error",description:t instanceof Error?t.message:"Failed to connect with provider",variant:"error"})}finally{G(!1)}}else ne({title:"Apple sign-in unavailable",description:"Apple sign-in is only supported on iOS and web.",variant:"error"})},ue=e.useCallback(async e=>{var t;if(!ae.current){ae.current=!0,G(!0),Q({});try{const a=await m({verify:()=>s.auth.verifyOtp({email:(B||A).trim().toLowerCase(),token:e.trim(),type:"email"}),getSession:()=>s.auth.getSession()});if(!a.authenticated)return void Q({code:"message"in a?a.message:"Verification failed"});ut(),await p(),"signup"===W&&f({method:"email_code",signup_location:"auth_form",user_id:(null==(t=a.user)?void 0:t.id)??null,email_confirmation_required:!1}),ie(de||"/",{replace:!0})}catch(a){Q({code:a instanceof Error?a.message:"Echo could not finish sign-in. Please try again."})}finally{ae.current=!1,G(!1)}}},[W,A,ie,B,de]);return e.useEffect(()=>{const e=z??8;U&&L.length===e?Y||re.current===L||(re.current=L,ue(L)):L.length<e&&(re.current="")},[L,z,U,Y,ue]),S?t.jsx(g,{onUpgradeToFullApp:()=>{window.__ECHO_FORCE_FULL_APP__=!0,ie("/",{replace:!0})}}):t.jsxs("div",{className:"notranslate app-screen min-h-screen bg-[#05070c] text-white",translate:"no",children:[t.jsx(c,{title:ee?"Reset Password":O?"Sign In":"Sign Up",noindex:!0}),t.jsxs("div",{className:"relative min-h-screen overflow-hidden",children:[t.jsx("div",{className:"pointer-events-none absolute inset-0",children:t.jsx("div",{className:"absolute inset-0 bg-[#05070c]"})}),t.jsx("div",{className:"relative z-10 flex min-h-screen items-center justify-center px-6 py-10",children:t.jsxs("section",{className:"w-full max-w-[520px]",children:[t.jsxs("div",{className:"mb-8 text-center",children:[t.jsx("div",{className:"mb-4 inline-flex items-center gap-2",children:t.jsx("div",{className:"h-14 w-14 overflow-hidden rounded-[1.15rem]",children:t.jsx(v,{alt:"Echo logo",className:"object-contain"})})}),t.jsx("h1",{className:"mb-2 text-3xl font-semibold text-white",children:ee?"Set a new password":U?"Check your email":O?"Welcome back!":"Create your feed"})]}),t.jsxs("form",{onSubmit:async e=>{if(e.preventDefault(),(()=>{try{if(ee)lt.parse({password:I,confirmPassword:$});else if(U){if(!(z?new RegExp(`^\\d{${z}}$`):/^\d{4,10}$/).test(L.trim()))throw new E([{code:"custom",path:["code"],message:z?`Enter the ${z}-digit code from your email`:"Enter the code from your email"}])}else O?nt.parse({email:A}):ot.parse({email:A,fullName:H});return Q({}),!0}catch(e){if(e instanceof E){const t={};
1e.errors.forEach(e=>{e.path[0]&&(t[e.path[0]]=e.message)}),Q(t)}return!1}})())if(U)ue(L);else if(!se.current){se.current=!0,G(!0);try{if(ee){const{error:e}=await s.auth.updateUser({password:I});if(e)throw new Error(await mt(e));ne({title:"Password updated",description:"Your password has been changed. You can continue into Echo now."}),window.history.replaceState(null,"","/auth"),te(!1),R(""),F(""),ie(de||"/",{replace:!0})}else{const e=O?"login":"signup",t=A.trim().toLowerCase(),s=await y({email:t,fullName:H.trim(),intent:e});q(e),K(t);const a=dt(null==s?void 0:s.codeLength);D(a),(e=>{if("undefined"!=typeof window)try{window.localStorage.setItem(ct,JSON.stringify({...e,createdAt:Date.now()}))}catch{}})({email:t,codeLength:a,intent:e}),V(!0),M(""),ne({title:"Code sent",description:`Check ${t} for your Echo sign-in code.`})}}catch(t){const e=await mt(t);e.includes("User already registered")?Q({email:"This email is already registered. Try logging in."}):e.includes("Token has expired")||e.includes("Email link is invalid")?Q({code:"That code did not work. Check every digit or request a new one."}):Q({form:e})}finally{se.current=!1,G(!1)}}},"aria-describedby":X.form?"auth-form-error":void 0,className:"w-full rounded-[2rem] border border-white/10 bg-[rgba(13,16,24,0.92)] p-6 shadow-[0_24px_70px_rgba(0,0,0,0.42)] backdrop-blur-xl md:p-8",children:[X.form?t.jsx("p",{id:"auth-form-error",role:"alert",className:"mb-4 rounded-xl border border-destructive/40 bg-destructive/10 px-4 py-3 text-sm text-red-200",children:X.form}):null,t.jsxs("div",{className:"space-y-4",children:[!O&&!ee&&!U&&t.jsxs("div",{className:"space-y-2",children:[t.jsxs("label",{htmlFor:"auth-full-name",className:"flex items-center gap-2 text-sm text-white/60",children:[t.jsx(x,{className:"w-4 h-4"}),"Nickname"]}),t.jsx(r,{id:"auth-full-name",type:"text",value:H,onChange:e=>J(e.target.value),placeholder:"Enter your name","aria-invalid":Boolean(X.fullName),"aria-describedby":X.fullName?"auth-full-name-error":void 0,className:"border-white/10 bg-white/[0.03] text-white placeholder:text-white/42 focus-visible:ring-0 focus-visible:ring-offset-0"}),X.fullName&&t.jsx("p",{id:"auth-full-name-error",role:"alert",className:"text-xs text-destructive",children:X.fullName})]}),!ee&&!U&&t.jsxs("div",{className:"space-y-2",children:[t.jsxs("label",{htmlFor:"auth-email",className:"flex items-center gap-2 text-sm text-white/60",children:[t.jsx(w,{className:"w-4 h-4"}),"Email"]}),t.jsx(r,{id:"auth-email",type:"email",value:A,onChange:e=>P(e.target.value),placeholder:"[email protected]",autoComplete:"email","aria-invalid":Boolean(X.email),"aria-describedby":X.email?"auth-email-error":void 0,className:"border-white/10 bg-white/[0.03] text-white placeholder:text-white/42 focus-visible:ring-0 focus-visible:ring-offset-0"}),X.email&&t.jsx("p",{id:"auth-email-error",role:"alert",className:"text-xs text-destructive",children:X.email})]}),ee?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"space-y-2",children:[t.jsxs("label",{htmlFor:"auth-password",className:"flex items-center gap-2 text-sm text-white/60",children:[t.jsx(b,{className:"w-4 h-4"}),"New password"]}),t.jsx(r,{id:"auth-password",type:"password",value:I,onChange:e=>R(e.target.value),placeholder:"••••••••",autoComplete:"new-password","aria-invalid":Boolean(X.password),"aria-describedby":X.password?"auth-password-error":void 0,className:"border-white/10 bg-white/[0.03] text-white placeholder:text-white/42 focus-visible:ring-0 focus-visible:ring-offset-0"}),X.password&&t.jsx("p",{id:"auth-password-error",role:"alert",className:"text-xs text-destructive",children:X.password})]}),t.jsxs("div",{className:"space-y-2",children:[t.jsxs("label",{htmlFor:"auth-confirm-password",className:"flex items-center gap-2 text-sm text-white/60",children:[t.jsx(b,{className:"w-4 h-4"}),"Confirm password"]}),t.jsx(r,{id:"auth-confirm-password",type:"password",value:$,onChange:e=>F(e.target.value),placeholder:"••••••••",autoComplete:"new-password","aria-invalid":Boolean(X.confirmPassword),"aria-describedby":X.confirmPassword?"auth-confirm-password-error":void 0,className:"border-white/10 bg-white/[0.03] text-white placeholder:text-white/42 focus-visible:ring-0 focus-visible:ring-offset-0"}),X.confirmPassword&&t.jsx("p",{id:"auth-confirm-password-error",role:"alert",className:"text-xs text-destructive",children:X.confirmPassword})]})]}):U?t.jsxs("div",{className:"space-y-2",children:[t.jsxs("label",{htmlFor:"auth-code",className:"flex items-center gap-2 text-sm text-white/60",children:[t.jsx(k,{className:"w-4 h-4"}),"Sign-in code"]}),t.jsx(r,{id:"auth-code",autoComplete:"one-time-code",inputMode:"numeric",maxLength:z??10,pattern:"[0-9]*",value:L,onChange:e=>{const t=e.target.value.replace(/\D/g,"").slice(0,z??10);M(t),X.code&&Q(e=>({...e,code:""}))},placeholder:"12345678","aria-invalid":Boolean(X.code),"aria-describedby":X.code?"auth-code-error auth-code-help":"auth-code-help",className:"border-white/10 bg-white/[0.03] text-center text-2xl font-semibold tracking-[0.5em] text-white placeholder:text-white/28 focus-visible:ring-0 focus-visible:ring-offset-0"}),X.code&&t.jsx("p",{id:"auth-code-error",role:"alert",className:"text-xs text-destructive",children:X.code}),t.jsxs("p",{id:"auth-code-help",className:"text-xs text-white/45",children:["We sent a code to ",B||A.trim(),"."]})]}):null,t.jsx(a,{type:"submit",disabled:Y,"aria-busy":Y,className:"w-full bg-primary hover:bg-primary/90 text-primary-foreground",children:Y?t.jsxs(t.Fragment,{children:[t.jsx(j,{"aria-hidden":"true",className:"w-4 h-4 animate-spin"}),t.jsx("span",{className:"sr-only",children:"Please wait"})]}):t.jsxs(t.Fragment,{children:[t.jsx("span",{children:ee?"Update Password":U?"Verify Code":O?"Email Me a Code":"Create Account"}),t.jsx(N,{className:"w-4 h-4 ml-2"})]})}),U?t.jsx("button",{type:"button",onClick:()=>{ut(),V(!1),M(""),D(null),K(""),Q({})},className:"w-full text-sm text-white/60 transition-colors hover:text-white",children:"Use a different email"}):null,ee||U?null:t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"relative my-6",children:[t.jsx("div",{className:"absolute inset-0 flex items-center",children:t.jsx("div",{className:"w-full border-t border-white/10"})}),t.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:t.jsx("span",{className:"bg-[#0d1018] px-2 text-white/45",children:"Or continue with"})})]}),t.jsxs("div",{className:"grid grid-cols-1 gap-3",children:[Z&&t.jsxs(a,{t
1ype:"button",variant:"outline",onClick:()=>ce("apple"),disabled:Y,className:"border-white/10 bg-white/[0.03] text-white hover:bg-white/[0.08]",children:[t.jsx("svg",{className:"w-4 h-4 mr-2",viewBox:"0 0 24 24",children:t.jsx("path",{fill:"currentColor",d:"M16.365 21.438c-1.125.811-2.28 1.562-3.483 1.562-1.396 0-2.4-.766-3.882-.766-1.528 0-2.684.766-3.928.766-1.16 0-2.235-.615-3.351-1.353C-.198 18.916-.948 11.233 2.112 8.358c1.396-1.307 2.946-1.895 4.38-1.895 1.527 0 2.503.766 3.753.766 1.077 0 2.502-.857 4.11-1.023 1.705-.084 3.09.431 4.02 1.623-3.03 1.579-2.585 5.56 1.251 7.042-.716 1.803-1.637 3.528-3.263 6.567zM15.42 5.08A4.896 4.896 0 0 0 16.513 1.5c-1.488.084-3.16.947-4.144 2.15-1.026 1.157-1.47 2.656-1.352 4.144 1.6-.2 3.16-1.157 4.403-2.714z"})}),"Continue with Apple"]}),t.jsxs(a,{type:"button",variant:"outline",onClick:()=>ce("google"),disabled:Y,className:"border-white/10 bg-white/[0.03] text-white hover:bg-white/[0.08]",children:[t.jsxs("svg",{className:"w-4 h-4 mr-2",viewBox:"0 0 24 24",children:[t.jsx("path",{fill:"currentColor",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"}),t.jsx("path",{fill:"currentColor",d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"}),t.jsx("path",{fill:"currentColor",d:"M5.84 14.1c-.22-.66-.35-1.36-.35-2.1s.13-1.44.35-2.1V7.06H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.94l3.66-2.84z"}),t.jsx("path",{fill:"currentColor",d:"M12 5.38c1.62 0 3.06.56 4.21 1.66l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.06l3.66 2.84c.87-2.6 3.3-4.52 6.16-4.52z"})]}),"Continue with Google"]})]})]})]}),ee?null:t.jsx("div",{className:"mt-8 text-center",children:t.jsx("button",{type:"button",onClick:()=>{T(!O),V(!1),M(""),D(null),K(""),Q({})},className:"text-sm text-white/60 transition-colors hover:text-white",children:O?t.jsxs(t.Fragment,{children:["Don't have an account?"," ",t.jsx("span",{className:"font-medium text-rose-400",children:"Sign up"})]}):t.jsxs(t.Fragment,{children:["Already have an account?"," ",t.jsx("span",{className:"text-primary font-medium",children:"Sign in"})]})})})]})]})})]})]})}export{pt as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.