(function(){window._AHInterceptionConfig = {"interceptions":[{"fields":[{"type":"FULL_NAME","selector":"#form-field-PreCotNomCli","selectorType":"SINGLE"},{"type":"PHONE","selector":"#form-field-PreCotTelCli","selectorType":"SINGLE"}],"selector":"#formulario_data"}],"configId":"tOUxQA"};}());
(function(){"use strict";const u="https://leads-interception.alohome.ai",c={FIRST_NAME:"firstName",LAST_NAME:"lastName",FULL_NAME:"fullName",EMAIL:"email",PHONE:"phone"},s=window._AHInterceptionConfig;if(s===void 0)throw new Error("No configuration found");const{interceptions:m,configId:E}=s;(document==null?void 0:document.readyState)==="loading"?addEventListener("DOMContentLoaded",l):l();function l(){m.forEach(({selector:t,fields:o,selectorType:f})=>{if(f==="ALL"){const i=document.querySelectorAll(t);if(i.length===0)return;i.forEach(a=>{d({formElement:a,fields:o})})}else{const i=document.querySelector(t);if(!i)return;d({formElement:i,fields:o})}})}async function d({formElement:t,fields:o}){t.addEventListener("submit",async f=>{const a=o.map(({selector:e,type:n})=>{const r=t.querySelector(e);return r?{element:r,type:n}:{element:null,type:n}}).filter(({type:e,element:n})=>e in c&&n!==null).map(({element:e,type:n})=>({name:c[n],value:e==null?void 0:e.value})).reduce((e,{name:n,value:r})=>({...e,[n]:r}),{});try{await L({configId:E,fields:a})}catch(e){console.log("Error sending lead ",e)}})}async function L({fields:t,configId:o}){await fetch(`${u}/api/leads/v1`,{method:"POST",keepalive:!0,headers:{"Content-Type":"application/json"},body:JSON.stringify({configurationId:o,contact:{...t}})})}})();
