1import{p as l}from"./push-data-layer.Dc90DW6O.js";const u=["contact","cv","download","newsletter"];function f(e){return u.includes(e)}function w(e){const o={form_variant:e.formVariant,page_location:e.pageLocation,language:e.language,...e.formId?{form_id:e.formId}:{}};l({event:"generate_lead",...o});const t=e.downloadUrl?.trim();e.formVariant==="download"&&t&&l({event:"file_download",...o,link_url:t})}function g(){window.__formBlockBound||(window.__formBlockBound=!0,document.addEventListener("submit",e=>{const o=e.target;o instanceof HTMLFormElement&&o.matches(".form-block__form[data-form-id]")&&(e.preventDefault(),h(o))}))}async function h(e){const o=e.dataset.variant??"";if(!f(o))return;const t=e.querySelector('button[type="submit"]'),s=e.parentElement?.querySelector("[data-success-message]"),i=t?.textContent?.trim()??"";t&&(t.disabled=!0,t.textContent="Enviando...");const d=new FormData(e);d.set("page_url",window.location.href),d.set("lang",document.documentElement.lang||"");try{const a=await fetch("/api/forms",{method:"POST",body:d});let n={};try{n=await a.json()}catch{n={}}if(!a.ok||n.success!==!0){const r="error"in n&&typeof n.error=="string"?n.error:"No se pudo enviar el formulario.";throw new Error(r)}const c=e.querySelector('input[name="form_id"]')?.value.trim()??"",m=document.documentElement.lang||"";if(w({formVariant:o,formId:c||void 0,pageLocation:window.location.href,language:m,downloadUrl:n.downloadUrl}),o==="download"&&typeof n.downloadUrl=="string"&&n.downloadUrl.length>0){const r=document.createElement("a");r.href=n.downloadUrl,r.download="",r.rel="noopener noreferrer",r.click()}e.style.display="none",s?.removeAttribute("hidden")}catch(a){console.error("Form submission error:",a),t&&(t.disabled=!1,t.textContent=i?`Error â ${i}`:"Error â Reintentar")}}g();
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.