"use strict";(globalThis.webpackChunk_clerk_ui=globalThis.webpackChunk_clerk_ui||[]).push([["265"],{1170:function(e,i,t){t.r(i),t.d(i,{WaitlistModal:()=>D,Waitlist:()=>z});var l=t(4518),r=t(9400),n=t(6088),a=t(3269),o=t(8640),s=t(451),d=t(2861),c=t(4607),h=t(4132),u=t(2265),m=t(2454),Y=t(6153),p=t(4468),g=t(6245),f=t(8272),w=t(8920),A=t(4901),v=t(8388),b=t(4964),I=t(4374);let y=e=>{let i=(0,r.ho)(),t=(0,a.f0)(),o=(0,A.m)(),{navigate:c}=(0,b.r)(),h=(0,s.Y)(),{formState:u}=e,y=(0,g.X)({onNextStep:()=>t.setError(void 0)}),z=async e=>{e.preventDefault(),o.setLoading(),t.setLoading(),t.setError(void 0);let l={emailAddress:u.emailAddress.value};await i.joinWaitlist(l).then(()=>{y.nextStep(),setTimeout(()=>{h.afterJoinWaitlistUrl&&c(h.afterJoinWaitlistUrl)},2e3)}).catch(e=>{(0,p.H4)(e,[u.emailAddress],t.setError)}).finally(()=>{o.setIdle(),t.setIdle()})};return(0,l.FD)(g.s,{...y.props,children:[(0,l.FD)(f.fv,{gap:6,children:[(0,l.FD)(Y.Y.Root,{showLogo:!0,children:[(0,l.Y)(Y.Y.Title,{localizationKey:(0,d.G)("waitlist.start.title")}),(0,l.Y)(Y.Y.Subtitle,{localizationKey:(0,d.G)("waitlist.start.subtitle")})]}),(0,l.Y)(n.Z.Alert,{children:t.error}),(0,l.Y)(f.so,{direction:"col",elementDescriptor:w.$z.main,gap:6,children:(0,l.FD)(m.l.Root,{onSubmit:z,gap:8,children:[(0,l.Y)(f.fv,{gap:6,children:(0,l.Y)(m.l.ControlRow,{elementId:"emailAddress",children:(0,l.Y)(m.l.PlainInput,{...u.emailAddress.props,isRequired:!0})})}),(0,l.Y)(f.fv,{center:!0,children:(0,l.Y)(m.l.SubmitButton,{localizationKey:(0,d.G)("waitlist.start.formButton")})})]})})]}),(0,l.FD)(f.fv,{gap:6,children:[(0,l.FD)(Y.Y.Root,{showLogo:!0,children:[(0,l.Y)(Y.Y.Title,{localizationKey:(0,d.G)("waitlist.success.title")}),(0,l.Y)(Y.Y.Subtitle,{localizationKey:(0,d.G)("waitlist.success.subtitle")})]}),h.afterJoinWaitlistUrl&&(0,l.Y)(f.so,{direction:"col",elementDescriptor:w.$z.main,gap:6,children:(0,l.Y)(f.fv,{center:!0,children:(0,l.FD)(f.so,{gap:2,align:"center",children:[(0,l.Y)(f.In,{icon:v.A,sx:e=>({margin:"auto",width:e.sizes.$6,height:e.sizes.$6,animation:`${I.W.spinning} 1s linear infinite`})}),(0,l.Y)(f.EY,{colorScheme:"secondary",localizationKey:(0,d.G)("waitlist.success.message")})]})})})]})]})},z=(0,a.dm)(()=>{let e=(0,r.ho)(),i=(0,s.Y)(),{signInUrl:t}=i,a=i.initialValues||{},h={emailAddress:(0,o.tJ)("emailAddress",a.emailAddress||"",{type:"email",label:(0,d.G)("formFieldLabel__emailAddress"),placeholder:(0,d.G)("formFieldInputPlaceholder__emailAddress")})};return(0,l.Y)(c.n.Root,{flow:"waitlist",children:(0,l.FD)(n.Z.Root,{children:[(0,l.Y)(n.Z.Content,{children:(0,l.Y)(y,{formState:h})}),(0,l.Y)(n.Z.Footer,{children:(0,l.FD)(n.Z.Action,{elementId:"waitlist",children:[(0,l.Y)(n.Z.ActionText,{localizationKey:(0,d.G)("waitlist.start.actionText")}),(0,l.Y)(n.Z.ActionLink,{localizationKey:(0,d.G)("waitlist.start.actionLink"),to:e.buildUrlWithAuth(t)})]})})]})})}),D=e=>{let i={signInUrl:`/${h.I}/sign-in`,...e,routing:"virtual"};return(0,l.Y)(u.q,{path:"waitlist",children:(0,l.Y)(s.r.Provider,{value:{...i,componentName:"Waitlist",mode:"modal"},children:(0,l.Y)("div",{children:(0,l.Y)(z,{})})})})}},451:function(e,i,t){t.d(i,{Y:()=>h,r:()=>c});var l=t(4173),r=t(630),n=t(7697),a=t(2366),o=t(4964),s=t(2117);let d=["email_address"],c=(0,r.createContext)(null),h=()=>{let e=(0,r.useContext)(c),{displayConfig:i}=(0,n.O)(),t=(0,a.II)(),{queryString:h}=(0,o.r)(),u=(0,r.useMemo)(()=>(0,s.tf)(h,d),[]);if(!e||"Waitlist"!==e.componentName)throw Error("Clerk: useWaitlistContext called outside Waitlist.");let{componentName:m,...Y}=e,p=Y.signInUrl||t.signInUrl||i.signInUrl;return p=(0,l.kZ)({base:p},{stringify:!0}),{...Y,componentName:m,signInUrl:p,initialValues:{...u}}}}}]);