PageSourceSearch

https://www.nudestix.com/cdn/shop/t/587/assets/cart.js?v=45882900379208307431778609809

js nudestix.com collected 2026-10-02 14:35:32 UTC 19,061 bytes, 1 lines download raw bytes

1class CartRemoveButton extends HTMLElement{constructor(){super(),this.addEventListener("click",e=>{e.preventDefault();return(this.closest("cart-items")||this.closest("cart-drawer-items")).updateQuantity(this.dataset.index,0),dataLayer.push({event:"remove_from_cart",ecommerce:{currency:"USD",value:this.getAttribute("data-price"),items:[{item_id:this.getAttribute("data-sku"),item_name:this.getAttribute("data-itemTitle").toLowerCase(),currency:"USD",discounted_price:this.getAttribute("data-discount")>0?"yes":"no",discount:this.getAttribute("data-discount"),item_brand:this.getAttribute("data-vendor").replace(" US",""),item_category:this.getAttribute("data-type"),item_variant:this.getAttribute("data-variantTitle"),price:this.getAttribute("data-price"),quantity:0}]}}),!1})}}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"),this.currentItemCount=Array.from(this.querySelectorAll('[name="updates[]"]')).reduce((e,t)=>e+parseInt(t.value),0),this.debouncedOnChange=debounce(e=>{this.onChange(e)},300);let e=document.querySelector("[data-free-sample-remove]");if(void 0!==e&&null!=e){var t=e.getAttribute("data-free-sample-remove");e.hasAttribute("data-drawer")?this.removeSampleProducts(t,"drawer"):this.removeSampleProducts(t,"cart")}this.enforceProtectedGiftQuantities(),this.addEventListener("change",this.debouncedOnChange.bind(this)),document.querySelectorAll(".free-sample-atc").forEach(e=>{e.addEventListener("click",t=>{e.hasAttribute("data-cart-page")?this.freeSampleATC(t,"cart"):this.freeSampleATC(t,"drawer")})}),document.querySelectorAll(".gift-wrap-product").forEach(e=>{e.addEventListener("change",t=>{e.hasAttribute("data-cart-page")?this.giftingATC(t,"cart"):this.giftingATC(t,"drawer")})}),this.loadCartCrossSells()}disableAllFreeSampleATC(){try{document.querySelectorAll(".free-sample-atc").forEach(e=>e.classList.add("disabled-element"))}catch(e){console.warn(e)}}reinitializeSwipers(){if("undefined"==typeof Swiper)return;const e={loop:!1,slidesPerView:"auto",spaceBetween:15,autoplayDisableOnInteraction:!0,pagination:!0,grabCursor:!0,allowTouchMove:!0,slideToClickedSlide:!0,navigation:{nextEl:".free-sample-slider-next",prevEl:".free-sample-slider-prev"}},t=document.querySelector(".free-cart");t&&new Swiper(t,{...e,breakpoints:{0:{allowTouchMove:!0,slideToClickedSlide:!0,slidesPerView:"auto"},500:{allowTouchMove:!0,slideToClickedSlide:!0,slidesPerView:2,spaceBetween:20},992:{slidesPerView:3,spaceBetween:24},1100:{slidesPerView:3,spaceBetween:24}}});const r=document.querySelector(".free-drawer");r&&new Swiper(r,{...e,breakpoints:{0:{allowTouchMove:!0,slideToClickedSlide:!0,slidesPerView:"auto"},576:{allowTouchMove:!0,slideToClickedSlide:!0,slidesPerView:3,spaceBetween:20},992:{slidesPerView:3,spaceBetween:24},1100:{slidesPerView:3,spaceBetween:24}}})}refreshCartSections(){const e=this.getSectionsToRender().filter(e=>e.section&&document.getElementById(e.id)),t=e.map(e=>e.section).join(",");return fetch(`/cart?sections=${t}`).then(e=>e.json()).then(t=>{e.forEach(e=>{const r=document.getElementById(e.id)?.querySelector(e.selector)||document.getElementById(e.id);r&&t[e.section]&&(r.innerHTML=this.getSectionInnerHTML(t[e.section],e.selector))}),window.loyaltylion&&window.loyaltylion.ui.refresh(),this.reinitializeSwipers(),this.bindEvent(),this.enforceProtectedGiftQuantities()})}onChange(e){e.target.classList.contains("quantity__input")&&this.updateQuantity(e.target.dataset.index,e.target.value,document.activeElement.getAttribute("name"))}bindEvent(){document.querySelectorAll(".free-sample-atc").forEach(e=>{e.addEventListener("click",t=>{e.hasAttribute("data-cart-page")&&this.freeSampleATC(t,"cart")})}),document.querySelectorAll(".gift-wrap-product").forEach(e=>{e.addEventListener("change",t=>{e.hasAttribute("data-cart-page")?this.giftingATC(t,"cart"):this.giftingATC(t,"drawer")})}),this.loadCartCrossSells()}getSectionsToRender(){return[{id:"main-cart-items",section:document.getElementById("main-cart-items").dataset.id,selector:".cart-parent"},{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(e,t,r){this.enableLoading(e);var i=this;const a=JSON.stringify({line:e,quantity:t,sections:this.getSectionsToRender().map(e=>e.section),sections_url:window.location.pathname});
1fetch(`${routes.cart_change_url}`,{...fetchConfig(),body:a}).then(e=>e.text()).then(t=>{const a=JSON.parse(t);a.items.forEach(function(t,i){var a=i+1,n="Nudeskin"==t.product_type?"Nudeskin":"Nudestix";a==parseInt(e)&&("plus"==r?dataLayer.push({event:"add_to_cart_v2",ecommerce:{currency:"USD",value:t.price/100,items:[{item_id:t.sku,item_name:t.title.toLowerCase(),currency:"USD",discounted_price:t.total_discount>0?"yes":"no",discount:t.total_discount,item_brand:n,item_category:t.product_type,item_variant:t.variant_title,price:t.price/100,quantity:t.quantity}]}}):dataLayer.push({event:"remove_from_cart",ecommerce:{currency:"USD",value:t.price/100,items:[{item_id:t.sku,item_name:t.title.toLowerCase(),currency:"USD",discounted_price:t.total_discount>0?"yes":"no",discount:t.total_discount,item_brand:n,item_category:t.product_type,item_variant:t.variant_title,price:t.price/100,quantity:t.quantity}]}}))}),this.classList.toggle("is-empty",0===a.item_count);const n=document.querySelector("cart-drawer"),o=document.getElementById("main-cart-footer");o&&o.classList.toggle("is-empty",0===a.item_count),n&&n.classList.toggle("is-empty",0===a.item_count),this.getSectionsToRender().forEach(e=>{(document.getElementById(e.id).querySelector(e.selector)||document.getElementById(e.id)).innerHTML=this.getSectionInnerHTML(a.sections[e.section],e.selector);let t=(new DOMParser).parseFromString(a.sections[e.section],"text/html").querySelector("[data-free-sample-remove]");if(void 0!==t&&null!=t){var r=t.getAttribute("data-free-sample-remove");"CartDrawer"==e.id?this.removeSampleProducts(r,"drawer"):"main-cart-items"==e.id&&this.removeSampleProducts(r,"cart")}}),this.enforceProtectedGiftQuantities(),this.updateLiveRegions(e,a.item_count);const s=document.getElementById(`CartItem-${e}`)||document.getElementById(`CartDrawer-Item-${e}`);s&&s.querySelector(`[name="${r}"]`)?n?trapFocus(n,s.querySelector(`[name="${r}"]`)):s.querySelector(`[name="${r}"]`).focus():0===a.item_count&&n?trapFocus(n.querySelector(".drawer__inner-empty"),n.querySelector("a")):document.querySelector(".cart-item")&&n&&trapFocus(n,document.querySelector(".cart-item__name")),this.disableLoading(),window.loyaltylion&&window.loyaltylion.ui.refresh();var c=document.querySelector(".free-cart");if(void 0!==c&&null!=c)new Swiper(c,{loop:!1,slidesPerView:"auto",spaceBetween:15,autoplayDisableOnInteraction:!0,pagination:!0,grabCursor:!0,allowTouchMove:!0,slideToClickedSlide:!0,navigation:{nextEl:".free-sample-slider-next",prevEl:".free-sample-slider-prev"},breakpoints:{0:{allowTouchMove:!0,slideToClickedSlide:!0,slidesPerView:"auto"},500:{allowTouchMove:!0,slideToClickedSlide:!0,slidesPerView:2,spaceBetween:20},992:{slidesPerView:3,spaceBetween:24},1100:{slidesPerView:3,spaceBetween:24}}});var d=document.querySelector(".free-drawer");if(void 0!==d&&null!=d)new Swiper(d,{loop:!1,slidesPerView:"auto",spaceBetween:15,autoplayDisableOnInteraction:!0,pagination:!0,grabCursor:!0,allowTouchMove:!0,slideToClickedSlide:!0,navigation:{nextEl:".free-sample-slider-next",prevEl:".free-sample-slider-prev"},breakpoints:{0:{allowTouchMove:!0,slideToClickedSlide:!0,slidesPerView:"auto"},576:{allowTouchMove:!0,slideToClickedSlide:!0,slidesPerView:3,spaceBetween:20},992:{slidesPerView:3,spaceBetween:24},1100:{slidesPerView:3,spaceBetween:24}}});var l=document.querySelector("[data-swipe-ele]");void 0!==l&&null!=l&&(l.hasAttribute("data-cart-page")?setTimeout(function(){i.swapProduct(l,"cart")},400):setTimeout(function(){i.swapProduct(l,"drawer")},400));var u=document.querySelector("[data-swipe-ele-rev]");void 0!==u&&null!=u&&(u.hasAttribute("data-cart-page")?setTimeout(function(){i.swapProduct(u,"cart")},400):setTimeout(function(){i.swapProduct(u,"drawer")},400)),this.bindEvent(),setTimeout(function(){"function"==typeof window.addKlarnaToMiniCart&&addKlarnaToMiniCart((a.total_price/100/4).toFixed(2)),"function"==typeof window.addKlarna&&addKlarna((a.total_price/100/4).toFixed(2))},1e3)}).catch(e=>{console.log("file: cart.js:403 | CartItems | .then | error:",e),this.querySelectorAll(".loading-overlay").forEach(e
1=>e.classList.add("hidden")),this.disableLoading()})}freeSampleATC(e,t){e.preventDefault(),this.disableAllFreeSampleATC();const r=e.target.getAttribute("data-var");e.target.querySelector(".loading-overlay__spinner")?.classList.remove("hidden"),fetch("/cart/add.js",{body:JSON.stringify({id:Number(r),quantity:1}),credentials:"same-origin",headers:{"Content-Type":"application/json","X-Requested-With":"xmlhttprequest"},method:"POST"}).then(()=>this.refreshCartSections()).catch(()=>{this.querySelectorAll(".loading-overlay").forEach(e=>e.classList.add("hidden"))})}giftingATC(e,t){e.preventDefault();const r=e.target.getAttribute("data-var-id");fetch("/cart/add.js",{body:JSON.stringify({id:Number(r),quantity:1,properties:{product_type:"giftwrapproduct"}}),credentials:"same-origin",headers:{"Content-Type":"application/json","X-Requested-With":"xmlhttprequest"},method:"POST"}).then(()=>this.refreshCartSections()).catch(()=>{this.querySelectorAll(".loading-overlay").forEach(e=>e.classList.add("hidden"))})}swapProduct(e,t){const r=e.getAttribute("data-gift-id"),i=e.getAttribute("data-free-gift-id"),a={"Content-Type":"application/json","X-Requested-With":"xmlhttprequest"};fetch("/cart/change.js",{body:JSON.stringify({id:r,quantity:0}),credentials:"same-origin",headers:a,method:"POST"}).then(()=>fetch("/cart/add.js",{body:JSON.stringify({id:Number(i),quantity:1,properties:{product_type:"giftwrapproduct"}}),credentials:"same-origin",headers:a,method:"POST"})).then(()=>this.refreshCartSections()).catch(e=>{this.querySelectorAll(".loading-overlay").forEach(e=>e.classList.add("hidden")),console.error("swapProduct error:",e)})}removeSampleProducts(e,t){const r={};e.split(",").forEach(e=>{r[e]=0}),fetch("/cart/update.json",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({updates:r})}).then(e=>e.json()).then(e=>{const t=document.getElementById("main-cart-items");return t&&0===e.item_count&&t.classList.add("is-empty"),this.refreshCartSections()}).catch(()=>{})}enforceProtectedGiftQuantities(){const e={};return document.querySelectorAll("[data-protected-gwp-quantity]").forEach(t=>{const r=t.getAttribute("data-protected-gwp-key");r&&(e[r]=1)}),Object.keys(e).length?fetch("/cart/update.json",{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({updates:e})}).then(e=>e.json()).then(()=>this.refreshCartSections()).catch(()=>{}):Promise.resolve()}loadCartCrossSells(){document.querySelectorAll("[data-cart-cross-sell]").forEach(e=>{const t=e.getAttribute("data-product-id"),r=e.querySelector("[data-cart-cross-sell-items]");if(!t||!r||e.dataset.loadedFor===t)return;e.dataset.loadedFor=t;const i=e.getAttribute("data-limit")||"4",a=new Set((e.getAttribute("data-cart-product-ids")||"").split(",").map(e=>e.trim()).filter(Boolean));this.fetchCartRecommendations(t,i,"complementary").then(e=>e.length?e:this.fetchCartRecommendations(t,i,"related")).then(t=>{const n=t.filter(e=>this.isCartRecommendationProductAllowed(e,a)).slice(0,Number(i));n.length?(r.innerHTML=n.map(e=>this.renderCartRecommendation(e)).join(""),this.bindCartRecommendationButtons(r),this.hydrateCartRecommendationDescriptions(r)):e.hidden=!0}).catch(()=>{e.hidden=!0})})}fetchCartRecommendations(e,t,r){const i=window.Shopify?.routes?.root||"/",a=new URLSearchParams({product_id:e,limit:t,intent:r}),n=`${e}:${t}:${r}`;if(window.cartRecommendationCache=window.cartRecommendationCache||new Map,window.cartRecommendationCache.has(n))return window.cartRecommendationCache.get(n);const o=fetch(`${i}recommendations/products.json?${a.toString()}`).then(e=>e.ok?e.json():{products:[]}).then(e=>e.products||[]).catch(e=>{throw window.cartRecommendationCache.delete(n),e});return window.cartRecommendationCache.set(n,o),o}isCartRecommendationProductAllowed(e,t){const r=(Array.isArray(e.tags)?e.tags:String(e.tags||"").split(",")).map(e=>e.trim().toLowerCase());return e&&!t.has(String(e.id))&&"gwp-nudescreen-blush-tint-spf-30"!==e.handle&&!r.includes("free-gwp")&&!r.includes("free-deluxe-gwp")&&!r.includes("cart-sample")&&!r.includes("compostable")}renderCartRecommendation(e){const t=(e.variants||[]).find(e=>e.available)||(e.variants||[])[0],r=this.getCartRecommendationImage(e),i=Number(e.price||t?.price||0),a=Boolean(t?.id&&!1!==t?.available),n=this.getCartRecommendationDescription(e);return`\n      <div\n        class="add-bundle-cart-item cart-cross-sell__item"\n        data-cart-cross-sell-product\n        data-product-url="${this.escapeCartRecommendationAttribute(e.url||`/products/${e.handle}`)}"\n      >\n        <div class="card d-flex flex-row">\n          <a class="card-img" href="${e.url||`/products/${e.handle}`}">\n            ${r?`<img src="${r}" class="img-fluid" alt="${this.escapeCartRecommendationText(e.title)}">`:""}\n          </a>\n          <div class="app-bundle-content">\n            <a class="add-bundle-title" href="${e.url||`/products/${e.handle}`}">\n              ${this.escapeCartRecommendationText(e.title)}\n            </a>\n            ${n?`<p class="cart-cross-sell__description" data-cart-cross-sell-description>${this.escapeCartRecommendationText(n)}</p>`:'<p class="cart-cross-sell__description" data-cart-cross-sell-description hidden></p>'}\n          </div>\n          <div class="app-bundle-price-btn">\n            <p class="app-bundle-price">${this.formatCartRecommendationMoney(i)}</p>\n            <button\n              type="button"\n              class="btn btn-skin cart-cross-sell-atc${a?"":" bt
1n-skin-soldout disabled-element"}"\n              data-var="${t?.id||""}"\n              ${a?"":"disabled"}\n            >\n              ${a?"add":"Soldout"}\n              <div class="loading-overlay__spinner hidden">\n                <svg aria-hidden="true" focusable="false" role="presentation" class="spinner" viewBox="0 0 66 66" xmlns="http://www.w3.org/2000/svg">\n                  <circle class="path" fill="none" stroke-width="6" cx="33" cy="33" r="30"></circle>\n                </svg>\n              </div>\n            </button>\n          </div>\n        </div>\n      </div>\n    `}getCartRecommendationDescription(e){const t=e.description||e.body||e.body_html||"";if(!t)return"";const r=t.replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim();return r.length>95?`${r.slice(0,92).trim()}...`:r}hydrateCartRecommendationDescriptions(e){e.querySelectorAll("[data-cart-cross-sell-product]").forEach(e=>{const t=e.getAttribute("data-product-url"),r=e.querySelector("[data-cart-cross-sell-description]");t&&r&&(r.textContent.trim()?r.hidden=!1:this.fetchCartRecommendationProductCardDescription(t).then(e=>{e?(r.textContent=e,r.hidden=!1):r.textContent.trim()&&(r.hidden=!1)}).catch(()=>{r.textContent.trim()&&(r.hidden=!1)}))})}fetchCartRecommendationProductCardDescription(e){if(window.cartRecommendationDescriptionCache=window.cartRecommendationDescriptionCache||new Map,window.cartRecommendationDescriptionCache.has(e))return window.cartRecommendationDescriptionCache.get(e);const t=fetch(e,{credentials:"same-origin"}).then(e=>e.ok?e.text():"").then(e=>{if(!e)return"";const t=(new DOMParser).parseFromString(e,"text/html"),r=t.querySelector("[varDesc]"),i=r?.getAttribute("varDesc")?.trim();if(i)return i;const a=t.querySelector("[data-meta-description]")?.getAttribute("data-meta-description")?.trim();return a||""}).catch(t=>{throw window.cartRecommendationDescriptionCache.delete(e),t});return window.cartRecommendationDescriptionCache.set(e,t),t}getCartRecommendationImage(e){if("string"==typeof e.featured_image)return e.featured_image;if(e.featured_image?.url)return e.featured_image.url;if(e.featured_image?.src)return e.featured_image.src;const t=(e.images||[])[0];return"string"==typeof t?t:t?.url||t?.src||""}bindCartRecommendationButtons(e){e.querySelectorAll(".cart-cross-sell-atc").forEach(e=>{"true"!==e.dataset.bound&&(e.dataset.bound="true",e.addEventListener("click",e=>this.cartRecommendationATC(e)))})}cartRecommendationATC(e){e.preventDefault();const t=e.currentTarget,r=t.getAttribute("data-var");r&&(t.classList.add("disabled-element"),t.querySelector(".loading-overlay__spinner")?.classList.remove("hidden"),fetch("/cart/add.js",{body:JSON.stringify({id:Number(r),quantity:1}),credentials:"same-origin",headers:{"Content-Type":"application/json","X-Requested-With":"xmlhttprequest"},method:"POST"}).then(()=>this.refreshCartSections()).catch(()=>{t.classList.remove("disabled-element"),t.querySelector(".loading-overlay__spinner")?.classList.add("hidden")}))}formatCartRecommendationMoney(e){return window.Shopify?.formatMoney?window.Shopify.formatMoney(e):`$${(e/100).toFixed(2)}`}escapeCartRecommendationText(e){const t=document.createElement("div");return t.textContent=e||"",t.innerHTML}escapeCartRecommendationAttribute(e){return this.escapeCartRecommendationText(e).replace(/"/g,"&quot;")}updateLiveRegions(e,t){if(this.currentItemCount===t){document.getElementById(`Line-item-error-${e}`)||document.getElementById(`CartDrawer-LineItemError-${e}`),document.getElementById(`Quantity-${e}`)||document.getElementById(`Drawer-quantity-${e}`)}this.currentItemCount=t,this.lineItemStatusElement.setAttribute("aria-hidden",!0);const r=document.getElementById("cart-live-region-text")||document.getElementById("CartDrawer-LiveRegionText");r.setAttribute("aria-hidden",!1),setTimeout(()=>{r.setAttribute("aria-hidden",!0)},1e3)}getSectionInnerHTML(e,t){return(new DOMParser).parseFromString(e,"text/html").querySelector(t).innerHTML}enableLoading(e){(document.getElementById("main-cart-items")||document.getElementById("CartDrawer-CartItems")).classList.add("cart__items--disabled");[...this.querySelectorAll(`#CartItem-${e} .loading-overlay`),...this.querySelectorAll(`#CartDrawer-Item-${e}
1 .loading-overlay`)].forEach(e=>e.classList.remove("hidden")),document.activeElement.blur(),this.lineItemStatusElement.setAttribute("aria-hidden",!1)}disableLoading(){(document.getElementById("main-cart-items")||document.getElementById("CartDrawer-CartItems")).classList.remove("cart__items--disabled")}}customElements.define("cart-items",CartItems),customElements.get("cart-note")||customElements.define("cart-note",class extends HTMLElement{constructor(){super(),this.addEventListener("change",debounce(e=>{const t=JSON.stringify({note:e.target.value});fetch(`${routes.cart_update_url}`,{...fetchConfig(),body:t})},300))}});

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.