PageSourceSearch

https://www.selkirk.com/cdn/shop/t/642/assets/cart-scripts.js?v=4944778283070871511790019821

js selkirk.com collected 2026-10-01 10:27:21 UTC 45,006 bytes, 56 lines download raw bytes

1const CURRENCY_SYM=window.SelkirkStore?.currencySymbol||"$",ICON_TRUCK_SVG='<svg class="icon icon-truck" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512" aria-hidden="true" focusable="false" role="presentation"><path fill="currentColor" d="M48 0C21.5 0 0 21.5 0 48V368c0 26.5 21.5 48 48 48H64c0 53 43 96 96 96s96-43 96-96H384c0 53 43 96 96 96s96-43 96-96h32c17.7 0 32-14.3 32-32s-14.3-32-32-32V288 256 237.3c0-17-6.7-33.3-18.7-45.3L512 114.7c-12-12-28.3-18.7-45.3-18.7H416V48c0-26.5-21.5-48-48-48H48zM416 160h50.7L544 237.3V256H416V160zM160 464c-26.5 0-48-21.5-48-48s21.5-48 48-48s48 21.5 48 48s-21.5 48-48 48zm368-48c0 26.5-21.5 48-48 48s-48-21.5-48-48s21.5-48 48-48s48 21.5 48 48z"/></svg>';document.addEventListener("DOMContentLoaded",function(){Cart.init()});const Cart={selectors:{htmlEl:{selector:"html",type:"single",scope:"document"},cartIcon:{selector:".header-cart .cart-icon",type:"single",scope:"document"},cartClose:{selector:".close-cart",type:"single",scope:"document"},wrapperOverlay:{selector:".wrapper-overlay",type:"single",scope:"document"},removeItemBtns:{selector:".mini-products-list .btn-remove, .cart-list .btn-remove",type:"all",scope:"document"},noItems:{selector:".no-items",type:"single",scope:"document"},hasItems:{selector:".has-items",type:"single",scope:"document"},loadingSpinner:{selector:".icon-loading",type:"single",scope:"document"},cartTemplate:{selector:".cart-template",type:"single",scope:"document"},quantityInputs:{selector:".item-quantity",type:"all",scope:"document"},addGiftBtns:{selector:".gift-product-card button",type:"all",scope:"document"},quickAddBtns:{selector:".quick-add-to-cart",type:"all",scope:"document"},hasAnyTiersBars:{selector:".progress-bar-tiers",type:"all",scope:"document"},multiplierProgressBar:{selector:".progress-bar-multiplier",type:"single",scope:"document"},progressFreeShippingBar:{selector:".free_shipping_progress",type:"single",scope:"document"},dropdownCart:{selector:"#dropdown-cart",type:"single",scope:"document"},fullPageShippingEl:{selector:".price.shipping-price",type:"single",scope:"document"},sideBarShippingEl:{selector:".price-text.shipping-text",type:"single",scope:"document"},popupChatCartConfirmShippingEl:{selector:"[data-cart-confirm-shipping]",type:"single",scope:"document"},upsellContainers:{selector:".upsell-promo-container",type:"all",scope:"document"},defaultContainer:{selector:".customers-also-bought",type:"single",scope:"document"},customBannerLink:{selector:".custom-banner-link",type:"single",scope:"document"}},init:async function(){Utility.fetchEls(this.selectors,this),this.initEventListeners(),this.promo="",this.promoAmount=.5,this.parent,this.threshold,this.UPCHARGE_VARIANT_ID="43392971997286",this.cartTemplate?this.parent=this.cartTemplate:this.parent=this.dropdownCart;const initialCartData=await this.getCartItems();initialCartData&&Array.isArray(initialCartData.items)&&initialCartData.items.some(item=>this.getLineProperty(item,"_bundle_token"))&&await this.updateCart()},getLineProperty:function(item,propertyName){if(!item||!item.properties)return null;if(Array.isArray(item.properties)){const match=item.properties.find(entry=>entry.name===propertyName||entry[0]===propertyName);if(match){const value2=match.value||match[1];if(value2!=null&&String(value2).trim()!=="")return String(value2).trim()}return null}const value=item.properties[propertyName];return value!=null&&String(value).trim()!==""?String(value).trim():null},GIFT_CARD_IDENTITY_PROPERTIES:["Recipient Email","Recipient Name","Send On","Message","_Design"],getGiftSignature:function(item){return JSON.stringify(this.GIFT_CARD_IDENTITY_PROPERTIES.map(propName=>this.getLineProperty(item,propName)||""))},getGiftSignatureFromParams:function(formParams){return JSON.stringify(formParams?this.GIFT_CARD_IDENTITY_PROPERTIES.map(propName=>(formParams.get(`properties[${propName}]`)||"").trim()):this.GIFT_CARD_IDENTITY_PROPERTIES.map(()=>""))},updateShippingDelayNotice:function(cartData){if(!cartData||!Array.isArray(cartData.items))return;const hasShippingDelay=cartData.items.some(item=>!!this.getLineProperty(item,"Shipping Delay"));
1document.querySelectorAll("#cart-shipping-delay-notice, #cart-drawer-shipping-delay-notice").forEach(notice=>{notice.style.display=hasShippingDelay?"flex":"none"})},syncSidebarLineItems:async function(cartData){if(!cartData||!Array.isArray(cartData.items)||!document.querySelector(".mini-products-list"))return;const analysis=this.analyzeBundleLines(cartData.items);for(let index=0;index<cartData.items.length;index+=1){const cartItem=cartData.items[index];if(analysis.componentKeys.has(cartItem.key)||this.getLineProperty(cartItem,"_bundle_token")&&!this.getLineProperty(cartItem,"_slot_id")||document.querySelector(`.cart-product-item[data-line-id="${CSS.escape(cartItem.key)}"]`))continue;const customGrip=this.getLineProperty(cartItem,"Custom Grip");await this.addItemToSidebarCart(String(cartItem.variant_id),cartItem.quantity,customGrip,cartItem.handle,!1,cartItem.key);const addedItem=document.querySelector(`.cart-product-item[data-line-id="${CSS.escape(cartItem.key)}"]`),bundleToken=this.getLineProperty(cartItem,"_bundle_token");addedItem&&bundleToken&&addedItem.setAttribute("data-bundle-token",bundleToken)}this.applyBundleSidebarVisibility(cartData),await this.ensureBundleDrawerMarkup(cartData)},initEventListeners:function(){const{htmlEl,cartIcon,cartClose,wrapperOverlay,removeItemBtns,quantityInputs,addGiftBtns,quickAddBtns,customBannerLink}=this;cartIcon&&cartIcon.addEventListener("click",event=>{event.preventDefault(),!window.location.href.includes("selkirk.com/cart")&&(Utility.hideProgressBarPopup(),htmlEl.classList.add("cart-show"))}),cartClose&&cartClose.addEventListener("click",()=>{Utility.restoreProgressBarPopup(),htmlEl.classList.remove("cart-show")}),wrapperOverlay&&wrapperOverlay.addEventListener("click",()=>{Utility.restoreProgressBarPopup(),htmlEl.classList.remove("cart-show")}),document.addEventListener("keydown",event=>{event.key==="Escape"&&htmlEl.classList.contains("cart-show")&&(Utility.restoreProgressBarPopup(),htmlEl.classList.remove("cart-show"))}),removeItemBtns&&removeItemBtns.forEach(btn=>{const item=btn.closest(".cart-product-item");btn.addEventListener("click",()=>{this.removeFromCart(item)})}),quantityInputs&&quantityInputs.forEach(input=>{input.addEventListener("change",()=>{const item=input.closest(".cart-product-item"),itemId=item.dataset.lineId;this.updateCartLineQuantity(itemId,input.value,item)})}),addGiftBtns&&addGiftBtns.forEach(btn=>{btn.addEventListener("click",event=>{this.addToCart(event)})}),quickAddBtns&&quickAddBtns.forEach(btn=>{btn.addEventListener("click",event=>{this.addToCart(event)})}),customBannerLink&&customBannerLink.addEventListener("click",event=>{const targetTitle=customBannerLink.getAttribute("data-target-title");if(targetTitle){const upsellBlocks=document.querySelectorAll(".upsell-promo-container:not(.hidden-block)");let targetBlock=null;if(upsellBlocks.forEach(block=>{block.getAttribute("data-promo-title")===targetTitle&&(targetBlock=block)}),targetBlock){event.preventDefault();const cartDrawer=document.getElementById("dropdown-cart");if(cartDrawer){const scrollPosition=targetBlock.offsetTop-20;cartDrawer.scrollTo({top:scrollPosition,behavior:"smooth"})}}}})},getCartItems:async function(){try{const url="/cart.js?t="+new Date().getTime(),response=await fetch(url,{method:"GET",headers:{"Cache-Control":"no-cache, no-store, must-revalidate",Pragma:"no-cache",Expires:"0"}});if(!response.ok)throw new Error("Network response was not ok.");return await response.json()}catch(error){console.error("Error getting cart",error)}},removeFromCart:async function(item){const{loadingSpinner}=this;loadingSpinner.style.display="block";const bundleToken=item.dataset.bundleToken;if(bundleToken){try{const cartData=await this.getCartItems(),updates={};cartData.items.forEach(cartItem=>{this.getLineProperty(cartItem,"_bundle_token")===bundleToken&&(updates[cartItem.key]=0)}),Object.keys(updates).length>0&&(await fetch("/cart/update.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({updates})}),Object.keys(updates).forEach(lineKey=>{const lineEl=document.querySelector(`.cart-product-item[data-line-id="${CSS.escape(lineKey)}"]`);lineEl&&lineEl.remove()}),document.querySelectorAll(`.cart-product-item[data-bundle-token="${CSS.escape(bundleToken)}"]`).forEach(lineEl=>{lineEl.remove()}))}catch(error){console.error("Error removing bundle:",error)}await this.updateCart(),loadingSpinner.style.display="none";return}const variantId=item.dataset.productId,gripValue=item.dataset.customGrip||"none",hasCu
1stomGrip=gripValue!=="none",upchargeEl=document.querySelector(`[data-product-id="${this.UPCHARGE_VARIANT_ID}"]`);let upchargeQtyEl=null,currentUpchargeTotal=0;upchargeEl&&(upchargeQtyEl=upchargeEl.querySelector(".item-quantity"),currentUpchargeTotal=parseInt(upchargeQtyEl.value,10));try{const splitLines=(await this.getCartItems()).items.filter(cartItem=>{if(this.getLineProperty(cartItem,"_bundle_token")||String(cartItem.variant_id)!==String(variantId))return!1;let cartItemGripValue="none";if(Array.isArray(cartItem.properties)){const gripProp=cartItem.properties.find(p=>p.name==="Custom Grip"||p[0]==="Custom Grip");if(gripProp){const val=gripProp.value||gripProp[1];val&&val.trim()!==""&&(cartItemGripValue=val.replace(" (BTOG)","").trim())}}else cartItem.properties&&cartItem.properties["Custom Grip"]&&cartItem.properties["Custom Grip"].trim()!==""&&(cartItemGripValue=cartItem.properties["Custom Grip"].replace(" (BTOG)","").trim());return cartItemGripValue===gripValue}),updates={};let quantityToRemove=0;if(splitLines.forEach(split=>{updates[split.key]=0,quantityToRemove+=split.quantity}),Object.keys(updates).length>0){if(await fetch("/cart/update.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({updates})}),hasCustomGrip&&upchargeEl){const upchargeKey=upchargeEl.dataset.lineId,newUpchargeQty=Math.max(0,currentUpchargeTotal-quantityToRemove);if(await fetch("/cart/change.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:upchargeKey,quantity:newUpchargeQty})}),newUpchargeQty===0)upchargeEl.remove();else{const upchargePriceEl=upchargeEl.querySelector(".price"),totalPrice=parseFloat(upchargePriceEl.dataset.price)*newUpchargeQty;upchargePriceEl.textContent=`${CURRENCY_SYM}${Utility.fmtPrice(totalPrice/100)}`,upchargeQtyEl.value=newUpchargeQty}}item&&item.remove()}}catch(error){console.error("Error removing item:",error)}await this.updateCart(),loadingSpinner.style.display="none"},updateCartLineQuantity:async function(key,quantity,item){const{loadingSpinner}=this;if(loadingSpinner.style.display="block",!item&&key&&(item=document.querySelector(`.cart-product-item[data-line-id="${CSS.escape(key)}"]`)),!item){console.error("Item DOM element not found."),loadingSpinner.style.display="none";return}if(item.dataset.bundleToken||item.dataset.bundleHeader==="true"){loadingSpinner.style.display="none";return}const variantId=item.dataset.productId,gripValue=item.dataset.customGrip||"none",hasCustomGrip=gripValue!=="none",oldQuantity=parseInt(item.dataset.quantity,10)||0,diff=quantity-oldQuantity,upchargeEl=document.querySelector(`.cart-product-item[data-product-id="${this.UPCHARGE_VARIANT_ID}"]`);let upchargeQtyEl=null,upchargeQty=0,upchargePriceEl=null;if(upchargeEl&&(upchargeQtyEl=upchargeEl.querySelector(".item-quantity"),upchargeQty=parseInt(upchargeQtyEl.value,10),upchargePriceEl=upchargeEl.querySelector(".price")),quantity>1e3&&(quantity=1e3),(quantity<0||isNaN(quantity))&&(quantity=0),Number(quantity)===0){await this.removeFromCart(item);return}try{const cartData=await this.getCartItems(),targetItem=key?cartData.items.find(cartItem=>cartItem.key===key):null,targetGiftSignature=targetItem?this.getGiftSignature(targetItem):this.getGiftSignatureFromParams(null),splitLines=cartData.items.filter(cartItem=>{if(this.getLineProperty(cartItem,"_bundle_token")||String(cartItem.variant_id)!==String(variantId))return!1;let cartItemGripValue="none";if(Array.isArray(cartItem.properties)){const gripProp=cartItem.properties.find(p=>p.name==="Custom Grip"||p[0]==="Custom Grip");if(gripProp){const val=gripProp.value||gripProp[1];val&&val.trim()!==""&&(cartItemGripValue=val.replace(" (BTOG)","").trim())}}else cartItem.properties&&cartItem.properties["Custom Grip"]&&cartItem.properties["Custom Grip"].trim()!==""&&(cartItemGripValue=cartItem.properties["Custom Grip"].replace(" (BTOG)","").trim());return!(cartItemGripValue!==gripValue||this.getGiftSignature(cartItem)!==targetGiftSignature)});if(splitLines.length>0){let remainingDesiredQty=quantity;const updates={};if(splitLines.forEach(split=>{if(remainingDesiredQty>0){const alloc=Math.min(split.quantity,remainingDesiredQty);updates[split.key]=alloc,remainingDesiredQty-=alloc}else updates[split.key]=0}),remainingDesiredQty>0&&(updates[splitLines[0].key]+=remainingDesiredQty),await fetch("/cart/update.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({updates})}),hasCustomGrip&&diff!==0&&upchargeEl){const upchargeKey=upchargeEl.dataset.lineId,newUpchargeQty=Math.max(0,upchargeQty+diff);if(await fetch("/cart/change.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:upchargeKey,quantity:newUpchargeQty})}),newUpchargeQty===0)upchargeEl.remove();else{const totalPrice=parseFloat(upchargePriceEl.dataset.price)*newUpchargeQty;upchargePriceEl.textContent=`${CURRENCY_SYM}${Utility.fmtPrice(totalPrice/100)}`,upchargeQtyEl.value=newUpchargeQty}}item.dataset.quantity=quantity}}catch(error){console.error("Error updating quantity:",error)}await this.updateCart(),loadingSpinner.style.display="none"},updateProgressMeterTiers:function(total){const totalCents=Math.round(parseFloat(total)*100),DOT_FILL_MS=420,bars=document.querySelectorAll(".progress-bar-tiers");if(!bars.length)return;
1bars.forEach(function(bar){const ctaEl=bar.querySelector(".progress-bar-tiers__cta"),progressMessage=bar.querySelector(".free_shipping_message"),steps=bar.querySelectorAll(".progress-bar-tiers__step"),segBars=bar.querySelectorAll(".progress-bar-tiers__seg-bar");if(!progressMessage||!steps.length||!segBars.length)return;const tiersCents=(bar.dataset.tiers||"").split(",").map(v=>parseInt(v.trim(),10)).filter(n=>!isNaN(n)),rewards=(bar.dataset.rewards||"").split(",").map(v=>v.trim());if(!tiersCents.length)return;let unlockedIndex=-1;for(let i=0;i<tiersCents.length&&totalCents>=tiersCents[i];i++)unlockedIndex=i;const nextIndex=unlockedIndex+1,prevUnlocked=parseInt(bar.dataset.prevUnlocked||"-1",10);if(unlockedIndex>prevUnlocked)for(let j=prevUnlocked+1;j<=unlockedIndex;j++){const step=steps[j];step&&triggerTierUnlockAnimation(step)}bar.dataset.prevUnlocked=String(unlockedIndex);let dotFillPct=0;if(nextIndex>0&&nextIndex<tiersCents.length){const prevCap=tiersCents[nextIndex-1],nextCap=tiersCents[nextIndex];if(nextCap>prevCap&&totalCents>prevCap){const within=totalCents-prevCap,span=nextCap-prevCap;dotFillPct=within/span*100,dotFillPct<0&&(dotFillPct=0),dotFillPct>100&&(dotFillPct=100)}}if(steps.forEach(function(step,idx){const dot=step.querySelector(".progress-bar-tiers__dot");idx<=unlockedIndex?(step.classList.add("is-unlocked"),step.classList.remove("is-filling"),dot&&dot.style.removeProperty("--dot-fill")):(step.classList.remove("is-unlocked"),idx===nextIndex&&dotFillPct>0?(step.classList.add("is-filling"),animateTierDotFill(dot,dotFillPct,DOT_FILL_MS)):(step.classList.remove("is-filling"),dot&&dot.style.setProperty("--dot-fill","0%")))}
1),segBars.forEach(function(segBar,i){const shouldBeFull=i<nextIndex&&i<tiersCents.length-1;segBar.style.transform=shouldBeFull?"scaleX(1)":"scaleX(0)"}),nextIndex>=tiersCents.length)progressMessage&&(progressMessage.textContent="");else{ctaEl&&bar.dataset.ctaDefault&&(ctaEl.textContent=bar.dataset.ctaDefault);const remaining=Math.max(0,tiersCents[nextIndex]-totalCents);if(remaining>0){const main=((rewards[nextIndex]||"").split(" | ")[0]||"").trim(),perk=(main.split(" + ").pop()||main).trim(),dollars=Utility.fmtPrice(remaining/100);progressMessage.innerHTML=themeT("cart.perk_away",{amount:`<strong>${CURRENCY_SYM}${dollars}</strong>`,perk:`<strong>${perk}</strong>`})}else progressMessage.textContent=""}});function animateTierDotFill(dot,targetPct,duration){if(!dot)return;const style=dot.style,current=getTierDotCurrentFill(style),from=isNaN(current)?0:current,to=Math.max(0,Math.min(100,targetPct));if(Math.abs(to-from)<.5){style.setProperty("--dot-fill",to.toFixed(2)+"%");return}const start=performance.now();function raf(t){const p=Math.min(1,(t-start)/duration),eased=p<.5?2*p*p:-1+(4-2*p)*p,val=from+(to-from)*eased;style.setProperty("--dot-fill",val.toFixed(2)+"%"),p<1&&requestAnimationFrame(raf)}requestAnimationFrame(raf)}function getTierDotCurrentFill(style){const v=style.getPropertyValue("--dot-fill");if(!v)return NaN;const n=parseFloat(v.replace("%",""));return isNaN(n)?NaN:n}function triggerTierUnlockAnimation(step){step&&(step.classList.add("just-unlocked"),setTimeout(function(){step.classList.remove("just-unlocked")},600))}},updateProgressBarMultiplier:function(total){const{multiplierProgressBar,parent}=this,progressMeter=parent.querySelector(".progress-bar-multiplier-meter"),progressMessage=parent.querySelector(".progress-bar-multiplier-message"),unlockedGift=parent.querySelector(".simple-unlocked-gift"),earnedMultiplierDisplay=parent.querySelector(".simple-bonus-multiplier");if(!progressMeter||!progressMessage||!unlockedGift){console.error("Progress bar elements not found.");return}const goalAmount=parseFloat(multiplierProgressBar.dataset.goal),rewardAmount=parseFloat(multiplierProgressBar.dataset.reward);let previousMultiplier=parseInt(earnedMultiplierDisplay.textContent)||0,earnedMultiplier=Math.floor(total/goalAmount),earnedAmount=Math.floor(total/goalAmount)*rewardAmount,remainingAmount=goalAmount-total%goalAmount;remainingAmount===goalAmount&&(remainingAmount=0);let progressPercentage=total%goalAmount/goalAmount*100;progressPercentage>100&&(progressPercentage=100),progressMeter.style.width=`${progressPercentage}%`;let formattedEarnedAmount=Utility.fmtPrice(earnedAmount,0),formattedRemainingAmount=Utility.fmtPrice(remainingAmount,remainingAmount%1===0?0:2);earnedMultiplier>previousMultiplier&&(earnedMultiplierDisplay.classList.add("pop-bonus"),setTimeout(()=>{earnedMultiplierDisplay.classList.remove("pop-bonus")},500)),earnedMultiplierDisplay.textContent=`${earnedMultiplier}x`,total>=goalAmount?(unlockedGift.style.display="block",unlockedGift.innerHTML=themeT("cart.bonus_earned_html",{amount:`${CURRENCY_SYM}${formattedEarnedAmount}`})+"<br> "+themeT("cart.bonus_keep_spending"),progressMessage.style.display="none"):(progressMessage.style.display="block",progressMessage.innerHTML=themeT("cart.bonus_next_reward_html",{amount:`${CURRENCY_SYM}${formattedRemainingAmount}`,reward:`${CURRENCY_SYM}${Utility.fmtPrice(rewardAmount,0)}`}),unlockedGift.style.display="none")},updateProgressBarFreeShipping:function(total){const{parent}=this,container=parent.querySelector(".free_shipping_progress");if(!container)return;if(total>0)container.style.display="flex";else{container.style.display="none";return}const threshold=parseFloat(container.dataset.threshold);this.threshold=threshold;const meter=container.querySelector(".progress-meter-free-shipping"),remainingP=container.querySelector(".free-ship-msg-remaining"),unlockedP=container.querySelector(".free-ship-msg-unlocked"),percentage=Math.min(total/threshold*100,100),remaining=Math.max(threshold-total,0),isUnlocked=total>=threshold;meter.classList.toggle("filled",isUnlocked),meter.style.width=`${percentage}%`,isUnlocked?(remainingP.style.display="none",unlockedP.style.display="flex"):(remainingP.style.display="flex",remainingP.innerHTML=themeT("cart.free_shipping_away",{amount:`${CURRENCY_SYM}${Utility.fmtPrice(remaining)}`}),unlockedP.style.display="none")},updateCart:async function(){const{noItems,hasItems,cartTemplate,multiplierProgressBar,hasAnyTiersBars,progressFreeShippingBar,upsellContainers,defaultContainer}=this,cartData=await this.getCartItems();this.updateShippingDelayNotice(cartData);const bundleAnalysis=this.analyzeBundleLines(cartData.items),displayItemCount=Math.max(0,cartData.item_count-bundleAnalysis.componentCount);cartData.item_count!==0?this.updateCartCount(displayItemCount):(this.updateCartTotal(0),this.updateCartCount(0),this.updateShipping(0));const excludedProductIds=["4178164580406","7231994069094"],aggregatedItems={};
1cartData.items.forEach(item=>{if(this.getLineProperty(item,"_bundle_token"))return;const hasCustomGrip=item.properties&&item.properties["Custom Grip"]&&item.properties["Custom Grip"].trim()!=="";let gripValue="none";hasCustomGrip&&(gripValue=item.properties["Custom Grip"]);const mergeKey=`${item.variant_id}-${gripValue}`;aggregatedItems[mergeKey]?(aggregatedItems[mergeKey].quantity+=item.quantity,aggregatedItems[mergeKey].original_line_total+=item.original_line_price,aggregatedItems[mergeKey].final_line_total+=item.line_price):(aggregatedItems[mergeKey]={...item},aggregatedItems[mergeKey].original_line_total=item.original_line_price,aggregatedItems[mergeKey].final_line_total=item.line_price)});const mergedCartItems=Object.values(aggregatedItems),cartLineEls=document.querySelectorAll(".cart-product-item");let totalGiftCards=0;cartData.items.forEach(item=>{excludedProductIds.includes(item.product_id.toString())&&(totalGiftCards+=item.price*item.quantity)});let total=cartData.total_price-totalGiftCards-bundleAnalysis.componentPriceCents,activeUpsellFound=!1;const visualDiscounts={};upsellContainers.length>0&&upsellContainers.forEach(container=>{let triggerIdsArray=[];container.dataset.triggerIds&&(triggerIdsArray=container.dataset.triggerIds.split(",").filter(Boolean));let upsellIdsArray=[];container.dataset.upsellIds&&(upsellIdsArray=container.dataset.upsellIds.split(",").filter(Boolean));let promoPricesObject={};container.dataset.promoPrices&&(promoPricesObject=JSON.parse(container.dataset.promoPrices));const promoDiscountPct=parseFloat(container.dataset.promoDiscountPct),hasPercentageDiscount=Number.isFinite(promoDiscountPct)&&promoDiscountPct>0;let validTriggerOptions=[];container.dataset.triggerOptions&&(validTriggerOptions=container.dataset.triggerOptions.toLowerCase().split(",").map(option=>option.trim()),validTriggerOptions=validTriggerOptions.filter(Boolean));const triggerAll=container.dataset.triggerAll==="true",unlimitedUpsell=container.dataset.unlimitedUpsell==="true";let triggerQty=0,upsellQty=0;cartData.items.forEach(item=>{if(upsellIdsArray.includes(item.product_id.toString()))upsellQty+=item.quantity;else if(triggerAll)triggerQty+=item.quantity;else if(triggerIdsArray.includes(item.product_id.toString())){let doesOptionMatch=!0;validTriggerOptions.length>0&&(doesOptionMatch=!1,item.variant_options&&item.variant_options.forEach(optionValue=>{if(optionValue){const normalizedOption=optionValue.toLowerCase().trim();validTriggerOptions.includes(normalizedOption)&&(doesOptionMatch=!0)}})),doesOptionMatch===!0&&(triggerQty+=item.quantity)}});let eligibleDiscountQty=triggerQty;unlimitedUpsell&&(triggerQty>0?eligibleDiscountQty=99999:eligibleDiscountQty=0),triggerQty>0&&mergedCartItems.forEach(cartItem=>{if(upsellIdsArray.includes(cartItem.product_id.toString())&&eligibleDiscountQty>0&&!visualDiscounts[cartItem.key]){let promoPriceCents;if(hasPercentageDiscount)promoPriceCents=Math.round(cartItem.original_price*(1-promoDiscountPct/100));else{const rawPromoPrice=promoPricesObject[cartItem.product_id];if(rawPromoPrice==null)return;const promoPriceNumber=Number(rawPromoPrice);if(!Number.isFinite(promoPriceNumber))return;promoPriceCents=Math.round(promoPriceNumber*100)}const qtyToDiscount=Math.min(cartItem.quantity,eligibleDiscountQty);eligibleDiscountQty-=qtyToDiscount;const shopifyDiscount=cartItem.original_line_total-cartItem.final_line_total,remainingDiscountNeeded=(cartItem.original_price-promoPriceCents)*qtyToDiscount-shopifyDiscount;remainingDiscountNeeded>0&&(visualDiscounts[cartItem.key]={discountNeeded:remainingDiscountNeeded,promoPrice:promoPriceCents})}}),triggerQty>upsellQty?activeUpsellFound===!1?(container.classList.remove("hidden-block"),activeUpsellFound=!0):container.classList.add("hidden-block"):unlimitedUpsell&&triggerQty>0&&activeUpsellFound===!1?(container.classList.remove("hidden-block"),activeUpsellFound=!0):container.classList.add("hidden-block")}),cartLineEls.forEach(el=>{if(el.dataset.bundleHeader==="true"||el.dataset.bundleToken)return;const variantId=el.dataset.productId,hasCustomGrip=el.dataset.customGrip==="true";let gripValue="none";hasCustomGrip&&el.querySelectorAll(".option small").forEach(smallEl=>{const gripLabel=themeT("cart.custom_grip_label");smallEl.textContent&&smallEl.textContent.includes(gripLabel)&&(gripValue=smallEl.textContent.replace(gripLabel,"").trim())});
1const mergeKey=`${variantId}-${gripValue}`,cartItem=aggregatedItems[mergeKey];if(!cartItem)return;el.dataset.lineId=cartItem.key,el.dataset.quantity=cartItem.quantity;const qtyInput=el.querySelector(".item-quantity");qtyInput&&qtyInput.value!==cartItem.quantity.toString()&&(qtyInput.value=cartItem.quantity);const priceWrap=el.querySelector(".cart-collateral"),appliedDiscount=visualDiscounts[cartItem.key],surveyPriceEl=priceWrap&&priceWrap.querySelector("[data-apparel-survey-price]");if(surveyPriceEl){const surveyCompareEl=priceWrap.querySelector("[data-apparel-survey-compare-price]"),surveyFullEl=priceWrap.querySelector("[data-apparel-survey-full-price]"),hasRealDiscount=cartItem.line_level_discount_allocations&&cartItem.line_level_discount_allocations.length>0;let compareLineTotal,saleLineTotal;if(hasRealDiscount)compareLineTotal=cartItem.original_line_total,saleLineTotal=cartItem.final_line_total;else{let lineTotal=cartItem.final_line_total;appliedDiscount&&appliedDiscount.discountNeeded>0&&(lineTotal-=appliedDiscount.discountNeeded),compareLineTotal=lineTotal,saleLineTotal=Math.floor(lineTotal/2)}surveyCompareEl&&(surveyCompareEl.textContent=`${CURRENCY_SYM}${Utility.fmtPrice(compareLineTotal/100)}`),surveyPriceEl.textContent=`${CURRENCY_SYM}${Utility.fmtPrice(saleLineTotal/100)}`,surveyPriceEl.setAttribute("data-price",saleLineTotal),surveyFullEl&&(surveyFullEl.textContent=`${CURRENCY_SYM}${Utility.fmtPrice(compareLineTotal/100)}`)}else if(appliedDiscount){if(appliedDiscount.discountNeeded>0&&(total-=appliedDiscount.discountNeeded,priceWrap)){const displayTotal=cartItem.final_line_total-appliedDiscount.discountNeeded;priceWrap.innerHTML=`
2                      <span class="compare-price" style="text-decoration: line-through; padding-right: 4px; font-size: 12px;">
3                        ${CURRENCY_SYM}${Utility.fmtPrice(cartItem.original_line_total/100)}
4                      </span>
5                      <span class="price on-sale" data-price="${appliedDiscount.promoPrice}" data-compare-price="${cartItem.original_price}">
6                        ${CURRENCY_SYM}${Utility.fmtPrice(displayTotal/100)}
7                      </span>
8                    `}}else cartItem.original_line_total>
8cartItem.final_line_total?priceWrap&&(priceWrap.innerHTML=`
9                    <span class="compare-price" style="text-decoration: line-through; padding-right: 4px; font-size: 12px;">
10                      ${CURRENCY_SYM}${Utility.fmtPrice(cartItem.original_line_total/100)}
11                    </span>
12                    <span class="price on-sale" data-price="${cartItem.final_price}" data-compare-price="${cartItem.original_price}">
13                      ${CURRENCY_SYM}${Utility.fmtPrice(cartItem.final_line_total/100)}
14                    </span>
15                  `):priceWrap&&(priceWrap.innerHTML=`<span class="price" data-price="${cartItem.original_price}">${CURRENCY_SYM}${Utility.fmtPrice(cartItem.final_line_total/100)}</span>`)}),this.updateCartTotal(Utility.fmtPrice(total/100)),this.updateShipping(total),hasAnyTiersBars&&this.updateProgressMeterTiers((total/100).toFixed(2)),multiplierProgressBar&&this.updateProgressBarMultiplier((total/100).toFixed(2)),progressFreeShippingBar&&this.updateProgressBarFreeShipping((total/100).toFixed(2)),cartTemplate||(cartData.item_count===0?(noItems.classList.remove("hidden-block"),hasItems.classList.add("hidden-block")):(noItems.classList.add("hidden-block"),hasItems.classList.remove("hidden-block"))),defaultContainer&&(activeUpsellFound?defaultContainer.classList.add("hidden-block"):defaultContainer.classList.remove("hidden-block")),this.applyBundleSidebarVisibility(cartData),await this.ensureBundleDrawerMarkup(cartData),document.dispatchEvent(new CustomEvent("apparel-survey:cart-updated",{detail:cartData}))},updateCartTotal:function(total){const{cartTemplate}=this;if(cartTemplate)document.querySelectorAll(".th_cart_total_price").forEach(el=>{el.textContent=`${CURRENCY_SYM}${total}`});else{const priceEl=document.querySelector(".total-section .price-text");priceEl.textContent=`${CURRENCY_SYM}${total}`}},updateShipping:function(total){const{fullPageShippingEl,sideBarShippingEl,popupChatCartConfirmShippingEl}=this,threshold=this.threshold?this.threshold*100:5500,nextText=total>threshold?themeT("cart.free"):themeT("cart.calculated_at_checkout"),shippingEls=[fullPageShippingEl,sideBarShippingEl,popupChatCartConfirmShippingEl].filter(Boolean);shippingEls.length&&shippingEls.forEach(shippingEl=>{shippingEl.textContent=nextText})},updateCartCount:function(count){document.querySelectorAll(".cartCount").forEach(el=>{el.textContent=count})},addItemToSidebarCart:async function(id,quantity,customGrip,handle,display,key){const{noItems,hasItems,promo}=this,normalizedGripValue=customGrip?customGrip.replace(" (BTOG)","").trim():"none",existingItem=document.querySelector(`.cart-product-item[data-product-id="${id}"][data-custom-grip="${CSS.escape(normalizedGripValue)}"]`);
15if(existingItem){const qtyInput=existingItem.querySelector(".item-quantity"),newTotalQty=parseInt(qtyInput.value||0,10)+parseInt(quantity,10);if(qtyInput.value=newTotalQty,await this.updateCartLineQuantity(existingItem.dataset.lineId,newTotalQty,existingItem),display){const html=document.querySelector("html");Utility.hideProgressBarPopup(),html.classList.add("cart-show")}return}const cartItem=(await this.getCartItems()).items.find(item2=>item2.key===key);let productData=await Utility.fetchProductDataAjax(handle);const variant=productData.variants.find(variant2=>variant2.id==id),isReadonly=["43392971997286","42119516553318","44177423663206"].includes(variant.id.toString()),container=document.querySelector(".mini-products-list"),item=document.createElement("li");item.classList.add("item"),item.classList.add("cart-product-item"),item.id=`cart-item-${key}`,item.setAttribute("data-product-id",variant.id),item.setAttribute("data-line-id",key),item.setAttribute("data-quantity",quantity),item.setAttribute("data-custom-grip",normalizedGripValue);let imageSrc=cartItem?.image||variant.featured_image?.src||productData.featured_image;typeof ProductPage<"u"&&!cartItem?.image&&ProductPage.productDetails?.variantId==variant.id&&(imageSrc=ProductPage.selected?.querySelector("img")?.src||ProductPage.productDetails.image||imageSrc),item.innerHTML=`
16                  <a href="${productData.url}?variant=${variant.id}" class="product-image">
17                  <img src="${imageSrc}" alt="${productData.title} - ${variant.title}">
18                  </a>
19                  <div class="product-details">
20                  <a class="product-title" href="${productData.url}?variant=${variant.id}">
21                      <span>
22                      ${productData.title}
23                      </span>
24                  </a>
25                  ${variant.title.includes("Default")?"":`<div class="option">
26                      <small>${variant.title}</small>
27                  </div>`}
28                  
29                  <div class="cart-collateral">
30                    ${promo&&productData.title.toLowerCase().includes(promo)?`<span class="price on-sale" data-price="${variant.price*this.promoAmount}" data-compare-price="${variant.price}">
31                          ${CURRENCY_SYM}${Utility.fmtPrice(variant.price*quantity*this.promoAmount/100)}
32                        </span>`:`<span class="price" data-price="${variant.price}">
33                          ${CURRENCY_SYM}${Utility.fmtPrice(variant.price*quantity/100)}
34                        </span>`}
35                  </div>
36                  <div class="quantity">
37                    ${isReadonly?`<input class="item-quantity item-quantity-new" type="text" value="${quantity}" readonly>`:`<input class="item-quantity item-quantity-new" name="quantity" id="updates${variant.id}" data-qtt-id1="quantity${variant.id}" value="${quantity}" type="number">`}
38                    <span class="error-message-input"></span>
39                  </div>
40                  </div>
41                  <a href="javascript:void(0)" title="${themeT("cart.remove")}" class="btn-remove-new btn-remove">
42                      <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="#000000" d="M170.5 51.6L151.5 80l145 0-19-28.4c-1.5-2.2-4-3.6-6.7-3.6l-93.7 0c-2.7 0-5.2 1.3-6.7 3.6zm147-26.6L354.2 80 368 80l48 0 8 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-8 0 0 304c0 44.2-35.8 80-80 80l-224 0c-44.2 0-80-35.8-80-80l0-304-8 0c-13.3 0-24-10.7-24-24S10.7 80 24 80l8 0 48 0 13.8 0 36.7-55.1C140.9 9.4 158.4 0 177.1 0l93.7 0c18.7 0 36.2 9.4 46.6 24.9zM80 128l0 304c0 17.7 14.3 32 32 32l224 0c17.7 0 32-14.3 32-32l0-304L80 128zm80 64l0 208c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-208c0-8.8 7.2-16 16-16s16 7.2 16 16zm80 0l0 208c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-208c0-8.8 7.2-16 16-16s16 7.2 16 16zm80 0l0 208c0 8.8-7.2 16-16 16s-16-7.2-16-16l0-208c0-8.8 7.2-16 16-16s16 7.2 16 16z"/></svg>
43                  </a>
44                  `,container.prepend(item);const shippingDelay=this.getLineProperty(cartItem,"Shipping Delay");if(shippingDelay){const collateralEl=item.querySelector(".product-details").querySelector(".cart-collateral"),delayDiv=document.createElement("div");delayDiv.classList.add("option","cart-item__shipping-delay"),delayDiv.innerHTML=`${ICON_TRUCK_SVG}<small>${themeT("cart.shipping_delay_note",{delay:shippingDelay})}</small>`,collateralEl.insertAdjacentElement("beforebegin",delayDiv)}if(normalizedGripValue!=="none"){const variantTitleEl=item.querySelector(".product-details .option"),gripDiv=document.createElement("div");gripDiv.classList.add("option"),gripDiv.innerHTML=`<small>${themeT("cart.custom_grip_label")} ${normalizedGripValue}</small>`,variantTitleEl.insertAdjacentElement("afterend",gripDiv);const existingUpchargeEl=container.querySelector(`.cart-product-item[data-product-id="${this.UPCHARGE_VARIANT_ID}"]`);
44if(existingUpchargeEl){const qtyEl=existingUpchargeEl.querySelector(".item-quantity"),priceEl=existingUpchargeEl.querySelector(".price"),unitPrice=parseFloat(priceEl.dataset.price),newQty=parseInt(qtyEl.value,10)+parseInt(quantity,10);qtyEl.value=newQty,priceEl.textContent=`${CURRENCY_SYM}${Utility.fmtPrice(unitPrice*newQty/100)}`}else{const upchargeEl=document.createElement("li");upchargeEl.classList.add("item","cart-product-item"),upchargeEl.setAttribute("data-product-id",this.UPCHARGE_VARIANT_ID),upchargeEl.setAttribute("data-line-id",this.UPCHARGE_VARIANT_ID),upchargeEl.setAttribute("data-quantity",quantity),upchargeEl.innerHTML=`
45                    <div class="product-image no-image"></div>
46                    <div class="product-details">
47                      <span class="product-title">${themeT("cart.paddle_customization")}</span>
48                      <div class="cart-collateral">
49                        <span class="price" data-price="500">${CURRENCY_SYM}${Utility.fmtPrice(5*quantity)}</span>
50                      </div>
51                      <div class="quantity">
52                        <input class="item-quantity" type="text" value="${quantity}" readonly>
53                      </div>
54                    </div>
55                  `,container.prepend(upchargeEl)}}container.querySelector(".btn-remove-new").addEventListener("click",()=>{this.removeFromCart(item)});const newQuantity=container.querySelector(".item-quantity-new");if(newQuantity.addEventListener("change",async()=>{await this.updateCartLineQuantity(key,newQuantity.value,item)}),hasItems&&hasItems.classList.remove("hidden-block"),noItems&&noItems.classList.add("hidden-block"),display){const html=document.querySelector("html");Utility.hideProgressBarPopup(),html.classList.add("cart-show")}},findLineItem:async function(variantId,grip,giftSignature){const cartData=await this.getCartItems(),targetGrip=grip?grip.replace(" (BTOG)","").trim():"none",targetGiftSignature=giftSignature||this.getGiftSignatureFromParams(null),item=cartData.items.find(item2=>{if(this.getLineProperty(item2,"_bundle_token")||item2.variant_id.toString()!==variantId.toString())return!1;let itemGrip="none";if(item2.properties)if(Array.isArray(item2.properties)){const gripProp=item2.properties.find(p=>p.name==="Custom Grip"||p[0]==="Custom Grip");if(gripProp){const val=gripProp.value||gripProp[1];val&&val.trim()!==""&&(itemGrip=val.replace(" (BTOG)","").trim())}}else item2.properties["Custom Grip"]&&item2.properties["Custom Grip"].trim()!==""&&(itemGrip=item2.properties["Custom Grip"].replace(" (BTOG)","").trim());return!(itemGrip!==targetGrip||this.getGiftSignature(item2)!==targetGiftSignature)});return item?{key:item.key,quantity:item.quantity}:null},addToCart:async function(e,options){let handle,card=!1;const ogBtnText=e.target.textContent;e.preventDefault();const form=e.target.closest(".cart");window.innerWidth<1200?e.target.textContent=themeT("product.adding"):e.target.textContent=themeT("product.adding_to_cart"),e.target.disabled=!0;const modal=e.target.dataset.modal==="true";let id,quantity=1,formParams,customGrip,productCard,hasCustomGrip=!1;const context=options&&options.context?options.context:null,shouldOpenSidebarCart=options&&options.shouldOpenSidebarCart!==void 0?options.shouldOpenSidebarCart:context!=="popup-chatbot",shouldUpdateSidebarDom=options&&options.shouldUpdateSidebarDom!==void 0?options.shouldUpdateSidebarDom:!1;if(!form)productCard=e.target.closest(".product-card"),id=productCard.querySelector(".product-id-input").value,quantity=1,formParams=new URLSearchParams({id,quantity}),handle=e.target.dataset.handle;else{const formData=new FormData(form),normalizedGrip=formData.getAll("properties[Custom Grip]").reverse().find(rawInput=>{if(!rawInput)return!1;let cleanedInput=rawInput.trim();return cleanedInput=cleanedInput.replace(/[\u200B-\u200D\uFEFF]/g,""),cleanedInput.length>0&&cleanedInput!=="undefined"&&cleanedInput!=="null"})||"";formParams=new URLSearchParams(formData),formParams.delete("properties[Custom Grip]"),normalizedGrip&&formParams.set("properties[Custom Grip]",normalizedGrip),id=formParams.get("id"),customGrip=normalizedGrip,hasCustomGrip=!!customGrip,quantity=parseFloat(formParams.get("quantity")),form.classList.contains("card-cart")?(card=!0,handle=form.querySelector(".quick-add").dataset.handle):handle=e.target.dataset.handle}e.target.dataset.promo&&this.promo&&formParams.append("properties[_cartPromo]",e.target.dataset.promo),options&&options.extraProperties&&Object.entries(options.extraProperties).forEac
55h(([key,value])=>{value!=null&&value!==""&&formParams.append(`properties[${key}]`,value)});const giftSignature=this.getGiftSignatureFromParams(formParams),itemInCart=await this.findLineItem(id,customGrip,giftSignature);if(itemInCart){if(id.includes("44177423663206")){window.location.href="/cart";return}const key=itemInCart.key,newQuantity=parseFloat(itemInCart.quantity)+quantity;try{await this.updateCartLineQuantity(key,newQuantity),shouldOpenSidebarCart?await this.handleAddSuccess(id,ogBtnText,modal,card,e,newQuantity,handle,quantity,customGrip,key):shouldUpdateSidebarDom?(await this.addItemToSidebarCart(id,quantity,customGrip,handle,!1,key),e.target.textContent=ogBtnText,e.target.disabled=!1):(e.target.textContent=ogBtnText,e.target.disabled=!1),window.PromoModal&&window.PromoModal.onAddSuccess({variantId:id,handle})}catch(error){console.error("PDP: error adding to cart",error)}}else try{const bodyString=formParams.toString(),response=await fetch("/cart/add.js",{method:"POST",body:bodyString,headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"}});if(!response.ok)throw new Error("Network response was not ok.");const responseData=await response.json();hasCustomGrip&&await fetch("/cart/add.js",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({id:this.UPCHARGE_VARIANT_ID,quantity})}),shouldOpenSidebarCart?await this.handleAddSuccess(id,ogBtnText,modal,card,e,null,handle,quantity,customGrip,responseData.key):shouldUpdateSidebarDom?(await this.addItemToSidebarCart(id,quantity,customGrip,handle,!1,responseData.key),e.target.textContent=ogBtnText,e.target.disabled=!1):(e.target.textContent=ogBtnText,e.target.disabled=!1),window.PromoModal&&window.PromoModal.onAddSuccess({variantId:id,handle})}catch(error){console.error("PDP: error adding to cart",error)}const giftCardModal=document.querySelector(".send-as-gift-form"),modalBg=document.querySelector(".modal-background");giftCardModal&&(giftCardModal.style.display="none",modalBg&&(modalBg.style.display="none")),await this.updateCart()},handleAddSuccess:async function(id,ogBtnText,modal,card,e,newQuantity,handle,quantity,customGrip,key){const quickView=document.querySelector("#quickview-modal"),modalBg=document.querySelector(".modal-background");if(e.target.textContent=ogBtnText,modal&&(quickView&&(quickView.style.display="none"),modalBg&&(modalBg.style.display="none")),newQuantity){const itemQuantity=document.querySelector(`#updates${id}`);itemQuantity&&(itemQuantity.value=newQuantity);const html=document.querySelector("html");html&&html.classList.add("cart-show")}else await this.addItemToSidebarCart(id,quantity,customGrip,handle,!0,key);e.target.disabled=!1,await this.updateCart()},ensureBundleDrawerMarkup:async function(cartData){const list=document.querySelector(".mini-products-list");if(!list||!cartData||!Array.isArray(cartData.items))return;const analysis=this.analyzeBundleLines(cartData.items);let needsRefresh=!1;for(const[token,group]of analysis.groups.entries())if(!list.querySelector(`.cart-product-item[data-bundle-token="${CSS.escape(token)}"][data-bundle-header="true"]`)&&(group.parent||group.components[0])){needsRefresh=!0;break}if(!needsRefresh)return;const root=window.Shopify?.routes?.root||"/";try{const response=await fetch(`${root}?sections=cart-drawer`);if(!response.ok)return;const sectionHtml=(await response.json())["cart-drawer"];if(!sectionHtml)return;const newList=new DOMParser().parseFromString(sectionHtml,"text/html").querySelector(".mini-products-list");if(!newList)return;list.innerHTML=newList.innerHTML,this.bindCartLineEvents(list)}catch(error){console.warn("Cart: could not refresh mini products list",error)}},analyzeBundleLines:function(items){const groups=new Map,componentKeys=new Set;let componentPriceCents=0,componentCount=0;return Array.isArray(items)?(items.forEach(item=>{const token=this.getLineProperty(item,"_bundle_token");if(!token)return;groups.has(token)||groups.set(token,{parent:null,components:[]});const slotId=this.getLineProperty(item,"_slot_id"),group=groups.get(token);
55slotId?(group.components.push(item),componentKeys.add(item.key),componentPriceCents+=item.final_line_price,componentCount+=item.quantity):group.parent=item}),{groups,componentKeys,componentPriceCents,componentCount}):{groups,componentKeys,componentPriceCents,componentCount}},applyBundleSidebarVisibility:function(cartData){const analysis=this.analyzeBundleLines(cartData.items);return document.querySelectorAll(".cart-product-item").forEach(el=>{const lineId=el.dataset.lineId;lineId&&analysis.componentKeys.has(lineId)?(el.classList.add("bundle-component-hidden"),el.setAttribute("hidden","hidden")):(el.classList.remove("bundle-component-hidden"),el.removeAttribute("hidden"))}),analysis},bindCartLineEvents:function(root){const scope=root||document;scope.querySelectorAll(".cart-product-item .btn-remove").forEach(btn=>{btn.dataset.cartBound!=="true"&&(btn.dataset.cartBound="true",btn.addEventListener("click",()=>{const item=btn.closest(".cart-product-item");this.removeFromCart(item)}))}),scope.querySelectorAll(".cart-product-item .item-quantity").forEach(input=>{input.dataset.cartBound!=="true"&&(input.dataset.cartBound="true",input.addEventListener("change",()=>{const item=input.closest(".cart-product-item");this.updateCartLineQuantity(item.dataset.lineId,input.value,item)}))})}};window.Jarvis=window.Jarvis||{},window.Jarvis.Cart=Cart;
56//# sourceMappingURL=/cdn/shop/t/642/assets/cart-scripts.js.map?v=4944778283070871511790019821

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.