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]="56527d80-01c7-874e-d0a5-9e9f1a46e10b")}catch(e){}}(); 2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,930866,e=>{e.v({absoluteLogo:"LoginComponent-module-scss-module__rGvgTq__absoluteLogo",buffer:"LoginComponent-module-scss-module__rGvgTq__buffer",color:"LoginComponent-module-scss-module__rGvgTq__color",container:"LoginComponent-module-scss-module__rGvgTq__container",formContainer:"LoginComponent-module-scss-module__rGvgTq__formContainer",heroBg:"LoginComponent-module-scss-module__rGvgTq__heroBg",heroContainer:"LoginComponent-module-scss-module__rGvgTq__heroContainer",leftSidebar:"LoginComponent-module-scss-module__rGvgTq__leftSidebar",logo:"LoginComponent-module-scss-module__rGvgTq__logo",rightContainer:"LoginComponent-module-scss-module__rGvgTq__rightContainer",rightSidebar:"LoginComponent-module-scss-module__rGvgTq__rightSidebar",tools:"LoginComponent-module-scss-module__rGvgTq__tools"})},171444,e=>{e.v({actionButton:"LoginForm-module-scss-module__TM5NVq__actionButton",additionalFields:"LoginForm-module-scss-module__TM5NVq__additionalFields",authWrapper:"LoginForm-module-scss-module__TM5NVq__authWrapper",backButton:"LoginForm-module-scss-module__TM5NVq__backButton",background:"LoginForm-module-scss-module__TM5NVq__background",disabledActionButton:"LoginForm-module-scss-module__TM5NVq__disabledActionButton",emailSentLink:"LoginForm-module-scss-module__TM5NVq__emailSentLink",emailSentMessage:"LoginForm-module-scss-module__TM5NVq__emailSentMessage",fadeIn:"LoginForm-module-scss-module__TM5NVq__fadeIn",fadeInAndUp:"LoginForm-module-scss-module__TM5NVq__fadeInAndUp",fadeOut:"LoginForm-module-scss-module__TM5NVq__fadeOut",fadeOutAndDown:"LoginForm-module-scss-module__TM5NVq__fadeOutAndDown",forgotPassword:"LoginForm-module-scss-module__TM5NVq__forgotPassword",headerSwitch:"LoginForm-module-scss-module__TM5NVq__headerSwitch",lastUsedBadge:"LoginForm-module-scss-module__TM5NVq__lastUsedBadge",loaderContainer:"LoginForm-module-scss-module__TM5NVq__loaderContainer",loginForm:"LoginForm-module-scss-module__TM5NVq__loginForm",or:"LoginForm-module-scss-module__TM5NVq__or",orContainer:"LoginForm-module-scss-module__TM5NVq__orContainer",pageContent:"LoginForm-module-scss-module__TM5NVq__pageContent",popIn:"LoginForm-module-scss-module__TM5NVq__popIn",show:"LoginForm-module-scss-module__TM5NVq__show",successIcon:"LoginForm-module-scss-module__TM5NVq__successIcon",thirdPartyHint:"LoginForm-module-scss-module__TM5NVq__thirdPartyHint",title:"LoginForm-module-scss-module__TM5NVq__title"})},993001,e=>{"use strict";var t=e.i(94601),r=e.i(993266),i=e.i(136960),o=e.i(451920),a=e.i(688021),s=e.i(741189),n=e.i(831081);e.i(520800);var l=e.i(919259);e.i(563568);var c=e.i(291867);e.i(955116);var u=e.i(181630),d=e.i(877882);e.i(149844);var m=e.i(84887);e.i(663188);var g=e.i(795239);e.i(301020);var h=e.i(194284),f=e.i(397553),p=e.i(697802),v=e.i(351662),x=e.i(353662),_=e.i(930866),w=e.i(762917),j=e.i(171444),C=e.i(38356),k=e.i(532627),b=e.i(790376),S=e.i(197649);e.i(963219);var y=e.i(780444),y=y,I=y,N=y,P=e.i(929590),E=e.i(772738);let T=E.z.email("Please enter a valid email address").min(1,"Email is required"),A=E.z.string().min(6,"Password must be at least 6 characters long"),O=E.z.object({email:T,password:A}),L=E.z.object({email:T}),F=E.z.object({email:T,password:A}),M=E.z.object({email:T}),R=E.z.object({password:A,confirmPassword:E.z.string().min(1,"Please confirm your password")}).refine(e=>e.password===e.confirmPassword,{message:"Passwords do not match",path:["confirmPassword"]});e.i(650189);var B=e.i(147163);e.i(465198);
2var q=e.i(413975);e.i(299499);var V=e.i(249551);e.i(454511);var D=e.i(627403),W=e.i(896876);e.i(341583);var G=e.i(845774);let z=({oobCode:e,isTransitioning:o,onBack:a})=>{let s=(0,r.useRouter)(),[n,l]=(0,i.useState)(""),[c,u]=(0,i.useState)(!1),d=(0,P.useForm)({resolver:(0,k.zodResolver)(R),defaultValues:{password:"",confirmPassword:""}}),m=async t=>{u(!0),l("");try{let r=await (0,N.au)(W.auth,e);await (0,y.v)(W.auth,e,t.password),await (0,I.af)(W.auth,r,t.password),await s.replace("/")}catch(e){(0,h.captureException)(e),u(!1),l("The reset link has expired or is invalid. Please request a new one.")}};return(0,t.jsxs)(b.Stack,{gap:"1.5rem",children:[(0,t.jsx)(q.Button,{variant:"minimal",leftSection:(0,t.jsx)(C.ChevronLeftSolidIcon,{}),onClick:a,className:j.default.backButton,children:"Back"}),(0,t.jsx)(D.Title,{className:j.default.title,children:"Set new password"}),(0,t.jsx)("div",{className:(0,S.default)(j.default.pageContent,o&&j.default.fadeOut),children:(0,t.jsx)(G.Form,{onSubmit:d.handleSubmit(m),noValidate:!0,children:(0,t.jsxs)(b.Stack,{gap:"1rem",children:[(0,t.jsx)(P.Controller,{name:"password",control:d.control,render:({field:e})=>(0,t.jsx)(V.PasswordInput,{placeholder:"New password",size:"xl",leftSection:(0,t.jsx)(C.LockClosedIcon,{}),error:d.formState.errors.password?.message,...e})}),(0,t.jsx)(P.Controller,{name:"confirmPassword",control:d.control,render:({field:e})=>(0,t.jsx)(V.PasswordInput,{placeholder:"Confirm new password",size:"xl",leftSection:(0,t.jsx)(C.LockClosedIcon,{}),error:d.formState.errors.confirmPassword?.message,...e})}),(0,t.jsx)(q.Button,{size:"xl",type:"submit",fullWidth:!0,loading:c,children:"Set new password"}),n&&(0,t.jsx)(B.Alert,{variant:"danger",showIcon:!1,children:n})]})})})]})};var U=y;e.i(813928);var Y=e.i(923931);e.i(549852);var $=e.i(458923),H=e.i(521782);let K=({inviteDetails:e,isTransitioning:r,onBack:o})=>{let[a,s]=(0,i.useState)(""),[n,l]=(0,i.useState)(!1),[c,u]=(0,i.useState)(!1),[d,m]=(0,i.useState)(0),[g,f]=(0,i.useState)(!1),p=(0,P.useForm)({resolver:(0,k.zodResolver)(M),defaultValues:{email:e.email||""}});(0,i.useEffect)(()=>{if(d<=0)return;let e=setInterval(()=>m(e=>e-1),1e3);return()=>clearInterval(e)},[d]);let v=(e,t=!1)=>{t?f(!0):l(!0),(0,U.a9)(W.auth,e).then(()=>{s(""),l(!1),f(!1),u(!0),m(30)}).catch(e=>{(0,h.captureException)(e),l(!1),f(!1);let t=(0,H.getFirebaseErrorCode)(e);t===H.FirebaseAuthErrorCode.INVALID_EMAIL?s("Invalid email address."):t===H.FirebaseAuthErrorCode.TOO_MANY_REQUESTS?s("Too many requests. Please try again later."):s("Something went wrong. Please try again.")})};return(0,t.jsxs)(b.Stack,{gap:"1.5rem",children:[(0,t.jsx)(q.Button,{variant:"minimal",leftSection:(0,t.jsx)(C.ChevronLeftSolidIcon,{}),onClick:o,className:j.default.backButton,children:"Back"}),c&&(0,t.jsx)("div",{className:j.default.successIcon,children:(0,t.jsx)(C.MailIcon,{})}),(0,t.jsx)(D.Title,{className:j.default.title,children:c?"Check your email":"Reset password"}),(0,t.jsx)("div",{className:(0,S.default)(j.default.pageContent,r&&j.default.fadeOut),children:(0,t.jsx)(b.Stack,{gap:"1rem",children:c?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(Y.Text,{className:j.default.emailSentMessage,children:["If ",(0,t.jsx)("strong",{children:p.getValues().email})," is registered with Atlas, we have sent it a link to reset your password. Check your inbox and follow the instructions."]}),(0,t.jsxs)(b.Stack,{gap:"0.5rem",children:[(0,t.jsxs)(Y.Text,{className:j.default.emailSentLink,children:["Did not receive the email?"," ",d>0||g?(0,t.jsx)(Y.Text,{className:j.default.disabledActionButton,children:g?"Sending...":`Resend email (${d}s)`}):(0,t.jsx)("span",{onClick:()=>v(p.getValues().email,!0),className:j.default.actionButton,children:"Resend email"})]}),(0,t.jsxs)(Y.Text,{className:j.default.emailSentLink,children:["Wrong email address?"," ",(0,t.jsx)("span",{onClick:()=>{u(!1),m(0),f(!1)},className:j.default.actionButton,children:"Change address"})]})]})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(G.Form,{onSubmit:p.handleSubmit(({email:e})=>v(e)),noValidate:!0,children:[(0,t.jsx)($.TextInput,{size:"xl",disabled:!!e.email,placeholder:"Email address",leftSection:(0,t.jsx)(C.MailIcon,{}),error:p.formState.errors.email?.message,type:"email",autoComplete:"email",...p.register("email")}),(0,t.jsx)(q.Button,{size:"xl",type:"submit",fullWidth:!0,loading:n,children:"Send verification code"})]}),a&&(0,t.jsx)(B.Alert,{variant:"danger",showIcon:!1,children:a})]})})})]})};var X=y,Q=e.i(990434);function J(e={}){let{client:t=Q.client,...r}=e;return t({method:"POST",url:"/users/me/sync-firebase-identity",security:[{type:"oauth2"}],...r})}let Z=({actionCode:e})=>{let[r,o]=(0,i.useState)(!1),[a,s]=(0,i.useState)(!0),[n,l]=(0,i.useState)(null),[c,d]=(0,i.useState)(null),m=(0,i.useRef)(!1),{authLoaded:g}=u.Auth.useSnapshot("authLoaded");return((0,i.useEffect)(()=>{g&&e&&!m.current&&(m.current=!0,(async()=>{try{let t=(await (0,X.u)(W.auth,e)).data.email;t&&d(t),await u.Auth.applyActionCode(e),o(!0),u.Auth.user?.uid&&await J(),await u.Auth.signOut(),s(!1)}catch(t){(0,h.captureException)(t),s(!1);let e=(0,H.getFirebaseErrorCode)(t);e===H.FirebaseAuthErrorCode.INVALID_ACTION_CODE?l("This link is invali
2d or has expired."):e===H.FirebaseAuthErrorCode.EXPIRED_ACTION_CODE?l("This link has expired."):l("Failed to recover email. Please try again.")}})())},[g,e]),a)?(0,t.jsxs)("div",{className:j.default.background,children:[(0,t.jsx)(D.Title,{className:j.default.title,children:"Recovering email"}),(0,t.jsx)(Y.Text,{children:"Please wait while we restore your email address"}),(0,t.jsx)(q.Button,{href:"/",fullWidth:!0,size:"xl",onClick:()=>window.location.reload(),children:"Refresh"})]}):r?(0,t.jsxs)("div",{className:j.default.background,children:[(0,t.jsx)(D.Title,{className:j.default.title,children:"Email restored"}),(0,t.jsxs)(Y.Text,{children:["Your email address has been restored",c?` to ${c}`:"",". Please sign in with your original email address."]}),(0,t.jsx)(q.Button,{href:"/login",fullWidth:!0,size:"xl",children:"Sign in"})]}):(0,t.jsxs)("div",{className:j.default.background,children:[(0,t.jsx)(D.Title,{className:j.default.title,children:"Email recovery failed"}),(0,t.jsx)(Y.Text,{children:n}),(0,t.jsx)(q.Button,{href:"/login",fullWidth:!0,size:"xl",leftSection:(0,t.jsx)(C.ArrowLeftIcon,{}),children:"Back to login"})]})};var ee=e.i(180950),et=y,er=y,ei=e.i(363985),eo=e.i(13187),ea=e.i(454740),I=y,es=e.i(620361),en=e.i(372877);e.i(522027);var el=e.i(747989);let ec="last_used_auth_method",eu=e=>{new el.LocalStorageHandler(ec).set(e)};e.i(870107);var ed=e.i(28369);e.i(640669);var em=e.i(965622);e.i(625073);var eg=e.i(13592);e.i(799689);var eh=e.i(839348),ef=e.i(691423);e.i(168911);var ep=e.i(153308);e.i(813521);var ev=e.i(216119);e.i(793244);var ex=e.i(786223);e.i(932537);var e_=e.i(486945),ew=e.i(617287),ej=e.i(963628),eC=e.i(1941);let ek=new Set([403,429]),eb={provider:null,isDiscovering:!1,isSigningIn:!1,error:null};function eS(){let[e,t]=(0,i.useState)(eb),r=(0,i.useRef)(0),o=(0,i.useCallback)(async e=>{let i=e.trim();if(!i.includes("@"))return t(e=>({...e,provider:null})),null;let o=++r.current;t(e=>({...e,isDiscovering:!0,error:null}));try{let{data:e}=await function(e){let{client:t=Q.client,...r}=e;return t({method:"POST",url:"/v1/auth/sso/discover",...r})}({body:{email:i}});if(o!==r.current)return null;let a=e.provider_id&&e.display_name?{providerId:e.provider_id,displayName:e.display_name}:null;return t(e=>({...e,provider:a,isDiscovering:!1})),a}catch(i){let e;if(o!==r.current)return null;return void 0!==(e=(0,eC.getErrorStatus)(i))&&ek.has(e)||(0,h.captureException)(i,"SSO discovery failed"),t(e=>({...e,provider:null,isDiscovering:!1,error:"We could not check single sign-on for that address. Please try again in a moment."})),null}},[]),a=(0,i.useCallback)(()=>{r.current+=1,t(eb)},[]),s=(0,i.useCallback)(async e=>{t(e=>({...e,isSigningIn:!0,error:null}));let r=await (0,ej.signInWithSsoProvider)(e);return t(e=>({...e,isSigningIn:!1,error:"failed"===r.status?r.message:null})),"success"===r.status},[]);return{...e,discover:o,signIn:s,reset:a}}function ey(e){let t=(0,H.getFirebaseErrorCode)(e);return t===H.FirebaseAuthErrorCode.POPUP_CLOSED||t===H.FirebaseAuthErrorCode.CANCELLED_POPUP}let eI=()=>(0,t.jsx)(ed.Badge,{className:j.default.lastUsedBadge,size:"sm",stroke:!0,color:"brand",children:"Last used"}),eN=({isSignIn:e,onlySignIn:o,inviteDetails:a,prompt:s,isTransitioning:n,onGoToForgotPassword:l,onGoToSso:c})=>{let m=(0,r.useRouter)(),g=(0,ep.useMfaChallenge)(),f=eS(),[v]=(0,el.usePersistedState)(ec,null),x=function({onlySignIn:e,isSignIn:t,hasInviteForNewUser:r,lastUsedAuthMethod:i}){return e||t?"sign-in":r?"sign-up":i?"sign-in":"sign-up"}({onlySignIn:o,isSignIn:e,hasInviteForNewUser:!!a.email&&!o,lastUsedAuthMethod:v}),[_,w]=(0,i.useState)(x),[k,y]=(0,i.useState)(!1),[N,E]=(0,i.useState)(""),[T,A]=(0,i.useState)(!1),[M,R]=(0,i.useState)(0),[z,U]=(0,i.useState)(!1),[K,X]=(0,i.useState)(!0),[Q,J]=(0,i.useState)(""),[Z,ed]=(0,i.useState)({}),[ej=globalThis,eC]=(0,i.useState)(),ek=(0,P.useForm)({defaultValues:{email:a.email||"",password:""},mode:"onSubmit",reValidateMode:"onChange"}),eb=(0,P.useForm)({defaultValues:{email:a.email||"",password:""},mode:"onSubmit",reValidateMode:"onChange"});(0,i.useEffect)(()=>{w(x)},[x]),(0,i.useEffect)(()=>{E("")},[_]),(0,i.useEffect)(()=>
2{-1!==ej.navigator.userAgent.toLowerCase().indexOf("linkedinapp")&&X(!1);try{eC(ej);let e=new URLSearchParams(ej.location.search),t=e.get("ref");t&&(e_.mixpanelClient.register_once({referral_id:t}),e_.mixpanelClient.get_group("referral_id",t).set_once({$name:t}));let r=e.get("duplicationProjectId")||e.get("projectToDuplicate");r&&(J(r),(0,ee.setCookie)("duplicationProjectId",r)),document?.referrer&&e_.mixpanelClient.register_once({document_referrer:document.referrer}),ed({utm_source:e.get("utm_source")||localStorage.getItem("utm_source"),utm_medium:e.get("utm_medium")||localStorage.getItem("utm_medium"),utm_campaign:e.get("utm_campaign")||localStorage.getItem("utm_campaign"),referrer:e.get("referrer")||localStorage.getItem("referrer"),website_origin:e.get("website_origin")||localStorage.getItem("website_origin"),last_page:s?`atlas.new/prompt=${s}`:e.get("last_page")||localStorage.getItem("last_page")})}catch(e){(0,h.captureException)(e,"Failed to initialise auth analytics")}},[]);let eN=(e,t)=>{ef.mpManager.handleUserSignup({user:e,provider:t,sourceValues:Z,duplicationProjectId:Q,inviteWorkspaceId:a.workspaceId})},eP=e=>{y(!0),setTimeout(()=>{e(),y(!1)},250)},eE=async()=>{let e=new ei.GoogleAuthProvider;e.addScope("https://www.googleapis.com/auth/userinfo.email"),e.addScope("https://www.googleapis.com/auth/userinfo.profile"),a.email&&e.setCustomParameters({login_hint:a.email});try{let t=await (0,es.signInWithPopup)(W.auth,e),r=(0,er.C)(t);if(!t.user.email){(0,h.captureMessage)(`Did not receive email for user: ${t.user.uid}`),E("We didn't receive any email details from Google. Try using email/password instead."),await u.Auth.signOut();return}eu("google"),r?.isNewUser?(localStorage.removeItem(ev.ONBOARDING_COMPLETE_STORAGE_KEY),A(!0),(0,ew.stashMarketingConsent)(z),eN(t.user,eh.AuthProvider.GOOGLE),s&&p.promptRedirectState.setPrompt(s),(0,d.savePendingInvite)(a),setTimeout(()=>{ej.location.href="/onboarding"},2e3)):((0,ew.clearStashedMarketingConsent)(),ef.mpManager.trackLogin(t.user,eh.AuthProvider.GOOGLE))}catch(e){if(ey(e)||g.handleMfaError(e))return;(0,h.captureException)(e,"Error signing in with Google"),E("Error signing in with Google")}},eT=async()=>{let e=new eo.OAuthProvider("microsoft.com");e.addScope("User.Read"),a.email&&e.setCustomParameters({login_hint:a.email});try{let t=await (0,es.signInWithPopup)(W.auth,e),r=(0,er.C)(t);if(!t.user.email){(0,h.captureMessage)(`Did not receive email for user: ${t.user.uid}`),E("We didn't receive any email details from Microsoft. Try using email/password instead."),await u.Auth.signOut();return}eu("microsoft"),r?.isNewUser?(localStorage.removeItem(ev.ONBOARDING_COMPLETE_STORAGE_KEY),A(!0),(0,ew.stashMarketingConsent)(z),eN(t.user,eh.AuthProvider.MICROSOFT),s&&p.promptRedirectState.setPrompt(s),(0,d.savePendingInvite)(a),setTimeout(()=>{ej.location.href="/onboarding"},2e3)):((0,ew.clearStashedMarketingConsent)(),ef.mpManager.trackLogin(t.user,eh.AuthProvider.MICROSOFT))}catch(e){if(ey(e)||g.handleMfaError(e))return;(0,h.captureException)(e,"Error signing in with Microsoft"),E("Error signing in with Microsoft")}},eA=async(e,t)=>{A(!0);try{let r=await (0,et.x)(W.auth,e,t);localStorage.removeItem(ev.ONBOARDING_COMPLETE_STORAGE_KEY),eu("email"),(0,ea.sendEmailVerification)(r.user),(0,ew.stashMarketingConsent)(z),eN(r.user,eh.AuthProvider.EMAIL),s&&p.promptRedirectState.setPrompt(s),(0,d.savePendingInvite)(a),await m.push("/onboarding")}catch(t){A(!1);let e=(0,H.getFirebaseErrorCode)(t);e===H.FirebaseAuthErrorCode.EMAIL_ALREADY_IN_USE?eb.setError("email",{type:"firebase",message:"This email is already registered. Try logging in instead."}):e===H.FirebaseAuthErrorCode.INVALID_EMAIL?eb.setError("email",{type:"firebase",message:"Please enter a valid email address"}):e===H.FirebaseAuthErrorCode.WEAK_PASSWORD?eb.setError("password",{type:"firebase",message:"Password is too weak"}):e===H.FirebaseAuthErrorCode.INVALID_PASSWORD?eb.setError("password",{type:"firebase",message:"Password must be at least 6 characters"}):e===H.FirebaseAuthErrorCode.INTERNAL_ERROR&&t instanceof Error&&t.message.includes("Can't use temp email when signing up.")?eb.setError("email",{type:"firebase",message:"Temporary email addresses are not allowed"}):((0,h.captureException)(t),E("Something went wrong during signup. Please try again."))}},eO=async e=>{await f.discover(e)&&c(e.trim())},eL=e=>{let t=O.safeParse(e);if(t.success){var r,i;A(!0),r=e.email,i=e.password,(0,I.af)(W.auth,r,i).then(e=>(eu("email"),(0,ew.clearStashedMarketingConsent)(),ef.mpManager.trackLogin(e.user,eh.AuthProvider.EMAIL))).catch(e=>{if(g.handleMfaError(e))return void A(!1);A(!1);let t=(0,H.getFirebaseErrorCode)(e);t===H.FirebaseAuthErrorCode.INVALID_EMAIL?ek.setError("email",{type:"firebase",message:"Please enter a valid email address"}
2):t===H.FirebaseAuthErrorCode.WRONG_PASSWORD||t===H.FirebaseAuthErrorCode.INVALID_CREDENTIAL||t===H.FirebaseAuthErrorCode.USER_NOT_FOUND?ek.setError("password",{type:"firebase",message:"Incorrect email or password. Please try again."}):t===H.FirebaseAuthErrorCode.INVALID_PASSWORD?ek.setError("password",{type:"firebase",message:"Password must be at least 6 characters"}):((0,h.captureException)(e),E("Something went wrong during sign in. Please try again."))})}else t.error.issues.forEach(e=>{ek.setError(e.path[0],{type:"manual",message:e.message})})},eF=e=>{if(0===M){let t=L.safeParse({email:e.email});t.success?(eb.clearErrors(),R(1)):t.error.issues.forEach(e=>{eb.setError("email",{type:"manual",message:e.message})})}else{let t=F.safeParse(e);t.success?eA(e.email,e.password):t.error.issues.forEach(e=>{eb.setError(e.path[0],{type:"manual",message:e.message})})}};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:(0,S.default)(j.default.pageContent,(n||k)&&j.default.fadeOut),children:(0,t.jsxs)(b.Stack,{gap:"1.5rem",children:[(0,t.jsxs)(b.Stack,{gap:"1rem",children:[(0,t.jsx)(D.Title,{className:j.default.title,children:a.projectId?"You're invited to a project":a.workspaceId?`You're invited to ${a.workspaceName??"a workspace"}`:"sign-in"===_?"Welcome back":"Get started"}),"sign-up"===_&&(0,t.jsxs)(Y.Text,{className:j.default.headerSwitch,children:["Create a free account or"," ",(0,t.jsx)(q.Button,{variant:"link",onClick:()=>{let{email:e,password:t}=eb.getValues();eP(()=>{e&&ek.setValue("email",e),t&&ek.setValue("password",t),w("sign-in")})},"data-testid":"switch-to-signin",children:"log in"})]}),"sign-in"===_&&(0,t.jsxs)(Y.Text,{className:j.default.headerSwitch,children:["Login or"," ",(0,t.jsx)(q.Button,{variant:"link",onClick:()=>{var e;return e=ek.getValues().email,void eP(()=>{e&&eb.setValue("email",e),w("sign-up")})},"data-testid":"switch-to-signup",children:"create a free account"})]})]}),Q&&"sign-up"===_&&(0,t.jsx)(B.Alert,{variant:"information",centered:!0,children:"After signing up, you will be redirected to the duplicated project"}),"sign-in"===_&&(0,t.jsxs)(G.Form,{onSubmit:ek.handleSubmit(eL,()=>eL(ek.getValues())),noValidate:!0,children:[(0,t.jsxs)("div",{className:j.default.authWrapper,children:[(0,t.jsx)($.TextInput,{size:"xl",disabled:!!a.email,placeholder:"Email address",leftSection:(0,t.jsx)(C.MailIcon,{}),error:ek.formState.errors.email?.message,"data-testid":"email-input",type:"email",autoComplete:"username",...ek.register("email",{onBlur:e=>{eO(e.currentTarget.value)},onChange:()=>{f.provider&&f.reset()}})}),"email"===v&&(0,t.jsx)(eI,{})]}),(0,t.jsx)(P.Controller,{name:"password",control:ek.control,render:({field:e})=>(0,t.jsxs)(b.Stack,{gap:"0.5rem",children:[(0,t.jsx)(V.PasswordInput,{placeholder:"Your password",size:"xl",leftSection:(0,t.jsx)(C.LockClosedIcon,{}),error:ek.formState.errors.password?.message,"data-testid":"password-input",autoComplete:"current-password",...e}),(0,t.jsx)(q.Button,{className:j.default.forgotPassword,variant:"link",onClick:l,children:"Forgot password?"})]})}),(0,t.jsx)(q.Button,{size:"xl",type:"submit",fullWidth:!0,loading:T,"data-testid":"login-button",children:"Sign in"})]}),"sign-up"===_&&(0,t.jsxs)(G.Form,{onSubmit:eb.handleSubmit(eF,()=>eF(eb.getValues())),noValidate:!0,children:[(0,t.jsxs)("div",{className:j.default.authWrapper,children:[(0,t.jsx)($.TextInput,{size:"xl",disabled:!!a.email,placeholder:"Email address",leftSection:(0,t.jsx)(C.MailIcon,{}),error:eb.formState.errors.email?.message,"data-testid":"signup-email-input",type:"email",autoComplete:"username",...eb.register("email")}),"email"===v&&(0,t.jsx)(eI,{})]}),(0,t.jsxs)("div",{className:`${j.default.additionalFields} ${1===M&&j.default.show}`,children:[(0,t.jsx)(P.Controller,{name:"password",control:eb.control,render:({field:e})=>(0,t.jsx)(V.PasswordInput,{placeholder:"Your password",size:"xl",leftSection:(0,t.jsx)(C.LockClosedIcon,{}),error:eb.formState.errors.password?.message,"data-testid":"signup-password-input",autoComplete:"new-password",...e})}),(0,t.jsx)(eg.Checkbox,{label:"Get cool updates and special invites to beta tests â opt out anytime.",onChange:()=>U(e=>!e),checked:z})]}),(0,t.jsx)(q.Button,{type:"submit",fullWidth:!0,size:"xl",loading:T,"data-testid":"signup-button",children:0===M?"Continue":"Sign up"})]}),K&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:j.default.orContainer,children:[(0,t.jsx)("div",{className:j.default.or}),(0,t.jsx)(em.Caption,{children:"Or"}),(0,t.jsx)("div",{className:j.default.or})]}),a.email&&(0,t.jsxs)(em.Caption,{className:j.default.thirdPartyHint,children:["If using a third-party sign in, make sure the account belongs to ",(0,t.jsx)("strong",{children:a.email}),". Another account will not gain access."]}),(0,t.jsxs)(b.Stack,{gap:"1rem",children:[(0,t.jsxs)("div",{className:j.default.authWrapper,children:[(0,t.jsxs)(q.Button,{onClick:()=>void eE(),variant:"ghost",fullWidth:!0,size:"xl",leftSection:(0,t.jsx)(en.default,{src:"/static/logos/google.svg",alt:"Google logo",width:22,height:22}),children:["Sign ","sign-in"===_?"in":"up"," with Google"]}),"google"===v&&(0,t.jsx)(eI,{})]}),(0,t.jsxs)("div",{className:j.default.authWrapper,children:[(0,t.jsxs)(q.Button,{onClick:()=>void eT(),variant:"ghost",fullWidth:!0,size:"xl",leftSection:(0,t.jsx)(en.default,{src:"/static/logos/microsoft.svg",alt:"Microsoft logo",width:22,height:22}),children:["Sign ","sign-in"===_?"in":"up"," with Microsoft"]}),"microsoft"===v&&(0,t.jsx)(eI,{})]}),(0,t.jsxs)("div",{className:j.default.authWrapper,children:[(0,t.jsxs)(q.Button,{onClick:()=>c(ek.getValues("email")?.trim()),variant:"ghost",fullWidth:!0,size:"xl",leftSection:(0,t.jsx)(C.BuildingIcon,{size:22}),"data-testid":"sso-prompt-button",children:["Sign ","sign-in"===_?"in":"up"," with single sign-on"]}),"sso"===v&&(0,t.jsx)(eI,{})]})]})]}),(N||f.error)&&(0,t.jsx)(B.Alert,{variant:"danger",showIcon:!1,children:(0,t.jsx)("span",{"data-testid":"error-message",children:N||f.error})}),"sign-in"!==_&&!T&&(0,t.jsxs)(em.Caption,{children:["By signing up you agree to our"," ",(0,t.jsx)(q.Button,{variant:"link",href:"https://atlas.co/terms-of-service/",target:"_blank",children:"Terms of Service"})," ","and"," ",(0,t.jsx)(q.Button,{variant:"link",href:"https://atlas.co/privacy-policy/",target:"_blank",children:"Privacy Policy"})]})]})}),(0,t.jsx)(ex.MfaChallengeModal,{opened:"required"===g.state.status||"submitting"===g.state.status||"error"===g.state.status,isSubmitting:"submitting"===g.state.status,error:"error"===g.state.status?g.state.message:void 0,onSubmit:e=>void g.submitCode(e),onClose:g.reset})]})},eP=({initialEmail:e,inviteDetails:r,isTransitioning:o,onBack:a,onSignedIn:s})=>{let[n,l]=(0,i.useState)(r.email??e??""),[c,u]=(0,i.useState)(!1),d=eS(),m=async()=>{let e=n.trim();if(!e.includes("@"))return;u(!1);let t=await d.discover(e);t?await d.signIn(t.providerId)&&(eu("sso"),s()):u(!0)},g=d.isDiscovering||d.isSigningIn;return(0,t.jsxs)(b.Stack,{gap:"1.5rem",children:[(0,t.jsx)(q.Button,{variant:"minimal",leftSection:(0,t.jsx)(C.ChevronLeftSolidIcon,{}),onClick:a,className:j.default.backButton,children:"Back"}),(0,t.jsx)("div",{className:j.default.successIcon,children:(0,t.jsx)(C.BuildingIcon,{})}),(0,t.jsx)(D.Title,{className:j.default.title,children:"Single sign-on"}
2),(0,t.jsx)("div",{className:(0,S.default)(j.default.pageContent,o&&j.default.fadeOut),children:(0,t.jsxs)(b.Stack,{gap:"1rem",children:[(0,t.jsx)(Y.Text,{children:"Enter your work email address and we will take you to your organization's identity provider."}),(0,t.jsx)($.TextInput,{size:"xl",type:"email",autoComplete:"username",autoFocus:!0,placeholder:"Email address",leftSection:(0,t.jsx)(C.MailIcon,{}),value:n,disabled:!!r.email,"data-testid":"sso-email-input",onChange:e=>{l(e.currentTarget.value),c&&u(!1)},onKeyDown:e=>{"Enter"===e.key&&m()}}),c&&!d.error&&(0,t.jsx)(Y.Text,{"data-testid":"sso-not-found",children:"No single sign-on is set up for that email domain. Contact your workspace admin, or go back and sign in another way."}),d.error&&(0,t.jsx)(B.Alert,{variant:"danger",showIcon:!1,children:(0,t.jsx)("span",{"data-testid":"sso-error",children:d.error})}),(0,t.jsx)(q.Button,{size:"xl",fullWidth:!0,loading:g,disabled:!n.trim().includes("@"),onClick:()=>void m(),"data-testid":"sso-continue-button",children:"Continue"})]})})]})};e.i(304253);var eE=e.i(102640);let eT=({actionCode:e})=>{let[r,o]=(0,i.useState)(!1),[a,s]=(0,i.useState)(!0),[n,l]=(0,i.useState)(null),c=(0,i.useRef)(!1),{authLoaded:d}=u.Auth.useSnapshot("authLoaded");return((0,i.useEffect)(()=>{d&&e&&!c.current&&(c.current=!0,(async()=>{try{await u.Auth.applyActionCode(e),o(!0),u.Auth.user&&(await u.Auth.user.reload(),await J()),await u.Auth.signOut(),s(!1)}catch(t){(0,h.captureException)(t),s(!1);let e=(0,H.getFirebaseErrorCode)(t);e===H.FirebaseAuthErrorCode.INVALID_ACTION_CODE?l("This link is invalid or has expired. Please request a new email change."):e===H.FirebaseAuthErrorCode.EXPIRED_ACTION_CODE?l("This link has expired. Please request a new email change."):l("Failed to verify email change. Please try again.")}})())},[d,e]),a)?(0,t.jsxs)("div",{className:j.default.background,children:[(0,t.jsxs)(D.Title,{className:j.default.title,children:["Verifying email change",(0,t.jsx)(eE.AnimatedEllipsis,{})]}),(0,t.jsx)(Y.Text,{children:"Please wait while we verify your new email address."}),(0,t.jsx)(q.Button,{href:"/",fullWidth:!0,size:"xl",onClick:()=>window.location.reload(),leftSection:(0,t.jsx)(C.ResetIcon,{}),children:"Refresh"})]}):r?(0,t.jsxs)("div",{className:j.default.background,children:[(0,t.jsx)(D.Title,{className:j.default.title,children:"Email changed successfully"}),(0,t.jsx)(Y.Text,{children:"Your email address has been updated. Please sign in with your new email address to continue."}),(0,t.jsx)(q.Button,{href:"/login",fullWidth:!0,size:"xl",children:"Sign in with new email"})]}):(0,t.jsxs)("div",{className:j.default.background,children:[(0,t.jsx)(D.Title,{className:j.default.title,children:"Email change failed"}),(0,t.jsx)(Y.Text,{children:n}),(0,t.jsx)(q.Button,{href:"/login",fullWidth:!0,size:"xl",leftSection:(0,t.jsx)(C.ArrowLeftIcon,{}),children:"Back to login"})]})},eA=({actionCode:e})=>{let[o,a]=(0,i.useState)(!1),[s,n]=(0,i.useState)(!0),[l,c]=(0,i.useState)(!1),[m,g]=(0,i.useState)(!1),f=(0,r.useRouter)(),p=(0,i.useRef)(!1),{authLoaded:v}=u.Auth.useSnapshot("authLoaded");(0,i.useEffect)(()=>{v&&e&&!p.current&&(p.current=!0,(async()=>{try{if(await u.Auth.applyActionCode(e),a(!0),window.localStorage.setItem("email_verified",JSON.stringify(!0)),!u.Auth?.user?.uid){(0,h.captureMessage)("Failed to verify email because user was null."),n(!1);return}await J(),n(!1)}catch(e){(0,h.captureException)(e),n(!1),e&&f.push("/verify-email")}})())},[v,e,f]);let x=async()=>{try{await u.Auth.signOut(),e_.mixpanelClient.reset()}catch(e){(0,h.captureException)(e)}f.push("/login")};if(s)return(0,t.jsxs)("div",{className:j.default.background,children:[(0,t.jsx)(D.Title,{className:j.default.title,children:"Verifying email"}),(0,t.jsx)(Y.Text,{children:"Please wait while we verify your email"}),(0,t.jsx)(q.Button,{href:"/",size:"xl",fullWidth:!0,leftSection:(0,t.jsx)(C.ResetIcon,{}),onClick:()=>window.location.reload(),children:"Refresh"}),(0,t.jsx)(q.Button,{variant:"minimal",size:"xl",fullWidth:!0,onClick:()=>void x(),children:"Sign out"})]});let _=(0,d.readPendingInvite)(),w=!!u.Auth.user&&(0,d.invitationsAwaitVerification)(),k=async()=>{c(!0),g(!1);try{await (0,d.continueToPendingInvite)(_)}
2catch(e){(0,h.captureException)(e,"Failed to continue to invitation after email verification"),c(!1),g(!0)}};if(o&&w){let e=_?.workspaceName;return(0,t.jsxs)("div",{className:j.default.background,children:[(0,t.jsx)("div",{className:j.default.successIcon,children:(0,t.jsx)(C.CheckIcon,{})}),(0,t.jsx)(D.Title,{className:j.default.title,children:"Your email is verified"}),(0,t.jsx)(Y.Text,{children:e?`Your invitation to ${e} has been accepted.`:"Your invitation has been accepted."}),m&&(0,t.jsx)(B.Alert,{variant:"danger",showIcon:!1,children:"We could not open your invitation. Try again, or open the link in your invitation email."}),(0,t.jsx)(q.Button,{fullWidth:!0,size:"xl",loading:l,onClick:()=>void k(),children:e?`Continue to ${e}`:"Continue to your invitation"})]})}return o?(0,t.jsxs)("div",{className:j.default.background,children:[(0,t.jsx)("div",{className:j.default.successIcon,children:(0,t.jsx)(C.CheckIcon,{})}),(0,t.jsx)(D.Title,{className:j.default.title,children:"Your email is verified"}),(0,t.jsx)(Y.Text,{children:"Please click on the button below to get back to the application"}),(0,t.jsx)(q.Button,{href:"/",fullWidth:!0,size:"xl",onClick:()=>window.location.reload(),children:"Continue to application"})]}):null},eO=({isSignIn:e,onlySignIn:o,inviteDetails:a,loading:s,prompt:n,mode:l,oobCode:c})=>{let u=(0,r.useRouter)(),[d,m]=(0,i.useState)("sign-in-up"),[g,h]=(0,i.useState)(""),[f,p]=(0,i.useState)(!1),v=e=>{p(!0),setTimeout(()=>{e(),p(!1)},250)};return(0,t.jsx)("div",{className:j.default.loginForm,children:(0,t.jsx)("div",{className:j.default.background,children:s?(0,t.jsx)("div",{className:j.default.loaderContainer,children:(0,t.jsx)(w.Loader,{color:"var(--color-icon-brand)"})}):"resetPassword"===l&&c?(0,t.jsx)(z,{oobCode:c,isTransitioning:f,onBack:()=>v(()=>void u.replace("/login",void 0,{shallow:!0}))}):"verifyEmail"===l&&c?(0,t.jsx)(eA,{actionCode:c}):"verifyAndChangeEmail"===l&&c?(0,t.jsx)(eT,{actionCode:c}):"recoverEmail"===l&&c?(0,t.jsx)(Z,{actionCode:c}):"sso"===d?(0,t.jsx)(eP,{initialEmail:g,inviteDetails:a,isTransitioning:f,onBack:()=>v(()=>m("sign-in-up")),onSignedIn:()=>{window.location.href="/"}}):"forgot-password"===d?(0,t.jsx)(K,{inviteDetails:a,isTransitioning:f,onBack:()=>v(()=>m("sign-in-up"))}):(0,t.jsx)(eN,{isSignIn:e,onlySignIn:o,inviteDetails:a,prompt:n,isTransitioning:f,onGoToForgotPassword:()=>v(()=>m("forgot-password")),onGoToSso:e=>{e&&h(e),v(()=>m("sso"))}})})})};var eL=e.i(600022);let eF=({domain:e,isSignIn:r,inviteDetails:o,loading:a,prompt:s,mode:n,oobCode:l})=>{let[c,u]=(0,i.useState)(!0);return(0,i.useEffect)(()=>{e&&"localhost"!==e&&"localhost:3000"!==e&&"app.atlas.co"!==e&&!e.includes("atlasco.vercel.app")?u(!1):("app.atlas.co"===e||"localhost"===e||"localhost:3000"===e||e.includes("atlasco.vercel.app"))&&u(!1)},[e]),!c&&(0,t.jsx)(x.SetBrandColors,{children:(0,t.jsxs)("div",{className:_.default.container,children:[(0,t.jsx)("div",{className:_.default.absoluteLogo,children:(0,t.jsx)(eL.default,{className:_.default.logo,src:"/static/brand/logo-dark.svg",alt:"Logo"})}),(0,t.jsx)("div",{className:_.default.formContainer,children:(0,t.jsx)(eO,{onlySignIn:o.existingUser,isSignIn:r,inviteDetails:o,loading:a,prompt:s,mode:n,oobCode:l})}),(0,t.jsx)("div",{className:_.default.rightContainer,children:(0,t.jsxs)("div",{className:_.default.heroContainer,children:[(0,t.jsx)("div",{className:_.default.heroBg,children:(0,t.jsx)("img",{src:"/static/hero/map-bg-data.jpg",alt:"Map Background",width:"100%",height:"auto",style:{objectFit:"cover"},loading:"eager"})}),(0,t.jsx)("div",{className:_.default.leftSidebar,children:(0,t.jsx)("img",{src:"/static/hero/left-sidebar.svg",alt:"Left Sidebar"})}),(0,t.jsx)("div",{className:_.default.color,children:(0,t.jsx)("img",{src:"/static/hero/color.svg",alt:"Color"})}),(0,t.jsx)("div",{className:_.default.buffer,children:(0,t.jsx)("img",{src:"/static/hero/buffer.svg",alt:"Buffer"})}),(0,t.jsx)("div",{className:_.default.tools,children:(0,t.jsx)("img",{src:"/static/hero/tools.svg",alt:"Tools"})})]})})]})})};var eM=e.i(289942);e.s(["__N_SSP",0,!0,"default",0,({domain:e})=>{let x=(0,r.useRouter)(),{user:_,authLoaded:w,token:j,userMeta:C}=u.Auth.useSnapshot("user","token","authLoaded","userMeta"),k=!!x?.query["sign-in"],b=x?.query.prompt?decodeURIComponent(x?.query.prompt):void 0,S=x?.query.mode,y=S?x?.query.oobCode:void 0,I=!!y&&("resetPassword"===S||"verifyEmail"
2===S||"verifyAndChangeEmail"===S||"recoverEmail"===S),N=(0,i.useMemo)(()=>{var e;return{workspaceId:(e=x?.query??{}).invWorkspace,workspaceName:e.invWorkspaceName,projectId:e.invProject,inviteAs:e.invInviteAs,interfaceId:e.invInterface,existingUser:"true"===e.existingUser,email:e.email?decodeURIComponent(e.email):"",projectToDuplicate:e.projectToDuplicate,duplicationProjectId:e.duplicationProjectId}},[x?.query]),P=x?.query["pricing-plans"]==="true",E=x?.query.next,T=(0,f.isSafeNextPath)(E)?E:void 0,A=(0,i.useRef)(!1),O=(0,i.useRef)(!1),L=(0,i.useRef)(!1),{importProject:F}=(0,v.useProjectImportIntoWorkspace)({}),M=(0,g.useViewingWorkspaceId)(),[R,B]=(0,i.useState)(!1),q=w&&_&&!_.isAnonymous,V=(0,i.useRef)(!1);q&&(V.current=!0);let D=(V.current||R)&&!I,W=!w;return((0,i.useEffect)(()=>{!q||!b||A.current||I||C?.active_workspace&&(A.current=!0,(0,eM.createProject)({currentWorkspaceId:C.active_workspace,redirect:!1,folderId:void 0,name:void 0,isWorkspaceProject:!1}).then(e=>{e&&(window.location.href=`/projects/${e}?prompt=${encodeURIComponent(b)}`)}).catch(e=>{(0,h.captureException)(e),(0,m.handleQuotaError)(e,{fallbackFeature:n.planFeature.num_projects})||o.toast.error("Failed to create project"),p.promptRedirectState.clearPrompt(),A.current=!1}))},[q,b,C?.active_workspace,I]),(0,i.useEffect)(()=>{if(q&&!b&&!I&&C){if(!C.onboarding_complete){(0,d.savePendingInvite)(N),window.location.href="/onboarding";return}if(!N.projectId&&!N.workspaceId)if(N.projectToDuplicate&&j){if(!M||L.current)return;L.current=!0,F(N.projectToDuplicate,M)}else N.duplicationProjectId?window.location.href=`/projects/${N.duplicationProjectId}`:P?x.push("/?pricing-plans=true"):T?window.location.href=T:window.location.href="/projects/all"}},[q,b,j,I,N,F,M,P,x,T,C]),(0,i.useEffect)(()=>{q&&!b&&j&&!I&&null!==C&&(N.projectId||N.workspaceId)&&!O.current&&(O.current=!0,B(!0),(async()=>{try{let{data:e}=await (0,a.resolveInvitations)({body:{token:j}});if(e?.pending_invitations_await_verification){(0,d.savePendingInvite)(N),(0,d.markInvitationsAwaitingVerification)(),await x.replace("/verify-email");return}await (0,d.redirectToInviteTarget)(N,e?.default_workspace_id_for_user)}catch(e){if((0,h.captureException)(e,"Failed to resolve invitations from login flow"),N.workspaceId)try{await (0,s.setActiveWorkspace)({body:{workspace_id:N.workspaceId}}),u.Auth.updateActiveWorkspace(N.workspaceId),u.Auth.forceRefreshToken()}catch{o.toast.warning("You do not have access to this workspace. Please make sure you are logged in with the correct user.")}window.location.href="/"}})())},[q,b,j,C,N,I,x]),D)?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(c.Meta,{}),(0,t.jsx)("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",height:"100vh",width:"100vw"},children:(0,t.jsx)(l.Loader,{color:"var(--color-icon-brand)"})})]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(c.Meta,{}),(0,t.jsx)(eF,{domain:e||"",isSignIn:k,inviteDetails:N,loading:W,prompt:b,mode:S,oobCode:y})]})}],993001)},539152,(e,t,r)=>{let i="/login";(window.__NEXT_P=window.__NEXT_P||[]).push([i,()=>e.r(993001)]),t.hot&&t.hot.dispose(function(){window.__NEXT_P.push([i])})},639904,(e,t,r)=>{"use strict";var i=e.e&&e.e.__assign||function(){return(i=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=e.e&&e.e.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,o)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),a=e.e&&e.e.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||o(t,e,r)},s=e.e&&e.e.__awaiter||function(e,t,r,i){return new(r||(r=Promise))(function(o,a){function s(e){try{l(i.next(e))}catch(e){a(e)}}function n(e){try{l(i.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?o(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,n)}l((i=i.apply(e,t||[])).next())})},n=e.e&&e.e.__generator||function(e,t){var r,i,o,a,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function n(n){return function(l){var c=[n,l];if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(s=0)),s;)try{if(r=1,i&&(o=2&c[0]?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return s.label++,{value:c[1],done:!1};case 5:s.label++,i=c[1],c=[0];continue;case 7:c=s.ops.pop(),s.trys.pop();continue;default:if(!(o=(o=s.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){s=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){s.label=c[1];break}if(6===c[0]&&s.label<o[1]){s.label=o[1],o=c;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(c);break}o[2]&&s.ops.pop(),s.trys.pop();continue}c=t.call(e,s)}catch(e){c=[6,e],i=0}finally{r=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}},l=e.e&&e.e.__rest||function(e,t){var r={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&0>t.indexOf(i)&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,i=Object.getOwnPropertySymbols(e);o<i.length;o++)0>t.indexOf(i[o])&&Object.prototype.propertyIsEnumerable.call(e,i[o])&&(r[i[o]]=e[i[o]]);return r};
2Object.defineProperty(r,"__esModule",{value:!0}),r.hasCookie=r.deleteCookie=r.setCookie=r.getCookie=r.getCookies=void 0;var c=e.r(913492),u=e.r(362361),d=function(e){if((0,u.isClientSide)(e))throw Error("You are trying to access cookies on the client side. Please, use the client-side import with `cookies-next/client` instead.")},m=function(e){return!!e&&"getAll"in e&&"set"in e&&"function"==typeof e.getAll&&"function"==typeof e.set},g=function(e){return!!(null==e?void 0:e.req)&&"cookies"in e.req&&m(e.req.cookies)||!!(null==e?void 0:e.res)&&"cookies"in e.res&&m(e.res.cookies)||!!e&&"cookies"in e&&"function"==typeof e.cookies},h=function(e){var t={};return e.getAll().forEach(function(e){var r=e.name,i=e.value;t[r]=i}),t},f=function(e){return s(void 0,void 0,void 0,function(){var t,r;return n(this,function(i){switch(i.label){case 0:if(d(e),!g(e))return[3,2];if(e.req)return[2,h(e.req.cookies)];if(e.res)return[2,h(e.res.cookies)];if(!e.cookies)return[3,2];return t=h,[4,e.cookies()];case 1:return[2,t.apply(void 0,[i.sent()])];case 2:if((null==e?void 0:e.req)&&(r=e.req),null==r?void 0:r.cookies)return[2,r.cookies];if(null==r?void 0:r.headers.cookie)return[2,(0,c.parse)(r.headers.cookie)];return[2,{}]}})})};r.getCookies=f,r.getCookie=function(e,t){return s(void 0,void 0,void 0,function(){var r;return n(this,function(i){switch(i.label){case 0:return d(t),[4,f(t)];case 1:if(void 0===(r=i.sent()[e]))return[2,void 0];return[2,(0,u.decode)(r)]}})})};var p=function(e,t,r){return s(void 0,void 0,void 0,function(){var o,a,s,m,h,f,p,v,x,_,w,j,C,k,b;return n(this,function(n){switch(n.label){case 0:if(d(r),!g(r))return[3,3];if(o=r.req,a=r.res,s=r.cookies,m=l(r,["req","res","cookies"]),h=i({name:e,value:(0,u.stringify)(t)},m),o&&o.cookies.set(h),a&&a.cookies.set(h),!s)return[3,2];return[4,s()];case 1:n.sent().set(h),n.label=2;case 2:return[2];case 3:return f={},r&&(_=(x=r).req,w=x.res,j=l(x,["req","res"]),p=_,v=w,f=j),C=(0,c.serialize)(e,(0,u.stringify)(t),i({path:"/"},f)),v&&p&&(Array.isArray(k=v.getHeader("Set-Cookie"))||(k=k?[String(k)]:[]),v.setHeader("Set-Cookie",k.concat(C)),p&&p.cookies&&(b=p.cookies,""===t?delete b[e]:b[e]=(0,u.stringify)(t)),p&&p.headers&&p.headers.cookie&&(b=(0,c.parse)(p.headers.cookie),""===t?delete b[e]:b[e]=(0,u.stringify)(t),p.headers.cookie=Object.entries(b).reduce(function(e,t){return e.concat("".concat(t[0],"=").concat(t[1],";"))},""))),[2]}})})};r.setCookie=p,r.deleteCookie=function(e,t){return s(void 0,void 0,void 0,function(){return n(this,function(r){return d(t),[2,p(e,"",i(i({},t),{maxAge:-1}))]})})},r.hasCookie=function(e,t){return s(void 0,void 0,void 0,function(){return n(this,function(r){switch(r.label){case 0:if(d(t),!e)return[2,!1];return[4,f(t)];case 1:return[2,r.sent().hasOwnProperty(e)]}})})},a(e.r(864883),r)},180950,(e,t,r)=>{"use strict";var i=e.e&&e.e.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var o=Object.getOwnPropertyDescriptor(t,r);(!o||("get"in o?!t.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,o)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),o=e.e&&e.e.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),a=e.e&&e.e.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&i(t,e,r);return o(t,e),t},s=e.e&&e.e.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||i(t,e,r)};Object.defineProperty(r,"__esModule",{value:!0}),r.CookiesNextProvider=r.useReactiveCookiesNext=r.useReactiveHasCookie=r.useReactiveDeleteCookie=r.useReactiveSetCookie=r.useReactiveGetCookie=r.useReactiveGetCookies=r.useCookiesNext=r.useDeleteCookie=r.useGetCookie=r.useSetCookie=r.useHasCookie=r.useGetCookies=r.hasCookie=r.deleteCookie=r.setCookie=r.getCookie=r.getCookies=void 0;var n=a(e.r(846627)),l=a(e.r(639904));s(e.r(864883),r);var c=e.r(362361);r.getCookies=function(e){return(0,c.isClientSide)(e)?n.getCookies(e):l.getCookies(e)},r.getCookie=function(e,t){return(0,c.isClientSide)(t)?n.getCookie(e,t):l.getCookie(e,t)},r.setCookie=function(e,t,r){return(0,c.isClientSide)(r)?n.setCo
2okie(e,t,r):l.setCookie(e,t,r)},r.deleteCookie=function(e,t){return(0,c.isClientSide)(t)?n.deleteCookie(e,t):l.deleteCookie(e,t)},r.hasCookie=function(e,t){return(0,c.isClientSide)(t)?n.hasCookie(e,t):l.hasCookie(e,t)};var u=e.r(846627);Object.defineProperty(r,"useGetCookies",{enumerable:!0,get:function(){return u.useGetCookies}}),Object.defineProperty(r,"useHasCookie",{enumerable:!0,get:function(){return u.useHasCookie}}),Object.defineProperty(r,"useSetCookie",{enumerable:!0,get:function(){return u.useSetCookie}}),Object.defineProperty(r,"useGetCookie",{enumerable:!0,get:function(){return u.useGetCookie}}),Object.defineProperty(r,"useDeleteCookie",{enumerable:!0,get:function(){return u.useDeleteCookie}}),Object.defineProperty(r,"useCookiesNext",{enumerable:!0,get:function(){return u.useCookiesNext}}),Object.defineProperty(r,"useReactiveGetCookies",{enumerable:!0,get:function(){return u.useReactiveGetCookies}}),Object.defineProperty(r,"useReactiveGetCookie",{enumerable:!0,get:function(){return u.useReactiveGetCookie}}),Object.defineProperty(r,"useReactiveSetCookie",{enumerable:!0,get:function(){return u.useReactiveSetCookie}}),Object.defineProperty(r,"useReactiveDeleteCookie",{enumerable:!0,get:function(){return u.useReactiveDeleteCookie}}),Object.defineProperty(r,"useReactiveHasCookie",{enumerable:!0,get:function(){return u.useReactiveHasCookie}}),Object.defineProperty(r,"useReactiveCookiesNext",{enumerable:!0,get:function(){return u.useReactiveCookiesNext}}),Object.defineProperty(r,"CookiesNextProvider",{enumerable:!0,get:function(){return u.CookiesNextProvider}})}]); 3 4//# debugId=56527d80-01c7-874e-d0a5-9e9f1a46e10b
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.