var static_url=document.body.getAttribute("data-static"),media_url=document.body.getAttribute("data-media"),csrf_token=document.body.getAttribute("data-token"),next_testimonials_url=null,profile_url,jsPDF=null,maps_api_key=document.getElementById("body-content").getAttribute("data-maps"),map,map_markers=[],lastOpenedInfoWindow;let info_windows=[];function setupAccessibleHeroBanners(){$(".toggle-hero-carousel").on("click",(function(){const e=document.getElementById(this.dataset.target);"carousel"==e.dataset.ride?(this.innerText="Play Banner Carousel",e.dataset.ride="false",$(e).carousel("pause")):"false"==e.dataset.ride&&(this.innerText="Pause Banner Carousel",e.dataset.ride="carousel",$(e).carousel("play"))})),$(".hero-carousel").on("slid.bs.carousel",(function(e){const t=this.querySelector(".carousel-indicators"),a=$(t).children().eq(e.from),i=$(t).children().eq(e.to);a.attr("aria-selected","false"),i.attr("aria-selected","true")}))}function setupImageCarouselBlock(){$(".image-carousel-block .carousel").each((function(){const e=this.dataset.numImages;$(this).css("--images-per-slide",e);const t=window.navigator.userAgent;if(t.indexOf("MSIE ")>0||t.match(/Trident.*rv\:11\./)){const t=".image-carousel-"+this.dataset.blockId,a=(100/e).toFixed(3),i=t+" .carousel-inner .carousel-item-right.active,             "+t+" .carousel-inner .carousel-item-next {                 transform: translateX("+a+"%);             }             "+t+" .carousel-inner .carousel-item-left.active,             "+t+" .carousel-inner .carousel-item-prev {                 transform: translateX(-"+a+"%);             }",o=document.createElement("style");o.innerHTML=i,document.body.appendChild(o)}})),$(".image-carousel-block").each((function(){const e=$(this).find(".indicators");e.length>0&&$(this).find(".carousel").on("slid.bs.carousel",(function(t){const a=e.children().eq(t.from),i=e.children().eq(t.to);a.removeClass("active"),i.addClass("active")}))}));var e=[].slice.call(document.querySelectorAll(".image-carousel-block img.lazy-carousel"));if("IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype&&"isIntersecting"in window.IntersectionObserverEntry.prototype){var t=new IntersectionObserver((function(e,a){e.forEach((function(e){if(e.isIntersecting){var a=e.target;a.src=a.dataset.src,a.classList.remove("lazy-carousel"),t.unobserve(a)}}))}));e.forEach((function(e){t.observe(e)}))}else e.forEach((function(e){e.src=e.dataset.src,e.classList.remove("lazy-carousel")}))}function updateBlogCardSettings(){const e=document.querySelector(".blogs-card sl-carousel");if(!e)return;const t=window.matchMedia("(min-width: 992px)"),a=document.querySelectorAll(".card");function handleMediaQueryChange(t){let i=1;t.matches&&(i=a.length<3?a.length:3),e.setAttribute("slides-per-page",i)}handleMediaQueryChange(t),t.addListener(handleMediaQueryChange)}function populateTestimonials(){if($(".testimonial-block-three").length>0){var e=$(".testimonial-block-three").attr("data-id");next_testimonials_url||(next_testimonials_url=$(".provider-profile-page").length>0?"/ts/api/public_wrote_kudos/?order_by=-recommendationTimestamp&recommended="+e+"&showInTestimonialsBlock=true&offset=20&limit=20":$(".location-profile-header").length>0?"/ts/api/public_wrote_kudos/?order_by=-recommendationTimestamp&recommended_other__office="+e+"&showInTestimonialsBlock=true&offset=20&limit=20":"/ts/api/public_wrote_kudos/?order_by=-recommendationTimestamp&recommended_other__practice="+e+"&showInTestimonialsBlock=true&offset=20&limit=20"),$.getJSON(next_testimonials_url,(function(e){next_testimonials_url=e.meta.next,$.each(e.objects,(function(e,t){if(t.recommendationText){var a=$(".testimonial-list .testimonial-clone").clone().removeClass("testimonial-clone d-none");a.attr("data-id",t.id),t.source?a.find(".review-img").attr("alt",formatReviewSourceLabel(t.source)+" Logo").attr("src",static_url+getReviewLogo(t.source)):a.find(".review-img").attr("alt","PracticeBeat Logo").attr("src",static_url+getReviewLogo("TREATSPACE"));var i="";i=t.isAnonymous?"Anonymous":t.recommender||t.first_name?t.first_name:t.recommender_other.practice?t.recommender_other.practice.pracName:t.recommender_other.office.name,a.find(".reviewer-name").text(i),a.find(".review-date").text(timeFormat(t.recommendationTimestamp,"testimonial")),a.find(".review-text").html(t.recommendationText),$(".testimonial-list").append(a)}})),next_testimonials_url||$(".testimonial-view-more").hide()}))}}function subscribe(e,t,a){var i=new XMLHttpRequest,o="/subscribe/"+a+"/"+t,n='{"email" : '+JSON.stringify(e)+"}";i.open("POST",o,!1),i.setRequestHeader("Content-type","application/json"),i.send(n),"200"==i.status?(data=JSON.parse(i.responseText),data.success?$("#subscribeModal").modal("show"):alert(data.error)):alert("An error has occured.")}function subscribeBlockSubscribe(){var e=$("#ContentBlockSubForm"),t=e.attr("data-id"),a=e.attr("data-type"),i=e.find("input[type='email']");if(i.removeClass("is-invalid"),i.prev(".input-group-prepend").removeClass("is-invalid"),!validateEmail(i.val()))return i.addClass("is-invalid"),void i.prev(".input-group-prepend").addClass("is-invalid");subscribe(i.val(),a,t)}function optOutSubmit(){$(".patient-form-block").attr("data-esignature",!1),$(".download-container").addClass("d-none"),$("#esignatureOptOutModal").modal("hide"),submitForm($(".patient-form-block .submit-btn"))}function submitForm(e){if(!1!==validateInput(e)){if($(".patient-form-block .opt-out-btn").attr("disabled",!0),$(".patient-form-block .submit-btn").html('Submitting... <span class="fas fa-spinner fa-spin"></span>').attr("disabled",!0),$("#custom-Email")){var t=!1,a=document.getElementById("subscribe-checkbox");a&&a.checked&&(t=!0)}var i=$(e).closest(".card-body").find(".form-fields .form-group, .form-fields .styled-subheading, .form-fields .group-label-container").children(":not(label):not(.invalid-feedback)").map((function(){if($(this).hasClass("form-check"))return{name:$(this).children("input[type='checkbox']").siblings("label").first().text(),value:$(this).children("input[type='checkbox']").prop("checked")};if($(this).hasClass("radio-form-control"))return{name:$(this).siblings("legend").first().text().replace(/\*$/,""),value:$(this).find("input[type='radio']:checked").length>0?$(this).find("input[type='radio']:checked").val():""};if($(this).hasClass("form-subheading"))return{name:"subheading",value:$(this).text()};if($(this).hasClass("form-group-label"))return{name:"group-label",value:$(this).text()};if("date"===$(this).attr("type")){if($(this).val()){var e=new Date($(this).val()),t=new Intl.DateTimeFormat("en",{year:"numeric",month:"2-digit",day:"2-digit",timeZone:"UTC"}).format(e);return{name:$(this).siblings("label").first().text(),value:t}}return{name:$(this).siblings("label").first().text(),value:""}}return{name:$(this).siblings("label").first().text(),value:$(this).val()}})).get();captcha_token=document.body.getAttribute("captcha_token");var o={first_name:$(e).closest(".card-body").find("#custom-PatientFirstName").val(),last_name:$(e).closest(".card-body").find("#custom-PatientLastName").val(),fields:i,recaptcha_response:captcha_token,patient_form:$(e).closest(".patient-form-block").attr("data-id")};$("#custom-Email")&&(o.email=$("#custom-Email").val(),o.user_subscribed=t),$("#custom-dateField").length>0&&(o.date_of_birth=$("#custom-dateField").val()),$(".locations")&&(o.office=$(e).closest(".card-body").find("#location-select").val()),"true"==$(".patient-form-block").attr("data-esignature")?o.esignature=$("#signature-data-url").val():"false"==$(".patient-form-block").attr("data-esignature")&&(o.esignature="OPTOUT");var n=profile_url+"/form/"+$(e).closest(".patient-form-block").attr("id");return $.ajax({type:"POST",beforeSend:function(e,t){e.setRequestHeader("X-CSRFToken",csrf_token)},url:n,data:JSON.stringify(o),dataType:"json",processData:!1,contentType:"application/json",success:function(t){var a=document.getElementById("upload-input");if(null!=a&&a.files.length>0){const e=document.querySelector(".reupload-files");e&&"success"==t.status&&(e.dataset.responseToken=t.response_token),uploadFile(a,t)}else{var i=$(e).attr("data-url-redirect");i?window.location.href=i:$("#submitFormModal").modal({backdrop:"static",keyboard:!1})}},error:function(){$(".opt-out-button").attr("disabled",!1),$(".submit-btn").text("Submit").attr("disabled",!1),alert("Error submitting your form, please try again.")}})}}function downloadPDF(){var e=8.5,t=1.2,a=.5,o=7.5,n=12,r=72,s=.19999999999999998,l=new jsPDF({unit:"in",lineHeight:t}),c=$(".form-fields .form-group, .form-fields .styled-subheading, .form-fields .group-label-container").children(":not(label):not(.invalid-feedback)").map((function(){if($(this).hasClass("form-check"))return{name:$(this).children("input[type='checkbox']").siblings("label").first().text(),value:$(this).children("input[type='checkbox']").prop("checked")};if($(this).hasClass("radio-form-control"))return{name:$(this).siblings("legend").first().text().replace(/\*$/,""),value:$(this).find("input[type='radio']:checked").length>0?$(this).find("input[type='radio']:checked").val():""};if($(this).hasClass("form-subheading"))return{name:"",value:$(this).text()};if($(this).hasClass("form-group-label"))return{name:"",value:$(this).text()};if("date"===$(this).attr("type")){if($(this).val()){var e=new Date($(this).val()),t=new Intl.DateTimeFormat("en",{year:"numeric",month:"2-digit",day:"2-digit",timeZone:"UTC"}).format(e);return{name:$(this).siblings("label").first().text(),value:t}}return{name:$(this).siblings("label").first().text(),value:""}}return{name:$(this).siblings("label").first().text(),value:$(this).val()}})).get(),d="";for(i=0;i<c.length;i++){""!==c[i].name&&(d+=c[i].name+"\n");var u="",m,p;d+=(u=""===c[i].value?String(c[i].value):!0===c[i].value?"Yes":!1===c[i].value?"No":String(c[i].value))+"\n\n",(p=(m=l.setFontSize(n).splitTextToSize(d,o)).length*n*t/r)>10&&(l.text(m,a,.8999999999999999),l.addPage("a4","p"),d="")}var m=l.setFontSize(n).splitTextToSize(d,o);l.text(m,a,.8999999999999999);var p=m.length*n*t/r;"true"==$(".patient-form-block").attr("data-esignature")&&(l.text("\n\nSignature:\n\n\n\n",a,p+s),l.addImage($("#signature-data-url").val(),"PNG",a,p+s+s)),pdf_filename=$(".form-title").text()+".pdf",l.save(pdf_filename)}function validateInput(e){var t=!0;return $(e).closest(".card-body").find("#location-select")&&($(e).closest(".card-body").find("#location-select").removeClass("is-invalid"),""==$(e).closest(".card-body").find("#location-select").val()&&($(e).closest(".card-body").find("#location-select").addClass("is-invalid"),t=!1)),$(e).closest(".card-body").find(".form-fields .required").children(":not(label):not(.invalid-feedback):not(div)").map((function(){$(this).removeClass("is-invalid"),$(this).hasClass("form-check")?$(this).children("input[type='checkbox']").prop("checked")||($(this).addClass("is-invalid"),t=!1):""===$(this).val()&&($(this).addClass("is-invalid"),t=!1)})),$(e).closest(".card-body").find(".form-fields .form-group").find(".custom-required").parent().siblings(".form-control").map((function(){$(this).removeClass("is-invalid"),$(this).find("input[type='radio']:checked").val()||($(this).addClass("is-invalid"),t=!1)})),"true"==$(".patient-form-block").attr("data-esignature")&&($("#signature-canvas").removeClass("is-invalid"),""==$("#signature-data-url").val()&&($("#signature-canvas").addClass("is-invalid"),t=!1)),t||(document.querySelector(".is-invalid").scrollIntoView(),window.scrollBy(0,-205)),t}function google_maps_lazyload_search(e){if(document.getElementById("search-map")){var t=document.getElementById("search-map"),a;new IntersectionObserver((function(a,i){var o="boolean"==typeof a[0].isIntersecting?a[0].isIntersecting:a[0].intersectionRatio>0;a[0].isIntersecting&&(loadJS("https://maps.googleapis.com/maps/api/js?key="+e+"&callback=initSearchMap"),i.unobserve(t))})).observe(t)}}function initSearchMap(){if(document.getElementById("search-map")){let e=parseInt(document.getElementById("search-map").dataset.zoom),t=[];map=new google.maps.Map(document.getElementById("search-map"),{center:{lat:40.458833,lng:-79.924796},zoom:e||9}),getLocationButton=$("#current-location"),getSearchButton=$("#search-btn"),getLocationButton.on("click",(()=>{$(".location-search .overlay").removeClass("d-none");let e=new google.maps.InfoWindow;navigator.geolocation?navigator.geolocation.getCurrentPosition((e=>{const a=undefined;initSearchMapValues({lat:e.coords.latitude,lng:e.coords.longitude},t),$(".location-search .overlay").addClass("d-none")}),(()=>{handleLocationError(!0,e,map.getCenter())})):handleLocationError(!1,e,map.getCenter())})),$(".location-search .search-bar").keypress((function(e){let t;13==e.which&&getSearchButton.click()})),getSearchButton.on("click",(()=>{$(".location-search .overlay").removeClass("d-none");let e=searchUserLocation();null==e?alert("The address you’ve searched for was not found. Please check your spelling, try another address, or use only your zip code."):"empty"==e?alert("Please enter an address before trying to search."):initSearchMapValues(e,t),$(".location-search .overlay").addClass("d-none")})),$(".list-group-item[data-location]").each((function(a,i){let o=$(i).attr("data-location").split("~"),n=parseFloat(o[0]),r=parseFloat(o[1]),s=o[2],l=o[3],c=$(i).attr("data-office-id"),d=$(i).attr("data-thumbnail"),u=$(i).attr("data-office-url");if(t.push({lat:n,lng:r,id:c}),null!=n){let t=new google.maps.Marker({position:{lat:n,lng:r},marker_name:s,marker_id:c,map,title:s}),i='<div class="info-container"><div class="info-left"><img class="lazy img-fluid office-image-small" src="'+d+'"></div><div class="info-right col"><div class="mb-1 mt-2" style="font-weight: 500; font-size: 1.1em;">'+s+'</div><div class="mb-1">'+l+'</div><div class="info-buttons"><div class="col-lg-6 direction-btn"><a class="btn primary-color map-marker-btn" href="https://www.google.com/maps/dir/?api=1&destination='+l+'" target="_blank" rel="nofollow"> Directions</a></div><div class="col-lg-6 view-office-btn"><a class="btn secondary-color map-marker-btn" href="'+u+'" target="_blank" rel="nofollow"> View Office </a></div></div></div>',o=new google.maps.InfoWindow({content:i,maxWidth:300,minWidth:300,id:c});t.addListener("click",(function(){lastOpenedInfoWindow&&lastOpenedInfoWindow.close(),o.open(map,t),lastOpenedInfoWindow=o})),map_markers.push(t),info_windows.push(o),0==a&&(map.setCenter({lat:n,lng:r}),a===$(".list-group-item[data-location]").length-1&&(map.setZoom(e||16),o.open(map,t),lastOpenedInfoWindow=o))}}))}}function distance(e,t,a,i,o){if(e==a&&t==i)return 0;var n=Math.PI*e/180,r=Math.PI*a/180,s=t-i,l=Math.PI*s/180,c=Math.sin(n)*Math.sin(r)+Math.cos(n)*Math.cos(r)*Math.cos(l);return c>1&&(c=1),c=60*(c=180*(c=Math.acos(c))/Math.PI)*1.1515}function searchUserLocation(){let e=$("#user-address").val(),t=$(".location-search .list-group-item").attr("data-practice-url"),a=$("body").attr("captcha_token"),i,o;if(""!=e){e=e.replace(/ /g,"+"),e=e.replace(/,/g,""),i=t+"/geocoding";let n={address:e,recaptcha_token:a};$.ajax({type:"POST",beforeSend:function(e,t){e.setRequestHeader("X-CSRFToken",csrf_token)},url:i,data:JSON.stringify(n),dataType:"json",contentType:"application/json",async:!1,success:function(e){if(null!==e.lat){let t={lng:e.lng,lat:e.lat};o=t}},error:function(){}})}else o="empty";return o}function initSearchMapValues(e,t){let a=[];for(let i=0;i<t.length;i++)distanceVal=distance(t[i].lat,t[i].lng,e.lat,e.lng),officeID=t[i].id,a.push({distanceVal:distanceVal.toFixed(1),officeID});a.sort((function(e,t){return parseFloat(e.distanceVal)-parseFloat(t.distanceVal)}));let i=$(".location-search .list-group-item"),o=$(".location-search #office-list-container"),n=[];if(null!=e){for(let e=0;e<i.length;e++){n.push($(`.list-group-item[data-office-id='${a[e].officeID}']`).wrap("<li></li>").parent());let t=$(`.list-group-item[data-office-id='${a[e].officeID}'] .office-distance`);t.removeClass("d-none"),t.html(`${a[e].distanceVal} mi`)}o.html(n),$(".list-group-item[data-location]").each((function(e,t){let i=$(t).attr("data-location").split("~"),o=parseFloat(i[0]),n=parseFloat(i[1]),r=i[2],s=i[3],l=$(t).attr("data-office-id"),c=$(t).attr("data-thumbnail"),d=$(t).attr("data-office-url");if(null!=o){let t='<div class="info-container"><div class="info-left"><img class="lazy img-fluid office-image-small" src="'+c+'"><div class="mt-2" style="text-align:center;font-weight:700;font-style:italic;">'+a[e].distanceVal+' mi</div></div><div class="info-right col"><div class="mb-1 mt-2" style="font-weight: 500; font-size: 1.1em;">'+r+'</div><div class="mb-1">'+s+'</div><div class="info-buttons"><div class="col-lg-6 direction-btn"><a class="btn primary-color map-marker-btn" href="https://www.google.com/maps/dir/?api=1&destination='+s+'" target="_blank" rel="nofollow"> Directions</a></div><div class="col-lg-6 view-office-btn"><a class="btn secondary-color map-marker-btn" href="'+d+'" target="_blank" rel="nofollow"> View Office </a></div></div></div>';info_windows.find((e=>e.id===l)).setContent(t),0==e&&(lastOpenedInfoWindow&&lastOpenedInfoWindow.close(),google.maps.event.trigger(map_markers.find((e=>e.marker_id===l)),"click"))}}))}}function handleLocationError(e,t,a){t.setPosition(a),t.setContent(e?"Error: The Geolocation service failed.":"Error: Your browser doesn't support geolocation."),t.open(map),$(".location-search .overlay").addClass("d-none"),lastOpenedInfoWindow=t}function google_maps_lazyload_3(e){if(document.getElementById("map3")){const t=document.getElementById("map3"),a=undefined;new IntersectionObserver(((a,i)=>{const o=undefined;if(a[0].isIntersecting??a[0].intersectionRatio>0){if(window.google&&window.google.maps)initMapThree();else if(!document.querySelector('script[src*="maps.googleapis.com/maps/api/js"]')){const t=document.createElement("script");t.src=`https://maps.googleapis.com/maps/api/js?key=${e}&callback=initMapThree`,t.async=!0,t.defer=!0,document.body.appendChild(t)}i.unobserve(t)}})).observe(t)}}function initMapThree(){const e=document.getElementById("map3");if(e){const t=parseInt(e.dataset.zoom)||9;map=new google.maps.Map(e,{center:{lat:40.458833,lng:-79.924796},zoom:t}),$(".list-group-location[data-location]").each((function(e,a){const[i,o,n,r]=$(a).attr("data-location").split("~"),s=parseFloat(i),l=parseFloat(o);if(!s||!l)return;const c=$(a).attr("data-practice-url"),d=$(a).attr("data-appointment-url"),u=$(a).attr("data-external-url"),m=new google.maps.Marker({position:{lat:s,lng:l},map,title:n});let p=`\n\t\t\t\t<div class="mb-1 mt-2" style="font-weight: 500; font-size: 1.1em;">${n}</div>\n\t\t\t\t<div class="mb-2">${r}</div>\n\t\t\t\t<a class="btn tertiary-color map-marker-btn mb-2 direction-btn" href="https://www.google.com/maps/dir/?api=1&destination=${encodeURIComponent(r)}" target="_blank" rel="nofollow">DIRECTIONS</a>\n\t\t\t`;d&&(p+=`<a class="btn primary-color map-marker-btn mb-2 app-btn" href="${d}" ${u?'target="_blank"':""} rel="nofollow">REQUEST APPOINTMENT</a>`);const f=new google.maps.InfoWindow({content:p,maxWidth:240});m.addListener("click",(function(){lastOpenedInfoWindow&&lastOpenedInfoWindow.close(),f.open(map,m),lastOpenedInfoWindow=f})),map_markers.push(m),0===e&&map.setCenter({lat:s,lng:l}),0===e&&1===$(".list-group-location[data-location]").length&&(map.setZoom(t),f.open(map,m),lastOpenedInfoWindow=f)}))}}function google_maps_lazyload_4(e){if(document.getElementById("map4")){const t=document.getElementById("map4"),a=undefined;new IntersectionObserver(((a,i)=>{const o=undefined;if(a[0].isIntersecting??a[0].intersectionRatio>0){if(window.google&&window.google.maps)initMapFour();else if(!document.querySelector('script[src*="maps.googleapis.com/maps/api/js"]')){const t=document.createElement("script");t.src=`https://maps.googleapis.com/maps/api/js?key=${e}&callback=initMapFour`,t.async=!0,t.defer=!0,document.body.appendChild(t)}i.unobserve(t)}})).observe(t)}}function initMapFour(){const e=document.getElementById("map4");if(e){const t=document.getElementById("custom-info-window"),a=parseInt(e.dataset.zoom)||9;map=new google.maps.Map(e,{center:{lat:40.458833,lng:-79.924796},zoom:a,mapTypeControl:!1});let i=!1;$(".list-group-location[data-location]").each((function(e,a){const[o,n,r,s,l]=$(a).attr("data-location").split("~"),c=parseFloat(o),d=parseFloat(n),u=$(a).data("hours"),m=document.getElementById("custom-info-body");if(!c||!d)return;const p=$(a).attr("data-appointment-url"),f=$(a).attr("data-external-url"),h=new google.maps.Marker({position:{lat:c,lng:d},map,title:r});let g=`\n\t\t\t\t<div class="mb-2 h3">${r}</div>\n\t\t\t\t<div class="mb-2">${s}</div>\n                <hr class="info-window-line primary-color ml-0">\n                 <div class="col-12 p-0 pb-2 pr-1" id="float-hours-${e}">${u}</div>\n\t\t\t`;(p||l)&&(g+='<div class="d-flex mt-2 justify-content-between">',p&&(g+=`<a class="btn primary-color map-marker-btn app-btn mr-2" href="${p}" ${f?'target="_blank"':""} rel="nofollow">APPOINTMENTS</a>`),l&&(g+=`<a class="btn primary-color-alt map-marker-btn call-btn" href="tel:${l}" rel="nofollow">${l}</a>`),g+="</div>"),h.addListener("click",(function(){map.panTo({lat:c,lng:d}),m.innerHTML=g,t.style.display="block"})),i||0!==e||(map.panTo({lat:c,lng:d}),m.innerHTML=g,t.style.display="block",i=!0)})),map.addListener("click",(()=>{t.style.display="none"}))}}function jumpToLocation(e,t,a){for(var i in map.panTo({lat:parseFloat(e),lng:parseFloat(t)}),map_markers)if(map_markers[i].marker_name==a){var o=map_markers[i];google.maps.event.trigger(o,"click")}}$(document).ready((function(){if($("#provider-bio-text").length>0){var e=document.getElementById("provider-bio-text").innerHTML,t=(new DOMParser).parseFromString(e,"text/html");if(!Array.prototype.slice.call(t.body.childNodes).some((function(e){return 1===e.nodeType}))){var a=$("#provider-bio-text").text(),o;a=a.replace(/(?:\r\n|\r|\n)/g,"<br>"),document.getElementById("provider-bio-text").innerHTML=a}}if($(".providers-scroll-block").length>0){const p=document.querySelector(".carousel-prov"),f=document.getElementsByClassName("provider-scroll-card");var n;function loadProviderIds(){for(i=0;i<f.length;i++)f[i].setAttribute("id","provider_"+i)}function setInitialHighlight(){3==$(".scroll-card-container").length?window.innerWidth<768?n=0:window.innerWidth<1199?(n=1,p.scrollLeft=410):(n=1,p.scrollLeft=205):$(".scroll-card-container").length>3?window.innerWidth<768?n=0:window.innerWidth<1199?(n=1,p.scrollLeft=410):(n=2,p.scrollLeft=410):(window.innerWidth<1199&&window.innerWidth>767.98&&(p.scrollLeft=205),n=0),highlightProvider(n)}function scrollProvider(e){const t=p.offsetWidth,a=185*e;p.scrollLeft+=a}function scrollProviderId(e){return"right"==e?n==f.length-1?(removeHighlight(n),p.scrollLeft=0,window.innerWidth<1199&&window.innerWidth>767.98&&(p.scrollLeft=185),highlightProvider(n=0)):(removeHighlight(n),highlightProvider(n+=1)):"left"==e&&(0==n?(removeHighlight(n),p.scrollLeft=getScrollEnd(),highlightProvider(n=f.length-1),console.log("ProviderId = 0 and ul.scrollLeft = "+p.scrollLeft)):(removeHighlight(n),highlightProvider(n-=1))),n}function removeHighlight(e){document.getElementById("provider_"+e).classList.remove("provider-scroll-highlight")}function highlightProvider(e){document.getElementById("provider_"+e).classList.add("provider-scroll-highlight")}function getScrollEnd(){var e=$(".carousel-prov"),t=Math.floor(e.outerWidth()),a,i=e.get(0).scrollWidth-t;return window.innerWidth<1199&&window.innerWidth>767.98&&(i-=185),i}loadProviderIds(),setInitialHighlight(),window.setInterval((function(){scrollProvider(1),scrollProviderId("right")}),p.dataset.delay),document.getElementById("right").addEventListener("click",(function(){scrollProvider(1)})),document.getElementById("right").addEventListener("click",(function(){scrollProviderId("right")})),document.getElementById("left").addEventListener("click",(function(){scrollProvider(-1)})),document.getElementById("left").addEventListener("click",(function(){scrollProviderId("left")}))}if($(".testimonial-review-row").length>0&&$(".testimonial-review-row .row .testimonial-card").each((function(e,t){var a=$(this).find(".review-text"),i=a.text();i=i.replace(/(?:\r\n|\r|\n)/g,"<br>"),a.html(i)})),$(".specialties-block").length>0&&($(".specialties-container #accordion").on("show.bs.collapse",(function(e){$(e.target).closest(".specialty-container").find(".fa-caret-down").toggleClass("rotate")})),$(".specialties-container #accordion").on("hide.bs.collapse",(function(e){$(e.target).closest(".specialty-container").find(".fa-caret-down").toggleClass("rotate")}))),$(".testimonial-block-three").length>0&&$(".testimonial-view-more").click((function(){populateTestimonials()})),Array.prototype.slice.call(document.querySelectorAll(".read-more-block .read-more-expand")).forEach((function(e){e.addEventListener("click",(function(e){e.currentTarget.classList.add("d-none"),e.currentTarget.parentElement.querySelector(".additional-text").classList.remove("d-none")}))})),setupImageCarouselBlock(),setupAccessibleHeroBanners(),$("#carouselExampleIndicators").on("slid.bs.carousel",(function(e){const t=this.querySelector(".carousel-indicators"),a=$(t).children().eq(e.from),i=$(t).children().eq(e.to);a.attr("aria-selected","false"),i.attr("aria-selected","true")})),$(".toggle-custom-carousel").on("click",(function(){const e=document.getElementById(this.dataset.target);"carousel"==e.dataset.ride?(this.innerText="Play Carousel",e.dataset.ride="false",$(e).carousel("pause")):"false"==e.dataset.ride&&(this.innerText="Pause Carousel",e.dataset.ride="carousel",$(e).carousel("play"))})),$(".location-block-two .controls li").on("click",(function(){const e=document.getElementById(this.dataset.location);$(this).siblings('[aria-selected="true"]').attr("aria-selected","false"),$(this).attr("aria-selected","true");const t=e.dataset.location.split("~"),a=t[2],i=t[3],o=t[4],n=t[5];let r="No Phone Listed",s="",l="No Fax Listed";if("<br>"!==n&&""!==n){var c=n.split("<br>");c[0]&&(r=c[0]),c[1]&&(l=c[1])}if("null"!=o){var d=JSON.parse(o),u=JSON.parse(hours_descriptions);s=format_office_hours_string(d,u)}else s="No Hours Listed";show_location_info(a,i,s,r,l)})),$(".patient-form-block").length>0&&(profile_url=document.querySelector(".patient-form-block").getAttribute("data-prac-url"),window.jspdf&&(jsPDF=window.jspdf.jsPDF)),$(".image-preview-block").length>0){const h=$(".slider-container"),g=$(".slider-input"),v=$(".before-img-container"),b=$(".slider-before-img");let y=h.width();b.css("width",y+"px");for(let w=0;w<h.length;w++){const k=undefined;new ResizeObserver((e=>{for(let t of e)document.getElementsByClassName("slider-before-img")[w].style.width=t.contentRect.width+"px"})).observe(document.getElementsByClassName("slider-container")[w])}g.on("input",(function(){v.css("width",$(this).val()+"%"),$(".slider-button").css("left","calc("+$(this).val()+"% - 15px")}))}google_maps_lazyload_search(maps_api_key),google_maps_lazyload_3(maps_api_key),google_maps_lazyload_4(maps_api_key);let r,s=$(".service-card-carousel .carousel .carousel-item").length;if(s>0){let _;s>=3&&$(".service-card-carousel .carousel .carousel-item").each((function(){var e=3,t=$(this).next();t.length||(t=$(this).siblings(":first")),t.children(":first-child").clone().appendTo($(this));for(var a=0;a<3;a++)(t=t.next()).length||(t=$(this).siblings(":first")),t.children(":first-child").clone().appendTo($(this))})),$(".service-card-carousel .carousel").on("touchstart",(function(e){const t=e.originalEvent.touches[0].pageX;$(this).one("touchmove",(function(e){const a=e.originalEvent.touches[0].pageX,i=5;Math.floor(t-a)>5?$(this).carousel("next"):Math.floor(t-a)<-5&&$(this).carousel("prev")})),$(this).on("touchend",(function(){$(this).off("touchmove")}))})),document.querySelector(".service-card-carousel .carousel .carousel-inner").children[0].classList.add("active");let I=document.querySelector(".service-card-carousel .carousel-controls .carousel-indicators");null!=I&&(I=I.children[0],I.classList.add("active"))}if(document.querySelector(".service-panel-carousel")){let x,E;document.querySelector(".service-panel-carousel .service-tabs-container .nav").children[0].querySelector(".nav-link").classList.add("active"),document.querySelector(".service-panel-carousel .service-details-container .tab-content").children[0].classList.add("active","show")}let l,c=$(".testimonial-cards-block .carousel .carousel-item").length;if(c>0&&(c>=3&&$(".testimonial-cards-block .carousel .carousel-item").each((function(){var e=3,t=$(this).next();t.length||(t=$(this).siblings(":first")),t.children(":first-child").clone().appendTo($(this));for(var a=0;a<3;a++)(t=t.next()).length||(t=$(this).siblings(":first")),t.children(":first-child").clone().appendTo($(this))})),$(".testimonial-cards-block .carousel").on("touchstart",(function(e){const t=e.originalEvent.touches[0].pageX;$(this).one("touchmove",(function(e){const a=e.originalEvent.touches[0].pageX,i=5;Math.floor(t-a)>5?$(this).carousel("next"):Math.floor(t-a)<-5&&$(this).carousel("prev")})),$(this).on("touchend",(function(){$(this).off("touchmove")}))}))),$(".provider-bio-block-custom-tabs").find("#bio-tab .nav-item:first").addClass("active"),$(".provider-bio-block-custom-tabs").find("#bio-tab-content .tab-pane:first").addClass("show active"),$("#testimonials-ul").length>0){var d=document.getElementById("testimonials-ul").querySelectorAll("li").length,u=100*d+"%";$("#testimonials-ul").css("width",u);var m=0;document.querySelector("#t-btn-left").addEventListener("click",(()=>{if(m>0){var e="-"+100*--m+"%";$("#testimonials-ul").animate({left:e},500),greyButton()}})),document.querySelector("#t-btn-right").addEventListener("click",(()=>{if(m<d-1){var e="-"+100*++m+"%";$("#testimonials-ul").animate({left:e},500),greyButton()}}));var greyButton=function(){0==m?($("#testimonials-l").css("opacity","0.3"),$("#testimonials-l").css("cursor","default")):m==d-1?($("#testimonials-r").css("opacity","0.3"),$("#testimonials-r").css("cursor","default")):($("#testimonials-r").css("opacity","1"),$("#testimonials-r").css("cursor","pointer"),$("#testimonials-l").css("opacity","1"),$("#testimonials-l").css("cursor","pointer"))};greyButton(),1==d&&$(".testimonials-control").css("display","none")}})),$(".image-carousel-block .carousel .carousel-item").each((function(){const e=this.parentElement.parentElement,t=parseInt(e.dataset.numImages);let a=$(this).next();for(let e=1;e<t;e++)a.length||(a=$(this).siblings(":first")),a.children(":first-child").clone().addClass("clone").appendTo($(this)),a=a.next()})),updateBlogCardSettings();