1import{R as te,k as Pe,e as Ie,g as Rr,n as be,r as q,l as Vr,j as l,L as ze,S as Nn,m as On}from"./index-iegIeF45.js";import{L as He}from"./logo-Du2doHA8.js";import{I as ce}from"./input-YwntURuZ.js";import{B as Re}from"./button-ngsdm2jQ.js";import{u as Ve}from"./useMutation-3fP8P5Jg.js";import{S as En,a as Zn}from"./legal-doc-page-Bin8G01w.js";import{M as An}from"./modal-JMPYbZCR.js";import"./useQuery-D6gZY3LU.js";import"./textarea-CMPxVrab.js";import"./index-C8eNEL7x.js";var Xe=e=>e.type==="checkbox",$e=e=>e instanceof Date,oe=e=>e==null;const Lr=e=>typeof e=="object";var J=e=>!oe(e)&&!Array.isArray(e)&&Lr(e)&&!$e(e),Tn=e=>J(e)&&e.target?Xe(e.target)?e.target.checked:e.target.value:e,Cn=(e,t)=>t.split(".").some((r,n,s)=>!isNaN(Number(r))&&e.has(s.slice(0,n).join("."))),Dn=e=>{const t=e.constructor&&e.constructor.prototype;return J(t)&&t.hasOwnProperty("isPrototypeOf")},Ct=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function G(e){if(e instanceof Date)return new Date(e);const t=typeof FileList<"u"&&e instanceof FileList;if(Ct&&(e instanceof Blob||t))return e;const r=Array.isArray(e);if(!r&&!(J(e)&&Dn(e)))return e;const n=r?[]:Object.create(Object.getPrototypeOf(e));for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(n[s]=G(e[s]));return n}var dt=e=>/^\w*$/.test(e),L=e=>e===void 0,Dt=e=>Array.isArray(e)?e.filter(Boolean):[],Ft=e=>Dt(e.replace(/["|']|\]/g,"").split(/\.|\[/)),k=(e,t,r)=>{if(!t||!J(e))return r;const n=(dt(t)?[t]:Ft(t)).reduce((s,o)=>oe(s)?s:s[o],e);return L(n)||n===e?L(e[t])?r:e[t]:n},ye=e=>typeof e=="boolean",fe=e=>typeof e=="function",F=(e,t,r)=>{let n=-1;const s=dt(t)?[t]:Ft(t),o=s.length,a=o-1;for(;++n<o;){const i=s[n];let f=r;if(n!==a){const h=e[i];f=J(h)||Array.isArray(h)?h:isNaN(+s[n+1])?{}:[]}if(i==="__proto__"||i==="constructor"||i==="prototype")return;e[i]=f,e=e[i]}};const Ae={BLUR:"blur",FOCUS_OUT:"focusout",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},he={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},de={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Pt="form",Ur="root",Fn=te.createContext(null);Fn.displayName="HookFormControlContext";var In=(e,t,r,n=!0)=>{const s={defaultValues:t._defaultValues};for(const o in e)Object.defineProperty(s,o,{get:()=>{const a=o;return t._proxyFormState[a]!==he.all&&(t._proxyFormState[a]=!n||he.all),e[a]}});return s};const Rn=typeof window<"u"?te.useLayoutEffect:te.useEffect;var ne=e=>typeof e=="string",Vn=(e,t,r,n,s)=>ne(e)?(n&&t.watch.add(e),k(r,e,s)):Array.isArray(e)?e.map(o=>(n&&t.watch.add(o),k(r,o))):(n&&(t.watchAll=!0),r),Nt=e=>oe(e)||!Lr(e);function ke(e,t,r=new WeakSet){if(Nt(e)||Nt(t))return Object.is(e,t);if($e(e)&&$e(t))return Object.is(e.getTime(),t.getTime());const n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const o of n){const a=e[o];if(!s.includes(o))return!1;if(o!=="ref"){const i=t[o];if($e(a)&&$e(i)||(J(a)||Array.isArray(a))&&(J(i)||Array.isArray(i))?!ke(a,i,r):!Object.is(a,i))return!1}}return!0}const Ln=te.createContext(null);Ln.displayName="HookFormContext";var It=(e,t,r,n,s)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:s||!0}}:{},qe=e=>Array.isArray(e)?e:[e],or=()=>{let e=[];return{get observers(){return e},next:s=>{for(const o of e)o.next&&o.next(s)},subscribe:s=>(e.push(s),{unsubscribe:()=>{e=e.filter(o=>o!==s)}}),unsubscribe:()=>{e=[]}}};function Mr(e,t){const r={};for(const n in e)if(e.hasOwnProperty(n)){const s=e[n],o=t[n];if(s&&J(s)&&o){const a=Mr(s,o);J(a)&&(r[n]=a)}else e[n]&&(r[n]=o)}return r}var re=e=>J(e)&&!Object.keys(e).length,Rt=e=>e.type==="file",ot=e=>{if(!Ct)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Jr=e=>e.type==="select-multiple",Vt=e=>e.type==="radio",Un=e=>Vt(e)||Xe(e),$t=e=>ot(e)&&e.isConnected;function Mn(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=L(e)?n++:e[t[n++]];return e}function Jn(e){for(const t in e)if(e.hasOwnProperty(t)&&!L(e[t]))return!1;return!0}function W(e,t){const r=Array.isArray(t)?t:dt(t)?[t]:Ft(t),n=r.length===1?e:Mn(e,r),s=r.length-1,o=r[s];return n&&delete n[o],s!==0&&(J(n)&&re(n)||Array.isArray(n)&&Jn(n))&&W(e,r.slice(0,-1)),e}var Bn=e=>{for(const t in e)if(fe(e[t]))return!0;return!1};function Br(e){return Array.isArray(e)||J(e)&&!Bn(e)}function Ot(e,t={}){for(const r in e){const n=e[r];Br(n)?(t[r]=Array.isArray(n)?[]:{},Ot(n,t[r])):L(n)||(t[r]=!0)}return t}function Be(e,t,r){r||(r=Ot(t));for(const n in e){const s=e[n];if(Br(s))L(t)||Nt(r[n])?r[n]=Ot(s,Array.isArray(s)?[]:{}):Be(s,oe(t)?{}:t[n],r[n]);else{const o=t[n];r[n]=!ke(s,o)}}return r}const ar={value:!1,isValid:!1},ir={value:!0,isValid:!0};var Wr=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!L(e[0].attributes.value)?L(e[0].value)||e[0].value===""?ir:{value:e[0].value,isValid:!0}:ir:ar}return ar},qr=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>L(e)?e:t?e===""?NaN:e&&+e:r&&ne(e)?new Date(e):n?n(e):e;const cr={isValid:!1,value:null};var Kr=e=>Array.isArray(e)?e.reduce((t,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:t,cr):cr;function ur(e){const t=e.ref;return Rt(t)?t.files:Vt(t)?Kr(e.refs).value:Jr(t)?[...t.selectedOptions].map(({value:r})=>r):Xe(t)?Wr(e.refs).value:qr(L(t.value)?e.ref.value:t.value,e)}var Wn=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,qn=(e,t,r,n)=>{const s={};for(const o of e){const a=k(t,o);a&&F(s,o,a._f)}return{criteriaMode:r,names:[...e],fields:s,shouldUseNativeValidation:n}},at=e=>e instanceof RegExp,Je=e=>L(e)?e:at(e)?e.source:J(e)?at(e.value)?e.value.source:e.value:e,lr=e=>({isOnSubmit:!e||e===he.onSubmit,isOnBlur:e===he.onBlur,isOnChange:e===he.onChange,isOnAll:e===he.all,isOnTouch:e===he.onTouched});const dr="AsyncFunction";var Kn=e=>!!e&&!!e.validate&&!!(fe(e.validate)&&e.validate.constructor.name===dr||J(e.validate)&&Object.values(e.validate).find(t=>t.constructor.name===dr)),Hn=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),fr=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const Ke=(e,t,r,n)=>{for(const s of r||Object.keys(e)){const o=k(e,s);if(o){const{_f:a,...i}=o;if(a){if(a.refs&&a.refs[0]&&t(a.refs[0],s)&&!n)return!0;
1if(a.ref&&t(a.ref,a.name)&&!n)return!0;if(Ke(i,t))break}else if(J(i)&&Ke(i,t))break}}};function hr(e,t,r){const n=k(e,r);if(n||dt(r))return{error:n,name:r};const s=r.split(".");for(;s.length;){const o=s.join("."),a=k(t,o),i=k(e,o);if(a&&!Array.isArray(a)&&r!==o)return{name:r};if(i&&i.type)return{name:o,error:i};if(i&&i.root&&i.root.type)return{name:`${o}.root`,error:i.root};s.pop()}return{name:r}}var Gn=(e,t,r,n)=>{r(e);const{name:s,...o}=e;return re(o)||Object.keys(o).length>=Object.keys(t).length||Object.keys(o).find(a=>t[a]===(!n||he.all))},Yn=(e,t,r)=>!e||!t||e===t||qe(e).some(n=>n&&(r?n===t:n.startsWith(t)||t.startsWith(n))),Xn=(e,t,r,n,s)=>s.isOnAll?!1:!r&&s.isOnTouch?!(t||e):(r?n.isOnBlur:s.isOnBlur)?!e:(r?n.isOnChange:s.isOnChange)?e:!0,Qn=(e,t)=>!Dt(k(e,t)).length&&W(e,t),es=(e,t,r)=>{const n=qe(k(e,r));return F(n,Ur,t[r]),F(e,r,n),e};function mr(e,t,r="validate"){if(ne(e)||Array.isArray(e)&&e.every(ne)||ye(e)&&!e)return{type:r,message:ne(e)?e:"",ref:t}}var Te=e=>J(e)&&!at(e)?e:{value:e,message:""},pr=async(e,t,r,n,s,o)=>{const{ref:a,refs:i,required:f,maxLength:h,minLength:p,min:m,max:w,pattern:y,validate:S,name:P,valueAsNumber:j,mount:N}=e._f,x=k(r,P);if(!N||t.has(P))return{};const M=i?i[0]:a,T=Z=>{s&&M.reportValidity&&(M.setCustomValidity(ye(Z)?"":Z||""),M.reportValidity())},O={},B=Vt(a),ie=Xe(a),we=B||ie,I=(j||Rt(a))&&L(a.value)&&L(x)||ot(a)&&a.value===""||x===""||Array.isArray(x)&&!x.length,me=It.bind(null,P,n,O),Ze=(Z,D,R,X=de.maxLength,pe=de.minLength)=>{const le=Z?D:R;O[P]={type:Z?X:pe,message:le,ref:a,...me(Z?X:pe,le)}};if(o?!Array.isArray(x)||!x.length:f&&(!we&&(I||oe(x))||ye(x)&&!x||ie&&!Wr(i).isValid||B&&!Kr(i).isValid)){const{value:Z,message:D}=ne(f)?{value:!!f,message:f}:Te(f);if(Z&&(O[P]={type:de.required,message:D,ref:M,...me(de.required,D)},!n))return T(D),O}if(!I&&(!oe(m)||!oe(w))){let Z,D;const R=Te(w),X=Te(m);if(!oe(x)&&!isNaN(x)){const pe=a.valueAsNumber||x&&+x;oe(R.value)||(Z=pe>R.value),oe(X.value)||(D=pe<X.value)}else{const pe=a.valueAsDate||new Date(x),le=Qe=>new Date(new Date().toDateString()+" "+Qe),Me=a.type=="time",_e=a.type=="week";ne(R.value)&&x&&(Z=Me?le(x)>le(R.value):_e?x>R.value:pe>new Date(R.value)),ne(X.value)&&x&&(D=Me?le(x)<le(X.value):_e?x<X.value:pe<new Date(X.value))}if((Z||D)&&(Ze(!!Z,R.message,X.message,de.max,de.min),!n))return T(O[P].message),O}if((h||p)&&!I&&(ne(x)||o&&Array.isArray(x))){const Z=Te(h),D=Te(p),R=!oe(Z.value)&&x.length>+Z.value,X=!oe(D.value)&&x.length<+D.value;if((R||X)&&(Ze(R,Z.message,D.message),!n))return T(O[P].message),O}if(y&&!I&&ne(x)){const{value:Z,message:D}=Te(y);if(at(Z)&&!x.match(Z)&&(O[P]={type:de.pattern,message:D,ref:a,...me(de.pattern,D)},!n))return T(D),O}if(S){if(fe(S)){const Z=await S(x,r),D=mr(Z,M);if(D&&(O[P]={...D,...me(de.validate,D.message)},!n))return T(D.message),O}else if(J(S)){let Z={};for(const D in S){if(!re(Z)&&!n)break;const R=mr(await S[D](x,r),M,D);R&&(Z={...R,...me(D,R.message)},T(R.message),n&&(O[P]=Z))}if(!re(Z)&&(O[P]={ref:M,...Z},!n))return O}}return T(!0),O};const ts={mode:he.onSubmit,reValidateMode:he.onChange,shouldFocusError:!0};function rs(e={}){let t={...ts,...e},r={submitCount:0,isDirty:!1,isReady:!1,isLoading:fe(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},n={},s=J(t.defaultValues)||J(t.values)?G(t.defaultValues||t.values)||{}:{},o=t.shouldUnregister?{}:G(s),a={action:!1,mount:!1,watch:!1,keepIsValid:!1},i={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},f,h=0;const p={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},m={...p};let w={...m};const y={array:or(),state:or()},S=t.criteriaMode===he.all,P=c=>u=>{clearTimeout(h),h=setTimeout(c,u)},j=async c=>{if(!a.keepIsValid&&!t.disabled&&(m.isValid||w.isValid||c)){let u;t.resolver?(u=re((await I()).errors),N()):u=await Z({fields:n,onlyCheckValid:!0,eventType:Ae.VALID}),u!==r.isValid&&y.state.next({isValid:u})}},N=(c,u)=>{!t.disabled&&(m.isValidating||m.validatingFields||w.isValidating||w.validatingFields)&&((c||Array.from(i.mount)).forEac
1h(d=>{d&&(u?F(r.validatingFields,d,u):W(r.validatingFields,d))}),y.state.next({validatingFields:r.validatingFields,isValidating:!re(r.validatingFields)}))},x=c=>{const u=Be(s,o),d=Wn(c);F(r.dirtyFields,d,k(u,d))},M=(c,u=[],d,_,b=!0,v=!0)=>{if(_&&d&&!t.disabled){if(a.action=!0,v&&Array.isArray(k(n,c))){const z=d(k(n,c),_.argA,_.argB);b&&F(n,c,z)}if(v&&Array.isArray(k(r.errors,c))){const z=d(k(r.errors,c),_.argA,_.argB);b&&F(r.errors,c,z),Qn(r.errors,c)}if((m.touchedFields||w.touchedFields)&&v&&Array.isArray(k(r.touchedFields,c))){const z=d(k(r.touchedFields,c),_.argA,_.argB);b&&F(r.touchedFields,c,z)}(m.dirtyFields||w.dirtyFields)&&x(c),y.state.next({name:c,isDirty:R(c,u),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else F(o,c,u)},T=(c,u)=>{F(r.errors,c,u),y.state.next({errors:r.errors})},O=c=>{r.errors=c,y.state.next({errors:r.errors,isValid:!1})},B=(c,u,d,_)=>{const b=k(n,c);if(b){const v=k(o,c,L(d)?k(s,c):d);L(v)||_&&_.defaultChecked||u?F(o,c,u?v:ur(b._f)):le(c,v),a.mount&&!a.action&&j()}},ie=(c,u,d,_,b)=>{let v=!1,z=!1;const E={name:c};if(!t.disabled){if(!d||_){(m.isDirty||w.isDirty)&&(z=r.isDirty,r.isDirty=E.isDirty=R(),v=z!==E.isDirty);const A=ke(k(s,c),u);z=!!k(r.dirtyFields,c),A?W(r.dirtyFields,c):F(r.dirtyFields,c,!0),E.dirtyFields=r.dirtyFields,v=v||(m.dirtyFields||w.dirtyFields)&&z!==!A}if(d){const A=k(r.touchedFields,c);A||(F(r.touchedFields,c,d),E.touchedFields=r.touchedFields,v=v||(m.touchedFields||w.touchedFields)&&A!==d)}v&&b&&y.state.next(E)}return v?E:{}},we=(c,u,d,_)=>{const b=k(r.errors,c),v=(m.isValid||w.isValid)&&ye(u)&&r.isValid!==u;if(t.delayError&&d?(f=P(()=>T(c,d)),f(t.delayError)):(clearTimeout(h),f=null,d?F(r.errors,c,d):W(r.errors,c)),(d?!ke(b,d):b)||!re(_)||v){const z={..._,...v&&ye(u)?{isValid:u}:{},errors:r.errors,name:c};r={...r,...z},y.state.next(z)}},I=async c=>(N(c,!0),await t.resolver(o,t.context,qn(c||i.mount,n,t.criteriaMode,t.shouldUseNativeValidation))),me=async c=>{const{errors:u}=await I(c);if(N(c),c)for(const d of c){const _=k(u,d);_?F(r.errors,d,_):W(r.errors,d)}else r.errors=u;return u},Ze=async({name:c,eventType:u})=>
vendor: 10,307 bytes, line 1
1{if(e.validate){const d=await e.validate({formValues:o,formState:r,name:c,eventType:u});if(J(d))for(const _ in d)d[_]&&et(`${Pt}.${_}`,{message:ne(d.message)?d.message:"",type:de.validate});else ne(d)||!d?et(Pt,{message:d||"",type:de.validate}):Gt(Pt);return d}return!0},Z=async({fields:c,onlyCheckValid:u,name:d,eventType:_,context:b={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(b.runRootValidation=!0,!await Ze({name:d,eventType:_})&&(b.valid=!1,u)))return b.valid;for(const v in c){const z=c[v];if(z){const{_f:E,...A}=z;if(E){const Q=i.array.has(E.name),ge=z._f&&Kn(z._f);ge&&m.validatingFields&&N([E.name],!0);const se=await pr(z,i.disabled,o,S,t.shouldUseNativeValidation&&!u,Q);if(ge&&m.validatingFields&&N([E.name]),se[E.name]&&(b.valid=!1,u)||(!u&&(k(se,E.name)?Q?es(r.errors,se,E.name):F(r.errors,E.name,se[E.name]):W(r.errors,E.name)),e.shouldUseNativeValidation&&se[E.name]))break}!re(A)&&await Z({context:b,onlyCheckValid:u,fields:A,name:v,eventType:_})}}return b.valid},D=()=>{for(const c of i.unMount){const u=k(n,c);u&&(u._f.refs?u._f.refs.every(d=>!$t(d)):!$t(u._f.ref))&&xt(c)}i.unMount=new Set},R=(c,u)=>!t.disabled&&(c&&u&&F(o,c,u),!ke(Kt(),s)),X=(c,u,d)=>Vn(c,i,{...a.mount?o:L(u)?s:ne(c)?{[c]:u}:u},d,u),pe=c=>Dt(k(a.mount?o:s,c,t.shouldUnregister?k(s,c,[]):[])),le=(c,u,d={})=>{const _=k(n,c);let b=u;if(_){const v=_._f;v&&(!v.disabled&&F(o,c,qr(u,v)),b=ot(v.ref)&&oe(u)?"":u,Jr(v.ref)?[...v.ref.options].forEach(z=>z.selected=b.includes(z.value)):v.refs?Xe(v.ref)?v.refs.forEach(z=>{(!z.defaultChecked||!z.disabled)&&(Array.isArray(b)?z.checked=!!b.find(E=>E===z.value):z.checked=b===z.value||!!b)}):v.refs.forEach(z=>z.checked=z.value===b):Rt(v.ref)?v.ref.value="":(v.ref.value=b,v.ref.type||y.state.next({name:c,values:G(o)})))}(d.shouldDirty||d.shouldTouch)&&ie(c,b,d.shouldTouch,d.shouldDirty,!0),d.shouldValidate&&_t(c)},Me=(c,u,d)=>{for(const _ in u){if(!u.hasOwnProperty(_))return;const b=u[_],v=c+"."+_,z=k(n,v);(i.array.has(c)||J(b)||z&&!z._f)&&!$e(b)?Me(v,b,d):le(v,b,d)}},_e=(c,u,d={})=>{const _=k(n,c),b=i.array.has(c),v=G(u);F(o,c,v),b?(y.array.next({name:c,values:G(o)}),(m.isDirty||m.dirtyFields||w.isDirty||w.dirtyFields)&&d.shouldDirty&&(x(c),y.state.next({name:c,dirtyFields:r.dirtyFields,isDirty:R(c,v)}))):_&&!_._f&&!oe(v)?Me(c,v,d):le(c,v,d),fr(c,i)?y.state.next({...r,name:c,values:G(o)}):y.state.next({name:a.mount?c:void 0,values:G(o)})},Qe=async c=>{a.mount=!0;const u=c.target;let d=u.name,_=!0;const b=k(n,d),v=A=>{_=Number.isNaN(A)||$e(A)&&isNaN(A.getTime())||ke(A,k(o,d,A))},z=lr(t.mode),E=lr(t.reValidateMode);if(b){let A,Q;const ge=u.type?ur(b._f):Tn(c),se=c.type===Ae.BLUR||c.type===Ae.FOCUS_OUT,Sn=!Hn(b._f)&&!e.validate&&!t.resolver&&!k(r.errors,d)&&!b._f.deps||Xn(se,k(r.touchedFields,d),r.isSubmitted,E,z),jt=fr(d,i,se);F(o,d,ge),se?(!u||!u.readOnly)&&(b._f.onBlur&&b._f.onBlur(c),f&&f(0)):b._f.onChange&&b._f.onChange(c);const St=ie(d,ge,se),Pn=!re(St)||jt;if(!se&&y.state.next({name:d,type:c.type,values:G(o)}),Sn)return(m.isValid||w.isValid)&&(t.mode==="onBlur"?se&&j():se||j()),Pn&&y.state.next({name:d,...jt?{}:St});if(!t.resolver&&e.validate&&await Ze({name:d,eventType:c.type}),!se&&jt&&y.state.next({...r}),t.resolver){const{errors:nr}=await I([d]);if(N([d]),v(ge),_){const $n=hr(r.errors,n,d),sr=hr(nr,n,$n.name||d);A=sr.error,d=sr.name,Q=re(nr)}}else N([d],!0),A=(await pr(b,i.disabled,o,S,t.shouldUseNativeValidation))[d],N([d]),v(ge),_&&(A?Q=!1:(m.isValid||w.isValid)&&(Q=await Z({fields:n,onlyCheckValid:!0,name:d,eventType:c.type})));_&&(b._f.deps&&(!Array.isArray(b._f.deps)||b._f.deps.length>0)&&_t(b._f.deps),we(d,Q,A,St))}},qt=(c,u)=>{if(k(r.errors,u)&&c.focus)return c.focus(),1},_t=async(c,u={})=>{let d,_;const b=qe(c);if(t.resolver){const v=await me(L(c)?c:b);d=re(v),_=c?!b.some(z=>k(v,z)):d}else c?(_=(await Promise.all(b.map(async v=>{const z=k(n,v);return await Z({fields:z&&z._f?{[v]:z}:z,eventType:Ae.TRIGGER})}))).every(Boolean),!(!_&&!r.isValid)&&j()):_=d=await Z({fields:n,name:c,eventType:Ae.TRIGGER});return y.state.next({...!ne(c)||(m.isValid||w.isValid)&&d!==r.isValid?{}:{name:c},...t.resolver||!c?{isValid:d}:{},errors:r.errors}),u.shouldFocus&&!_&&Ke(n,qt,c?b:i.mount),_},Kt=(c,u)=>{let d={...a.mount?o:s};return u&&(d=Mr(u.dirtyFields?r.dirtyFields:r.touchedFields,d)),L(c)?d:ne(c)?k(d,c):c.map(_=>k(d,_))},Ht=(c,u)=>({invalid:!!k((u||r).errors,c),isDirty:!!k((u||r).dirtyFields,c),error:k((u||r).errors,c),isValidating:!!k(r.validatingFields,c),isTouched:!!k((u||r).touchedFields,c)}),Gt=c=>{const u=c?qe(c):void 0;u==null||u.forEach(d=>W(r.errors,d)),u?u.forEach(d=>{y.state.next({name:d,errors:r.errors})}):y.state.next({errors:{}})},et=(c,u,d)=>{const _=(k(n,c,{_f:{}})._f||{}).ref,b=k(r.errors,c)||{},{ref:v,message:z,type:E,...A}=b;F(r.errors,c,{...A,...u,ref:_}),y.state.next({name:c,errors:r.errors,isValid:!1}),d&&d.shouldFocus&&_&&_.focus&&_.focus()},wn=(c,u)=>fe(c)?y.state.subscribe({next:d=>"values"in d&&c(X(void 0,u),d)}):X(c,u,!0),Yt=c=>y.state.subscribe({next:u=>{Yn(c.name,u.name,c.exact)&&Gn(u,c.formState||m,jn,c.reRenderRoot)&&c.callback({values:{...o},...r,...u,defaultValues:s})}}).unsubscribe,_n=c=>(a.mount=!0,w={...w,...c.formState},Yt({...c,formState:{...p,...c.formState}})),xt=(c,u={})=>{for(const d of c?qe(c):i.mount)i.mount.delete(d),i.array.delete(d),u.keepValue||(W(n,d),W(o,d)),!u.keepError&&W(r.errors,d),!u.keepDirty&&W(r.dirtyFields,d),!u.keepTouched&&W(r.touchedFields,d),!u.keepIsValidating&&W(r.validatingFields,d),!t.shouldUnregister&&!u.keepDefaultValue&&W(s,d);y.state.next({values:G(o)}),y.state.next({...r,...u.keepDirty?{isDirty:R()}:{}}),!u.keepIsValid&&j()},Xt=({disabled:c,name:u})=>{if(ye(c)&&a.mount||c||i.disabled.has(u)){const b=i.disabled.has(u)!==!!c;c?i.disabled.add(u):i.disabled.delete(u),b&&a.mount&&!a.action&&j()}},kt=(c,u={})=>{let d=k(n,c);const _=ye(u.disabled)||ye(t.disabled),b=!i.registerName.has(c)&&d&&!d._f.mount;return F(n,c,{...d||{},_f:{...d&&d._f?d._f:{ref:{name:c}},name:c,mount:!0,...u}}),i.mount.add(c),d&&!b?Xt({disabled:ye(u.disabled)?u.disabled:t.disabled,name:c}):B(c,!0,u.value),{..._?{disabled:u.disabled||t.disabled}:{},...t.progressive?{required:!!u.required,min:Je(u.min),max:Je(u.max),minLength:Je(u.minLength),maxLength:Je(u.maxLength),pattern:Je(u.pattern)}:{},name:c,onChange:Qe,onBlur:Qe,ref:v=>{if(v){i.registerName.add(c),kt(c,u),i.registerName.delete(c),d=k(n,c);const z=L(v.value)&&v.querySelectorAll&&v.querySelectorAll("input,select,textarea")[0]||v,E=Un(z),A=d._f.refs||[];if(E?A.find(Q=>Q===z):z===d._f.ref)return;F(n,c,{_f:{...d._f,...E?{refs:[...A.filter($t),z,...Array.isArray(k(s,c))?[{}]:[]],ref:{type:z.type,name:c}}:{ref:z}}}),B(c,!1,void 0,z)}else d=k(n,c,{}),d._f&&(d._f.mount=!1),(t.shouldUnregister||u.shouldUnregister)&&!(Cn(i.array,c)&&a.action)&&i.unMount.add(c)}}},zt=()=>t.shouldFocusError&&Ke(n,qt,i.mount),xn=c=>{ye(c)&&(y.state.next({disabled:c}),Ke(n,(u,d)=>{const _=k(n,d);_&&(u.disabled=_._f.disabled||c,Array.isArray(_._f.refs)&&_._f.refs.forEach(b=>{b.disabled=_._f.disabled||c}))},0,!1))},Qt=(c,u)=>async d=>{let _;d&&(d.preventDefault&&d.preventDefault(),d.persist&&d.persist());let b=G(o);if(y.state.next({isSubmitting:!0}),t.resolver){const{errors:v,values:z}=await I();N(),r.errors=v,b=G(z)}else await Z({fields:n,eventType:Ae.SUBMIT});if(i.disabled.size)for(const v of i.disabled)W(b,v);if(W(r.errors,Ur),re(r.errors)){y.state.next({errors:{}});try{await c(b,d)}catch(v){_=v}}else u&&await u({...r.errors},d),zt(),setTimeout(zt);if(y.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:re(r.errors)&&!_,submitCount:r.submitCount+1,errors:r.errors}),_)throw _},kn=(c,u={})=>{k(n,c)&&(L(u.defaultValue)?_e(c,G(k(s,c))):(_e(c,u.defaultValue),F(s,c,G(u.defaultValue))),u.keepTouched||W(r.touchedFields,c),u.keepDirty||(W(r.dirtyFields,c),r.isDirty=u.defaultValue?R(c,G(k(s,c))):R()),u.keepError||(W(r.errors,c),m.isValid&&j()),y.state.next({...r}))},er=(c,u={})=>{const d=c?G(c):s,_=G(d),b=re(c),v=b?s:_;if(u.keepDefaultValues||(s=d),!u.keepValues){if(u.keepDirtyValues){const z=new Set([...i.mount,...Object.keys(Be(s,o))]);for(const E of Array.from(z)){const A=k(r.dirtyFields,E),Q=k(o,E),ge=k(v,E);A&&!L(Q)?F(v,E,Q):!A&&!L(ge)&&_e(E,ge)}}else{if(Ct&&L(c))for(const z of i.mount){const E=k(n,z);if(E&&E._f){const A=Array.isArray(E._f.refs)?E._f.refs[0]:E._f.ref;if(ot(A)){const Q=A.closest("form");if(Q){Q.reset();break}}}}if(u.keepFieldsRef)for(const z of i.mount)_e(z,k(v,z));else n={}}o=t.shouldUnregister?u.keepDefaultValues?G(s):{}:G(v),y.array.next({values:{...v}}),y.state.next({values:{...v}})}i={mount:u.keepDirtyValues?i.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!m.isValid||!!u.keepIsValid||!!u.keepDirtyValues||!t.shouldUnregister&&!re(v),a.watch=!!t.shouldUnregister,a.keepIsValid=!!u.keepIsValid,a.action=!1,u.keepErrors||(r.errors={}),y.state.next({submitCount:u.keepSubmitCount?r.submitCount:0,isDirty:b?!1:u.keepDirty?r.isDirty:!!(u.keepDefaultValues&&!ke(c,s)),isSubmitted:u.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:b?{}:u.keepDirtyValues?u.keepDefaultValues&&o?Be(s,o):r.dirtyFields:u.keepDefaultValues&&c?Be(s,c):u.keepDirty?r.dirtyFields:{},touchedFields:u.keepTouched?r.touchedFields:{},errors:u.keepErrors?r.errors:{},isSubmitSuccessful:u.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:s})},tr=(c,u)=>er(fe(c)?c(o):c,{...t.resetOptions,...u}),zn=(c,u={})=>{const d=k(n,c),_=d&&d._f;if(_){const b=_.refs?_.refs[0]:_.ref;b.focus&&setTimeout(()=>{b.focus(),u.shouldSelect&&fe(b.select)&&b.select()})}},jn=c=>{r={...r,...c}},rr={control:{register:kt,unregister:xt,getFieldState:Ht,handleSubmit:Qt,setError:et,_subscribe:Yt,_runSchema:I,_updateIsValidating:N,_focusError:zt,_getWatch:X,_getDirty:R,_setValid:j,_setFieldArray:M,_setDisabledField:Xt,_setErrors:O,_getFieldArray:pe,_reset:er,_resetDefaultValues:()=>fe(t.defaultValues)&&t.defaultValues().then(c=>{tr(c,t.resetOptions),y.state.next({isLoading:!1})}),_removeUnmounted:D,_disableForm:xn,_subjects:y,_proxyFormState:m,get _fields(){return n},get _formValues(){return o},get _state(){return a},set _state(c){a=c},get _defaultValues(){return s},get _names(){return i},set _names(c){i=c},get _formState(){return r},get _options(){return t},set _options(c){t={...t,...c}}}
1,subscribe:_n,trigger:_t,register:kt,handleSubmit:Qt,watch:wn,setValue:_e,getValues:Kt,reset:tr,resetField:kn,clearErrors:Gt,unregister:xt,setError:et,setFocus:zn,getFieldState:Ht};return{...rr,formControl:rr}}function ft(e={}){const t=te.useRef(void 0),r=te.useRef(void 0),[n,s]=te.useState({isDirty:!1,isValidating:!1,isLoading:fe(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:fe(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:n},e.defaultValues&&!fe(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:a,...i}=rs(e);t.current={...i,formState:n}}const o=t.current.control;return o._options=e,Rn(()=>{const a=o._subscribe({formState:o._proxyFormState,callback:()=>s({...o._formState}),reRenderRoot:!0});return s(i=>({...i,isReady:!0})),o._formState.isReady=!0,a},[o]),te.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),te.useEffect(()=>{e.mode&&(o._options.mode=e.mode),e.reValidateMode&&(o._options.reValidateMode=e.reValidateMode)},[o,e.mode,e.reValidateMode]),te.useEffect(()=>{e.errors&&(o._setErrors(e.errors),o._focusError())},[o,e.errors]),te.useEffect(()=>{e.shouldUnregister&&o._subjects.state.next({values:o._getWatch()})},[o,e.shouldUnregister]),te.useEffect(()=>{if(o._proxyFormState.isDirty){const a=o._getDirty();a!==n.isDirty&&o._subjects.state.next({isDirty:a})}},[o,n.isDirty]),te.useEffect(()=>{var a;e.values&&!ke(e.values,r.current)?(o._reset(e.values,{keepFieldsRef:!0,...o._options.resetOptions}),!((a=o._options.resetOptions)===null||a===void 0)&&a.keepIsValid||o._setValid(),r.current=e.values,s(i=>({...i}))):o._resetDefaultValues()},[o,e.values]),te.useEffect(()=>{o._state.mount||(o._setValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),t.current.formState=te.useMemo(()=>In(n,o),[o,n]),t.current}const gr=(e,t,r)=>{if(e&&"reportValidity"in e){const n=k(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},Et=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?gr(n.ref,r,e):n&&n.refs&&n.refs.forEach(s=>gr(s,r,e))}},yr=(e,t)=>{t.shouldUseNativeValidation&&Et(e,t);const r={};for(const n in e){const s=k(t.fields,n),o=Object.assign(e[n]||{},{ref:s&&s.ref});if(ns(t.names||Object.keys(e),n)){const a=Object.assign({},k(r,n));F(a,"root",o),F(r,n,a)}else F(r,n,o)}return r},ns=(e,t)=>{const r=vr(t);return e.some(n=>vr(n).match(`^${r}\\.\\d+`))};function vr(e){return e.replace(/\]|\[/g,"")}function g(e,t,r){function n(i,f){if(i._zod||Object.defineProperty(i,"_zod",{value:{def:f,constr:a,traits:new Set},enumerable:!1}),i._zod.traits.has(e))return;i._zod.traits.add(e),t(i,f);const h=a.prototype,p=Object.keys(h);for(let m=0;m<p.length;m++){const w=p[m];w in i||(i[w]=h[w].bind(i))}}const s=(r==null?void 0:r.Parent)??Object;class o extends s{}Object.defineProperty(o,"name",{value:e});function a(i){var f;const h=r!=null&&r.Parent?new o:this;n(h,i),(f=h._zod).deferred??(f.deferred=[]);for(const p of h._zod.deferred)p();return h}return Object.defineProperty(a,"init",{value:n}),Object.defineProperty(a,Symbol.hasInstance,{value:i=>{var f,h;return r!=null&&r.Parent&&i instanceof r.Parent?!0:(h=(f=i==null?void 0:i._zod)==null?void 0:f.traits)==null?void 0:h.has(e)}}),Object.defineProperty(a,"name",{value:e}),a}class De extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class Hr extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const Gr={};function Ne(e){return Gr}function Yr(e){const t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,s])=>t.indexOf(+n)===-1).map(([n,s])=>s)}function Zt(e,t){return typeof t=="bigint"?t.toString():t}function Lt(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function Ut(e){return e==null}function Mt(e){const t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}const br=Symbol("evaluating");function C(e,t,r){let n;
vendor: 7,867 bytes, line 1
1Object.defineProperty(e,t,{get(){if(n!==br)return n===void 0&&(n=br,n=r()),n},set(s){Object.defineProperty(e,t,{value:s})},configurable:!0})}function Ee(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function je(...e){const t={};for(const r of e){const n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function wr(e){return JSON.stringify(e)}function ss(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Xr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function it(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const os=Lt(()=>{var e;if(typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function Ge(e){if(it(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const r=t.prototype;return!(it(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function Qr(e){return Ge(e)?{...e}:Array.isArray(e)?[...e]:e}const as=new Set(["string","number","symbol"]);function Fe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Se(e,t,r){const n=new e._zod.constr(t??e._zod.def);return(!t||r!=null&&r.parent)&&(n._zod.parent=e),n}function $(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function is(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function cs(e,t){const r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const o=je(e._zod.def,{get shape(){const a={};for(const i in t){if(!(i in r.shape))throw new Error(`Unrecognized key: "${i}"`);t[i]&&(a[i]=r.shape[i])}return Ee(this,"shape",a),a},checks:[]});return Se(e,o)}function us(e,t){const r=e._zod.def,n=r.checks;if(n&&n.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const o=je(e._zod.def,{get shape(){const a={...e._zod.def.shape};for(const i in t){if(!(i in r.shape))throw new Error(`Unrecognized key: "${i}"`);t[i]&&delete a[i]}return Ee(this,"shape",a),a},checks:[]});return Se(e,o)}function ls(e,t){if(!Ge(t))throw new Error("Invalid input to extend: expected a plain object");const r=e._zod.def.checks;if(r&&r.length>0){const o=e._zod.def.shape;for(const a in t)if(Object.getOwnPropertyDescriptor(o,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const s=je(e._zod.def,{get shape(){const o={...e._zod.def.shape,...t};return Ee(this,"shape",o),o}});return Se(e,s)}function ds(e,t){if(!Ge(t))throw new Error("Invalid input to safeExtend: expected a plain object");const r=je(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t};return Ee(this,"shape",n),n}});return Se(e,r)}function fs(e,t){const r=je(e._zod.def,{get shape(){const n={...e._zod.def.shape,...t._zod.def.shape};return Ee(this,"shape",n),n},get catchall(){return t._zod.def.catchall},checks:[]});return Se(e,r)}function hs(e,t,r){const s=t._zod.def.checks;if(s&&s.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const a=je(t._zod.def,{get shape(){const i=t._zod.def.shape,f={...i};if(r)for(const h in r){if(!(h in i))throw new Error(`Unrecognized key: "${h}"`);r[h]&&(f[h]=e?new e({type:"optional",innerType:i[h]}):i[h])}else for(const h in i)f[h]=e?new e({type:"optional",innerType:i[h]}):i[h];return Ee(this,"shape",f),f},checks:[]});return Se(t,a)}function ms(e,t,r){const n=je(t._zod.def,{get shape(){const s=t._zod.def.shape,o={...s};if(r)for(const a in r){if(!(a in o))throw new Error(`Unrecognized key: "${a}"`);r[a]&&(o[a]=new e({type:"nonoptional",innerType:s[a]}))}else for(const a in s)o[a]=new e({type:"nonoptional",innerType:s[a]});return Ee(this,"shape",o),o}});return Se(t,n)}function Ce(e,t=0){var r;if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(((r=e.issues[n])==null?void 0:r.continue)!==!0)return!0;return!1}function en(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function tt(e){return typeof e=="string"?e:e==null?void 0:e.message}function Oe(e,t,r){var s,o,a,i,f,h;const n={...e,path:e.path??[]};if(!e.message){const p=tt((a=(o=(s=e.inst)==null?void 0:s._zod.def)==null?void 0:o.error)==null?void 0:a.call(o,e))??tt((i=t==null?void 0:t.error)==null?void 0:i.call(t,e))??tt((f=r.customError)==null?void 0:f.call(r,e))??tt((h=r.localeError)==null?void 0:h.call(r,e))??"Invalid input";n.message=p}return delete n.inst,delete n.continue,t!=null&&t.reportInput||delete n.input,n}function Jt(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Ye(...e){const[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}const tn=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Zt,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Bt=g("$ZodError",tn),ht=g("$ZodError",tn,{Parent:Error});function ps(e,t=r=>r.message){const r={},n=[];for(const s of e.issues)s.path.length>0?(r[s.path[0]]=r[s.path[0]]||[],r[s.path[0]].push(t(s))):n.push(t(s));return{formErrors:n,fieldErrors:r}}function gs(e,t=r=>r.message){const r={_errors:[]},n=s=>{for(const o of s.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(a=>n({issues:a}));else if(o.code==="invalid_key")n({issues:o.issues});else if(o.code==="invalid_element")n({issues:o.issues});else if(o.path.length===0)r._errors.push(t(o));else{let a=r,i=0;for(;i<o.path.length;){const f=o.path[i];i===o.path.length-1?(a[f]=a[f]||{_errors:[]},a[f]._errors.push(t(o))):a[f]=a[f]||{_errors:[]},a=a[f],i++}}};return n(e),r}const mt=e=>(t,r,n,s)=>{const o=n?Object.assign(n,{async:!1}):{async:!1},a=t._zod.run({value:r,issues:[]},o);if(a instanceof Promise)throw new De;if(a.issues.length){const i=new((s==null?void 0:s.Err)??e)(a.issues.map(f=>Oe(f,o,Ne())));throw Xr(i,s==null?void 0:s.callee),i}return a.value},ys=mt(ht),pt=e=>async(t,r,n,s)=>{const o=n?Object.assign(n,{async:!0}):{async:!0};let a=t._zod.run({value:r,issues:[]},o);if(a instanceof Promise&&(a=await a),a.issues.length){const i=new((s==null?void 0:s.Err)??e)(a.issues.map(f=>Oe(f,o,Ne())));throw Xr(i,s==null?void 0:s.callee),i}return a.value},vs=pt(ht),gt=e=>(t,r,n)=>{const s=n?{...n,async:!1}:{async:!1},o=t._zod.run({value:r,issues:[]},s);if(o instanceof Promise)throw new De;return o.issues.length?{success:!1,error:new(e??Bt)(o.issues.map(a=>Oe(a,s,Ne())))}:{success:!0,data:o.value}},bs=gt(ht),yt=e=>async(t,r,n)=>{const s=n?Object.assign(n,{async:!0}):{async:!0};let o=t._zod.run({value:r,issues:[]},s);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(a=>Oe(a,s,Ne())))}:{success:!0,data:o.value}},ws=yt(ht),_s=e=>(t,r,n)=>{const s=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return mt(e)(t,r,s)},xs=e=>(t,r,n)=>mt(e)(t,r,n),ks=e=>async(t,r,n)=>{const s=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return pt(e)(t,r,s)},zs=e=>async(t,r,n)=>pt(e)(t,r,n),js=e=>(t,r,n)=>{const s=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return gt(e)(t,r,s)},Ss=e=>(t,r,n)=>gt(e)(t,r,n),Ps=e=>async(t,r,n)=>{const s=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return yt(e)(t,r,s)},$s=e=>async(t,r,n)=>yt(e)(t,r,n),Ns=/^[cC][^\s-]{8,}
vendor: 4,173 bytes, line 1
1$/,Os=/^[0-9a-z]+$/,Es=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Zs=/^[0-9a-vA-V]{20}$/,As=/^[A-Za-z0-9]{27}$/,Ts=/^[a-zA-Z0-9_-]{21}$/,Cs=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Ds=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,_r=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Fs=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Is="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Rs(){return new RegExp(Is,"u")}const Vs=/^(?:(?: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])$/,Ls=/^(([0-9a-fA-F]{1,4}:){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}|:))$/,Us=/^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/,Ms=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Js=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,rn=/^[A-Za-z0-9_-]*$/,Bs=/^\+[1-9]\d{6,14}$/,nn="(?:(?:\\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])))",Ws=new RegExp(`^${nn}$`);function sn(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function qs(e){return new RegExp(`^${sn(e)}$`)}function Ks(e){const t=sn({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const n=`${t}(?:${r.join("|")})`;return new RegExp(`^${nn}T(?:${n})$`)}const Hs=e=>{const t=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Gs=/^[^A-Z]*$/,Ys=/^[^a-z]*$/,ve=g("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Xs=g("$ZodCheckMaxLength",(e,t)=>{var r;ve.init(e,t),(r=e._zod.def).when??(r.when=n=>{const s=n.value;return!Ut(s)&&s.length!==void 0}),e._zod.onattach.push(n=>{const s=n._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<s&&(n._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{const s=n.value;if(s.length<=t.maximum)return;const a=Jt(s);n.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),Qs=g("$ZodCheckMinLength",(e,t)=>{var r;ve.init(e,t),(r=e._zod.def).when??(r.when=n=>{const s=n.value;return!Ut(s)&&s.length!==void 0}),e._zod.onattach.push(n=>{const s=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>s&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{const s=n.value;if(s.length>=t.minimum)return;const a=Jt(s);n.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:s,inst:e,continue:!t.abort})}}),eo=g("$ZodCheckLengthEquals",(e,t)=>{var r;ve.init(e,t),(r=e._zod.def).when??(r.when=n=>{const s=n.value;return!Ut(s)&&s.length!==void 0}),e._zod.onattach.push(n=>{const s=n._zod.bag;s.minimum=t.length,s.maximum=t.length,s.length=t.length}),e._zod.check=n=>{const s=n.value,o=s.length;if(o===t.length)return;const a=Jt(s),i=o>t.length;n.issues.push({origin:a,...i?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),vt=g("$ZodCheckStringFormat",(e,t)=>{var r,n;ve.init(e,t),e._zod.onattach.push(s=>
vendor: 34,476 bytes, lines 1-39
1{const o=s._zod.bag;o.format=t.format,t.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=s=>{t.pattern.lastIndex=0,!t.pattern.test(s.value)&&s.issues.push({origin:"string",code:"invalid_format",format:t.format,input:s.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),to=g("$ZodCheckRegex",(e,t)=>{vt.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),ro=g("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Gs),vt.init(e,t)}),no=g("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Ys),vt.init(e,t)}),so=g("$ZodCheckIncludes",(e,t)=>{ve.init(e,t);const r=Fe(t.includes),n=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(s=>{const o=s._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=s=>{s.value.includes(t.includes,t.position)||s.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:s.value,inst:e,continue:!t.abort})}}),oo=g("$ZodCheckStartsWith",(e,t)=>{ve.init(e,t);const r=new RegExp(`^${Fe(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{const s=n._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),ao=g("$ZodCheckEndsWith",(e,t)=>{ve.init(e,t);const r=new RegExp(`.*${Fe(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(n=>{const s=n._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),io=g("$ZodCheckOverwrite",(e,t)=>{ve.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}});class co{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const n=t.split(` 2`).filter(a=>a),s=Math.min(...n.map(a=>a.length-a.trimStart().length)),o=n.map(a=>a.slice(s)).map(a=>" ".repeat(this.indent*2)+a);for(const a of o)this.content.push(a)}compile(){const t=Function,r=this==null?void 0:this.args,s=[...((this==null?void 0:this.content)??[""]).map(o=>` ${o}`)];return new t(...r,s.join(` 3`))}}const uo={major:4,minor:3,patch:6},K=g("$ZodType",(e,t)=>{var s;var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=uo;const n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(const o of n)for(const a of o._zod.onattach)a(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),(s=e._zod.deferred)==null||s.push(()=>{e._zod.run=e._zod.parse});else{const o=(i,f,h)=>{let p=Ce(i),m;for(const w of f){if(w._zod.def.when){if(!w._zod.def.when(i))continue}else if(p)continue;const y=i.issues.length,S=w._zod.check(i);if(S instanceof Promise&&(h==null?void 0:h.async)===!1)throw new De;if(m||S instanceof Promise)m=(m??Promise.resolve()).then(async()=>{await S,i.issues.length!==y&&(p||(p=Ce(i,y)))});else{if(i.issues.length===y)continue;p||(p=Ce(i,y))}}return m?m.then(()=>i):i},a=(i,f,h)=>{if(Ce(i))return i.aborted=!0,i;const p=o(f,n,h);if(p instanceof Promise){if(h.async===!1)throw new De;return p.then(m=>e._zod.parse(m,h))}return e._zod.parse(p,h)};e._zod.run=(i,f)=>{if(f.skipChecks)return e._zod.parse(i,f);if(f.direction==="backward"){const p=e._zod.parse({value:i.value,issues:[]},{...f,skipChecks:!0});return p instanceof Promise?p.then(m=>a(m,i,f)):a(p,i,f)}const h=e._zod.parse(i,f);if(h instanceof Promise){if(f.async===!1)throw new De;return h.then(p=>o(p,n,f))}return o(h,n,f)}}C(e,"~standard",()=>({validate:o=>{var a;try{const i=bs(e,o);return i.success?{value:i.data}:{issues:(a=i.error)==null?void 0:a.issues}}catch{return ws(e,o).then(f=>{var h;return f.success?{value:f.data}:{issues:(h=f.error)==null?void 0:h.issues}})}},vendor:"zod",version:1}))}),Wt=g("$ZodString",(e,t)=>{var r;K.init(e,t),e._zod.pattern=[...((r=e==null?void 0:e._zod.bag)==null?void 0:r.patterns)??[]].pop()??Hs(e._zod.bag),e._zod.parse=(n,s)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),V=g("$ZodStringFormat",(e,t)=>{vt.init(e,t),Wt.init(e,t)}),lo=g("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Ds),V.init(e,t)}),fo=g("$ZodUUID",(e,t)=>{if(t.version){const n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(n===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=_r(n))}else t.pattern??(t.pattern=_r());V.init(e,t)}),ho=g("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Fs),V.init(e,t)}),mo=g("$ZodURL",(e,t)=>{V.init(e,t),e._zod.check=r=>{try{const n=r.value.trim(),s=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(s.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(s.protocol.endsWith(":")?s.protocol.slice(0,-1):s.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=s.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),po=g("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Rs()),V.init(e,t)}),go=g("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Ts),V.init(e,t)}),yo=g("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Ns),V.init(e,t)}),vo=g("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Os),V.init(e,t)}),bo=g("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Es),V.init(e,t)}),wo=g("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Zs),V.init(e,t)}),_o=g("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=As),V.init(e,t)}),xo=g("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Ks(t)),V.init(e,t)}),ko=g("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Ws),V.init(e,t)}),zo=g("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=qs(t)),V.init(e,t)}),jo=g("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=Cs),V.init(e,t)}),So=g("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Vs),V.init(e,t),e._zod.bag.format="ipv4"}),Po=g("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Ls),V.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),$o=g("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Us),V.init(e,t)}),No=g("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Ms),V.init(e,t),e._zod.check=r=>{const n=r.value.split("/");try{if(n.length!==2)throw new Error;const[s,o]=n;if(!o)throw new Error;const a=Number(o);if(`${a}`!==o)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${s}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function on(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const Oo=g("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Js),V.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{on(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function Eo(e){if(!rn.test(e))return!1;const t=e.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return on(r)}const Zo=g("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=rn),V.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{Eo(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Ao=g("$ZodE164",(e,t)=>{t.pattern??(t.pattern=Bs),V.init(e,t)});function To(e,t=null){try{const r=e.split(".");if(r.length!==3)return!1;const[n]=r;if(!n)return!1;const s=JSON.parse(atob(n));return!("typ"in s&&(s==null?void 0:s.typ)!=="JWT"||!s.alg||t&&(!("alg"in s)||s.alg!==t))}catch{return!1}}const Co=g("$ZodJWT",(e,t)=>{V.init(e,t),e._zod.check=r=>{To(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),Do=g("$ZodUnknown",(e,t)=>{K.init(e,t),e._zod.parse=r=>r}),Fo=g("$ZodNever",(e,t)=>{K.init(e,t),e._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)});function xr(e,t,r){e.issues.length&&t.issues.push(...en(r,e.issues)),t.value[r]=e.value}const Io=g("$ZodArray",(e,t)=>{K.init(e,t),e._zod.parse=(r,n)=>{const s=r.value;if(!Array.isArray(s))return r.issues.push({expected:"array",code:"invalid_type",input:s,inst:e}),r;r.value=Array(s.length);const o=[];for(let a=0;a<s.length;a++){const i=s[a],f=t.element._zod.run({value:i,issues:[]},n);f instanceof Promise?o.push(f.then(h=>xr(h,r,a))):xr(f,r,a)}return o.length?Promise.all(o).then(()=>r):r}});function ct(e,t,r,n,s){if(e.issues.length){if(s&&!(r in n))return;t.issues.push(...en(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}function an(e){var n,s,o,a;const t=Object.keys(e.shape);for(const i of t)if(!((a=(o=(s=(n=e.shape)==null?void 0:n[i])==null?void 0:s._zod)==null?void 0:o.traits)!=null&&a.has("$ZodType")))throw new Error(`Invalid element at key "${i}": expected a Zod schema`);const r=is(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function cn(e,t,r,n,s,o){const a=[],i=s.keySet,f=s.catchall._zod,h=f.def.type,p=f.optout==="optional";for(const m in t){if(i.has(m))continue;if(h==="never"){a.push(m);continue}const w=f.run({value:t[m],issues:[]},n);w instanceof Promise?e.push(w.then(y=>ct(y,r,m,t,p))):ct(w,r,m,t,p)}return a.length&&r.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:o}),e.length?Promise.all(e).then(()=>r):r}const Ro=g("$ZodObject",(e,t)=>{K.init(e,t);const r=Object.getOwnPropertyDescriptor(t,"shape");if(!(r!=null&&r.get)){const i=t.shape;Object.defineProperty(t,"shape",{get:()=>{const f={...i};return Object.defineProperty(t,"shape",{value:f}),f}})}const n=Lt(()=>an(t));C(e._zod,"propValues",()=>{const i=t.shape,f={};for(const h in i){const p=i[h]._zod;if(p.values){f[h]??(f[h]=new Set);for(const m of p.values)f[h].add(m)}}return f});const s=it,o=t.catchall;let a;e._zod.parse=(i,f)=>{a??(a=n.value);const h=i.value;if(!s(h))return i.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),i;i.value={};const p=[],m=a.shape;for(const w of a.keys){const y=m[w],S=y._zod.optout==="optional",P=y._zod.run({value:h[w],issues:[]},f);P instanceof Promise?p.push(P.then(j=>ct(j,i,w,h,S))):ct(P,i,w,h,S)}return o?cn(p,h,i,f,n.value,e):p.length?Promise.all(p).then(()=>i):i}}),Vo=g("$ZodObjectJIT",(e,t)=>{Ro.init(e,t);const r=e._zod.parse,n=Lt(()=>an(t)),s=w=>{var M;const y=new co(["shape","payload","ctx"]),S=n.value,P=T=>{const O=wr(T);return`shape[${O}]._zod.run({ value: input[${O}], issues: [] }, ctx)`};y.write("const input = payload.value;");const j=Object.create(null);let N=0;for(const T of S.keys)j[T]=`key_${N++}`;y.write("const newResult = {};");for(const T of S.keys){const O=j[T],B=wr(T),ie=w[T],we=((M=ie==null?void 0:ie._zod)==null?void 0:M.optout)==="optional";y.write(`const ${O} = ${P(T)};`),we?y.write(` 4 if (${O}.issues.length) { 5 if (${B} in input) { 6 payload.issues = payload.issues.concat(${O}.issues.map(iss => ({ 7 ...iss, 8 path: iss.path ? [${B}, ...iss.path] : [${B}] 9 }))); 10 } 11 } 12 13 if (${O}.value === undefined) { 14 if (${B} in input) { 15 newResult[${B}] = undefined; 16 } 17 } else { 18 newResult[${B}] = ${O}.value; 19 } 20 21 `):y.write(` 22 if (${O}.issues.length) { 23 payload.issues = payload.issues.concat(${O}.issues.map(iss => ({ 24 ...iss, 25 path: iss.path ? [${B}, ...iss.path] : [${B}] 26 }))); 27 } 28 29 if (${O}.value === undefined) { 30 if (${B} in input) { 31 newResult[${B}] = undefined; 32 } 33 } else { 34 newResult[${B}] = ${O}.value; 35 } 36 37 `)}y.write("payload.value = newResult;"),y.write("return payload;");const x=y.compile();return(T,O)=>x(w,T,O)};let o;const a=it,i=!Gr.jitless,h=i&&os.value,p=t.catchall;let m;e._zod.parse=(w,y)=>{m??(m=n.value);const S=w.value;return a(S)?i&&h&&(y==null?void 0:y.async)===!1&&y.jitless!==!0?(o||(o=s(t.shape)),w=o(w,y),p?cn([],S,w,y,m,e):w):r(w,y):(w.issues.push({expected:"object",code:"invalid_type",input:S,inst:e}),w)}});function kr(e,t,r,n){for(const o of e)if(o.issues.length===0)return t.value=o.value,t;const s=e.filter(o=>!Ce(o));return s.length===1?(t.value=s[0].value,s[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(o=>o.issues.map(a=>Oe(a,n,Ne())))}),t)}const Lo=g("$ZodUnion",(e,t)=>{K.init(e,t),C(e._zod,"optin",()=>t.options.some(s=>s._zod.optin==="optional")?"optional":void 0),C(e._zod,"optout",()=>t.options.some(s=>s._zod.optout==="optional")?"optional":void 0),C(e._zod,"values",()=>{if(t.options.every(s=>s._zod.values))return new Set(t.options.flatMap(s=>Array.from(s._zod.values)))}),C(e._zod,"pattern",()=>{if(t.options.every(s=>s._zod.pattern)){const s=t.options.map(o=>o._zod.pattern);return new RegExp(`^(${s.map(o=>Mt(o.source)).join("|")})$`)}});const r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(s,o)=>{if(r)return n(s,o);let a=!1;const i=[];for(const f of t.options){const h=f._zod.run({value:s.value,issues:[]},o);if(h instanceof Promise)i.push(h),a=!0;else{if(h.issues.length===0)return h;i.push(h)}}return a?Promise.all(i).then(f=>kr(f,s,e,o)):kr(i,s,e,o)}}),Uo=g("$ZodIntersection",(e,t)=>{K.init(e,t),e._zod.parse=(r,n)=>{const s=r.value,o=t.left._zod.run({value:s,issues:[]},n),a=t.right._zod.run({value:s,issues:[]},n);return o instanceof Promise||a instanceof Promise?Promise.all([o,a]).then(([f,h])=>zr(r,f,h)):zr(r,o,a)}});function At(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Ge(e)&&Ge(t)){const r=Object.keys(t),n=Object.keys(e).filter(o=>r.indexOf(o)!==-1),s={...e,...t};for(const o of n){const a=At(e[o],t[o]);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};s[o]=a.data}return{valid:!0,data:s}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const r=[];for(let n=0;n<e.length;n++){const s=e[n],o=t[n],a=At(s,o);if(!a.valid)return{valid:!1,mergeErrorPath:[n,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function zr(e,t,r){const n=new Map;let s;for(const i of t.issues)if(i.code==="unrecognized_keys"){s??(s=i);for(const f of i.keys)n.has(f)||n.set(f,{}),n.get(f).l=!0}else e.issues.push(i);for(const i of r.issues)if(i.code==="unrecognized_keys")for(const f of i.keys)n.has(f)||n.set(f,{}),n.get(f).r=!0;else e.issues.push(i);const o=[...n].filter(([,i])=>i.l&&i.r).map(([i])=>i);if(o.length&&s&&e.issues.push({...s,keys:o}),Ce(e))return e;const a=At(t.value,r.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}const Mo=g("$ZodEnum",(e,t)=>{K.init(e,t);const r=Yr(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(s=>as.has(typeof s)).map(s=>typeof s=="string"?Fe(s):s.toString()).join("|")})$`),e._zod.parse=(s,o)=>{const a=s.value;return n.has(a)||s.issues.push({code:"invalid_value",values:r,input:a,inst:e}),s}}),Jo=g("$ZodLiteral",(e,t)=>{if(K.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?Fe(n):n?Fe(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,s)=>{const o=n.value;return r.has(o)||n.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),n}}),Bo=g("$ZodTransform",(e,t)=>{K.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Hr(e.constructor.name);const s=t.transform(r.value,r);if(n.async)return(s instanceof Promise?s:Promise.resolve(s)).then(a=>(r.value=a,r));if(s instanceof Promise)throw new De;return r.value=s,r}});function jr(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}const un=g("$ZodOptional",(e,t)=>{K.init(e,t),e._zod.optin="optional",e._zod.optout="optional",C(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),C(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${Mt(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){const s=t.innerType._zod.run(r,n);return s instanceof Promise?s.then(o=>jr(o,r.value)):jr(s,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}}),Wo=g("$ZodExactOptional",(e,t)=>{un.init(e,t),C(e._zod,"values",()=>t.innerType._zod.values),C(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,n)=>t.innerType._zod.run(r,n)}),qo=g("$ZodNullable",(e,t)=>{K.init(e,t),C(e._zod,"optin",()=>t.innerType._zod.optin),C(e._zod,"optout",()=>t.innerType._zod.optout),C(e._zod,"pattern",()=>{const r=t.innerType._zod.pattern;return r?new RegExp(`^(${Mt(r.source)}|null)$`):void 0}),C(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)}),Ko=g("$ZodDefault",(e,t)=>{K.init(e,t),e._zod.optin="optional",C(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);if(r.value===void 0)return r.value=t.defaultValue,r;const s=t.innerType._zod.run(r,n);return s instanceof Promise?s.then(o=>Sr(o,t)):Sr(s,t)}});function Sr(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const Ho=g("$ZodPrefault",(e,t)=>{K.init(e,t),e._zod.optin="optional",C(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>(n.direction==="backward"||r.value===void 0&&(r.value=t.defaultValue),t.innerType._zod.run(r,n))}),Go=g("$ZodNonOptional",(e,t)=>{K.init(e,t),C(e._zod,"values",()=>{const r=t.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),e._zod.parse=(r,n)=>{const s=t.innerType._zod.run(r,n);return s instanceof Promise?s.then(o=>Pr(o,e)):Pr(s,e)}});function Pr(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const Yo=g("$ZodCatch",(e,t)=>{K.init(e,t),C(e._zod,"optin",()=>t.innerType._zod.optin),C(e._zod,"optout",()=>t.innerType._zod.optout),C(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const s=t.innerType._zod.run(r,n);return s instanceof Promise?s.then(o=>(r.value=o.value,o.issues.length&&(r.value=t.catchValue({...r,error:{issues:o.issues.map(a=>Oe(a,n,Ne()))},input:r.value}),r.issues=[]),r)):(r.value=s.value,s.issues.length&&(r.value=t.catchValue({...r,error:{issues:s.issues.map(o=>Oe(o,n,Ne()))},input:r.value}),r.issues=[]),r)}}),Xo=g("$ZodPipe",(e,t)=>{K.init(e,t),C(e._zod,"values",()=>t.in._zod.values),C(e._zod,"optin",()=>t.in._zod.optin),C(e._zod,"optout",()=>t.out._zod.optout),C(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){const o=t.out._zod.run(r,n);return o instanceof Promise?o.then(a=>rt(a,t.in,n)):rt(o,t.in,n)}const s=t.in._zod.run(r,n);return s instanceof Promise?s.then(o=>rt(o,t.out,n)):rt(s,t.out,n)}});function rt(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}const Qo=g("$ZodReadonly",(e,t)=>{K.init(e,t),C(e._zod,"propValues",()=>t.innerType._zod.propValues),C(e._zod,"values",()=>t.innerType._zod.values),C(e._zod,"optin",()=>{var r,n;return(n=(r=t.innerType)==null?void 0:r._zod)==null?void 0:n.optin}),C(e._zod,"optout",()=>{var r,n;return(n=(r=t.innerType)==null?void 0:r._zod)==null?void 0:n.optout}),e._zod.parse=(r,n)=>{if(n.direction==="backward")return t.innerType._zod.run(r,n);const s=t.innerType._zod.run(r,n);return s instanceof Promise?s.then($r):$r(s)}});function $r(e){return e.value=Object.freeze(e.value),e}const ea=g("$ZodCustom",(e,t)=>{ve.init(e,t),K.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{const n=r.value,s=t.fn(n);if(s instanceof Promise)return s.then(o=>Nr(o,r,n,e));Nr(s,r,n,e)}});function Nr(e,t,r,n){if(!e){const s={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(s.params=n._zod.def.params),t.issues.push(Ye(s))}}var Or;class ta{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){const n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){const r=t._zod.parent;if(r){const n={...this.get(r)??{}};delete n.id;const s={...n,...this._map.get(t)};return Object.keys(s).length?s:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function ra(){return new ta}(Or=globalThis).__zod_globalRegistry??(Or.__zod_globalRegistry=ra());const We=globalThis.__zod_globalRegistry;function na(e,t){return new e({type:"string",...$(t)})}function sa(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...$(t)})}function Er(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...$(t)})}function oa(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...$(t)})}function aa(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...$(t)})}function ia(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...$(t)})}function ca(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...$(t)})}function ua(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...$(t)})}function la(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...$(t)})}function da(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...$(t)})}function fa(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...$(t)})}function ha(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...$(t)})}function ma(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...$(t)})}function pa(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...$(t)})}function ga(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...$(t)})}function ya(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...$(t)})}function va(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...$(t)})}function ba(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...$(t)})}function wa(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...$(t)})}function _a(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...$(t)})}function xa(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...$(t)})}function ka(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...$(t)})}function za(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...$(t)})}function ja(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...$(t)})}function Sa(e,t){return new e({type:"string",format:"date",check:"string_format",...$(t)})}function Pa(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...$(t)})}function $a(e,t){return new e({type:"string",format:"duration",check:"string_format",...$(t)})}function Na(e){return new e({type:"unknown"})}function Oa(e,t){return new e({type:"never",...$(t)})}function ln(e,t){return new Xs({check:"max_length",...$(t),maximum:e})}function ut(e,t){return new Qs({check:"min_length",...$(t),minimum:e})}function dn(e,t){return new eo({check:"length_equals",...$(t),length:e})}function Ea(e,t){return new to({check:"string_format",format:"regex",...$(t),pattern:e})}function Za(e){return new ro({check:"string_format",format:"lowercase",...$(e)})}function Aa(e){return new no({check:"string_format",format:"uppercase",...$(e)})}function Ta(e,t){return new so({check:"string_format",format:"includes",...$(t),includes:e})}function Ca(e,t){return new oo({check:"string_format",format:"starts_with",...$(t),prefix:e})}function Da(e,t){return new ao({check:"string_format",format:"ends_with",...$(t),suffix:e})}function Le(e){return new io({check:"overwrite",tx:e})}function Fa(e){return Le(t=>t.normalize(e))}function Ia(){return Le(e=>e.trim())}function Ra(){return Le(e=>e.toLowerCase())}function Va(){return Le(e=>e.toUpperCase())}function La(){return Le(e=>ss(e))}function Ua(e,t,r){return new e({type:"array",element:t,...$(r)})}function Ma(e,t,r){return new e({type:"custom",check:"custom",fn:t,...$(r)})}function Ja(e){const t=Ba(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(Ye(n,r.value,t._zod.def));else{const s=n;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=t),s.continue??(s.continue=!t._zod.def.abort),r.issues.push(Ye(s))}},e(r.value,r)));return t}function Ba(e,t){const r=new ve({check:"custom",...$(t)});return r._zod.check=e,r}function fn(e){let t=(e==null?void 0:e.target)??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:(e==null?void 0:e.metadata)??We,target:t,unrepresentable:(e==null?void 0:e.unrepresentable)??"throw",override:(e==null?void 0:e.override)??(()=>{}),io:(e==null?void 0:e.io)??"output",counter:0,seen:new Map,cycles:(e==null?void 0:e.cycles)??"ref",reused:(e==null?void 0:e.reused)??"inline",external:(e==null?void 0:e.external)??void 0}}function Y(e,t,r={path:[],schemaPath:[]}){var p,m;var n;const s=e._zod.def,o=t.seen.get(e);if(o)return o.count++,r.schemaPath.includes(e)&&(o.cycle=r.path),o.schema;const a={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,a);const i=(m=(p=e._zod).toJSONSchema)==null?void 0:m.call(p);if(i)a.schema=i;else{const w={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,a.schema,w);else{const S=a.schema,P=t.processors[s.type];if(!P)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${s.type}`);P(e,t,S,w)}const y=e._zod.parent;y&&(a.ref||(a.ref=y),Y(y,t,w),t.seen.get(y).isParent=!0)}const f=t.metadataRegistry.get(e);return f&&Object.assign(a.schema,f),t.io==="input"&&ee(e)&&(delete a.schema.examples,delete a.schema.default),t.io==="input"&&a.schema._prefault&&((n=a.schema).default??(n.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(e).schema}function hn(e,t){var a,i,f,h;const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=new Map;for(const p of e.seen.entries()){const m=(a=e.metadataRegistry.get(p[0]))==null?void 0:a.id;if(m){const w=n.get(m);if(w&&w!==p[0])throw new Error(`Duplicate schema id "${m}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(m,p[0])}}const s=p=>{var P;const m=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const j=(P=e.external.registry.get(p[0]))==null?void 0:P.id,N=e.external.uri??(M=>M);if(j)return{ref:N(j)};const x=p[1].defId??p[1].schema.id??`schema${e.counter++}`;return p[1].defId=x,{defId:x,ref:`${N("__shared")}#/${m}/${x}`}}if(p[1]===r)return{ref:"#"};const y=`#/${m}/`,S=p[1].schema.id??`__schema${e.counter++}`;return{defId:S,ref:y+S}},o=p=>{if(p[1].schema.$ref)return;const m=p[1],{ref:w,defId:y}=s(p);m.def={...m.schema},y&&(m.defId=y);const S=m.schema;for(const P in S)delete S[P];S.$ref=w};if(e.cycles==="throw")for(const p of e.seen.entries()){const m=p[1];if(m.cycle)throw new Error(`Cycle detected: #/${(i=m.cycle)==null?void 0:i.join("/")}/<root> 38 39Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const p of e.seen.entries()){const m=p[1];if(t===p[0]){o(p);continue}if(e.external){const y=(f=e.external.registry.get(p[0]))==null?void 0:f.id;if(t!==p[0]&&y){o(p);continue}}if((h=e.metadataRegistry.get(p[0]))==null?void 0:h.id){o(p);continue}if(m.cycle){o(p);continue}if(m.count>1&&e.reused==="ref"){o(p);continue}}}function mn(e,t){var a,i,f;const r=e.seen.get(t);if(!r)throw new Error("Unprocessed schema. This is a bug in Zod.");const n=h=>{const p=e.seen.get(h);if(p.ref===null)return;const m=p.def??p.schema,w={...m},y=p.ref;if(p.ref=null,y){n(y);const P=e.seen.get(y),j=P.schema;if(j.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(m.allOf=m.allOf??[],m.allOf.push(j)):Object.assign(m,j),Object.assign(m,w),h._zod.parent===y)for(const x in m)x==="$ref"||x==="allOf"||x in w||delete m[x];if(j.$ref&&P.def)for(const x in m)x==="$ref"||x==="allOf"||x in P.def&&JSON.stringify(m[x])===JSON.stringify(P.def[x])&&delete m[x]}const S=h._zod.parent;if(S&&S!==y){n(S);const P=e.seen.get(S);if(P!=null&&P.schema.$ref&&(m.$ref=P.schema.$ref,P.def))for(const j in m)j==="$ref"||j==="allOf"||j in P.def&&JSON.stringify(m[j])===JSON.stringify(P.def[j])&&delete m[j]}e.override({zodSchema:h,jsonSchema:m,path:p.path??[]})};for(const h of[...e.seen.entries()].reverse())n(h[0]);const s={};if(e.target==="draft-2020-12"?s.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?s.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?s.$schema="http://json-schema.org/draft-04/schema#":e.target,(a=e.external)!=null&&a.uri){const h=(i=e.external.registry.get(t))==null?void 0:i.id;if(!h)throw new Error("Schema is missing an `id` property");s.$id=e.external.uri(h)}Object.assign(s,r.def??r.schema);const o=((f=e.external)==null?void 0:f.defs)??{};for(const h of e.seen.entries()){const p=h[1];p.def&&p.defId&&(o[p.defId]=p.def)}e.external||Object.keys(o).length>0&&(e.target==="draft-2020-12"?s.$defs=o:s.definitions=o);try{const h=JSON.parse(JSON.stringify(s));return Object.defineProperty(h,"~standard",{value:{...t["~standard"],jsonSchema:{input:lt(t,"input",e.processors),output:lt(t,"output",e.processors)}},enumerable:!1,writable:!1}),h}catch{throw new Error("Error converting schema to JSON.")}}function ee(e,t){const r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);const n=e._zod.def;if(n.type==="transform")return!0;if(n.type==="array")return ee(n.element,r);if(n.type==="set")return ee(n.valueType,r);if(n.type==="lazy")return ee(n.getter(),r);if(n.type==="promise"||n.type==="optional"||n.type==="nonoptional"||n.type==="nullable"||n.type==="readonly"||n.type==="default"||n.type==="prefault")return ee(n.innerType,r);if(n.type==="intersection")return ee(n.left,r)||ee(n.right,r);if(n.type==="record"||n.type==="map")return ee(n.keyType,r)||ee(n.valueType,r);if(n.type==="pipe")return ee(n.in,r)||ee(n.out,r);if(n.type==="object"){for(const s in n.shape)if(ee(n.shape[s],r))return!0;return!1}if(n.type==="union"){for(const s of n.options)if(ee(s,r))return!0;return!1}if(n.type==="tuple"){for(const s of n.items)if(ee(s,r))return!0;return!!(n.rest&&ee(n.rest,r))}return!1}const Wa=(e,t={})=>r=>{const n=fn({...r,processors:t});return Y(e,n),hn(n,e),mn(n,e)},lt=(e,t,r={})=>n=>{const{libraryOptions:s,target:o}=n??{},a=fn({...s??{},target:o,io:t,processors:r});return Y(e,a),hn(a,e),mn(a,e)},qa={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Ka=(e,t,r,n)=>{const s=r;s.type="string";const{minimum:o,maximum:a,format:i,patterns:f,contentEncoding:h}=e._zod.bag;if(typeof o=="number"&&(s.minLength=o),typeof a=="number"&&(s.maxLength=a),i&&(s.format=qa[i]??i,s.format===""&&delete s.format,i==="time"&&delete s.format),h&&(s.contentEncoding=h),f&&f.size>0){const p=[...f];p.length===1?s.pattern=p[0].source:p.length>1&&(s.allOf=[...p.map(m=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))])}},Ha=(e,t,r,n)=>{r.not={}},Ga=(e,t,r,n)=>{},Ya=(e,t,r,n)=>{const s=e._zod.def,o=Yr(s.entries);o.every(a=>typeof a=="number")&&(r.type="number"),o.every(a=>typeof a=="string")&&(r.type="string"),r.enum=o},Xa=(e,t,r,n)=>{const s=e._zod.def,o=[];for(const a of s.values)if(a===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(a))}else o.push(a);if(o.length!==0)if(o.length===1){const a=o[0];r.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0"?r.enum=[a]:r.const=a}else o.every(a=>typeof a=="number")&&(r.type="number"),o.every(a=>typeof a=="string")&&(r.type="string"),o.every(a=>typeof a=="boolean")&&(r.type="boolean"),o.every(a=>a===null)&&(r.type="null"),r.enum=o},Qa=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},ei=(e,t,r,n)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},ti=(e,t,r,n)=>{const s=r,o=e._zod.def,{minimum:a,maximum:i}=e._zod.bag;typeof a=="number"&&(s.minItems=a),typeof i=="number"&&(s.maxItems=i),s.type="array",s.items=Y(o.element,t,{...n,path:[...n.path,"items"]})},ri=(e,t,r,n)=>{var h;const s=r,o=e._zod.def;s.type="object",s.properties={};const a=o.shape;for(const p in a)s.properties[p]=Y(a[p],t,{...n,path:[...n.path,"properties",p]});const i=new Set(Object.keys(a)),f=new Set([...i].filter(p=>{const m=o.shape[p]._zod;return t.io==="input"?m.optin===void 0:m.optout===void 0}));f.size>0&&(s.required=Array.from(f)),((h=o.catchall)==null?void 0:h._zod.def.type)==="never"?s.additionalProperties=!1:o.catchall?o.cat
39chall&&(s.additionalProperties=Y(o.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):t.io==="output"&&(s.additionalProperties=!1)},ni=(e,t,r,n)=>{const s=e._zod.def,o=s.inclusive===!1,a=s.options.map((i,f)=>Y(i,t,{...n,path:[...n.path,o?"oneOf":"anyOf",f]}));o?r.oneOf=a:r.anyOf=a},si=(e,t,r,n)=>{const s=e._zod.def,o=Y(s.left,t,{...n,path:[...n.path,"allOf",0]}),a=Y(s.right,t,{...n,path:[...n.path,"allOf",1]}),i=h=>"allOf"in h&&Object.keys(h).length===1,f=[...i(o)?o.allOf:[o],...i(a)?a.allOf:[a]];r.allOf=f},oi=(e,t,r,n)=>{const s=e._zod.def,o=Y(s.innerType,t,n),a=t.seen.get(e);t.target==="openapi-3.0"?(a.ref=s.innerType,r.nullable=!0):r.anyOf=[o,{type:"null"}]},ai=(e,t,r,n)=>{const s=e._zod.def;Y(s.innerType,t,n);const o=t.seen.get(e);o.ref=s.innerType},ii=(e,t,r,n)=>{const s=e._zod.def;Y(s.innerType,t,n);const o=t.seen.get(e);o.ref=s.innerType,r.default=JSON.parse(JSON.stringify(s.defaultValue))},ci=(e,t,r,n)=>{const s=e._zod.def;Y(s.innerType,t,n);const o=t.seen.get(e);o.ref=s.innerType,t.io==="input"&&(r._prefault=JSON.parse(JSON.stringify(s.defaultValue)))},ui=(e,t,r,n)=>{const s=e._zod.def;Y(s.innerType,t,n);const o=t.seen.get(e);o.ref=s.innerType;let a;try{a=s.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}r.default=a},li=(e,t,r,n)=>{const s=e._zod.def,o=t.io==="input"?s.in._zod.def.type==="transform"?s.out:s.in:s.out;Y(o,t,n);const a=t.seen.get(e);a.ref=o},di=(e,t,r,n)=>{const s=e._zod.def;Y(s.innerType,t,n);const o=t.seen.get(e);o.ref=s.innerType,r.readOnly=!0},pn=(e,t,r,n)=>{const s=e._zod.def;Y(s.innerType,t,n);const o=t.seen.get(e);o.ref=s.innerType};function Zr(e,t){try{var r=e()}catch(n){return t(n)}return r&&r.then?r.then(void 0,t):r}function fi(e,t){for(var r={};e.length;){var n=e[0],s=n.code,o=n.message,a=n.path.join(".");if(!r[a])if("unionErrors"in n){var i=n.unionErrors[0].errors[0];r[a]={message:i.message,type:i.code}}else r[a]={message:o,type:s};if("unionErrors"in n&&n.unionErrors.forEach(function(p){return p.errors.forEach(function(m){return e.push(m)})}),t){var f=r[a].types,h=f&&f[n.code];r[a]=It(a,t,r,s,h?[].concat(h,n.message):n.message)}e.shift()}return r}function hi(e,t){for(var r={};e.length;){var n=e[0],s=n.code,o=n.message,a=n.path.join(".");if(!r[a])if(n.code==="invalid_union"&&n.errors.length>0){var i=n.errors[0][0];r[a]={message:i.message,type:i.code}}else r[a]={message:o,type:s};if(n.code==="invalid_union"&&n.errors.forEach(function(p){return p.forEach(function(m){return e.push(m)})}),t){var f=r[a].types,h=f&&f[n.code];r[a]=It(a,t,r,s,h?[].concat(h,n.message):n.message)}e.shift()}return r}function bt(e,t,r){if(r===void 0&&(r={}),(function(n){return"_def"in n&&typeof n._def=="object"&&"typeName"in n._def})(e))return function(n,s,o){try{return Promise.resolve(Zr(function(){return Promise.resolve(e[r.mode==="sync"?"parse":"parseAsync"](n,t)).then(function(a){return o.shouldUseNativeValidation&&Et({},o),{errors:{},values:r.raw?Object.assign({},n):a}})},function(a){if((function(i){return Array.isArray(i==null?void 0:i.issues)})(a))return{values:{},errors:yr(fi(a.errors,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw a}))}catch(a){return Promise.reject(a)}};if((function(n){return"_zod"in n&&typeof n._zod=="object"})(e))return function(n,s,o){try{return Promise.resolve(Zr(function(){return Promise.resolve((r.mode==="sync"?ys:vs)(e,n,t)).then(function(a){return o.shouldUseNativeValidation&&Et({},o),{errors:{},values:r.raw?Object.assign({},n):a}})},function(a){if((function(i){return i instanceof Bt})(a))return{values:{},errors:yr(hi(a.issues,!o.shouldUseNativeValidation&&o.criteriaMode==="all"),o)};throw a}))}catch(a){return Promise.reject(a)}};throw new Error("Invalid input: not a Zod schema")}const mi=g("ZodISODateTime",(e,t)=>{xo.init(e,t),U.init(e,t)});function pi(e){return ja(mi,e)}const gi=g("ZodISODate",(e,t)=>{ko.init(e,t),U.init(e,t)});function yi(e){return Sa(gi,e)}const vi=g("ZodISOTime",(e,t)=>{zo.init(e,t),U.init(e,t)});function bi(e){return Pa(vi,e)}const wi=g("ZodISODuration",(e,t)=>{jo.init(e,t),U.init(e,t)});function _i(e){return $a(wi,e)}const xi=(e,t)=>{Bt.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:r=>gs(e,r)},flatten:{value:r=>ps(e,r)},addIssue:{value:r=>{e.issues.push(r),e.message=JSON.stringify(e.issues,Zt,2)}},addIssues:{value:r=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,Zt,2)}},isEmpty:{get(){return e.issues.length===0}}})},ue=g("ZodError",xi,{Parent:Error}),ki=mt(ue),zi=pt(ue),ji=gt(ue),Si=yt(ue),Pi=_s(ue),$i=xs(ue),Ni=ks(ue),Oi=zs(ue),Ei=js(ue),Zi=Ss(ue),Ai=Ps(ue),Ti=$s(ue),H=g("ZodType",(e,t)=>(K.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:lt(e,"input"),output:lt(e,"output")}}),e.toJSONSchema=Wa(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(je(t,{checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0}),e.with=e.check,e.clone=(r,n)=>Se(e,r,n),e.brand=()=>e,e.register=((r,n)=>(r.add(e,n),e)),e.parse=(r,n)=>
vendor: 5,718 bytes, line 39
39ki(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>ji(e,r,n),e.parseAsync=async(r,n)=>zi(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>Si(e,r,n),e.spa=e.safeParseAsync,e.encode=(r,n)=>Pi(e,r,n),e.decode=(r,n)=>$i(e,r,n),e.encodeAsync=async(r,n)=>Ni(e,r,n),e.decodeAsync=async(r,n)=>Oi(e,r,n),e.safeEncode=(r,n)=>Ei(e,r,n),e.safeDecode=(r,n)=>Zi(e,r,n),e.safeEncodeAsync=async(r,n)=>Ai(e,r,n),e.safeDecodeAsync=async(r,n)=>Ti(e,r,n),e.refine=(r,n)=>e.check(Pc(r,n)),e.superRefine=r=>e.check($c(r)),e.overwrite=r=>e.check(Le(r)),e.optional=()=>Cr(e),e.exactOptional=()=>mc(e),e.nullable=()=>Dr(e),e.nullish=()=>Cr(Dr(e)),e.nonoptional=r=>wc(e,r),e.array=()=>nc(e),e.or=r=>ac([e,r]),e.and=r=>cc(e,r),e.transform=r=>Fr(e,fc(r)),e.default=r=>yc(e,r),e.prefault=r=>bc(e,r),e.catch=r=>xc(e,r),e.pipe=r=>Fr(e,r),e.readonly=()=>jc(e),e.describe=r=>{const n=e.clone();return We.add(n,{description:r}),n},Object.defineProperty(e,"description",{get(){var r;return(r=We.get(e))==null?void 0:r.description},configurable:!0}),e.meta=(...r)=>{if(r.length===0)return We.get(e);const n=e.clone();return We.add(n,r[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=r=>r(e),e)),gn=g("_ZodString",(e,t)=>{Wt.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,s,o)=>Ka(e,n,s);const r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...n)=>e.check(Ea(...n)),e.includes=(...n)=>e.check(Ta(...n)),e.startsWith=(...n)=>e.check(Ca(...n)),e.endsWith=(...n)=>e.check(Da(...n)),e.min=(...n)=>e.check(ut(...n)),e.max=(...n)=>e.check(ln(...n)),e.length=(...n)=>e.check(dn(...n)),e.nonempty=(...n)=>e.check(ut(1,...n)),e.lowercase=n=>e.check(Za(n)),e.uppercase=n=>e.check(Aa(n)),e.trim=()=>e.check(Ia()),e.normalize=(...n)=>e.check(Fa(...n)),e.toLowerCase=()=>e.check(Ra()),e.toUpperCase=()=>e.check(Va()),e.slugify=()=>e.check(La())}),Ci=g("ZodString",(e,t)=>{Wt.init(e,t),gn.init(e,t),e.email=r=>e.check(sa(Di,r)),e.url=r=>e.check(ua(Fi,r)),e.jwt=r=>e.check(za(Xi,r)),e.emoji=r=>e.check(la(Ii,r)),e.guid=r=>e.check(Er(Ar,r)),e.uuid=r=>e.check(oa(nt,r)),e.uuidv4=r=>e.check(aa(nt,r)),e.uuidv6=r=>e.check(ia(nt,r)),e.uuidv7=r=>e.check(ca(nt,r)),e.nanoid=r=>e.check(da(Ri,r)),e.guid=r=>e.check(Er(Ar,r)),e.cuid=r=>e.check(fa(Vi,r)),e.cuid2=r=>e.check(ha(Li,r)),e.ulid=r=>e.check(ma(Ui,r)),e.base64=r=>e.check(_a(Hi,r)),e.base64url=r=>e.check(xa(Gi,r)),e.xid=r=>e.check(pa(Mi,r)),e.ksuid=r=>e.check(ga(Ji,r)),e.ipv4=r=>e.check(ya(Bi,r)),e.ipv6=r=>e.check(va(Wi,r)),e.cidrv4=r=>e.check(ba(qi,r)),e.cidrv6=r=>e.check(wa(Ki,r)),e.e164=r=>e.check(ka(Yi,r)),e.datetime=r=>e.check(pi(r)),e.date=r=>e.check(yi(r)),e.time=r=>e.check(bi(r)),e.duration=r=>e.check(_i(r))});function ae(e){return na(Ci,e)}const U=g("ZodStringFormat",(e,t)=>{V.init(e,t),gn.init(e,t)}),Di=g("ZodEmail",(e,t)=>{ho.init(e,t),U.init(e,t)}),Ar=g("ZodGUID",(e,t)=>{lo.init(e,t),U.init(e,t)}),nt=g("ZodUUID",(e,t)=>{fo.init(e,t),U.init(e,t)}),Fi=g("ZodURL",(e,t)=>{mo.init(e,t),U.init(e,t)}),Ii=g("ZodEmoji",(e,t)=>{po.init(e,t),U.init(e,t)}),Ri=g("ZodNanoID",(e,t)=>{go.init(e,t),U.init(e,t)}),Vi=g("ZodCUID",(e,t)=>{yo.init(e,t),U.init(e,t)}),Li=g("ZodCUID2",(e,t)=>{vo.init(e,t),U.init(e,t)}),Ui=g("ZodULID",(e,t)=>{bo.init(e,t),U.init(e,t)}),Mi=g("ZodXID",(e,t)=>{wo.init(e,t),U.init(e,t)}),Ji=g("ZodKSUID",(e,t)=>{_o.init(e,t),U.init(e,t)}),Bi=g("ZodIPv4",(e,t)=>{So.init(e,t),U.init(e,t)}),Wi=g("ZodIPv6",(e,t)=>{Po.init(e,t),U.init(e,t)}),qi=g("ZodCIDRv4",(e,t)=>{$o.init(e,t),U.init(e,t)}),Ki=g("ZodCIDRv6",(e,t)=>{No.init(e,t),U.init(e,t)}),Hi=g("ZodBase64",(e,t)=>{Oo.init(e,t),U.init(e,t)}),Gi=g("ZodBase64URL",(e,t)=>{Zo.init(e,t),U.init(e,t)}),Yi=g("ZodE164",(e,t)=>{Ao.init(e,t),U.init(e,t)}),Xi=g("ZodJWT",(e,t)=>{Co.init(e,t),U.init(e,t)}),Qi=g("ZodUnknown",(e,t)=>{Do.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Ga()});function Tr(){return Na(Qi)}const ec=g("ZodNever",(e,t)=>{Fo.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Ha(e,r,n)});function tc(e){return Oa(ec,e)}const rc=g("ZodArray",(e,t)=>{Io.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,s)=>ti(e,r,n,s),e.element=t.element,e.min=(r,n)=>e.check(ut(r,n)),e.nonempty=r=>e.check(ut(1,r)),e.max=(r,n)=>e.check(ln(r,n)),e.length=(r,n)=>e.check(dn(r,n)),e.unwrap=()=>e.element});function nc(e,t){return Ua(rc,e,t)}const sc=g("ZodObject",(e,t)=>{Vo.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,s)=>ri(e,r,n,s),C(e,"shape",()=>t.shape),e.keyof=()=>uc(Object.keys(e._zod.def.shape)),e.catchall=r=>e.clone({...e._zod.def,catchall:r}),e.passthrough=()=>e.clone({...e._zod.def,catchall:Tr()}),e.loose=()=>e.clone({...e._zod.def,catchall:Tr()}),e.strict=()=>e.clone({...e._zod.def,catchall:tc()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=r=>ls(e,r),e.safeExtend=r=>ds(e,r),e.merge=r=>fs(e,r),e.pick=r=>cs(e,r),e.omit=r=>us(e,r),e.partial=(...r)=>hs(yn,e,r[0]),e.required=(...r)=>ms(vn,e,r[0])});function wt(e,t){const r={type:"object",shape:e??{},...$(t)};return new sc(r)}const oc=g("ZodUnion",(e,t)=>{Lo.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,s)=>ni(e,r,n,s),e.options=t.options});function ac(e,t){return new oc({type:"union",options:e,...$(t)})}const ic=g("ZodIntersection",(e,t)=>{Uo.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,s)=>si(e,r,n,s)});function cc(e,t){return new ic({type:"intersection",left:e,right:t})}const Tt=g("ZodEnum",(e,t)=>{Mo.init(e,t),H.init(e,t),e._zod.processJSONSchema=(n,s,o)=>Ya(e,n,s),e.enum=t.entries,e.options=Object.values(t.entries);const r=new Set(Object.keys(t.entries));e.extract=(n,s)=>{const o={};for(const a of n)if(r.has(a))o[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);
39return new Tt({...t,checks:[],...$(s),entries:o})},e.exclude=(n,s)=>{const o={...t.entries};for(const a of n)if(r.has(a))delete o[a];else throw new Error(`Key ${a} not found in enum`);return new Tt({...t,checks:[],...$(s),entries:o})}});function uc(e,t){const r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Tt({type:"enum",entries:r,...$(t)})}const lc=g("ZodLiteral",(e,t)=>{Jo.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Xa(e,r,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function st(e,t){return new lc({type:"literal",values:Array.isArray(e)?e:[e],...$(t)})}const dc=g("ZodTransform",(e,t)=>{Bo.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,s)=>ei(e,r),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Hr(e.constructor.name);r.addIssue=o=>{if(typeof o=="string")r.issues.push(Ye(o,r.value,t));else{const a=o;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=e),r.issues.push(Ye(a))}};const s=t.transform(r.value,r);return s instanceof Promise?s.then(o=>(r.value=o,r)):(r.value=s,r)}});function fc(e){return new dc({type:"transform",transform:e})}const yn=g("ZodOptional",(e,t)=>{un.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,s)=>pn(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});function Cr(e){return new yn({type:"optional",innerType:e})}const hc=g("ZodExactOptional",(e,t)=>{Wo.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,s)=>pn(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});function mc(e){return new hc({type:"optional",innerType:e})}const pc=g("ZodNullable",(e,t)=>{qo.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,s)=>oi(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});function Dr(e){return new pc({type:"nullable",innerType:e})}const gc=g("ZodDefault",(e,t)=>{Ko.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,s)=>ii(e,r,n,s),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function yc(e,t){return new gc({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():Qr(t)}})}const vc=g("ZodPrefault",(e,t)=>{Ho.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,s)=>ci(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});function bc(e,t){return new vc({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():Qr(t)}})}const vn=g("ZodNonOptional",(e,t)=>{Go.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,s)=>ai(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});function wc(e,t){return new vn({type:"nonoptional",innerType:e,...$(t)})}const _c=g("ZodCatch",(e,t)=>{Yo.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,s)=>ui(e,r,n,s),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function xc(e,t){return new _c({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const kc=g("ZodPipe",(e,t)=>{Xo.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,s)=>li(e,r,n,s),e.in=t.in,e.out=t.out});function Fr(e,t){return new kc({type:"pipe",in:e,out:t})}const zc=g("ZodReadonly",(e,t)=>{Qo.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,s)=>di(e,r,n,s),e.unwrap=()=>e._zod.def.innerType});function jc(e){return new zc({type:"readonly",innerType:e})}const Sc=g("ZodCustom",(e,t)=>{ea.init(e,t),H.init(e,t),e._zod.processJSONSchema=(r,n,s)=>Qa(e,r)});function Pc(e,t={}){return Ma(Sc,e,t)}function $c(e){return Ja(e)}const Nc=wt({email:ae().min(1,"Email is required").email("Please enter a valid email address").transform(e=>e.trim().toLowerCase()),password:ae().min(6,"Password must be at least 6 characters")}),Ue={login:e=>Pe.post("/user/auths/login",{...e,email:e.email.trim().toLowerCase()}).then(t=>t.data),register:e=>Pe.post("/user/auths/register",e).then(t=>t.data),forgotPassword:e=>Pe.post("/user/auths/forgotpass",{email:e}).then(t=>t.data),verifyOtp:(e,t)=>Pe.post("/user/auths/verifyotp",{otp:t,email:e}).then(r=>r.data),resendOtp:e=>Pe.post("/user/auths/resendotp",{email:e}).then(t=>t.data),resetPassword:(e,t,r)=>Pe.post("/user/auths/resetpass",{token:e,password:t,confirmPassword:r}).then(n=>n.data),getMe:()=>Pe.get("/user/profile/ProfileDetails").then(e=>{const t=e.data.personaldata;return{id:t.email,email:t.email,firstName:t.firstName,lastName:t.lastName,phoneNumber:t.phoneNumber}})};function Oc(){const e=Ie(),t=Rr();return Ve({mutationFn:r=>Ue.login(r),onSuccess:(r,n)=>{t.loginWithToken(r.accessToken,r.refreshToken,n.remember),be.success(r.message),e("/ch
39at",{replace:!0})},onError:()=>{}})}function Ec(){const e=Ie();return Ve({mutationFn:t=>Ue.register(t),onSuccess:(t,r)=>{be.success(t.message),e(`/verify-otp?email=${encodeURIComponent(r.email)}`)},onError:()=>{}})}function Zc(){return Ve({mutationFn:e=>Ue.forgotPassword(e),onSuccess:()=>{be.success("Password reset link sent to your email.")},onError:()=>{be.error("Failed to send reset link. Please try again.")}})}function Ac(){return{authenticate:q.useCallback((t,r="signup")=>{const n="https://lawttorney.ai/v2/api";window.location.href=`${n}/user/oauth/${t}/${r}`},[])}}function Tc(){const e=Ie(),[t]=Vr(),{loginWithToken:r}=Rr(),[n,s]=q.useState(""),o=q.useRef(!1),a=t.get("accessToken"),i=t.get("refreshToken"),f=t.get("provider"),h=t.get("error");return q.useEffect(()=>{if(!o.current){if(h){o.current=!0,s(h);return}a?(o.current=!0,r(a,i??void 0,!0),be.success("Successfully signed in!"),e("/chat",{replace:!0})):(o.current=!0,s("No access token received from authentication."))}},[a,i,h,r,e]),{provider:f,error:n}}function Cc(){const e=Ie();return Ve({mutationFn:({email:t,otp:r})=>Ue.verifyOtp(t,r),onSuccess:t=>{be.success(t.message),e("/login")},onError:()=>{}})}function Dc(){return Ve({mutationFn:e=>Ue.resendOtp(e),onSuccess:e=>{be.success(e.message)},onError:()=>{}})}function Fc(){const e=Ie();return Ve({mutationFn:({token:t,password:r,confirmPassword:n})=>Ue.resetPassword(t,r,n),onSuccess:()=>{be.success("Password reset successfully. Please log in."),e("/login")},onError:()=>{be.error("Failed to reset password. The link may have expired.")}})}const Ic=[{name:"google",label:"Google",icon:l.jsxs("svg",{className:"h-5 w-5",viewBox:"0 0 24 24",children:[l.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92a5.06 5.06 0 01-2.2 3.32v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.1z",fill:"#4285F4"}),l.jsx("path",{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",fill:"#34A853"}),l.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z",fill:"#FBBC05"}),l.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z",fill:"#EA4335"})]})},{name:"linkedin",label:"LinkedIn",icon:l.jsx("svg",{className:"h-5 w-5",viewBox:"0 0 24 24",children:l.jsx("path",{d:"M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433a2.062 2.062 0 01-2.063-2.065 2.064 2.064 0 112.063 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z",fill:"#0A66C2"})})},{name:"apple",label:"Apple",icon:l.jsx("svg",{className:"h-5 w-5",fill:"currentColor",viewBox:"0 0 24 24",children:l.jsx("path",{d:"M17.05 20.28c-.98.95-2.05.88-3.08.4-1.09-.5-2.08-.48-3.24 0-1.44.62-2.2.44-3.06-.4C2.79 15.25 3.51 7.59 9.05 7.31c1.35.07 2.29.74 3.08.8 1.18-.24 2.31-.93 3.57-.84 1.51.12 2.65.72 3.4 1.8-3.12 1.87-2.38 5.98.48 7.13-.57 1.5-1.31 2.99-2.54 4.09zM12.03 7.25c-.15-2.23 1.66-4.07 3.74-4.25.29 2.58-2.34 4.5-3.74 4.25z"})})}];function bn({action:e="signup"}){const{authenticate:t}=Ac();return l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"flex gap-2 sm:gap-3",children:Ic.map(({name:r,label:n,icon:s})=>l.jsxs("button",{type:"button",onClick:()=>t(r,e),className:"flex min-w-0 flex-1 items-center justify-center gap-2 rounded-lg border border-gray-200 bg-white px-2 py-2.5 text-sm font-medium text-gray-700 transition-colors hover:bg-gray-50 dark:border-gray-600 dark:bg-gray-700 dark:text-gray-200 dark:hover:bg-gray-600 sm:px-4",children:[l.jsx("span",{className:"shrink-0",children:s}),l.jsx("span",{className:"truncate",children:n})]},r))}),l.jsxs("div",{className:"my-6 flex items-center gap-3",children:[l.jsx("div",{className:"h-px flex-1 bg-gray-200 dark:bg-gray-600"}),l.jsx("span",{className:"text-xs text-gray-400 dark:text-gray-500",children:"or"}),l.jsx("div",{className:"h-px flex-1 bg-gray-200 dark:bg-gray-600"})]})]})}const xe=4,Ir=60;function Rc({onComplete:e,onResend:t,isVerifying:r=!1,isResending:n=!1}){const[s,o]=q.useState(Array(xe).fill("")),[a,i]=q.useState(Ir),[f,h]=q.useState(!1),p=q.useRef([]);q.useEffect(()=>{var j;(j=p.current[0])==null||j.focus()},[]),q.useEffect(()=>{if(a<=0){h(!0);return}const j=setInterval(()=>{i(N=>N-1)},1e3);return()=>clearInterval(j)},[a]);const m=q.useCallback((j,N)=>{var T;if(!/^\d*$/.test(N))return;const x=[...s];x[j]=N.slice(-1),o(x),N&&j<xe-1&&((T=p.current[j+1])==null||T.focus());const M=x.join("");M.length===xe&&x.every(O=>O!=="")&&e(M)},[s,e]),w=q.useCallback((j,N)=>{var x;N.key==="Backspace"&&!s[j]&&j>0&&((x=p.current[j-1])==null||x.focus())},[s]),y=q.useCallback(j=>{var T;j.preventDefault();const N=j.clipboardData.getData("text").replace(/\D/g,"").slice(0,xe);if(!N)return;const x=Array(xe).fill("");for(let O=0;O<N.length;O++)x[O]=N[O];o(x);const M=Math.min(N.length,xe-1);(T=p.current[M])==null||T.focus(),N.length===xe&&e(N)},[e]),S=()=>{var j;t(),i(Ir),h(!1),o(Array(xe).fill("")),(j=p.current[0])==null||j.focus()},P=j=>{const N=Math.floor(j/60),x=j%60;return`${N}:${x.toString().padStart(2,"0")}`};return l.jsxs("div",{className:"space-y-6",children:[l.jsx("div",{className:"flex justify-center gap-3",children:s.map((j,N)=>l.jsx("input",{ref:x=>{p.current[N]=x},type:"text",inputMode:"numeric",maxLength:1,value:j,onChange:x=>m(N,x.target.value),onKeyDown:x=>w(N,x),onPaste:N===0?y:void 0,disabled:r,className:"h-14 w-12 rounded-xl border border-gray-300 bg-white text-center text-xl font-semibold text-gray-900 shadow-sm transition-all focus:border-indigo-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/20 disabled:opacity-50 dark:border-gray-600 dark:bg-gray-800 dark:text-white dark:focus:border-indigo-400 dark:focus:ring-indigo-400/20","aria-label":`Digit ${N+1}`},N))}),l.jsx("div",{className:"text-center",children:f?l.jsx(Re,{type:"button",variant:"ghost",size:"sm",onClick:S,disabled:n,children:n?"Resending...":"Resend OTP"}):l.jsxs("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:["Resend OTP in"," ",l.jsx("span",{className:"font-medium text-indigo-600 dark:text-indigo-400",children:P(a)})]})})]})}function tu(){var p,m;const{mutate:e,isPending:t}=Oc(),[r,n]=q.useState(!1),{register:s,handleSubmit:o,formState:{errors:a}}=ft({resolver:bt(Nc),defaultValues:{email:"",password:""}}),i=s("email"),f=w=>{i.onChange({target:{name:i.name,value:w.target.value.toLowerCase()},type:"change"})},h=w=>{e(w)};return l.jsxs("div",{className:"rounded-2xl border border-gray-100 bg-white px-5 py-8 shadow-xl shadow-gray-200/60 dark:border-gray-700 dark:bg-gray-800 dark:shadow-gray-900/60 sm:px-8 sm:py-10",children:[l.jsx("div",{className:"mb-6 flex justify-center",children:l.jsx(He,{size:"lg",linkTo:"/"})}),l.jsx("h1",{className:"mb-1 text-center text-2xl font-bold text-gray-900 dark:text-gray-100",children:"Welcome!!"}),l.jsx("p",{className:"mb-6 text-center text-sm text-gray-500 dark:text-gray-400",children:"Sign In to your Account"}),l.jsx(bn,{action:"login"}),l.jsxs("form",{onSubmit:o(h),className:"space-y-4",children:[l.jsx(ce,{label:"Email",type:"email",placeholder:"e.g. [email protected]",error:(p=a.email)==null?void 0:p.message,...i,onChange:f}),l.jsx(ce,{label:"Password",type:r?"text":"password",placeholder:"Enter your password",error:(m=a.password)==null?void 0:m.message,...s("password"),rightIcon:l.jsx("button",{type:"button",onClick:()=>n(!r),className:"text-gray-400 hover:text-gray-600 dark:hover:text-gray-300",tabIndex:-1,
39children:r?l.jsx("svg",{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21"})}):l.jsxs("svg",{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:[l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})]})})}),l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("label",{className:"flex items-center gap-2",children:[l.jsx("input",{type:"checkbox",className:"h-4 w-4 rounded border-gray-300 text-yellow-600 focus:ring-yellow-500 dark:border-gray-600 dark:bg-gray-700"}),l.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:"Remember Me"})]}),l.jsx(ze,{to:"/forgot-password",className:"text-sm font-medium text-yellow-600 hover:text-yellow-700 dark:text-yellow-500 dark:hover:text-yellow-400",children:"Forgot Password?"})]}),l.jsx("div",{className:"flex justify-center",children:l.jsx(Re,{type:"submit",isLoading:t,size:"lg",className:"w-1/2 bg-amber-400 text-white hover:bg-amber-500 active:bg-amber-600 dark:bg-amber-500 dark:hover:bg-amber-600 dark:active:bg-amber-700",children:"Login"})})]}),l.jsxs("p",{className:"mt-6 text-center text-sm text-gray-500 dark:text-gray-400",children:["Don't have an account?"," ",l.jsx(ze,{to:"/register",className:"font-semibold text-yellow-600 hover:text-yellow-700 dark:text-yellow-500 dark:hover:text-yellow-400",children:"Sign Up"})]})]})}const Vc=wt({firstName:ae().trim().min(2,"First name must be at least 2 characters").max(100,"First name must be at most 100 characters").regex(/^[A-Za-z]+(?:[ '-][A-Za-z]+)*$/,"First name may contain only letters, spaces, hyphens, and apostrophes"),lastName:ae().trim().min(2,"Last name must be at least 2 characters").max(100,"Last name must be at most 100 characters").regex(/^[A-Za-z]+(?:[ '-][A-Za-z]+)*$/,"Last name may contain only letters, spaces, hyphens, and apostrophes"),email:ae().trim().toLowerCase().min(1,"Email is required").max(254,"Email must be at most 254 characters").email("Please enter a valid email address").regex(/^[A-Za-z0-9._%+-]+@[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?(?:\.[A-Za-z0-9](?:[A-Za-z0-9-]*[A-Za-z0-9])?)*\.[A-Za-z]{2,}$/,"Please enter a valid email address").refine(e=>!e.includes(".."),"Email cannot contain consecutive dots"),phoneNumber:ae().regex(/^\d{10}$/,"Phone number must be 10 digits").optional().or(st("")),password:ae().min(8,"Password must be at least 8 characters").max(128,"Password must be at most 128 characters").regex(/[a-z]/,"Password must contain at least one lowercase letter").regex(/[A-Z]/,"Password must contain at least one uppercase letter").regex(/[0-9]/,"Password must contain at least one number").regex(/[!@#$%^&*()\-_=+\[\]{};:'",.<>/?\\|`~]/,"Password must contain at least one special character").refine(e=>!/\s/.test(e),"Password cannot contain spaces"),confirmPassword:ae().min(1,"Please confirm your password"),state:ae().optional().or(st("")),city:ae().optional().or(st("")),acceptTerms:st(!0,{message:"You must accept the Terms & Conditions"})}).refine(e=>e.password===e.confirmPassword,{message:"Passwords do not match",path:["confirmPassword"]}),Lc=[{value:"Andhra Pradesh",label:"Andhra Pradesh"},{value:"Arunachal Pradesh",label:"Arunachal Pradesh"},{value:"Assam",label:"Assam"},{value:"Bihar",label:"Bihar"},{value:"Chhattisgarh",label:"Chhattisgarh"},{value:"Goa",label:"Goa"},{value:"Gujarat",label:"Gujarat"},{value:"Haryana",label:"Haryana"},{value:"Himachal Pradesh",label:"Himachal Pradesh"},{value:"Jharkhand",label:"Jharkhand"},{value:"Karnataka",label:"Karnataka"},{value:"Kerala",label:"Kerala"},{value:"Madhya Pradesh",label:"Madhya Pradesh"},{value:"Maharashtra",label:"Maharashtra"},{value:"Manipur",label:"Manipur"},{value:"Meghalaya",label:"Meghalaya"},{value:"Mizoram",label:"Mizoram"},{value:"Nagaland",label:"Nagaland"},{value:"Odisha",label:"Odisha"},{value:"Punjab",label:"Punjab"},{value:"Rajasthan",label:"Rajasthan"},{value:"Sikkim",label:"Sikkim"},{value:"Tamil Nadu",label:"Tamil Nadu"},{value:"Telangana",label:"Telangana"},{value:"Tripura",label:"Tripura"},{value:"Uttar Pradesh",label:"Uttar Pradesh"},{value:"Uttarakhand",label:"Uttarakhand"},{value:"West Bengal",label:"West Bengal"},{value:"Andaman and Nicobar Islands",label:"Andaman and Nicobar Islands"},{value:"Chandigarh",label:"Chandigarh"},{value:"Dadra and Nagar Haveli and Daman and Diu",label:"Dadra and Nagar Haveli and Daman and Diu"},{value:"Delhi",label:"Delhi"},{value:"Jammu and Kashmir",label:"Jammu and Kashmir"},{value:"Ladakh",label:"Ladakh"},{value:"Lakshadweep",label:"Lakshadweep"},{value:"Puducherry",label:"Puducherry"}];function ru(){var N,x,M,T,O,B,ie,we;const{mutate:e,isPending:t}=Ec(),[r,n]=q.useState(!1),[s,o]=q.useState(!1),[a,i]=q.useState(!1),[f,h]=q.useState("terms"),p=()=>{h("terms"),i(!0)},{register:m,handleSubmit:w,formState:{errors:y,isValid:S}}=ft({resolver:bt(Vc),mode:"onChange",defaultValues:{firstName:"",lastName:"",email:"",ph
39oneNumber:"",password:"",confirmPassword:"",state:"",city:"",acceptTerms:!1}}),P=I=>{const{confirmPassword:me,acceptTerms:Ze,...Z}=I;e(Z)},j=(I,me)=>l.jsx("button",{type:"button",onClick:me,className:"text-gray-400 hover:text-gray-600 dark:hover:text-gray-300",tabIndex:0,children:I?l.jsx("svg",{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21"})}):l.jsxs("svg",{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:[l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})]})});return l.jsxs("div",{className:"rounded-2xl border border-gray-100 bg-white px-5 py-8 shadow-xl shadow-gray-200/60 dark:border-gray-700 dark:bg-gray-800 dark:shadow-gray-900/60 sm:px-8 sm:py-10",children:[l.jsx("div",{className:"mb-6 flex justify-center",children:l.jsx(He,{size:"lg",linkTo:"/"})}),l.jsx("h1",{className:"mb-1 text-center text-2xl font-bold text-gray-900 dark:text-gray-100",children:"Welcome!!"}),l.jsx("p",{className:"mb-6 text-center text-sm text-gray-500 dark:text-gray-400",children:"Create your Account"}),l.jsx(bn,{action:"signup"}),l.jsxs("form",{onSubmit:w(P),className:"space-y-4",children:[l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsx(ce,{label:"First Name",isRequired:!0,placeholder:"First Name",minLength:2,maxLength:100,error:(N=y.firstName)==null?void 0:N.message,...m("firstName",{onChange:I=>{I.target.value=I.target.value.replace(/[^A-Za-z '-]/g,"")}})}),l.jsx(ce,{label:"Last Name",isRequired:!0,placeholder:"Last Name",minLength:2,maxLength:100,error:(x=y.lastName)==null?void 0:x.message,...m("lastName",{onChange:I=>{I.target.value=I.target.value.replace(/[^A-Za-z '-]/g,"")}})})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsx(ce,{label:"Contact No",isRequired:!0,type:"tel",inputMode:"numeric",placeholder:"9822212345",error:(M=y.phoneNumber)==null?void 0:M.message,...m("phoneNumber",{onChange:I=>{I.target.value=I.target.value.replace(/[^0-9]/g,"")}})}),l.jsx(ce,{label:"Email",isRequired:!0,type:"email",autoComplete:"email",placeholder:"e.g. [email protected]",maxLength:254,error:(T=y.email)==null?void 0:T.message,...m("email",{onChange:I=>{I.target.value=I.target.value.replace(/\s/g,"").toLowerCase()}})})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsx(En,{label:"State",placeholder:"Select a state",options:Lc,error:(O=y.state)==null?void 0:O.message,...m("state")}),l.jsx(ce,{label:"City",isRequired:!0,placeholder:"e.g. Mumbai",error:(B=y.city)==null?void 0:B.message,...m("city")})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[l.jsx(ce,{label:"Password",isRequired:!0,type:r?"text":"password",autoComplete:"new-password",placeholder:"Enter password",maxLength:128,error:(ie=y.password)==null?void 0:ie.message,rightIcon:j(r,()=>n(!r)),...m("password")}),l.jsx(ce,{label:"Confirm Password",isRequired:!0,type:s?"text":"password",autoComplete:"new-password",placeholder:"Re-enter password",maxLength:128,error:(we=y.confirmPassword)==null?void 0:we.message,rightIcon:j(s,()=>o(!s)),...m("confirmPassword")})]}),l.jsxs("div",{children:[l.jsxs("label",{className:"flex items-center gap-2",children:[l.jsx("input",{type:"checkbox",...m("acceptTerms"),className:"h-4 w-4 rounded border-gray-300 text-yellow-600 focus:ring-yellow-500 dark:border-gray-600 dark:bg-gray-700"}),l.jsxs("span",{className:"text-sm text-gray-600 dark:text-gray-400",children:["Accept"," ",l.jsx("button",{type:"button",onClick:p,className:"font-semibold text-yellow-600 underline-offset-2 hover:underline dark:text-yellow-500 dark:hover:text-yellow-400",children:"Terms & Conditions"})]})]}),y.acceptTerms&&l.jsx("p",{className:"mt-1 text-sm text-red-600 dark:text-red-400",children:y.acceptTerms.message})]}),l.jsx("div",{className:"flex justify-center",children:l.jsx(Re,{type:"submit",isLoading:t,disabled:!S,size:"lg",className:"w-1/2 bg-amber-400 text-white hover:bg-amber-500 active:bg-amber-600 dar
39k:bg-amber-500 dark:hover:bg-amber-600 dark:active:bg-amber-700",children:"Register"})})]}),l.jsxs("p",{className:"mt-6 text-center text-sm text-gray-500 dark:text-gray-400",children:["Already have an account?"," ",l.jsx(ze,{to:"/login",className:"font-semibold text-yellow-600 hover:text-yellow-700 dark:text-yellow-500 dark:hover:text-yellow-400",children:"Sign In"})]}),l.jsxs(An,{isOpen:a,onClose:()=>i(!1),size:"lg",children:[l.jsxs("div",{className:"-mx-6 -mt-4 mb-4 flex items-center justify-between border-b border-gray-200 px-6 py-4 dark:border-gray-700",children:[l.jsxs("div",{role:"tablist","aria-label":"Legal documents",className:"flex items-center gap-6",children:[l.jsx("button",{type:"button",role:"tab","aria-selected":f==="terms",onClick:()=>h("terms"),className:f==="terms"?"border-b-2 border-yellow-500 pb-1 text-lg font-semibold text-gray-900 dark:text-gray-100":"border-b-2 border-transparent pb-1 text-lg font-semibold text-gray-400 transition-colors hover:text-gray-600 dark:text-gray-500 dark:hover:text-gray-300",children:"Terms of Service"}),l.jsx("button",{type:"button",role:"tab","aria-selected":f==="privacy",onClick:()=>h("privacy"),className:f==="privacy"?"border-b-2 border-yellow-500 pb-1 text-lg font-semibold text-gray-900 dark:text-gray-100":"border-b-2 border-transparent pb-1 text-lg font-semibold text-gray-400 transition-colors hover:text-gray-600 dark:text-gray-500 dark:hover:text-gray-300",children:"Privacy Policy"})]}),l.jsx("button",{type:"button",onClick:()=>i(!1),className:"rounded-lg p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 dark:text-gray-500 dark:hover:bg-gray-700 dark:hover:text-gray-300","aria-label":"Close",children:l.jsx("svg",{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})]}),l.jsx("div",{className:"max-h-[70vh] overflow-y-auto pr-1",children:l.jsx(Zn,{type:f})})]})]})}const Uc=wt({email:ae().min(1,"Email is required").email("Please enter a valid email address")});function nu(){var a;const{mutate:e,isPending:t}=Zc(),{register:r,handleSubmit:n,formState:{errors:s}}=ft({resolver:bt(Uc),defaultValues:{email:""}}),o=i=>{e(i.email)};return l.jsxs("div",{className:"rounded-2xl border border-gray-100 bg-white px-5 py-8 shadow-xl shadow-gray-200/60 dark:border-gray-700 dark:bg-gray-800 dark:shadow-gray-900/60 sm:px-8 sm:py-10",children:[l.jsx("div",{className:"mb-6 flex justify-center",children:l.jsx(He,{className:"h-12 w-auto text-gray-900 dark:text-gray-100",linkTo:"/"})}),l.jsx("h1",{className:"mb-1 text-center text-2xl font-bold text-gray-900 dark:text-gray-100",children:"Forgot Password?"}),l.jsx("p",{className:"mb-6 text-center text-sm text-gray-500 dark:text-gray-400",children:"Enter your email here to proceed and we'll send you a link to reset your password."}),l.jsxs("form",{onSubmit:n(o),className:"space-y-4",children:[l.jsx(ce,{label:"Email",type:"email",placeholder:"Enter your email",error:(a=s.email)==null?void 0:a.message,...r("email")}),l.jsx("div",{className:"flex justify-center",children:l.jsx(Re,{type:"submit",isLoading:t,size:"lg",className:"w-1/2 bg-amber-400 text-white hover:bg-amber-500 active:bg-amber-600 dark:bg-amber-500 dark:hover:bg-amber-600 dark:active:bg-amber-700",children:"Submit"})})]}),l.jsxs("p",{className:"mt-6 text-center text-sm text-gray-500 dark:text-gray-400",children:["Go to"," ",l.jsx(ze,{to:"/login",className:"font-semibold text-yellow-600 hover:text-yellow-700 dark:text-yellow-500 dark:hover:text-yellow-400",children:"Login"})]})]})}function su(){const{provider:e,error:t}=Tc(),r=Ie();return t?l.jsx("div",{className:"flex min-h-screen items-center justify-center bg-gray-50 dark:bg-gray-950",children:l.jsxs("div",{className:"w-full max-w-sm rounded-2xl border border-gray-100 bg-white p-8 text-center shadow-xl dark:border-gray-700 dark:bg-gray-800",children:[l.jsx("h2",{className:"mb-4 text-xl font-bold text-gray-900 dark:text-gray-100",children:"Authentication Failed"}),l.jsx("p",{className:"mb-6 rounded-lg bg-red-50 px-4 py-3 text-sm text-red-600 dark:bg-red-900/20 dark:text-red-400",children:t}),l.jsx(Re,{onClick:()=>
39r("/login"),className:"w-full bg-amber-400 text-white hover:bg-amber-500 dark:bg-amber-500 dark:hover:bg-amber-600",children:"Back to Login"})]})}):l.jsxs("div",{className:"flex min-h-screen flex-col items-center justify-center bg-gray-50 dark:bg-gray-950",children:[l.jsx(Nn,{className:"h-10 w-10 text-amber-500 dark:text-amber-400"}),l.jsx("p",{className:"mt-4 text-lg font-medium text-gray-900 dark:text-white",children:"Signing you in..."}),e&&l.jsxs("p",{className:"mt-1 text-sm text-gray-500 dark:text-gray-400",children:["Completing ",e," authentication"]})]})}function ou(){const[e]=Vr(),t=e.get("email")||"",{mutate:r,isPending:n}=Cc(),{mutate:s,isPending:o}=Dc(),a=f=>{t&&r({email:t,otp:f})},i=()=>{t&&s(t)};return l.jsx("div",{className:"flex min-h-dvh items-center justify-center bg-gray-50 px-4 py-12 dark:bg-gray-950 sm:px-6 lg:px-8",children:l.jsxs("div",{className:"w-full max-w-md",children:[l.jsxs("div",{className:"text-center",children:[l.jsxs(ze,{to:"/",className:"inline-flex items-center gap-2",children:[l.jsxs("svg",{className:"h-10 w-10 text-indigo-600 dark:text-indigo-400",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[l.jsx("rect",{width:"32",height:"32",rx:"8",fill:"
39currentColor",fillOpacity:"0.1"}),l.jsx("path",{d:"M8 8h4v12H8V8zm6 0h4v16h-4V8zm6 4h4v12h-4V12z",fill:"currentColor"})]}),l.jsx("span",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:"Lawttorney"})]}),l.jsx("h1",{className:"mt-6 text-2xl font-bold text-gray-900 dark:text-white",children:"Verify your email"}),l.jsxs("p",{className:"mt-2 text-sm text-gray-600 dark:text-gray-400",children:["We sent a 4-digit code to"," ",l.jsx("span",{className:"font-medium text-gray-900 dark:text-white",children:t||"your email"}),". Enter it below to verify your account."]})]}),l.jsx("div",{className:"mt-8 rounded-2xl border border-gray-200 bg-white p-6 shadow-sm dark:border-gray-800 dark:bg-gray-900 sm:p-8",children:l.jsx(Rc,{onComplete:a,onResend:i,isVerifying:n,isResending:o})}),l.jsx("p",{className:"mt-6 text-center text-sm text-gray-600 dark:text-gray-400",children:l.jsx(ze,{to:"/login",className:"font-medium text-indigo-600 hover:text-indigo-500 dark:text-indigo-400",children:"Back to Login"})})]})})}const Mc=wt({password:ae().min(6,"Password must be at least 6 characters"),confirmPassword:ae().min(1,"Please confirm your password")}).refine(e=>e.password===e.confirmPassword,{message:"Passwords do not match",path:["confirmPassword"]});function au(){var w,y;const{token:e=""}=On(),{mutate:t,isPending:r}=Fc(),[n,s]=q.useState(!1),[o,a]=q.useState(!1),{register:i,handleSubmit:f,formState:{errors:h}}=ft({resolver:bt(Mc),defaultValues:{password:"",confirmPassword:""}}),p=S=>{t({token:e,password:S.password,confirmPassword:S.confirmPassword})},m=({visible:S,onToggle:P})=>l.jsx("button",{type:"button",onClick:P,className:"text-gray-400 hover:text-gray-600 dark:hover:text-gray-300",tabIndex:-1,children:S?l.jsx("svg",{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21"})}):l.jsxs("svg",{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:[l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"}),l.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z"})]})});return e?l.jsxs("div",{className:"rounded-2xl border border-gray-100 bg-white px-5 py-8 shadow-xl shadow-gray-200/60 dark:border-gray-700 dark:bg-gray-800 dark:shadow-gray-900/60 sm:px-8 sm:py-10",children:[l.jsx("div",{className:"mb-6 flex justify-center",children:l.jsx(He,{className:"h-12 w-auto text-gray-900 dark:text-gray-100",linkTo:"/"})}),l.jsx("h1",{className:"mb-1 text-center text-2xl font-bold text-gray-900 dark:text-gray-100",children:"Reset Password"}),l.jsx("p",{className:"mb-6 text-center text-sm text-gray-500 dark:text-gray-400",children:"Enter your new password below."}),l.jsxs("form",{onSubmit:f(p),className:"space-y-4",children:[l.jsx(ce,{label:"New Password",type:n?"text":"password",placeholder:"Enter new password",error:(w=h.password)==null?void 0:w.message,...i("password"),rightIcon:l.jsx(m,{visible:n,onToggle:()=>s(S=>!S)})}),l.jsx(ce,{label:"Confirm Password",type:o?"text":"password",placeholder:"Confirm new password",error:(y=h.confirmPassword)==null?void 0:y.message,...i("confirmPassword"),rightIcon:l.jsx(m,{visible:o,onToggle:()=>a(S=>!S)})}),l.jsx("div",{className:"flex justify-center",children:l.jsx(Re,{type:"submit",isLoading:r,size:"lg",className:"w-1/2 bg-amber-400 text-white hover:bg-amber-500 active:bg-amber-600 dark:bg-amber-500 dark:hover:bg-amber-600 dark:active:bg-amber-700",children:"Reset Password"})})]}),l.jsxs("p",{className:"mt-6 text-center text-sm text-gray-500 dark:text-gray-400",children:["Go to"," ",l.jsx(ze,{to:"/login",className:"font-semibold text-yellow-600 hover:text-yellow-700 dark:text-yellow-500 dark:hover:text-yellow-400",children:"Login"})]})]}):l.jsxs("div",{className:"rounded-2xl border border-gray-100 bg-white px-5 py-8 shadow-xl shadow-gray-200/60 dark:border-gray-700 dark:bg-gray-800 dark:shadow-gray-900/60 sm:px-8 sm:py-10",children:[l.jsx("div",{className:"mb-6 flex justify-center",children:l.jsx(He,{className:"h-12 w-auto text-gray-900 dark:text-gray-100",linkTo:"/"})}),l.jsx("h1",{className:"mb-2 text-center text-2xl font-bold text-gray-900 dark:text-gray-100",children:"Invalid Reset Link"}),l.jsx("p",{className:"mb-6 text-center text-sm text-gray-500 dark:text-gray-400",children:"This password reset link is invali
39d or has expired. Please request a new one."}),l.jsx("div",{className:"flex justify-center",children:l.jsx(ze,{to:"/forgot-password",className:"font-semibold text-yellow-600 hover:text-yellow-700 dark:text-yellow-500 dark:hover:text-yellow-400",children:"Request New Link"})})]})}export{nu as ForgotPasswordPage,tu as LoginPage,ru as RegisterPage,au as ResetPasswordPage,su as SocialCallbackPage,ou as VerifyOtpPage};
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.