vendor: 4,520 bytes, lines 1-6
1import{Y as Be,r as t,j as e,aq as K,k as le,o as be,Q as oe,R as se,_ as Ge,q as U,bI as He}from"./index-DWX5XK1n.js";import{A as we}from"./AuthLayout-D1rynoss.js";import{G as $e}from"./GoogleIcon-D8R-oOvk.js";import{M as ye}from"./mail-Yb5pNdWg.js";import{U as qe}from"./user-plus-Cn8Rlkw9.js";import{L as je}from"./lock-C8XmMHqt.js";/** 2 * @license lucide-react v0.475.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 Ve=[["path",{d:"M5 12h14",key:"1ays0h"}]],ze=Be("Minus",Ve);var Ue=Object.defineProperty,Qe=Object.defineProperties,Ye=Object.getOwnPropertyDescriptors,X=Object.getOwnPropertySymbols,Se=Object.prototype.hasOwnProperty,Pe=Object.prototype.propertyIsEnumerable,Ce=(n,r,l)=>r in n?Ue(n,r,{enumerable:!0,configurable:!0,writable:!0,value:l}):n[r]=l,Ze=(n,r)=>{for(var l in r||(r={}))Se.call(r,l)&&Ce(n,l,r[l]);if(X)for(var l of X(r))Pe.call(r,l)&&Ce(n,l,r[l]);return n},Je=(n,r)=>Qe(n,Ye(r)),Ke=(n,r)=>{var l={};for(var s in n)Se.call(n,s)&&r.indexOf(s)<0&&(l[s]=n[s]);if(n!=null&&X)for(var s of X(n))r.indexOf(s)<0&&Pe.call(n,s)&&(l[s]=n[s]);return l};function Xe(n){let r=setTimeout(n,0),l=setTimeout(n,10),s=setTimeout(n,50);return[r,l,s]}function et(n){let r=t.useRef();return t.useEffect(()=>{r.current=n}),r.current}var tt=18,Ee=40,nt=`${Ee}px`,at=["[data-lastpass-icon-root]","com-1password-button","[data-dashlanecreated]",'[style$="2147483647 !important;"]'].join(",");function rt({containerRef:n,inputRef:r,pushPasswordManagerStrategy:l,isFocused:s}){let[b,d]=t.useState(!1),[w,h]=t.useState(!1),[C,E]=t.useState(!1),D=t.useMemo(()=>l==="none"?!1:(l==="increase-width"||l==="experimental-no-flickering")&&b&&w,[b,w,l]),R=t.useCallback(()=>{let f=n.current,N=r.current;if(!f||!N||C||l==="none")return;let g=f,S=g.getBoundingClientRect().left+g.offsetWidth,O=g.getBoundingClientRect().top+g.offsetHeight/2,i=S-tt,c=O;document.querySelectorAll(at).length===0&&document.elementFromPoint(i,c)===f||(d(!0),E(!0))},[n,r,C,l]);return t.useEffect(()=>{let f=n.current;if(!f||l==="none")return;function N(){let S=window.innerWidth-f.getBoundingClientRect().right;h(S>=Ee)}N();let g=setInterval(N,1e3);return()=>{clearInterval(g)}},[n,l]),t.useEffect(()=>{let f=s||document.activeElement===r.current;if(l==="none"||!f)return;let N=setTimeout(R,0),g=setTimeout(R,2e3),S=setTimeout(R,5e3),O=setTimeout(()=>{E(!0)},6e3);return()=>{clearTimeout(N),clearTimeout(g),clearTimeout(S),clearTimeout(O)}},[r,s,l,R]),{hasPWMBadge:b,willPushPWMBadge:D,PWM_BADGE_SPACE_WIDTH:nt}}var Ne=t.createContext({}),ke=t.forwardRef((n,r)=>{var l=n,{value:s,onChange:b,maxLength:d,textAlign:w="left",pattern:h,placeholder:C,inputMode:E="numeric",onComplete:D,pushPasswordManagerStrategy:R="increase-width",pasteTransformer:f,containerClassName:N,noScriptCSSFallback:g=lt,render:S,children:O}=l,i=Ke(l,["value","onChange","maxLength","textAlign","pattern","placeholder","inputMode","onComplete","pushPasswordManagerStrategy","pasteTransformer","containerClassName","noScriptCSSFallback","render","children"]),c,Y,ie,ue,ce;let[Oe,Te]=t.useState(typeof i.defaultValue=="string"?i.defaultValue:""),p=s??Oe,F=et(p),$=t.useCallback(a=>{b==null||b(a),Te(a)},[b]),k=t.useMemo(()=>h?typeof h=="string"?new RegExp(h):h:null,[h]),m=t.useRef(null),ee=t.useRef(null),te=t.useRef({value:p,onChange:$,isIOS:typeof window<"u"&&((Y=(c=window==null?void 0:window.CSS)==null?void 0:c.supports)==null?void 0:Y.call(c,"-webkit-touch-callout","none"))}),Z=t.useRef({prev:[(ie=m.current)==null?void 0:ie.selectionStart,(ue=m.current)==null?void 0:ue.selectionEnd,(ce=m.current)==null?void 0:ce.selectionDirection]});t.useImperativeHandle(r,()=>m.current,[]),t.useEffect(()=>{let a=m.current,o=ee.current;if(!a||!o)return;te.current.value!==a.value&&te.current.onChange(a.value),Z.current.prev=[a.selectionStart,a.selectionEnd,a.selectionDirection];function v(){if(document.activeElement!==a){V(null),z(null);return}let u=a.selectionStart,x=a.selectionEnd,J=a.selectionDirection,P=a.maxLength,W=a.value,M=Z.current.prev,T=-1,I=-1,L;if(W.length!==0&&u!==null&&x!==null){let We=u===x,Le=u===W.length&&W.length<P;if(We&&!Le){let _=u;if(_===0)T=0,I=1,L="forward";else if(_===P)T=_-1,I=_,L="backward";else if(P>1&&W.length>1){let re=0;if(M[0]!==null&&M[1]!==null){L=_<M[1]?"backward":"forward";let _e=M[0]===M[1]&&M[0]<P;L==="backward"&&!_e&&(re=-1)}T=re+_,I=re+_+1}}T!==-1&&I!==-1&&T!==I&&m.current.setSelectionRange(T,I,L)}let ge=T!==-1?T:u,xe=I!==-1?I:x,Ae=L??J;
6V(ge),z(xe),Z.current.prev=[ge,xe,Ae]}if(document.addEventListener("selectionchange",v,{capture:!0}),v(),document.activeElement===a&&ne(!0),!document.getElementById("input-otp-style")){let u=document.createElement("style");if(u.id="input-otp-style",document.head.appendChild(u),u.sheet){let x="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;";Q(u.sheet,"[data-input-otp]::selection { background: transparent !important; color: transparent !important; }"),Q(u.sheet,`[data-input-otp]:autofill { ${x} }`),Q(u.sheet,`[data-input-otp]:-webkit-autofill { ${x} }`),Q(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; } }"),Q(u.sheet,"[data-input-otp] + * { pointer-events: all !important; }")}}let y=()=>{o&&o.style.setProperty("--root-height",`${a.clientHeight}px`)};y();let j=new ResizeObserver(y);return j.observe(a),()=>{document.removeEventListener("selectionchange",v,{capture:!0}),j.disconnect()}},[]);let[de,pe]=t.useState(!1),[q,ne]=t.useState(!1),[A,V]=t.useState(null),[G,z]=t.useState(null);t.useEffect(()=>{Xe(()=>{var a,o,v,y;(a=m.current)==null||a.dispatchEvent(new Event("input"));let j=(o=m.current)==null?void 0:o.selectionStart,u=(v=m.current)==null?void 0:v.selectionEnd,x=(y=m.current)==null?void 0:y.selectionDirection;j!==null&&u!==null&&(V(j),z(u),Z.current.prev=[j,u,x])})},[p,q]),t.useEffect(()=>{F!==void 0&&p!==F&&F.length<d&&p.length===d&&(D==null||D(p))},[d,D,F,p]);let H=rt({containerRef:ee,inputRef:m,pushPasswordManagerStrategy:R,isFocused:q}),me=t.useCallback(a=>{let o=a.currentTarget.value.slice(0,d);if(o.length>0&&k&&!k.test(o)){a.preventDefault();return}typeof F=="string"&&o.length<F.length&&document.dispatchEvent(new Event("selectionchange")),$(o)},[d,$,F,k]),he=t.useCallback(()=>{var a;if(m.current){let o=Math.min(m.current.value.length,d-1),v=m.current.value.length;(a=m.current)==null||a.setSelectionRange(o,v),V(o),z(v)}ne(!0)},[d]),fe=t.useCallback(a=>{var o,v;let y=m.current;if(!f&&(!te.current.isIOS||!a.clipboardData||!y))return;let j=a.clipboardData.getData("text/plain"),u=f?f(j):j;a.preventDefault();let x=(o=m.current)==null?void 0:o.selectionStart,J=(v=m.current)==null?void 0:v.selectionEnd,P=(x!==J?p.slice(0,x)+u+p.slice(J):p.slice(0,x)+u+p.slice(x)).slice(0,d);if(P.length>0&&k&&!k.test(P))return;y.value=P,$(P);let W=Math.min(P.length,d-1),M=P.length;y.setSelectionRange(W,M),V(W),z(M)},[d,$,k,p]),Ie=t.useMemo(()=>({position:"relative",cursor:i.disabled?"default":"text",userSelect:"none",WebkitUserSelect:"none",pointerEvents:"none"}),[i.disabled]),ve=t.useMemo(()=>({position:"absolute",inset:0,width:H.willPushPWMBadge?`calc(100% + ${H.PWM_BADGE_SPACE_WIDTH})`:"100%",clipPath:H.willPushPWMBadge?`inset(0 ${H.PWM_BADGE_SPACE_WIDTH} 0 0)`:void 0,height:"100%",display:"flex",textAlign:w,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"}),[H.PWM_BADGE_SPACE_WIDTH,H.willPushPWMBadge,w]),De=t.useMemo(()=>t.createElement("input",Je(Ze({autoComplete:i.autoComplete||"one-time-code"},i),{"data-input-otp":!0,"data-input-otp-placeholder-shown":p.length===0||void 0,"data-input-otp-mss":A,"data-input-otp-mse":G,inputMode:E,pattern:k==null?void 0:k.source,"aria-placeholder":C,style:ve,maxLength:d,value:p,ref:m,onPaste:a=>{var o;fe(a),(o=i.onPaste)==null||o.call(i,a)},onChange:me,onMouseOver:a=>{var o;pe(!0),(o=i.onMouseOver)==null||o.call(i,a)},onMouseLeave:a=>{var o;pe(!1),(o=i.onMouseLeave)==null||o.call(i,a)},onFocus:a=>{var o;he(),(o=i.onFocus)==null||o.call(i,a)},onBlur:a=>{var o;ne(!1),(o=i.onBlur)==null||o.call(i,a)}})),[me,he,fe,E,ve,d,G,A,i,k==null?void 0:k.source,p]),ae=t.useMemo(()=>({slots:Array.from({length:d}).map((a,o)=>{var v;let y=q&&A!==null&&G!==null&&(A===G&&o===A||o>=A&&o<G),j=p[o]!==void 0?p[o]:null,u=p[0]!==void 0?null:(v=C==null?void 0:C[o]
6)!=null?v:null;return{char:j,placeholderChar:u,isActive:y,hasFakeCaret:y&&j===null}}),isFocused:q,isHovering:!i.disabled&&de}),[q,de,d,G,A,i.disabled,p]),Fe=t.useMemo(()=>S?S(ae):t.createElement(Ne.Provider,{value:ae},O),[O,ae,S]);return t.createElement(t.Fragment,null,g!==null&&t.createElement("noscript",null,t.createElement("style",null,g)),t.createElement("div",{ref:ee,"data-input-otp-container":!0,style:Ie,className:N},Fe,t.createElement("div",{style:{position:"absolute",inset:0,pointerEvents:"none"}},De)))});ke.displayName="Input";function Q(n,r){try{n.insertRule(r)}catch{console.error("input-otp could not insert CSS rule:",r)}}var lt=` 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 Me=t.forwardRef(({className:n,containerClassName:r,...l},s)=>e.jsx(ke,{ref:s,containerClassName:K("flex items-center gap-2 has-[:disabled]:opacity-50",r),className:K("disabled:cursor-not-allowed",n),...l}));Me.displayName="InputOTP";const Re=t.forwardRef(({className:n,...r},l)=>e.jsx("div",{ref:l,className:K("flex items-center",n),...r}));Re.displayName="InputOTPGroup";const B=t.forwardRef(({index:n,className:r,...l},s)=>{const b=t.useContext(Ne),{char:d,hasFakeCaret:w,isActive:h}=b.slots[n];return e.jsxs("div",{ref:s,className:K("relative flex h-9 w-9 items-center justify-center border-y border-r border-input text-sm shadow-sm transition-all first:rounded-l-md first:border-l last:rounded-r-md",h&&"z-10 ring-1 ring-ring",r),...l,children:[d,w&&e.jsx("div",{className:"pointer-events-none absolute inset-0 flex items-center justify-center",children:e.jsx("div",{className:"h-4 w-px animate-caret-blink bg-foreground duration-1000"})})]})});B.displayName="InputOTPSlot";const ot=t.forwardRef(({...n},r)=>e.jsx("div",{ref:r,role:"separator",...n,children:e.jsx(ze,{})}));ot.displayName="InputOTPSeparator";function mt(){const[n,r]=t.useState(""),[l,s]=t.useState(""),[b,d]=t.useState(""),[w,h]=t.useState(""),[C,E]=t.useState(!1),[D,R]=t.useState(!1),[f,N]=t.useState(""),g=async c=>{if(c.preventDefault(),h(""),l!==b){h("Passwords do not match");return}E(!0);try{await U.auth.register({email:n,password:l}),R(!0)}catch(Y){h(Y.message||"Registration failed")}finally{E(!1)}},S=async()=>{h(""),E(!0);try{const c=await U.auth.verifyOtp({email:n,otpCode:f});c!=null&&c.access_token&&U.auth.setToken(c.access_token),window.location.href="/"}catch(c){h(c.message||"Invalid verification code")}finally{E(!1)}},O=async()=>{h("");try{await U.auth.resendOtp(n),He({title:"Code sent",description:"Check your email for the new code."})}catch(c){h(c.message||"Failed to resend code")}},i=()=>{U.auth.loginWithProvider("google","/")};return D?e.jsxs(we,{icon:ye,title:"Verify your email",subtitle:`We sent a code to ${n}`,children:[w&&e.jsx("div",{className:"mb-4 p-3 rounded-lg bg-destructive/10 text-destructive text-sm",children:w}),e.jsx("div",{className:"flex justify-center mb-6",children:e.jsx(Me,{maxLength:6,value:f,onChange:N,autoFocus:!0,autoComplete:"one-time-code",children:e.jsxs(Re,{children:[e.jsx(B,{index:0}),e.jsx(B,{index:1}),e.jsx(B,{index:2}),e.jsx(B,{index:3}),e.jsx(B,{index:4}),e.jsx(B,{index:5})]})})}),e.jsx(le,{className:"w-full h-12 font-medium",onClick:S,disabled:C||f.length<6,children:C?e.jsxs(e.Fragment,{children:[e.jsx(be,{className:"w-4 h-4 mr-2 animate-spin"}),"Verifying..."]}):"Verify"}),e.jsxs("p",{className:"text-center text-sm text-muted-foreground mt-4",children:["Didn't receive the code?"," ",e.jsx("button",{onClick:O,className:"text-primary font-medium hover:underline",children:"Resend"})]})]}):e.jsxs(we,{icon:qe,title:"Create your account",subtitle:"Sign up to get started",footer
25:e.jsxs(e.Fragment,{children:["Already have an account?"," ",e.jsx(Ge,{to:"/login",className:"text-primary font-medium hover:underline",children:"Log in"})]}),children:[e.jsxs(le,{variant:"outline",className:"w-full h-12 text-sm font-medium mb-6",onClick:i,children:[e.jsx($e,{className:"w-5 h-5 mr-2"}),"Continue with Google"]}),e.jsxs("div",{className:"relative mb-6",children:[e.jsx("div",{className:"absolute inset-0 flex items-center",children:e.jsx("div",{className:"w-full border-t border-border"})}),e.jsx("div",{className:"relative flex justify-center text-xs uppercase",children:e.jsx("span",{className:"bg-card px-3 text-muted-foreground",children:"or"})})]}),w&&e.jsx("div",{className:"mb-4 p-3 rounded-lg bg-destructive/10 text-destructive text-sm",children:w}),e.jsxs("form",{onSubmit:g,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(oe,{htmlFor:"email",children:"Email"}),e.jsxs("div",{className:"relative",children:[e.jsx(ye,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground","aria-hidden":"true"}),e.jsx(se,{id:"email",type:"email",autoComplete:"email",autoFocus:!0,placeholder:"[email protected]",value:n,onChange:c=>r(c.target.value),className:"pl-10 h-12",required:!0})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(oe,{htmlFor:"password",children:"Password"}),e.jsxs("div",{className:"relative",children:[e.jsx(je,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground","aria-hidden":"true"}),e.jsx(se,{id:"password",type:"password",autoComplete:"new-password",placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢",value:l,onChange:c=>s(c.target.value),className:"pl-10 h-12",required:!0})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(oe,{htmlFor:"confirm",children:"Confirm Password"}),e.jsxs("div",{className:"relative",children:[e.jsx(je,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground","aria-hidden":"true"}),e.jsx(se,{id:"confirm",type:"password",autoComplete:"new-password",placeholder:"â¢â¢â¢â¢â¢â¢â¢â¢",value:b,onChange:c=>d(c.target.value),className:"pl-10 h-12",required:!0})]})]}),e.jsx(le,{type:"submit",className:"w-full h-12 font-medium",disabled:C,children:C?e.jsxs(e.Fragment,{children:[e.jsx(be,{className:"w-4 h-4 mr-2 animate-spin"}),"Creating account..."]}):"Create account"})]})]})}export{mt 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.