PageSourceSearch

https://www.bananabeauty.de/cdn/shop/t/217/assets/cart.js?v=98466365810893924581764775589

js bananabeauty.de collected 2026-10-04 13:29:57 UTC 20,572 bytes, 2 lines download raw bytes

1class CartRemoveButton extends HTMLElement{constructor(){if(super(),document.querySelector(".product-recommandation-swiper")){const swiper=new Swiper(".product-recommandation-swiper",{slidesPerView:1.3,spaceBetween:12,navigation:{nextEl:".swiper-button-next",prevEl:".swiper-button-prev"},scrollbar:{el:".swiper-scrollbar"}});document.querySelectorAll(".product-recommandation .swiper-slide").forEach(rec_prod=>{const id=rec_prod.getAttribute("data-variant-id"),input=rec_prod.querySelector('.buttons-rt form input[name="id"]'),formButton=rec_prod.querySelector(".buttons-rt form button"),addToCartButton=rec_prod.querySelector(".product-recommandation-add-to-cart");input&&(input.value=id),addToCartButton.addEventListener("click",()=>{formButton&&(addToCartButton.classList.add("loading"),formButton.click(),setTimeout(()=>{addToCartButton.classList.remove("loading")},500))})})}this.addEventListener("click",event=>{event.preventDefault(),(this.closest("cart-items")||this.closest("cart-drawer-items")).updateQuantity(this.dataset.index,0)})}}customElements.define("cart-remove-button",CartRemoveButton);class CartItems extends HTMLElement{constructor(){super(),this.lineItemStatusElement=document.getElementById("shopping-cart-line-item-status")||document.getElementById("CartDrawer-LineItemStatus");const debouncedOnChange=debounce(event=>{this.onChange(event)},ON_CHANGE_DEBOUNCE_TIMER);this.addEventListener("change",debouncedOnChange.bind(this))}cartUpdateUnsubscriber=void 0;connectedCallback(){this.cartUpdateUnsubscriber=subscribe(PUB_SUB_EVENTS.cartUpdate,event=>{event.source!=="cart-items"&&this.onCartUpdate(event)})}disconnectedCallback(){this.cartUpdateUnsubscriber&&this.cartUpdateUnsubscriber()}onChange(event){this.updateQuantity(event.target.dataset.index,event.target.value,document.activeElement.getAttribute("name"),event.target.dataset.quantityVariantId)}onCartUpdateUpsell(tagName){tagName==="CART-DRAWER-ITEMS"?fetch(`${routes.cart_url}?section_id=cart-drawer`).then(response=>response.text()).then(responseText=>{const html=new DOMParser().parseFromString(responseText,"text/html"),selectors=["cart-drawer-items",".cart-drawer__footer"];for(const selector of selectors){const targetElement=document.querySelector(selector),sourceElement=html.querySelector(selector);targetElement&&sourceElement&&targetElement.replaceWith(sourceElement)}}).catch(e=>{console.error(e)}):fetch(`${routes.cart_url}?section_id=main-cart-items`).then(response=>response.text()).then(responseText=>{const sourceQty=new DOMParser().parseFromString(responseText,"text/html").querySelector("cart-items");document.querySelector("cart-items")&&(document.querySelector("cart-items").innerHTML=sourceQty.innerHTML)}).catch(e=>{console.error(e)})}removeUpsell(items,onCartUpdateUpsell,tagName){let formData={updates:{}};items.forEach(function(item){formData.updates[item.line]=item.quantity}),fetch("/cart/update.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(formData)}).then(response=>response.json()).then(response=>{if(response.status){console.log("Error");return}onCartUpdateUpsell(tagName)}).catch(error=>{console.log(error)})}addUpsell(cartVariants,onCartUpdateUpsell,tagName){fetch("/cart/add.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({items:cartVariants})}).then(()=>{onCartUpdateUpsell(tagName)}).catch(error=>{console.log(error)})}removeSetCreatorsIfEmpty(addUpsell,removeUpsell,tagName,onCartUpdateUpsell,items){var addUpsell=addUpsell,removeUpsell=removeUpsell,tagName=tagName,onCartUpdateUpsell=onCartUpdateUpsell;let variant_ids=[46552647893316,46886636421444,46886461440324,46958133477700,48471819092292,47097963479364];items.forEach(function(value,index){variant_ids.includes(value.variant_id)&&removeUpsell([{line:value.variant_id,quantity:0}],onCartUpdateUpsell,tagName)})}getCartFunctionality(addUpsell,removeUpsell,onCartUpdateUpsell,tagName,setProductID,giftVariantID,items,properties){var setAdded=!1,giftAdded=!1,otherGiftAdded=!1;items.forEach(function(value,index){value.product_id==setProductID&&(setAdded=!0),value.variant_id==giftVariantID&&value.properties&&value.properties&&value.properties[properties]&&(giftAdded=!0),setProductID==0xd9b1024817f&&value.variant_id==42867898450074&&(otherGiftAdded=!0),items.length==index+1&&(!giftAdded&&setAdded&&addUpsell([{id:giftVariantID,quantity:1,price:0,final_price:0,properties:{[properties]:"Bonus for cart value"}}],onCartUpdateUpsell,tagName),giftAdded&&!setAdded&&removeUpsell([{line:giftVariantID,quantity:0}],onCartUpdateUpsell,tagName),setAdded&&!otherGiftAdded&&setTimeout(function(){addUpsell([{id:42867898450074,quantity:1,price:0,final_price:0,properties:{[properties]:"Bonus for cart value"}}],onCartUpdateUpsell,tagName)},2e3))})}addExtraProductsInCart(addUpsell,removeUpsell,tagName,onCartUpdateUpsell,items,removeSetCreatorsIfEmpty,getCartFunctionality){removeSetCreatorsIfEmpty(addUpsell,removeUpsell,tagName,onCartUpdateUpsell,items);var addUpsell=addUpsell,removeUpsell=removeUpsell,tagName=tagName,onCartUpdateUpsell=onCartUpdateUpsell,giftVariantID=48237156958532;document.querySelector('.freegift-selector select[name="selectFreeGift"]')&&document.querySelector('.freegift-selector select[name="selectFreeGift"]').value&&(giftVariantID=document.querySelector('.freegift-selector select[name="selectFreeGift"]').value),setTimeout(function(){getCartFunctionality(addUpsell,removeUpsell,onCartUpdateUpsell,tagName,0xd9b1024817f,giftVariantID,items,"nude_set_p_1"),getCartFunctionality(addUpsell,removeUpsell,onCartUpdateUpsell,tagName,9418656317764,42867898450074,items,"gloss_gift_set")},1e3);var giftVariantID=48237156958532;document.querySelector('.freegift-selector select[name="selectFreeGift"]')&&document.querySelector('.freegift-selector select[name="selectFreeGift"]').value&&(giftVariantID=document.querySelector('.freegift-selector select[name="selectFreeGift"]').value),setTimeout(function(){getCartFunctionality(addUpsell,removeUpsell,onCartUpdateUpsell,tagName,9555510427972,giftVariantID,items,"go_lip_set_gift")},1e3)}upSellCart(){var addUpsell=this.addUpsell,removeUpsell=this.removeUpsell,tagName=this.tagName,onCartUpdateUpsell=this.onCartUpdateUpsell,addExtraProductsInCart=this.addExtraProductsInCart,getCartFunctionality=this.getCartFunctionality,removeSetCreatorsIfEmpty=this.removeSetCreatorsIfEmpty;fetch("/cart.js",{method:"GET",headers:{"Content-Type":"application/json"}}).then(response=>response.json()).then(response=>{addExtraProductsInCart(addUpsell,removeUpsell,tagName,onCartUpdateUpsell,response.items,removeSetCreatorsIfEmpty,getCartFunctionality);var addFreeGiftsOnCart=[],removeFreeGiftsOnCart=[],free_gifts_array_variant_ids=[],totalFreeGiftsOnCart=0,setAddedNudePlusOne=!1,giftAddedNudePlusOne=!1,totalAmountInCart=0,lipButterAddGift=!1,giftAddedLipButter=!1,kismassLipKitAddGift=!1,giftaddedkismassLipKit=!1;
1response.items.forEach(function(value,index){value.properties&&value.properties.upsellingbar_tag&&(free_gifts_array_variant_ids.push(value.variant_id),totalFreeGiftsOnCart+=value.final_price),value.properties&&value.properties.upsellingbar_tag&&(free_gifts_array_variant_ids.push(value.variant_id),totalFreeGiftsOnCart+=value.final_price),value.properties&&value.properties.EasterShoppingWeek&&(lipButterAddGift=!0),value.properties&&value.properties.EasterShoppingWeekGift&&(giftAddedLipButter=!0),totalAmountInCart+=value.final_price*value.quantity,value.product_id==8771032187204&&(setAddedNudePlusOne=!0),value.variant_id==42927021260954&&(giftAddedNudePlusOne=!0),value.product_id==0xdedc2b4017f&&(kismassLipKitAddGift=!0),value.variant_id==54869457207679&&(giftaddedkismassLipKit=!0),index+1==response.items.length&&(totalAmountInCart>=4900?(!giftaddedkismassLipKit&&kismassLipKitAddGift&&addFreeGiftsOnCart.push({id:54869457207679,quantity:1,price:0,final_price:0,properties:{kismass_lip_kit:"Gift for Kismass Lip Kit"}}),giftAddedLipButter&&!lipButterAddGift&&response.items.forEach(function(value2,index2){value2.properties&&value2.properties.EasterShoppingWeekGift&&value2.variant_id==54869457207679&&removeFreeGiftsOnCart.push({line:value2.key,quantity:0})}),!giftAddedLipButter&&lipButterAddGift&&addFreeGiftsOnCart.push({id:42831385165978,quantity:1,price:0,final_price:0,properties:{EasterShoppingWeekGift:"Bonus for Easter Shopping Week"}}),giftAddedLipButter&&!lipButterAddGift&&response.items.forEach(function(value2,index2){value2.properties&&value2.properties.EasterShoppingWeekGift&&value2.variant_id==42831385165978&&removeFreeGiftsOnCart.push({line:value2.key,quantity:0})})):response.items.forEach(function(value2,index2){value2.properties&&value2.properties.EasterShoppingWeekGift&&value2.variant_id==42831385165978&&removeFreeGiftsOnCart.push({line:value2.key,quantity:0})}),window.upsell&&window.upsell.length?(!giftAddedNudePlusOne&&setAddedNudePlusOne&&addFreeGiftsOnCart.push({id:42927021260954,quantity:1,price:0,final_price:0,properties:{nude_set:"Bonus for nude set"}}),giftAddedNudePlusOne&&!setAddedNudePlusOne&&response.items.forEach(function(value2,index2){value2.properties&&value2.properties.nude_set&&value2.variant_id==42927021260954&&removeFreeGiftsOnCart.push({line:value2.key,quantity:0})}),window.upsell.forEach(function(upSellvalue,upSellindex){upSellvalue.id&&!free_gifts_array_variant_ids.includes(upSellvalue.id)&&response.total_price-totalFreeGiftsOnCart>=upSellvalue.price&&addFreeGiftsOnCart.push({id:upSellvalue.id,quantity:1,price:0,final_price:0,properties:{upsellingbar_tag:"Bonus for cart value"}}),upSellvalue.id&&free_gifts_array_variant_ids.includes(upSellvalue.id)&&response.total_price-totalFreeGiftsOnCart<upSellvalue.price&&response.items.forEach(function(value2,index2){value2.properties&&value2.properties.upsellingbar_tag&&value2.variant_id==upSellvalue.id&&removeFreeGiftsOnCart.push({line:value2.key,quantity:0})}),upSellindex+1==window.upsell.length&&(removeFreeGiftsOnCart.length>0&&removeUpsell(removeFreeGiftsOnCart,onCartUpdateUpsell,tagName),addFreeGiftsOnCart.length>0&&addUpsell(addFreeGiftsOnCart,onCartUpdateUpsell,tagName))})):(!giftAddedNudePlusOne&&setAddedNudePlusOne&&addFreeGiftsOnCart.push({id:42927021260954,quantity:1,price:0,final_price:0,properties:{nude_set:"Bonus for nude set"}}),giftAddedNudePlusOne&&!setAddedNudePlusOne&&response.items.forEach(function(value2,index2){value2.properties&&value2.properties.nude_set&&value2.variant_id==42927021260954&&removeFreeGiftsOnCart.push({line:value2.key,quantity:0})}),setTimeout(()=>{removeFreeGiftsOnCart.length>0&&removeUpsell(removeFreeGiftsOnCart,onCartUpdateUpsell,tagName),addFreeGiftsOnCart.length>0&&addUpsell(addFreeGiftsOnCart,onCartUpdateUpsell,tagName)},300)))})})}onCartUpdate(event=!1){typeof window.productInCart=="function"&&window.productInCart(event),this.tagName==="CART-DRAWER-ITEMS"?fetch(`${routes.cart_url}?section_id=cart-drawer`).then(response=>response.text()).then(responseText=>{this.upSellCart();const html=new DOMParser().parseFromString(responseText,"text/html"),selectors=["cart-drawer-items",".cart-drawer__footer"];for(const selector of selectors){const targetElement=document.querySelector(selector),sourceElement=html.querySelector(selector);targetElement&&sourceElement&&targetElement.replaceWith(sourceElement)}}).catch(e=>{console.error(e)}):fetch(`${routes.cart_url}?section_id=main-cart-items`).then(response=>response.text()).then(responseText=>{this.upSellCart();const sourceQty=new DOMParser().parseFromString(responseText,"text/html").querySelector("cart-items");this.innerHTML=sourceQty.innerHTML}).catch(e=>{console.error(e)})}getSectionsToRender(){return[{id:"custom-cart-items",section:document.getElementById("custom-cart-items").dataset.id,selector:".main-cart-itemss"},{id:"cart-icon-bubble",section:"cart-icon-bubble",selector:".shopify-section"},{id:"cart-live-region-text",section:"cart-live-region-text",selector:".shopify-section"}]}updateQuantity(line,quantity,name,variantId){this.enableLoading(line);const body=JSON.stringify({line,quantity,sections:this.getSectionsToRender().map(section=>section.section),sections_url:window.location.pathname});
1if(fetch(`${routes.cart_change_url}`,{...fetchConfig(),body}).then(response=>response.text()).then(state=>{this.upSellCart();const parsedState=JSON.parse(state),quantityElement=document.getElementById(`Quantity-${line}`)||document.getElementById(`Drawer-quantity-${line}`),items=document.querySelectorAll(".cart-item");if(parsedState.errors){quantityElement.value=quantityElement.getAttribute("value"),this.updateLiveRegions(line,parsedState.errors);return}this.classList.toggle("is-empty",parsedState.item_count===0);const cartDrawerWrapper=document.querySelector("cart-drawer"),cartFooter=document.getElementById("main-cart-footer");cartFooter&&cartFooter.classList.toggle("is-empty",parsedState.item_count===0),cartDrawerWrapper&&cartDrawerWrapper.classList.toggle("is-empty",parsedState.item_count===0),this.getSectionsToRender().forEach(section=>{const elementToReplace=document.getElementById(section.id).querySelector(section.selector)||document.getElementById(section.id);elementToReplace.innerHTML=this.getSectionInnerHTML(parsedState.sections[section.section],section.selector)});const updatedValue=parsedState.items[line-1]?parsedState.items[line-1].quantity:void 0;let message="";items.length===parsedState.items.length&&updatedValue!==parseInt(quantityElement.value)&&(typeof updatedValue>"u"?message=window.cartStrings.error:message=window.cartStrings.quantityError.replace("[quantity]",updatedValue)),this.updateLiveRegions(line,message);const lineItem=document.getElementById(`CartItem-${line}`)||document.getElementById(`CartDrawer-Item-${line}`);lineItem&&lineItem.querySelector(`[name="${name}"]`)?cartDrawerWrapper?trapFocus(cartDrawerWrapper,lineItem.querySelector(`[name="${name}"]`)):lineItem.querySelector(`[name="${name}"]`).focus():parsedState.item_count===0&&cartDrawerWrapper?trapFocus(cartDrawerWrapper.querySelector(".drawer__inner-empty"),cartDrawerWrapper.querySelector("a")):document.querySelector(".cart-item")&&cartDrawerWrapper&&trapFocus(cartDrawerWrapper,document.querySelector(".cart-item__name")),publish(PUB_SUB_EVENTS.cartUpdate,{source:"cart-items",cartData:parsedState,variantId})}).catch(()=>{this.querySelectorAll(".loading-overlay").forEach(overlay=>overlay.classList.add("hidden"));const errors=document.getElementById("cart-errors")||document.getElementById("CartDrawer-CartErrors");errors.textContent=window.cartStrings.error}).finally(()=>{this.disableLoading(line)}),document.querySelector(".product-recommandation-swiper")){const swiper=new Swiper(".product-recommandation-swiper",{slidesPerView:1.3,spaceBetween:12,navigation:{nextEl:".swiper-button-next",prevEl:".swiper-button-prev"},scrollbar:{el:".swiper-scrollbar"}});document.querySelectorAll(".product-recommandation .swiper-slide").forEach(rec_prod=>{const id=rec_prod.getAttribute("data-variant-id"),input=rec_prod.querySelector('.buttons-rt form input[name="id"]'),formButton=rec_prod.querySelector(".buttons-rt form button"),addToCartButton=rec_prod.querySelector(".product-recommandation-add-to-cart");input&&(input.value=id),addToCartButton.addEventListener("click",()=>{formButton&&(addToCartButton.classList.add("loading"),formButton.click(),setTimeout(()=>{addToCartButton.classList.remove("loading")},500))})})}}updateLiveRegions(line,message){const lineItemError=document.getElementById(`Line-item-error-${line}`)||document.getElementById(`CartDrawer-LineItemError-${line}`);lineItemError&&(lineItemError.querySelector(".cart-item__error-text").innerHTML=message),this.lineItemStatusElement.setAttribute("aria-hidden",!0);const cartStatus=document.getElementById("cart-live-region-text")||document.getElementById("CartDrawer-LiveRegionText");cartStatus.setAttribute("aria-hidden",!1),setTimeout(()=>{cartStatus.setAttribute("aria-hidden",!0)},1e3)}getSectionInnerHTML(html,selector){return new DOMParser().parseFromString(html,"text/html").querySelector(selector).innerHTML}enableLoading(line){(document.getElementById("main-cart-items")||document.getElementById("CartDrawer-CartItems")).classList.add("cart__items--disabled");const cartItemElements=this.querySelectorAll(`#CartItem-${line} .loading-overlay`),cartDrawerItemElements=this.querySelectorAll(`#CartDrawer-Item-${line} .loading-overlay`);
1[...cartItemElements,...cartDrawerItemElements].forEach(overlay=>overlay.classList.remove("hidden")),document.activeElement.blur(),this.lineItemStatusElement.setAttribute("aria-hidden",!1)}disableLoading(line){(document.getElementById("main-cart-items")||document.getElementById("CartDrawer-CartItems")).classList.remove("cart__items--disabled");const cartItemElements=this.querySelectorAll(`#CartItem-${line} .loading-overlay`),cartDrawerItemElements=this.querySelectorAll(`#CartDrawer-Item-${line} .loading-overlay`);cartItemElements.forEach(overlay=>overlay.classList.add("hidden")),cartDrawerItemElements.forEach(overlay=>overlay.classList.add("hidden"))}}customElements.define("cart-items",CartItems),customElements.get("cart-note")||customElements.define("cart-note",class extends HTMLElement{constructor(){super(),this.addEventListener("change",debounce(event=>{const body=JSON.stringify({note:event.target.value});fetch(`${routes.cart_update_url}`,{...fetchConfig(),body})},ON_CHANGE_DEBOUNCE_TIMER))}});function updateCartDrawer(open,upsell){(document.querySelector("cart-items")||document.querySelector("cart-drawer-items")).upSellCart(),$("cart-drawer").addClass("active"),$("cart-drawer").removeClass("is-empty"),fetch("/cart?section_id=cart-drawer").then(function(response){return response.text()}).then(function(html){var parser=new DOMParser,doc=parser.parseFromString(html,"text/html");const cart=$(doc).find("cart-drawer")[0].innerHTML;$(document).find("cart-drawer")[0].innerHTML=cart,Update_cart_count()}).catch(function(err){console.error("Something went wrong.",err)})}class CartSetRemove extends HTMLElement{constructor(){super(),this.addEventListener("click",event=>{event.preventDefault();const index=this.closest("cart-set-item").getAttribute("data-item-index");this.updateSetProduct(index,0)})}updateSetProduct(line,quantity){$("#custom-cart-drawer").addClass("loading");let line_array=line.split("|"),formData={updates:{}};line_array.forEach(function(item){item!=""&&(formData.updates[item]=quantity)}),fetch("/cart/update.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(formData)}).then(response=>response.json()).then(response=>{if(response.status){console.log("Error");return}(document.querySelector("cart-items")||document.querySelector("cart-drawer-items")).upSellCart(),console.log("Success"),updateCartDrawer(!1,!1)}).catch(error=>{console.log(error)})}errorMessage(resp){console.log(resp.description)}}customElements.define("remove-set-item",CartSetRemove);function updateCartPage(upsell){$("#custom-cart-items").addClass("loading"),fetch(`${routes.cart_url}`).then(function(response){return response.text()}).then(function(html){var parser=new DOMParser,doc=parser.parseFromString(html,"text/html");console.log($(doc).find("#custom-cart-items")[0].innerHTML);const cart=$(doc).find("#custom-cart-items")[0].innerHTML;$(document).find("#custom-cart-items")[0].innerHTML=cart,Update_cart_count(),upsell!=!0&&upsellProducts(),(document.querySelector("cart-items")||document.querySelector("cart-drawer-items")).upSellCart(),initCartSwatch(),$("#custom-cart-items").removeClass("loading")}).catch(function(err){console.error("Something went wrong.",err)})}class CartPageSetRemove extends HTMLElement{constructor(){super(),this.addEventListener("click",event=>{event.preventDefault();const index=this.closest("cart-page-set-item").getAttribute("data-item-index");this.updateSetProduct(index,0)})}updateSetProduct(line,quantity){$("#main-cart-itemss").find(".custom-cart-content").addClass("loading");let line_array=line.split("|"),formData={updates:{}};line_array.forEach(function(item){item!=""&&(formData.updates[item]=quantity)}),fetch("/cart/update.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(formData)}).then(response=>response.json()).then(response=>{if(response.status){console.log("Error");return}console.log("Success"),updateCartPage(!1)}).catch(error=>{console.log(error)})}errorMessage(resp){console.log(resp.description)}}customElements.define("remove-cart-set-item",CartPageSetRemove);
2//# sourceMappingURL=/cdn/shop/t/217/assets/cart.js.map?v=98466365810893924581764775589

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.