(()=>{function G(C){let w=`; ${document.cookie}`.split(`; ${C}=`);if(w.length===2)return w.pop()?.split(";").shift()||null;return null}function H(C,y,w=30){let O=new Date;O.setTime(O.getTime()+w*24*60*60*1000);let q=`expires=${O.toUTCString()}`;document.cookie=`${C}=${y};${q};path=/`}async function B({apiUrl:C,urlParams:y,url:w,candidatePhoneNumbersOnPage:O}){let q=G("dni_visitor_id");return fetch(C,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({urlParams:y,visitorId:q||void 0,url:w,candidatePhoneNumbersOnPage:O})}).then(($)=>$.json())}function V(C,y=document){let{swapTargets:w,phoneNumber:O}=C,q=(R)=>R.replace(/\D/g,""),_=new Set,$=new Set;w.forEach((R)=>{_.add(q(R.nationalNumber)),$.add(q(R.e164))});let z=q(O.nationalNumber),K=q(O.e164),L=/(\+?1?[-.\s]?)?\(?\d{3}\)?[-.\s\w]*\d{3}[-.\s\w]*\d{4}|\+?1?\d{10}/g,A=(R)=>{if(_.has(R)||$.has(R))return!0;for(let v of _)if(R.endsWith(v)){for(let J of $)if(R.length===J.length)return!0}for(let v of _)if(R.includes(v))return!0;return!1},x=(R)=>{let v=q(R);if(!A(v))return R;let J;if(v.length>=11)J=K;else J=z;let X="",Y=0;for(let T=0;T{if(L.lastIndex=0,R.textContent)R.textContent=R.textContent.replace(L,x)}),y.querySelectorAll('a[href^="tel:"]').forEach((R)=>{let v=q(R.href);if(A(v))R.href="tel:"+O.e164})}function S(C){return"fbp"in C&&"ev"in C}function W(C){let y=Object.fromEntries(new FormData(C).entries());if(S(y))return null;return y}function N(C,y){if(y.dni)y.dni.forEach((A)=>V(A));F(y.sessionId);let w=new WeakSet,O=new WeakSet,q=()=>{return(A)=>{let x=A.target;if(!x?.reportValidity())return;if(w.has(x))return;w.add(x);let E=W(x);if(!E)return;Z(C,y.sessionId,E)}};document.addEventListener("submit",q(),!0);let _=HTMLFormElement.prototype.submit;HTMLFormElement.prototype.submit=function(){if(this.reportValidity()&&!w.has(this)){w.add(this);let A=W(this);if(A)Z(C,y.sessionId,A)}return _.call(this)};let $=(A)=>{if(O.has(A))return;try{let x=A.contentDocument||A.contentWindow?.document;if(!x)return;if(O.add(A),x.addEventListener("submit",q(),!0),y.dni)y.dni.forEach((E)=>V(E,x))}catch{}};document.querySelectorAll("iframe").forEach((A)=>{if(A.contentDocument?.readyState==="complete")$(A);else A.addEventListener("load",()=>$(A))}),new MutationObserver((A)=>{for(let x of A)x.addedNodes.forEach((E)=>{if(E instanceof HTMLIFrameElement)if(E.contentDocument?.readyState==="complete")$(E);else E.addEventListener("load",()=>$(E));if(E instanceof HTMLFormElement)j(E,y.sessionId);if(E instanceof HTMLElement)E.querySelectorAll("iframe").forEach((U)=>{if(U.contentDocument?.readyState==="complete")$(U);else U.addEventListener("load",()=>$(U))}),E.querySelectorAll("form").forEach((U)=>{j(U,y.sessionId)})})}).observe(document.body,{childList:!0,subtree:!0});let K=!1,L=()=>{if(K)return;if(typeof window.jQuery<"u"&&typeof window.gform<"u")K=!0,window.jQuery(document).on("gform_confirmation_loaded",function(A,x){let E=document.getElementById(`gform_${x}`);if(E&&!w.has(E)){w.add(E);let U=W(E);if(U)Z(C,y.sessionId,U)}})};if(L(),document.readyState==="loading")document.addEventListener("DOMContentLoaded",L);setTimeout(L,1000)}function j(C,y){if(C.querySelector('input[name="aim_session_id"]'))return;let w=document.createElement("input");w.type="hidden",w.name="aim_session_id",w.value=y,C.appendChild(w)}function F(C){document.querySelectorAll("form").forEach((y)=>{j(y,C)})}function Z(C,y,w){fetch(`${C}/form-submission`,{method:"POST",keepalive:!0,headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:y,formData:w,submissionUrl:window.location.href})})}var P=/(\+?1?[-.\s]?)?\(?\d{3}\)?[-.\s\w]*\d{3}[-.\s\w]*\d{4}|\+?1?\d{10}/g,l=(C)=>C.replace(/\D/g,"");function b(C=document){let y=[],w=new Set,O=($)=>{if(!$||w.has($))return;w.add($),y.push($)},q=C.createTreeWalker(C.body,NodeFilter.SHOW_TEXT,null),_;while(_=q.nextNode()){let $=_.parentElement;if($&&($.tagName==="SCRIPT"||$.tagName==="STYLE"))continue;let z=_.textContent;if(typeof z!=="string")continue;P.lastIndex=0;let K;while(K=P.exec(z))O(l(K[0]))}return C.querySelectorAll('a[href^="tel:"]').forEach(($)=>O(l($.href))),y}var h=document.currentScript;(async()=>{let C=h?.getAttribute("src");if(!C)return;let y=C.substring(0,C.lastIndexOf("/")),w=b(),O=await B({apiUrl:`${y}/session`,urlParams:window.location.search.substring(1),url:window.location.href,candidatePhoneNumbersOnPage:w});if(!O.success)return;H("dni_visitor_id",O.visitorId),N(y,O)})();})();