1"use strict";(self.webpackChunkbase_camp=self.webpackChunkbase_camp||[]).push([[4558],{54329:function(e,t,n){n.r(t),n.d(t,{default:function(){return o}});var i=n(71083),a=n(8458),s=n(45535),r={name:"LeadMachineForm",components:{FormGenerator:a.A},props:{buttonText:{type:String,required:!0},buttonColor:{type:String,required:!0},attachments:{type:Array,required:!0},content:{type:String,required:!0},subject:{type:String,required:!0},message:{type:String,required:!0}},data(){return{isSending:!1,formFields:[[{name:"firstname",label:"Etunimi",field:"input",type:"text",validate:"required",column:6},{name:"lastname",label:"Sukunimi",field:"input",type:"text",validate:"required",column:6}],[{name:"emailaddress1",label:"Sähköposti",field:"input",type:"text",column:12,validate:"required"}],[{field:"checkbox",label:"Annan luvan älyohjaustuotteiden markkinointiin",name:"marketing",column:12,value:!1}]]}},computed:{customSubmitButton(){return{class:this.buttonColor,text:this.buttonText}}},methods:{onSubmit(e){this.isSending=!0;const t={},n={};this.formFields.forEach(n=>n.forEach(n=>{if(n.name){const i=n.prefix?n.prefix+e[n.name]:e[n.name];t[n.name]=i}})),t.ecr_customerprofile=806400001,t.ecr_type=806400002,t.donotemail=!0,t.ecr_donotsms=!0,t.preferredcontactmethodcode=2,t.ecr_messageweb="OPAS ÃLYOHJAUSTUOTTEIDEN HANKINTAAN",t.ecr_messageweb+="\r\n",t.ecr_messageweb+="\r\nAnnan luvan älyohjaustuotteiden markkinointiin: "+(t.marketing?"Kyllä":"Ei"),n.attachments=this.attachments,n.subject=this.subject,n.content=this.content,n.email=t.emailaddress1,console.log(n),console.log(t),this.$snotify.async("Lähetetään lomaketta",()=>new Promise(async(e,a)=>{try{200===(await i.A.post("/wp-json/api/lead-machine",n)).status&&await i.A.post(s.A,t),e({title:"",body:"Lähetys onnistui",config:{timeout:3e3}}),this.isSending=!1,this.$refs.leadMachine.resetFormData()}catch(e){a({title:"",body:"Lähetyksessä tapahtui virhe",config:{timeout:3e3}}),this.isSending=!1}}))}}},o=(0,n(14486).A)(r,function(){var e=this,t=e._self._c;return t("div",[t("FormGenerator",{ref:"leadMachine",attrs:{id:"lead-machine-form","form-fields":e.formFields,"has-terms":!1,"has-form-error-message":!1,"custom-submit-button":e.customSubmitButton,"is-sending":e.isSending},on:{submitted:e.onSubmit}})],1)},[],!1,null,null,null).exports}}]);
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.