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]="2c03c0c0-73d2-6163-a769-f489849347f4")}catch(e){}}(); 2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,519491,e=>{"use strict";var t=e.i(843476),r=e.i(482568),a=e.i(618566),s=e.i(271645),o=e.i(511152),i=e.i(984828),n=e.i(940141);function l(e){return(0,n.GenIcon)({tag:"svg",attr:{version:"1.1",x:"0px",y:"0px",viewBox:"0 0 48 48",enableBackground:"new 0 0 48 48"},child:[{tag:"path",attr:{fill:"#FFC107",d:"M43.611,20.083H42V20H24v8h11.303c-1.649,4.657-6.08,8-11.303,8c-6.627,0-12-5.373-12-12\r\n c0-6.627,5.373-12,12-12c3.059,0,5.842,1.154,7.961,3.039l5.657-5.657C34.046,6.053,29.268,4,24,4C12.955,4,4,12.955,4,24\r\n c0,11.045,8.955,20,20,20c11.045,0,20-8.955,20-20C44,22.659,43.862,21.35,43.611,20.083z"},child:[]},{tag:"path",attr:{fill:"#FF3D00",d:"M6.306,14.691l6.571,4.819C14.655,15.108,18.961,12,24,12c3.059,0,5.842,1.154,7.961,3.039l5.657-5.657\r\n C34.046,6.053,29.268,4,24,4C16.318,4,9.656,8.337,6.306,14.691z"},child:[]},{tag:"path",attr:{fill:"#4CAF50",d:"M24,44c5.166,0,9.86-1.977,13.409-5.192l-6.19-5.238C29.211,35.091,26.715,36,24,36\r\n c-5.202,0-9.619-3.317-11.283-7.946l-6.522,5.025C9.505,39.556,16.227,44,24,44z"},child:[]},{tag:"path",attr:{fill:"#1976D2",d:"M43.611,20.083H42V20H24v8h11.303c-0.792,2.237-2.231,4.166-4.087,5.571\r\n c0.001-0.001,0.002-0.001,0.003-0.002l6.19,5.238C36.971,39.205,44,34,44,24C44,22.659,43.862,21.35,43.611,20.083z"},child:[]}]})(e)}var c=e.i(846696),d=e.i(761685),u=e.i(391801),m=e.i(43664),f=e.i(867919),p=e.i(595749),g=e.i(415356),h=e.i(487486),x=e.i(519455),b=e.i(793479),j=e.i(772436),v=e.i(414877),w=e.i(659619),N=e.i(666930),y=e.i(774711),C=e.i(79451),P=e.i(661155),S=e.i(250908);function T(){return(0,t.jsxs)("div",{className:"my-6 flex items-start gap-3 rounded-3xl border border-border bg-muted/50 p-4 text-sm",role:"note",children:[(0,t.jsx)(m.Info,{className:"mt-0.5 h-5 w-5 text-muted-foreground"}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("p",{children:"Google, X and Apple sign-in need a newer version of the FeedNest app. For now, sign in with your email below."}),(0,t.jsx)("a",{className:"font-medium text-foreground underline underline-offset-4",href:S.GOOGLE_PLAY_URL,children:"Check for an update on Google Play"})]})]})}var k=e.i(975157);function X(e){return RegExp("^\\d{6}$").test(e)}function O({value:e,onChange:r,onComplete:a,length:o=6,disabled:i,autoFocus:n,ariaLabel:l}){let c=(0,s.useRef)(null),[d,u]=(0,s.useState)(!1),[m,f]=(0,s.useState)(0),p=(0,s.useMemo)(()=>Array.from({length:o},(e,t)=>`otp-slot-${t}`),[o]),g=()=>{let t=c.current;t&&f(t.selectionStart??e.length)},h=Math.min(m,o-1);return(0,t.jsxs)("div",{className:"relative w-full",children:[(0,t.jsx)("input",{"aria-label":l,autoComplete:"one-time-code",autoFocus:!!n,className:"absolute inset-0 z-10 w-full bg-transparent text-center text-transparent caret-transparent outline-none selection:bg-transparent disabled:cursor-not-allowed",disabled:i,id:"otp",inputMode:"numeric",maxLength:o,name:"otp",onBlur:()=>u(!1),onChange:e=>{let t=e.target.value.replace(/\D/g,"").slice(0,6);r(t),f(t.length),t.length===o&&a?.(t)},onFocus:()=>{u(!0),g()},onSelect:g,pattern:"[0-9]*",ref:c,type:"text",value:e}),(0,t.jsx)("div",{"aria-hidden":"true",className:"flex items-center justify-center gap-2 sm:gap-3",children:p.map((r,a)=>{let s=e[a]??"",o=d&&a===h;return(0,t.jsx)("div",{className:(0,k.cn)("relative flex h-14 min-w-0 flex-1 items-center justify-center border-b-2 bg-transparent text-center font-semibold text-2xl text-foreground transition-colors",o?"border-primary":"border-border",i&&"opacity-50"),children:s||(o?(0,t.jsx)("span",{className:"h-7 w-px animate-caret-blink bg-foreground"}):null)},r)})})]})}function L({email:e}){let r=(0,y.createClient)(),[a,o]=(0,s.useState)(""),[i,n]=(0,s.useState)(!1),[l,d]=(0,s.use
2State)(!1),[u,p]=(0,s.useState)(60);(0,s.useEffect)(()=>{if(u<=0)return;let e=setTimeout(()=>p(e=>e-1),1e3);return()=>clearTimeout(e)},[u]);let g=async(s=a)=>{if(!X(s)||i)return;n(!0);let{error:l}=await r.auth.verifyOtp({email:e,token:s,type:"email"});if(l){n(!1),o(""),c.toast.error("That code is invalid or expired. Try again.",{position:(0,P.getCurrentToastPosition)(),className:"gap-1",icon:(0,t.jsx)(m.CircleX,{className:"h-5 w-5",color:"#d32f2f"})});return}window.location.href="/dashboard/feeds"},h=async()=>{if(u>0||l)return;d(!0);let{error:a}=await r.auth.signInWithOtp({email:e,options:{shouldCreateUser:!0}});(d(!1),a)?c.toast.error(a.message,{position:(0,P.getCurrentToastPosition)(),className:"gap-1",icon:(0,t.jsx)(m.CircleX,{className:"h-5 w-5",color:"#d32f2f"})}):(p(60),c.toast.success("We sent a new code to your email.",{position:(0,P.getCurrentToastPosition)(),className:"gap-1",icon:(0,t.jsx)(m.CircleCheck,{className:"h-5 w-5",color:"#388e3c"})}))};return(0,t.jsxs)("div",{className:"mt-6 flex w-full flex-col gap-5",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"font-semibold text-foreground text-xl",children:"Enter your code"}),(0,t.jsxs)("p",{className:"pt-1 text-muted-foreground text-sm",children:["We sent a ",6,"-digit code to"," ",(0,t.jsx)("span",{className:"font-medium text-foreground",children:e}),". Enter it below to sign in."]})]}),(0,t.jsx)(O,{ariaLabel:"One-time code",autoFocus:!0,onChange:o,onComplete:e=>g(e),value:a}),(0,t.jsx)(x.Button,{className:`flex h-16 w-full items-center justify-center rounded-full border bg-primary font-bold text-base text-gray-900 transition-colors hover:bg-primary/80 ${i||!X(a)?"cursor-not-allowed opacity-50":""}`,disabled:i||!X(a),onClick:()=>g(),type:"button",children:i?(0,t.jsx)(f.Loader2,{className:"animate-spin"}):"Verify and sign in"}),(0,t.jsx)("div",{className:"flex items-center justify-center text-sm",children:(0,t.jsx)("button",{className:`font-medium ${u>0||l?"cursor-not-allowed text-muted-foreground":"text-primary-text hover:underline"}`,disabled:u>0||l,onClick:h,type:"button",children:u>0?`Resend in ${u}s`:"Resend code"})})]})}let $="feednest-last-signin-method";function A(e){localStorage.setItem($,e)}function F(){return(0,t.jsx)(h.Badge,{className:"absolute -top-2 -right-2 rounded-full border border-border font-medium text-[10px]",children:"Last used"})}function I(){let[e,n]=(0,s.useState)(""),[h,S]=(0,s.useState)(!1),[k,X]=(0,s.useState)(null),[O,I]=(0,s.use
2State)(null),[z,R]=(0,s.useState)(null),E=(0,y.createClient)(),H=(0,a.useRouter)(),B=(0,a.useSearchParams)(),M=(0,v.useIsMobile)(),W=B.get("return_to"),[_,D]=(0,s.useState)(!1),[G,U]=(0,s.useState)(!1);(0,s.useEffect)(()=>{D(r.Capacitor.isNativePlatform()&&"ios"===r.Capacitor.getPlatform()),U(r.Capacitor.isNativePlatform())},[]);let[J,K]=(0,s.useState)(!0);function V(){let e=B.get("checkout_intent"),t=B.get("plan"),r=B.get("billing"),a=B.get("source")||"landing",s=new URL("/auth/callback",location.origin);return"true"===e&&t&&r&&(s.searchParams.set("checkout_intent","true"),s.searchParams.set("plan",t),s.searchParams.set("billing",r),s.searchParams.set("source",a)),W&&s.searchParams.set("next",W),s.toString()}(0,s.useEffect)(()=>{let e=!0;return(0,N.nativeOAuthCanReturn)().then(t=>{e&&K(t)}),()=>{e=!1}},[]),(0,s.useEffect)(()=>{let e;R("google"===(e=localStorage.getItem($))||"x"===e||"apple"===e||"email"===e?e:null)},[]),(0,s.useEffect)(()=>{let e=B.get("checkout_intent"),t=B.get("plan"),r=B.get("billing"),a=B.get("source")||"landing";if("true"===e&&t&&r){let e={plan:t,billing:r,source:a,timestamp:Date.now().toString()};(0,C.setStorageItem)("checkout_intent",JSON.stringify(e),null),sessionStorage.setItem("checkout_intent",JSON.stringify(e))}},[B]);let q=""!==e.trim()&&/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)&&null!==O,Y=async e=>{try{let t=await fetch("/api/verify-turnstile",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:e})});return(await t.json()).success}catch{return!1}},Q=async e=>{S(!0);try{let r=await fetch("/api/auth/demo-signin",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:e})}),a=await r.json();if(!(r.ok&&a.success)){S(!1),c.toast.error(a.error??"Sign in failed.",{position:(0,P.getCurrentToastPosition)(),className:"gap-1",icon:(0,t.jsx)(m.CircleX,{className:"h-5 w-5",color:"#d32f2f"})});return}window.location.href="/dashboard/feeds"}catch{S(!1),c.toast.error("Network error. Please try again.",{position:(0,P.getCurrentToastPosition)(),className:"gap-1",icon:(0,t.jsx)(m.CircleX,{className:"h-5 w-5",color:"#d32f2f"})})}},Z=async()=>{if(!e.trim())return void c.toast.error("Please enter your email address",{position:(0,P.getCurrentToastPosition)(),className:"gap-1",icon:(0,t.jsx)(m.CircleX,{className:"h-5 w-5",color:"#d32f2f"})});if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e))return void c.toast.error("Please enter a valid email address",{position:(0,P.getCurrentToastPosition)(),className:"gap-1",icon:(0,t.jsx)(m.CircleX,{className:"h-5 w-5",color:"#d32f2f"})});if(r.Capacitor.isNativePlatform()&&"[email protected]"===e.trim().toLowerCase())return void await Q(e.trim());if(!O)return void c.toast.error("Please verify you are human",{position:(0,P.getCurrentToastPosition)(),className:"gap-1",icon:(0,t.jsx)(m.CircleX,{className:"h-5 w-5",color:"#d32f2f"})});if(S(!0),!await Y(O)){S(!1),c.toast.error("Human verification failed. Please try again.",{position:(0,P.getCurrentToastPosition)(),className:"gap-1",icon:(0,t.jsx)(m.CircleX,{className:"h-5 w-5",color:"#d32f2f"})});return}let{error:a}=await E.auth.signInWithOtp({email:e,options:{emailRedirectTo:V(),shouldCreateUser:!0}});S(!1),a?c.toast.error(a.message,{position:(0,P.getCurrentToastPosition)(),className:"gap-1",icon:(0,t.jsx)(m.CircleX,{className:"h-5 w-5",color:"#d32f2f"})}):(w.analytics.trackSignup({method:"email"}),A("email"),r.Capacitor.isNativePlatform()?X(e.trim()):c.toast.success("Check your email for the magic link",{position:(0,P.getCurrentToastPosition)(),className:"gap-1",icon:(0,t.jsx)(m.CircleCheck,{className:"h-5 w-5",color:"#388e3c"})}))},ee=async()=>{if(!O)return void c.toast.error("Please verify you are human",{position:(0,P.getCurrentToastPosition)(),className:"gap-1",icon:(0,t.jsx)(m.CircleX,{className:"h-5 w-5",color:"#d32f2f"})});if(S(!0),!await Y(O)){S(!1),c.toast.error("Human verification failed. Please try again.",{position:(0,P.getCurrentToastPosition)(),className:"gap-1",icon:(0,t.jsx)(m.CircleX,{className:"h-5 w-5",color:"#d32f2f"})});return}w.analytics.trackSignup({method:"google"}),A("google");let{error:e}=await (0,N.signInWithOAuthNative)(E,{provider:"google",redirectTo:V()});S(!1),e&&c.toast.error(e.message,{position:(0,P.getCurrentToastPosition)(),className:"gap-1",icon:(0,t.jsx)(m.CircleX,{className:"h-5 w-5",color:"#d32f2f"})})},et=async()=>
2{if(!O)return void c.toast.error("Please verify you are human",{position:(0,P.getCurrentToastPosition)(),className:"gap-1",icon:(0,t.jsx)(m.CircleX,{className:"h-5 w-5",color:"#d32f2f"})});if(S(!0),!await Y(O)){S(!1),c.toast.error("Human verification failed. Please try again.",{position:(0,P.getCurrentToastPosition)(),className:"gap-1",icon:(0,t.jsx)(m.CircleX,{className:"h-5 w-5",color:"#d32f2f"})});return}w.analytics.trackSignup({method:"apple"}),A("apple");let{error:e}=await (0,N.signInWithOAuthNative)(E,{provider:"apple",redirectTo:V()});S(!1),e&&c.toast.error(e.message,{position:(0,P.getCurrentToastPosition)(),className:"gap-1",icon:(0,t.jsx)(m.CircleX,{className:"h-5 w-5",color:"#d32f2f"})})},er=async()=>{if(!O)return void c.toast.error("Please verify you are human",{position:(0,P.getCurrentToastPosition)(),className:"gap-1",icon:(0,t.jsx)(m.CircleX,{className:"h-5 w-5",color:"#d32f2f"})});if(S(!0),!await Y(O)){S(!1),c.toast.error("Human verification failed. Please try again.",{position:(0,P.getCurrentToastPosition)(),className:"gap-1",icon:(0,t.jsx)(m.CircleX,{className:"h-5 w-5",color:"#d32f2f"})});return}w.analytics.trackSignup({method:"x"}),A("x");let{error:e}=await (0,N.signInWithOAuthNative)(E,{provider:"x",redirectTo:V()});S(!1),e&&c.toast.error(e.message,{position:(0,P.getCurrentToastPosition)(),className:"gap-1",icon:(0,t.jsx)(m.CircleX,{className:"h-5 w-5",color:"#d32f2f"})})};return(0,t.jsxs)("div",{className:"flex h-dvh flex-col bg-background font-poppins",children:[(0,t.jsx)(g.NativeSplashHider,{}),G&&(0,t.jsx)("div",{className:"shrink-0 px-4 pb-2",style:{paddingTop:"calc(env(safe-area-inset-top, 0px) + 12px)"},children:(0,t.jsx)("button",{"aria-label":k?"Back to sign in":"Back to welcome",className:"flex h-10 w-10 items-center justify-center rounded-full border border-border bg-card transition-colors hover:bg-accent active:bg-accent",onClick:()=>{k?X(null):H.push("/auth/welcome")},type:"button",children:(0,t.jsx)(m.ArrowLeft,{className:"h-5 w-5 text-foreground"})})}),(0,t.jsx)("div",{className:"flex flex-1 items-center justify-center overflow-y-auto md:overflow-hidden",children:(0,t.jsxs)("div",{className:"flex h-full w-full flex-col justify-center overflow-hidden bg-background md:flex-row md:justify-start",children:[(0,t.jsx)("div",{className:"flex w-full flex-col items-center justify-center p-4 md:w-1/2",children:(0,t.jsxs)("div",{className:"w-full max-w-[520px] rounded-3xl border border-border bg-white p-8 shadow-xs dark:bg-sidebar",children:[(0,t.jsxs)("div",{className:"w-full",children:[(0,t.jsx)(p.LogoWithText,{iconPrimary:!0,iconSize:M?"xl":"xxl",size:M?"md":"lg"}),(0,t.jsx)("p",{className:"pt-3 text-muted-foreground",children:"Sign in to stay informed with your personalized news feed"})]}),k?(0,t.jsx)(L,{email:k}):(0,t.jsxs)(t.Fragment,{children:[J?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"mt-6 flex flex-col gap-3",children:[(0,t.jsxs)("div",{className:`hover:!bg-muted/20 relative flex h-16 w-full cursor-pointer items-center justify-center gap-2 rounded-full border bg-background font-bold transition-colors ${_?"order-2":"order-1"} ${h||!O?"cursor-not-allowed opacity-50":""}`,onClick:h?void 0:ee,role:"button",children:["google"===z&&(0,t.jsx)(F,{}),h?(0,t.jsx)(f.Loader2,{className:"animate-spin"}):(0,t.jsx)(l,{size:32}),"Continue with Google"]}),(0,t.jsxs)("div",{className:`hover:!bg-muted/20 relative flex h-16 w-full cursor-pointer items-center justify-center gap-2 rounded-full border bg-background font-bold transition-colors ${_?"order-3":"order-2"} ${h||!O?"cursor-not-allowed opacity-50":""}`,onClick:h?void 0:er,role:"button",children:["x"===z&&(0,t.jsx)(F,{}),h?(0,t.jsx)(f.Loader2,{className:"animate-spin"}):(0,t.jsx)(i.FaXTwitter,{size:28}),"Continue with X"]}),(0,t.jsxs)("div",{className:`hover:!bg-muted/20 relative flex h-16 w-full cursor-pointer items-center justify-center gap-2 rounded-full border bg-background font-bold transition-colors ${_?"order-1":"order-3"} ${h||!O?"cursor-not-allowed opacity-50":""}`,onClick:h?void 0:et,role:"button",children:["apple"===z&&(0,t.jsx)(F,{}),h?(0,t.jsx)(f.Loader2,{className:"animate-spin"}):(0,t.jsx)(o.FaApple,{size:28}),"Continue with Apple"]})]}),(0,t.jsx)("div",{className:"w-full py-8",children:(0,t.jsxs)("div",{className:"flex w-full items-center justify-center",children:[(0,t.jsx)(j.Separator,{className:"flex-1"}),(0,t.jsx)("span",{className:"whitespace-nowrap px-4 text-gray-500 text-xs",children:"OR"}),(0,t.jsx)(j.Separator,{className:"flex-1"})]})})]}):(0,t.jsx)(T,{}),(0,t.jsxs)("form",{onSubmit:e=>{e.preventDefault(),Z()},children:[(0,t.jsx)(b.Input,{autoComplete:"email",className:`h-16 rounded-3xl bg-background px-4 shadow-none focus-visible:border-primary focus-visible:outline-hidden focu
2s-visible:ring-0 focus-visible:ring-offset-0 ${e&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)?"border-red-500":""}`,enterKeyHint:"go",inputMode:"email",onChange:e=>n(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),e.currentTarget instanceof HTMLElement&&e.currentTarget.blur(),Z())},placeholder:"[email protected]",required:!0,type:"email",value:e}),(0,t.jsx)("div",{className:"mt-4",children:(0,t.jsx)(u.default,{onVerified:I})}),(0,t.jsxs)(x.Button,{className:`relative mt-6 flex h-16 w-full items-center justify-center rounded-full border bg-primary font-bold text-base text-gray-900 transition-colors hover:bg-primary/80 ${h||!q?"cursor-not-allowed opacity-50":""}`,disabled:h||!q,type:"submit",children:["email"===z&&(0,t.jsx)(F,{}),h?(0,t.jsx)(f.Loader2,{className:"animate-spin"}):void 0," ","Sign in with email"]})]})]})]})}),(0,t.jsx)("div",{className:"hidden h-full w-1/2 flex-col items-center justify-start overflow-hidden border-border border-l bg-separator md:flex",children:(0,t.jsx)(d.AuthTestimonials,{})})]})})]})}e.s(["default",0,function(){return(0,t.jsx)(s.Suspense,{fallback:(0,t.jsx)("div",{className:"flex h-dvh items-center justify-center bg-primary font-poppins",children:"Loading..."}),children:(0,t.jsx)(I,{})})}],519491)}]); 3 4//# debugId=2c03c0c0-73d2-6163-a769-f489849347f4
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.