PageSourceSearch

https://www.smallbizagent.ai/assets/verify-email-D8QhQcic.js

js smallbizagent.ai collected 2026-10-05 15:05:55 UTC 15,000 bytes, 25 lines download raw bytes

vendor: 5,279 bytes, lines 1-6
1import{r as e,j as n,e as We}from"./vendor-query-CnAhr2B8.js";import{c as Fe,az as te,g as Le,u as _e,ak as oe,bp as ve,p as He,q as Ve,n as xe,a8 as $e,r as Ge,aT as ze,s as qe,aE as be,o as Qe,aF as ye,B as Je}from"./index-CLUtDhnY.js";import"./vendor-ui-CYA7SV0W.js";import"./vendor-charts-CPMWc2oJ.js";import"./vendor-forms-UY-il7MQ.js";/**
2 * @license lucide-react v0.453.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const Ke=Fe("Dot",[["circle",{cx:"12.1",cy:"12.1",r:"1",key:"18d7e5"}]]);var Ue=Object.defineProperty,Xe=Object.defineProperties,Ze=Object.getOwnPropertyDescriptors,ne=Object.getOwnPropertySymbols,je=Object.prototype.hasOwnProperty,Se=Object.prototype.propertyIsEnumerable,we=(t,a,l)=>a in t?Ue(t,a,{enumerable:!0,configurable:!0,writable:!0,value:l}):t[a]=l,Ye=(t,a)=>{for(var l in a||(a={}))je.call(a,l)&&we(t,l,a[l]);if(ne)for(var l of ne(a))Se.call(a,l)&&we(t,l,a[l]);return t},et=(t,a)=>Xe(t,Ze(a)),tt=(t,a)=>{var l={};for(var o in t)je.call(t,o)&&a.indexOf(o)<0&&(l[o]=t[o]);if(t!=null&&ne)for(var o of ne(t))a.indexOf(o)<0&&Se.call(t,o)&&(l[o]=t[o]);return l};function nt(t){let a=setTimeout(t,0),l=setTimeout(t,10),o=setTimeout(t,50);return[a,l,o]}function rt(t){let a=e.useRef();return e.useEffect(()=>{a.current=t}),a.current}var at=18,Ce=40,lt=`${Ce}px`,st=["[data-lastpass-icon-root]","com-1password-button","[data-dashlanecreated]",'[style$="2147483647 !important;"]'].join(",");function it({containerRef:t,inputRef:a,pushPasswordManagerStrategy:l,isFocused:o}){let[v,c]=e.useState(!1),[C,f]=e.useState(!1),[T,R]=e.useState(!1),E=e.useMemo(()=>l==="none"?!1:(l==="increase-width"||l==="experimental-no-flickering")&&v&&C,[v,C,l]),O=e.useCallback(()=>{let h=t.current,P=a.current;if(!h||!P||T||l==="none")return;let m=h,y=m.getBoundingClientRect().left+m.offsetWidth,D=m.getBoundingClientRect().top+m.offsetHeight/2,i=y-at,I=D;document.querySelectorAll(st).length===0&&document.elementFromPoint(i,I)===h||(c(!0),R(!0))},[t,a,T,l]);return e.useEffect(()=>{let h=t.current;if(!h||l==="none")return;function P(){let y=window.innerWidth-h.getBoundingClientRect().right;f(y>=Ce)}P();let m=setInterval(P,1e3);return()=>{clearInterval(m)}},[t,l]),e.useEffect(()=>{let h=o||document.activeElement===a.current;if(l==="none"||!h)return;let P=setTimeout(O,0),m=setTimeout(O,2e3),y=setTimeout(O,5e3),D=setTimeout(()=>{R(!0)},6e3);return()=>{clearTimeout(P),clearTimeout(m),clearTimeout(y),clearTimeout(D)}},[a,o,l,O]),{hasPWMBadge:v,willPushPWMBadge:E,PWM_BADGE_SPACE_WIDTH:lt}}var Ee=e.createContext({}),Pe=e.forwardRef((t,a)=>{var l=t,{value:o,onChange:v,maxLength:c,textAlign:C="left",pattern:f,placeholder:T,inputMode:R="numeric",onComplete:E,pushPasswordManagerStrategy:O="increase-width",pasteTransformer:h,containerClassName:P,noScriptCSSFallback:m=ot,render:y,children:D}=l,i=tt(l,["value","onChange","maxLength","textAlign","pattern","placeholder","inputMode","onComplete","pushPasswordManagerStrategy","pasteTransformer","containerClassName","noScriptCSSFallback","render","children"]),I,X,Z,x,w;let[W,Te]=e.useState(typeof i.defaultValue=="string"?i.defaultValue:""),d=o??W,F=rt(d),q=e.useCallback(r=>{v==null||v(r),Te(r)},[v]),k=e.useMemo(()=>f?typeof f=="string"?new RegExp(f):f:null,[f]),p=e.useRef(null),re=e.useRef(null),ae=e.useRef({value:d,onChange:q,isIOS:typeof window<"u"&&((X=(I=window==null?void 0:window.CSS)==null?void 0:I.supports)==null?void 0:X.call(I,"-webkit-touch-callout","none"))}),Y=e.useRef({prev:[(Z=p.current)==null?void 0:Z.selectionStart,(x=p.current)==null?void 0:x.selectionEnd,(w=p.current)==null?void 0:w.selectionDirection]});e.useImperativeHandle(a,()=>p.current,[]),e.useEffect(()=>{let r=p.current,s=re.current;if(!r||!s)return;ae.current.value!==r.value&&ae.current.onChange(r.value),Y.current.prev=[r.selectionStart,r.selectionEnd,r.selectionDirection];function g(){if(document.activeElement!==r){J(null),K(null);return}let u=r.selectionStart,b=r.selectionEnd,ee=r.selectionDirection,N=r.maxLength,_=r.value,M=Y.current.prev,A=-1,B=-1,H;if(_.length!==0&&u!==null&&b!==null){let Ie=u===b,Ae=u===_.length&&_.length<N;if(Ie&&!Ae){let V=u;if(V===0)A=0,B=1,H="forward";else if(V===N)A=V-1,B=V,H="backward";else if(N>1&&_.length>1){let ie=0;if(M[0]!==null&&M[1]!==null){H=V<M[1]?"backward":"forward";let Be=M[0]===M[1]&&M[0]<N;H==="backward"&&!Be&&(ie=-1)}A=ie+V,B=ie+V+1}}A!==-1&&B!==-1&&A!==B&&p.current.setSelectionRange(A,B,H)}let he=A!==-1?A:u,ge=B!==-1?B:b,De=H??ee;J(he),K(ge),Y.current.prev=[he,ge,De]}if(document.addEventListener("selectionchange",g,{capture:!0}),g(),document.activeElement===r&&le(!0),!document.getElementById("input-otp-style")){let u=document.createElement("style");if(u.id="input-otp-style",document.head.appendChild(u),u.sheet){let b="background: transparent !important; color: transparent !important; border-color: transparent !important; opacity: 0 !important; box-shadow: none !important; -webkit-box-shadow: none !important; -webkit-text-fill-color: transparent !important;";U(u.sheet,"[data-input-otp]::selection { background: transparent !important; color: transparent !important; }"),U(u.sheet,`[data-input-otp]:autofill { ${b} }`),U(u.sheet,`[data-input-otp]:-webkit-autofill { ${b} }
6`),U(u.sheet,"@supports (-webkit-touch-callout: none) { [data-input-otp] { letter-spacing: -.6em !important; font-weight: 100 !important; font-stretch: ultra-condensed; font-optical-sizing: none !important; left: -1px !important; right: 1px !important; } }"),U(u.sheet,"[data-input-otp] + * { pointer-events: all !important; }")}}let j=()=>{s&&s.style.setProperty("--root-height",`${r.clientHeight}px`)};j();let S=new ResizeObserver(j);return S.observe(r),()=>{document.removeEventListener("selectionchange",g,{capture:!0}),S.disconnect()}},[]);let[ce,ue]=e.useState(!1),[Q,le]=e.useState(!1),[L,J]=e.useState(null),[G,K]=e.useState(null);e.useEffect(()=>{nt(()=>{var r,s,g,j;(r=p.current)==null||r.dispatchEvent(new Event("input"));let S=(s=p.current)==null?void 0:s.selectionStart,u=(g=p.current)==null?void 0:g.selectionEnd,b=(j=p.current)==null?void 0:j.selectionDirection;S!==null&&u!==null&&(J(S),K(u),Y.current.prev=[S,u,b])})},[d,Q]),e.useEffect(()=>{F!==void 0&&d!==F&&F.length<c&&d.length===c&&(E==null||E(d))},[c,E,F,d]);let z=it({containerRef:re,inputRef:p,pushPasswordManagerStrategy:O,isFocused:Q}),de=e.useCallback(r=>{let s=r.currentTarget.value.slice(0,c);if(s.length>0&&k&&!k.test(s)){r.preventDefault();return}
6typeof F=="string"&&s.length<F.length&&document.dispatchEvent(new Event("selectionchange")),q(s)},[c,q,F,k]),pe=e.useCallback(()=>{var r;if(p.current){let s=Math.min(p.current.value.length,c-1),g=p.current.value.length;(r=p.current)==null||r.setSelectionRange(s,g),J(s),K(g)}le(!0)},[c]),me=e.useCallback(r=>{var s,g;let j=p.current;if(!h&&(!ae.current.isIOS||!r.clipboardData||!j))return;let S=r.clipboardData.getData("text/plain"),u=h?h(S):S;r.preventDefault();let b=(s=p.current)==null?void 0:s.selectionStart,ee=(g=p.current)==null?void 0:g.selectionEnd,N=(b!==ee?d.slice(0,b)+u+d.slice(ee):d.slice(0,b)+u+d.slice(b)).slice(0,c);if(N.length>0&&k&&!k.test(N))return;j.value=N,q(N);let _=Math.min(N.length,c-1),M=N.length;j.setSelectionRange(_,M),J(_),K(M)},[c,q,k,d]),Re=e.useMemo(()=>({position:"relative",cursor:i.disabled?"default":"text",userSelect:"none",WebkitUserSelect:"none",pointerEvents:"none"}),[i.disabled]),fe=e.useMemo(()=>({position:"absolute",inset:0,width:z.willPushPWMBadge?`calc(100% + ${z.PWM_BADGE_SPACE_WIDTH})`:"100%",clipPath:z.willPushPWMBadge?`inset(0 ${z.PWM_BADGE_SPACE_WIDTH} 0 0)`:void 0,height:"100%",display:"flex",textAlign:C,opacity:"1",color:"transparent",pointerEvents:"all",background:"transparent",caretColor:"transparent",border:"0 solid transparent",outline:"0 solid transparent",boxShadow:"none",lineHeight:"1",letterSpacing:"-.5em",fontSize:"var(--root-height)",fontFamily:"monospace",fontVariantNumeric:"tabular-nums"}),[z.PWM_BADGE_SPACE_WIDTH,z.willPushPWMBadge,C]),Me=e.useMemo(()=>e.createElement("input",et(Ye({autoComplete:i.autoComplete||"one-time-code"},i),{"data-input-otp":!0,"data-input-otp-placeholder-shown":d.length===0||void 0,"data-input-otp-mss":L,"data-input-otp-mse":G,inputMode:R,pattern:k==null?void 0:k.source,"aria-placeholder":T,style:fe,maxLength:c,value:d,ref:p,onPaste:r=>{var s;me(r),(s=i.onPaste)==null||s.call(i,r)},onChange:de,onMouseOver:r=>{var s;ue(!0),(s=i.onMouseOver)==null||s.call(i,r)},onMouseLeave:r=>{var s;ue(!1),(s=i.onMouseLeave)==null||s.call(i,r)},onFocus:r=>{var s;pe(),(s=i.onFocus)==null||s.call(i,r)},onBlur:r=>{var s;le(!1),(s=i.onBlur)==null||s.call(i,r)}})),[de,pe,me,R,fe,c,G,L,i,k==null?void 0:k.source,d]),se=e.useMemo(()=>({slots:Array.from({length:c}).map((r,s)=>{var g;let j=Q&&L!==null&&G!==null&&(L===G&&s===L||s>=L&&s<G),S=d[s]!==void 0?d[s]:null,u=d[0]!==void 0?null:(g=T==null?void 0:T[s])!=null?g:null;return{char:S,placeholderChar:u,isActive:j,hasFakeCaret:j&&S===null}}),isFocused:Q,isHovering:!i.disabled&&ce}),[Q,ce,c,G,L,i.disabled,d]),Oe=e.useMemo(()=>y?y(se):e.createElement(Ee.Provider,{value:se},D),[D,se,y]);return e.createElement(e.Fragment,null,m!==null&&e.createElement("noscript",null,e.createElement("style",null,m)),e.createElement("div",{ref:re,"data-input-otp-container":!0,style:Re,className:P},Oe,e.createElement("div",{style:{position:"absolute",inset:0,pointerEvents:"none"}},Me)))});Pe.displayName="Input";function U(t,a){try{t.insertRule(a)}catch{console.error("input-otp could not insert CSS rule:",a)}}var ot=`
7[data-input-otp] {
8  --nojs-bg: white !important;
9  --nojs-fg: black !important;
10
11  background-color: var(--nojs-bg) !important;
12  color: var(--nojs-fg) !important;
13  caret-color: var(--nojs-fg) !important;
14  letter-spacing: .25em !important;
15  text-align: center !important;
16  border: 1px solid var(--nojs-fg) !important;
17  border-radius: 4px !important;
18  width: 100% !important;
19}
20@media (prefers-color-scheme: dark) {
21  [data-input-otp] {
22    --nojs-bg: black !important;
23    --nojs-fg: white !important;
24  }
25}`;const Ne=e.forwardRef(({className:t,containerClassName:a,...l},o)=>n.jsx(Pe,{ref:o,containerClassName:te("flex items-center gap-2 has-[:disabled]:opacity-50",a),className:te("disabled:cursor-not-allowed",t),...l}));Ne.displayName="InputOTP";const ke=e.forwardRef(({className:t,...a},l)=>n.jsx("div",{ref:l,className:te("flex items-center",t),...a}));ke.displayName="InputOTPGroup";const $=e.forwardRef(({index:t,className:a,...l},o)=>{const v=e.useContext(Ee),{char:c,hasFakeCaret:C,isActive:f}=v.slots[t];return n.jsxs("div",{ref:o,className:te("relative flex h-10 w-10 items-center justify-center border-y border-r border-input text-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md",f&&"z-10 ring-2 ring-ring ring-offset-background",a),...l,children:[c,C&&n.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:n.jsx("div",{className:"h-4 w-px animate-caret-blink bg-foreground duration-1000"})})]})});$.displayName="InputOTPSlot";const ct=e.forwardRef(({...t},a)=>n.jsx("div",{ref:a,role:"separator",...t,children:n.jsx(Ke,{})}));ct.displayName="InputOTPSeparator";function ht(){const{user:t,isLoading:a}=Le(),l=We(),[,o]=_e(),[v,c]=e.useState(""),[C,f]=e.useState(null),[T,R]=e.useState(!1),[E,O]=e.useState(!1),[h,P]=e.useState(!1),[m,y]=e.useState(0),[D,i]=e.useState(!1);if(e.useEffect(()=>{if(m>0){const x=setTimeout(()=>y(m-1),1e3);return()=>clearTimeout(x)}},[m]),e.useEffect(()=>{v.length===6&&X(v)},[v]),a)return n.jsx("div",{className:"min-h-screen flex items-center justify-center",children:n.jsx(oe,{className:"h-8 w-8 animate-spin text-muted-foreground"})});if(!t)return n.jsx(ve,{to:"/auth"});if(t.emailVerified)return n.jsx(ve,{to:t.businessId?"/":"/onboarding/subscription"});function I(){var W;const x={"Content-Type":"application/json"},w=(W=document.cookie.match(/(?:^|; )csrf-token=([^;]*)/))==null?void 0:W[1];return w&&(x["X-CSRF-Token"]=decodeURIComponent(w)),x}async function X(x){f(null),R(!0);try{const w=await fetch("/api/verify-email",{method:"POST",headers:I(),credentials:"include",body:JSON.stringify({email:t.email,code:x.trim()})}),W=await w.json();if(!w.ok){f(W.error||W.message||"Verification failed. Please try again."),c(""),R(!1);return}
25O(!0),await l.invalidateQueries({queryKey:["/api/user"]}),await l.refetchQueries({queryKey:["/api/user"]}),setTimeout(()=>{o("/onboarding/subscription")},1500)}catch{f("Something went wrong. Please try again."),c(""),R(!1)}}async function Z(){f(null),i(!1),P(!0);try{const x=await fetch("/api/resend-verification",{method:"POST",headers:I(),credentials:"include",body:JSON.stringify({email:t.email})}),w=await x.json();x.ok?(y(60),c(""),i(!0)):f(w.error||w.message||"Failed to resend code")}catch{f("Failed to resend code. Please try again later.")}finally{P(!1)}}return n.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gradient-to-br from-background to-muted p-4",children:n.jsxs(He,{className:"w-full max-w-md",children:[n.jsxs(Ve,{className:"text-center space-y-2",children:[n.jsx("div",{className:"mx-auto w-12 h-12 rounded-full bg-primary/10 flex items-center justify-center",children:E?n.jsx(xe,{className:"h-6 w-6 text-green-500"}):n.jsx($e,{className:"h-6 w-6 text-primary"})}),n.jsx(Ge,{className:"text-2xl",children:E?"Email Verified!":"Check your email"}),n.jsx(ze,{children:E?"Redirecting you to setup...":`We sent a 6-digit code to ${t.email}`}),!E&&n.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Don't see it? Check your spam or junk folder."})]}),!E&&n.jsxs(qe,{className:"space-y-6",children:[C&&n.jsxs(be,{variant:"destructive",children:[n.jsx(Qe,{className:"h-4 w-4"}),n.jsx(ye,{children:C})]}),D&&!C&&n.jsxs(be,{className:"border-green-200 bg-green-50 text-green-800",children:[n.jsx(xe,{className:"h-4 w-4 text-green-600"}),n.jsx(ye,{children:"New code sent! Check your email (and spam folder)."})]}),n.jsx("div",{className:"flex justify-center",children:n.jsx(Ne,{maxLength:6,value:v,onChange:c,disabled:T,children:n.jsxs(ke,{children:[n.jsx($,{index:0,className:"h-12 w-12 text-lg"}),n.jsx($,{index:1,className:"h-12 w-12 text-lg"}),n.jsx($,{index:2,className:"h-12 w-12 text-lg"}),n.jsx($,{index:3,className:"h-12 w-12 text-lg"}),n.jsx($,{index:4,className:"h-12 w-12 text-lg"}),n.jsx($,{index:5,className:"h-12 w-12 text-lg"})]})})}),T&&n.jsxs("div",{className:"flex items-center justify-center gap-2 text-muted-foreground",children:[n.jsx(oe,{className:"h-4 w-4 animate-spin"}),n.jsx("span",{children:"Verifying..."})]}),n.jsxs("div",{className:"text-center",children:[n.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"Didn't receive the code?"}),n.jsx(Je,{variant:"ghost",size:"sm",onClick:Z,disabled:h||m>0,children:h?n.jsxs(n.Fragment,{children:[n.jsx(oe,{className:"h-4 w-4 animate-spin mr-2"}),"Sending..."]}):m>0?`Resend code (${m}s)`:"Resend code"})]})]})]})})}export{ht as default};

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