Your IP : 216.73.217.77


Current Path : /home/users/unlimited/www/whatsapp-crm/public/build/assets/
Upload File :
Current File : /home/users/unlimited/www/whatsapp-crm/public/build/assets/Invite-96322d80.js

import{r as h,T as S,m as U,q as Z,R as D,c as n,a as e,e as d,f as k,u as a,t as l,k as V,b as C,g as $,n as u,o as i,l as A}from"./app-43851608.js";import{_ as p}from"./FormInput-4a309017.js";import{u as R,a as z}from"./ReCaptcha-55f58cbf.js";const E={class:"flex h-screen justify-center"},F={class:"flex justify-center items-center"},L={key:0,class:"w-[25em]"},P={class:"flex justify-center mb-5"},G=["src","alt"],H={key:1,class:"text-2xl mb-2"},I={class:"text-2xl text-center"},q={key:0},K={key:1},O={key:0,class:"text-center text-sm text-slate-500 mt-5"},Y={class:"mt-5 grid grid-cols-2 space-x-4"},J={class:""},Q={class:""},W={class:"mt-5"},X={class:"mt-5 grid grid-cols-2 space-x-4"},ee={class:""},te={class:""},se={key:0,class:"form-error text-[#b91c1c] text-xs"},oe={class:"mt-6"},ae={key:0,type:"submit",class:"rounded-md bg-primary px-3 py-3 text-sm text-white shadow-sm w-full"},re={key:1,type:"button",class:"rounded-md bg-primary px-3 py-3 text-sm text-white shadow-sm w-full flex justify-center"},ne=e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24"},[e("path",{fill:"currentColor",d:"M12 2A10 10 0 1 0 22 12A10 10 0 0 0 12 2Zm0 18a8 8 0 1 1 8-8A8 8 0 0 1 12 20Z",opacity:".5"}),e("path",{fill:"currentColor",d:"M20 12h2A10 10 0 0 0 12 2V4A8 8 0 0 1 20 12Z"},[e("animateTransform",{attributeName:"transform",dur:"1s",from:"0 12 12",repeatCount:"indefinite",to:"360 12 12",type:"rotate"})])],-1),ie=[ne],le={class:"mt-10"},me={key:0,type:"submit",class:"rounded-md bg-primary px-3 py-3 text-sm text-white shadow-sm w-full"},de={key:1,type:"button",class:"rounded-md bg-primary px-3 py-3 text-sm text-white shadow-sm w-full flex justify-center"},ce=e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24"},[e("path",{fill:"currentColor",d:"M12 2A10 10 0 1 0 22 12A10 10 0 0 0 12 2Zm0 18a8 8 0 1 1 8-8A8 8 0 0 1 12 20Z",opacity:".5"}),e("path",{fill:"currentColor",d:"M20 12h2A10 10 0 0 0 12 2V4A8 8 0 0 1 20 12Z"},[e("animateTransform",{attributeName:"transform",dur:"1s",from:"0 12 12",repeatCount:"indefinite",to:"360 12 12",type:"rotate"})])],-1),ue=[ce],pe={key:1,class:"w-[25em]"},fe={class:"text-2xl text-center"},_e={class:"mt-10 text-center"},ve={__name:"Invite",props:["flash","config","organization","companyConfig","invite","user"],setup(T){var w,v,x,g;const r=T,j=h((w=r.invite)==null?void 0:w.expire_at),M=h(new Date().toISOString()),f=h(!1),t=S({first_name:(v=r.user)==null?void 0:v.first_name,last_name:(x=r.user)==null?void 0:x.last_name,email:(g=r.invite)==null?void 0:g.email,password:null,password_confirmation:null,code:r.code,recaptcha_response:null}),c=s=>{const o=r.config.find(_=>_.key===s);return o?o.value:""};r.user&&delete t.password;const B=U(()=>{const s=new Date(j.value),o=new Date(M.value);return s<o}),y=async()=>{if(f.value=!0,c("recaptcha_active")==="1"){const s=await N();t.recaptcha_response=s}t.post("",{onSuccess:()=>t.reset(),onFinish:()=>{f.value=!1}})},N=()=>new Promise(s=>{grecaptcha.ready(()=>{grecaptcha.execute(c("recaptcha_site_key"),{action:"submit"}).then(o=>{s(o)})})});return Z(()=>{c("recaptcha_active")==="1"&&R(c("recaptcha_site_key"))}),D(()=>{z(c("recaptcha_site_key"))}),(s,o)=>{var _,b;return i(),n("div",E,[e("div",F,[B.value?(i(),n("div",pe,[e("h1",fe,l(s.$t("This invite link has expired. Contact the account owner to send you another link")),1),e("div",_e,[d(a(A),{href:"/login",type:"button",class:"rounded-md bg-primary px-3 py-3 text-sm text-white shadow-sm w-full"},{default:k(()=>[V(l(s.$t("Go to login")),1)]),_:1})])])):(i(),n("div",L,[e("div",P,[d(a(A),{href:"/"},{default:k(()=>[r.companyConfig.logo?(i(),n("img",{key:0,class:"max-w-[180px]",src:"/media/"+r.companyConfig.logo,alt:r.companyConfig.company_name},null,8,G)):(i(),n("h4",H,l(r.companyConfig.company_name),1))]),_:1})]),e("h3",I,[r.user?(i(),n("span",q,l(s.$t("Hi"))+" "+l((_=r.user)==null?void 0:_.first_name),1)):(i(),n("span",K,l(s.$t("Hi")),1)),V(", "+l(s.$t("You have been invited to join"))+" "+l((b=r==null?void 0:r.organization)==null?void 0:b.name),1)]),r.user?C("",!0):(i(),n("div",O,l(s.$t("Get started by entering your details below")),1)),r.user?(i(),n("form",{key:2,onSubmit:o[6]||(o[6]=$(m=>y(),["prevent"]))},[e("div",le,[f.value?(i(),n("button",de,ue)):(i(),n("button",me,l(s.$t("Proceed to join")),1))])],32)):(i(),n("form",{key:1,onSubmit:o[5]||(o[5]=$(m=>y(),["prevent"])),class:"mt-5"},[e("div",Y,[e("div",J,[d(p,{modelValue:a(t).first_name,"onUpdate:modelValue":o[0]||(o[0]=m=>a(t).first_name=m),name:s.$t("First name"),type:"text",error:a(t).errors.first_name,class:u("w-full"),labelClass:"mb-0"},null,8,["modelValue","name","error"])]),e("div",Q,[d(p,{modelValue:a(t).last_name,"onUpdate:modelValue":o[1]||(o[1]=m=>a(t).last_name=m),name:s.$t("Last name"),type:"text",error:a(t).errors.last_name,class:u("w-full"),labelClass:"mb-0"},null,8,["modelValue","name","error"])])]),e("div",W,[d(p,{modelValue:a(t).email,"onUpdate:modelValue":o[2]||(o[2]=m=>a(t).email=m),name:s.$t("Email"),type:"email",disabled:!0,error:a(t).errors.email,class:u("w-full"),labelClass:"mb-0"},null,8,["modelValue","name","error"])]),e("div",X,[e("div",ee,[d(p,{modelValue:a(t).password,"onUpdate:modelValue":o[3]||(o[3]=m=>a(t).password=m),name:s.$t("Password"),type:"password",error:a(t).errors.password,class:u("w-full"),labelClass:"mb-0"},null,8,["modelValue","name","error"])]),e("div",te,[d(p,{modelValue:a(t).password_confirmation,"onUpdate:modelValue":o[4]||(o[4]=m=>a(t).password_confirmation=m),name:s.$t("Confirm password"),type:"password",error:a(t).errors.password_confirmation,class:u("w-full")},null,8,["modelValue","name","error"])])]),a(t).errors.recaptcha_response?(i(),n("div",se,l(a(t).errors.recaptcha_response),1)):C("",!0),e("div",oe,[f.value?(i(),n("button",re,ie)):(i(),n("button",ae,l(s.$t("Create account")),1))])],32))]))])])}}};export{ve as default};