1;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="515c7a94-551a-575d-824f-ab13ec3c3114")}catch(e){}}(); 2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,173554,973741,e=>{"use strict";var a=e.i(843476),t=e.i(271645);e.i(174080);var s=e.i(991918),r=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,r)=>{let i=(0,s.createSlot)(`Primitive.${r}`),l=t.forwardRef((e,t)=>{let{asChild:s,...l}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,a.jsx)(s?i:r,{...l,ref:t})});return l.displayName=`Primitive.${r}`,{...e,[r]:l}},{}),i=t.forwardRef((e,t)=>(0,a.jsx)(r.label,{...e,ref:t,onMouseDown:a=>{a.target.closest("button, input, select, textarea")||(e.onMouseDown?.(a),!a.defaultPrevented&&a.detail>1&&a.preventDefault())}}));i.displayName="Label",e.s(["Label",0,i,"Root",0,i],973741);var l=e.i(225913),n=e.i(956202);let o=(0,l.cva)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),c=t.forwardRef(({className:e,...t},s)=>(0,a.jsx)(i,{ref:s,className:(0,n.cn)(o(),e),...t}));c.displayName=i.displayName,e.s(["Label",0,c],173554)},856511,e=>{"use strict";var a=e.i(843476),t=e.i(271645),s=e.i(225913),r=e.i(956202);let i=(0,s.cva)("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",info:"bg-primary/10 text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),l=t.forwardRef(({className:e,variant:t,...s},l)=>(0,a.jsx)("div",{ref:l,role:"alert",className:(0,r.cn)(i({variant:t}),e),...s}));l.displayName="Alert";let n=t.forwardRef(({className:e,...t},s)=>(0,a.jsx)("h5",{ref:s,className:(0,r.cn)("mb-1 font-medium leading-none tracking-tight",e),...t}));n.displayName="AlertTitle";let o=t.forwardRef(({className:e,...t},s)=>(0,a.jsx)("p",{ref:s,className:(0,r.cn)("text-sm [&_p]:leading-relaxed",e),...t}));o.displayName="AlertDescription",e.s(["Alert",0,l,"AlertDescription",0,o,"AlertTitle",0,n])},591036,98919,e=>{"use strict";var a=e.i(615813);e.s(["TotpMultiFactorGenerator",()=>a.T],591036);let t=(0,e.i(475254).default)("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);e.s(["Shield",0,t],98919)},295534,94480,189988,194602,e=>{"use strict";var a=e.i(843476),t=e.i(264036),s=e.i(547608),r=e.i(313318),i=e.i(959411),l=e.i(948148),n=e.i(271645),o=e.i(477846),c=e.i(661584),d=e.i(464247),u=e.i(610012),g=e.i(173554),h=e.i(876581),m=e.i(321715),x=e.i(385228),p=e.i(819880),f=e.i(536296),v=e.i(241126);e.i(151718);var j=e.i(615813),j=j,w=j,y=e.i(117595),N=j,b=j,C=j;let k=()=>{let e=new N.X;return e.addScope("profile"),e.addScope("email"),e.setCustomParameters({display:"popup"}),e},L=async(e,a)=>(await (0,C.c)(e,a,b.k)).user,T=({className:e})=>(0,a.jsxs)("svg",{className:e,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[(0,a.jsx)("path",{fill:"#4285F4",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"}),(0,a.jsx)("path",{fill:"#34A853",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"}),(0,a.jsx)("path",{fill:"#FBBC05",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"}),(0,a.jsx)("path",{fill:"#EA4335",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"})]});var S=e.i(155683),I=e.i(856511),F=j,P=e.i(591036),A=e.i(98919),D=e.i(846696);function R({resolver:e,onSuccess:t,onCancel:s}
2){let r=(0,l.useTranslations)("auth.mfa"),[i,d]=(0,n.useState)(""),[h,m]=(0,n.useState)(0),x=e.hints.filter(e=>e.factorId===P.TotpMultiFactorGenerator.FACTOR_ID),[p,f]=(0,c.useLoadingCallback)(async()=>{if(!i||6!==i.length)throw Error(r("invalidCode"));let a=x[h];if(a.factorId===P.TotpMultiFactorGenerator.FACTOR_ID){let s=P.TotpMultiFactorGenerator.assertionForSignIn(a.uid,i);await e.resolveSignIn(s),await t()}else if(a.factorId===F.P.PHONE_SIGN_IN_METHOD)throw Error(r("phoneNotSupported"))},{errorTitle:r("verificationFailed"),onError:e=>"auth/invalid-verification-code"===e.code?(D.toast.error(r("invalidCodeError")),"skip-toast"):"auth/code-expired"===e.code?(D.toast.error(r("codeExpiredError")),"skip-toast"):void 0},[i,h,x,e,t]);return(0,a.jsxs)("div",{className:"space-y-4 w-full",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,a.jsx)(A.Shield,{className:"h-5 w-5 text-primary"}),(0,a.jsx)("h2",{className:"text-lg font-semibold",children:r("title")})]}),(0,a.jsx)(I.Alert,{children:(0,a.jsx)(I.AlertDescription,{children:r("description")})}),x.length>1&&(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(g.Label,{children:r("selectMethod")}),(0,a.jsx)("select",{className:"w-full p-2 border rounded-md",value:h,onChange:e=>m(Number(e.target.value)),children:x.map((e,t)=>(0,a.jsx)("option",{value:t,children:e.displayName||r("totpDevice",{index:t+1})},e.uid))})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(g.Label,{htmlFor:"verification-code",children:r("codeLabel")}),(0,a.jsx)(u.Input,{id:"verification-code",type:"text",placeholder:r("codePlaceholder"),value:i,onChange:(0,n.useCallback)(e=>{d(e.target.value.replace(/\D/g,"").slice(0,6))},[]),maxLength:6,className:"text-center text-2xl font-mono tracking-widest",disabled:f,onKeyDown:(0,n.useCallback)(e=>{"Enter"===e.key&&6===i.length&&p()},[i,p])}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:r("codeHint")})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[s&&(0,a.jsx)(o.LoadingButton,{variant:"outline",onClick:s,disabled:f,className:"flex-1",children:r("cancelButton")}),(0,a.jsx)(o.LoadingButton,{onClick:p,isLoading:f,disabled:!i||6!==i.length,className:"flex-1",children:r("verifyButton")})]})]})}function U({onSuccess:e,searchParams:s,showRegisterLink:r=!0,showForgotPasswordLink:i=!0,onRegisterClick:N}){let b=(0,l.useTranslations)("auth.login"),C=(0,l.useTranslations)("auth"),{getFirebaseAuth:I}=(0,f.useFirebaseAuth)(),F=(0,x.useTRPCClient)(),{logEvent:P,reportConversion:A,identifyUser:D}=(0,d.useClientTracker)(),[E,M]=n.useState(""),[B,H]=n.useState(""),[_,$]=n.useState(null),[G,q]=n.useState(!1),[O]=(0,S.useAutoAnimate)(),z=n.useMemo(()=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(E),[E]),V=(0,n.useCallback)(async a=>{let t=await F.auth.validateUser.mutate({token:a.token});D(t),await (0,p.login)(a.token),y.default.remove("is-impersonating-user"),A(d.ConversionType.SIGNUP,{transactionId:t.id,value:1,currency:"USD"}),await e?.()},[F,A,D,e]),[K,W]=(0,c.useLoadingCallback)(async()=>{P("auth.login.start",{mode:"email-password"});let e=I();try{let a=await (0,w.ab)(e,E,B),t=await a.user.getIdTokenResult();await V(t),P("auth.login.success",{mode:"email-password"})}catch(a){if("auth/multi-factor-auth-required"===a.code)$((0,j.as)(e,a)),q(!0),P("auth.login.mfa-required",{mode:"email-password"});else throw v.captureException(a,{extra:{email:E,mode:"email-password"}}),a}},{errorTitle:b("loginFailed")},[E,B,P,V]),[X,J]=(0,c.useLoadingCallback)(async()=>{P("auth.login.start",{mode:"google"});let e=I();try{let a=k(),t=await L(e,a),s=await t.getIdTokenResult();await V(s),P("auth.login.success",{mode:"google"})}catch(a){if("auth/multi-factor-auth-required"===a.code)$((0,j.as)(e,a)),q(!0),P("auth.login.mfa-required",{mode:"google"});else throw v.captureException(a,{extra:{mode:"google"}}),a}},{errorTitle:b("googleLoginFailed")},[P,V]),[Q]=(0,c.useLoadingCallback)(async()=>{let e=I();if(!e.currentUser)throw Error("No authenticated user found");let a=await e.currentUser.getIdTokenResult();await V(a),P("auth.login.mfa-success")},{errorTitle:b("mfaFailed")},[I,V,P]),Y=(0,n.useCallback)(()=>{q(!1),$(null),H("")},[]),Z=s?`?${s}`:"";return G&&_?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(t.CardHeader,{className:"text-center",children:[(0,a.jsx)(t.CardTitle,{children:b("mfaTitle")}),(0,a.jsx)(t.CardDescription,{className:"text-gray-500",children:b("mfaDescription")})]}),(0,a.jsx)(t.CardContent,{children:(0,a.jsx)(R,{resolver:_,onSuccess:Q,onCancel:Y})})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(t.CardHeader,{className:"text-center",children:[(0,a.jsx)(t.CardTitle,{children:b("title")}),r&&(0,a.jsxs)(t.CardDescription,{className:"text-gray-500",children:[b("noAccount")," ",N?(0,a.jsx)("button",{type:"button",onClick:N,className:"text-primary hover:underline",children:b("createAccount")}
2):(0,a.jsx)(m.Link,{href:`/auth/register${Z}`,className:"text-primary hover:underline",children:b("createAccount")})]})]}),(0,a.jsxs)(t.CardContent,{children:[(0,a.jsxs)("div",{ref:O,className:"flex flex-col items-center space-y-4",children:[(0,a.jsxs)("div",{className:"w-full space-y-2",children:[(0,a.jsx)(g.Label,{htmlFor:"login-email",children:b("emailLabel")}),(0,a.jsx)(u.Input,{id:"login-email",placeholder:b("emailPlaceholder"),required:!0,type:"email",value:E,disabled:W,onChange:e=>M(e.target.value)})]}),z&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"w-full space-y-2",children:[(0,a.jsx)(g.Label,{htmlFor:"login-password",children:b("passwordLabel")}),(0,a.jsx)(u.Input,{id:"login-password",required:!0,type:"password",placeholder:"********",value:B,disabled:W,onChange:e=>H(e.target.value)})]}),i&&(0,a.jsx)(m.Link,{href:`/auth/forgot-password${Z}`,className:"w-full text-sm text-center text-gray-600 hover:underline",children:b("forgotPassword")}),(0,a.jsx)(o.LoadingButton,{className:"w-full mt-4",onClick:K,isLoading:W,children:b("signIn")})]})]}),(0,a.jsxs)("div",{className:"flex items-center justify-center px-4 my-6 gap-4",children:[(0,a.jsx)(h.Separator,{className:"w-32"}),(0,a.jsx)("p",{className:"text-xs text-center text-gray-500 uppercase",children:C("or")}),(0,a.jsx)(h.Separator,{className:"w-32"})]}),(0,a.jsxs)(o.LoadingButton,{className:"w-full bg-white hover:bg-gray-50 text-gray-700 border border-gray-300 shadow-sm",variant:"outline",onClick:X,isLoading:J,children:[(0,a.jsx)(T,{className:"w-5 h-5 mr-2"}),C("continueWithGoogle")]}),(0,a.jsxs)("p",{className:"mt-8 text-xs text-center text-gray-500 dark:text-gray-400",children:[C("agreeTermsSignIn")," ",(0,a.jsx)(m.Link,{href:"/legal/terms",className:"underline",children:C("termsOfService")})," ",C("and")," ",(0,a.jsx)(m.Link,{href:"/legal/privacy",className:"underline",children:C("privacyPolicy")}),"."]})]})]})}e.s(["MFAChallenge",0,R],94480),e.s(["LoginForm",0,U],189988);var E=j,M=e.i(720565);function B({onSuccess:e,searchParams:s,showLoginLink:r=!0,onLoginClick:i}){let v=(0,l.useTranslations)("auth.register"),j=(0,l.useTranslations)("auth"),{getFirebaseAuth:w}=(0,f.useFirebaseAuth)(),y=(0,x.useTRPCClient)(),{logEvent:N,reportConversion:b,identifyUser:C}=(0,d.useClientTracker)(),I=(0,M.usePostHog)(),[F,P]=n.useState(""),[A,D]=n.useState(""),[R,U]=n.useState(""),[H]=(0,S.useAutoAnimate)(),_=n.useMemo(()=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(A),[A]),[$,G]=(0,c.useLoadingCallback)(async()=>{N("auth.register.start",{mode:"email-password"});let a=w(),t=await (0,E.aa)(a,A,R),s=await t.user.getIdTokenResult(),r=await y.auth.validateUser.mutate({token:s.token,name:F,phDistinctId:I.get_distinct_id()});C(r),await (0,p.login)(s.token),b(d.ConversionType.SIGNUP,{transactionId:r.id,value:1,currency:"USD"}),N("auth.register.success",{mode:"email-password"}),await e?.()},{errorTitle:v("registrationFailed")},[A,R,F,N,I,y,e]),[q,O]=(0,c.useLoadingCallback)(async()=>{N("auth.register.start",{mode:"google"});let a=w(),t=k(),s=await L(a,t),r=await s.getIdTokenResult(),i=await y.auth.validateUser.mutate({token:r.token,name:F,phDistinctId:I.get_distinct_id()});C(i),await (0,p.login)(r.token),b(d.ConversionType.SIGNUP,{transactionId:i.id,value:1,currency:"USD"}),N("auth.register.success",{mode:"google"}),await e?.()},{errorTitle:v("googleLoginFailed")},[N,I,y,F,e]),z=s?`?${s}`:"";return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(t.CardHeader,{className:"text-center",children:[(0,a.jsx)(t.CardTitle,{children:v("title")}),r&&(0,a.jsxs)(t.CardDescription,{className:"text-gray-500",children:[v("hasAccount")," ",i?(0,a.jsx)("button",{type:"button",onClick:i,className:"text-primary hover:underline",children:v("signInHere")}):(0,a.jsx)(m.Link,{href:`/auth/login${z}`,className:"text-primary hover:underline",children:v("signInHere")})]})]}),(0,a.jsxs)(t.CardContent,{children:[(0,a.jsxs)("div",{ref:H,className:"space-y-4",children:[(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(g.Label,{htmlFor:"register-email",children:v("emailLabel")}),(0,a.jsx)(u.Input,{id:"register-email",placeholder:v("emailPlaceholder"),required:!0,type:"email",value:A,disabled:G,onChange:e=>D(e.target.value)})]}),_&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(g.Label,{htmlFor:"register-password",children:v("passwordLabel")}),(0,a.jsx)(u.Input,{id:"register-password",required:!0,type:"password",placeholder:"********",value:R,disabled:G,onChange:e=>U(e.target.value)})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(g.Label,{htmlFor:"register-name",children:v("nameLabel")}),(0,a.jsx)(u.Input,{id:"register-name",placeholder:v("namePlaceholder"),value:F,onChange:e=>P(e.target.value),required:!0})]}),(0,a.jsx)(o.LoadingButton,{className:"w-full",onClick:$,isLoading:G,children:v("signUp")})]})]}),(0,a.jsxs)("div",{className:"flex items-center justify-center px-4 my-6 gap-4",children:[(0,a.jsx)(h.Separator,{className:"w-32"}),(0,a.jsx)("p",{className:"text-xs text-center text-gray-500 uppercase",children:j("or")}),(0,a.jsx)(h.Separator,{className:"w-32"})]}),(0,a.jsxs)(o.LoadingButton,{className:"w-full bg-white hover:bg-gray-50 text-gray-700 border border-gray-300 shadow-sm",variant:"outline",onClick:q,isLoading:O,children:[(0,a.jsx)(T,{className:"w-5 h-5 mr-2"}),j("continueWithGoogle")]}),(0,a.jsxs)("p",{className:"mt-8 text-xs text-center text-gray-500 dark:text-gray-400",children:[j("agreeTermsSignUp")," ",(0,a.jsx)(m.Link,{href:"/legal/terms",className:"underline",children:j("termsOfService")})," ",j("and")," ",(0,a.jsx)(m.Link,{href:"/legal/privacy",className:"underline",children:j("privacyPolicy")}),"."]})]})]})}e.s(["RegisterForm",0,B],194602),e.s(["AuthDialog",0,function({open:e,onOpenChange:o,defaultTab:c="register",onSuccess:d}
2){let u=(0,l.useTranslations)("auth"),[g,h]=(0,n.useState)(c);(0,n.useEffect)(()=>{e&&h(c)},[e,c]);let m=async()=>{await d?.(),o(!1)};return(0,a.jsx)(s.Dialog,{open:e,onOpenChange:o,children:(0,a.jsxs)(s.DialogContent,{className:"sm:max-w-[425px] p-0 gap-0",showCloseButton:!1,children:[(0,a.jsxs)(i.VisuallyHidden,{children:[(0,a.jsx)(s.DialogTitle,{children:u("login"===g?"signIn":"createAccount")}),(0,a.jsx)(s.DialogDescription,{children:u("login"===g?"signInDescription":"createAccountDescription")})]}),(0,a.jsx)(r.Tabs,{value:g,onValueChange:e=>h(e),className:"w-full",children:(0,a.jsxs)(t.Card,{className:"border-0 shadow-none rounded-t-none",children:[(0,a.jsx)(r.TabsContent,{value:"login",className:"mt-0",children:(0,a.jsx)(U,{onSuccess:m,showRegisterLink:!0,onRegisterClick:()=>h("register")})}),(0,a.jsx)(r.TabsContent,{value:"register",className:"mt-0",children:(0,a.jsx)(B,{onSuccess:m,showLoginLink:!0,onLoginClick:()=>h("login")})})]})})]})})},"useAuthDialog",0,function(){let[e,a]=(0,n.useState)(!1),[t,s]=(0,n.useState)("login");return{open:e,defaultTab:t,setOpen:a,openLogin:()=>{s("login"),a(!0)},openRegister:()=>{s("register"),a(!0)},close:()=>a(!1)}}],295534)},25615,922528,e=>{"use strict";e.i(189988),e.i(194602),e.i(94480),e.i(295534),e.s([],25615);var a=e.i(247167),t=e.i(184561);a.default.env.NEXT_PUBLIC_APP_URL,e.s(["stripLocalePrefix",0,function(e){let a=RegExp(`^/(${t.locales.join("|")})(/|$)`);return e.replace(a,"/")}],922528)},498725,e=>{"use strict";var a=e.i(843476);e.i(25615);var t=e.i(189988),s=e.i(321715),r=e.i(922528),i=e.i(784505),l=e.i(618566),n=e.i(271645);function o(){let e=(0,s.useRouter)(),o=(0,l.useSearchParams)(),c=o?.get("redirect"),d=(0,n.useCallback)(async()=>{let a=c?(0,r.stripLocalePrefix)(c):i.dashboardPath();e.push(a),e.refresh(),await new Promise(e=>setTimeout(e,1e4))},[c,e]);return(0,a.jsx)(t.LoginForm,{onSuccess:d,searchParams:o?.toString(),showRegisterLink:!0,showForgotPasswordLink:!0})}e.s(["default",0,function(){return(0,a.jsx)(n.Suspense,{fallback:null,children:(0,a.jsx)(o,{})})}])}]); 3 4//# debugId=515c7a94-551a-575d-824f-ab13ec3c3114
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.