(()=>{"use strict";var e={};function t(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function n(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,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 r="email",i="phone",l="name",a={[r]:["email","e-mail","mail","email address"],[i]:["phone","tel","mobile","cell","telephone","phone number"],[l]:["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 o(e){return e&&"string"==typeof e?e.trim().toLowerCase():""}function u(e){const t=o(e),n=t.lastIndexOf("@");if(-1===n)return t;const r=t.slice(n+1);if(["gmail.com","googlemail.com"].includes(r)){const e=t.slice(0,n).replace(/\./g,"");return"".concat(e,"@").concat(r)}return t}function s(e){const t=o(e),n=t.replace(/\D/g,"");return t.startsWith("+")?"+".concat(n):n}function c(e){const r=e.filter(e=>{let{type:t}=e;return t===l}).map(e=>{let{value:t}=e;return o(t)}).filter(Boolean);if(!r.length)return;const[i,...a]=1===r.length?r[0].split(" "):r;return function(e){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?t(Object(i),!0).forEach(function(t){n(e,t,i[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))})}return e}({first_name:i},(null==a?void 0:a.length)>0?{last_name:a.join(" ")}:{})}function f(e){var t;return null===(t=e.find(e=>{let{type:t}=e;return t===r}))||void 0===t?void 0:t.value}function m(e){var t;return null===(t=e.find(e=>{let{type:t}=e;return t===i}))||void 0===t?void 0:t.value}((t,n,v)=>{if(!t||!n||!v)return;const g=n.Object.extend({initialize(){this.listenTo(v.Radio.channel("forms"),"submit:response",this.actionSubmit)},actionSubmit(t){var n,v,g;const y=(null===(n=e.g._googlesitekit)||void 0===n?void 0:n.gtagUserData)?(d=t.data.fields,function(e){const t=[["address",c(e)],["email",f(e)],["phone_number",m(e)]].filter(e=>{let[,t]=e;return t});if(0!==t.length)return Object.fromEntries(t)}(Object.values(d).map(e=>{var t;const{label:n,type:c,value:f,key:m}=e;return function(e){let{type:t,name:n,value:c,label:f}=e||{};switch(t=o(t),n=o(n),c=o(c),f=function(e){return e&&"string"==typeof e?e.trim().toLowerCase().replace(/\s*\*+\s*$/,"").replace(/\s*\(required\)\s*$/i,"").replace(/\s*:\s*$/,"").trim():""}(f),t){case"email":return{type:r,value:u(c)};case"tel":return{type:i,value:s(c)}}return function(e){if(!e)return!1;const t=u(e);return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t)}(c)||a[r].includes(n)||a[r].includes(f)?{type:r,value:u(c)}:a[i].includes(n)||a[i].includes(f)?{type:i,value:s(c)}:a[l].includes(n)||a[l].includes(f)?{type:l,value:o(c)}: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=s(e);if(!/^\+?\d{7,}$/.test(t))return!1;const n=/[\s\-()+.]/.test(e),r=e.trim().startsWith("+");return!(!n&&!r)}(c)?{type:i,value:s(c)}:null}({label:n,type:null!==(t=p[c])&&void 0!==t?t:c,value:f,name:m})}).filter(Boolean))):void 0;var d;null===(v=e.g._googlesitekit)||void 0===v||null===(g=v.gtagEvent)||void 0===g||g.call(v,"submit_lead_form",y?{user_data:y}:void 0)}});t(document).ready(()=>{new g})})(e.g.jQuery,e.g.Marionette,e.g.Backbone);const p={phone:"tel",textbox:"text"}})();