1import{d as G,f as Q,a4 as W,aQ as Y,az as Z,Z as q,s as J,r as u,Y as K,c as I,o as d,k as A,w as m,V as h,W as v,ao as X,b as x,m as g,t as s,e as a,j as n,a as y,l as L,B as O,a8 as l,a0 as ee,_ as te}from"./-6Lls737.js";import ae from"./CiiYzqQD.js";import{_ as oe}from"./CI-50u4g.js";import{u as se}from"./BvfhP9bq.js";import{_ as B}from"./C9IHJtY7.js";import"./DSV61gAW.js";import"./DlAUqK2U.js";import"./CN6vTOWD.js";import"./B5spvOTL.js";const ne={class:"container"},ie={class:"w-full max-w-[460px] mx-auto"},re={class:"text-xl mb-2 max-md:px-4"},le={class:"text-sm text-dark-grey mb-8 max-md:px-4"},ce={key:0},ue={class:"mt-4 text-center text-sm text-x-grey-7"},de={key:0,class:"font-semibold underline"},me={key:1},_e={class:"mt-4 text-center text-sm text-x-grey-7"},fe=["innerHTML"],Se=G({__name:"[hashRegistration]",async setup(pe){var U;let S,V;const{t:e}=Q(),R=W(),M=Y(),_=se(),D=Z(),k=q(),{selectedRole:N,isRegistrationSubmitLoading:i}=J(_),C=(U=R==null?void 0:R.params)==null?void 0:U.hashRegistration,r=u(!1),w=u(0),f=u(""),p=u(!1),T=u(!1);async function E(){const{response:o,error:t}=await _.fetchVerifyPhoneData(C);if(r.value=o==null?void 0:o.canResend,t&&await l.error(),!r.value){const b=setInterval(()=>{w.value=o.timeout--,w.value<=0&&(r.value=!0,clearInterval(b))},1e3)}}[S,V]=K(()=>E()),await S,V();async function H(){if(T.value=!0,r.value){p.value=!0;const{error:o,response:t}=await _.resendSmsCode(C);if(p.value=!1,o||(t==null?void 0:t.success)!==!0){await l.error();return}await l.success(e("login.phoneVerification.smsResended")),await E()}}async function z(){i.value=!0;const{error:o,response:t}=await _.submitCode(C,f.value);if(o){if(o.statusCode===422){await l.error(e("account.phoneVerification.wrongCode")),i.value=!1;return}await l.error(),i.value=!1;return}await l.success(e("account.phoneVerification.phoneVerified"));let c=h(v.USERS_CREATE_ACCOUNT_CONFIRMATION);t!=null&&t.token&&(await D.setTokenFromCookie(t.token),await k.fetchUser(),k.hasRole(ee.PUNTER)&&(c=h(v.ONBOARDING_PUNTER))),await M.push({path:c}),i.value=!1}const F=I(()=>N.value!==null?h(v.USERS_CREATE_ACCOUNT_INFO(N.value)):h(v.USERS_CREATE_ACCOUNT)),P=I(()=>f.value.trim().length<6);return(o,t)=>{const c=te,b=ae,$=X;return d(),A($,{name:"light"},{header:m(()=>[x(c,{to:F.value,class:"button-secondary button-xxs ml-auto hidden md:block"},{default:m(()=>[g(s(a(e)("home.back")),1)]),_:1},8,["to"])]),default:m(()=>[n("div",ne,[n("div",ie,[n("form",null,[n("h1",re,s(a(e)("login.phoneVerification.title")),1),n("p",le,s(a(e)("login.phoneVerification.subTitle")),1),x(oe,{type:"number",placeholder:a(e)("login.phoneVerification.enterCodeHere"),modelValue:f.value,"onUpdate:modelValue":t[0]||(t[0]=j=>f.value=j),modelModifiers:{trim:!0}},null,8,["placeholder","modelValue"]),T.value?(d(),y("div",me,[n("p",_e,s(a(e)("home.youHaveReachedResendLimit")),1),n("p",{class:"mt-0 text-center text-sm text-x-grey-7",innerHTML:a(e)("home.contactIfNoSMS")},null,8,fe)])):(d(),y("div",ce,[n("p",ue,[g(s(a(e)("login.phoneVerification.reSendTitle"))+" ",1),r.value?L("",!0):(d(),y("span",de,s(a(e)("login.phoneVerification.reSendSubtitle"))+" "+s(w.value),1))]),r.value?(d(),A(B,{key:0,onClick:O(H,["prevent"]),class:"mt-2",loading:p.value,disabled:p.value,variant:"outline",color:"secondary",size:"xs"},{default:m(()=>[g(s(a(e)("login.phoneVerification.reSend")),1)]),_:1},8,["loading","disabled"])):L("",!0)])),x(B,{onClick:O(z,["prevent"]),loading:a(i),disabled:a(i)||P.value,rounded:"large",variant:"outline",class:"gap-3 min-w-[192px] !fixed left-1/2 transform -translate-x-1/2 bottom-12 z-10"},{default:m(()=>[g(s(a(e)("login.phoneVerification.verify"))+" ",1),x(b,{class:"text-sm !mb-0"})]),_:1},8,["loading","disabled"])])])])]),_:1})}}});
1export{Se 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.