PageSourceSearch

https://www.docortho.com/cdn/shop/t/36/assets/app.js?v=65769988580183007921768594490

js docortho.com collected 2026-09-24 13:01:40 UTC 15,031 bytes, 2 lines download raw bytes

1function debounce(fn,wait){let t;return(...args)=>{clearTimeout(t),t=setTimeout(()=>fn.apply(this,args),wait)}}var dispatchCustomEvent=function(eventName){var data=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},detail={detail:data},event=new CustomEvent(eventName,data?detail:null);document.dispatchEvent(event)};if(window.recentlyViewedIds=[],!customElements.get("quantity-selector")){class QuantityInput extends HTMLElement{constructor(){super(),this.input=this.querySelector(".qty"),this.step=this.input.getAttribute("step"),this.changeEvent=new Event("change",{bubbles:!0}),this.subtract=this.querySelector(".minus"),this.add=this.querySelector(".plus"),this.subtract.addEventListener("click",()=>this.change_quantity(-1*this.step)),this.add.addEventListener("click",()=>this.change_quantity(1*this.step))}connectedCallback(){this.classList.add("buttons_added")}change_quantity(change){let quantity=Number(this.input.value);isNaN(quantity)&&(quantity=1),!(this.input.getAttribute("min")>quantity+change)&&(this.input.getAttribute("max")&&this.input.getAttribute("max")<quantity+change||(quantity+=change,quantity=Math.max(quantity,1),this.input.value=quantity,this.input.dispatchEvent(this.changeEvent)))}}customElements.define("quantity-selector",QuantityInput)}if(!customElements.get("product-card")){class ProductCard extends HTMLElement{constructor(){super(),this.swatches=this.querySelector(".product-card-swatches"),this.image=this.querySelector(".product-featured-image-link .product-primary-image"),this.secondary=this.querySelector(".product-featured-image-link .product-secondary-image"),this.quick_add=this.querySelector(".product-card--add-to-cart-button-simple")}connectedCallback(){this.swatches&&this.enableSwatches(),this.quick_add&&this.enableQuickView(),this.secondary&&window.addEventListener("load",event=>{lazySizes.loader.unveil(this.secondary)})}enableSwatches(){let swatch_list=this.swatches.querySelectorAll(".product-card-swatch"),org_srcset=this.image?this.image.dataset.srcset:"";swatch_list.forEach((swatch,index)=>{window.addEventListener("load",event=>{let image=new Image;image.srcset=swatch.dataset.srcset,lazySizes.loader.unveil(image)}),swatch.addEventListener("mouseover",()=>{[].forEach.call(swatch_list,function(el){el.classList.remove("active")}),this.image&&(swatch.dataset.srcset?this.image.setAttribute("srcset",swatch.dataset.srcset):this.image.setAttribute("srcset",org_srcset)),swatch.classList.add("active")}),swatch.addEventListener("click",function(evt){window.location.href=this.dataset.href,evt.preventDefault()})})}enableQuickView(){this.quick_add.addEventListener("click",this.quickAdd.bind(this))}quickAdd(evt){if(evt.preventDefault(),this.quick_add.disabled)return;this.quick_add.classList.add("loading"),this.quick_add.setAttribute("aria-disabled",!0);const config={method:"POST",headers:{"X-Requested-With":"XMLHttpRequest",Accept:"application/javascript"}};let formData=new FormData(this.form);return formData.append("id",this.quick_add.dataset.productId),formData.append("quantity",1),formData.append("sections",this.getSectionsToRender().map(section=>section.section)),formData.append("sections_url",window.location.pathname),config.body=formData,fetch(`${theme.routes.cart_add_url}`,config).then(response=>response.json()).then(response=>{response.status||(this.renderContents(response),dispatchCustomEvent("cart:item-added",{product:response.hasOwnProperty("items")?response.items[0]:response}))}).catch(e=>{console.error(e)}).finally(()=>{this.quick_add.classList.remove("loading"),this.quick_add.removeAttribute("aria-disabled")}),!1}getSectionsToRender(){return[{id:"Cart",section:"main-cart",selector:".thb-cart-form"},{id:"Cart-Drawer",section:"cart-drawer",selector:".cart-drawer"},{id:"cart-drawer-toggle",section:"cart-bubble",selector:".thb-item-count"}]}renderContents(parsedState){this.getSectionsToRender().forEach((section=>{if(!document.getElementById(section.id))return;const elementToReplace=document.getElementById(section.id).querySelector(section.selector)||document.getElementById(section.id);elementToReplace.innerHTML=this.getSectionInnerHTML(parsedState.sections[section.section],section.selector),typeof CartDrawer<"u"&&new CartDrawer,typeof Cart<"u"&&new Cart().renderContents(parsedState)})),document.getElementById("Cart-Drawer")&&document.getElementById("Cart-Drawer").open()}getSectionInnerHTML(html,selector=".shopify-section"){return new DOMParser().parseFromString(html,"text/html").querySelector(selector).innerHTML}}customElements.define("product-card",ProductCard)}class PanelClose extends HTMLElement{constructor(){super();let cc=document.querySelector(".click-capture");this.addEventListener("click",e=>this.close_panel(e)),document.addEventListener("keyup",e=>{e.code&&e.code.toUpperCase()==="ESCAPE"&&document.querySelectorAll(".side-panel").forEach(panel=>{panel.classList.remove("active"),document.body.classList.remove("open-cc")})}),cc.addEventListener("click",e=>{document.body.classList.remove("open-cc"),document.querySelector(".side-panel.active")&&document.querySelector(".side-panel.active").classList.remove("active")})}close_panel(e){e.preventDefault(),e.target.closest(".side-panel").classList.remove("active"),document.body.classList.remove("open-cc")}}if(customElements.define("side-panel-close",PanelClose),!customElements.get("cart-drawer")){class CartDrawer2 extends HTMLElement{constructor(){super()}connectedCallback(){let button=document.getElementById("cart-drawer-toggle");button&&(button.addEventListener("click",e=>{e.preventDefault(),document.body.classList.add("open-cc"),this.classList.add("active"),this.focus(),dispatchCustomEvent("cart-drawer:open")}),this.debouncedOnChange=debounce(event=>{this.onChange(event)},300),document.addEventListener("cart:refresh",event=>{this.refresh()}),this.addEventListener("change",this.debouncedOnChange.bind(this)),this.removeProductEvent())}open(){document.body.classList.add("open-cc"),this.classList.add("active"),dispatchCustomEvent("cart-drawer:open")}close(){document.body.classList.remove("open-cc"),this.classList.remove("active")}onChange(event){event.target.classList.contains("qty")&&this.updateQuantity(event.target.dataset.index,event.target.value),this.removeProductEvent()}removeProductEvent(){this.querySelectorAll(".remove").forEach(remove=>{remove.addEventListener("click",event=>{this.updateQuantity(event.target.dataset.index,"0"),event.preventDefault()})})}getSectionsToRender(){return[{id:"Cart-Drawer",section:"cart-drawer",selector:".cart-drawer"},{id:"cart-drawer-toggle",section:"cart-bubble",selector:".thb-item-count"}]}getSectionInnerHTML(html,selector){return new DOMParser().parseFromString(html,"text/html").querySelector(selector).innerHTML}updateQuantity(line,quantity){this.querySelector(`#CartDrawerItem-${line}`).classList.add("thb-loading");const body=JSON.stringify({line,quantity,sections:this.getSectionsToRender().map(section=>section.section),sections_url:window.location.pathname});dispatchCustomEvent("line-item:change:start",{quantity}
1),fetch(`${theme.routes.cart_change_url}`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body}).then(response=>response.text()).then(state=>{const parsedState=JSON.parse(state);this.getSectionsToRender().forEach((section=>{const elementToReplace=document.getElementById(section.id).querySelector(section.selector)||document.getElementById(section.id);elementToReplace.innerHTML=this.getSectionInnerHTML(parsedState.sections[section.section],section.selector)})),this.removeProductEvent(),dispatchCustomEvent("line-item:change:end",{quantity,cart:parsedState}),this.querySelector(`#CartDrawerItem-${line}`).length&&this.querySelector(`#CartDrawerItem-${line}`).classList.remove("thb-loading")})}refresh(){fetch(`${window.location.pathname}?sections=cart-drawer,cart-bubble`).then(response=>response.text()).then(state=>{const parsedState=JSON.parse(state);this.getSectionsToRender().forEach((section=>{const elementToReplace=document.getElementById(section.id).querySelector(section.selector)||document.getElementById(section.id);elementToReplace.innerHTML=this.getSectionInnerHTML(parsedState[section.section],section.selector)})),this.removeProductEvent()})}}customElements.define("cart-drawer",CartDrawer2)}if(!customElements.get("quick-view")){class QuickView extends HTMLElement{constructor(){super()}connectedCallback(){this.cc=document.querySelector(".click-capture"),this.drawer=document.getElementById("Product-Drawer"),this.body=document.body,this.addEventListener("click",this.setupEventListener.bind(this)),this.cc.addEventListener("click",this.setupCCEventListener.bind(this))}setupCCEventListener(e){this.body.classList.remove("open-cc"),this.drawer.classList.remove("active"),this.drawer.querySelector("#Product-Drawer-Content").innerHTML=""}setupEventListener(e){e.preventDefault();let productHandle=this.dataset.productHandle,href=`${theme.routes.root_url}/products/${productHandle}?view=quick-view`;href=href.replace("//","/"),!(!href||!productHandle)&&(this.classList.contains("loading")||(this.classList.add("loading"),fetch(href,{method:"GET"}).then(response=>(this.classList.remove("loading"),response.text())).then(text=>{const sectionInnerHTML=new DOMParser().parseFromString(text,"text/html").querySelector("#Product-Drawer-Content").innerHTML;this.renderQuickview(sectionInnerHTML,href,productHandle)})))}renderQuickview(sectionInnerHTML,href,productHandle){if(sectionInnerHTML){this.drawer.querySelector("#Product-Drawer-Content").innerHTML=sectionInnerHTML;let js_files=this.drawer.querySelector("#Product-Drawer-Content").querySelectorAll("script");if(js_files.length>0){var head=document.getElementsByTagName("head")[0];js_files.forEach((js_file,i)=>{let script=document.createElement("script");script.src=js_file.src,head.appendChild(script)})}setTimeout(()=>{window.dispatchEvent(new Event("resize")),Shopify&&Shopify.PaymentButton&&Shopify.PaymentButton.init(),window.ProductModel&&window.ProductModel.loadShopifyXR()},300),this.body.classList.add("open-cc"),this.drawer.classList.add("active"),this.drawer.querySelector(".side-panel-close").focus(),dispatchCustomEvent("quick-view:open",{productUrl:href,productHandle})}}}customElements.define("quick-view",QuickView)}class ProductRecommendations extends HTMLElement{constructor(){super()}fetchProducts(){fetch(this.dataset.url).then(response=>response.text()).then(text=>{const html=document.createElement("div");html.innerHTML=text;const recommendations=html.querySelector("product-recommendations");recommendations&&recommendations.innerHTML.trim().length&&(this.innerHTML=recommendations.innerHTML),this.classList.add("product-recommendations--loaded")}).catch(e=>{console.error(e)})}connectedCallback(){this.fetchProducts()}}customElements.define("product-recommendations",ProductRecommendations);class SelectWidth{constructor(){let _this=this;document.querySelectorAll(".resize-select").forEach(_this.resizeSelect),document.body.addEventListener("change",e=>{e.target.matches(".resize-select")&&e.target.offsetParent!==null&&_this.resizeSelect(e.target)}),window.addEventListener("resize.resize-select",function(){document.querySelectorAll(".resize-select").forEach(_this.resizeSelect)}
1)}resizeSelect(sel){let tempOption=document.createElement("option");tempOption.textContent=sel.selectedOptions[0].textContent;let tempSelect=document.createElement("select");tempSelect.style.visibility="hidden",tempSelect.style.position="fixed",tempSelect.appendChild(tempOption),sel.after(tempSelect),tempSelect.clientWidth>0&&(sel.style.width=`${+tempSelect.clientWidth+12}px`),tempSelect.remove()}}if(!customElements.get("collapsible-row")){class CollapsibleRow extends HTMLElement{constructor(){super(),this.details=this.querySelector("details"),this.summary=this.querySelector("summary"),this.content=this.querySelector(".collapsible__content"),this.animation=null,this.isClosing=!1,this.isExpanding=!1}connectedCallback(){this.setListeners()}setListeners(){this.querySelector("summary").addEventListener("click",e=>this.onClick(e))}prepareAnimations(){let _this=this,summary_height=this.querySelector("summary").offsetHeight,content_height=this.querySelector(".collapsible__content").offsetHeight,initial_height=summary_height,final_height=summary_height+content_height;this.tl=!1,this.tl=gsap.timeline({reversed:!_this.details.open,paused:!0,inherit:!1,ease:"none",onStart:function(){_this.details.open=!0,_this.details.style.overflow="hidden"},onReverseComplete:function(){_this.details.open=!1,_this.details.style.overflow=""}}),this.tl.fromTo(_this.details,{height:function(){return Math.max(Math.max(initial_height,0),24)},clearProps:"height"},{duration:.4,height:final_height,clearProps:"height"}),this.details.open&&this.tl.progress(1)}instantClose(){this.tl.timeScale(10).reverse()}animateClose(){this.tl.timeScale(3).reverse()}animateOpen(){this.tl.timeScale(1).play()}onClick(e){e.preventDefault(),this.details.style.overflow="hidden",this.isClosing||!this.details.open?this.open():(this.isExpanding||this.details.open)&&this.shrink()}shrink(){this.isClosing=!0;const startHeight=`${this.details.offsetHeight}px`,endHeight=`${this.summary.offsetHeight}px`;this.animation&&this.animation.cancel(),this.animation=this.details.animate({height:[startHeight,endHeight]},{duration:250,easing:"ease"}),this.animation.onfinish=()=>this.onAnimationFinish(!1),this.animation.oncancel=()=>this.isClosing=!1}open(){this.details.style.height=`${this.details.offsetHeight}px`,this.details.open=!0,window.requestAnimationFrame(()=>this.expand())}expand(){this.isExpanding=!0;const startHeight=`${this.details.offsetHeight}px`,endHeight=`${this.summary.offsetHeight+this.content.offsetHeight}px`;this.animation&&this.animation.cancel(),this.animation=this.details.animate({height:[startHeight,endHeight]},{duration:400,easing:"ease-out"}),this.animation.onfinish=()=>this.onAnimationFinish(!0),this.animation.oncancel=()=>this.isExpanding=!1}onAnimationFinish(open){this.details.open=open,this.animation=null,this.isClosing=!1,this.isExpanding=!1,this.details.style.height=this.details.style.overflow=""}}customElements.define("collapsible-row",CollapsibleRow)}function addIdToRecentlyViewed(handle){if(!handle){let product=document.querySelector(".thb-product-detail");product&&(handle=product.dataset.handle)}if(handle){if(window.localStorage){let recentIds=window.localStorage.getItem("recently-viewed");recentIds!="undefined"&&recentIds!=null&&(window.recentlyViewedIds=JSON.parse(recentIds))}var i=window.recentlyViewedIds.indexOf(handle);i>-1&&window.recentlyViewedIds.splice(i,1),window.recentlyViewedIds.unshift(handle),window.localStorage&&window.localStorage.setItem("recently-viewed",JSON.stringify(window.recentlyViewedIds))}}document.addEventListener("DOMContentLoaded",()=>{typeof SelectWidth<"u"&&new SelectWidth,typeof CartDrawer<"u"&&new CartDrawer});
2//# sourceMappingURL=/cdn/shop/t/36/assets/app.js.map?v=65769988580183007921768594490

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.