PageSourceSearch

https://www.grenier-alpin.com/cdn/shop/t/25/assets/mm-wishlist.js?v=14742674002508984841790682197

js grenier-alpin.com collected 2026-10-08 01:16:26 UTC 2,585 bytes, 2 lines download raw bytes

1class WishlistManager{constructor(){this.boundHandleClick=this.handleButtonClick.bind(this),this.wishlistContainer=document.querySelector("[data-wishlist-button-header]"),this.countBubble=this.wishlistContainer?.querySelector(".mm-wishlist-count-bubble"),this.initializeWishlist(),this.setupEventListeners()}setupEventListeners(){document.addEventListener("ooo-wishlist:product-added",event=>{const count=event.detail.wishlist_product_list.length;this.updateUI(count)}),document.addEventListener("ooo-wishlist:product-removed",event=>{const count=event.detail.wishlist_product_list.length;this.updateUI(count)})}async handleButtonClick(e){e.preventDefault(),e.stopPropagation();const button=e.currentTarget,handle=button.dataset.productHandle;if(handle)try{const isCurrentlyActive=button.classList.contains("active");await(isCurrentlyActive?window.Maestrooo.wishlist.removeProduct(handle):window.Maestrooo.wishlist.addProduct(handle)),this.updateButtonState(button,!isCurrentlyActive);const wishlistSection=document.querySelector("wishlist-products-section");wishlistSection&&isCurrentlyActive&&await wishlistSection.loadWishlistProducts()}catch(error){console.error("Erreur wishlist:",error)}}updateUI(count){!this.countBubble||!this.wishlistContainer||(this.countBubble.textContent=count,this.countBubble.classList.toggle("hidden",count===0),this.wishlistContainer.classList.toggle("active",count>0))}updateButtonState(button,isActive){button.classList.toggle("active",isActive),button.dataset.added=isActive?"true":null}async initButtons(){const wishlistButtons=document.querySelectorAll("[data-wishlist-button]");if(!wishlistButtons.length)return;const promises=Array.from(wishlistButtons).map(async button=>{const handle=button.dataset.productHandle;if(handle){button.removeEventListener("click",this.boundHandleClick),button.addEventListener("click",this.boundHandleClick);try{const isInWishlist=await window.Maestrooo.wishlist.containsProduct(handle);this.updateButtonState(button,isInWishlist)}catch(error){console.error("Erreur \xE9tat initial:",error)}}});await Promise.all(promises)}async initializeWishlist(){try{const content=await window.Maestrooo.wishlist.getContent();this.updateUI(content?.products?.length||0),await this.initButtons()}catch(error){console.error("Erreur initialisation wishlist:",error)}}}const initWishlistManager=()=>{window.wishlistManager||(window.wishlistManager=new WishlistManager)};document.addEventListener("DOMContentLoaded",initWishlistManager);
2//# sourceMappingURL=/cdn/shop/t/25/assets/mm-wishlist.js.map?v=14742674002508984841790682197

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.