${location.address.city}, ${location.address.region ?? 'TX'} ${location.address.postalCode}`; const distanceContent = location.distance ? `${location.distance} miles` : ''; if (address) { address.innerHTML = addressContent; } if (seeOnMap) { seeOnMap.ariaLabel = location.address.full; } if (distance) { distance.innerText = distanceContent; } if(mapDistances) { mapDistances.forEach((div) => { div.innerText = distanceContent; }) } if (fax) { if (location.Fax) { fax.innerHTML = location.Fax; fax.parentElement.classList.remove('hidden'); } else { fax.parentElement.classList.add('hidden'); } } if (locationsInfo.length) { locationsInfo.forEach(loc => { if (loc.id !== location.id) { loc.classList.add('hidden'); } else { loc.classList.remove('hidden'); } }) } if (locationLink) { if (location.Url?.length > 0) { locationLink.href = location.Url; locationLink.classList.remove('hidden'); } else { locationLink.classList.add('hidden'); } } if (/^http/i.test(location.Url)) { locationLink.setAttribute('target', '_blank'); locationLink.setAttribute('rel', 'noopener noreferrer'); } else { locationLink.setAttribute('target', ''); locationLink.setAttribute('rel', ''); } if (phoneLink) { if (location.Phone) { phoneLink.innerHTML = location.Phone; phoneLink.href = 'tel:' + location.Phone; phoneLink.parentElement.classList.remove('hidden'); } else { phoneLink.parentElement.classList.add('hidden'); } } if (directions) { directions.href = "https://maps.google.com/maps/dir//" + location.address.googleAddress; } if (primaryTimeslots) { primaryTimeslots.setAttribute('location', location.address.apiString); primaryTimeslots.setAttribute('location-id', location.id); primaryTimeslots.setAttribute('phone', location.Phone); primaryTimeslotsParent.style.minHeight = primaryTimeslots.offsetHeight.toString() + 'px'; primaryTimeslots.outerHTML = primaryTimeslots.outerHTML; setTimeout(() => { primaryTimeslotsParent.style.minHeight = "auto"; }, 200); } } async function updateSimilarProvider(location) { const similarProvEl = document.querySelector('#provsWrapper'); const dropdownEl = document.querySelector('.selector-dropdown'); let provider = ''; if (dropdownEl) { provider = dropdownEl.dataset.provider; }; try { if (similarProvEl) { similarProvEl.innerHTML = `
${provider.ProviderTitle}
No similar providers at this location were found.
`; console.error('Error building similar provider: ', err); } }