1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[142],{6262:function(e,r){r.A=(e,r)=>{const t=e.__vccOpts||e;for(const[e,o]of r)t[e]=o;return t}},2142:function(e,r,t){t.r(r),t.d(r,{default:function(){return y}});var o=t(9726),a={key:0},s={key:1},n={key:0},l={class:"w-full"},i={class:"grid md:grid-cols-2 pt-2 lg:pt-4 gap-4 p-4 md:p-8"},d={class:"md:col-span-2"},u={class:"md:col-span-2 h-0 w-0 overflow-hidden"},m={for:"terms",class:"opacity-0 absolute z-0 -left-[9999px]"},c={class:"md:col-span-2 flex flex-col xl:flex-row items-center pt-2"},f=["disabled"],p={key:1,class:"text-sm p-4 leading-none"};var h={name:"ContactForm",props:{nonce:{type:String,default:""},userIp:{type:String,default:""},userAgent:{type:String,default:""},referrer:{type:String,default:""},form:{type:String,default:"Contact Form"},to:{type:String,default:""},source:{type:Object,default:function(){}}},data:function(){return{processing:!1,errors:{},errorCode:null,success:!1,hasError:!1,formData:{fname:"",lname:"",phone:"",email:"",message:"",terms:!1},mailto:"",submitted:!1}},computed:{validate:function(){return""!=this.formData.fname&&""!=this.formData.lname&&""!=this.formData.phone&&""!=this.formData.email&&""!=this.formData.message}},mounted:function(){this.formData.post_id=this.postId,this.formData.user_ip=this.userIp,this.formData.user_agent=this.userAgent,this.formData.referrer=this.referrer},methods:{submitForm:function(){var e=this;this.processing=!0,fetch("/wp-json/kma/v1/submit-contact-form",{method:"POST",mode:"cors",cache:"no-cache",headers:{"Content-Type":"application/json","X-WP-Nonce":this.nonce},body:JSON.stringify(this.formData)}).then(function(e){return e.json()}).then(function(r){"submitted"==r.data&&(e.success=!0),"success"==r.data&&(e.success=!0,dataLayer.push({event:"form_submitted",form_name:"Contact Form",form_type:e.source.post_type,form_source:e.source.post_title})),0==r.success&&(e.success=!1,e.hasError=!0,e.errors=r.data),e.processing=!1})}}};const b=(0,t(6262).A)(h,[["render",function(e,r,t,h,b,y){return(0,o.uX)(),(0,o.CE)("div",null,[b.success?((0,o.uX)(),(0,o.CE)("div",a,[(0,o.RG)(e.$slots,"default")])):((0,o.uX)(),(0,o.CE)("div",s,[b.hasError?((0,o.uX)(),(0,o.CE)("div",n,[((0,o.uX)(!0),(0,o.CE)(o.FK,null,(0,o.pI)(b.errors,function(e){return(0,o.uX)(),(0,o.CE)("p",{key:e,class:"text-error font-bold text-sm"},(0,o.v_)(e),1)}),128))])):(0,o.Q3)("",!0),(0,o.Lk)("div",l,[(0,o.Lk)("form",i,[(0,o.Lk)("div",null,[r[7]||(r[7]=(0,o.Lk)("label",{for:"first-name",class:"sr-only"},"First Name",-1)),(0,o.bo)((0,o.Lk)("input",{"onUpdate:modelValue":r[0]||(r[0]=function(e){return b.formData.fname=e}),id:"first-name",type:"text",class:(0,o.C4)(["px-4 py-2 text-sm w-full rounded-xs overflow-hidden border",{"border-error":b.hasError&&""==b.formData.fname}]),placeholder:"First Name",required:""},null,2),[[o.Jo,b.formData.fname]])]),(0,o.Lk)("div",null,[r[8]||(r[8]=(0,o.Lk)("label",{for:"last-name",class:"sr-only"},"Last Name",-1)),(0,o.bo)((0,o.Lk)("input",{"onUpdate:modelValue":r[1]||(r[1]=function(e){return b.formData.lname=e}),id:"last-name",type:"text",class:(0,o.C4)(["px-4 py-2 text-sm w-full rounded-xs overflow-hidden border",{"border-error":b.hasError&&""==b.formData.lname}]),placeholder:"Last Name",required:""},null,2),[[o.Jo,b.formData.lname]])]),(0,o.Lk)("div",null,[r[9]||(r[9]=(0,o.Lk)("label",{for:"email-address",class:"sr-only"},"Email Address",-1)),(0,o.bo)((0,o.Lk)("input",{"onUpdate:modelValue":r[2]||(r[2]=function(e){return b.formData.email=e}),id:"email-address",type:"email",class:(0,o.C4)(["px-4 py-2 text-sm w-full rounded-xs overflow-hidden border",{"border-error":b.hasError&&""==b.formData.email}]),placeholder:"Email Address",required:""},null,2),[[o.Jo,b.formData.email]])]),(0,o.Lk)("div",null,[r[10]||(r[10]=(0,o.Lk)("label",{for:"phone-number",class:"sr-only"},"Phone Number",-1)),(0,o.bo)((0,o.Lk)("input",{"onUpdate:modelValue":r[3]||(r[3]=function(e){return b.formData.phone=e}),id:"phone-number",type:"tel",class:(0,o.C4)(["px-4 py-2 text-sm w-full rounded-xs overflow-hidden border",{"border-error":b.hasError&&""==b.formData.phone}]),placeholder:"Phone Number",required:""},null,2),[[o.Jo,b.formData.phone]])]),(0,o.Lk)("div",d,[r[11]||(r[11]=(0,o.Lk)("label",{for:"message",class:"sr-only"},"Message",-1)),(0,o.bo)((0,o.Lk)("textarea",{type:"text",id:"message","onUpdate:modelValue":r[4]||(r[4]=function(e){return b.formData.message=e}),class:(0,o.C4)(["px-4 py-2 text-sm w-full h-24 md:h-32 rounded-xs overflow-hidden group border",{"border-error":b.hasError&&""==b.formData.message}]),placeholder:"Type your message here.",required:""},null,2),[[o.Jo,b.formData.message]])]),(0,o.Lk)("div",u,[(0,o.Lk)("label",m,[(0,o.bo)((0,o.Lk)("input",{type:"checkbox","onUpdate:modelValue":r[5]||(r[5]=function(e){return b.formData.terms=e}),id:"terms",name:"terms",tabindex:"-1"},null,512),[[o.lH,b.formData.terms]]),r[12]||(r[12]=(0,o.eW)(" I agree to the ",-1)),r[13]||(r[13]=(0,o.Lk)("a",{href:"/privacy-policy/",target:"_blank",tabindex:"-1"},"Terms & Conditions",-1))])]),(0,o.Lk)("div",c,[(0,o.Lk)("button",{onClick:r[6]||(r[6]=(0,o.D$)(function(){return y.submitForm&&y.submitForm.apply(y,arguments)},["prevent"])),type:"submit",disabled:b.processing,class:"btn-accent-outlined py-2 px-4 md:px-6"}," Send Message ",8,f),b.processing?(0,o.Q3)("",!0):((0,o.uX)(),(0,o.CE)("div",{key:0,class:(0,o.C4)(["text-sm p-4 leading-none",{"text-error font-bold":this.hasError}])}," All fields required",2)),b.processing?((0,o.uX)(),(0,o.CE)("div",p,"Sending inquiry.")):(0,o.Q3)("",!0)])])])]))])}]]);var y=b}}]); 2//# sourceMappingURL=142.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.