1const l="download_lead_profile";const p=e=>{const o=document.cookie.split("; ").find(t=>t.startsWith(`${e}=`));if(!o)return null;try{return JSON.parse(decodeURIComponent(o.split("=").slice(1).join("=")))}catch{return null}},I=(e,o)=>{const t=window.location.protocol==="https:"?"; Secure":"";document.cookie=`${e}=${encodeURIComponent(JSON.stringify(o))}; Max-Age=157680000; Path=/; SameSite=Lax${t}`},m=e=>!!(e!=null&&e.company_name&&(e!=null&&e.email)&&(e!=null&&e.phone)),y=()=>{const e=m(p(l));document.querySelectorAll(".js-locked-download").forEach(o=>{o.classList.toggle("-lead-unlocked",e)})},w=e=>{const o=document.createElement("a");o.href=e,o.setAttribute("download",""),o.target="_self",o.style.display="none",document.body.appendChild(o),o.click(),o.remove()},d=()=>{var t;const e=document.getElementById("download-popup"),o=document.getElementById("download-form");return!e||!o?null:{popup:e,form:o,storeUrl:e.dataset.storeUrl,errorText:e.dataset.errorMessage,csrf:(t=o.querySelector('input[name="_token"]'))==null?void 0:t.value,submitButton:document.getElementById("download-submit-button"),errorMessage:document.getElementById("download-popup-error"),companyInput:document.getElementById("download-company"),emailInput:document.getElementById("download-email"),phoneInput:document.getElementById("download-phone"),privacyInput:document.getElementById("download-privacy"),downloadIdInput:document.getElementById("download-id"),fileKeyInput:document.getElementById("download-file-key"),localeInput:document.getElementById("download-locale"),formPanel:document.querySelector('[data-download-popup-panel="form"]'),successPanel:document.querySelector('[data-download-popup-panel="success"]'),repeatLink:document.getElementById("download-repeat-link")}};let r=null;const a=(e,o="")=>{e.errorMessage.textContent=o,e.errorMessage.hidden=!o},s=e=>{e.submitButton.disabled=!e.form.checkValidity()},g=(e,o,t={})=>{r=o,e.popup.classList.remove("-success"),e.formPanel.hidden=!1,e.successPanel.hidden=!0,e.downloadIdInput.value=o.dataset.downloadId,e.fileKeyInput.value=o.dataset.f
1ileKey,e.localeInput.value=o.dataset.locale,e.companyInput.value=t.company_name||"",e.emailInput.value=t.email||"",e.phoneInput.value=t.phone||"",e.privacyInput.checked=!1,a(e),s(e)},i=(e,o,t={})=>{g(e,o,t),e.popup.classList.add("-visible"),e.popup.setAttribute("aria-hidden","false"),e.companyInput.focus()},f=e=>{e.popup.classList.remove("-visible"),e.popup.classList.remove("-success"),e.popup.setAttribute("aria-hidden","true"),a(e)},k=(e,o)=>{e.popup.classList.add("-success"),e.formPanel.hidden=!0,e.successPanel.hidden=!1,e.repeatLink.href=o,e.popup.classList.add("-visible"),e.popup.setAttribute("aria-hidden","false")},E=e=>({company_name:e.companyInput.value.trim(),email:e.emailInput.value.trim(),phone:e.phoneInput.value.trim()}),v=(e,o)=>({...o,privacy:!0,download_type:e.dataset.downloadType||"download",download_id:e.dataset.downloadId,file_key:e.dataset.fileKey,locale:e.dataset.locale}),h=async(e,o,t)=>{o.classList.add("-loading");try{const n=await fetch(e.storeUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","X-CSRF-TOKEN":e.csrf},body:JSON.stringify(v(o,t))});if(!n.ok)throw new Error("Download lead request failed");const c=await n.json();return I(l,c.profile||t),y(),w(c.download_url),c}finally{o.classList.remove("-loading")}},L=async e=>{const o=e.target.closest(".js-locked-download");if(!o)return;const t=d();if(!t)return;e.preventDefault();const n=p(l);if(!m(n)){i(t,o,n||{});return}try{await h(t,o,n)}catch{i(t,o,n),a(t,t.errorText)}},B=e=>{if(!e.target.closest("[data-download-popup-close]"))return;const t=d();t&&f(t)},C=e=>{const o=e.target.closest("#download-repeat-link");o&&(e.preventDefault(),w(o.href))},u=e=>{if(!e.target.closest("#download-form"))return;const o=d();o&&s(o)},_=async e=>{if(e.target.id!=="download-form")return;e.preventDefault();const o=d();if(o){if(!o.form.checkValidity()||!r){s(o);return}o.submitButton.disabled=!0,a(o);try{const t=await h(o,r,E(o));k(o,t.download_url)}catch{a(o,o.errorText),s(o)}}},P=e=>{const o=d();e.key==="Escape"&&(o!=null&&o.popup.classList.contains("-visible"))&&f(o)};window.downloadPopupInitialized||(window.downloadPopupInitialized=!0,y(),document.addEventListener("click",L,!0),document.addEventListener("click",C),document.addEventListener("click",B),document.addEventListener("input",u),document.addEventListener("change",u),document.addEventListener("submit",_),document.addEventListener("keydown",P));
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.