PageSourceSearch

https://www.manucurist.com/cdn/shop/t/72/assets/gift-wrapping-product.js?v=142415240094932194791763650429

js manucurist.com collected 2026-09-24 18:53:55 UTC 3,872 bytes, 2 lines download raw bytes

1class ProductGiftWrapping extends HTMLElement{constructor(){super(),this.miniCart=document.querySelector("mini-cart"),this.productKey=this.dataset.productKey,this.productQuantity=parseInt(this.dataset.productQuantity),this.giftWrapId=parseInt(this.dataset.giftWrapId),this.giftWrapsInCart=parseInt(this.dataset.giftWrapsInCart),this.loadingOverlay=this.querySelector(".loading-overlay"),this.sections=this.getSectionsToRender().map(section=>section.section),this.giftWrapCheckbox=this.querySelector('input[type="checkbox"]'),this.totalWrappedProductsInCart=0,this.totalWrappedProductsInCart+=document.querySelectorAll(`[data-gift-wrap-id="${this.giftWrapId}"][data-gift-wrapping="true"]`)?.length,this.addEventListeners(),this.getProductProperties(),!this.miniCart&&this.handleCartUpdate()}addEventListeners(){this.giftWrapCheckbox.addEventListener("change",this.handleGiftWrapChange.bind(this)),document.addEventListener("cart:updated",this.handleCartUpdate.bind(this)),document.addEventListener("cartdrawer:opened",this.handleCartUpdate.bind(this))}handleGiftWrapChange(event){event.target.checked?this.setProductGiftWrap():this.removeProductGiftWrap()}handleCartUpdate(){document.body.contains(this)&&(this.giftWrapsInCart=parseInt(this.dataset.giftWrapsInCart),this.giftWrapsInCart===0&&this.giftWrapCheckbox.checked?(this.giftWrapCheckbox.checked=!1,this.updateProductProperty(!1)):this.giftWrapsInCart>0&&this.giftWrapCheckbox.checked&&this.totalWrappedProductsInCart>this.giftWrapsInCart&&this.setProductGiftWrap())}setProductGiftWrap(){this.loadingOverlay.classList.remove("hidden");const body={updates:{[this.giftWrapId]:this.giftWrapsInCart+1},sections:this.sections,sections_url:window.location.pathname};this._fetchCart(window.routes.cart_update_url,body).then(()=>{this.updateProductProperty(!0)}).catch(e=>{console.error("Error setting gift wrap:",e)})}removeProductGiftWrap(){this.loadingOverlay.classList.remove("hidden");const body={updates:{[this.giftWrapId]:Math.max(0,this.giftWrapsInCart-1)},sections:this.sections,sections_url:window.location.pathname};this._fetchCart(window.routes.cart_update_url,body).then(()=>{this.updateProductProperty(!1)}).catch(e=>{console.error("Error removing gift wrap:",e)})}updateProductProperty(propertyValue){this.productProperties._has_gift_wrap=propertyValue;const formData={id:this.productKey,properties:this.productProperties,quantity:this.productQuantity,sections:this.sections,sections_url:window.location.pathname};this._fetchCart(window.routes.cart_change_url,formData).then(response=>{if(this.loadingOverlay.classList.add("hidden"),document.body.classList.contains("template-cart")){window.location.href=window.routes.cart_url;return}this.miniCart&&this.miniCart.renderContents(response)}).catch(e=>{console.error("Error updating product property:",e)})}getProductProperties(){return this.productProperties=this.productProperties||JSON.parse(this.querySelector('[type="application/json"]').textContent),delete this.productProperties._has_gift_wrap,this.productProperties}_fetchCart(url,data){return fetch(url,{...fetchConfig(),body:JSON.stringify(data)}).then(response=>response.ok?response.json():response.json().then(error=>{throw new Error(error.message||"Something went wrong with the cart API.")}))}getSectionsToRender(){const SHOPIFY_SECTION_SELECTOR=".shopify-section";return[{id:"mini-cart",section:"mini-cart",selector:SHOPIFY_SECTION_SELECTOR},{id:"cart-icon-bubble",section:"cart-icon-bubble",selector:SHOPIFY_SECTION_SELECTOR},{id:"mobile-cart-icon-bubble",section:"mobile-cart-icon-bubble",selector:SHOPIFY_SECTION_SELECTOR},{id:"cart-live-region-text",section:"cart-live-region-text",selector:SHOPIFY_SECTION_SELECTOR}]}}customElements.define("product-gift-wrapping",ProductGiftWrapping);
2//# sourceMappingURL=/cdn/shop/t/72/assets/gift-wrapping-product.js.map?v=142415240094932194791763650429

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.