1import{_ as ae}from"./BdkBgYLd.js";import{_ as ie,a as se,b as le,c as re}from"./0Ozj_zc4.js";import{_ as oe}from"./DZS7iAwq.js";import{a$ as ne,bu as A,b7 as b,aQ as me,aR as O,bC as ce,bp as de,bt as pe,aT as $,ba as ue,bb as y,bq as fe,b5 as E,bj as S,b1 as t,b2 as v,be as d,b4 as n,bA as x,br as U,c7 as ge,bL as he,bV as we,bh as ve,bg as xe,b6 as R,b3 as be,bf as _e,cc as Ne,eV as ye,bw as Ee,bx as Se,cb as Re,bz as M,cz as Ae,bl as Fe,by as Ve,bO as ke}from"./DxgWOYC7.js";import{F as Ce}from"./CPsRQ-0o.js";import{c as Oe,b as T}from"./VhNWnv0R.js";import{i as Te}from"./JW8Cg2ha.js";import{p as Be}from"./D7I_Qf0q.js";import{u as Pe}from"./CBoc-nQv.js";import{a as Ie}from"./ChdAXFQ2.js";import{d as Le}from"./DR7V5NZm.js";import{l as $e,c as D}from"./CUVfMQFT.js";import"./C09C3FBS.js";import"./blj-DMbf.js";import"./DO_ZAZE0.js";import"./CjXQqCLz.js";import"./DzULpy3F.js";import"./BD_B4czg.js";import"./DmGYkCXc.js";import"./CQonJtlf.js";import"./By0pmW9M.js";import"./w9SQIKAR.js";(function(){try{var m=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};m.SENTRY_RELEASE={id:"68c4f94e"};var s=new m.Error().stack;s&&(m._sentryDebugIds=m._sentryDebugIds||{},m._sentryDebugIds[s]="c26f10a5-97e5-488d-80df-18751b64765e",m._sentryDebugIdIdentifier="sentry-dbid-c26f10a5-97e5-488d-80df-18751b64765e")}catch{}})();const Ue=(m,s)=>{const c=b(!1),p=()=>s.firstName.trim().length>0&&s.lastName.length>=1;return ne(()=>[s.firstName,s.lastName,s.email],()=>{!m||c.value||(s.email.trim()||p())&&(c.value=!0)},{immediate:!0}),{showEmailField:A(()=>!m||c.value),revealEmailFieldForValidation:()=>{m&&(c.value=!0)}}},Me={class:"relative"},De={class:"flex w-full flex-col gap-2.5"},ze={class:"flex w-full flex-col gap-2.5"},He={class:"flex w-full flex-col gap-2.5"},We={class:"mt-8 flex w-full flex-col items-center justify-center px-3 md:mt-[68px]"},qe={key:2,class:"flex w-full max-w-[350px] flex-col items-center gap-2 md:!max-w-[220px]"},je={class:"my-3 text-[0.834rem] leading-4 text-rose-500"},f="first",Ge=me({__name:"index",async setup(m){let s,c;const{$am:p,$unleash:F,$eventBus:B,$steps:g}=O(),{updateEmail:z}=Pe();ce({title:"ScholarshipOwl: Win More Scholarships With Less Effort",meta:[{name:"description",content:"Register with ScholarshipOwl to find scholarships, apply for them."},{property:"og:title",content:"Win More Scholarships With Less Effort"},{property:"og:description",content:"Register with ScholarshipOwl to find scholarships, apply for them."},{name:"twitter:card",content:"summary"},{name:"twitter:site",content:"@ScholarshipOwl"},{name:"twitter:description",content:"Register with ScholarshipOwl to find scholarships, apply for them."}],link:[{rel:"canonical",href:"https://scholarshipowl.com/registration"}]}),Le("Public",{title:"Hello! Let's Start With the Basics.",description:"Enter your name and email so that we can start matching you to scholarships."},{cacheKey:"registration"});const u=b(!1),V=b(!1),P=b(!1),I=A(()=>W.value==="unauthenticated"),k=A(()=>Ne()),H=A(()=>k.value),_=b(""),{me:r,status:W,fetchMe:q,signUp:j}=de(),i=pe({get firstName(){return this._firstName},set firstName(l){this._firstName=l},get lastName(){return this._lastName},set lastName(l){this._lastName=l},get email(){return this._email},set email(l){this._email=l},_firstName:r.value?.profile?.firstName||"",_lastName:r.value?.profile?.lastName||"",_email:r.value?.email||""}),G=([s,c]=$(()=>F.getVariant("social-proof-first-step")),s=await s,c(),s),h=([s,c]=$(()=>F.getVariant("rf-hidden-email")),s=await s,c(),s).name==="on",{showEmailField:K,revealEmailFieldForValidation:Q}=Ue(h,i);ue(()=>{r.value&&p.loggedIn({id:r.value.id}),G.name==="on"&&y().trackRegistrationStep(f),p.view("/registration")});const Y=Oe({email:T().required("Please enter email address").test("email","Email address is invalid",fe).label("Email"),lastName:T().required("Please enter last name").label("Last name"),firstName:T().required("Please enter first name").label("First name")}),J=async l=>{try{if(i.firstName===r.value?.profile.firstName&&i.lastName===r.value?.profile.lastName&&i.email===r.value?.email){await g.navigateNext();return}const e=i.firstName!==r.value?.profile.firstName||i.lastName!==r.value?.profile.lastName;i.email!==r.value?.email&&await z(i.email),e&&await Be({lastName:i.lastName,firstName:i.firstName},{attributes:["firstName","lastName"]}),await g.navigateNext()}catch(e){if(u.value=!1,e.data?.errors[0]?.detail===Ve){l({email:M});return}V.value=!0}},X=async(l,{setErrors:e})=>
1{if(!u.value){_.value="",u.value=!0,y().trackRegistrationButton(f,"next");try{if(r.value){await J(e);return}const a=$e();await j({...i,...a?{dateOfBirth:a.dateOfBirth,schoolLevel:a.schoolLevel?.id,degree:a.degree?.id}:{}}),a&&(await ye()?D():D()),await C()}catch(a){if(u.value=!1,a?.status===429){_.value=Ee;return}if(a instanceof Se&&a.data?.validationErrors){e(a.data.validationErrors);return}const w=a.data?.error?.email?.[0],N=!!(w&&Re(String(w)));if(N||O().$sentry.captureException(a),a.data?.error){if(N){P.value=!0,e({...a.data.error,email:M});return}e({...a.data.error})}else V.value=!0}}},L=async l=>{if(_.value=l.error?Ae(l.error):"",l.success){if(await q(),await Ie(),Te(r.value?.email)){await C(g.getAppleHiddenEmailStep());return}await C()}},C=async l=>{p.registered(r.value),re();const e=sessionStorage.getItem("personalized-scholarship");if(e&&O().$inst.addPendingApplication(JSON.parse(e)),l){await Fe(l);return}await g.navigateNext()};return(l,e)=>{const a=ae,w=ve,N=ie,Z=se,ee=le,te=oe;return v(),E(te,{description:"Enter your name and email so that we can start matching you to scholarships.",title:"Hello! Let's start with the basics.","server-error":t(V),step:f},{default:S(()=>[d(t(Ce),{name:"registration",as:"form",class:"w-full","validation-schema":t(Y),onSubmit:X},{default:S(()=>[n("div",Me,[n("div",{class:x(["content-field-container",{"!max-w-[760px] !flex-col":h}])},[n("div",{class:x(["flex w-full flex-col justify-between gap-6 md:flex-row",{"lg:w-4/6 lg:gap-[42px]":!h}])},[n("div",De,[e[8]||(e[8]=n("label",{class:"font-inter text-lg font-semibold text-true-gray-400"}," First name ",-1)),d(a,{modelValue:t(i).firstName,"onUpdate:modelValue":e[0]||(e[0]=o=>t(i).firstName=o),"data-test":"firstName",type:"text",placeholder:"Enter your first name",name:"firstName",format:t(U)},null,8,["modelValue","format"])]),n("div",ze,[e[9]||(e[9]=n("label",{class:"font-inter text-lg font-semibold text-true-gray-400"}," Last name ",-1)),d(a,{modelValue:t(i).lastName,"onUpdate:modelValue":e[1]||(e[1]=o=>t(i).lastName=o),"data-test":"lastName",type:"text",placeholder:"Enter your last name",name:"lastName",format:t(U)},null,8,["modelValue","format"])])],2),d(ge,{name:"email-reveal",css:h},{default:S(()=>[he(n("div",{"data-test":"emailFieldSection",class:x(["flex w-full flex-col gap-2.5",{"grow-1 lg:w-2/6":!h}])},[n("div",He,[e[10]||(e[10]=n("label",{class:"font-inter text-lg font-semibold text-true-gray-400"}," Email ",-1)),d(a,{modelValue:t(i).email,"onUpdate:modelValue":e[2]||(e[2]=o=>t(i).email=o),"data-test":"email",type:"email",placeholder:"Enter your email",label:"Email",name:"email"},null,8,["modelValue"])])],2),[[we,t(K)]])]),_:1})],2)]),n("div",We,[d(w,{size:"large",severity:"primary",icon:"pi pi-arrow-right",class:"!w-full !max-w-[350px] md:!max-w-[220px]",label:t(r)&&!t(u)?"Continue":"Next Step","icon-pos":"right","data-test":"btnNextStep",type:"submit",loading:t(u),onClick:t(Q)},null,8,["label","loading","onClick"]),t(P)?(v(),E(w,{key:0,class:"mx-auto !text-xs !font-semibold !text-blue-300","data-test":"resetBtn",text:"",plain:"",onClick:e[3]||(e[3]=o=>{t(B).emit("show-reset-password"),t(p).event("Reset password click",{Step:f})})},{default:S(()=>[...e[11]||(e[11]=[xe(" Reset Password ",-1)])]),_:1})):R("",!0),t(I)?(v(),E(N,{key:1,class:"!max-w-[350px] md:!max-w-[220px]"})):R("",!0),t(I)?(v(),be("div",qe,[d(Z,{action:"signup",class:x(["!w-full !max-w-[350px] md:!max-w-[220px]",t(k)?"order-2":"order-1"]),"onSocial:google:signup":e[4]||(e[4]=o=>L(o)),onClick:e[5]||(e[5]=o=>t(y)().trackRegistrationButton(f,"google sign up"))},null,8,["class"]),t(H)?(v(),E(ee,{key:0,action:"signup","initial-profile":{firstName:t(i).firstName,lastName:t(i).lastName},class:x(["!w-full !max-w-[350px] md:!max-w-[220px]",t(k)?"order-1":"order-2"]),"onSocial:apple:signup":e[6]||(e[6]=o=>L(o)),onClick:e[7]||(e[7]=o=>t(y)().trackRegistrationButton(f,"apple sign up"))},null,8,["initial-profile","class"])):R("",!0)])):R("",!0),n("div",je,_e(t(_)),1)])]),_:1},8,["validation-schema"])]),_:1},8,["server-error"])}}}),wt=ke(Ge,[["__scopeId","data-v-0c95b975"]]);export{wt 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.