{
  "version": 3,
  "sources": ["/cdn/shop/t/369/assets/buybox.js?cb=14429"],
  "sourcesContent": ["// ========================================================================================\n// ========================================================================================\n// Bundle Builder\n// ========================================================================================\n// ========================================================================================\n\nconst bundleBuilderInit = () => {\n\n    if (document.addEventListener) {\n        window.addEventListener('pageshow', function (event) {\n                if (event.persisted || performance.getEntriesByType(\"navigation\")[0].type === 'back_forward') {\n                    document.querySelectorAll('.lsg-bundle-product-select-quantity-input').forEach(function(input){\n                        input.value = 0;\n                        inputChangeSubProduct(input);\n                        incrementEnableValidation(input);\n                        checkoutEnableValidation(input);\n                    });\n                    buildStickyUI();\n                }\n            },\n            false);\n    }\n\n    const bindStickyUIActions = () => {\n        document.querySelectorAll('[data-bundle-builder-selected-product-remove-button-sticky]').forEach(function(removeButton){\n            removeButton.addEventListener('click', function(e){\n                e.preventDefault();\n                const triggeredProduct = e.target.closest('[data-bundle-builder-selected-product-id]');\n                const productID = triggeredProduct.getAttribute('data-bundle-builder-selected-product-id');\n                const productList = document.querySelector(`[data-lsg-bundle-product-sub-list]`);\n                const bundleProduct = productList.querySelector(`[data-lsg-bundle-product-select-id='${productID}']`);\n                const productDecrementTarget = bundleProduct.querySelector('.lsg-bundle-product-select-quantity-minus');\n                productDecrementTarget.click();\n            });\n        });\n\n        document.querySelectorAll('[data-lsg-bundle-plan-button-sticky]').forEach(function(planButton){\n            planButton.addEventListener('click', function(e){\n                e.preventDefault();\n                const planID = planButton.getAttribute('data-lsg-bundle-plan-button-sticky');\n                const orignalPlanButton = document.querySelector(`[data-lsg-bundle-interval-select] [for='${planID}']`);\n                orignalPlanButton.click();\n            });\n        });\n\n        document.querySelectorAll('[data-lsg-bundle-interval-select-sticky]').forEach(function(intervalSelector){\n            intervalSelector.addEventListener('change', function(e){\n                e.preventDefault();\n                const selectedIndex = (intervalSelector.selectedIndex);\n                const orignalIntervalSelect = document.querySelector('[data-lsg-bundle-interval-select] .lsg-bundle-interval-frequency-select');\n                orignalIntervalSelect.selectedIndex = selectedIndex;\n                orignalIntervalSelect.dispatchEvent(new Event('change'));\n            });\n        });\n\n        document.querySelectorAll('[data-lsg-bundle-atc-sticky]').forEach(function(atcButton){\n            atcButton.addEventListener('click', function(e){\n                e.preventDefault();\n                const orignalATCButton = document.querySelector('[data-lsg-bundle-wrapper] [data-lsg-bundle-atc]');\n                orignalATCButton.click();\n            });\n        });\n    }\n\n    const buildStickyUI = () => {\n        // Sticky Elements\n        const stickySelectedProducts = document.querySelector('[data-bundle-builder-sticky-selected-products]');\n        const stickyIntervalSelect = document.querySelector('[data-bundle-builder-sticky-interval-select]');\n        const stickyAtc = document.querySelector('[data-bundle-builder-sticky-atc]');\n        const stickyUnderAtcText = document.querySelector('[data-bundle-builder-sticky-under-atc-text]');\n\n        // Original Elements\n        const originalSelectedProducts = document.querySelector('[data-bundle-builder-selected-products]');\n        const originalPlanSelectButtons = document.querySelectorAll('[data-lsg-bundle-interval-select] label');\n        const originalIntervalSelect = document.querySelector('[data-lsg-bundle-interval-select] .lsg-bundle-interval-frequency-select');\n        const originalAtc = document.querySelector('[data-lsg-bundle-atc]');\n        const originalUnderAtcText = document.querySelector('[data-under-atc-text]');\n\n        const planTitle = document.querySelector('.pdp__select-plan-title');\n        const intervalOptions = originalIntervalSelect.querySelectorAll('option');\n\n        // New Elements\n        const clonedSelectedProducts = originalSelectedProducts.cloneNode(true);\n        const clonedAtc = originalAtc.cloneNode(true);\n        const clonedUnderAtcText = originalUnderAtcText.cloneNode(true);\n\n        const clonedPlanTitle = planTitle.cloneNode(true);\n        const newPlanButtonsWrapper = document.createElement('div');\n        const newIntervalSelect = document.createElement('select');\n\n        // Alter Product Removal Buttons\n        const removalButtons = clonedSelectedProducts.querySelectorAll('[data-bundle-builder-selected-product-remove-button]');\n        removalButtons.forEach((button) => {\n            button.setAttribute('data-bundle-builder-selected-product-remove-button-sticky', '');\n            button.removeAttribute('data-bundle-builder-selected-product-remove-button');\n        });\n\n        // Reset sticky UI Elements\n        stickySelectedProducts.innerHTML = '';\n        stickyIntervalSelect.innerHTML = '';\n        stickyAtc.innerHTML = '';\n        stickyUnderAtcText.innerHTML = '';\n\n        // Build New Plan Selector\n        newIntervalSelect.setAttribute('data-lsg-bundle-interval-select-sticky', '');\n        newIntervalSelect.classList.add('bundle-builder-sticky__interval-select');\n        newPlanButtonsWrapper.classList.add('bundle-builder-sticky__plan-button-wrapper');\n\n        let subscriptionSelected = false;\n        originalPlanSelectButtons.forEach((planButton, i) => {\n            const newPlanButton = document.createElement('button');\n            const planID = planButton.getAttribute('for');\n            const planInput = document.getElementById(planID);\n\n            newPlanButton.classList.add('bundle-builder-sticky__plan-button');\n            newPlanButton.setAttribute('data-lsg-bundle-plan-button-sticky', `${planID}`);\n\n            if (planInput.checked) {\n                newPlanButton.classList.add('selected');\n                if (planInput.value === 'sub') subscriptionSelected = true;\n            }\n            newPlanButton.innerHTML = planButton.innerHTML;\n            newPlanButtonsWrapper.append(newPlanButton);\n        });\n\n        intervalOptions.forEach((option, i) => {\n            const newOption = document.createElement('option');\n            newOption.innerHTML = option.innerHTML;\n            newIntervalSelect.append(newOption);\n\n            if (originalIntervalSelect.selectedIndex !== i) return\n            newIntervalSelect.selectedIndex = i;\n        });\n\n        // Update cloned ATC\n        clonedAtc.setAttribute('data-lsg-bundle-atc-sticky', '');\n        clonedAtc.removeAttribute('data-lsg-bundle-atc');\n\n        // Build UI Elements\n        stickyAtc.append(clonedAtc);\n\n        if (selectedProducts.length > 0) stickySelectedProducts.append(clonedSelectedProducts);\n\n        if (selectedProducts.length >= 4) {\n            stickyIntervalSelect.append(clonedPlanTitle);\n            stickyIntervalSelect.append(newPlanButtonsWrapper);\n            if (subscriptionSelected) stickyIntervalSelect.append(newIntervalSelect);\n            stickyUnderAtcText.append(clonedUnderAtcText);\n        }\n\n        bindStickyUIActions();\n    }\n\n    let productSelectionButtonClicked = false,\n        productSelectionIndex,\n        selectedProducts = [],\n        freshProductTotal = 0;\n\n    const buildSelectedProductArray = (trigger) => {\n        const method = (trigger.classList.contains('lsg-bundle-product-select-quantity-minus') ? 'minus' : (trigger.classList.contains('lsg-bundle-product-select-quantity-plus') ? 'plus' : 'err'));\n        const triggeredProductWrapper = trigger.closest('.lsg-bundle-product-select-wrapper');\n        const productID = triggeredProductWrapper.getAttribute('data-lsg-bundle-product-select-id');\n        const productType = triggeredProductWrapper.getAttribute('data-lsg-bundle-product-type');\n        const productTitle = triggeredProductWrapper.querySelector('.lsg-bundle-product-select-title').innerHTML;\n\n        switch(method) {\n            case 'minus':\n                if (productSelectionButtonClicked == true) {\n                    selectedProducts.splice(productSelectionIndex, 1);\n                    productSelectionButtonClicked = false\n                }\n                else {\n                    productSelectionIndex = selectedProducts.findLastIndex(p => p.selectedProductId == productID);\n                    selectedProducts.splice(productSelectionIndex, 1);\n                }\n\n                if (productType === 'fresh') {\n                    freshProductTotal--;\n                }\n                break;\n            case 'plus':\n                const productImageUrl = triggeredProductWrapper.querySelector('img').src;\n                const productImageAlt = triggeredProductWrapper.querySelector('img').alt;\n                let selectedProductData = {\n                    selectedProductImageUrl: productImageUrl,\n                    selectedProductId: productID,\n                    selectedProductType: productType,\n                    selectedProductTitle: productTitle,\n                    selectedProductImageAlt: productImageAlt,\n                };\n                selectedProducts.push(selectedProductData);\n\n                if (productType === 'fresh') {\n                    freshProductTotal++;\n                }\n                break;\n        }\n        updateSelectedProductGUI(selectedProducts);\n    }\n\n    const updateSelectedProductGUI = (selectedProducts) => {\n        const selectedProductWrappers = document.querySelectorAll('[data-bundle-builder-selected-product-id]');\n\n        selectedProductWrappers.forEach((productWrapper, i) => {\n            const selectedProductData = selectedProducts[i];\n\n            const productWrapperImage = productWrapper.querySelector('[data-bundle-builder-selected-product-image]');\n            const productWrapperType = productWrapper.querySelector('[data-bundle-builder-selected-product-type]');\n            const productWrapperTitle = productWrapper.querySelector('[data-bundle-builder-selected-product-title]');\n\n            if (typeof selectedProductData !== 'undefined') {\n\n                productWrapper.setAttribute('data-bundle-builder-selected-product-id', selectedProductData.selectedProductId);\n\n                productWrapperImage.src = selectedProductData.selectedProductImageUrl;\n                productWrapperImage.alt = selectedProductData.selectedProductImageAlt;\n\n                productWrapperType.innerHTML = selectedProductData.selectedProductType;\n                productWrapperTitle.innerHTML = selectedProductData.selectedProductTitle;\n\n                productWrapper.classList.add('active');\n            } else {\n\n                productWrapper.setAttribute('data-bundle-builder-selected-product-id', '');\n\n                productWrapperImage.src = '';\n                productWrapperImage.alt = '';\n\n                productWrapperType.innerHTML = '';\n                productWrapperTitle.innerHTML = '';\n\n                productWrapper.classList.remove('active');\n\n            }\n        });\n    }\n\n    function setActiveBundle(trigger) {\n        //sets different bundle blocks active\n        const bundleIndex = trigger.dataset.bundleIndex;\n        const bundleWrapper = trigger.closest('.lsg-bundle-wrapper');\n        const bundleBlocks = bundleWrapper.querySelectorAll('.lsg-bundle-block');\n        const targetBundle = bundleWrapper.querySelector('[data-bundle-index=\"' + bundleIndex + '\"].lsg-bundle-block');\n        if(targetBundle) {\n            bundleBlocks.forEach(function(bundleBlock){\n                if(bundleBlock.dataset.bundleIndex != bundleIndex) {\n                    bundleBlock.classList.remove('lsg-bundle-block-active');\n                } else {\n                    bundleBlock.classList.add('lsg-bundle-block-active');\n                }\n            });\n        }\n    }\n\n    function incrementEnableValidation(trigger) {\n        //trigger is input or increment buttons\n        const productSetList = trigger.closest('.lsg-bundle-product-set-list');\n        const quantityIncrementButtons = productSetList.querySelectorAll('.lsg-bundle-product-select-quantity-increment');\n        const bundleQuantity = getBundleQuantityByChild(trigger);\n        const bundleMax = productSetList.dataset.bundleMax;\n\n        //increment button enable/disable\n        quantityIncrementButtons.forEach(function(quantityIncrementButton){\n            const inputWrap = quantityIncrementButton.closest('.lsg-bundle-product-select-quantity-wrap');\n            const method = (quantityIncrementButton.classList.contains('lsg-bundle-product-select-quantity-minus') ? 'minus' : (quantityIncrementButton.classList.contains('lsg-bundle-product-select-quantity-plus') ? 'plus' : 'err'));\n            const input = quantityIncrementButton.closest('.lsg-bundle-product-select-quantity-wrap').querySelector('.lsg-bundle-product-select-quantity-input');\n            const quantity = input.value;\n            switch(method) {\n                case 'minus':\n                    quantityIncrementButton.disabled = false;\n                    if(quantity <= 0) {\n                        quantityIncrementButton.disabled = true;\n                    }\n                    if(quantity <= parseInt(input.min)) {\n                        quantityIncrementButton.disabled = true;\n                    }\n                    break;\n                case 'plus':\n                    const productType = quantityIncrementButton.closest('[data-lsg-bundle-product-type]').getAttribute('data-lsg-bundle-product-type');\n\n                    quantityIncrementButton.disabled = false;\n                    if(quantity >= parseInt(input.max)) {\n                        quantityIncrementButton.disabled = true;\n                    }\n                    if(parseInt(bundleMax) > 0) {\n                        if(bundleQuantity >= parseInt(bundleMax)) {\n                            quantityIncrementButton.disabled = true;\n                            inputWrap.classList.add('product-maxed');\n                        }\n                    }\n                    // Custom business logic - Disable dry product plus increment buttons if 2 fresh product minimum is not met\n                    if(productType === 'dry' && bundleQuantity === 3 && freshProductTotal === 1) {\n                        quantityIncrementButton.disabled = true;\n                        inputWrap.classList.add('product-maxed');\n                    }\n                    if(productType === 'fresh' && bundleQuantity === 3 && freshProductTotal === 0) {\n                        quantityIncrementButton.disabled = true;\n                        inputWrap.classList.add('product-maxed');\n                    }\n                    break;\n            }\n        });\n    }\n\n    function checkoutEnableValidation(trigger) {\n        const bundleBlock = getBundleBlock(trigger);\n        const addToCartButtons = bundleBlock.querySelectorAll('.lsg-bundle-form button[type=\"submit\"]');\n        const bundleQuantity = getBundleQuantity(trigger);\n        const bundleForm = bundleBlock.querySelector('.lsg-bundle-form');\n        const interval = getBundleInterval(trigger);\n        const bundleMin = (interval == 'otp' ? bundleBlock.dataset.otpBundleMin : bundleBlock.dataset.subBundleMin);\n        const bundleMax = (interval == 'otp' ? bundleBlock.dataset.otpBundleMax : bundleBlock.dataset.subBundleMax);\n        const quantityToAdd = bundleMax - bundleQuantity;\n\n        //checkout button enable/disable\n        addToCartButtons.forEach(function(addToCartButton){\n            const addToCartText = addToCartButton.querySelector('[data-lsg-bundle-submit-button-atc-text]');\n            const addMoreText = addToCartButton.querySelector('[data-lsg-bundle-submit-button-add-more-text]');\n            const addMoreQuantity = addToCartButton.querySelector('[data-lsg-bundle-submit-button-add-more-quantity]');\n            const addMoreType = addToCartButton.querySelector('[data-lsg-bundle-submit-button-add-more-type]');\n\n            if(bundleQuantity >= bundleMin && (bundleQuantity <= bundleMax || bundleMax < bundleMin)) {\n                addToCartButton.disabled = false;\n                addToCartText.classList.remove('hidden');\n                addMoreText.classList.add('hidden');\n            } else {\n                addToCartButton.disabled = true;\n                // Custom business logic - Show 'Add 1 more fresh' text if 2 fresh product minimum is not met\n                if(bundleQuantity === 3 && freshProductTotal === 1) {\n                    addToCartText.classList.add('hidden');\n                    addMoreText.classList.remove('hidden');\n                    addMoreType.classList.remove('hidden');\n                    addMoreQuantity.innerHTML = quantityToAdd;\n                } else {\n                    addToCartText.classList.add('hidden');\n                    addMoreText.classList.remove('hidden');\n                    addMoreType.classList.add('hidden');\n                    addMoreQuantity.innerHTML = quantityToAdd;\n                }\n            }\n        });\n    }\n\n    function addToCart(trigger) {\n        const bundleID = getGuid();\n        const bundleBlock = getBundleBlock(trigger);\n        const bundleForm = bundleBlock.querySelector('.lsg-bundle-form');\n        const bundleProductID = bundleForm.querySelector('input[name=\"id\"]').value;\n        const bundleSellingPlan = bundleForm.querySelector('input[name=\"selling_plan\"]').value;\n        const interval = (bundleSellingPlan == '' ? 'otp' : 'sub');\n        const bundleMin = (interval == 'otp' ? bundleBlock.dataset.otpBundleMin : bundleBlock.dataset.subBundleMin);\n        const bundleMax = (interval == 'otp' ? bundleBlock.dataset.otpBundleMax : bundleBlock.dataset.subBundleMax);\n        const bundleProductList = bundleBlock.querySelector('.lsg-bundle-product-set-list');\n        const bundleProductListInputs = bundleProductList.querySelectorAll('.lsg-bundle-product-select-quantity-input');\n        const discountCode = new URLSearchParams(window.location.search).get('code') || '';\n        let bundleCart = {\n            'items': []\n        };\n        let bundleProductQuantity = 0;\n        {\n            let cartItem = {\n                id: bundleProductID,\n                quantity: 1,\n                properties: {\n                    \"bundle_id\": bundleID,\n                    \"bundle_parent\": true,\n                },\n            };\n            if (interval == 'sub') {\n                cartItem[\"selling_plan\"] = bundleSellingPlan;\n            }\n            bundleCart.items.push(cartItem);\n        }\n        bundleProductListInputs.forEach(function(bundleProductInput){\n            bundleProductQuantity = bundleProductQuantity + parseInt(bundleProductInput.value);\n            if(parseInt(bundleProductInput.value) > 0) {\n                let cartItem = {\n                    id: bundleProductInput.dataset.product,\n                    quantity: parseInt(bundleProductInput.value),\n                    properties: {\n                        \"bundle_id\": bundleID,\n                    },\n                };\n                if (interval == 'sub') {\n                    cartItem[\"selling_plan\"] = bundleSellingPlan;\n                }\n                bundleCart.items.push(cartItem);\n            }\n        });\n        if(bundleProductQuantity > bundleMax || bundleProductQuantity < bundleMin) {\n            //quantity is not within bundle size\n            return false;\n        }\n\n        fetch(`/discount/${discountCode}`).then(() => {\n            fetch('/cart/add.js', {\n                method: 'POST',\n                headers: {\n                    'Content-Type': 'application/json',\n                    'X-Requested-With': 'XMLHttpRequest'\n                },\n                body: JSON.stringify(bundleCart),\n                credentials: 'same-origin'\n            }).then((response) => {\n                if(response.status == 200) {\n                    // window.location.href = \"/cart\";\n                    // setTimeout(() => slideCartOpen(), 1000)\n                    original_selector = $(trigger);\n                    document.body.classList.add('atc-cart');\n                    slideCartOpen();\n                    // renderCart();\n                }\n            }).catch((error) => {\n                console.error(error);\n            });\n        });\n        //\n    }\n\n    function updateFrequency(trigger) {\n        //Render price and assign selling_plan in the form\n        updateBundlePrice(trigger);\n        updateSellingPlan(trigger);\n    }\n\n    function updateInterval(trigger) {\n        //updates bundle block classes, resets displayed prices, and sets the selling_plan input value\n        const bundleBlock = getBundleBlock(trigger);\n        const sellingPlanInput = bundleBlock.querySelector('.lsg-bundle-form input[name=\"selling_plan\"]');\n        const frequencySelect = bundleBlock.querySelector('.lsg-bundle-interval-frequency-select');\n\n        switch(trigger.value) {\n            case 'otp':\n                bundleBlock.classList.remove('lsg-bundle--sub-selected');\n                bundleBlock.classList.add('lsg-bundle--otp-selected');\n                sellingPlanInput.value = '';\n                break;\n            case 'sub':\n                bundleBlock.classList.remove('lsg-bundle--otp-selected');\n                bundleBlock.classList.add('lsg-bundle--sub-selected');\n                sellingPlanInput.value = frequencySelect.value;\n                break;\n        }\n\n        updateBundlePrice(trigger);\n        updateSellingPlan(trigger);\n    }\n\n    function updateSellingPlan(trigger) {\n        //set form selling_plan based on selected state\n        const bundleBlock = getBundleBlock(trigger);\n        const selling_plan = bundleBlock.querySelector('.lsg-bundle-form input[name=\"selling_plan\"]');\n        if(selling_plan) {\n            if(bundleBlock.classList.contains('lsg-bundle--sub-selected') || bundleBlock.classList.contains('lsg-bundle--only-sub')) {\n                const frequencySelect = bundleBlock.querySelector('.lsg-bundle-interval-frequency-select');\n                if(frequencySelect) {\n                    selling_plan.value = frequencySelect.value;\n                } else {\n                    selling_plan.value = '';\n                }\n            } else {\n                selling_plan.value = '';\n            }\n        }\n    }\n\n    function inputChangeSubProduct(trigger) {\n        //validates quantities for bundle products when the input field is updated\n        if(isNaN(trigger.value) || trigger.value == ''){\n            trigger.value = 0;\n        }\n\n        if(trigger.value > parseInt(trigger.max)) {\n            trigger.value = parseInt(trigger.max);\n        }\n\n        if(trigger.value < 0) {\n            trigger.value = 0;\n        }\n\n        if(trigger.value < parseInt(trigger.min)) {\n            trigger.value = parseInt(trigger.min);\n        }\n\n        const bundleMax = trigger.closest('.lsg-bundle-product-set-list').dataset.bundleMax;\n        const bundleQuantity = getBundleQuantity(trigger);\n\n        if((bundleQuantity > bundleMax) && bundleMax > 0) {\n            let bundleDif = bundleQuantity - bundleMax;\n            if(trigger.value >= bundleDif) {\n                //reduce quantity to stay within bundle max\n                trigger.value = (trigger.value - bundleDif);\n            } else {\n                //something went wrong, reset all values to min\n                trigger.closest('.lsg-bundle-product-set-list').querySelectorAll('.lsg-bundle-product-select-quantity-input').forEach(function(input){\n                    input.value = parseInt(input.min);\n                });\n            }\n        }\n        updateQuantityDisplay(trigger);\n        updateBundlePrice(trigger);\n    }\n\n    function incrementSubProduct(trigger) {\n        //validates quantities for the bundle products and updates the input when increment buttons are clicked\n        const method = (trigger.classList.contains('lsg-bundle-product-select-quantity-minus') ? 'minus' : (trigger.classList.contains('lsg-bundle-product-select-quantity-plus') ? 'plus' : ''));\n        const input = trigger.closest('.lsg-bundle-product-select-quantity-wrap').querySelector('.lsg-bundle-product-select-quantity-input');\n        const bundleMax = trigger.closest('.lsg-bundle-product-set-list').dataset.bundleMax;\n        const bundleQuantity = getBundleQuantity(trigger);\n\n        switch(method) {\n            case 'plus':\n                if(input.value >= parseInt(input.max)) {\n                    //reset to inventory max if over\n                    input.value = parseInt(input.max);\n                } else {\n                    if((bundleQuantity < parseInt(bundleMax)) || parseInt(bundleMax) < 1) {\n                        input.value++;\n                    } else {\n                        //at max bundle quantity, do not change\n                    }\n                }\n                updateBundlePrice(trigger);\n                break;\n            case 'minus':\n                if(input.value <= parseInt(input.min)) {\n                    input.value = parseInt(input.min);\n                } else if(input.value <= 0) {\n                    input.value = 0;\n                } else {\n                    input.value--;\n                }\n                updateBundlePrice(trigger);\n                break;\n        }\n        updateQuantityDisplay(input);\n        mirrorQuantityDisplay(input);\n    }\n\n    function mirrorQuantityDisplay(input) {\n        const bundleBlock = getBundleBlock(input);\n        const productID = input.dataset.product;\n        const quantity = input.value;\n        const productInputs = bundleBlock.querySelectorAll('[data-product=\"' + productID + '\"].lsg-bundle-product-select-quantity-input');\n        productInputs.forEach(function(productInput){\n            if(productInput !== input) {\n                productInput.value = quantity;\n                inputChangeSubProduct(productInput);\n            }\n        });\n    }\n\n    function updateQuantityDisplay(input) {\n        const inputWrap = input.closest('.lsg-bundle-product-select-quantity-wrap');\n        $(inputWrap).removeClass('no-quantity');\n        if (input.value <= 0) {\n            $(inputWrap).addClass('no-quantity');\n        }\n        const inputDisplay = input.parentNode.querySelector('.lsg-bundle-product-select-quantity-input-display');\n        if(inputDisplay) {\n            inputDisplay.innerHTML = input.value;\n        }\n    }\n\n    function updateBundlePrice(trigger) {\n        //updates OTP/Sub pricing\n        const bundleBlock = getBundleBlock(trigger);\n        const otpPriceEls = bundleBlock.querySelectorAll('.lsg-bundle-interval-otp-price');\n        const subPriceEls = bundleBlock.querySelectorAll('.lsg-bundle-interval-sub-price');\n        const frequency = bundleBlock.querySelector('.lsg-bundle-interval-frequency-select option:checked');\n        const productList = bundleBlock.querySelector('.lsg-bundle-product-set-list');\n        const hasIntervalSelect = bundleBlock.classList.contains('lsg-bundle--has-interval-select');\n        let interval = ''\n        if(bundleBlock.classList.contains('lsg-bundle--only-otp') || bundleBlock.classList.contains('lsg-bundle--otp-selected')) {\n            interval = 'otp';\n        } else if (bundleBlock.classList.contains('lsg-bundle--only-sub') || bundleBlock.classList.contains('lsg-bundle--sub-selected')) {\n            interval = 'sub';\n        }\n        let otpSubtotal = 0;\n        let subSubtotal = 0;\n\n        if(productList && interval == 'otp') {\n            productList.querySelectorAll('.lsg-bundle-product-select-quantity-input').forEach(function(otpProductInput){\n                let quantity = parseInt(otpProductInput.value);\n                let price = parseInt(otpProductInput.dataset.price);\n                otpSubtotal = otpSubtotal + (quantity * price);\n                if(productList && frequency && hasIntervalSelect) {\n                    const discountType = frequency.dataset.discountType;\n                    const discountValue = frequency.dataset.discountValue;\n                    let discount = 0;\n                    switch(discountType){\n                        case 'percentage':\n                            discount = (price * parseInt(discountValue)) / 100;\n                            break;\n                        case 'fixed_amount':\n                            discount = parseInt(discountValue);\n                            break;\n                        case 'price':\n                            discount = price - parseInt(discountValue);\n                            break;\n                    }\n                    subSubtotal = subSubtotal + (quantity * (price - discount));\n                }\n            });\n        }\n\n        if(productList && frequency && interval == 'sub') {\n            const discountType = frequency.dataset.discountType;\n            const discountValue = frequency.dataset.discountValue;\n            productList.querySelectorAll('.lsg-bundle-product-select-quantity-input').forEach(function(subProductInput){\n                let quantity = parseInt(subProductInput.value);\n                let price = parseInt(subProductInput.dataset.price);\n                let discount = 0;\n                switch(discountType){\n                    case 'percentage':\n                        discount = (price * parseInt(discountValue)) / 100;\n                        break;\n                    case 'fixed_amount':\n                        discount = parseInt(discountValue);\n                        break;\n                    case 'price':\n                        discount = price - parseInt(discountValue);\n                        break;\n                }\n                subSubtotal = subSubtotal + (quantity * (Math.floor(price - discount)));\n\n                if(productList && hasIntervalSelect) {\n                    otpSubtotal = otpSubtotal + (quantity * price);\n                }\n            });\n        }\n\n        const currencyFormatter = new Intl.NumberFormat('en-US', {\n            style: 'currency',\n            currency: 'USD'\n        });\n        otpPriceEls.forEach(function(el){\n            el.innerHTML = currencyFormatter.format(otpSubtotal / 100);\n        });\n        subPriceEls.forEach(function(el){\n            el.innerHTML = currencyFormatter.format(subSubtotal / 100);\n        });\n    }\n\n    function initializeBundle() {\n        //loop through bundle blocks\n        document.querySelectorAll('.lsg-bundle-block').forEach(function(bundleBlock){\n            //set bundle block classes and initial selling_plan input\n            const intervalSelect = bundleBlock.querySelector('.lsg-bundle-interval-select');\n            const onlyOTP = bundleBlock.querySelector('.lsg-bundle-interval-only-otp');\n            const onlySub = bundleBlock.querySelector('.lsg-bundle-interval-only-sub');\n            const sellingPlanInput = bundleBlock.querySelector('.lsg-bundle-form input[name=\"selling_plan\"]');\n            const frequencySelect = bundleBlock.querySelector('.lsg-bundle-interval-frequency-select');\n            if(intervalSelect){\n                //has otp/sub selector\n                bundleBlock.classList.add('lsg-bundle--has-interval-select');\n                let selectedInterval = intervalSelect.querySelector('input[name^=\"bundle_interval_select_\"]:checked');\n                switch(selectedInterval.value){\n                    case 'otp':\n                        bundleBlock.classList.add('lsg-bundle--otp-selected');\n                        sellingPlanInput.value = '';\n                        break;\n                    case 'sub':\n                        bundleBlock.classList.add('lsg-bundle--sub-selected');\n                        sellingPlanInput.value = frequencySelect.value;\n                        break;\n                }\n            } else if (onlyOTP) {\n                //has only otp options\n                bundleBlock.classList.add('lsg-bundle--only-otp');\n                sellingPlanInput.value = '';\n            } else if (onlySub) {\n                //has only sub options\n                bundleBlock.classList.add('lsg-bundle--only-sub');\n                sellingPlanInput.value = frequencySelect.value;\n            }\n\n            //intial enable/disable for quantity increments and submit button\n            bundleBlock.querySelectorAll('.lsg-bundle-product-set-list').forEach(function(productSetList){\n                incrementEnableValidation(productSetList.querySelector('.lsg-bundle-product-select-quantity-input'));\n            });\n            checkoutEnableValidation(sellingPlanInput);\n        });\n    }\n\n    function getBundleQuantity(trigger) {\n        //gets the quantity of the current active bundle block product list\n        let bundleBlock = getBundleBlock(trigger);\n        let quantity = -1;\n        let productList = bundleBlock.querySelector('.lsg-bundle-product-set-list');\n        if(productList){\n            quantity = 0;\n            productList.querySelectorAll('.lsg-bundle-product-select-quantity-input').forEach(function(input){\n                quantity = quantity + parseInt(input.value);\n            });\n        }\n        return quantity;\n    }\n\n    function getBundleQuantityByChild(trigger){\n        const productSetList = trigger.closest('.lsg-bundle-product-set-list');\n        let quantity = -1;\n        if(productSetList){\n            quantity = 0;\n            productSetList.querySelectorAll('.lsg-bundle-product-select-quantity-input').forEach(function(input){\n                quantity = quantity + parseInt(input.value);\n            });\n        }\n        return quantity;\n    }\n\n    function getBundleInterval(trigger) {\n        //checks if the bundle is set to display OTP or suscription options\n        let bundleBlock = getBundleBlock(trigger);\n        if(bundleBlock.classList.contains('lsg-bundle--has-interval-select')) {\n            if(bundleBlock.classList.contains('lsg-bundle--otp-selected')) {\n                return 'otp';\n            }\n            if(bundleBlock.classList.contains('lsg-bundle--sub-selected')) {\n                return 'sub';\n            }\n        }\n        if(bundleBlock.classList.contains('lsg-bundle--only-otp')) {\n            return 'otp';\n        }\n        if(bundleBlock.classList.contains('lsg-bundle--only-sub')) {\n            return 'sub';\n        }\n        return 'err';\n    }\n\n    function getBundleBlock(trigger) {\n        return trigger.closest('.lsg-bundle-block');\n    }\n\n    function getGuid() {\n        let d = new Date().getTime();\n        let d2 =  (performance && performance.now && (performance.now() * 1000)) || 0;\n        return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => {\n            let r = Math.random() * 16;\n            if (d > 0) {\n                r = (d + r) % 16 | 0;\n                d = Math.floor(d / 16);\n            } else {\n                r = (d2 + r) % 16 | 0;\n                d2 = Math.floor(d2 / 16);\n            }\n            return (c == 'x' ? r: (r & 0x7 | 0x8)).toString(16);\n        });\n    }\n\n    //Run initialize\n    initializeBundle();\n\n    $('[data-lsg-bundle-wrapper]').appendTo('[data-bundle-selector-wrap-main]');\n\n    buildStickyUI();\n\n    //Event Listeners\n    document.querySelectorAll('.lsg-bundle-product-select-quantity-increment').forEach(function(incrementButton){\n        incrementButton.addEventListener('click', function(e){\n            e.preventDefault();\n            incrementSubProduct(e.currentTarget);\n            buildSelectedProductArray(e.currentTarget);\n            incrementEnableValidation(e.currentTarget);\n            checkoutEnableValidation(e.currentTarget);\n            buildStickyUI();\n        })\n    });\n\n    document.querySelectorAll('.lsg-bundle-product-select-quantity-input').forEach(function(input){\n        input.addEventListener('change', function(e){\n            inputChangeSubProduct(e.currentTarget);\n            incrementEnableValidation(e.currentTarget);\n            checkoutEnableValidation(e.currentTarget);\n            buildStickyUI();\n        })\n    });\n\n    document.querySelectorAll('.lsg-bundle-interval-select input[name^=\"bundle_interval_select_\"]').forEach(function(intervalSelector){\n        intervalSelector.addEventListener('change', function(e){\n            updateInterval(e.currentTarget);\n            checkoutEnableValidation(e.currentTarget);\n            buildStickyUI();\n        });\n    });\n\n    document.querySelectorAll('.lsg-bundle-interval-frequency-select').forEach(function(frequencySelect){\n        frequencySelect.addEventListener('change', function(e){\n            updateFrequency(e.currentTarget);\n            buildStickyUI();\n        })\n    });\n\n    document.querySelectorAll('.lsg-bundle-form').forEach(function(bundleForm){\n        bundleForm.addEventListener('submit', function(e){\n            e.preventDefault();\n            addToCart(e.currentTarget);\n        });\n    });\n\n    document.querySelectorAll('.lsg-bundle-size-select-el').forEach(function(bundleSelector){\n        bundleSelector.addEventListener('click', function(e){\n            e.preventDefault();\n            setActiveBundle(e.currentTarget);\n        });\n    });\n\n    document.querySelectorAll('[data-bundle-builder-selected-product-remove-button]').forEach(function(removeButton){\n        removeButton.addEventListener('click', function(e){\n            e.preventDefault();\n            const triggeredProductWrapper = e.target.closest('[data-bundle-builder-selected-product-id]');\n            productSelectionButtonClicked = true;\n            productSelectionIndex = triggeredProductWrapper.getAttribute('data-index');\n            const productID = triggeredProductWrapper.getAttribute('data-bundle-builder-selected-product-id');\n            const bundleProduct = document.querySelector(`[data-lsg-bundle-product-select-id='${productID}']`);\n            const bundleProductDecrement = bundleProduct.querySelector('.lsg-bundle-product-select-quantity-minus');\n            bundleProductDecrement.click();\n        })\n    });\n};\n\n$(document).ready(function() {\n    if ($('[data-lsg-bundle-wrapper]').length) {\n        bundleBuilderInit();\n    }\n});\n\n// ========================================================================================\n// ========================================================================================\n// Slide Cart\n// ========================================================================================\n// ========================================================================================\n\n// ======================\n// UI Actions\n// ======================\n\n// Slide cart open/close\nlet original_selector;\n$(document).on('click', '[data-slidecart-trigger]', (e) => {\n    original_selector = $(e.target);\n    slideCartOpen();\n});\n$(document).on('click', '[data-close-slidecart], [slidecart-overlay]', slideCartClose);\n\n// KB trap (accessibility)\n$('#slidecart-wrapper').on('keydown', (e) => {\n    if ($(e.target).hasClass('first-focusable-element') && e.key == 'Tab' && e.shiftKey) {\n        e.preventDefault();\n        setTimeout(() => {\n            $('#slidecart-wrapper .last-focusable-element').get(0).focus();\n        });\n    } else if ($(e.target).hasClass('last-focusable-element') && e.key == 'Tab' && !e.shiftKey) {\n        e.preventDefault();\n        setTimeout(() => {\n            $('#slidecart-wrapper .first-focusable-element').get(0).focus();\n        });\n    }\n});\n\n// A stepper click used to fire a mutation immediately, so tapping \"+\" three\n// times sent three writes plus three reads and let them race: the third write\n// carries a quantity computed from whatever the DOM said at click time, and\n// whichever response lands last wins. Collect the clicks instead, send the\n// settled quantity once, and never have two writes for the same line in flight.\nconst QTY_DEBOUNCE_MS = 350;\nconst pendingQtyWrites = {};\n\nconst flushQtyWrite = (key) => {\n    const pending = pendingQtyWrites[key];\n    if (!pending) return;\n\n    delete pendingQtyWrites[key];\n\n    const write = pending.isBundleParent\n        ? window.APACart.mutate('/cart/update.js', { updates: pending.updates })\n        : window.APACart.mutate('/cart/change.js', { id: key, quantity: pending.quantity });\n\n    write\n        .then(function () {\n            renderCart();\n        })\n        .catch(function () {\n            // The mutation failed and cart:error has already surfaced it. Redraw\n            // from the server so the drawer shows what the cart actually holds\n            // rather than the optimistic number we painted on click.\n            renderCart();\n        });\n};\n\nconst cancelQtyWrite = (key) => {\n    const pending = pendingQtyWrites[key];\n    if (!pending) return;\n    if (pending.timer) clearTimeout(pending.timer);\n    delete pendingQtyWrites[key];\n};\n\nconst scheduleQtyWrite = (key, payload) => {\n    const existing = pendingQtyWrites[key];\n    if (existing && existing.timer) clearTimeout(existing.timer);\n\n    payload.timer = setTimeout(function () {\n        flushQtyWrite(key);\n    }, QTY_DEBOUNCE_MS);\n\n    pendingQtyWrites[key] = payload;\n};\n\nconst bindSlideCartUIActions = () => {\n\n    // Update item quantity\n    $(document).off().on('click', `[data-qty-button]`, (event) => {\n        event.preventDefault();\n\n        const key = $(event.target).attr('data-key');\n        // Read from the pending write when there is one, so a second click\n        // within the debounce window increments from the quantity we are about\n        // to send rather than from the last value the server confirmed.\n        const pending = pendingQtyWrites[key];\n        // The quantity the drawer was last *rendered* at, which is what the\n        // bundle child quantities in the DOM are expressed relative to. It must\n        // come from the pending record once one exists: the optimistic repaint\n        // below overwrites the value attribute on every click, so re-reading the\n        // DOM on a second click would divide by the optimistic number and send\n        // wrong child quantities.\n        const renderedQty = pending\n            ? pending.renderedQty\n            : parseInt($(`[data-input-key=\"${key}\"]`).attr('value'));\n        const currentQty = pending ? pending.quantity : renderedQty;\n        let newQty;\n        if ($(event.target).hasClass('js-plus-button')) {\n            newQty = currentQty + 1;\n        } else {\n            newQty = currentQty - 1;\n            if (newQty < 0) newQty = 0;\n        }\n\n        const bundleChildKeys = $(event.target).closest('[data-bundle-child-keys]').attr('data-bundle-child-keys');\n        const bundleChildQuantities = $(event.target).closest('[data-bundle-child-keys]').attr('data-bundle-child-quantities');\n\n        const isBundleParent = bundleChildKeys !== '' ? true : false;\n\n        // Paint the new number straight away either way. The debounce is about\n        // collapsing network writes, not about making the UI feel slower.\n        $(`[data-input-key=\"${key}\"]`).attr('value', newQty);\n\n        // if this is a bundle parent product\n        if (isBundleParent) {\n            const childKeysArray = bundleChildKeys.split(',');\n            const childQuantitiesArray = bundleChildQuantities.split(',');\n\n            let updates = {};\n\n            childKeysArray.forEach((childKey, i) => {\n                const currentChildQty = parseInt(childQuantitiesArray[i]);\n                let newChildQty = (currentChildQty / renderedQty) * newQty;\n                if (newChildQty < 0) newChildQty = 0;\n\n                updates[String(childKey)] = newChildQty;\n            });\n\n            scheduleQtyWrite(key, { isBundleParent: true, quantity: newQty, renderedQty: renderedQty, updates: updates });\n        } else {\n            scheduleQtyWrite(key, { isBundleParent: false, quantity: newQty, renderedQty: renderedQty });\n        }\n    });\n\n    // Remove item\n    $(`.slidecart-wrapper`).on(`click`, `span.removeItem`, (e) => {\n        e.stopPropagation();\n        e.preventDefault();\n        var key = $(e.target).attr('data-remove-key');\n        // Drop any debounced quantity write still queued for this line. Sending\n        // it after the removal would target a line key the cart no longer has.\n        cancelQtyWrite(key);\n        // Redraw on failure as well as success: a remove that did not take must\n        // not leave the row looking gone.\n        window.APACart.mutate('/cart/change.js', { id: key, quantity: 0 })\n            .then(renderCart, renderCart);\n    });\n\n    // Add upsell\n    $(document).on('click', '[data-upsell-atc]', (event) => {\n        var button = $(event.target);\n        var variantId = button.attr('data-upsell-atc');\n        if (button.prop('disabled')) return;\n\n        // Disabling for the duration is the cheapest possible dedupe: an upsell\n        // tile is a single-purpose button, and a second click before the first\n        // resolves only ever meant \"I could not tell whether that worked\".\n        button.prop('disabled', true);\n        window.APACart.mutate('/cart/add.js', { id: variantId, quantity: 1 })\n            .then(renderCart, renderCart)\n            .then(function () {\n                button.prop('disabled', false);\n            });\n    });\n\n    // Submit discount code (string selector so it only fires for the discount form,\n    // not every form submit on the page)\n    $(document).on('submit', '[data-cart-discount-form]', onDiscountFormSubmit);\n\n    // Trigger First Purchase Form\n    $(document).on('click', '[data-trigger-first-purchase-form]', (e) => {\n        e.preventDefault();\n        firstPurchaseTrigger();\n    });\n\n    // Toggle OTP to Subscribe\n    $(document).on('click', '[data-cart-toggle-subscribe]', (event) => {\n        event.preventDefault();\n        updateItemSubscription(event);\n    });\n\n    // Trigger Cart OTP to Subscribe\n    $(document).on('click', '[data-trigger-cart-subscribe]', (e) => {\n        e.preventDefault();\n        updateCartSubscription(e);\n    });\n\n    // Change Subscription Plan\n    $(document).on('change', '[data-subscribe-select]', (event) => {\n        event.preventDefault();\n        updateItemSubscription(event);\n    });\n\n    $(document).on('change', '.slidecart-item-cart-upsells-variants', function() {\n        const helperElement = document.querySelector(\".slidecart-cart-upsells-helper-element\");\n        const selectedOption = $(this).find('option:selected');\n        helperElement.innerHTML = selectedOption.text();\n        $(this).css('width', helperElement.offsetWidth + 5 + 'px');\n        let properties = {};\n        let removalData= {\n            updates: {}\n        };\n        removalData['updates'][$(this).attr('data-key')] = 0;\n\n        if (selectedOption.attr('data-type') == '_is_first_cart_upsale') {\n            properties = {\n                \"_is_cubies_dry_food_sr_cart_upsale\": \"true\",\n                \"_is_first_cart_upsale\": \"true\"\n            }\n        }\n\n        if (selectedOption.attr('data-type') == '_is_second_cart_upsale') {\n            properties = {\n                \"_is_cubies_dry_food_sr_cart_upsale\": \"true\",\n                \"_is_second_cart_upsale\": \"true\"\n            }\n        }\n\n\n\n        const data = {\n            \"items\": [{\n                \"id\": parseInt(selectedOption.attr('value')),\n                \"quantity\": 1,\n                \"properties\": properties\n            }]\n        };\n\n        $.ajax({\n            type: 'POST',\n            url: '/cart/add.js',\n            data: data,\n            dataType: 'json',\n            success: () => {\n                $.ajax({\n                    type: 'POST',\n                    url: '/cart/update.js',\n                    data: removalData,\n                    dataType: 'json',\n                    success: () => {\n                        renderCart();\n                    },\n                    error: (err) => {\n                    }\n                });\n            },\n            error: (err) => {\n            }\n        });\n    });\n\n}\n\n// ======================\n// Dynamic product list height\n// ======================\n\nconst setProductListHeight = () => {\n    /* let headerFooterHeight =  $('.slidecart-title-wrapper').outerHeight(true) + $('.slidecart-bottom-wrapper').outerHeight() + 20;\n    const wrapEl= $('[slidecart-cart-upsells-wrapper]');\n    if (wrapEl.length > 0) {\n        headerFooterHeight+= wrapEl.outerHeight()\n    }\n    $('.slidecart-inner').css('height', `calc(100vh - ${headerFooterHeight}px)`); */\n\n}\n\n// ======================\n// Discount Code\n// ======================\n\nconst onDiscountFormSubmit = (e) => {\n    const discountInput = $('[data-cart-discount-form-input]')[0];\n    if (!discountInput) return; // No discount form on this page \u2014 let the submit proceed\n    e.preventDefault();\n    const value = discountInput.value;\n    if (value.length === 0) return\n    // Append discount code to checkout link URL.\n    const checkoutLink = $('[data-cart-checkout-link]')[0];\n    if (checkoutLink) checkoutLink.href = `/checkout?discount=${value}`;\n    // Surface that discount will be applied at checkout.\n    $('[data-cart-discount-info]').addClass('active');\n    // Clear input.\n    discountInput.value = '';\n}\n\n// ======================\n// Subscribe\n// ======================\n\n// IMPORTANT - WIP - This needs to be re-worked, currently has a bug when subsctription is toggled and other items are in the cart\n\n// First Purchase\nconst firstPurchaseTrigger = () => {\n    if (window.innerWidth >= 750) {\n        // Desktop\n        window._klOnsite = window._klOnsite || [];\n        window._klOnsite.push(['openForm', 'XZstBu']);\n    } else {\n        // Mobile\n        window._klOnsite = window._klOnsite || [];\n        window._klOnsite.push(['openForm', 'TnrneV']);\n    }\n};\n\n// Update slide cart all to subscription\nconst updateCartSubscription = (e) => {\n    //\n    const trigger = e.target;\n    const cartWrapper = trigger?.closest('.slidecart-wrapper');\n    const productWrapper = cartWrapper?.querySelector('[slidecart-product-wrapper]');\n    const subToggles = productWrapper?.querySelectorAll('[data-cart-toggle-subscribe]:not(.hidden)');\n    let additionDataArray = {\n        items: []\n    };\n    let removalData= {\n        updates: {}\n    };\n    subToggles.forEach((toggle) => {\n        const key = toggle.getAttribute('key');\n        const id = parseInt(toggle.getAttribute('product_id'));\n        const qty = parseInt(toggle.getAttribute('qty'));\n        const plan = parseInt(toggle.getAttribute('plan_id'));\n        const bundleChildKeys = toggle.closest('[data-bundle-child-keys]').getAttribute('data-bundle-child-keys');\n        const bundleChildQuantities = toggle.closest('[data-bundle-child-quantities]').getAttribute('data-bundle-child-quantities');\n        const bundleID = toggle.closest('[data-bundle-id]').getAttribute('data-bundle-id');\n        const bundleParentKey = toggle.closest('[data-bundle-parent-key]').getAttribute('data-bundle-parent-key');\n        const isBundleParent = bundleChildKeys !== '' ? true : false;\n        if (isBundleParent === true) {\n            const childKeysArray = bundleChildKeys.split(',');\n            const childQuantitiesArray = bundleChildQuantities.split(',');\n\n            childKeysArray.forEach((childKey, i) => {\n                const childIsBundleParent = childKey === bundleParentKey ? true : false;\n                const currentChildQty = parseInt(childQuantitiesArray[i]);\n                const childID = parseInt(childKey.split(':')[0]);\n\n                removalData['updates'][childKey] = 0;\n\n                additionDataArray['items'].push({\n                    quantity: currentChildQty,\n                    id: childID,\n                    selling_plan: plan,\n                    properties: {\n                        bundle_id: bundleID,\n                        bundle_parent: childIsBundleParent\n                    }\n                });\n            });\n        }\n        else {\n            removalData['updates'][key] = 0;\n\n            additionDataArray['items'].push({\n                quantity: qty,\n                id: id,\n                selling_plan: plan,\n                properties: {\n                    bundle_id: false,\n                    bundle_parent: false\n                }\n            });\n        }\n    });\n    const reAddToCart = ()=> {\n        fetch(window.Shopify.routes.root + 'cart/add.js', {\n            method: 'POST',\n            headers: {\n                'Content-Type': 'application/json'\n            },\n            body: JSON.stringify(additionDataArray)\n        }).then((response) => {\n            renderCart();\n        })\n            .catch((error) => {\n                console.error('Error:', error);\n            });\n    };\n\n    $.ajax({\n        type: 'POST',\n        url: '/cart/update.js',\n        data: removalData,\n        dataType: 'json',\n        success: () => {\n            setTimeout(function(){\n                reAddToCart();\n            }, 750);\n        }\n    });\n};\n\n// Update slide cart item subscription\nconst updateItemSubscription = (event) => {\n\n    let key,\n        qty,\n        plan,\n        oldPlan,\n        id,\n        additionDataArray = {},\n        removalData= {\n            updates: {}\n        };\n\n\n    if ($(event.target).is('[data-cart-toggle-subscribe]')) {\n        key = $(event.target).attr('key');\n        id = parseInt($(event.target).attr('product_id'));\n        qty = parseInt($(event.target).attr('qty'));\n        plan = parseInt($(event.target).attr('plan_id'));\n    }\n    if ($(event.target).is('[data-subscribe-select]')) {\n        key = $(\"option:selected\", $(event.target)).attr('key');\n        id = parseInt($(\"option:selected\", $(event.target)).attr('product_id'));\n        qty = parseInt($(\"option:selected\", $(event.target)).attr('qty'));\n        plan = parseInt($(\"option:selected\", $(event.target)).attr('value'));\n        oldPlan = parseInt($(\"option:selected\", $(event.target)).attr('plan_id'));\n    }\n\n    const isOTP = isNaN(parseFloat(plan));\n\n    if (oldPlan === plan) return\n\n    // Determine if this is a bundle parent\n    const bundleChildKeys = $(event.target).closest('[data-bundle-child-keys]').attr('data-bundle-child-keys');\n    const bundleChildQuantities = $(event.target).closest('[data-bundle-child-quantities]').attr('data-bundle-child-quantities');\n    const bundleID = $(event.target).closest('[data-bundle-id]').attr('data-bundle-id');\n    const bundleParentKey = $(event.target).closest('[data-bundle-parent-key]').attr('data-bundle-parent-key');\n\n    const isBundleParent = bundleChildKeys !== '' ? true : false;\n\n    // if this is a bundle parent product\n    if (isBundleParent === true) {\n        const childKeysArray = bundleChildKeys.split(',');\n        const childQuantitiesArray = bundleChildQuantities.split(',');\n\n        let product_data = childKeysArray.map((childKey, i) => {\n            const childIsBundleParent = childKey === bundleParentKey ? true : false;\n            const currentChildQty = parseInt(childQuantitiesArray[i]);\n            const childID = parseInt(childKey.split(':')[0]);\n\n            removalData['updates'][childKey] = 0;\n\n            if (isOTP) {\n                return {\n                    quantity: currentChildQty,\n                    id: childID,\n                    properties: {\n                        bundle_id: bundleID,\n                        bundle_parent: childIsBundleParent\n                    }\n                }\n            } else {\n                return {\n                    quantity: currentChildQty,\n                    id: childID,\n                    selling_plan: plan,\n                    properties: {\n                        bundle_id: bundleID,\n                        bundle_parent: childIsBundleParent\n                    }\n                }\n            }\n        })\n\n        additionDataArray = {\n            items: product_data\n        };\n    }\n    else {\n\n        removalData['updates'][key] = 0;\n\n        if (isOTP) {\n            additionDataArray = {\n                items: [{\n                    quantity: qty,\n                    id: id,\n                    properties: {\n                        bundle_id: false,\n                        bundle_parent: false\n                    }\n                }]\n            }\n        } else {\n            additionDataArray = {\n                items: [{\n                    quantity: qty,\n                    id: id,\n                    selling_plan: plan,\n                    properties: {\n                        bundle_id: false,\n                        bundle_parent: false\n                    }\n                }]\n            }\n        }\n    }\n\n\n\n    // This used to call itself again the instant the item was missing from the\n    // cart, with no cap and no delay. Under any condition that makes the add\n    // fail repeatedly (a throttled response, a sold-out variant) that is an\n    // unbounded loop that hammers the cart and never tells the shopper\n    // anything. One retry is enough for the edge case it was written for (the\n    // just-added line being removed by another handler); past that, stop and\n    // surface it.\n    const MAX_READD_ATTEMPTS = 2;\n\n    const reAddToCart = (attempt = 1) => {\n        return window.APACart.mutate('/cart/add.js', additionDataArray)\n            .then(() => {\n                if (isBundleParent === true) {\n                    renderCart();\n                    return;\n                }\n\n                // Confirm the line actually landed, from the server rather than\n                // from the write response, since a bundle swap can drop a line\n                // that the add itself reported as accepted.\n                return window.APACart.get({ force: true }).then((cart) => {\n                    const productExists = cart.items.some((item) => {\n                        const itemBundleID = (item.properties !== null) ? ((item.properties.bundle_id !== undefined) ? item.properties.bundle_id : false) : false;\n                        return itemBundleID == false && item.id === id;\n                    });\n\n                    if (productExists || attempt >= MAX_READD_ATTEMPTS) {\n                        if (!productExists) {\n                            document.dispatchEvent(new CustomEvent('cart:error', {\n                                detail: { message: 'We could not add that to your cart. Please try again.' }\n                            }));\n                        }\n                        renderCart();\n                        return;\n                    }\n\n                    // Wait before trying again. Firing the next add in the same\n                    // tick is what made the original version a request storm;\n                    // capping the attempts without spacing them only shortens it.\n                    return new Promise((resolve) => setTimeout(resolve, 750))\n                        .then(() => reAddToCart(attempt + 1));\n                });\n            })\n            .catch(() => {\n                // cart:error has already been raised by APACart. Redraw so the\n                // drawer matches the server rather than the add we attempted.\n                renderCart();\n            });\n    };\n\n    window.APACart.mutate('/cart/update.js', removalData)\n        .then(() => reAddToCart(), () => renderCart());\n};\n\n// ++++++++++++++++++++++++++++++++++++++++++++++++++\n// CLEAR CART - temporary for dev\nconst clearCart = () => {\n    $.ajax({\n        type: \"POST\",\n        url: '/cart/clear.js',\n        data: '',\n        dataType: 'json',\n        success: function() {\n            Shopify.clear();\n        },\n        error: function(XMLHttpRequest, textStatus) {\n            /* error code */\n        }\n    });\n}\n// clearCart();\n// ++++++++++++++++++++++++++++++++++++++++++++++++++\n\nfunction slideCartOpen() {\n    $(`#slidecart-wrapper`).removeClass('hide');\n    $(`#slidecart-wrapper`).attr('aria-hidden', false);\n    $('[data-slidecart-trigger]').attr('aria-expanded', true);\n    setTimeout(() => {\n        $(`#slidecart-wrapper`).addClass('active');\n        $(`[slidecart-overlay]`).addClass('active');\n        $('html, body').css('overflow-y', 'hidden');\n        document.body.classList.add('cart-open');\n        $('#slidecart-wrapper .first-focusable-element').get(0).focus();\n        renderCart();\n    }, 100);\n}\n\nfunction slideCartClose() {\n    $(`#slidecart-wrapper`).removeClass('active');\n    $('html, body').css('overflow-y', '');\n    document.body.classList.remove('cart-open');\n    $(`[slidecart-overlay]`).removeClass('active');\n    setTimeout(() => {\n        $(`#slidecart-wrapper`).addClass('hide');\n        $(`#slidecart-wrapper`).attr('aria-hidden', true);\n        $('[data-slidecart-trigger]').attr('aria-expanded', false);\n        $('#slidecart-wrapper [data-close-slidecart]').get(0).focus();\n        if (original_selector) {\n            original_selector.get(0).focus();\n        }\n        document.body.classList.remove('atc-cart');\n    }, 500);\n}\n\nfunction clearCartDrawer() {\n    $(`[slidecart-product-wrapper], [slidecart-product-wrapper], [slidecart-upsell-wrapper]`).html('');\n}\n\n// Obfuscates cart items - Combine duplicates items & hide child subsciption items\nconst obscureCartData = (cart) => {\n\n    let obscuredCartData = []\n\n    cart.items.forEach((item) => {\n\n        const itemPrice = parseFloat(item.line_price / 100).toFixed(2).replace(/(\\d)(?=(\\d{3})+\\.)/g, \"$1\").toString();\n        const itemFinalPrice = parseFloat((item.final_price * item.quantity) / 100).toFixed(2).replace(/(\\d)(?=(\\d{3})+\\.)/g, \"$1\").toString();\n\n        const itemSellingPlanAllocation = (item.selling_plan_allocation !== undefined) ? true : false;\n        const itemPlanId = (item.selling_plan_allocation !== undefined) ? item.selling_plan_allocation.selling_plan.id : false;\n        const itemPlanType = (item.selling_plan_allocation !== undefined) ? item.selling_plan_allocation.selling_plan.name : false;\n        const itemBundleID = (item.properties !== null) ? ((item.properties.bundle_id !== undefined) ? item.properties.bundle_id : false) : false;\n        const isBundleChild = (item.properties !== null) ? ((item.properties.bundle_id !== undefined && item.properties.bundle_parent === undefined) ? true : false) : false;\n        const isBundleParent = (item.properties !== null) ? ((item.properties.bundle_parent === true) ? true : false) : false;\n        const itemComparisonPrice = (itemSellingPlanAllocation) ? (item.selling_plan_allocation.compare_at_price ? (parseFloat(item.selling_plan_allocation.compare_at_price * item.quantity / 100).toFixed(2).replace(/(\\d)(?=(\\d{3})+\\.)/g, \"$1\").toString()) : itemPrice) : itemFinalPrice;\n        let title = item.title.split(\" (\")[0];\n        // For variant products, drop the size from the name so it matches non-variant products (size is shown in the pack-size badge)\n        if (item.variant_title && item.variant_title !== 'Default Title') {\n            const recipeParts = item.variant_title\n                .split('/')\n                .map(part => part.trim())\n                .filter(part => part && !/^\\d+(?:\\.\\d+)?\\s*lb$/i.test(part));\n            title = recipeParts.length ? (item.product_title + '<br>' + recipeParts.join(' ')) : item.product_title;\n        }\n        let cartDataItem = {\n            itemID: item.id,\n            itemTitle: title ,\n            itemHandle: item.handle,\n            itemImage: item.image,\n            itemPrice: itemPrice,\n            itemComparisonPrice: itemComparisonPrice,\n            itemQuantity: item.quantity,\n            itemGrams: item.grams,\n            itemUrl: item.url,\n            itemKey: item.key,\n            itemSellingPlanAllocation: itemSellingPlanAllocation,\n            itemPlanId: itemPlanId,\n            itemPlanType: itemPlanType,\n            itemBundleID: itemBundleID,\n            isBundleChild: isBundleChild,\n            isBundleParent: isBundleParent,\n            bundleChildKeys: '',\n            bundleChildQuantities: '',\n            bundleItemList: '',\n            bundleParentKey: '',\n            itemTags: [],\n            itemProperties: item.properties,\n            itemVariantId: item.variant_id,\n            itemVariantTitle: item.variant_title\n        };\n\n\n        obscuredCartData.push(cartDataItem);\n    });\n\n    let removalIndexes = [];\n    obscuredCartData.forEach((mainItem) => {\n\n        if (mainItem.isBundleParent) {\n\n            const mainItemBundleID = mainItem.itemBundleID;\n\n            if (mainItemBundleID) {\n                let bundleChildKeys = [];\n                let bundleChildQuantities = [];\n                let bundleItemList = '';\n\n                obscuredCartData.forEach((comparedItem, i) => {\n                    const comparedItemBundleID = comparedItem.itemBundleID;\n                    const comparedItemPrice = parseFloat(comparedItem.itemPrice);\n\n\n                    if (comparedItem.isBundleParent === false && comparedItemBundleID === mainItemBundleID) {\n                        // const keyAndQuantity = {\n                        //   key: comparedItem.itemKey,\n                        //   quantity: comparedItem.itemQuantity,\n                        // }\n                        bundleChildKeys.push(comparedItem.itemKey)\n                        bundleChildQuantities.push(comparedItem.itemQuantity)\n                        bundleItemList += '<li class=\"cart-item-bundle-el\">' + comparedItem.itemTitle + (comparedItem.itemQuantity > 1 ? ' (' + comparedItem.itemQuantity + ')' : '') + '</li>';\n                        mainItem.itemPrice = parseFloat(parseFloat(mainItem.itemPrice) + comparedItemPrice).toFixed(2);\n                        removalIndexes.push(i);\n                    }\n                    if (comparedItem.isBundleParent === true && comparedItemBundleID === mainItemBundleID) {\n                        bundleChildKeys.push(comparedItem.itemKey)\n                        bundleChildQuantities.push(comparedItem.itemQuantity)\n                        mainItem.bundleParentKey = comparedItem.itemKey;\n                    }\n                })\n\n                mainItem.bundleChildKeys = bundleChildKeys;\n                mainItem.bundleChildQuantities = bundleChildQuantities;\n                mainItem.bundleItemList = (bundleItemList != '' ? '<ul class=\"cart-item-bundle-items\">' + bundleItemList + '</ul>' : '');\n            }\n        }\n    });\n\n    obscuredCartData = obscuredCartData.filter((item, index) => {\n        return removalIndexes.indexOf(index) == -1;\n    })\n\n    return obscuredCartData;\n};\n\nconst initQuantityElements = ()=> {\n    // Runs on every page load purely to paint the header count. Routed through\n    // APACart so it reuses whatever snapshot the drawer or an app embed has\n    // already fetched rather than adding another identical read.\n    return window.APACart.get()\n        .then(function (cart) {\n            const obscuredCartData = obscureCartData(cart);\n            let cartQty = 0;\n            obscuredCartData.forEach((item, index) => {\n                if (item.isBundleChild) return;\n                cartQty = cartQty + item.itemQuantity;\n            });\n            $('[data-cart-slider-total-quantity]').html(`(${cartQty})`);\n            $('[data-lsg-cart-count]').html(cartQty);\n        })\n        .catch(function () {\n            // Leave the badge at its server-rendered value. Overwriting it with\n            // a guess would be worse than showing a slightly stale count.\n        });\n}\n\nconst updateQuantityElements = (data)=> {\n    const obscuredCartData = data;\n    let cartQty = 0;\n    obscuredCartData.forEach((item, index) => {\n        if (item.isBundleChild) return;\n        cartQty = cartQty + item.itemQuantity;\n    });\n    $('[data-cart-slider-total-quantity]').html(`(${cartQty})`);\n    $('[data-lsg-cart-count]').html(cartQty);\n}\n\nfunction renderCart() {\n    // Reads go through APACart so that the several callers that all want the\n    // cart at the same moment (drawer open, quantity change, upsell add, the\n    // shipping bar) share one request instead of each issuing their own.\n    // APACart publishes cart.update / cart:updated itself, so the dispatches\n    // that used to live here have moved into that module and still reach every\n    // existing listener.\n    //\n    // Forced, always. renderCart() is what runs immediately after a cart write,\n    // including the several legacy call sites that still POST with their own\n    // $.ajax and never tell APACart anything. An unforced read there could be\n    // served from a snapshot taken before the add and redraw the drawer without\n    // the line the shopper just added. APACart.mutate() deliberately does not\n    // re-read, so this is the single read per write, not a second one.\n    return window.APACart.get({ force: true })\n        .then(function (cart) {\n\n            clearCartDrawer();\n\n            // // Cart shipping bar - saved in case of future implementation\n            // const freeShipping = $(`[slidecart-shipping-bar]`).attr('free-shipping-minimum');\n            // var amountToShipping = (parseInt(freeShipping) - parseFloat(cart.items_subtotal_price / 100).toFixed(2)).toFixed(2);\n\n            // if (amountToShipping <= 0) {\n            //   $('[slidecart-shipping-bar][amountaway]').show();\n            //   $(`[shipping-label]`).html('');\n            //   $(`[shipping-label]`).html('You get Free Shipping!');\n            //   $(`[shipping-bar-percent]`).css('max-width', '100%');\n            // }\n            // else if (parseInt(amountToShipping) == parseInt(freeShipping)) {\n            //   $('[slidecart-product-wrapper]').html('Your cart is empty');\n            //   $('[slidecart-shipping-bar], [amountaway]').hide();\n            // }\n            // else {\n            //   $('[slidecart-shipping-bar], [amountaway]').show();\n            //   var spendMore = `Spend <span class=\"slidecart-shipping-price\">$${amountToShipping}</span> more to get free shipping`;\n            //   var amountAway = `You are <span class=\"slidecart-shipping-price\">$${amountToShipping}</span> away from free shipping`;\n            //   var shippingOver = `Free shipping over <span class=\"slidecart-shipping-price\">$${freeShipping}</span>`;\n            //   $(`[shipping-label]`).html('');\n            //   $(`[spendMore]`).html(spendMore);\n            //   $(`[amountAway]`).html(amountAway);\n            //   $(`[shippingOver]`).html(shippingOver);\n            //   var maxWidth = (parseFloat(cart.items_subtotal_price / 100).toFixed(1) / parseInt(freeShipping)) * 100;\n            //   $(`[shipping-bar-percent]`).css('max-width', maxWidth + '%');\n            // }\n\n            // Obscure cart data\n            if(cart.item_count == 0){\n                $('.slidecart-wrapper').addClass(\"is-empty\")\n            }else{\n                $('.slidecart-wrapper').removeClass(\"is-empty\")\n            }\n\n            const obscuredCartData = obscureCartData(cart);\n\n            // Update quantity elements\n            updateQuantityElements(obscuredCartData);\n\n            // Update subtotal\n            let cartSubscriptionDiscount = 0;\n            cart.items.forEach((item) => {\n                const spa = item.selling_plan_allocation;\n                if (spa) {\n                    cartSubscriptionDiscount += (spa.compare_at_price ? ((spa.compare_at_price - spa.price) * item.quantity) : 0);\n                }\n            });\n            const cartSubtotal = `<p>${cartSubscriptionDiscount > 0 ? '<span class=\"cart-subtotal-comparison\">$' + parseFloat((cartSubscriptionDiscount + cart.total_price) / 100).toFixed(2).replace(/(\\d)(?=(\\d{3})+\\.)/g, \"$1\").toString() + '</span>' : ''}$${parseFloat(cart.total_price / 100).toFixed(2).replace(/(\\d)(?=(\\d{3})+\\.)/g, \"$1\").toString()}</p>`;\n            const cartSubtotalInfo = `<h2>Subtotal <span class=\"cart-subtotal-count\">(${cart.item_count} item${cart.item_count > 1 ? 's' : ''})</span></h2> ${cartSubtotal}`;\n            $(`[cart-subtotal]`).html(cartSubtotalInfo);\n\n            /////////////////////////////////////////////////////////////////////\n            /////////////////////////////////////////////////////////////////////\n            // Render cart items\n\n            $('.slidecart-wrapper').addClass('slidecart--show-cart-sub-upsell');\n\n            obscuredCartData.forEach((item, index) => {\n                let productTitle = `<h2>${item.itemTitle}</h2>`;\n                const productHandle = item.itemHandle;\n                const productId = item.itemID;\n                const productImage = `<img src=\"${item.itemImage}\" >`;\n                const productPrice = `<p>${item.itemPrice==0.00?'FREE':item.itemPrice}</p>`;\n                const productComparisonPrice = (item.itemPrice !== item.itemComparisonPrice) ? `<p class=\"slidecart-item-comparison-price\">${item.itemComparisonPrice}</p>` : '';\n                const productQuantity = item.itemQuantity;\n                const productGrams = item.itemGrams;\n                const productUrl = item.itemUrl;\n                const productKey = item.itemKey;\n                const productPlanAllocation = item.itemSellingPlanAllocation;\n                // const productPlanId = item.itemPlanId;\n                // const productPlanType = item.itemPlanType;\n                const productBundleID = item.itemBundleID;\n                const isBundleChild = item.isBundleChild;\n                const isBundleParent = item.isBundleParent;\n                const bundleChildKeys = item.bundleChildKeys;\n                const bundleChildQuantities = item.bundleChildQuantities;\n                const bundleItemList = item.bundleItemList;\n                const bundleParentKey = item.bundleParentKey;\n                let productTags = item.itemTags;\n                $.ajax({\n                    dataType: 'json',\n                    url: '/products/' + productHandle + '.js',\n                    async: false,\n                    success: function(prod){\n                        productTags = prod.tags;\n                    }\n                });\n\n                let productPackSize,\n                    sellingPlanId,\n                    planType,\n                    planIdLoaded = false,\n                    toggleButtonClass,\n                    subscribeDropdownClass,\n                    sellingPlanGroup,\n                    percentOff,\n                    sellingPlans,\n                    productBundleId;\n\n                // Keep only the plans the cart item's variant has allocations for\n                const filterPlansForCartVariant = (product, plans) => {\n                    if (!plans) return plans;\n                    const variant = (product.variants || []).find(v => v.id == item.itemVariantId);\n                    if (!variant || !variant.selling_plan_allocations) return plans;\n                    const allocatedIds = variant.selling_plan_allocations.map(a => a.selling_plan_id);\n                    return plans.filter(plan => allocatedIds.includes(plan.id));\n                };\n\n                jQuery.getJSON(window.Shopify.routes.root + `products/${productHandle}.js`, (product) => {\n                    if (product.selling_plan_groups.length > 0) {\n                        const rtxGroup = product.selling_plan_groups.find(group => group.app_id == '5859381') || product.selling_plan_groups[0];\n                        sellingPlans = filterPlansForCartVariant(product, rtxGroup.selling_plans);\n                    }\n                }).success((product) => {\n                    // Item is a subscription\n                    if (productPlanAllocation) {\n                        sellingPlanId = item.itemPlanId;\n                        planType = item.itemPlanType;\n                        toggleButtonClass = 'hidden';\n                        subscribeDropdownClass = '';\n                    }\n                    // Item is one-time purchase\n                    else {\n                        if (product.selling_plan_groups.length > 0) {\n                            let sellingPlanGroup = product.selling_plan_groups.find(group => group.app_id == '5859381') || product.selling_plan_groups[0];\n                            sellingPlans = filterPlansForCartVariant(product, sellingPlanGroup.selling_plans);\n                            if (sellingPlans && sellingPlans.length > 0) {\n                                let targetSellingPlan = sellingPlans.find(plan => plan.name == 'Ships every 4 weeks') || sellingPlans[0];\n                                sellingPlanId = targetSellingPlan.id;\n                                const groupName = sellingPlanGroup.name;\n                                percentOff = groupName.substring( groupName.indexOf('(') + 1, groupName.lastIndexOf(')') );\n                                toggleButtonClass = '';\n                                subscribeDropdownClass = 'hidden';\n                            } else {\n                                // Variant has no available plans \u2014 hide subscribe UI\n                                toggleButtonClass = 'hidden';\n                                subscribeDropdownClass = 'hidden';\n                            }\n                        } else {\n                            toggleButtonClass = 'hidden';\n                            subscribeDropdownClass = '';\n                        }\n                        planType = 'One-time purchase';\n                    }\n                    planIdLoaded = true;\n                });\n\n                const factor = 0.00220462;\n                let grams = productGrams;\n                let packagingType = 'bags';\n                let foodType = false;\n\n                if(productTags.includes('type=fresh')) {\n                    foodType = 'fresh food';\n                    packagingType = 'bags';\n                } else if(productTags.includes('type=dry')) {\n                    foodType = 'dry food';\n                    packagingType = 'boxes';\n                }\n                // Variant grams cover the whole pack, while the size tag and the variant\n                // title carry the per-bag size. Track which source won so the weight can be\n                // normalised to a pack total below.\n                let productWeight = Math.round(grams * factor) + 'LB';\n                let weightIsPerBag = false;\n                const sizeTags = productTags.filter(s => s.includes('size='));\n                sizeTags.map(sTag => {\n                    let split_sTag = sTag.split('=');\n                    const productHandle2 = productHandle.replace(\"-bags\",\"bags\");\n                    if (split_sTag[2] == productHandle2) {\n                        productWeight = split_sTag[1];\n                        weightIsPerBag = true;\n                    }\n                })\n\n                // Multi-variant products report 0 grams, so read the weight from the Size\n                // variant. The raw variant title (e.g. \"Chicken / 3lb\" or \"3LB\") still carries\n                // the size, whereas itemTitle has had the lb stripped out in obscureCartData.\n                if (parseFloat(productWeight) === 0) {\n                    const sizeSource = String(item.itemVariantTitle || item.itemTitle || '');\n                    const titleWeightMatch = sizeSource.match(/(\\d+(?:\\.\\d+)?)\\s*lb/i);\n                    if (titleWeightMatch) {\n                        productWeight = parseFloat(titleWeightMatch[1]) + 'LB';\n                        weightIsPerBag = true;\n                    }\n                }\n\n                // Pack Size\n                if (productHandle.includes('sampler') || productHandle.includes('combo') || productHandle.includes('sensitive-stomach-fresh') || productHandle.includes('grain-free')) productPackSize = 4;\n                else if (productHandle.includes('6-bags') || productHandle.includes('6bags')) productPackSize = 6;\n                else if (productHandle.includes('4-bags') || productHandle.includes('4bags')) productPackSize = 4;\n                else productPackSize = 2;\n                const foodTypeEl = foodType ? item.itemTitle.toLowerCase().indexOf(foodType) == -1 ? `<span class=\"slidecart-item-food-type\">${foodType}</span>` : '' : '';\n                // Copy reads \"2 bags (6LB total)\", so scale per-bag weights by the pack size.\n                const parsedWeight = parseFloat(productWeight);\n                const totalWeight = weightIsPerBag ? parsedWeight * productPackSize : parsedWeight;\n                const productWeightText = totalWeight ? ` (${totalWeight}LB total)` : '';\n                const packSizeEl = `<span class=\"slidecart-item-pack-size\">${productPackSize} ${packagingType}${productWeightText}</span>`;\n\n                function renderItem() {\n                    const isAB13C = document.body.classList.contains('ab13-c');\n                    if(planIdLoaded === false) window.setTimeout(renderItem, 100);\n                    else {\n                        let concatSellingPlanOptions = '';\n                        if (sellingPlans) {\n\n                            sellingPlans.forEach(plan => {\n                                let sellingPlanSelectAttr;\n                                if (plan.id === sellingPlanId) sellingPlanSelectAttr = 'selected'\n                                concatSellingPlanOptions =  `\n                    ${concatSellingPlanOptions} \n                    <option value=\"${plan.id}\" \n                            product_id=\"${productId}\" \n                            qty=\"${productQuantity}\" \n                            key=\"${productKey}\"\n                            plan_id=\"${sellingPlanId}\"\n                            ${sellingPlanSelectAttr}\n                    >\n                      ${plan.name}\n                    </option>\n                  `;\n                            });\n                        }\n\n                        const concatSubscribeDropdown = `\n                <select name=\"selling_plan\" class=\"cart_item_selling_plan  ${subscribeDropdownClass}\" data-subscribe-select>\n                  <option value=\"\" \n                          product_id=\"${productId}\" \n                          qty=\"${productQuantity}\" \n                          key=\"${productKey}\"\n                          plan_id=\"${sellingPlanId}\"\n                  >\n                    One-Time Purchase \n                  </option>\n                  ${concatSellingPlanOptions}\n                </select>\n              `;\n\n                        let concatProductInfo = '';\n                        if (!isAB13C) {\n                            concatProductInfo = `\n                <div  class=\"slidecart-item-wrapper\" \n                      data-slidecart-item=\"${productId}\" \n                      data-line=\"${Number(index + 1)}\" \n                      data-bundle-child-keys=\"${bundleChildKeys}\" \n                      data-bundle-child-quantities=\"${bundleChildQuantities}\" \n                      data-bundle-id=\"${productBundleID}\" \n                      data-bundle-parent-key=\"${bundleParentKey}\" \n                >\n                <div class=\"slidecart-item-holder\">\n                  <div class=\"slidecart-item-image-wrapper\">${productImage}</div>\n                  <div class=\"slidecart-item-details-wrapper\">\n                    <div class=\"slidecart-item-details-top\">\n                      <div class=\"slidecart-item-description-wrapper\">\n                        ${foodTypeEl}\n                        <a class=\"slidecart-item-title\" href=\"${productUrl}\">${productTitle}</a>\n                        ${bundleItemList}\n                        ${packSizeEl}\n                      </div>\n                      <div class=\"slidecart-item-qty-wrapper\">\n                        <span class=\"removeItem\" data-remove-key=\"${productKey}\">Remove</span>\n                        <span class=\"slidecart-item-price\">${productComparisonPrice || ''} ${productPrice}</span>\n                        <div class=\"slidecart-qty-wrapper\" >\n                          <button class=\"qty-button qty-minus-button js-minus-button\" data-minus data-qty-button data-key=\"${productKey}\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"10\" height=\"2\" viewBox=\"0 0 10 2\" fill=\"none\">\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M4.37112e-08 0.5C5.57818e-08 0.223858 0.223858 -1.20706e-08 0.5 0L9.5 4.76837e-07C9.77614 4.88908e-07 10 0.223858 10 0.5V1.5C10 1.77614 9.77614 2 9.5 2L0.5 2C0.223858 2 -1.20706e-08 1.77614 0 1.5L4.37112e-08 0.5Z\" fill=\"#0C3D37\"/>\n</svg></button>\n                          <input class=\"cart-qty-input js-cart-qty-input\" type=\"number\" pattern=\"[0-9]*\" data-input-key=\"${productKey}\" value=\"${productQuantity}\"/>\n                          <button class=\"qty-button qty-plus-button js-plus-button\" data-plus data-qty-button data-key=\"${productKey}\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"10\" height=\"10\" viewBox=\"0 0 10 10\" fill=\"none\">\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M4.5 10C4.22386 10 4 9.77614 4 9.5V0.5C4 0.223858 4.22386 0 4.5 0H5.5C5.77614 0 6 0.223858 6 0.5V9.5C6 9.77614 5.77614 10 5.5 10H4.5Z\" fill=\"#0C3D37\"/>\n<path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M4.37112e-08 4.5C5.57818e-08 4.22386 0.223858 4 0.5 4L9.5 4C9.77614 4 10 4.22386 10 4.5V5.5C10 5.77614 9.77614 6 9.5 6L0.5 6C0.223858 6 -1.20706e-08 5.77614 0 5.5L4.37112e-08 4.5Z\" fill=\"#0C3D37\"/>\n</svg></button>\n                        </div>\n                      </div>\n                    </div>\n                    \n                  </div>\n                  </div>\n                   ${concatSubscribeDropdown}\n                  <button class=\"cart-item-payment-options__button ${toggleButtonClass}\"\n                            key=\"${productKey}\" \n                            qty=\"${productQuantity}\" \n                            plan_id=\"${sellingPlanId}\"\n                            product_id=\"${productId}\" \n                            data-cart-toggle-subscribe \n                    >\n                      Subscribe & <span>save ${percentOff}</span> now and on future orders\n                    </button>\n                </div>`;\n                        } else {\n                            concatProductInfo = `\n                <div  class=\"slidecart-item-wrapper\" \n                      data-slidecart-item=\"${productId}\" \n                      data-line=\"${Number(index + 1)}\" \n                      data-bundle-child-keys=\"${bundleChildKeys}\" \n                      data-bundle-child-quantities=\"${bundleChildQuantities}\" \n                      data-bundle-id=\"${productBundleID}\" \n                      data-bundle-parent-key=\"${bundleParentKey}\" \n                >\n                  <div class=\"slidecart-item-image-wrapper\">${productImage}</div>\n                  <div class=\"slidecart-item-details-wrapper\">\n                    <div class=\"slidecart-item-details-top\">\n                      <div class=\"slidecart-item-description-wrapper\">\n                        <span class=\"removeItem\" data-remove-key=\"${productKey}\">Remove</span>\n                        <a class=\"slidecart-item-title\" href=\"${productUrl}\">${foodTypeEl} - ${productTitle}</a>\n                        ${bundleItemList}\n                        ${packSizeEl}\n                      </div>\n                      <div class=\"slidecart-item-qty-wrapper\">\n                        <div class=\"slidecart-qty-wrapper\" >\n                          <button class=\"qty-button qty-minus-button js-minus-button\" data-minus data-qty-button data-key=\"${productKey}\">-</button>\n                          <input class=\"cart-qty-input js-cart-qty-input\" type=\"number\" pattern=\"[0-9]*\" data-input-key=\"${productKey}\" value=\"${productQuantity}\"/>\n                          <button class=\"qty-button qty-plus-button js-plus-button\" data-plus data-qty-button data-key=\"${productKey}\">+</button>\n                        </div>\n                        <span class=\"slidecart-item-price\">${productComparisonPrice}${productPrice}</span>\n                      </div>\n                    </div>\n                  </div>\n                  ${concatSubscribeDropdown}\n                  <button class=\"cart-item-payment-options__button ${toggleButtonClass}\"\n                          key=\"${productKey}\" \n                          qty=\"${productQuantity}\" \n                          plan_id=\"${sellingPlanId}\"\n                          product_id=\"${productId}\" \n                          data-cart-toggle-subscribe \n                  >\n                    Subscribe and save ${percentOff}\n                  </button>\n                </div>`;\n                        }\n\n                        $(`[slidecart-product-wrapper]`).html($(`[slidecart-product-wrapper]`).html() + concatProductInfo);\n                        if (toggleButtonClass == 'hidden') {\n                            $('.slidecart-wrapper').removeClass('slidecart--show-cart-sub-upsell');\n                        }\n                    }\n                }\n                if (isBundleChild) return;\n                renderItem();\n            });\n            bindSlideCartUIActions();\n        })\n        .catch(function () {\n            // APACart has already raised cart:error, which the toast renders.\n            // Swallow here so a failed read cannot reject into an unhandled\n            // rejection, and so renderUpsells() below still runs.\n        })\n        .then(function () {\n            renderUpsells();\n        });\n}\n\nfunction renderUpsells() {\n    $.ajax({\n        type: 'GET',\n        url: '/cart/?view=upselljson',\n        dataType: 'html',\n        success: function (data) {\n            $(`[slidecart-upsell-wrapper]`).empty();\n            $(`[slidecart-upsell-wrapper]`).html(data);\n            setTimeout(renderUpsellSlider(), 50);\n        }\n    });\n}\n\nfunction renderUpsellSlider() {\n    $('[slidecart-upsell-wrapper].slick-initialized').slick('unslick');\n    if ($('[slidecart-upsell-wrapper] .slidecart-upsell').length > 1) {\n        $('[slidecart-upsell-wrapper]').slick({\n            infinite: true,\n            slidesToShow: 1,\n            slidesToScroll: 1,\n            mobileFirst: true,\n            variableWidth: true,\n            arrows: true,\n            // adaptiveHeight: true,\n            prevArrow:'<button type=\"button\" class=\"slick-prev slick-arrow\" aria-label=\"Previous slide\"><svg class=\"icon icon-prev icon--full-color\" viewBox=\"0 0 21 21\"><path fill=\"#fff\" d=\"M15.3,20.7c-0.3,0-0.5-0.1-0.7-0.3l-9.9-9.9l9.9-9.9c0.4-0.4,1-0.4,1.4,0s0.4,1,0,1.4l-8.5,8.5L16,19 c0.4,0.4,0.4,1,0,1.4C15.8,20.6,15.6,20.7,15.3,20.7z\"></path></svg></button>',\n            nextArrow:'<button type=\"button\" class=\"slick-next slick-arrow\" aria-label=\"Next slide\"><svg class=\"icon icon-next icon--full-color\" viewBox=\"0 0 21 21\"><path fill=\"#fff\" d=\"M5.7,0.3c0.3,0,0.5,0.1,0.7,0.3l9.9,9.9l-9.9,9.9c-0.4,0.4-1,0.4-1.4,0s-0.4-1,0-1.4l8.5-8.5L5,2 C4.6,1.6,4.6,1,5,0.6C5.2,0.4,5.4,0.3,5.7,0.3z\"></path></svg></button>',\n            dots: false\n        })\n    }\n    setProductListHeight();\n    $('window').resize(function(){\n        setProductListHeight();\n    })\n}\n\nfunction renderSlider(index) {\n    // Flickity.setJQuery($);\n    // jQueryBridget('flickity', Flickity, $);\n    // destroySlider();\n    // var $nav = $(`[buy-box-index=${index}] .bb-testimonials`).flickity({\n    //   asNavFor: '.bb-gallery-slider',\n    //   draggable: false,\n    //   percentPosition: false,\n    //   groupCells: \"100%\",\n    //   pageDots: false\n    // });\n    // var $carousel = $(`[buy-box-index=${index}] .bb-gallery-slider`).flickity({\n    //   pageDots: false,\n    //   contain: true,\n    //   wrapAround: false,\n    //   prevNextButtons: false\n    // });\n    // $(`[testimonial-wrapper]`).on('click', function () {\n    //   var index = $(this).attr('data-btn-index');\n    //   $carousel.flickity('select', index);\n    // });\n    // $carousel.flickity('resize');\n}\n\nfunction rebuildCurrentSlider() {\n    // var index = $(`[bb-gallery-slider].flickity-enabled`).attr('data-index');\n    // destroySlider();\n    // setTimeout(renderSlider(index), 50);\n}\n\nfunction destroySlider() {\n    // Flickity.setJQuery($);\n    // jQueryBridget('flickity', Flickity, $);\n    // var navSlider = $(`[bb-testimonials].flickity-enabled`);\n    // var currSlider = $(`[bb-gallery-slider].flickity-enabled`);\n    // currSlider.flickity('destroy');\n    // navSlider.flickity('destroy');\n}\n\n$(window).resize(function () {\n    rebuildCurrentSlider();\n});\n\n// Auto-open if redirected from cart page\nif (window.location.href.indexOf('?cart-opened') > -1) {\n    slideCartOpen();\n}\n\n// ========================================================================================\n// ========================================================================================\n// Buy Box\n// ========================================================================================\n// ========================================================================================\n\nfunction setUrlParameter(productId) {\n    window.history.pushState('', '', `?product=${productId}`);\n}\n\nfunction setActiveProduct() {\n    if ($(`body`).hasClass('template-index')) {\n        var urlParams = new URLSearchParams(window.location.search);\n        var urlId = urlParams.get('product');\n        if (urlId) {\n            var index = $(`[buy-box-wrapper][buy-box-product-id=${urlId}]`).attr('buy-box-index');\n            setUrlParameter(urlId);\n            $(`[buy-box-wrapper], [flavor-selector-item]`).removeClass('active');\n            $(`[buy-box-wrapper][buy-box-product-id=${urlId}], [flavor-selector-item][buy-box-flavor=${urlId}]`).addClass('active');\n            setTimeout(renderSlider(index), 100);\n        }\n        else {\n            $(`[buy-box-wrapper]`).removeClass('active');\n            $(`[buy-box-index=0]`).addClass('active');\n            var prId = $(`[buy-box-index=0]`).attr('buy-box-product-id');\n            setUrlParameter(prId);\n            setTimeout(renderSlider(0), 50);\n        }\n    }\n}\n\n$(`[flavor-selector-item]`).click(function () {\n    $(`[flavor-selector-item].active, [buy-box-wrapper]`).removeClass('active');\n    $(this).addClass('active');\n    var index = $(this).attr('data-index');\n    var productID = $(this).attr('buy-box-flavor');\n    $(`[buy-box-wrapper][buy-box-product-id=${productID}]`).addClass('active');\n    $(`div[buy-box-flavor=${productID}]`).addClass('active');\n    setUrlParameter(productID);\n    setTimeout(renderSlider(index), 50);\n});\n\n$(`[variant-selector-item]`).click(function () {\n    var id = $(this).attr('buy-box-variant');\n    var prId = $(this).attr('buy-box-var-product-id');\n    $(`div[buy-box-product-id=${prId}] [variant-selector-item].active`).removeClass('active');\n    $(`div[buy-box-product-id=${prId}] [variant-selector-price].active`).removeClass('active');\n    $(`div[buy-box-product-id=${prId}] [quantity-input-wrapper]`).removeClass('active');\n    $(`div[buy-box-product-id=${prId}] [variant-underbutton-text]`).removeClass('active');\n    $(`[quantity-input-wrapper][bb-qty-for-variant=${id}]`).addClass('active');\n    $(`[variant-selector-price][buy-box-variant=${id}]`).addClass('active');\n    $(`[variant-underbutton-text][data-variant-underbutton-id=${id}]`).addClass('active');\n    $(this).addClass('active');\n});\n\n$(`[product-quantity]`).click(function () {\n    var varID = $(this).attr('bb-variant-id');\n    var currentValue = parseInt($(`input#bb-qty-${varID}`).attr('value'));\n    var newValue;\n    var maxValue = parseInt($(`input#bb-qty-${varID}`).attr('max'));\n    if ($(this).hasClass('bb-product-quantity-minus')) {\n        if (currentValue > 0) {\n            newValue = currentValue - 1;\n        }\n        else {\n            newValue = currentValue;\n        }\n        $(`input#bb-qty-${varID}`).attr('value', newValue);\n    }\n    else if ($(this).hasClass('bb-product-quantity-plus')) {\n        if (currentValue < maxValue) {\n            newValue = currentValue + 1;\n        }\n        else if (currentValue >= maxValue) {\n            newValue = currentValue;\n        }\n        $(`input#bb-qty-${varID}`).attr('value', newValue);\n    }\n});\n\n$(document).on('click', '[data-add-to-cart]', (e) => {\n    original_selector = $(e.target);\n    document.body.classList.add('atc-cart');\n    // setTimeout(() => slideCartOpen(), 1000)\n});\n\n$(`button[add-to-cart-button]`).click(function (e) {\n    var productId = $(this).attr('add-to-cart-id');\n    var variantId = $(`[buy-box-product-id=${productId}] [variant-selector-item].active`).attr('buy-box-variant');\n    var quantity = $(`[buy-box-product-id=${productId}] [quantity-input-wrapper].active input`).attr('value');\n    var data = {\n        \"id\": variantId,\n        \"quantity\": quantity,\n    };\n    $.ajax({\n        type: 'POST',\n        url: '/cart/add.js',\n        data: data,\n        dataType: 'json',\n        success: function () {\n            original_selector = $(e.target);\n            slideCartOpen();\n        }\n    });\n});\n\n$(document).ready(() => {\n    // setActive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