PageSourceSearch

https://dogtopiashop.com/cdn/shop/t/4/assets/app.js?v=42222119013632461731756941135

js dogtopiashop.com collected 2026-10-08 07:40:09 UTC 19,185 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()}connectedCallback(){this.input=this.querySelector(".qty"),this.step=parseFloat(this.input.getAttribute("step"))||1,this.changeEvent=new Event("change",{bubbles:!0}),this.subtract=this.querySelector(".minus"),this.add=this.querySelector(".plus"),this.subtract.addEventListener("click",()=>this.changeQuantity(-1*this.step)),this.add.addEventListener("click",()=>this.changeQuantity(1*this.step)),this.classList.add("buttons_added"),this.validateQtyRules()}changeQuantity(change){let quantity=parseInt(this.input.value)||0;const newValue=Math.max(quantity+change,1),min=parseInt(this.input.min)||1,max=parseInt(this.input.max)||1/0;newValue<min||newValue>max||(this.input.value=newValue,this.input.dispatchEvent(this.changeEvent),this.validateQtyRules())}validateQtyRules(){const value=parseInt(this.input.value)||0,min=parseInt(this.input.min)||1,max=parseInt(this.input.max)||1/0;this.subtract.classList.toggle("disabled",value<=min),this.add.classList.toggle("disabled",value>=max)}}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-card-image-link .product-primary-image"),this.additional_images=this.querySelectorAll(".product-secondary-image"),this.additional_images_nav=this.querySelectorAll(".product-secondary-images-nav li"),this.quick_add=this.querySelector(".product-card--add-to-cart-button-simple")}connectedCallback(){this.swatches&&this.enableSwatches(),this.additional_images&&this.enableAdditionalImages(),this.quick_add&&this.enableQuickAdd()}enableAdditionalImages(){let image_length=this.additional_images.length,images=this.additional_images,nav=this.additional_images_nav,image_container=this.querySelector(".product-card-image");const mousemove=function(e){let l=e.offsetX,w=this.getBoundingClientRect().width,prc=l/w,sel=Math.floor(prc*image_length),selimg=images[sel];images.forEach((image,index)=>{image.classList.contains("hover")&&(image.classList.remove("hover"),nav.length&&nav[index].classList.remove("active"))}),selimg&&(selimg.classList.contains("hover")||(selimg.classList.add("hover"),nav.length&&nav[sel].classList.add("active")))},mouseleave=function(e){images.forEach((image,index)=>{image.classList.remove("hover"),nav.length&&nav[index].classList.remove("active")})};image_container&&(image_container.addEventListener("touchstart",mousemove,{passive:!0}),image_container.addEventListener("touchmove",mousemove,{passive:!0}),image_container.addEventListener("touchend",mouseleave,{passive:!0}),image_container.addEventListener("mouseenter",mousemove,{passive:!0}),image_container.addEventListener("mousemove",mousemove,{passive:!0}),image_container.addEventListener("mouseleave",mouseleave,{passive:!0})),window.addEventListener("load",()=>{images.forEach(function(image){lazySizes.loader.unveil(image)})})}enableSwatches(){let swatch_list=this.swatches.querySelectorAll(".product-card-swatch");this.color_index=this.swatches.dataset.index,this.org_srcset=this.image?this.image.dataset.srcset:"",this.addEventListener("change",this.onSwatchChange.bind(this)),swatch_list.forEach(swatch=>{window.addEventListener("load",()=>{let image=new Image;image.srcset=swatch.dataset.srcset,lazySizes.loader.unveil(image)}),swatch.addEventListener("click",this.onSwatchClick),swatch.addEventListener("mouseover",this.onSwatchHover)})}onSwatchClick(){window.location.href=this.dataset.href}onSwatchHover(){let swatch_input=this.previousElementSibling;swatch_input.checked=!0,swatch_input.dispatchEvent(new Event("change",{bubbles:!0}))}onSwatchChange(evt){this.image&&(evt.target.dataset.srcset?this.image.setAttribute("srcset",evt.target.dataset.srcset):this.image.setAttribute("srcset",this.org_srcset))}enableQuickAdd(){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;return formData.append("id",this.quick_add.dataset.productId),formData.append("quantity",1),formData.append("sections",this.get
1SectionsToRender().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-secondary-area--item-count"},{id:"cart-drawer-toggle",section:"cart-bubble",selector:".thb-secondary-area--item-amount"}]}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)})),document.getElementById("Cart-Drawer")&&(document.getElementById("Cart-Drawer").open(),document.getElementById("Cart-Drawer").removeProductEvent())}getSectionInnerHTML(html,selector=".shopify-section"){return new DOMParser().parseFromString(html,"text/html").querySelector(selector)?.innerHTML}}customElements.define("product-card",ProductCard)}if(!customElements.get("side-panel-close")){class PanelClose extends HTMLElement{constructor(){super();let cc=document.querySelector(".click-capture");this.addEventListener("click",e=>this.close_panel(e)),document.addEventListener("panel:close",e=>{let panel=document.querySelectorAll(".side-panel.active");panel.length&&this.close_panel(e,panel[0])}),cc.addEventListener("click",e=>{let panel=document.querySelectorAll(".side-panel.active");panel&&this.close_panel(e,panel[0])})}close_panel(e,panel){e&&e.preventDefault(),!(!panel&&(panel=e?.target.closest(".side-panel"),!panel))&&(panel.classList.remove("active"),document.body.classList.remove("open-cc"),panel.setAttribute("inert",""))}}customElements.define("side-panel-close",PanelClose),document.addEventListener("keyup",e=>{e.code&&e.code.toUpperCase()==="ESCAPE"&&dispatchCustomEvent("panel:close")})}if(!customElements.get("cart-drawer")){class CartDrawer extends HTMLElement{constructor(){super()}connectedCallback(){this.isOpen=!1,this.button=document.getElementById("cart-drawer-toggle"),this.debouncedOnChange=debounce(event=>{this.onChange(event)},300),document.addEventListener("cart:refresh",event=>{this.refresh()}),this.addEventListener("change",this.debouncedOnChange.bind(this)),this.removeProductEvent(),document.addEventListener("click",this.onWindowClick.bind(this)),this.button.addEventListener("click",e=>{e.preventDefault(),this.isOpen?this.close():this.open()}),document.addEventListener("keyup",e=>{e.code&&e.code.toUpperCase()==="ESCAPE"&&this.close()})}onWindowClick(event){!this.contains(event.target)&&this.isOpen&&!this.button.contains(event.target)&&this.close()}open(){this.removeAttribute("inert"),this.focus(),this.isOpen=!0,dispatchCustomEvent("cart-drawer:open")}close(){this.setAttribute("inert",""),this.isOpen=!1}onChange(event){event.target.classList.contains("qty")&&this.updateQuantity(event.target.dataset.index,event.target.value)}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--inner"},{id:"cart-drawer-toggle",section:"cart-bubble",selector:".thb-secondary-area--item-count"},{id:"cart-drawer-toggle",section:"cart-bubble",selector:".thb-secondary-area--item-amount"}]}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);parsedState.sections&&(elementToReplace.innerHTML=this.getSectionInnerHTML(parsedState.sections[section.section],section.selector))})),this.removeProductEvent(),dispatchCustomEvent("line-item:change:end",{quantity,cart:parsedState}),this.querySelector(`#CartDrawerItem-${line}`)&&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",CartDrawer)}if(!customElements.get("localization-form")){class LocalizationForm extends HTMLElement{constructor(){super(),this.form=this.querySelector("form"),this.inputs=this.form.querySelectorAll('[name="locale_code"], [name="country_code"]'),this.debouncedOnSubmit=debounce(event=>{this.onSubmitHandler(event)},200),this.inputs.forEach(item=>item.addEventListener("change",this.debouncedOnSubmit.bind(this)))}onSubmitHandler(event){this.form&&this.form.submit()}}customElements.define("localization-form",LocalizationForm)}if(!customElements.get("resize-select")){class ResizeSelect extends HTMLElement{constructor(){super()}connectedCallback(){this.select=this.querySelector("select"),this.addEventListeners()}addEventListeners(){this.addEventListener("change",this.resizeSelect.bind(this)),window.addEventListener("load",this.resizeSelect.bind(this)),this.resizeSelect()}resizeSelect(){let tempOption=document.createElement("option");tempOption.textContent=this.select.selectedOptions[0].textContent;let tempSelect=document.createElement("select"),offset=10;tempSelect.style.visibility="hidden",tempSelect.style.position="fixed",tempSelect.appendChild(tempOption),this.after(tempSelect),tempSelect.clientWidth>0&&(this.select.style.width=`${+tempSelect.clientWidth+offset}px`),tempSelect.remove()}}customElements.define("resize-select",ResizeSelect)}if(!customElements.get("quick-view")){class QuickView extends HTMLElement{constructor(){super()}connectedCallback(){this.drawer=document.getElementById("Product-Modal"),this.body=document.body,this.addEventListener("click",this.setupEventListener.bind(this)),this.addEventListener("keypress",this.setupEventListener.bind(this))}setupEventListener(e){if(e.key&&e.key!=="Enter")return;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-Modal-Content").innerHTML;this.renderQuickview(sectionInnerHTML,href,productHandle)})))}renderQuickview(sectionInnerHTML,href,productHandle){if(sectionInnerHTML){this.drawer.querySelector("#Product-Modal-Content").innerHTML=sectionInnerHTML;let js_files=this.drawer.querySelector("#Product-Modal-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(()=>{Shopify&&Shopify.PaymentButton&&Shopify.PaymentButton.init(),window.ProductModel&&window.ProductModel.loadShopifyXR()},300),this.drawer.setAttribute("open",""),this.drawer.querySelector(".product-modal__toggle").focus(),setTimeout(()=>{this.drawer.querySelector("#Product-Slider").reInit(),window.dispatchEvent(new Event("resize"))},100),dispatchCustomEvent("quick-view:open",{productUrl:href,productHandle}),addIdToRecentlyViewed(productHandle)}}}customElements.define("quick-view",QuickView)}if(!customElements.get("theme-scroll")){class ThemeScroll extends HTMLElement{constructor(){super(),this.viewport=this.querySelector(".theme-scroll--inner"),this.slideWidth=274,this.slidesToScroll=1}connectedCallback(){window.OverlayScrollbarsGlobal.OverlayScrollbars({target:this,elements:{viewport:this.viewport}},{}),this.init()}init(){this.setSlides(),this.reachedEnd=0,!(this.slides.length<1)&&(this.nav=this.querySelector(".theme-scroll-nav"),this.navPrev=this.querySelector(".flickity-prev"),this.navNext=this.querySelector(".flickity-next"),this.resizeObserver=new ResizeObserver(entries=>{this.slideWidth=this.slides[1].offsetLeft-this.slides[0].offsetLeft,this.reachedEnd=this.viewport.scrollWidth-this.viewport.offsetWidth==this.viewport.scrollLeft,this.onNavDisabled()},{root:this}),this.debouncedOnScroll=debounce(event=>{this.onScroll(event)},100),this.setListeners(),this.centerArrows())}setSlides(){this.slides=this.querySelectorAll(".carousel__slide"),this.slidesLength=this.slides.length,this.lastSlide=this.slides[this.slides.length-1]}setListeners(){this.nav.addEventListener("click",this.onNavClick.bind(this)),this.viewport.addEventListener("scroll",this.debouncedOnScroll.bind(this)),this.viewport.addEventListener("resize",this.debouncedOnScroll.bind(this)),this.resizeObserver.observe(this.slides[0])}onScroll(){this.reachedEnd=this.viewport.scrollWidth-this.viewport.offsetWidth==Math.floor(this.viewport.scrollLeft),this.onNavDisabled()}onNavClick(e){e.target.matches(".flickity-nav")&&(e.target.name==="next"?this.scrollPos=this.viewport.scrollLeft+this.slidesToScroll*this.slideWidth:e.target.name==="prev"&&(this.scrollPos=this.viewport.scrollLeft-this.slidesToScroll*this.slideWidth),this.viewport.scrollTo({left:this.scrollPos,behavior:"smooth"}))}onNavDisabled(){this.navPrev&&(this.navPrev.disabled=this.viewport.scrollLeft===0?1:0),this.navNext&&(this.navNext.disabled=this.reachedEnd?1:0)}centerArrows(){let first_cell=this.slides[0],max_height=0,image_height=0;if(first_cell.querySelector(".product-card-image")?image_height=first_cell.querySelector(".product-card-image").clientHeight:first_cell.querySelector(".gallery--item")&&(image_height=this.slides[1].querySelector(".product-card-image").clientHeight),image_height>
10&&(this.slides.forEach((item,i)=>{item.clientHeight>max_height&&(max_height=item.clientHeight)}),max_height>image_height)){let difference=(max_height-image_height)/-2;this.navPrev.style.transform="translateY("+difference+"px)",this.navNext.style.transform="translateY("+difference+"px)"}}}customElements.define("theme-scroll",ThemeScroll)}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.collapsed_mobile=this.classList.contains("accordion--collapsed-mobile"),this.animation=null,this.isClosing=!1,this.isExpanding=!1}connectedCallback(){this.setListeners()}setListeners(){this.initialized||(this.querySelector("summary").addEventListener("click",e=>this.onClick(e)),this.initialized=!0,this.collapsed_mobile&&(window.addEventListener("resize",()=>{this.details.open=window.innerWidth>768}),window.dispatchEvent(new Event("resize"))))}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:250,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="",this.dispatchEvent(new Event("animationend",{bubbles:!1}))}}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&&typeof recentIds!==void 0&&(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",()=>{let scrollbarWidth=window.innerWidth-document.body.clientWidth;document.documentElement.style.setProperty("--scrollbar-width",scrollbarWidth+"px")});
2//# sourceMappingURL=/cdn/shop/t/4/assets/app.js.map?v=42222119013632461731756941135

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.