var profile_url,map,lastOpenedInfoWindow,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,jsPDF=null,maps_api_key=document.getElementById("body-content").getAttribute("data-maps"),map_markers=[];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"),i=$(t).children().eq(e.from),a=$(t).children().eq(e.to);i.attr("aria-selected","false"),a.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,i=(100/e).toFixed(3),a=t+" .carousel-inner .carousel-item-right.active,             "+t+" .carousel-inner .carousel-item-next {                 transform: translateX("+i+"%);             }             "+t+" .carousel-inner .carousel-item-left.active,             "+t+" .carousel-inner .carousel-item-prev {                 transform: translateX(-"+i+"%);             }",n=document.createElement("style");n.innerHTML=a,document.body.appendChild(n)}})),$(".image-carousel-block").each((function(){const e=$(this).find(".indicators");e.length>0&&$(this).find(".carousel").on("slid.bs.carousel",(function(t){const i=e.children().eq(t.from),a=e.children().eq(t.to);i.removeClass("active"),a.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,i){e.forEach((function(e){if(e.isIntersecting){var i=e.target;i.src=i.dataset.src,i.classList.remove("lazy-carousel"),t.unobserve(i)}}))}));e.forEach((function(e){t.observe(e)}))}else e.forEach((function(e){e.src=e.dataset.src,e.classList.remove("lazy-carousel")}))}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 i=$(".testimonial-list .testimonial-clone").clone().removeClass("testimonial-clone d-none");i.attr("data-id",t.id),t.source?i.find(".review-img").attr("alt",formatReviewSourceLabel(t.source)+" Logo").attr("src",static_url+getReviewLogo(t.source)):i.find(".review-img").attr("alt","PracticeBeat Logo").attr("src",static_url+getReviewLogo("TREATSPACE"));var a="";a=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,i.find(".reviewer-name").text(a),i.find(".review-date").text(timeFormat(t.recommendationTimestamp,"testimonial")),i.find(".review-text").html(t.recommendationText),$(".testimonial-list").append(i)}})),next_testimonials_url||$(".testimonial-view-more").hide()}))}}function subscribe(e,t,i){var a=new XMLHttpRequest,n="/subscribe/"+i+"/"+t,o='{"email" : '+JSON.stringify(e)+"}";a.open("POST",n,!1),a.setRequestHeader("Content-type","application/json"),a.send(o),"200"==a.status?(data=JSON.parse(a.responseText),data.success?$("#subscribeModal").modal("show"):alert(data.error)):alert("An error has occured.")}function subscribeBlockSubscribe(){var e=$("#ContentBlockSubForm"),t=e.attr("data-id"),i=e.attr("data-type"),a=e.find("input[type='email']");if(a.removeClass("is-invalid"),a.prev(".input-group-prepend").removeClass("is-invalid"),!validateEmail(a.val()))return a.addClass("is-invalid"),void a.prev(".input-group-prepend").addClass("is-invalid");subscribe(a.val(),i,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,i=document.getElementById("subscribe-checkbox");i&&i.checked&&(t=!0)}var a=$(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 n={first_name:$(e).closest(".card-body").find("#custom-PatientFirstName").val(),last_name:$(e).closest(".card-body").find("#custom-PatientLastName").val(),fields:a,recaptcha_response:captcha_token,patient_form:$(e).closest(".patient-form-block").attr("data-id")};$("#custom-Email")&&(n.email=$("#custom-Email").val(),n.user_subscribed=t),$("#custom-dateField").length>0&&(n.date_of_birth=$("#custom-dateField").val()),$(".locations")&&(n.office=$(e).closest(".card-body").find("#location-select").val()),"true"==$(".patient-form-block").attr("data-esignature")?n.esignature=$("#signature-data-url").val():"false"==$(".patient-form-block").attr("data-esignature")&&(n.esignature="OPTOUT");var o=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:o,data:JSON.stringify(n),dataType:"json",processData:!1,contentType:"application/json",success:function(t){var i=document.getElementById("upload-input");if(null!=i&&i.files.length>0){const e=document.querySelector(".reupload-files");e&&"success"==t.status&&(e.dataset.responseToken=t.response_token),uploadFile(i,t)}else{var a=$(e).attr("data-url-redirect");a?window.location.href=a:$("#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=new jsPDF({unit:"in",lineHeight:1.2}),t=$(".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(),a="";for(i=0;i<t.length;i++){""!==t[i].name&&(a+=t[i].name+"\n");a+=(""===t[i].value?String(t[i].value):!0===t[i].value?"Yes":!1===t[i].value?"No":String(t[i].value))+"\n\n",(o=12*(n=e.setFontSize(12).splitTextToSize(a,7.5)).length*1.2/72)>10&&(e.text(n,.5,.5+12*1.2/72*2),e.addPage("a4","p"),a="")}var n=e.setFontSize(12).splitTextToSize(a,7.5);e.text(n,.5,.5+12*1.2/72*2);var o=12*n.length*1.2/72;"true"==$(".patient-form-block").attr("data-esignature")&&(e.text("\n\nSignature:\n\n\n\n",.5,o+12*1.2/72),e.addImage($("#signature-data-url").val(),"PNG",.5,o+12*1.2/72+12*1.2/72)),pdf_filename=$(".form-title").text()+".pdf",e.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");new IntersectionObserver((function(i,a){"boolean"==typeof i[0].isIntersecting?i[0].isIntersecting:i[0].intersectionRatio;i[0].isIntersecting&&(loadJS("https://maps.googleapis.com/maps/api/js?key="+e+"&callback=initSearchMap"),a.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=>{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){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(i,a){let n=$(a).attr("data-location").split("~"),o=parseFloat(n[0]),s=parseFloat(n[1]),r=n[2],l=n[3],c=$(a).attr("data-office-id"),d=$(a).attr("data-thumbnail"),u=$(a).attr("data-office-url");if(t.push({lat:o,lng:s,id:c}),null!=o){let t=new google.maps.Marker({position:{lat:o,lng:s},marker_name:r,marker_id:c,map:map,title:r}),a='<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;">'+r+'</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>',n=new google.maps.InfoWindow({content:a,maxWidth:300,minWidth:300,id:c});t.addListener("click",(function(){lastOpenedInfoWindow&&lastOpenedInfoWindow.close(),n.open(map,t),lastOpenedInfoWindow=n})),map_markers.push(t),info_windows.push(n),0==i&&(map.setCenter({lat:o,lng:s}),i===$(".list-group-item[data-location]").length-1&&(map.setZoom(e||16),n.open(map,t),lastOpenedInfoWindow=n))}}))}}function distance(e,t,i,a,n){if(e==i&&t==a)return 0;var o=Math.PI*e/180,s=Math.PI*i/180,r=t-a,l=Math.PI*r/180,c=Math.sin(o)*Math.sin(s)+Math.cos(o)*Math.cos(s)*Math.cos(l);return c>1&&(c=1),c=60*(c=180*(c=Math.acos(c))/Math.PI)*1.1515}function searchUserLocation(){let e,t,i=$("#user-address").val(),a=$(".location-search .list-group-item").attr("data-practice-url"),n=$("body").attr("captcha_token");if(""!=i){i=i.replace(/ /g,"+"),i=i.replace(/,/g,""),e=a+"/geocoding";let o={address:i,recaptcha_token:n};$.ajax({type:"POST",beforeSend:function(e,t){e.setRequestHeader("X-CSRFToken",csrf_token)},url:e,data:JSON.stringify(o),dataType:"json",contentType:"application/json",async:!1,success:function(e){if(null!==e.lat){let i={lng:e.lng,lat:e.lat};t=i}},error:function(){}})}else t="empty";return t}function initSearchMapValues(e,t){let i=[];for(let a=0;a<t.length;a++)distanceVal=distance(t[a].lat,t[a].lng,e.lat,e.lng),officeID=t[a].id,i.push({distanceVal:distanceVal.toFixed(1),officeID:officeID});i.sort((function(e,t){return parseFloat(e.distanceVal)-parseFloat(t.distanceVal)}));let a=$(".location-search .list-group-item"),n=$(".location-search #office-list-container"),o=[];if(null!=e){for(let e=0;e<a.length;e++){o.push($(`.list-group-item[data-office-id='${i[e].officeID}']`).wrap("<li></li>").parent());let t=$(`.list-group-item[data-office-id='${i[e].officeID}'] .office-distance`);t.removeClass("d-none"),t.html(i[e].distanceVal+" mi")}n.html(o),$(".list-group-item[data-location]").each((function(e,t){let a=$(t).attr("data-location").split("~"),n=parseFloat(a[0]),o=(parseFloat(a[1]),a[2]),s=a[3],r=$(t).attr("data-office-id"),l=$(t).attr("data-thumbnail"),c=$(t).attr("data-office-url");if(null!=n){let t='<div class="info-container"><div class="info-left"><img class="lazy img-fluid office-image-small" src="'+l+'"><div class="mt-2" style="text-align:center;font-weight:700;font-style:italic;">'+i[e].distanceVal+' mi</div></div><div class="info-right col"><div class="mb-1 mt-2" style="font-weight: 500; font-size: 1.1em;">'+o+'</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="'+c+'" target="_blank" rel="nofollow"> View Office </a></div></div></div>';info_windows.find(e=>e.id===r).setContent(t),0==e&&(lastOpenedInfoWindow&&lastOpenedInfoWindow.close(),google.maps.event.trigger(map_markers.find(e=>e.marker_id===r),"click"))}}))}}function handleLocationError(e,t,i){t.setPosition(i),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}$(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();a=a.replace(/(?:\r\n|\r|\n)/g,"<br>"),document.getElementById("provider-bio-text").innerHTML=a}}if($(".providers-scroll-block").length>0){const e=document.querySelector(".carousel-prov"),t=document.getElementsByClassName("provider-scroll-card");var n;function o(t){e.offsetWidth;const i=185*t;e.scrollLeft+=i}function s(i){return"right"==i?n==t.length-1?(r(n),e.scrollLeft=0,window.innerWidth<1199&&window.innerWidth>767.98&&(e.scrollLeft=185),l(n=0)):(r(n),l(n+=1)):"left"==i&&(0==n?(r(n),e.scrollLeft=function(){var e=$(".carousel-prov"),t=Math.floor(e.outerWidth()),i=e.get(0).scrollWidth-t;window.innerWidth<1199&&window.innerWidth>767.98&&(i-=185);return i}(),l(n=t.length-1),console.log("ProviderId = 0 and ul.scrollLeft = "+e.scrollLeft)):(r(n),l(n-=1))),n}function r(e){document.getElementById("provider_"+e).classList.remove("provider-scroll-highlight")}function l(e){document.getElementById("provider_"+e).classList.add("provider-scroll-highlight")}!function(){for(i=0;i<t.length;i++)t[i].setAttribute("id","provider_"+i)}(),function(){3==$(".scroll-card-container").length?window.innerWidth<768?n=0:window.innerWidth<1199?(n=1,e.scrollLeft=410):(n=1,e.scrollLeft=205):$(".scroll-card-container").length>3?window.innerWidth<768?n=0:window.innerWidth<1199?(n=1,e.scrollLeft=410):(n=2,e.scrollLeft=410):(window.innerWidth<1199&&window.innerWidth>767.98&&(e.scrollLeft=205),n=0);l(n)}(),window.setInterval((function(){o(1),s("right")}),e.dataset.delay),document.getElementById("right").addEventListener("click",(function(){o(1)})),document.getElementById("right").addEventListener("click",(function(){s("right")})),document.getElementById("left").addEventListener("click",(function(){o(-1)})),document.getElementById("left").addEventListener("click",(function(){s("left")}))}if($(".testimonial-review-row").length>0&&$(".testimonial-review-row .row .testimonial-card").each((function(e,t){var i=$(this).find(".review-text"),a=i.text();a=a.replace(/(?:\r\n|\r|\n)/g,"<br>"),i.html(a)})),$(".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"),i=$(t).children().eq(e.from),a=$(t).children().eq(e.to);i.attr("aria-selected","false"),a.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("~"),i=t[2],a=t[3],n=t[4],o=t[5];let s="No Phone Listed",r="",l="No Fax Listed";if("<br>"!==o&&""!==o){var c=o.split("<br>");c[0]&&(s=c[0]),c[1]&&(l=c[1])}if("null"!=n){var d=JSON.parse(n),u=JSON.parse(hours_descriptions);r=format_office_hours_string(d,u)}else r="No Hours Listed";show_location_info(i,a,r,s,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 e=$(".slider-container"),t=$(".slider-input"),i=$(".before-img-container"),a=$(".slider-before-img");let n=e.width();a.css("width",n+"px");for(let t=0;t<e.length;t++){new ResizeObserver(e=>{for(let i of e)document.getElementsByClassName("slider-before-img")[t].style.width=i.contentRect.width+"px"}).observe(document.getElementsByClassName("slider-container")[t])}t.on("input",(function(){i.css("width",$(this).val()+"%"),$(".slider-button").css("left","calc("+$(this).val()+"% - 15px")}))}google_maps_lazyload_search(maps_api_key);let c=$(".service-card-carousel .carousel .carousel-item").length;if(c>0){c>=3&&$(".service-card-carousel .carousel .carousel-item").each((function(){var e=$(this).next();e.length||(e=$(this).siblings(":first")),e.children(":first-child").clone().appendTo($(this));for(var t=0;t<3;t++)(e=e.next()).length||(e=$(this).siblings(":first")),e.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 i=e.originalEvent.touches[0].pageX;Math.floor(t-i)>5?$(this).carousel("next"):Math.floor(t-i)<-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 e=document.querySelector(".service-card-carousel .carousel-controls .carousel-indicators");null!=e&&(e=e.children[0],e.classList.add("active"))}if(document.querySelector(".service-panel-carousel")){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 d=$(".testimonial-cards-block .carousel .carousel-item").length;if(d>0&&(d>=3&&$(".testimonial-cards-block .carousel .carousel-item").each((function(){var e=$(this).next();e.length||(e=$(this).siblings(":first")),e.children(":first-child").clone().appendTo($(this));for(var t=0;t<3;t++)(e=e.next()).length||(e=$(this).siblings(":first")),e.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 i=e.originalEvent.touches[0].pageX;Math.floor(t-i)>5?$(this).carousel("next"):Math.floor(t-i)<-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 u=document.getElementById("testimonials-ul").querySelectorAll("li").length,m=100*u+"%";$("#testimonials-ul").css("width",m);var f=0;document.querySelector("#t-btn-left").addEventListener("click",()=>{if(f>0){var e="-"+100*--f+"%";$("#testimonials-ul").animate({left:e},500),h()}}),document.querySelector("#t-btn-right").addEventListener("click",()=>{if(f<u-1){var e="-"+100*++f+"%";$("#testimonials-ul").animate({left:e},500),h()}});var h=function(){0==f?($("#testimonials-l").css("opacity","0.3"),$("#testimonials-l").css("cursor","default")):f==u-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"))};h(),1==u&&$(".testimonials-control").css("display","none")}})),$(".image-carousel-block .carousel .carousel-item").each((function(){const e=this.parentElement.parentElement,t=parseInt(e.dataset.numImages);let i=$(this).next();for(let e=1;e<t;e++)i.length||(i=$(this).siblings(":first")),i.children(":first-child").clone().addClass("clone").appendTo($(this)),i=i.next()}));