(()=>{"use strict";var e={};e.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}();const t="email",n="phone",r="name",a={[t]:["email","e-mail","mail","email address"],[n]:["phone","tel","mobile","cell","telephone","phone number"],[r]:["name","full-name","full name","full_name","fullname","first-name","first name","first_name","firstname","last-name","last name","last_name","lastname","given-name","given name","given_name","givenname","family-name","family name","family_name","familyname","fname","lname","first","last","your-name","your name"]};function i(e){return e&&"string"==typeof e?e.trim().toLowerCase():""}function l(e){const t=i(e),n=t.lastIndexOf("@");if(-1===n)return t;const r=t.slice(n+1);return["gmail.com","googlemail.com"].includes(r)?`${t.slice(0,n).replace(/\./g,"")}@${r}`:t}function u(e){const t=i(e),n=t.replace(/\D/g,"");return t.startsWith("+")?`+${n}`:n}function s(e){const t=e.filter(e=>{let{type:t}=e;return t===r}).map(e=>{let{value:t}=e;return i(t)}).filter(Boolean);if(!t.length)return;const[n,...a]=1===t.length?t[0].split(" "):t;return{first_name:n,...a?.length>0?{last_name:a.join(" ")}:{}}}function o(e){return e.find(e=>{let{type:n}=e;return n===t})?.value}function m(e){return e.find(e=>{let{type:t}=e;return t===n})?.value}e.g.document.addEventListener("om.Analytics.track",c=>{let{detail:f}=c;if("conversion"===f.Analytics.type){const c=e.g._googlesitekit?.gtagUserData,p=c&&f.Campaign?.Form?function(e){if(!e||!e.inputs)return;const c=Array.isArray(e.inputs)?e.inputs:Object.values(e.inputs);return c.length?function(e){const t=[["address",s(e)],["email",o(e)],["phone_number",m(e)]].filter(e=>{let[,t]=e;return t});if(0!==t.length)return Object.fromEntries(t)}(c.map(e=>{if("hidden"===e.type)return null;const s=e.id?document.querySelector(`label[for='${e.id}']`)?.textContent:e.placeholder||"";return function(e){let{type:s,name:o,value:m,label:c}=e||{};switch(s=i(s),o=i(o),m=i(m),c=function(e){return e&&"string"==typeof e?e.trim().toLowerCase().replace(/\s*\*+\s*$/,"").replace(/\s*\(required\)\s*$/i,"").replace(/\s*:\s*$/,"").trim():""}(c),s){case"email":return{type:t,value:l(m)};case"tel":return{type:n,value:u(m)}}return function(e){if(!e)return!1;const t=l(e);return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)}(m)||a[t].includes(o)||a[t].includes(c)?{type:t,value:l(m)}:a[n].includes(o)||a[n].includes(c)?{type:n,value:u(m)}:a[r].includes(o)||a[r].includes(c)?{type:r,value:i(m)}:function(e){if(!e)return!1;if(!function(e){const t=e.replace(/\D/g,"");return!(t.length<7||t.length<e.length/2)&&/^[\s\-()+.\d]*$/.test(e)}(e))return!1;const t=u(e);if(!/^\+?\d{7,}$/.test(t))return!1;const n=/[\s\-()+.]/.test(e),r=e.trim().startsWith("+");return!(!n&&!r)}(m)?{type:n,value:u(m)}:null}({type:e.type,name:e.name,value:e.value,label:s})}).filter(Boolean)):void 0}(f.Campaign.Form):null,g={campaignID:f.Campaign.id,campaignType:f.Campaign.type};p&&(g.user_data=p),e.g._googlesitekit?.gtagEvent?.("submit_lead_form",g)}})})();