PageSourceSearch

https://account.zendrop.com/build/assets/verification-Ca0TDNGj.js

js zendrop.com collected 2026-09-25 02:36:30 UTC 7,539 bytes, 2 lines download raw bytes

1import{n as H,P as a,J,G as F,Q as Z,E as j,A as W,D as Q,a as X}from"./index-CxHn0Gru.js";import{u as ee}from"./useStore-D98oxjg4.js";import{u as te}from"./composables-9gVQZmvb.js";import{o as O}from"./otpService-B07uwwk6.js";import{P as V}from"./app-un9PI25T.js";import{P as re}from"./PhoneVerification-ohi0dhzb.js";import{Z as oe}from"./ZendropLogoWhite-0zzgD76V.js";import{A as ne}from"./AppButton-DgRW-j5-.js";import{u as p}from"./util-BKLjsQa7.js";import"./index-DigVksEt.js";import"./roles-BxC5uA8g.js";import"./guest-DlKky-wy.js";import"./feature-DDf01P73.js";import"./TooltipCommon-DqYZGIK-.js";import"./HasParentTargetMixin-Dquecb9q.js";import"./popover-BzVLPSVt.js";import"./bootstrap-CE9PbH8-.js";/* empty css            *//* empty css                *//* empty css              */import"./parsePhoneNumber-ZxPOqrGk.js";const se={__name:"verification",setup(Y){const n="verification:resend-until",o="verification:registered";let s=null;const y=e=>Math.max(0,Math.ceil((e-Date.now())/1e3)),d=te(),v=ee(),l=a(""),E=a(""),R=a(""),B=a(""),u=a(!1),m=a(0),g=a(null),S=a(!1),w=a(""),f=a(!1),x=a(!1),_=a(null),b=a(null),D=a(new J({first_name:"",last_name:"",email:"",phone:"",shopify_UB:!1,onboarding_type:null})),K=F(()=>m.value===0),L=F(()=>p.formatUniversalPhone(l.value)),N=()=>{var t;if((t=window.crypto)!=null&&t.randomUUID)return window.crypto.randomUUID();const e="xxxxxxxxxxxxxxxx".replace(/x/g,()=>Math.floor(Math.random()*16).toString(16));return`${Date.now().toString(16)}-${e}`},U=e=>{if(e.registration_idempotency_key)return e.registration_idempotency_key;const t=N();e.registration_idempotency_key=t;try{sessionStorage.setItem("verification:context",JSON.stringify(e))}catch(i){console.warn("Failed to persist the registration idempotency key",i)}return t},I=e=>{var i;const t=(i=e==null?void 0:e.response)==null?void 0:i.data;if(t!=null&&t.errors&&typeof t.errors=="object"){const c=Object.values(t.errors).find(h=>Array.isArray(h)&&h.length);if(c)return c[0]}return(t==null?void 0:t.message)||(t==null?void 0:t.error)||(e==null?void 0:e.message)||String(e)},k=()=>{d.replace({name:"grow-your-business",query:p.getUrlParams()})};Z(()=>{if(A()){d.replace({name:"post-verification",query:p.getUrlParams()});return}P(),T()||C({preserveInput:!0})});const A=()=>{try{return!!sessionStorage.getItem(o)}catch(e){return console.warn("Failed to read the verification state from sessionStorage",e),!1}},M=()=>{try{sessionStorage.removeItem("verification:context"),sessionStorage.setItem(o,"1")}catch(e){console.warn("Failed to write the verification state to sessionStorage",e)}},P=()=>{let e=null;try{const t=sessionStorage.getItem("verification:context");e=t?JSON.parse(t):null}catch(t){console.warn("Failed to read verification context from sessionStorage",t)}if(!e||typeof e.phone!="string"){k();return}b.value=e,l.value=e.phone,E.value=e.email,e.first_name&&(R.value=e.first_name),e.last_name&&(B.value=e.last_name)},q=e=>{u.value=!0,g.value=e},z=e=>{const t=String(e||"");u.value=t.length===4,g.value=t},C=({preserveInput:e=!1}={})=>{e||j.$emit("clear-phone-verification");const t=Date.now()+59*1e3;try{sessionStorage.setItem(n,String(t))}catch{}u.value=!1,s&&clearInterval(s);const i=()=>{const c=y(t);if(m.value=c,c===0){clearInterval(s),s=null;try{sessionStorage.removeItem(n)}catch{}}};i(),s=setInterval(i,1e3)},G=async()=>{if(!f.value)try{await O.sendOtp(l.value),C()}catch(e){S.value=!0,w.value=I(e)}},T=()=>{let e=null;try{e=Number(sessionStorage.getItem(n))}catch{}if(!(Number.isFinite(e)&&e>Date.now()))return m.value=0,!1;s&&clearInterval(s);const i=()=>{const c=y(e);if(m.value=c,c===0){clearInterval(s),s=null;try{sessionStorage.removeItem(n)}catch{}}};return i(),s=setInterval(i,1e3),!0},$=async()=>{const e=b.value;if(!e)return k(),!1;if(!_.value){const t=D.value;t.first_name=e.first_name||"",t.last_name=e.last_name||"",t.email=e.email||"",t.phone=e.phone||"",t.country_code=e.country_code||"",t.accept_terms=!!e.accept_terms,t.onboarding_type=e.onboarding_type||null,t.marketing_consent_email=!!(t.accept_terms&&t.email),t.marketing_consent_sms=!!(t.marketing_consent_email&&t.phone),p.formExternalAttrSetter(t),!t.referral_name&&e.referral_name&&(t.referral_name=e.referral_name),v.commit("auth/LOGOUT");const i=await t.post(V.register,{headers:{"Idempotency-Key":U(e)}});_.value=i.data.token,await v.dispatch("auth/saveToken",{token:_.value,remember:!0})}M();try{const{data:t}=await X.get(V.user);await v.dispatch("auth/updateUser",{user:t})}catch(t){console.warn("Failed to load the user profile after registration",t)}return!0};return{__sfc:!0,RESEND_DURATION:59,RESEND_UNTIL_KEY:n,REGISTERED_KEY:
1o,resendIntervalId:s,getRemainingSeconds:y,router:d,store:v,phoneNumber:l,email:E,firstName:R,lastName:B,isVerificationComplete:u,resendTimerSeconds:m,verificationCode:g,isErrorModalShown:S,errorMsg:w,isSubmitting:f,isPhoneVerified:x,issuedToken:_,verificationContext:b,registrationForm:D,canResend:K,formattedPhoneNumber:L,createIdempotencyKey:N,getRegistrationIdempotencyKey:U,extractErrorMessage:I,redirectToRegistration:k,isRegistrationComplete:A,markRegistrationComplete:M,loadVerificationContext:P,handleComplete:q,handleChange:z,startResendTimer:C,resendVerificationCode:G,resumeResendTimerFromStorage:T,registerUser:$,verifyHandler:async()=>{if(!u.value||f.value){console.log("Verification not complete yet.");return}f.value=!0;try{if(x.value||(await O.verifyOtp(l.value,g.value),x.value=!0),!await $())return;const t=p.getUrlParams();d.push({name:"post-verification",query:{...t}})}catch(e){S.value=!0,w.value=I(e)}finally{f.value=!1}},PhoneVerification:re,ZendropLogoWhite:oe,AppButton:Q,AppModal:W,AppButton2:ne}}};var ae=function(){var r=this,n=r._self._c,o=r._self._setupProxy;return n("div",{staticClass:"verification-page-wrapper"},[n("div",{staticClass:"verification-block"},[n("div",{staticClass:"logo"},[n(o.ZendropLogoWhite)],1),n("div",{staticClass:"title"},[r._v(" "+r._s(r.$t("ui.orders.growYourBusiness.verify_number"))+" ")]),n("div",{staticClass:"phone-number-subtitle"},[r._v(" "+r._s(r.$t("ui.orders.growYourBusiness.enter_code"))+" "+r._s(o.formattedPhoneNumber)+" ")]),n(o.PhoneVerification,{attrs:{"char-amount":4,"check-type":"tel"},on:{change:o.handleChange,complete:o.handleComplete}}),n("div",{staticClass:"verification-timer"},[o.canResend?n("span",{staticClass:"resend-link",on:{click:o.resendVerificationCode}},[r._v(r._s(r.$t("ui.orders.growYourBusiness.resend_code")))]):n("span",[r._v(r._s(r.$t("ui.orders.growYourBusiness.resend_in"))+" "+r._s(o.resendTimerSeconds)+" seconds")])]),n("div",{staticClass:"verification-action-block"},[n(o.AppButton,{staticClass:"verify-btn",attrs:{variant:"mulberry",size:"small",disabled:!o.isVerificationComplete,loading:o.isSubmitting},on:{click:function(s){return s.preventDefault(),o.verifyHandler.apply(null,arguments)}}},[r._v(" "+r._s(r.$t("ui.orders.growYourBusiness.verify"))+" ")]),n(o.AppButton2,{staticClass:"back-button",attrs:{variant:"tertiary",size:"sm","prepend-icon":"ChevronLeftCircle"},on:{click:function(s){return s.preventDefault(),r.$router.go(-1)}}},[r._v(" "+r._s(r.$t("ui.orders.growYourBusiness.go_back"))+" ")])],1)],1),n(o.AppModal,{attrs:{title:"Error",message:o.errorMsg,"confirm-button-text":"OK"},on:{"positive-click":function(s){o.isErrorModalShown=!1}},model:{value:o.isErrorModalShown,callback:function(s){o.isErrorModalShown=s},expression:"isErrorModalShown"}})],1)},ie=[],ce=H(se,ae,ie,!1,null,null);const Ne=ce.exports;export{Ne as default};
2//# sourceMappingURL=verification-Ca0TDNGj.js.map

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.