1class DropList extends HTMLElement{constructor(){super(),this._onDrop=this._onDrop.bind(this),this._onDragOver=this._onDragOver.bind(this),this._onDragLeave=this._onDragLeave.bind(this),this.attachShadow({mode:"open"}).innerHTML="<slot></slot>",this._checkIsEmpty()}connectedCallback(){this.addEventListener("drop",this._onDrop),this.addEventListener("dragover",this._onDragOver),this.addEventListener("dragleave",this._onDragLeave),this.setAttribute("dropzone","move")}disconnectedCallback(){this.removeEventListener("drop",this._onDrop),this.removeEventListener("dragover",this._onDragOver),this.removeEventListener("dragleave",this._onDragLeave)}_checkIsEmpty(){const t=this.querySelectorAll("drop-list-item").length>0;this.toggleAttribute("is-empty",!t)}_onDrop(t){this._isDraggingAllowed()&&(t.preventDefault(),this._draggingElement&&(this.appendChild(this._draggingElement),this._draggingElement=null),this.removeAttribute("active"),this._checkIsEmpty(),this._sortItemsByIndex())}_onDragLeave(){this._draggingElement=null,this.removeAttribute("active"),this._checkIsEmpty()}_onDragOver(t){if(this._isDraggingAllowed()&&(t.preventDefault(),this.setAttribute("active",""),!this._draggingElement)){const s=t.composedPath().find((t=>1===t.nodeType&&"SLOT"!==t.nodeName))?.getRootNode();this._draggingElement=s?.querySelector("[dragging]")||document.querySelector("[dragging]")}}_isDraggingAllowed(){return!this.closest(".loading")&&!this.classList.contains("loading")}_sortItemsByIndex(){const t=Array.from(this.querySelectorAll("drop-list-item"));t.sort(((t,s)=>parseInt(t.getAttribute("data-index"),10)-parseInt(s.getAttribute("data-index"),10))),t.forEach((t=>this.appendChild(t)))}}customElements.define("drop-list",DropList);class DropListItem extends HTMLElement{constructor(){super(),this.cart=this.closest(".js-cart-boxes"),this.cartDrawer=this.closest("cart-drawer-items"),this.mainCartItems=document.getElementById("main-cart-items")||document.getElementById("CartDrawer-CartItems"),this.cartItems=document.querySelector("cart-items")||document.querySelector("cart-drawer-items"),this.isIndissociable=this.hasAttribute("indissociable"),this.setAttribute("draggable","true"),this.addEventListener("drag",this._onDrag.bind(this)),this.addEventListener("dragstart",this._onDragStart.bind(this)),this.addEventListener("dragend",this._onDragEnd.bind(this)),this.addEventListener("drop",this._onDragEnd.bind(this)),this.addEventListener("dragover",this._onDragOver.bind(this)),this.addEventListener("dragleave",this._onDragLeave.bind(this)),this.attachShadow({mode:"open"}).innerHTML="<slot></slot>"}_onDragStart(t){if(this.isIndissociable)return Toast(window.notificationStrings.indissociable,"notice"),void t.preventDefault();this._isDraggingAllowed()?this.setAttribute("dragging",""):t.preventDefault()}_isDraggingAllowed(){return!this.closest(".loading")&&!this.classList.contains("loading")}_onDrag(t){if(!t.target.hasAttribute("dragging")||!this.cartDrawer)return;const s=this.cartDrawer||this.cart||document.documentElement,{top:i,height:e}=s.getBoundingClientRect(),h=t.clientY,r=this.cartDrawer?100:150;this.stopY=!0,h<r?(this.stopY=!1,this._scroll(-1)):h>i+e-r&&!this._verticalMaxed()&&(this.stopY=!1,this._scroll(1))}_scroll(t){this.cartDrawer.scroll(0,this.cartDrawer.scrollTop+t),this.stopY||requestAnimationFrame((()=>this._scroll(t)))}_verticalMaxed(){return this.cartDrawer.scrollHeight<=this.cartDrawer.scrollTop+this.cartDrawer.clientHeight}_onDragEnd(t){this._save(t),this.removeAttribute("over"),this.removeAttribute("dragging"),this.stopY=!0}_onDragOver(){this.toggleAttribute("over",!this.hasAttribute("dragging"))}_onDragLeave(){this.removeAttribute("over")}_save(t){const s=t.target.closest("drop-list-item"),i=s.getAttribute("ref"),e=s.getAttribute("parent")||i,h=s.parentElement.getAttribute("ref");if(e===h||s.hasAttribute("saving"))return;addPreloader(s.parentElement),s.setAttribute("saving","true");const r=s.dataset.index,o=itemOfLine(r);if(!o)return;const n=indexOfItem(o.key);s.setAttribute("parent",h),this.mainCartItems.classList.add("cart__items--disabled");const a=Array.from(this.cartItems.querySelectorAll(`.loading-overlay[data-index="${r}"]`));a.forEach((t=>t.classList.remove("hidden"))),this.cartItems.lineItemStatusElement.setAttribute("aria-hidden",!1);const d=fetchRequestConfig("javascript"),c=new FormData;addFormDataProperties(c,n),c.set("id",o.key),c.set("quantity",o.quantity),h&&h!==i?c.set("properties[_parent]",h):c.delete("properties[_parent]"),c.set("sections",this._getSectionsToRender().map((t=>t.section))),c.set("sections_url",window.location.pathname),d.body=c,fetch(`${routes.cart_
1change_url}`,d).then((t=>t.json())).then((t=>{Shopify.setCartProperties(t),this._updateSections(t),s.removeAttribute("saving")})).finally((()=>{this.mainCartItems.classList.remove("cart__items--disabled"),a.forEach((t=>t.classList.add("hidden"))),this.cartItems.disableLoading(),removePreloader(s.parentElement)}))}_updateSections(t){this._getSectionsToRender().forEach((s=>{let i=s.selector?document.querySelector(s.selector):document.getElementById(s.id);!i&&document.getElementById(s.id)&&(i=document.getElementById(s.id).querySelector(s.selector)),i&&t.sections[s.section]?i.innerHTML=this._getSectionInnerHTML(t.sections[s.section],s.selector):i&&t.sections[s.id]&&(i.innerHTML=this._getSectionInnerHTML(t.sections[s.id],s.selector))}))}_getSectionsToRender(){const t=[],s=document.getElementById("main-cart-items");s&&t.push({id:"main-cart-items",section:s.dataset.id,selector:".js-cart-boxes"});return document.querySelector("cart-drawer")&&t.push({id:"CartDrawer",section:"cart-drawer",selector:".drawer__inner"}),t}_getSectionInnerHTML(t,s){return(new DOMParser).parseFromString(t,"text/html").querySelector(s).innerHTML}}customElements.define("drop-list-item",DropListItem);class DragDropWithTouchSupportShim{constructor({threshold:t=5,opacity:s=.8,dblClick:i=500,ctxMenu:e=900,isPressHoldMode:h=150,pressHoldAwait:r=150,pressHoldMargin:o=25,pressHoldThreshold:n=0,touchLongAwait:a=150}={}){this.setting={THRESHOLD:t,OPACITY:s,DBL_CLICK:i,CTX_MENU:e,IS_PRESS_HOLD_MODE:h,PRESS_HOLD_AWAIT:r,PRESS_HOLD_MARGIN:o,PRESS_HOLD_THRESHOLD:n,TOUCH_LONG_AWAIT:a},this._isTouchLong=!1,this.setInternalHoldersToDefault(),this.__removeAttributes="id,class,style,draggable".split(","),this.__keyboardProperties="altKey,ctrlKey,metaKey,shiftKey".split(","),this.__coordinateProperties="pageX,pageY,clientX,clientY,screenX,screenY".split(","),document.addEventListener("touchstart",this.touchstart.bind(this),{passive:!1,capture:!1}),document.addEventListener("touchmove",this.touchmove.bind(this),{passive:!1,capture:!1}),document.addEventListener("touchend",this.touchend.bind(this)),document.addEventListener("touchcancel",this.touchend.bind(this))}setInternalHoldersToDefault(){this._destroyImage(),this._dragSource=null,this._lastTouch=null,this._lastTarget=null,this._ptDown=null,this._isDragEnabled=!1,this._isDropZone=!1,clearInterval(this._pressHoldInterval)}touchstart(t){if(this.__shouldHandleEvent(t)){if(this.__timerTouch=setTimeout((()=>{this._isTouchLong=!0}),this.setting.TOUCH_LONG_AWAIT),Date.now()-this._lastClick<this.setting.DBL_CLICK&&this._dispatchEvent(t,"dblclick",t.target))return t.preventDefault(),void this.setInternalHoldersToDefault();this.setInternalHoldersToDefault();const s=this.__findClosestDraggable(t);if(s&&!this._dispatchEvent(t,"mousemove",t.target)&&!this._dispatchEvent(t,"mousedown",t.target)){this._dragSource=s,this._ptDown=this._getPoint(t),this._lastTouch=t,this._isTouchLong&&t.preventDefault();const i=t.target.closest("drop-list-item");if(i.hasAttribute("indissociable")||"false"===i.getAttribute("draggable"))return;setTimeout((()=>{this._dragSource==s&&null==this._img&&this._dispatchEvent(t,"contextmenu",s)&&this.setInternalHoldersToDefault()}),this.setting.CTX_MENU),this.setting.IS_PRESS_HOLD_MODE&&(this._pressHoldInterval=setTimeout((()=>{t.preventDefault(),this._isDragEnabled=!0,this.touchmove(t)}),this.setting.PRESS_HOLD_AWAIT))}}}touchmove(t){if(this._shouldCancelPressHoldMove(t))this.setInternalHoldersToDefault();else if(this._shouldHandleMove(t)||this._shouldHandlePressHoldMove(t)){const s=this.__getDragOverTarget(t);if(this._dispatchEvent(t,"mousemove",s))return this._lastTouch=t,void t.preventDefault();this._dispatchEvent(t,"drag",this._dragSource),this._dragSource&&!this._img&&this._shouldStartDragging(t)&&(this._dispatchEvent(t,"dragstart",this._dragSource),this._createImage(t),this._dispatchEvent(t,"dragenter",s)),this._img&&(this._lastTouch=t,t.preventDefault(),s!=this._lastTarget&&(this._dispatchEvent(this._lastTouch,"dragleave",this._lastTarget),this._dispatchEvent(t,"dragenter",s),this._lastTarget=s),this._moveImage(t),this._isDropZone=this._dispatchEvent(t,"dragover",s))}}touchend(t){if(this.__shouldHandleEvent(t)){if(this._dispatchEvent(this._lastTouch,"mouseup",t.target))return void t.preventDefault();this._img||(this._dragSource=null,this._dispatchEvent(this._lastTouch,"click",t.composedPath()[0]),this._lastClick=Date.now()),this._destroyImage(),this.__timerTouch&&(clearTimeout(this.__timerTouch),this._isTouchLong=!1),this._dragSource&&(t.type.indexOf("cancel")<0&&this._dispatchEvent(this._lastTouch,"drop",this._lastTarget),this._dispatchEvent(this._lastTouch,"dragend",this._dragSource),this.setInternalHoldersToDefault())}}__shouldHandleEvent(t){return t&&!t.defaultPrevented&&t.touches&&t.touches.length<2}_shouldHandleMove(t){return!this.setting.IS_PRESS_HOLD_MODE&&this.__shouldHandleEvent(t)}_shouldHandlePressHoldMove(t){return this.setting.IS_PRESS_HOLD_MODE&&this._isDragEnabled&&t&&t.touches&&t.touches.length}_shouldCancelPressHoldMove(t){return this.setting.IS_PRESS_HOLD_MODE&&!this._isDragEnabled&&this._getDelta(t)>this.setting.PRESS_HOLD_MARGIN}_shouldStartDragging(t){const s=this._getDelta(t);return s>this.setting.THRESHOLD||this.setting.IS_PRESS_HOLD_MODE&&s>=this.setting.PRESS_HOLD_THRESHOLD}_getPoint(t,s=!1){return t&&t.touches&&(t=t.touches[0]),{x:s?t.pageX:t.clientX,y:s?t.pageY:t.clientY}}_getDelta(t){if(this.setting.IS_PRESS_HOLD_MODE&&!this._ptDown)return 0;const s=this._getPoint(t);return Math.abs(s.x-this._ptDown.x)+Math.abs(s.y-this._ptDown.y)}__getDragOverTarget(t){let s;const i=t.composedPath().find((t=>
11===t.nodeType&&"SLOT"!==t.nodeName));if(i){const e=i.getRootNode(),h=this._getPoint(t);s=e.elementFromPoint(h.x,h.y)}return s}_createImage(t){this._img&&this._destroyImage();const s=this._imgCustom||this._dragSource;if(this._img=s.cloneNode(!0),this._copyStyle(s,this._img),this._img.style.top=this._img.style.left="-9999px",!this._imgCustom){const i=s.getBoundingClientRect(),e=this._getPoint(t);this._imgOffset={x:e.x-i.left,y:e.y-i.top},this._img.style.opacity=this.setting.OPACITY.toString()}this._moveImage(t),document.body.appendChild(this._img)}_destroyImage(){this._img&&this._img.parentElement&&this._img.parentElement.removeChild(this._img),this._img=null,this._imgCustom=null}_moveImage(t){requestAnimationFrame((()=>{if(this._img){const s=this._getPoint(t,!0),i=this._img.style;i.position="absolute",i.pointerEvents="none",i.zIndex="999999",i.left=`${Math.round(s.x-this._imgOffset.x)}px`,i.top=`${Math.round(s.y-this._imgOffset.y)}px`}}))}_copyProps(t,s,i){for(let e=0;e<i.length;e++){const h=i[e];t[h]=s[h]}}_copyStyle(t,s){if(this.__removeAttributes.forEach((t=>s.removeAttribute(t))),t instanceof HTMLCanvasElement){const i=t,e=s;e.width=i.width,e.height=i.height,e.getContext("2d").drawImage(i,0,0)}const i=getComputedStyle(t);for(let t=0;t<i.length;t++){const e=i[t];e.indexOf("transition")<0&&(s.style[e]=i[e])}s.style.pointerEvents="none";for(let i=0;i<t.children.length;i++)this._copyStyle(t.children[i],s.children[i])}_dispatchEvent(t,s,i){if(t&&i){const e=document.createEvent("Event"),h=t.touches?t.touches[0]:t;e.initEvent(s,!0,!0),e.button=0,e.which=e.buttons=1;try{this._copyProps(e,t,this.__keyboardProperties),this._copyProps(e,h,this.__coordinateProperties)}catch(t){}return i.dispatchEvent(e),e.defaultPrevented}return!1}__findClosestDraggable(t){return t.composedPath().find((t=>t.attributes&&t.hasAttribute("draggable")))}}("ontouchstart"in window||(navigator.maxTouchPoints||0)>0||window.matchMedia&&matchMedia("(pointer: coarse)").matches)&&(window.__DRAG_TOUCH_SHIM__||"function"==typeof DragDropWithTouchSupportShim&&document.querySelector(".js-cart-boxes")&&(window.__DRAG_TOUCH_SHIM__=new DragDropWithTouchSupportShim({threshold:6,opacity:.8,dblClick:500,ctxMenu:900,isPressHoldMode:150,pressHoldAwait:150,pressHoldMargin:25,pressHoldThreshold:0,touchLongAwait:150})));
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.