1import{D as e,E as s,k as a,u as l,n as i,G as t,A as o,f as r,o as n,g as u,x as c,h as m,w as O,i as S,t as N,H as d,I as T,s as E,J as R,m as f,q as I,K as p,e as h,v as M,B as A,j as b}from"./index-DICKVQij.js";import{_,a as v,b as y}from"./FieldLabel-CzIG740M.js";const D=e("demonstrationStore",{state:()=>({form:{id:0,name:"",email:"",phone:"",businessType:null,business:"",privacyConsent:!1},errors:{name:"",email:"",business:"",privacyConsent:""},showSuccessNotification:!1,showErrorNotification:!1,isSubmitting:!1}),actions:{generateRandomId:()=>Math.floor(1e6*Math.random()),validateForm(e){let s=!0;const a=e("DEMONSTRATION.FORM.ERROR_REQUIRED"),l=e("DEMONSTRATION.FORM.ERROR_EMAIL");return this.errors={name:"",email:"",business:"",privacyConsent:""},this.form.name||(this.errors.name=a,s=!1),this.form.email?/^[\w.%+-]+@[\w.-]+\.[a-z]{2,}$/i.test(this.form.email)||(this.errors.email=l,s=!1):(this.errors.email=a,s=!1),null!==this.form.businessType&&void 0!==this.form.businessType||(this.errors.business=a,s=!1),this.form.privacyConsent||(this.errors.privacyConsent=a,s=!1),s},async handleSubmit(e){if(this.validateForm(e)){this.form.id=this.generateRandomId(),this.isSubmitting=!0;try{await s.post("https://api.magnisoft.pt/trialrequest",this.form),this.showSuccessNotification=!0,setTimeout((()=>{this.showSuccessNotification=!1}),5e3),this.resetForm()}catch(a){console.error("Form submission error",a),this.showErrorNotification=!0,setTimeout((()=>{this.showErrorNotification=!1}),5e3)}finally{this.isSubmitting=!1}}},resetForm(){this.form={id:0,name:"",email:"",phone:"",businessType:null,business:"",privacyConsent:!1},this.errors={name:"",email:"",business:"",privacyConsent:""}}}}),C={class:"contact-form"},F={class:"columns is-multiline"},U={class:"column is-12"},g={key:0,class:"error-message"},P={class:"column is-12"},V={key:0,class:"error-message"},w={class:"column is-12"},B={class:"column is-12"},L={key:0,class:"error-message"},$={class:"column is-12"},H={class:"is-size-8 has-text-grey ml-2"},k={key:0,class:"error-message"},x={class:"column is-12",style:{display:"flex","justify-content":"center"}},j={key:0,class:"notification is-success is-light"},z={class:"is-flex is-align-items-center"},Y={key:1,class:"notification is-danger is-light"},q={class:"is-flex is-align-items-center"},G=h(a({__name:"ContactFormTrial",setup(e){const{t:s}=l(),a=D(),h=i((()=>[{value:0,label:s("DEMONSTRATION.FORM.BUSINESS_OPTIONS.CLOTHING")},{value:1,label:s("DEMONSTRATION.FORM.BUSINESS_OPTIONS.VETERINARY_CLINICS")},{value:2,label:s("DEMONSTRATION.FORM.BUSINESS_OPTIONS.HAIRDRESSERS_AND_BEAUTY")},{value:3,label:s("DEMONSTRATION.FORM.BUSINESS_OPTIONS.BUTCHERIES_AND_SUPERMARKETS")},{value:4,label:s("DEMONSTRATION.FORM.BUSINESS_OPTIONS.RESTAURANTS_AND_CAFES")},{value:5,label:s("DEMONSTRATION.FORM.BUSINESS_OPTIONS.PHARMACIES")},{value:6,label:s("DEMONSTRATION.FORM.BUSINESS_OPTIONS.TRADE_AND_SERVICES")},{value:7,label:s("DEMONSTRATION.FORM.BUSINESS_OPTIONS.BRANCHES_AND_WAREHOUSES")},{value:8,label:s("DEMONSTRATION.FORM.BUSINESS_OPTIONS.CONSTRUCTION")},{value:9,label:s("DEMONSTRATION.FORM.BUSINESS_OPTIONS.TECHNICAL_SERVICES")},{value:10,label:s("DEMONSTRATION.FORM.BUSINESS_OPTIONS.OTHERS")}]));function M(){a.handleSubmit(s)}return t((()=>a.form.businessType),(e=>{if(null==e)return void(a.form.business="");const s=h.value.find((s=>s.value===e));a.form.businessType=e,a.form.business=s?s.label:""})),(e,l)=>{const i=_,t=T,A=d,b=R,D=v,G=y,K=o("router-link"),J=f;return n(),r("div",C,[u("form",{onSubmit:p(M,["prevent"])},[u("div",F,[u("div",U,[m(b,null,{default:O((()=>[m(i,{label:"First Name"},{default:O((()=>[S(N(e.$t("DEMONSTRATION.FORM.NAME")),1)])),_:1}),m(A,{icon:"feather:user"},{default:O((()=>[m(t,{modelValue:E(a).form.name,"onUpdate:modelValue":l[0]||(l[0]=e=>E(a).form.name=e),placeholder:e.$t("DEMONSTRATION.FORM.NAME_PLACEHOLDER")},null,8,["modelValue","placeholder"])])),_:1}),E(a).errors.name?(n(),r("p",g,N(E(a).errors.name),1)):c("",!0)])),_:1})]),u("div",P,[m(b,null,{default:O((()=>[m(i,{label:"Email"},{default:O((()=>
1[S(N(e.$t("DEMONSTRATION.FORM.EMAIL")),1)])),_:1}),m(A,{icon:"feather:mail"},{default:O((()=>[m(t,{modelValue:E(a).form.email,"onUpdate:modelValue":l[1]||(l[1]=e=>E(a).form.email=e),placeholder:e.$t("DEMONSTRATION.FORM.EMAIL_PLACEHOLDER"),onVnodeUpdated:l[2]||(l[2]=e=>{return E(a).errors.email=(l=E(a).form.email)&&""!==l.trim()?/^[\w.%+-]+@[\w.-]+\.[a-z]{2,}$/i.test(l)?null:s("CONTACTS.FORM.ERROR_EMAIL"):null;var l})},null,8,["modelValue","placeholder"])])),_:1}),E(a).errors.email?(n(),r("p",V,N(E(a).errors.email),1)):c("",!0)])),_:1})]),u("div",w,[m(b,null,{default:O((()=>[m(i,{label:"Phone"},{default:O((()=>[S(N(e.$t("DEMONSTRATION.FORM.PHONE")),1)])),_:1}),m(A,{icon:"feather:phone"},{default:O((()=>[m(t,{modelValue:E(a).form.phone,"onUpdate:modelValue":l[3]||(l[3]=e=>E(a).form.phone=e),type:"number",pattern:"[0-9]*",placeholder:e.$t("DEMONSTRATION.FORM.PHONE_PLACEHOLDER")},null,8,["modelValue","placeholder"])])),_:1})])),_:1})]),u("div",B,[m(b,null,{default:O((()=>[m(i,{label:"Business"},{default:O((()=>[S(N(e.$t("DEMONSTRATION.FORM.BUSINESS")),1)])),_:1}),m(A,null,{default:O((()=>[m(D,{modelValue:E(a).form.businessType,"onUpdate:modelValue":l[4]||(l[4]=e=>E(a).form.businessType=e),required:"",options:E(h),placeholder:e.$t("DEMONSTRATION.FORM.BUSINESS_PLACEHOLDER")},null,8,["modelValue","options","placeholder"])])),_:1}),E(a).errors.business?(n(),r("p",L,N(E(a).errors.business),1)):c("",!0)])),_:1})]),u("div",$,[m(A,null,{default:O((()=>[m(G,{modelValue:E(a).form.privacyConsent,"onUpdate:modelValue":l[5]||(l[5]=e=>E(a).form.privacyConsent=e),name:"privacyConsent"},null,8,["modelValue"]),u("span",H,[S(N(e.$t("DEMONSTRATION.FORM.PRIVACY_CONSENT"))+" ",1),m(K,{to:"/privacy-policy"},{default:O((()=>[S(N(e.$t("PRIVACY.TITLE")),1)])),_:1}),l[8]||(l[8]=S(". "))])])),_:1}),E(a).errors.privacyConsent?(n(),r("p",k,N(E(a).errors.privacyConsent),1)):c("",!0)]),u("div",x,[m(A,null,{default:O((()=>[m(J,{color:"primary",bold:"",raised:"",fullwidth:"",disabled:E(a).isSubmitting,class:I({"is-loading":E(a).isSubmitting}),style:{width:"fit-content"}},{default:O((()=>[u("span",null,N(e.$t("DEMONSTRATION.FORM.BUTTON")),1)])),_:1},8,["disabled","class"])])),_:1})])]),E(a).showSuccessNotification?(n(),r("div",j,[u("button",{class:"delete",type:"button",onClick:l[6]||(l[6]=e=>E(a).showSuccessNotification=!1)}),u("div",z,[l[9]||(l[9]=u("i",{class:"iconify mr-2","data-icon":"feather:check"},null,-1)),S(" "+N(e.$t("DEMONSTRATION.FORM.SUCCESS")),1)])])):c("",!0),E(a).showErrorNotification?(n(),r("div",Y,[u("button",{class:"delete",type:"button",onClick:l[7]||(l[7]=e=>E(a).showErrorNotification=!1)}),u("div",q,[l[10]||(l[10]=u("i",{class:"iconify mr-2","data-icon":"feather:alert-circle"},null,-1)),S(" "+N(e.$t("DEMONSTRATION.FORM.ERROR")),1)])])):c("",!0)],32)])}}}),[["__scopeId","data-v-4dc20922"]]),K={class:"container py-40"},J={style:{"text-align":"center"},class:"px-40 mobile:px-10"},Q={class:"subtitle py-3"},W={class:"container-form py-12"};const X=h({},[["render",function(e,s){const a=b,l=G,i=A;return n(),M(i,{wave:"wave-1","shape-color":"grey",class:"p-0"},{default:O((()=>[u("div",K,[u("div",J,[m(a,{tag:"h3",size:2},{default:O((()=>[u("span",null,N(e.$t("DEMONSTRATION.TITLE")),1)])),_:1}),u("p",Q,N(e.$t("DEMONSTRATION.DESCRIPTION")),1)]),u("div",W,[m(l,{class:"demonstration-form"})])])])),_:1})}]]);export{X 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.