PageSourceSearch

https://photoframesandart.com/cdn/shop/t/64/assets/cart-drawer.js?v=133015243203373635441770206172

js photoframesandart.com collected 2026-10-08 05:26:01 UTC 5,045 bytes, 2 lines download raw bytes

1class CartDrawerSection extends HTMLElement{cartUpdateUnsubscriber=void 0;constructor(){super(),this.cartType=this.dataset.cartType,this.drawerClass="wt-cart__drawer",this.drawer=this.querySelector(`.${this.drawerClass}`),this.classDrawerActive=`${this.drawerClass}--open`,this.pageOverlayClass="page-overlay-cart",this.activeOverlayBodyClass=`${this.pageOverlayClass}-on`,this.body=document.body,this.triggerQuery=[".wt-cart__trigger",".wt-cart__back-link",`.${this.pageOverlayClass}`].join(", "),this.triggers=()=>document.querySelectorAll(this.triggerQuery),this.isOpen=!1,this.isCartPage=window.location.pathname===window.routes.cart_url,this.closeButton=()=>this.querySelector(".wt-cart__drawer__close"),this.mainTrigger=document.querySelector(".wt-cart__trigger"),this.toggleEelements=()=>this.querySelectorAll(this.dataset.toggleTabindex),this.openerEl=null}connectedCallback(){if(this.cartType==="page"||this.isCartPage){document.addEventListener("cart-drawer:refresh",e=>this.refreshCartDrawer(e));return}this.init(),this.cartUpdateUnsubscriber=subscribe(PUB_SUB_EVENTS.cartUpdate,()=>{this.isOpen&&(setTabindex(this.toggleEelements(),"0"),this.closeButton().focus())})}disconnectedCallback(){this.cartUpdateUnsubscriber&&this.cartUpdateUnsubscriber()}rememberOpener(e){const current=e?.currentTarget,active=document.activeElement,interactive=current instanceof HTMLElement?current.closest?.("button, a, [tabindex], input, select")||current:null;this.openerEl=interactive instanceof HTMLElement?interactive:active instanceof HTMLElement?active:null}restoreFocusToOpener(){const el=this.openerEl;!el||!document.contains(el)||el.hasAttribute("disabled")||el.getAttribute("aria-disabled")==="true"||requestAnimationFrame(()=>{el.focus?.()})}getFocusableElements(){const focusableElementsSelector="button, [href], input, select, [tabindex]",focusableElements=()=>Array.from(this.querySelectorAll(focusableElementsSelector)).filter(el=>!el.hasAttribute("disabled")&&el.tabIndex>=0);return{focusableElements,first:focusableElements()[0],last:focusableElements()[focusableElements().length-1]}}temporaryHideFocusVisible(){document.body.classList.add("no-focus-visible")}onToggle(){this.hasAttribute("open")?(this.removeAttribute("open"),this.isOpen=!1,this.temporaryHideFocusVisible(),setTabindex(this.toggleEelements(),"-1"),this.restoreFocusToOpener()):(this.setAttribute("open",""),this.isOpen=!0,this.closeButton().focus(),this.temporaryHideFocusVisible(),setTabindex(this.toggleEelements(),"0"))}toggleDrawerClasses(){this.onToggle(),this.drawer.classList.toggle(this.classDrawerActive),this.body.classList.toggle(this.activeOverlayBodyClass);const eventName=this.isOpen?PUB_SUB_EVENTS.cartDrawerOpen:PUB_SUB_EVENTS.cartDrawerClose;document.dispatchEvent(new CustomEvent(eventName,{bubbles:!0}))}init(){this.addEventListener("keydown",e=>{const isTabPressed=e.key==="Tab"||e.keyCode===9||e.code==="Tab",{first,last}=this.getFocusableElements();(e.key==="Escape"||e.keyCode===27||e.code==="Escape")&&this.isOpen&&this.toggleDrawerClasses(),isTabPressed&&(e.shiftKey&&document.activeElement===first?(last.focus(),e.preventDefault()):!e.shiftKey&&document.activeElement===last&&(first.focus(),e.preventDefault()))}),this.triggers().forEach(trigger=>{trigger.addEventListener("click",e=>{e.preventDefault(),this.isOpen||this.rememberOpener(e),this.toggleDrawerClasses()})}),this.addEventListener("click",e=>{e.target.classList.contains("wt-cart__drawer__close")&&(e.preventDefault(),this.toggleDrawerClasses())}),document.addEventListener("cart-drawer:refresh",e=>this.refreshCartDrawer(e))}renderContents(parsedState,isClosedCart=!0){this.getSectionsToRender().forEach(section=>{const sectionElement=section.selector?document.querySelector(section.selector):document.getElementById(section.id);sectionElement.innerHTML=this.getSectionInnerHTML(parsedState.sections[section.id],section.selector)}),isClosedCart&&setTimeout(()=>{this.toggleDrawerClasses(),this.isOpen&&this.closeButton().focus()})}getSectionInnerHTML(html,selector=".shopify-section"){return new DOMParser().parseFromString(html,"text/html").querySelector(selector).innerHTML}getSectionsToRender(){return[{id:"cart-drawer",selector:"#CartDrawer"},{id:"cart-icon-bubble"}]}refreshCartDrawer(e){const sectionsToRender=this.getSectionsToRender();fetch(`${window.Shopify.routes.root}?sections=${sectionsToRender[0].id},${sectionsToRender[1].id}`).then(response=>response.json()).then(response=>{const parsedState={sections:response};this.renderContents(parsedState,!1)}).catch(e2=>{console.log(e2)})}setActiveElement(element){this.activeElement=element}}customElements.define("cart-drawer",CartDrawerSection);class CartDrawerItems extends CartItems{getSectionsToRender(){return[{id:"CartDrawer",section:"cart-drawer",selector:".drawer__inner"},{id:"cart-icon-bubble",section:"cart-icon-bubble",selector:".shopify-section"}]}}customElements.define("cart-drawer-items",CartDrawerItems);
2//# sourceMappingURL=/cdn/shop/t/64/assets/cart-drawer.js.map?v=133015243203373635441770206172

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.