function onShadowReady(e,t,o){const n=e.querySelector(t);if(n)return o(n);const i=new MutationObserver(()=>{const n=e.querySelector(t);n&&(i.disconnect(),o(n))});i.observe(e,{childList:!0,subtree:!0})}function jarvisGoBack(){window.$shedulerShadowRoot&&onShadowReady(window.$shedulerShadowRoot,"#app > div.flex.flex-col.flex-grow.mt-6 > form > div.z-50.flex-grow.py-6.mt-6.bg-color.shadow-2xl > div > div > div a",e=>{console.log("Back button clicked by script:",e),e.click()})}function isIOS(){return/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream}function validateUSPhoneNumber(e){if(!e)return{valid:!1,message:"Phone number is required."};let t=e.replace(/\D/g,"");if(11===t.length&&t.startsWith("1")&&(t=t.slice(1)),10!==t.length)return{valid:!1,message:"Please enter a valid 10-digit US phone number."};const o=t.slice(0,3),n=t.slice(3,6);return/^[2-9]/.test(o)?/^[2-9]/.test(n)?/^[2-9]11$/.test(n)?{valid:!1,message:"Invalid exchange code"}:/^(\d)\1{9}$/.test(t)?{valid:!1,message:"Invalid phone number"}:{valid:!0,message:"",normalized:t,formatted:`(${o}) ${n}-${t.slice(6)}`}:{valid:!1,message:"Invalid phone number format"}:{valid:!1,message:"Invalid area code."}}function showPhoneError(e){const t=window.$shedulerShadowRoot;if(!t)return;const o=t.querySelector("#mobile_phone input");if(!o)return;o.style.borderColor="red",o.style.borderWidth="2px";let n=o.parentElement.querySelector(".phone-error-msg");n&&n.remove();const i=document.createElement("div");i.className="phone-error-msg",i.textContent=e,i.style.color="#d32f2f",i.style.fontSize="12px",i.style.marginTop="4px",i.style.fontFamily="inherit",o.parentElement.appendChild(i),o.addEventListener("input",()=>{o.style.borderColor="",i.remove()},{once:!0})}var load_jarvis=()=>{function e(){const e=window.location.href,t=new URL(e),o=new URLSearchParams(t.search).get("comment");return o?decodeURIComponent(o):null}var t=window.jarvisConfig.officeId,o=document.getElementById("booking-form");if(""===t||null==t){o.style.display="block",document.getElementById("loading-spinner-tmp").style.display="none"}else{o.style.display="none";try{var n,i,r,a;const p=XMLHttpRequest.prototype.send,m=XMLHttpRequest.prototype.open;function l(e){if(e){i=e.first_name||i||"",r=e.last_name||r||"",a=e.email||document.getElementById("Booking-Email")?.value||a||"",n=e.mobile_phone||n||"";try{let t=e.start_time||e.appointment_date||"";if(!t){const o=JSON.stringify(e).match(/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/);o&&(t=o[0])}if(t){const e=new Date(t);if(!isNaN(e.getTime())){window.jarvisBookingCache.date=e.toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"}),window.jarvisBookingCache.day=e.toLocaleDateString("en-US",{weekday:"long"});const o=t.match(/T(\d{2}):(\d{2})/);if(!o||t.includes("Z")||t.match(/[+-]\d{2}:\d{2}$/))window.jarvisBookingCache.time=e.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit"});else{let e=parseInt(o[1],10);const t=e>=12?"PM":"AM";e=e%12||12,window.jarvisBookingCache.time=`${e}:${o[2]} ${t}`}}}}catch(e){}if(n){const e=new URL(window.location.href);"1"!==e.searchParams.get("confirmation")&&(e.searchParams.delete("comment"),e.searchParams.delete("variant"),e.searchParams.set("confirmation","1"),window.history.pushState({},"",e.toString()))}}}XMLHttpRequest.prototype.open=function(e,t,o,n,i){return this._url=t,m.apply(this,arguments)},window.jarvisBookingCache={date:"",day:"",time:"",location:""},XMLHttpRequest.prototype.send=function(e){if(this._url&&"string"==typeof this._url&&this._url.includes("schedule.jarvisanalytics.com/graphql"))try{if(e&&"string"==typeof e){const t=JSON.parse(e);if(t&&t.query){const e=t.variables?.input;l(e)}}}catch(e){console.log("Error parsing XHR body:",e)}return p.apply(this,arguments)},window.fetch=new Proxy(window.fetch,{apply:async function(e,t,o){const[n,i={}]=o;if("https://schedule.jarvisanalytics.com/graphql"==n&&i.body)try{const e=JSON.parse(i.body),t=e.variables?.input;l(t)}catch(e){console.log("Error parsing fetch body:",e)}return await e.apply(t,o)}});const h=window.$shedulerShadowRoot;var s=isThreeStepForm||!1,d=!1;window.jarvis=new window.JarvisAnalyticsScheduler({token:"46138|hKPVSp7yX5m83JP4qdrNFI82ui91fp4yvJteVf3e",companyId:3,locationId:window.jarvisConfig.officeId});const u=t=>{window.scrollTo(0,0),(window.dataLayer||[]).push(t);try{parent.postMessage(t,"*"),setTimeout(()=>{console.log("Attempting to prefill comment");const t=e();if(t&&h){console.log("Comment:",t);const e=h.querySelector("textarea");e&&(e.value=`Offer: ${t}`)}var o=document.querySelector("jarvis-scheduler-v2").shadowRoot.querySelector("#email");o&&(console.log("Email input found"),o.addEventListener("blur",function(){document.getElementById("Booking-Email").value=o.value;var e=new Event("change");document.getElementById("Booking-Email").dispatchEvent(e)}))},1e3)}catch(e){window.console&&window.console.log(e)}};async function c(){try{const n=document.querySelector("#jarvis-location");let i=document.querySelector("jarvis-scheduler-v2");window.$shedulerShadowRoot=i.shadowRoot,window.$shedulerShadowRoot.addEventListener("click",e=>{const t=e.target.closest("label");if(t&&t.getAttribute("for")&&t.getAttribute("for").startsWith("time-")){const e=t.getAttribute("aria-label");if(e&&e.includes(" on ")){const t=e.split(" on "),o=t[0].trim().replace(/(am|pm)/i," $1").toUpperCase().replace(" "," ");o&&(window.jarvisBookingCache.time=o);const n=new Date(t[1].trim());isNaN(n.getTime())||(window.jarvisBookingCache.date=n.toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"}),window.jarvisBookingCache.day=n.toLocaleDateString("en-US",{weekday:"long"}))}}const o=e.target.closest(".availability-card, [data-operatory]");if(o)if("li"===o.tagName.toLowerCase()){const e=o.textContent.trim();e&&(window.jarvisBookingCache.time=e.replace(/(am|pm)/i," $1").toUpperCase().replace(" "," "));const t=o.closest(".carousel-cell");if(t){const e=t.querySelector("span.table-pagination")||t.querySelector(".date-header");if(e){let t=e.textContent.trim();/\d{4}/.test(t)||(t+=", "+(new Date).getFullYear());const o=new Date(t);isNaN(o.getTime())||(window.jarvisBookingCache.date=o.toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"}),window.jarvisBookingCache.day=o.toLocaleDateString("en-US",{weekday:"long"}))}}}else{const e=o.textContent||"",t=e.match(/(\d{1,2}:\d{2}\s*(?:AM|PM))/i);if(t&&e.match(/monday|tuesday|wednesday|thursday|friday|saturday|sunday/i)){window.jarvisBookingCache.time=t[1].trim().toUpperCase();const o=e.match(/(?:january|february|march|april|may|june|july|august|september|october|november|december)\s+\d{1,2}/i);if(o){const e=new Date(o[0]+", "+(new Date).getFullYear());isNaN(e.getTime())||(window.jarvisBookingCache.date=e.toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"}),window.jarvisBookingCache.day=e.toLocaleDateString("en-US",{weekday:"long"}))}}}},!0);const r=window.$shedulerShadowRoot.querySelector("#app");r&&(r.style.position="relative");const a=window.$shedulerShadowRoot.querySelector("button");a&&(a.style.display="none"),n.insertAdjacentElement("afterend",i);const l=await fetch("https://cdn.prod.website-files.com/66a29d804d1aff27a2f2ea9e/69b85fbacf49bd5d095e311a_16-03_jarvis-styles.txt"),c=await l.text(),p=document.createElement("style");p.textContent="",p.textContent+=c,p.textContent+="#app.first-visit>div.flex.flex-col.flex-grow.mt-6>form>div.container.pt-6.mx-auto.sm\\:p-6.flex-grow>div>div>div:nth-child(3)>div>div>div>div:nth-child(2)>div>div:nth-child(2){display:none}",p.textContent+='#app.first-visit>div.flex.flex-col.flex-grow.mt-6>form>div.container.pt-6.mx-auto.sm\\:p-6.flex-grow>div>div>div:nth-child(3)>div>div>div>div:nth-child(2)>div>div.relative.flex.items-center.justify-center.pb-2.mb-4.border-b.border-gray-300.cursor-pointer.select-none>svg path{d:path("M20 12H4")}',p.textContent+='\n @media screen and (max-width : 640px) {\n div:has(> fieldset > div > label > input#true-insurance){\n display: flex;\n flex-direction: column;\n }\n }\n div:has(> div > h3) > div > div:has(> div > div > div[data-location-id]) {\n grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)) !important;\n }\n .button-color {\n color: unset !important;\n }\n div:has(> label > input[type="radio"]){\n display:flex;\n }\n @media (min-width: 1280px) {\n .xl:grid-cols-5 {\n grid-template-columns: repeat(3, minmax(0, 1fr));\n }\n }\n @media (min-width: 1024px) and (max-width: 1280px) {\n #app>div.flex.flex-col.flex-grow.mt-6>form>div.z-50.flex-grow.py-6.mt-6.bg-color>div>div>button{\n max-width : none;\n }\n .rounded:not(#app > div.flex.flex-col.flex-grow.mt-6 > form > div.z-50.flex-grow.py-6.mt-6.bg-color > div > div > button){\n max-width : none;\n }\n }\n @media all and ( 1024px > width > 991px){\n #app > div.flex.flex-col.flex-grow.mt-6 > form > div.z-50.flex-grow.py-6.mt-6.bg-color.shadow-2xl.md\\:sticky.md\\:bottom-0.md\\:mt-24 > div > div{\n display:flex;\n }\n }\n @media all and (991px > width > 767px){\n #app > div.flex.flex-col.flex-grow.mt-6 > form > div.z-50.flex-grow.py-6.mt-6.bg-color.shadow-2xl.md\\:sticky.md\\:bottom-0.md\\:mt-24 > div > div{\n display : grid;\n }\n }\n @media all and (min-width : 767px ){\n #app > div.flex.flex-col.flex-grow.mt-6 > form > div.z-50.flex-grow.py-6.mt-6.bg-color.shadow-2xl.md\\:sticky.md\\:bottom-0.md\\:mt-24 > div > div{\n grid-template-columns: repeat(3, minmax(0, 1fr));\n }\n }\n #app>div.flex.flex-col.flex-grow.mt-6>div.flex.flex-col.flex-grow>div:has(>svg + p ){\n flex-direction: column;\n }\n #app>div.flex.flex-col.flex-grow.mt-6>form>div.container.pt-6.mx-auto>div>div>div:nth-child(3)>div>div>div>div:nth-child(2)>div>div.relative.flex.items-center.justify-center.pb-2.mb-4.border-b.border-gray-300.cursor-pointer.select-none:has(h3 + svg){\n margin-top : -15px;\n }\n @media all and (min-width : 991px){\n \t#app>div.flex.flex-col.flex-grow.mt-6>form h3,\n #app>div.flex.flex-col.flex-grow.mt-6>form>div.container>div>div>div:nth-child(1)>div>fieldset:nth-child(2)>legend{\n font-size : 18px;\n }}\n #app>div.flex.flex-col.flex-grow.mt-6>div.flex.flex-col.flex-grow>div>div>div>svg{\n transform: translateX(-22px) !important;\n }\n #app>div.flex.flex-col.flex-grow.mt-6>div.flex.flex-col.flex-grow>div>div>div>p.phone-number.text-lg.md\\:text-2xl::before {\n content: "";\n display: inline-block;\n width: 28px;\n height: 30px;\n background: url(https://uploads-ssl.webflow.com/663a58dfb423eff3639562f6/6696de4b113ee3fa34570e3b_phone-icon.svg) no-repeat left 40%;\n background-size: 20px;\n transform: translateY(10px);\n }\n\n #app > div.flex.flex-col.flex-grow.mt-6 > div.flex.flex-col.flex-grow > div > div > div > p:nth-child(5)::before {\n content: "";\n display: inline-block;\n width: 28px;\n height: 30px;\n background: url(https://uploads-ssl.webflow.com/663a58dfb423eff3639562f6/669032579a5afe63cc467ddf_envelope-icon.svg) no-repeat left 40%;\n background-size: 20px;\n transform: translateY(10px);\n }\n\n @media all and (1023px < width < 1281px){\n .continue-btn{\n max-width : none;\n }\n }\n .separator-line-3steps-1,\n .separator-line-3steps-2{\n width: 75px;\n background-color: #EEF2F6;\n height: 2px;\n margin-top: 15px;\n position: absolute;\n }\n .separator-line-3steps-1{\n left: 14%;\n }\n .separator-line-3steps-2{\n left: 60%;\n }\n @media screen and (max-width: 767px) {\n #app>div.flex.flex-col.flex-grow.mt-6>div>div>div.flex.justify-center:has(.separator-line-3steps-1) a span.text-xs.text-color{\n text-align : left;\n margin-left : 0px;\n }\n }\n #app>div.flex.flex-col.flex-grow.mt-6>div>div:has(.separator-line-3steps-1) >div.hidden{\n right : 135px;\n }\n #app>div.flex.flex-col.flex-grow.mt-6>div>div:has(.separator-line-3steps-1) button.continue-btn{\n min-width : 128px;\n }\n @media screen and (max-width: 991px) {\n #app>div.flex.flex-col.flex-grow.mt-6>div>div:has(.separator-line-3steps-1) button.continue-btn{\n min-width : 196px;\n }\n }\n \n @media screen and (1290px > width > 767px){\n #app>div.flex.flex-col.flex-grow.mt-6>div>div:has(.separator-line-3steps-1) >div.hidden {\n right: 0px !important;\n bottom: -60px;\n }\n }\n @media screen and (max-width: 420px) {\n #app>div.flex.flex-col.flex-grow.mt-6>div>div>div.flex.justify-center:has(.separator-line-3steps-1){\n gap : 50px;\n } \n .separator-line-3steps-1,\n .separator-line-3steps-2{\n width: 48px;\n }\n .separator-line-3steps-2{\n left: 54%;\n }\n }\n #app > div.flex.flex-col.flex-grow.mt-6 > div.flex.flex-col.flex-grow > div > div > div > p:nth-child(7){\n display:none;\n }\n #app>div.flex.flex-col.flex-grow.mt-6>div.flex.flex-col.flex-grow>div>div:has(iframe){\n padding: 0px;\n max-width: none !important;\n width : 800px !important;\n margin: 0 auto !important;\n }\n @media (max-width: 848px) {\n #app>div.flex.flex-col.flex-grow.mt-6>div.flex.flex-col.flex-grow>div>div:has(iframe){\n width: 600px !important;\n }\n }\n @media (max-width: 640px) {\n #app>div.flex.flex-col.flex-grow.mt-6>div.flex.flex-col.flex-grow>div>div:has(iframe){\n width: 85vw !important;\n }\n }\n #app div[role="listbox"] {\n height: 200px;\n overflow: auto;\n }\n #app>div.flex.flex-col.flex-grow.mt-6>div.flex.flex-col.flex-grow>div>div>div:has(iframe){\n padding: 32px 16px;\n max-width: none !important;\n margin-left: -16px;\n }\n\n #app>div.flex.flex-col.flex-grow.mt-6>div.flex.flex-col.flex-grow>div:has(iframe){\n padding: 0px;\n max-width: none;\n width: 100% !important;\n }\n \n /* Unbreakable fix for internal scrollbar inside cross-domain iframe */\n #app iframe[src*="thankyou"], \n #app iframe[title*="Appointment"], \n #app iframe[aria-label*="confirmation"] {\n /* Measured in DevTools to be the lowest safe ceiling that prevents overflow */\n min-height: 1100px !important;\n }\n @media (max-width: 768px) {\n #app iframe[src*="thankyou"], \n #app iframe[title*="Appointment"], \n #app iframe[aria-label*="confirmation"] {\n /* Tested the layout on phone without leaving excess whitespace */\n min-height: 850px !important;\n }\n }\n\n\n\n #app #insurance ul {\n height: 180px;\n overflow: auto;\n }\n\n ',is_new_layout&&(p.textContent+="\n #app>div.flex.flex-col.flex-grow.mt-6>form>div.z-50.flex-grow.py-6.mt-6.bg-color.shadow-2xl{\n background-color: white;\n box-shadow: 0 0 7px 3px #b2aea3;\n position : fixed;\n left : 0;\n width : 100%;\n bottom : 0;\n padding : 24px;\n }\n\n #app>div.flex.flex-col.flex-grow.mt-6>form>div.z-50.flex-grow.py-6.mt-6.bg-color>div>div>button{\n background-color: #6AC64B;\n color: #FBFEFF;\n }\n\n #app>div.flex.flex-col.flex-grow.mt-6>form>div.z-50.flex-grow.py-6.mt-6.bg-color>div>div>button:hover{\n background-color: #2ba900;\n }\n @media screen and (min-width : 768px){\n #app > div.flex.flex-col.flex-grow.mt-6 > form > div.z-50.flex-grow.py-6.mt-6.bg-color.shadow-2xl.md\\:sticky.md\\:bottom-0.md\\:mt-24 > div > div{\n display : flex;\n flex-direction : row-reverse;\n justify-content : space-between;\n width : 100%;\n max-width : 1024px;\n margin : 0 auto;\n }\n \n #app > div.flex.flex-col.flex-grow.mt-6 > form > div.z-50.flex-grow.py-6.mt-6.bg-color.shadow-2xl.md\\:sticky.md\\:bottom-0.md\\:mt-24 > div > div > div{\n width : 100%;\n display : flex !important;\n max-width : 300px;\n }\n #app>div.flex.flex-col.flex-grow.mt-6>form>div.z-50.flex-grow.py-6.mt-6.bg-color.shadow-2xl>div>div>button{\n width : 100%;\n max-width : 300px;\n }\n }\n ",$("footer").css("padding-bottom","110px")),window.$shedulerShadowRoot.appendChild(p);var e=!1,t=!1,o=!1;const m=document.createElement("script");m.textContent=`\n function continueAction(){\n $(window.$shedulerShadowRoot.querySelector("#app > div.flex.flex-col.flex-grow.mt-6 > form > div.z-50.flex-grow.py-6.mt-6.bg-color.shadow-2xl > div > div > button")).click();\n }\n function refresh_page(){\n window.location.href="/location${window.jarvisConfig.vanityUrl}"\n }\n `,window.$shedulerShadowRoot.appendChild(m);const u=new MutationObserver((n,i)=>{for(const i of n)if("childList"===i.type){const n=[{selector:"#app > div.flex.flex-col.flex-grow.mt-6 > div > div > div.flex.justify-center > a:nth-child(1) > span.text-xs.text-color",text_1:"Booking Information",originalText_1:"Details",text_2:"Booking Information",skip:isThreeStepForm},{selector:"#app > div.flex.flex-col.flex-grow.mt-6 > div > div > div.flex.justify-center > a:nth-child(2) > span.text-xs.text-color",text_1:"Patient Information",originalText_1:"Schedule",text_2:"Patient Information",skip:!1},{selector:"#app > div.flex.flex-col.flex-grow.mt-6 > form > div.z-50.flex-grow.py-6.mt-6.bg-color.shadow-2xl > div > div > div a",text_1:"Back",originalText_1:"BACK",text_2:"Back",skip:!1},{selector:"#app > div.flex.flex-col.flex-grow.mt-6 > div > div > div.hidden > a",text_1:"Back",originalText_1:"< previous step",text_2:"Back",skip:!1}];requestAnimationFrame(()=>{n.forEach(({selector:e,text_1:t,originalText_1:o,text_2:n,skip:i})=>{const r=window.$shedulerShadowRoot.querySelector(e);if(r&&!i){let e=r.textContent.trim();r.textContent=e===o?t:n}});const i=window.$shedulerShadowRoot;if(!isThreeStepForm&&!window.$shedulerShadowRoot.querySelector(".separator-line")){const e=i.querySelector("#app > div.flex.flex-col.flex-grow.mt-6 > div > div > div.flex.justify-center > a:nth-child(1)");e&&e.insertAdjacentHTML("afterend","
")}if(isThreeStepForm&&i.querySelector("#app>div.flex.flex-col.flex-grow.mt-6>div>div>div.flex.justify-center")&&!i.querySelector(".separator-line-3steps-1")){const e=i.querySelector("#app > div.flex.flex-col.flex-grow.mt-6 > div > div > div.flex.justify-center > a:nth-child(2)");e&&(e.insertAdjacentHTML("afterend","
"),e.insertAdjacentHTML("beforebegin","
"));const t=i.querySelector("#app>div.flex.flex-col.flex-grow.mt-6>div>div>div.flex.justify-center");t&&(t.style.alignItems="baseline")}if(i.querySelector("#app > div.flex.flex-col.flex-grow.mt-6 > div > div")&&!e){const t=i.querySelector("#app > div.flex.flex-col.flex-grow.mt-6 > div > div");t&&t.insertAdjacentHTML("beforeend","
"),e=!0}const r=i.querySelector("#next-button-sticky");if(i.querySelector("#app > div.flex.flex-col.flex-grow.mt-6 > form > div.z-50.flex-grow.py-6.mt-6.bg-color.shadow-2xl > div > div > button")&&(" Next "==i.querySelector("#app > div.flex.flex-col.flex-grow.mt-6 > form > div.z-50.flex-grow.py-6.mt-6.bg-color.shadow-2xl > div > div > button").textContent?(i.querySelector(".continue-btn").textContent="Next",r&&(r.textContent="Next")):(i.querySelector(".continue-btn").textContent=isThreeStepForm?"Submit":"Book Appointment",r&&(r.textContent=isThreeStepForm?"Submit":"Book Appointment"))),i.querySelector('form > div.z-50.flex-grow.py-6.mt-6.bg-color.shadow-2xl > div > div > button[disabled="disabled"]')&&r){i.querySelector('form > div.z-50.flex-grow.py-6.mt-6.bg-color.shadow-2xl > div > div > button[disabled="disabled"]')?(r.style.opacity="0.5",r.style.cursor="not-allowed",r.disabled=!0):(r.style.opacity="1",r.style.cursor="pointer",r.disabled=!1)}const a=i.querySelector("#app > div.flex.flex-col.flex-grow.mt-6 > form > div.z-50.flex-grow.py-6.mt-6.bg-color.shadow-2xl > div > div > div a"),l=document.querySelectorAll("#back-button-sticky-mobile, #back-button-sticky"),c=document.querySelector("#wf-back-button-mobile");if(a?(l.forEach(e=>{e.style.opacity="1",e.style.cursor="pointer"}),c&&(c.style.display="")):(l.forEach(e=>{e.style.opacity="0"}),c&&(c.style.display="none")),i.querySelector("#app > div.flex.flex-col.flex-grow.mt-6 > div.flex.flex-col.flex-grow > div > div > div")&&!t){const e=i.querySelector("#app > div.flex.flex-col.flex-grow.mt-6 > div.flex.flex-col.flex-grow > div > div > div");e&&e.insertAdjacentHTML("beforeend",""),t=!0}if(i.querySelector("input#true-policy-holder")&&s){const e=i.querySelector("input#false-policy-holder");e&&e.addEventListener("change",()=>{const e=i.querySelector("input#policy_holders_firstname");e&&(e.value="");const t=i.querySelector("input#policy_holders_lastname");t&&(t.value=""),setTimeout(()=>{const e=i.querySelector("input#policy_holders_dob");e&&(e.value="")},500);const o=e=>{const t=i.querySelector(e);if(t){const e=t.cloneNode(!0);t.replaceWith(e)}};o("input#first_name"),o("input#last_name"),o("input#birth_date")});const t=i.querySelector("input#true-policy-holder");t&&t.addEventListener("change",()=>{const e=i.querySelector("input#first_name"),t=i.querySelector("input#last_name"),o=i.querySelector("input#birth_date"),n=i.querySelector("input#policy_holders_firstname"),r=i.querySelector("input#policy_holders_lastname"),a=i.querySelector("input#policy_holders_dob");e&&n&&(n.value=e.value),t&&r&&(r.value=t.value),o&&a&&(a.value=o.value);const l=(e,t)=>{if(e&&t){const o=()=>{t.value=e.value};e.addEventListener("change",o),e._syncHandler=o}};l(e,n),l(t,r),l(o,a)}),s=!1}!d&&null==i.querySelector("#app > div.flex.flex-col.flex-grow.mt-6 > form > div.container.pt-6.mx-auto.sm\\:p-6.flex-grow > div > div > div:has(>div>div>div>div[date-picker-date])")&&o&&(o=!1);i.querySelector("#app>div.flex.flex-col.flex-grow.mt-6>form>div.container.pt-6.mx-auto>div>div>div:nth-child(3)>div>div>div>div:nth-child(2)>div>div.relative.flex.items-center.justify-center.pb-2.mb-4.border-b.border-gray-300.cursor-pointer.select-none")&&!o&&(setTimeout(function(){if(0==i.querySelector("#app>div.flex.flex-col.flex-grow.mt-6>form>div.container.pt-6.mx-auto>div>div>div:nth-child(3)>div>div>div>div:nth-child(2)>div>div.relative.flex.items-center.justify-center.pb-2.mb-4.border-b.border-gray-300.cursor-pointer.select-none + div").classList.length){const e=i.querySelector("#app>div.flex.flex-col.flex-grow.mt-6>form>div.container.pt-6.mx-auto>div>div>div:nth-child(3)>div>div>div>div:nth-child(2)>div>div.relative.flex.items-center.justify-center.pb-2.mb-4.border-b.border-gray-300.cursor-pointer.select-none");e&&e.click()}},500),o=!0)})}}),f=new ResizeObserver(()=>{const e=window.$shedulerShadowRoot;if(e){if(!e.querySelector("#mobile-grid-fix")){const t=document.createElement("style");t.id="mobile-grid-fix",t.textContent='\n @media screen and (max-width: 767px) {\n ul:has(> div[aria-labelledby^="date-header-"]):not([style*="display: none"]) { display: block !important; }\n div[role="radiogroup"][aria-label="Available appointment times"] {\n display: grid !important;\n grid-template-columns: repeat(3, minmax(0, 1fr)) !important;\n gap: 0.5rem !important;\n }\n }\n ',e.appendChild(t)}const t=e.querySelectorAll('[role="radiogroup"][aria-label="Available appointment times"]');window.innerWidth>=768?t.forEach(e=>{const t=e.closest("ul");t&&"none"===t.style.display&&(t.dataset.wasClosedOnMobile="true",t.style.display="")}):t.forEach(e=>{const t=e.closest("ul");t&&"true"===t.dataset.wasClosedOnMobile&&(t.style.display="none",t.dataset.wasClosedOnMobile="false")})}}),v={attributes:!1,childList:!0};h&&u.observe(h,v),document.body&&f.observe(document.body),document.getElementById("loading-spinner-tmp").style.display="none",window.jarvis.toggle(),window.scrollTo(0,0)}catch(e){console.error("Error during the jarvis toggle or script setup:",e)}}window.jarvis.title="",window.jarvis.colors.activeNavItemBackground="#6AC64B",window.jarvis.colors.primaryOptionColor="#6AC64B",window.jarvis.colors.primaryButtonBackground="#6AC64B",window.jarvis.colors.primaryButtonBorderColor="#6AC64B",window.jarvis.colors.bodyBackground="#FBFEFF",window.jarvis.colors.headerBackground="#FBFEFF",window.jarvis.colors.nearestCardSubtitleColor="#B7BCC2",window.jarvis.colors.inactiveNavItemBackground="#B7BCC2",window.jarvis.colors.samedayCardSubtitlesColor="#B7BCC2",window.jarvis.colors.availabilityBackground="#FBFEFF",window.jarvis.colors.availabilityPaginationBackground="#EEF2F6",window.jarvis.colors.availabilityPaginationColor="#767F87",window.jarvis.colors.availabilityColumnHeaderBackground="#EEF2F6",window.jarvis.colors.availabilityColumnHeaderColor="#767F87",window.jarvis.colors.nearestCardColumnHeaderColor="#767F87",setInterval(()=>{try{const e=window.$shedulerShadowRoot;if(!e)return;if(!window.jarvisBookingCache.time){const t=e.querySelectorAll("h1, h2, h3, h4, p, span, div");for(let e of t){if(e.children.length>0)continue;const t=e.textContent.trim(),o=t.match(/at\s+(\d{1,2}:\d{2}\s*(?:AM|PM))/i);if(o&&t.match(/monday|tuesday|wednesday|thursday|friday|saturday|sunday/i)){window.jarvisBookingCache.time=o[1].trim();const e=t.split(/at/i)[0].trim(),n=new Date(e);isNaN(n.getTime())||(window.jarvisBookingCache.date=n.toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"}),window.jarvisBookingCache.day=n.toLocaleDateString("en-US",{weekday:"long"}));break}}}const t=e.querySelector('input[type="radio"]:checked');if(t&&t.id&&t.id.startsWith("time-")){const e=t.getAttribute("aria-label");if(e&&e.includes(" on ")){const t=e.split(" on "),o=t[0].trim().replace(/(am|pm)/i," $1").toUpperCase().replace(" "," ");o&&(window.jarvisBookingCache.time=o);const n=new Date(t[1].trim());isNaN(n.getTime())||(window.jarvisBookingCache.date=n.toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"}),window.jarvisBookingCache.day=n.toLocaleDateString("en-US",{weekday:"long"}))}}const o=e.querySelector("[data-location-id]");if(o){const e=o.parentElement.querySelector("h3");e&&(window.jarvisBookingCache.location=e.textContent.trim())}}catch(e){}},500),window.jarvis.onBookSuccesshandlers.push(function(){if(window.$shedulerShadowRoot){const e=window.$shedulerShadowRoot.querySelector("#app");e&&(e.style.opacity="0",e.style.pointerEvents="none")}try{window.$shedulerShadowRoot;let e=window.jarvisBookingCache.location;if(!e){const t=document.querySelector("h1");t&&t.textContent&&"Book an Appointment"!==t.textContent.trim()?e=t.textContent.trim().replace(/Book an Appointment at:\s*/,"").replace(/Dentist in |Orthodontist in /,""):window.jarvisConfig&&window.jarvisConfig.officeName&&(e=window.jarvisConfig.officeName)}let t=window.jarvisBookingCache.date,o=window.jarvisBookingCache.day,n=window.jarvisBookingCache.time;const i=document.querySelector('a[href^="tel:"]');let r="";if(i){const e=i.getAttribute("href");let t=e.replace(/[^0-9]/g,"");11===t.length&&t.startsWith("1")&&(t=t.slice(1)),r=10===t.length?`(${t.slice(0,3)}) ${t.slice(3,6)}-${t.slice(6)}`:e.replace("tel:","").trim()}let a=window.location.pathname;a.includes("/book-appointment")&&window.jarvisConfig&&window.jarvisConfig.vanityUrl&&(a=window.jarvisConfig.vanityUrl.startsWith("/")?window.jarvisConfig.vanityUrl:"/"+window.jarvisConfig.vanityUrl);const l={location:e,date:t,day:o,time:n,phone:r,url:a};sessionStorage.setItem("jarvis_booking_details",JSON.stringify(l))}catch(e){console.error("Jarvis: error extracting booking details for thank you page",e)}const t={apikey:"HAuu1jpaWurNhCEHdRG1ZW4ZaDpB4Kr5Qs",location_id:window.jarvisConfig.jarvisId||"",type:"form",first_name:i||"",last_name:r||"",email:a||"",phone:n||"",date:(new Date).toISOString().slice(0,19).replace("T"," ")};try{const o=window.$shedulerShadowRoot?.querySelector("input#first_name"),n=window.$shedulerShadowRoot?.querySelector("input#last_name"),i=window.$shedulerShadowRoot?.querySelector("input#middle_name"),r=window.$shedulerShadowRoot?.querySelector("[date-picker-date]");o?.value&&(t.first_name=o.value),n?.value&&(t.last_name=n.value),i?.value&&(t.middle_name=i.value),r&&(t.appointment_date=r.getAttribute("date-picker-date"));const a=e();a&&(t.comments=`Offer: ${a}`);const l=new URLSearchParams(window.location.search);["utma","utmb","utmc","utmv","utmz","utmx"].forEach(e=>{const o=l.get(e);o&&(t[e]=o)}),document.referrer&&(t.referrer=document.referrer)}catch(e){console.error("Jarvis: error reading shadow DOM inputs for webhook payload:",e)}t.first_name&&t.last_name&&t.email||console.warn("Jarvis webhook: one or more required fields are empty.",t);i="",r="",a="",n="";let o=!1;const l=()=>{o||(o=!0,window.location.href="/thank-you")};setTimeout(()=>{window.fetch("https://webhooks.jarvisanalytics.com/api/v2/leads",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(t),keepalive:!0}).then(e=>{if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`);return e.json()}).then(e=>{window.dataLayer&&window.dataLayer.push({event:"jarvis_webhook_success",webhookResponse:e,eventTimeout:2e3,eventCallback:l})}).catch(e=>{console.error("Jarvis webhook error:",e),window.dataLayer&&window.dataLayer.push({event:"jarvis_webhook_error",error:e.message}),l()})},10),setTimeout(l,5e3)}),window.jarvis.onloadhandlers.push(function(){}),window.jarvis.onNextStep(u),window.jarvis.onNextStephandlers.push(function(e){console.log("Next step data:",e),window.$shedulerShadowRoot.addEventListener("click",e=>{const t=e.target;if(t&&function(e){return e.textContent?.toLowerCase().includes("book")}(t)){const t=window.$shedulerShadowRoot.querySelector("#mobile_phone input");if(!t)return;const o=validateUSPhoneNumber(t.value);if(!o.valid)return console.warn("Hard blocking before mutation is created"),e.preventDefault(),e.stopImmediatePropagation(),showPhoneError(o.message),!1}},!0),s=!0,d||(d=!0)}),document.querySelector("#wf-back-button-mobile")?.setAttribute("onclick","jarvisGoBack()"),document.querySelector("#back-button-sticky-mobile")?.setAttribute("onclick","jarvisGoBack()"),document.querySelector("#back-button-sticky")?.setAttribute("onclick","jarvisGoBack()"),document.querySelector("#next-button-sticky")?.addEventListener("click",()=>{h.querySelector(".continue-btn")?.click()}),"complete"===document.readyState?setTimeout(()=>{c(),console.log("Jarvis widget initialized after 5 seconds (page already loaded)")},5e3):(window.addEventListener("load",c),console.log("Jarvis widget initialized after on page load"))}catch(f){console.error("Error during the setup of the jarvis scheduler:",f)}}};class JarvisObserver{constructor(){this.onloadhandlers=[],this.onNextStephandlers=[],this.onTimesNearbyhandlers=[],this.onBookErrorhandlers=[],this.onBookSuccesshandlers=[],this.onOcrScanhandlers=[],this.onSubmittedhandlers=[]}onload(e){this.onloadhandlers.push(e)}onNextStep(e){this.onNextStephandlers.push(e)}onTimesNearby(e){this.onTimesNearbyhandlers.push(e)}onBookError(e){this.onBookErrorhandlers.push(e)}onBookSuccess(e){this.onBookSuccesshandlers.push(e)}onOcrScan(e){this.onOcrScanhandlers.push(e)}onSubmitted(e){this.onSubmittedhandlers.push(e)}unsubscribe(e,t){const o=`${e}handlers`;this[o]=this[o].filter(e=>{if(e!==t)return e})}fire(e,t){this[`${e}handlers`].forEach(e=>{e.call(this,t)})}}class JarvisAnalyticsScheduler extends JarvisObserver{constructor(e={}){super(),Object.assign(this,{title:"Book an Appointment",token:null,locationId:null,companyId:null,conversionPartnerId:null,conversionPartnerUrl:null,endpoint:"https://schedule.jarvisanalytics.com/graphql",iframeMode:!1,showLogo:1,showPhoneNumber:!0,showAddress:!1,isOpen:!1,useDatePicker:!1,logo:{src:null,width:189,height:38},headerPracticeName:"",colors:{bodyBackground:"#F3F4F6",headerBackground:"#FFFFFF",headerColor:"#212127",footerBackground:"#FFFFFF",containerBackground:"#FFFFFF",availabilityBackground:"#F9FAFB",availabilityPaginationBackground:"#111827",availabilityPaginationColor:"#FFFFFF",availabilityColumnHeaderBackground:"#111827",availabilityColumnHeaderColor:"#FFFFFF",nearestCardBackground:"#FFFFFF",nearestCardBorderColor:"#D1D5DB",nearestCardColumnHeaderBackground:"#111827",nearestCardColumnHeaderColor:"#FFFFFF",nearestCardTitleColor:"#212127",nearestCardSubtitleColor:"#9CA3AF",activeNavItemBackground:"#51B44F",activeNavItemColor:"#FFFFFF",inactiveNavItemBackground:"#9CA3AF",inactiveNavItemColor:"#FFFFFF",navItemColor:"#212127",primaryOptionColor:"#51B44F",secondaryOptionColor:"#D4F3BB",primaryButtonBackground:"#51B44F",primaryButtonBorderColor:"#51B44F",primaryButtonColor:"#FFFFFF",secondaryButtonBackground:"transparent",secondaryButtonBorderColor:"#212127",secondaryButtonColor:"#212127",samedayCardBackground:"#FFFFFF",samedayCardBorderColor:"#E5E7EB",samedayCardDividerColor:"#212127",samedayCardTitleColor:"#212127",samedayCardSubtitlesColor:"#9CA3AF",samedayCardServiceTitleColor:"#212127"},samedayTitle:"Same-Day Appointment",sameday:!1,samedayOpen:!1,includeServices:null,includeLocations:null,serviceCodes:null,override:null,utm_source:null,gclid:null,gbraid:null,referrer:null,map:null,reservedWithGoogle:!1,modalMode:!1,containerMode:!1,containerSelector:null,containerStyles:{position:"relative",width:"100%",height:"100%"},piwikUrl:"https://hs1.containers.piwik.pro",piwikWebsiteId:"fe11af93-662a-4f48-9b4b-49509bb4f395",recare:!1,recareData:null,recareMultiple:!1,recareServiceId:null,bookingLink:!1,bookingData:null},e),this.init()}attachWidgetTag(){const e=document.createElement("jarvis-scheduler-v2");if(this.containerMode&&this.containerSelector){const t=document.querySelector(this.containerSelector);if(t)return void t.appendChild(e);console.warn(`JarvisScheduler: Container "${this.containerSelector}" not found, falling back to document.body`)}document.body.appendChild(e)}attachScriptTag(){let e=document.createElement("script");e.id="jarvis-scheduler",e.src="https://schedule.jarvisanalytics.com/js/jarvis-scheduler-v2.min.js",e.async=!0,document.body.appendChild(e),this.getVueInstance(e)}initPendo(){!function(e,t,o,n,i){var r,a,l,s,d;for((i=e[n]=e[n]||{})._q=i._q||[],a=0,l=(r=["initialize","identify","updateOptions","pageLoad","track"]).length;a0?"?"+l.join("&"):"";a.async=!0,a.src=e+"/"+t+".js"+s,r.parentNode.insertBefore(a,r),function(e,t,n){e[t]=e[t]||{};for(var r=0;r{"scheduling-success"===e?.event&&this.requestConversion(),this.pushPiwik(["trackEvent","Booking","Clicked","Next Step",void 0,void 0,{dimension1:e?.location?.location_id,dimension2:e?.companyId}]),this.fire("onNextStep",this.enhanceEventWithTrackingParams(e))}),this.component.$on("ontimesnearby",e=>{this.fire("onTimesNearby",this.enhanceEventWithTrackingParams(e))}),this.component.$on("onbookerror",e=>{this.fire("onBookError",this.enhanceEventWithTrackingParams(e))}),this.component.$on("on:book_success",e=>{this.pushPiwik(["trackEvent","Booking","Confirmed","Appointment Request",void 0,{dimension1:e?.location?.location_id,dimension2:e?.companyId}]),this.fire("onBookSuccess",this.enhanceEventWithTrackingParams(e))}),this.component.$on("on:ocr_scan",e=>{this.fire("onOcrScan",e)}),this.component.$on("on:submitted",e=>{this.pushPiwik(["trackEvent","Booking","Submitted","Appointment Request",void 0,{dimension1:e?.location?.location_id,dimension2:e?.companyId}]),this.pushPiwik(["trackGoal","f4ebc000-db5a-45e8-a63c-3b296f9f7d7e",void 0,{dimension1:e?.location?.location_id,dimension2:e?.companyId}]),this.fire("onSubmitted",this.enhanceEventWithTrackingParams(e))}),this.component.$once("on:time_selected",e=>{this.pushPiwik(["trackEvent","Booking","Selected","Appointment Time"])}),this.component.$once("on:service_selected",e=>{this.pushPiwik(["trackEvent","Booking","Selected","Service"])}),this.component.$once("on:patient_information_entered",e=>{this.pushPiwik(["trackEvent","Booking","Entered","Patient Information"])}),this.component.$once("on:insurance_information_entered",e=>{this.pushPiwik(["trackEvent","Booking","Entered","Insurance Information"])})}getVueInstance(e){e.onload=()=>{this.initSettings()}}toggle(e){this.component.onOpen(e)}init(){"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>this.loadApp()):this.loadApp()}getRwgToken(){const e=location.search.substring(1).split("&");let t;for(let o=0;ot.startsWith(e))}requestConversion(){const e=this.conversionPartnerId,t=window.location.hostname.includes("staging")?"https://www.google.com/maps/conversion/debug/collect":"https://www.google.com/maps/conversion/collect",o=this.findCookie("_rwg_token");if(void 0!==o){const n=o.split(/=(.*)/s)[1];fetch(t,{method:"POST",body:JSON.stringify({conversion_partner_id:e,rwg_token:n,merchant_changed:2})})}}loadApp(){this.attachScriptTag(),this.attachWidgetTag(),this.handleRwgToken(),this.initPendo(),this.initPiwik(this.piwikUrl,this.piwikWebsiteId),this.fire("onload"),console.log("loading analytics scheduler")}}window.JarvisAnalyticsScheduler=JarvisAnalyticsScheduler;