const domainPrincipal="www.passline.com",domainCookie=".passline.com",pathSecure="https://",recaptcha_response="",urlApi="https://api.passline.com/v1/",urlDevApi="https://apidev.passline.com/v1/";let country=readCookie("country")?readCookie("country"):"";if(""==country){let e=JSON.parse(localStorage.getItem("country"));e.country&&(country=e.country)}const body=document.querySelector("body");let horaActual=(new Date).getHours(),contactMap=((20<=horaActual||horaActual<7)&&body.classList.add("dark"),{telefono_fijo:"",telefono_whatsapp:"",direccion:"",email:"",horarios_atencion:"",facebook:"",twitter:"",instagram:"",tiktok:"",gmt_timezone:"",currency:"",time_zone:"",termino_moneda:"",termino_cedula:"",termino_region:"",termino_comuna:"",cod_telefono:""}),contact;if(readCookie("contactMap"))try{contact=JSON.parse(readCookie("contactMap"))}catch(e){contact=contactMap}else contact=contactMap;const child=document.createElement("div"),listcountrydrop=document.querySelectorAll(".listFlagCountry");function readCountry(){var e=new Headers,e=(e.append("content-type","application/json"),{method:"GET",headers:e,redirect:"follow"});fetch(urlApi+"general/GetCountries",e).then(e=>e.text()).then(e=>{JSON.parse(e).forEach(function(e){const a=document.createElement("button");a.classList.add("list-country","list-group-item","list-group-item-action","btn-country-init","py-2","text-truncate"),a.type="buttom",e.flag_image2?a.innerHTML='
'+getCleanedString(e.nombre):a.innerHTML=e.nombre,a.dataset.id=e.id,a.dataset.name=e.nombre,a.dataset.flag=e.flag_image2,a.dataset.slug=e.slug,listcountrydrop.forEach(e=>{var t=a.cloneNode(!0);e.appendChild(t)})});e=document.querySelectorAll(".btn-country-init");Array.from(e).forEach(t=>{t.addEventListener("click",()=>{let e=!0;e=!t.dataset.reload||"false"!=t.dataset.reload,changeCountry(t.dataset.slug,t.dataset.name,null,t.dataset.flag,e)})})}).catch()}"object"==typeof listcountrydrop&&listcountrydrop&&readCountry();const selCountry=document.querySelectorAll(".btn-country-init");async function changeCountry(e,t="",a=null,o,r){let n="ES";a||(a="brasil"==e?"pt_BR":"es_ES",a="usa"==e?"en_US":"es_ES","pt_BR"==(a="italia"==e?"it_IT":"es_ES")&&(n="PT"),"en_US"==a&&(n="EN"),"it_IT"==a&&(n="IT"),"ca_ES"==a&&(n="CA"));var c={country:e,countryName:t=getCleanedString(t),language:a,languageInitials:n,flag:o},c=JSON.stringify(c);localStorage.setItem("country",c);let i=new Date(Date.now()+864e5);i=i.toUTCString(),document.cookie="language="+a+";path=/;domain="+domainCookie+";secure;expires="+i,document.cookie="country="+e+";path=/;domain="+domainCookie+";secure;expires="+i,document.cookie="countryName="+t+";path=/;domain="+domainCookie+";secure;expires="+i,document.cookie="countryFlag="+o+";path=/;domain="+domainCookie+";secure;expires="+i,document.cookie="languageInitials="+n+";path=/;domain="+domainCookie+";secure;expires="+i,n;c=new Headers,c.append("content-type","application/json"),c.append("Accept","application/json"),a={method:"GET",headers:c,redirect:"follow"};try{var s,l,u=await fetch(urlApi+"general/GetCountryData/"+e,a);u.ok&&(s=await u.json(),l=getCleanedString(JSON.stringify(s)),document.cookie="contactMap="+getCleanedString(l)+";path=/;domain="+domainCookie+";secure;expires="+i,contact=readCookie("contactMap")?JSON.parse(readCookie("contactMap")):contactMap)}catch(e){}r?location.reload():window.location=pathSecure+domainPrincipal+"/home"}Array.from(selCountry).forEach(t=>{t.addEventListener("click",()=>{let e=!0;e=!t.dataset.reload||"false"!=t.dataset.reload,changeCountry(t.dataset.slug,t.dataset.name,null,t.dataset.flag,e)})});const translate=document.querySelectorAll(".li-language"),forms=(Array.from(translate).forEach(o=>{o.addEventListener("click",()=>{var e=o.dataset.lang;const t="ca_ES"==e?"CA":"it_IT"==e?"IT":"en_US"==e?"EN":"pt_BR"==e?"PT":"ES";let a=new Date(Date.now()+864e5);a=a.toUTCString(),document.cookie="language="+e+";path=/;domain="+domainCookie+";secure;expires="+a,document.cookie="languageInitials="+t+";path=/;domain="+domainCookie+";secure;expires="+a,window.location.reload()})}),document.querySelectorAll(".needs-validation")),btnShowHide=(Array.from(forms).forEach(t=>{t.addEventListener("submit",e=>{t.checkValidity()||(e.preventDefault(),e.stopPropagation()),t.classList.add("was-validated")},!1)}),document.querySelector("#showhidepassword")),searchInput=("object"==typeof btnShowHide&&btnShowHide?.addEventListener("click",()=>{var e=btnShowHide.dataset.showhide,e=document.querySelector(e);"password"==e.type?(btnShowHide.innerHTML='',e.type="text"):(btnShowHide.innerHTML='',e.type="password")}),document.getElementById("search")),boxSearch=document.querySelector("#display-search"),closeSearch=document.querySelector(".close-search"),observer=(searchInput?.addEventListener("keyup",()=>{var e=searchInput.value;3{boxSearch.classList.add("d-none"),search.value=""}),new IntersectionObserver(e=>{e.forEach(t=>{if(t.isIntersecting){let e=t.target.dataset.animated;var a=t.target.dataset.delay;a?setTimeout(function(){t.target.classList.add(e)},a):t.target.classList.add(e)}})})),animates=document.querySelectorAll(".animation"),observerCount=(animates?.forEach(e=>observer.observe(e)),new IntersectionObserver(e=>{e.forEach(c=>{if(c.isIntersecting){let e=c.target.dataset.float;e;e;let t=0,a=c.target.dataset.firsticon,o=c.target.dataset.lasticon,r=("true"===e?parseFloat:parseInt)(c.target.dataset.finish);let n=setInterval(function(){r<=50&&"true"===e&&(t+=.2),r<=50&&"false"===e&&(t+=1),r<=100&&50=r&&(c.target.innerText="true"===e?a+r.toFixed(1)+o:a+r+o,clearInterval(n))},10)}})})),counter=document.querySelectorAll(".counter");function readCookie(e){for(var t=e+"=",a=document.cookie.split(";"),o=0;oobserverCount.observe(e));const closeSesion=document.querySelectorAll(".closeSesion");Array.from(closeSesion).forEach(e=>{e.addEventListener("click",()=>{document.cookie="refresh=;path=/;secure;domain="+domainCookie+";expires=Thu, 01 Jan 1970 00:00:00 UTC",document.cookie="access=;path=/;secure;domain="+domainCookie+";expires=Thu, 01 Jan 1970 00:00:00 UTC",document.cookie="user=;path=/;secure;domain="+domainCookie+";expires=Thu, 01 Jan 1970 00:00:00 UTC",location.reload()})});