PageSourceSearch

https://chiemgaukorn.de/cdn/shop/t/3/assets/add-to-cart.js?v=157761415605003885381744275109

js chiemgaukorn.de collected 2026-09-24 22:59:59 UTC 3,536 bytes, 2 lines download raw bytes

1import{EVENTS}from"@archetype-themes/utils/events";import{trapFocus,removeTrapFocus}from"@archetype-themes/utils/a11y";const classes={isAdded:"is-added"};class AddToCart extends HTMLElement{constructor(){super(),this.handleCartDrawerChange=this.handleCartDrawerChange.bind(this)}connectedCallback(){this.qtySelector=this.querySelector("quantity-selector"),this.qtySelectorInput=this.qtySelector?.querySelector('input[name="quantity"]'),this.button=this.querySelector(".js-add-to-cart"),this.successMessage=this.querySelector(".js-added"),this.abortController=new AbortController,this.variantId=this.dataset.variantId,this.changingQuantity=!1,this.smallContainer=!1,this.activeElement=null,this.count=this.getAttribute("data-count")?parseInt(this.getAttribute("data-count")):0,this.container=this.closest(".product-grid-item"),!(!this.button||!this.qtySelector)&&(this.resizeObserver=new ResizeObserver(this.handleResize.bind(this)),!this.count&&this.container&&this.resizeObserver.observe(this.container),this.qtySelector.addEventListener("quantity:change",this.handleQuantityChange.bind(this),{signal:this.abortController.signal}),this.addEventListener("mouseover",this.open.bind(this),{signal:this.abortController.signal}),this.addEventListener("mouseout",this.close.bind(this),{signal:this.abortController.signal}),this.button.addEventListener("click",()=>{this.button.getAttribute("aria-expanded")=="false"?this.open():this.close()},{signal:this.abortController.signal}),this.addEventListener("focusout",evt=>(!this.contains(evt.relatedTarget)||!this.contains(evt.target))&&this.close(),{signal:this.abortController.signal}),this.addEventListener("keydown",evt=>evt.key==="Escape"&&this.close(),{signal:this.abortController.signal}),document.addEventListener(EVENTS.cartDrawerChange,this.handleCartDrawerChange,{signal:this.abortController.signal}))}disconnectedCallback(){this.abortController.abort()}open(){!this.button||this.count||this.smallContainer||(this.button.setAttribute("aria-expanded","true"),this.button.setAttribute("disabled","disabled"),this.classList.remove(classes.isAdded),this.contains(document.activeElement)&&this.qtySelectorInput.focus())}close(){!this.button||this.changingQuantity||this.count||this.smallContainer||(this.button.setAttribute("aria-expanded","false"),this.button.removeAttribute("disabled"),this.activeElement&&this.activeElement.focus())}async handleQuantityChange({detail}){this.contains(document.activeElement)&&(this.activeElement=document.activeElement),this.changingQuantity=!0;const body={updates:{[this.variantId]:detail.qty},sections:["cart-ajax"]},response=await this.updateCart(body);this.handleProductAdded(response)}handleProductAdded(response){this.dispatchEvent(new CustomEvent(EVENTS.ajaxProductAdded,{bubbles:!0,detail:{product:response,preventCartOpen:!0}})),this.activeElement.classList.contains("js-qty__adjust--plus")&&(this.classList.add(classes.isAdded),trapFocus(this.successMessage))}async updateCart(body){return fetch(`${window.Shopify.routes.root}cart/update.js`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(body)}).then(response=>{if(!response.ok)throw response;return response.json()})}handleCartDrawerChange(){this.classList.remove(classes.isAdded),removeTrapFocus(this.activeElement)}handleResize(){this?.container?.offsetWidth<=235?this.smallContainer=!0:this.smallContainer=!1}}customElements.define("at-add-to-cart",AddToCart);
2//# sourceMappingURL=/cdn/shop/t/3/assets/add-to-cart.js.map?v=157761415605003885381744275109

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.