1import{j as e}from"./vendor-data-eBPZki-Z.js";import{o as R,k as w,f as C,r as n,L as m}from"./vendor-react-BgtJhS2O.js";import{a as E,u,dJ as I,dK as A,dL as L,dM as _,c,dN as D,dO as T,e as O,d as F,dP as j}from"./index-DTQGL8n8.js";import{S as M}from"./SignupFlow-B2bSANcR.js";import{A as G,P as z}from"./storeLinks-x0Bqktw8.js";import"./vendor-zod-Bei2Z9MS.js";import"./OtpInput-C1xRuUQ3.js";function U({className:r}){return e.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",className:r,"aria-hidden":"true",children:e.jsx("path",{d:"M18.71 19.5c-.83 1.24-1.71 2.45-3.05 2.47-1.34.03-1.77-.79-3.29-.79-1.53 0-2 .77-3.27.82-1.31.05-2.3-1.32-3.14-2.53C4.25 17 2.94 12.45 4.7 9.39c.87-1.52 2.43-2.48 4.12-2.51 1.28-.02 2.5.87 3.29.87.78 0 2.26-1.07 3.81-.91.65.03 2.47.26 3.64 1.98-.09.06-2.17 1.28-2.15 3.81.03 3.02 2.65 4.03 2.68 4.04-.03.07-.42 1.44-1.38 2.83M13 3.5c.73-.83 1.94-1.46 2.94-1.5.13 1.17-.34 2.35-1.04 3.19-.69.85-1.83 1.51-2.95 1.42-.15-1.15.41-2.35 1.05-3.11z"})})}function B({className:r}){return e.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"currentColor",className:r,"aria-hidden":"true",children:e.jsx("path",{d:"M3.609 1.814L13.792 12 3.61 22.186a.996.996 0 0 1-.61-.92V2.734a1 1 0 0 1 .609-.92zm10.89 10.893l2.302 2.302-10.937 6.333 8.635-8.635zm3.199-3.198l2.807 1.626a1 1 0 0 1 0 1.73l-2.808 1.626L15.206 12l2.492-2.491zM5.864 2.658L16.802 9.01l-2.303 2.303-8.635-8.655z"})})}const V=/^[A-Za-z0-9_-]{1,64}$/;function Y(r){return!!r&&V.test(r)}function X(){const{code:r}=R(),[h]=w(),x=C(),o=E(),i=u(a=>a.user),N=u(a=>a.isLoggedIn),l=Y(r)?r:null,t=n.useMemo(()=>l?I(l):null,[l]),g=h.toString(),s=n.useMemo(()=>t?A(new URLSearchParams(g),t):null,[t,g]),b=n.useRef(!1);n.useEffect(()=>{b.current||!t||!s||(b.current=!0,L({deviceId:s,code:t,type:"code"}))},[t,s]);const y=h.get("setup")==="complete",[P,S]=n.useState(!1),p=n.useRef(!1);if(n.useEffect(()=>{p.current||!t||!s||(p.current=!0,_(t,s)&&o?.track(c.REFERRAL_CLICK_FIRED,{extra:{code:t,deviceId:s}}))},[t,s,o]),!l)return e.jsxs(f,{children:[e.jsx("h1",{className:"text-2xl font-bold text-text dark:text-text-dark mb-2",children:"Invalid Invite Link"}),e.jsx("p",{className:"text-text-secondary dark:text-text-secondary-dark mb-6",children:"This invite link appears to be invalid."}),e.jsx(m,{to:"/login",className:"block w-full h-12 leading-[3rem] px-4 bg-brand text-white font-medium rounded-full text-sm",children:"Sign up for Parler anyway"})]});if(P||y)return e.jsx(q,{});if(N&&i){const a=i.accountSetup===!1,d=i.username||i.email||"your account";return e.jsxs(f,{children:[e.jsx("h1",{className:"text-2xl font-bold text-text dark:text-text-dark mb-2",children:a?"Welcome to Parler!":"You're already on Parler"}),e.jsx("p",{className:"text-text-secondary dark:text-text-secondary-dark mb-6",children:a?"Finish setting up your profile to get started.":`Signed in as ${d}.`}),e.jsx(m,{to:a?"/create-profile":"/feed",className:"block w-full h-12 leading-[3rem] px-4 bg-brand text-white font-medium rounded-full text-sm",children:a?"Set up profile":"Go to feed"})]})}return e.jsxs(f,{children:[e.jsx("h1",{className:"text-2xl font-bold text-text dark:text-text-dark mb-2",children:"You've been invited to Parler"}),e.jsx("p",{className:"text-text-secondary dark:text-text-secondary-dark mb-6",children:"Create an account to join the conversation."}),e.jsx("div",{className:"border border-border-light dark:border-border-dark rounded-lg p-8 text-left",children:e.jsx(M,{variant:"invite",inviteCode:t??void 0,referralDeviceId:s,onAuthSuccess:a=>{D(),o?.track(c.AUTH_LOGIN,{extra:{method:a,surface:"join",inviteCode:t??null}}),o?.track(c.REFERRAL_OTP_VERIFIED,{extra:{code:t,method:a}}),o?.track(c.REFERRAL_EDGE_CONFIRMED,{extra:{code:t}});const d=u.getState().user,k=!!T();if(d?.accountSetup===!1){k||sessionStorage.setItem("join-return-code",t??""),x("/create-profile",{replace:!0});return}if(d&&d.acceptTermsOfService===!1){k||sessionStorage.setItem("join-return-code",t??""),x("/accept-terms?onboarding=1",{replace:!0});return}const v=O();if(v.kind==="path"){F(v,x);return}S(!0)}})})]})}function f({children:r}){return e.jsx("div",{className:"min-h-dvh bg-bg dark:bg-bg-dark flex items-center justify-center px-4",children:e.jsxs("div",{className:"max-w-md w-full text-center",children:[e.jsx("div",{className:"mb-8 flex justify-center",children:e.jsx(j,{className:"h-16 w-auto","aria-label":"Parler logo"})}),r]})})}function q(){return e.jsx("div",{className:"min-h-dvh bg-bg dark:bg-bg-dark flex items-center justify-center px-4",children:e.jsxs("div",{className:"max-w-md w-full text-center",children:[e.jsx("div",{className:"mb-6 flex justify-center",children:e.jsx(j,{className:"h-16 w-auto","aria-label":"Parler logo"})}),e.jsx("h1",{className:"text-3xl font-bold text-text dark:text-text-dark mb-2",children:"Welcome to Parler!"}),e.jsx("p",{className:"text-text-secondary dark:text-text-secondary-dark mb-8",children:"Continue on your phone for the best experience."}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("a",{href:G,target:"_blank",rel:"noopener noreferrer",className:"block","aria-label":"Download on the App Store",children:e.jsxs("div",{className:"bg-bg-elevated dark:bg-bg-elevated-dark text-text dark:text-text-dark rounded-lg px-6 py-3 flex items-center justify-center space-x-3 hover:bg-bg dark:hover:bg-bg-dark transition-colors",children:[e.jsx(U,{className:"text-text dark:text-text-dark"}),e.jsxs("div",{className:"text-left",children:[e.jsx("div",{className:"text-xs",children:"Download on the"}),e.jsx("div",{className:"text-lg font-semibold",children:"App Store"})]})]})}),e.jsx("a",{href:z,target:"_blank",rel:"noopener noreferrer",className:"block","aria-label":"Get it on Google Play",children:e.jsxs("div",{className:"bg-bg-elevated dark:bg-bg-elevated-dark text-text dark:text-text-dark rounded-lg px-6 py-3 flex items-center justify-center space-x-3 hover:bg-bg dark:hover:bg-bg-dark transition-colors",children:[e.jsx(B,{className:"text-text dark:text-text-dark"}),e.jsxs("div",{className:"text-left",children:[e.jsx("div",{className:"text-xs",children:"Get it on"}),e.jsx("div",{className:"text-lg font-semibold",children:"Google Play"})]})]})})]}),e.jsx("div",{className:"mt-8 pt-8 border-t border-border-light/60 dark:border-border-dark/60",children:e.jsx(m,{to:"/feed",className:"text-brand hover:underline font-medium",children:"Continue in browser"})})]})})}export{X 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.