PageSourceSearch

https://www.cafeyn.co/assets/AuthSignup.994af6b5.js

js cafeyn.co collected 2026-09-24 09:27:51 UTC 9,846 bytes, 1 lines download raw bytes

1import{d as W,b as Z,r as A,k as f,l as w,aB as pe,m as T,I as ce,aC as fe,aD as ge,n as g,s as e,M as ve,ae as ye,_ as be,f as Y,Z as j,by as X,u as ee,J as h,av as we,aa as k,a9 as H,bW as Ve,an as ae,o as te,i as Se,p as G,t as C,y as d,c as V,A as S,aw as Ce,T as E,af as oe,aY as $,bQ as I,e as L,bL as ke,x as J,a3 as Q}from"./main.83d599ca.js";import{F as se}from"./vee-validate.esm.a4fb9e07.js";import{u as le,_ as re}from"./Captcha.vue_vue_type_style_index_0_lang.eefa3ad5.js";import{u as ie}from"./useAuthRoute.ed83329d.js";import{_ as ne}from"./AuthEmailReadOnly.vue_vue_type_script_setup_true_lang.900c95c0.js";import{_ as me}from"./TextInput.vue_vue_type_script_setup_true_lang.7d3771f4.js";import{_ as ue}from"./ErrorMsg.vue_vue_type_style_index_0_lang.d7fab1b0.js";import{O as P}from"./OptinRadioInput.513db312.js";import{A as he}from"./AuthPasswordInput.7119e75c.js";/* empty css                                                */const Ee=W({__name:"AuthPasswordInput.legacy",props:{modelValue:{},error:{}},emits:["update:modelValue"],setup(K,{emit:v}){const i=v,{t:m}=Z(),p=A(!1);return(y,s)=>(f(),w(me,{name:"password","data-testid":"password-field","model-value":y.modelValue,type:p.value?"text":"password",label:e(m)("forms.password_label"),placeholder:e(m)("forms.password_placeholder"),error:y.error,"onUpdate:modelValue":s[2]||(s[2]=l=>i("update:modelValue",l??""))},pe({action:T(()=>[g(be,{icon:e(ve).global.eye,isActiveState:p.value,class:"icon",fillColor:"textSecondaryInvert",onClick:s[0]||(s[0]=l=>p.value=!p.value),onKeyup:s[1]||(s[1]=ye(l=>p.value=!p.value,["enter"]))},null,8,["icon","isActiveState"])]),_:2},[y.$slots.rules?{name:"rules",fn:T(l=>[ce(y.$slots,"rules",fe(ge(l)))]),key:"0"}:void 0]),1032,["model-value","type","label","placeholder","error"]))}}),Ie=["innerHTML"],qe=W({__name:"AuthSignup.legacy",setup(K){const{t:v}=Z(),i=Y(),m=j(),{isPartner:p,getAuthRoute:y}=ie(),s=X(),l=ee(),{onCaptchaVerified:q,errorCaptchaMSG:B,captchaData:D,captchaVerified:U,regenerateCaptcha:x}=le(),M=h(()=>(n="textSecondary")=>({"--color":we(`colors.${n}`)})),b=A(!1),R=A("infos"),N=k().required().matches(/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[\W_]).{8,}$/),_=h(()=>!!i.query.email),z=h(()=>_.value?H({email:k().email().required(),password:N}):H({email:k().email().required(),confirmEmail:k().required().oneOf([Ve("email")]," "),password:N})),a=ae({email:s.email,confirmEmail:"",password:"",optins:{offers:!1,newsletter:!1,personalized:!1,partnerships:!1}});te(async()=>{l.infos&&await l.delogUser(),i.query.email&&i.query.email!==s.email&&(s.email=i.query.email.toString()),a.email=s.email,_.value&&(a.confirmEmail=s.email),document.getElementsByName("confirmEmail")[0]?.addEventListener("paste",n=>n.preventDefault())}),Se(()=>{document.getElementsByName("confirmEmail")[0]?.removeEventListener("paste",n=>n.preventDefault())});const F=async()=>{try{b.value=!0,s.errorMsg="";const n=i.query.promoCode||l.promoCode||(s.promoCode?.type==="activation"?s.promoCode.code:void 0)||void 0,t=await I.submitSignup(R.value,U.value,a,x,n,D.value);I.trackingUserLogin("Email","Registration"),t&&"nextStep"in t&&(s.registrationSecret=t.secret||"",m.push({name:y(L.AUTH_VALIDATION),params:i.params,query:i.query}))}catch(n){const t=n;s.errorMsg=n,t.response&&I.trackingUserFailed("Email",t.response.status),await x()}finally{b.value=!1}},O=()=>{const n={...i.query};delete n.email,m.push({name:y(L.AUTH_SIGNIN),params:i.params,query:n})};return(n,t)=>(f(),G("div",{class:d(e($)({gap:"1rem",alignItems:"center"}))},[C("div",null,[e(s).errorMsg?(f(),w(ue,{key:0,text:e(s).errorMsg,title:"",class:d(e(V)({marginBottom:4}))},null,8,["text","class"])):S("",!0),g(e(se),{class:d(e($)({marginTop:8,gap:4})),"validation-schema":z.value,id:"signup_email","initial-values":{email:e(s).email},onSubmit:t[9]||(t[9]=u=>F())},{default:T(({errors:u,meta:o})=>[g(ne,{modelValue:a.email,"onUpdate:modelValue":t[0]||(t[0]=r=>a.email=r),error:u.email,onModify:t[1]||(t[1]=r=>O())},null,8,["modelValue","error"]),_.value?S("",!0):(f(),w(me,{key:0,modelValue:a.confirmEmail,"onUpdate:modelValue":t[2]||(t[2]=r=>a.confirmEmail=r),name:"confirmEmail","data-testid":"confirm-email-field",error:u.confirmEmail,placeholder:e(v)("forms.email_placeholder"),label:e(v)("forms.confirmEmail_placeholder")},null,8,["modelValue","error","placeholder","label"])),g(Ee,{modelValue:a.password,"onUpdate:modelValue":t[3]||(t[3]=r=>a.password=r),error:u.password},{rules:T(({color:r})=>[C("p",{id:"signup_password_help",style:Ce(M.value(r)),class:d(e(V)({color:"var(--color)",textStyle:"infoMedium"})),innerHTML:e(v)("forms.password_help")},null,14,Ie)]),_:2},1032,["modelValue","error"]),e(p)?S("",!0):(f(),w(P,{key:1,modelValue:a.optins.offers,"onUpdate:modelValue":t[4]||(t[4]=r=>a.optins.offers=r),value:a.optins.offers,name:"offers",label:e(v)("authentication.optin.optinOffer",{brand_name:e(E).getDisplayName()}
1),onToogle:t[5]||(t[5]=r=>a.optins.offers=r)},null,8,["modelValue","value","label"])),e(p)?S("",!0):(f(),w(P,{key:2,modelValue:a.optins.newsletter,"onUpdate:modelValue":t[6]||(t[6]=r=>a.optins.newsletter=r),value:a.optins.newsletter,name:"newsletter",label:e(v)("authentication.optin.optinEdito",{brand_name:e(E).getDisplayName()}),onToogle:t[7]||(t[7]=r=>a.optins.newsletter=r)},null,8,["modelValue","value","label"])),C("div",{class:d(e(V)({width:"100%",marginTop:4}))},[g(oe,{size:"xl",visual:"brandInvert",type:"submit","data-testid":"auth-continue-signup",disabled:!o.valid||b.value||!e(U),"is-loading":b.value,label:e(v)("authentication.continue.signup",{brand_name:e(E).getDisplayName()})},null,8,["disabled","is-loading","label"])],2),g(re,{onValidated:e(q),onError:t[8]||(t[8]=r=>e(s).errorMsg=e(B)),"internal-location":""},null,8,["onValidated"])]),_:1},8,["class","validation-schema","initial-values"])])],2))}}),Be=W({__name:"AuthSignup",setup(K){const v=h(()=>ke()==="legacy"),{t:i}=Z(),m=Y(),p=j(),{isPartner:y,getAuthRoute:s}=ie(),l=X(),q=ee(),{onCaptchaVerified:B,errorCaptchaMSG:D,captchaData:U,captchaVerified:x,regenerateCaptcha:M}=le(),b=A(!1),R=A("infos"),N=k().required().matches(/^(?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[\W_]).{8,}$/),_=h(()=>!!m.query.email),z=h(()=>H({email:k().email().required(),password:N})),a=ae({email:l.email,password:"",optins:{offers:!1,newsletter:!1,personalized:!1,partnerships:!1}});te(async()=>{q.infos&&await q.delogUser(),m.query.email&&m.query.email!==l.email&&(l.email=m.query.email.toString()),a.email=l.email});const F=async()=>{try{b.value=!0,l.errorMsg="";const u=m.query.promoCode||q.promoCode||(l.promoCode?.type==="activation"?l.promoCode.code:void 0)||void 0,o=await I.submitSignup(R.value,x.value,a,M,u,U.value);I.trackingUserLogin("Email","Registration"),o&&"nextStep"in o&&(l.registrationSecret=o.secret||"",p.push({name:s(L.AUTH_VALIDATION),params:m.params,query:m.query}))}catch(u){const o=u;l.errorMsg=u,o.response&&I.trackingUserFailed("Email",o.response.status),await M()}finally{b.value=!1}},O=()=>{Q("track",{name:"ButtonClicked",options:{InternalLocation:"RegistrationCompletion",ButtonType:"Edit",Label:i("forms.button_modify")}});const u={...m.query};delete u.email,p.push({name:s(L.AUTH_SIGNIN),params:m.params,query:u})},n=()=>{Q("track",{name:"FieldCompletionStarted",options:{FieldName:"Password",InternalLocation:"RegistrationCompletion"}})},t=()=>{l.errorMsg=D};return(u,o)=>v.value?(f(),w(qe,{key:0})):(f(),G("div",{key:1,class:d(e($)({gap:"1rem",alignItems:"center"}))},[C("div",{class:d(e(V)({width:"100%"}))},[e(l).errorMsg?(f(),w(ue,{key:0,text:e(l).errorMsg,title:"",class:d(e(V)({marginBottom:4}))},null,8,["text","class"])):S("",!0),g(e(se),{class:d(e($)({marginTop:8,gap:"xl"})),"validation-schema":z.value,id:"signup_email","initial-values":{email:e(l).email},onSubmit:o[7]||(o[7]=r=>F())},{default:T(({errors:r,meta:de})=>[g(ne,{modelValue:a.email,"onUpdate:modelValue":o[0]||(o[0]=c=>a.email=c),error:r.email,onModify:o[1]||(o[1]=c=>O())},null,8,["modelValue","error"]),_.value?S("",!0):(f(),G("div",{key:0,class:d(e($)({gap:"3xs",alignItems:"start",width:"100%",cursor:"default"}))},[C("label",{class:d(e(V)({textStyle:"infoMedium",color:"textPrimaryInvert"}))},J(e(i)("authentication.signup.email.verification.label")),3),C("p",{"data-testid":"email-double-check-field",class:d(e(V)({textStyle:"bodyBaseSemiBold",color:"textPrimaryInvert"}))},J(a.email),3)],2)),g(he,{modelValue:a.password,"onUpdate:modelValue":o[2]||(o[2]=c=>a.password=c),error:r.password,"show-password-rules":"",onFocus:n},null,8,["modelValue","error"]),e(y)?S("",!0):(f(),w(P,{key:1,modelValue:a.optins.offers,"onUpdate:modelValue":o[3]||(o[3]=c=>a.optins.offers=c),value:a.optins.offers,name:"offers",label:e(i)("authentication.optin.optinOffer",{brand_name:e(E).getDisplayName()}),onToogle:o[4]||(o[4]=c=>a.optins.offers=c)},null,8,["modelValue","value","label"])),e(y)?S("",!0):(f(),w(P,{key:2,modelValue:a.optins.newsletter,"onUpdate:modelValue":o[5]||(o[5]=c=>a.optins.newsletter=c),value:a.optins.newsletter,name:"newsletter",label:e(i)("authentication.optin.optinEdito",{brand_name:e(E).getDisplayName()}),onToogle:o[6]||(o[6]=c=>a.optins.newsletter=c)},null,8,["modelValue","value","label"])),C("div",{class:d(e(V)({width:"100%",backgroundColor:{base
1:"surfacePrimaryLightInvert"},position:{base:"fixed",md:"relative"},marginTop:4,left:"0px",zIndex:"1000",bottom:{base:"0",md:"auto"},padding:{base:"4",md:"0"}}))},[g(oe,{size:"xl",visual:"brandInvert",type:"submit","data-testid":"auth-continue-signup",disabled:!de.valid||b.value||!e(x),"is-loading":b.value,label:e(i)("authentication.continue.signup",{brand_name:e(E).getDisplayName()})},null,8,["disabled","is-loading","label"])],2),g(re,{onValidated:e(B),onError:t,"internal-location":"RegistrationCompletion"},null,8,["onValidated"])]),_:1},8,["class","validation-schema","initial-values"])],2)],2))}});export{Be 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.