1import{h as oe,f as R,r as B,c as V,P as se,K as f,n as o,L as i,$ as n,_ as U,a4 as $,a0 as s,F as A,a6 as ie,a1 as d,aa as ne,O as L,u as l,a7 as D,M as p}from"./vue-datepicker-CpIdsRIT.js";import{_ as k}from"./CardContainer.vue_vue_type_script_setup_true_lang-BKfUFWAw.js";import{r as g,e as ue,V as M,v as de}from"./VForm-fG7fwhIC.js";import{u as pe,a as ce,b as me,c as ge,V as y,m as H,d as ve,e as he,f as fe,g as j,h as K,i as ye,j as be,k as Ve,l as q,n as F,o as Ae,_ as $e}from"./index-c2PABjuS.js";import{r as Ce}from"./ResolveErrorCode-_CDAcugR.js";import{b as Re}from"./countryOptions-CPO6Y5OC.js";import{u as ke,r as we,c as W}from"./voucherStorage-DkpTD02d.js";import{V as c}from"./VTextField-CzBtTN-C.js";import{V as Se}from"./VSelect-DnH6Hc5K.js";import"./datefns-BAflKSlV.js";import"./VCheckboxBtn-CaDiUy2q.js";import"./VChip-zxhclFBY.js";const xe={class:"flex flex-col gap-3 mt-8"},Ne={class:"text-2xl font-bold"},Te={class:"flex items-center gap-2 text-sm text-gray-500 mt-1 flex-wrap"},Ue={key:0,class:"text-gray-300 mx-1"},qe={class:"grid grid-cols-1 md:grid-cols-2 gap-5 w-full"},Fe={class:"grid grid-cols-1 md:grid-cols-2 gap-5 w-full"},ze={class:"flex gap-3"},Oe={class:"trial-step__headline"},Pe={key:0,class:"trial-step__facts"},Ie={class:"flex items-start gap-2"},Ee={class:"flex items-start gap-2"},Be={class:"flex items-start gap-2"},Le={class:"text-sm text-light-text"},De={class:"flex gap-3"},Me={class:"text-center"},He=oe({__name:"Register",setup(je){const _=Ae(),z=ge(),Q=pe(),{notifyError:G,notifySuccess:J}=ce(),{t:h,locale:X}=me(),v=R(1),b=R(!1),u=B({firstName:"",lastName:"",phone:"",email:""}),r=B({company:"",street:"",houseNumber:"",zipCode:"",city:"",country:"DE",vatId:"",voucherCode:""}),w=R(!1),S=R(!1),Y=V(()=>Re(String(X.value||"en"))),Z=V({get:()=>r.voucherCode,set:e=>{r.voucherCode=(e??"").toUpperCase()}}),{preview:m,errorCode:O,checking:x}=ke(Z),P=e=>{const t=h(`App.Trial.plans.${e}`);return t.startsWith("App.Trial.plans.")?e:t},C=V(()=>{if(!O.value)return null;const e=`App.Trial.Start.errors.${O.value}`,t=h(e);return t.startsWith("App.Trial.Start.errors.")?h("App.Trial.Start.errors.generic"):t}),ee=V(()=>!!r.voucherCode&&(x.value||!m.value)),N=V(()=>!!r.voucherCode),te=V(()=>[h("Auth.Register.stepPersonal"),h("Auth.Register.stepCompany"),...N.value?[h("Auth.Register.stepTrial")]:[]]),le=()=>{r.voucherCode="",W(),v.value=2};se(()=>{const t=((typeof z.query.code=="string"?z.query.code:null)||we()||"").trim().toUpperCase();t&&(r.voucherCode=t)});const ae=()=>{v.value=2},re=async()=>{if(N.value){v.value=3;return}await I()},I=async()=>{b.value=!0;try{await Q.register(u.email,u.firstName,u.lastName,r.company,r.street,r.houseNumber,r.zipCode,r.city,r.country,r.vatId,u.phone,m.value?m.value.code:null),m.value&&W(),J(h("Auth.Register.registerSuccess")),await _.push({name:"register-success",query:{email:u.email}})}catch(e){G(h(Ce(e,"Auth.Register.genericError")))}b.value=!1};return(e,t)=>{const E=ne("router-link");return p(),f(A,null,[o(k,{class:"min-w-64 flex items-center justify-between mt-12","padding-class":"p-1"},{default:n(()=>[o(E,{to:{name:"login"},class:"grow w-1/2 text-center"},{default:n(()=>[d(s(e.$t("Auth.Login.title")),1)]),_:1}),o(y,{color:"secondary",style:{"background-image":"linear-gradient(45deg,#d73625,#F78361)!important"},class:"grow w-1/2"},{default:n(()=>[d(s(e.$t("Auth.Register.title")),1)]),_:1})]),_:1}),i("div",xe,[i("span",Ne,s(e.$t("Auth.Register.heading")),1),i("div",Te,[(p(!0),f(A,null,ie(te.value,(a,T)=>(p(),f(A,{key:a},[T>0?(p(),f("span",Ue,"â")):$("",!0),i("span",{class:L(["flex items-center justify-center w-6 h-6 rounded-full text-xs font-bold",v.value===T+1?"bg-primary text-white":"bg-gray-200"])},s(T+1),3),i("span",null,s(a),1)],64))),128))]),v.value===1?(p(),U(k,{key:0,class:"flex flex-col gap-3 p-6 md:min-w-[60dvw]"},{default:n(()=>[i("span",null,s(e.$t("Auth.Register.promptPersonal")),1),o(M,{modelValue:w.value,"onUpdate:modelValue":t[4]||(t[4]=a=>w.value=a),class:"flex flex-col gap-5",onSubmit:D(ae,["prevent"])},{default:n(()=>[i("div",qe,[o(c,{modelValue:u.firstName,"onUpdate:modelValue":t[0]||(t[0]=a=>u.firstName=a),label:e.$t("Auth.Register.firstName"),type:"text",color:"secondary","prepe
1nd-inner-icon":l(H),rules:[l(g)],variant:"outlined","hide-details":"auto",required:""},null,8,["modelValue","label","prepend-inner-icon","rules"]),o(c,{modelValue:u.lastName,"onUpdate:modelValue":t[1]||(t[1]=a=>u.lastName=a),label:e.$t("Auth.Register.lastName"),type:"text",color:"secondary","prepend-inner-icon":l(H),rules:[l(g)],variant:"outlined","hide-details":"auto",required:""},null,8,["modelValue","label","prepend-inner-icon","rules"]),o(c,{modelValue:u.phone,"onUpdate:modelValue":t[2]||(t[2]=a=>u.phone=a),label:e.$t("Auth.Register.phone"),type:"phone",color:"secondary","prepend-inner-icon":l(ve),rules:[l(g)],variant:"outlined","hide-details":"auto",required:""},null,8,["modelValue","label","prepend-inner-icon","rules"]),o(c,{modelValue:u.email,"onUpdate:modelValue":t[3]||(t[3]=a=>u.email=a),class:"md:col-span-2",label:e.$t("Auth.Register.email"),type:"email",color:"secondary","prepend-inner-icon":l(he),rules:[l(g),l(ue)],variant:"outlined","hide-details":"auto",required:""},null,8,["modelValue","label","prepend-inner-icon","rules"])]),o(y,{disabled:!w.value,type:"submit",color:"secondary",height:"46",style:{"background-image":"linear-gradient(45deg,#d73625,#F78361)!important"}},{default:n(()=>[d(s(e.$t("Auth.Register.nextStep")),1)]),_:1},8,["disabled"])]),_:1},8,["modelValue"])]),_:1})):$("",!0),v.value===2?(p(),U(k,{key:1,class:"flex flex-col gap-3 p-6 md:min-w-[60dvw]"},{default:n(()=>[i("span",null,s(e.$t("Auth.Register.promptCompany")),1),o(M,{modelValue:S.value,"onUpdate:modelValue":t[13]||(t[13]=a=>S.value=a),class:"flex flex-col gap-5",onSubmit:D(re,["prevent"])},{default:n(()=>[i("div",Fe,[o(c,{modelValue:r.company,"onUpdate:modelValue":t[5]||(t[5]=a=>r.company=a),class:"md:col-span-2",label:e.$t("Auth.Register.company"),type:"text",color:"secondary","prepend-inner-icon":l(fe),rules:[l(g)],variant:"outlined","hide-details":"auto",required:""},null,8,["modelValue","label","prepend-inner-icon","rules"]),o(c,{modelValue:r.street,"onUpdate:modelValue":t[6]||(t[6]=a=>r.street=a),label:e.$t("Auth.Register.street"),type:"text",color:"secondary","prepend-inner-icon":l(j),rules:[l(g)],variant:"outlined","hide-details":"auto",required:""},null,8,["modelValue","label","prepend-inner-icon","rules"]),o(c,{modelValue:r.houseNumber,"onUpdate:modelValue":t[7]||(t[7]=a=>r.houseNumber=a),label:e.$t("Auth.Register.houseNumber"),type:"text",color:"secondary","prepend-inner-icon":l(j),rules:[l(g)],variant:"outlined","hide-details":"auto",required:""},null,8,["modelValue","label","prepend-inner-icon","rules"]),o(c,{modelValue:r.zipCode,"onUpdate:modelValue":t[8]||(t[8]=a=>r.zipCode=a),label:e.$t("Auth.Register.zipCode"),type:"text",color:"secondary","prepend-inner-icon":l(K),rules:[l(g)],variant:"outlined","hide-details":"auto",required:""},null,8,["modelValue","label","prepend-inner-icon","rules"]),o(c,{modelValue:r.city,"onUpdate:modelValue":t[9]||(t[9]=a=>r.city=a),label:e.$t("Auth.Register.city"),type:"text",color:"secondary","prepend-inner-icon":l(K),rules:[l(g)],variant:"outlined","hide-details":"auto",required:""},null,8,["modelValue","label","prepend-inner-icon","rules"]),o(Se,{modelValue:r.country,"onUpdate:modelValue":t[10]||(t[10]=a=>r.country=a),label:e.$t("Auth.Register.country"),items:Y.value,"item-title":"title","item-value":"value",color:"secondary","prepend-inner-icon":l(ye),rules:[l(g)],variant:"outlined","hide-details":"auto",required:""},null,8,["modelValue","label","items","prepend-inner-icon","rules"]),o(c,{modelValue:r.vatId,"onUpdate:modelValue":t[11]||(t[11]=a=>r.vatId=a),label:e.$t("Auth.Register.vatId"),type:"text",color:"secondary","prepend-inner-icon":l(be),rules:[l(de)],variant:"outlined","hide-details":"auto"},null,8,["modelValue","label","prepend-inner-icon","rules"])]),i("div",ze,[o(y,{variant:"outlined",height:"46",class:"flex-1",onClick:t[12]||(t[12]=a=>v.value=1)},{default:n(()=>[d(s(e.$t("Auth.Register.back")),1)]),_:1}),o(y,{loading:b.value,disabled:!S.value,type:"submit",color:"secondary",height:"46",class:"flex-1",style:{"background-image":"linear-gradient(45deg,#d73625,#F78361)!important"}},{default:n(()=>[d(s(N.value?e.$t("Auth.Register.nextStep"):e.$t("Auth.Register.confirm")),1)]),_:1},8,["loading","disabled"])])]),_:1},8,["modelValue"])]),_:1})):$("",!0),v.value===3?(p(),U(k,{key:2,class:"flex flex-col gap-4 p-6 md:min-w-[60dvw]"},{default:n(()=>[i("span",null,s(e.$t("Auth.Register.promptTrial")),1),i("div",{class:L(["trial-step",{"trial-step--invalid":C.value}])},[i("span",Oe,[l(m)?(p(),f(A,{key:0},[d(s(e.$t("App.Trial.Start.title",{days:l(m).trialDays,plan:P(l(m).licenseKey)}
1)),1)],64)):l(x)?(p(),f(A,{key:1},[d(s(e.$t("App.Trial.Start.loading")),1)],64)):(p(),f(A,{key:2},[d(s(C.value||e.$t("App.Trial.Start.invalidTitle")),1)],64))]),o(c,{modelValue:r.voucherCode,"onUpdate:modelValue":t[14]||(t[14]=a=>r.voucherCode=a),label:e.$t("Auth.Register.voucherCode"),type:"text",color:"secondary","prepend-inner-icon":l(Ve),variant:"outlined","hide-details":"auto",autocapitalize:"characters",loading:l(x),"error-messages":C.value?[C.value]:[]},null,8,["modelValue","label","prepend-inner-icon","loading","error-messages"]),l(m)?(p(),f("ul",Pe,[i("li",Ie,[o(F,{icon:l(q),size:"18",color:"success",class:"mt-0.5"},null,8,["icon"]),i("span",null,s(e.$t("App.Trial.Start.factNoPayment")),1)]),i("li",Ee,[o(F,{icon:l(q),size:"18",color:"success",class:"mt-0.5"},null,8,["icon"]),i("span",null,s(e.$t("App.Trial.Start.factFullAccess",{plan:P(l(m).licenseKey)})),1)]),i("li",Be,[o(F,{icon:l(q),size:"18",color:"success",class:"mt-0.5"},null,8,["icon"]),i("span",null,s(e.$t("App.Trial.Start.factDecideLater")),1)])])):$("",!0),i("span",Le,s(e.$t("Auth.Register.trialStepHint")),1)],2),i("div",De,[o(y,{variant:"outlined",height:"46",class:"flex-1",disabled:b.value,onClick:t[15]||(t[15]=a=>v.value=2)},{default:n(()=>[d(s(e.$t("Auth.Register.back")),1)]),_:1},8,["disabled"]),o(y,{loading:b.value,disabled:ee.value||!l(m),type:"button",color:"secondary",height:"46",class:"flex-1",style:{"background-image":"linear-gradient(45deg,#d73625,#F78361)!important"},onClick:I},{default:n(()=>[d(s(e.$t("Auth.Register.confirmWithTrial")),1)]),_:1},8,["loading","disabled"])]),o(y,{variant:"text",disabled:b.value,onClick:le},{default:n(()=>[d(s(e.$t("Auth.Register.withoutVoucher")),1)]),_:1},8,["disabled"])]),_:1})):$("",!0),i("span",Me,[d(s(e.$t("Auth.Register.alreadyHaveAccount"))+" ",1),o(E,{to:{name:"login"},class:"text-info underline"},{default:n(()=>[d(s(e.$t("Auth.Register.loginHere")),1)]),_:1})])])],64)}}}),at=$e(He,[["__scopeId","data-v-0c3e9fda"]]);export{at 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.