PageSourceSearch

https://boutique.rcnarbonnais.fr/cdn/shop/t/2/assets/component-qua…?v=41944816862679691781732546863

js rcnarbonnais.fr collected 2026-10-02 22:44:10 UTC 2,483 bytes, 2 lines download raw bytes

1customElements.get("quantity-input")||customElements.define("quantity-input",class extends HTMLElement{constructor(){super(),this.cacheDOMElements(),this.bindEventHandlers()}cacheDOMElements(){this.input=this.querySelector("input"),this.buttonMinus=this.querySelector("button[name='minus']"),this.buttonPlus=this.querySelector("button[name='plus']"),this.sectionId=this.getAttribute("data-section-id")}bindEventHandlers(){this.attachEventListeners=this.attachEventListeners.bind(this),this.detachEventListeners=this.detachEventListeners.bind(this),this.onButtonClick=this.onButtonClick.bind(this),this.onInput=this.debounce(this.onInput.bind(this),500),this.onCartAdded=this.onCartAdded.bind(this)}connectedCallback(){this.attachEventListeners()}attachEventListeners(){this.buttonMinus.addEventListener("click",this.onButtonClick),this.buttonPlus.addEventListener("click",this.onButtonClick),this.input.addEventListener("input",this.onInput),eventBus.on("cart:added",this.onCartAdded)}debounce(func,wait,immediate){let timeout;return function(){const context=this,args=arguments,later=function(){timeout=null,immediate||func.apply(context,args)},callNow=immediate&&!timeout;clearTimeout(timeout),timeout=setTimeout(later,wait),callNow&&func.apply(context,args)}}onButtonClick(event){event.preventDefault();const previousValue=this.input.value,adjustment=event.currentTarget.name==="plus"?1:-1;this.adjustQuantity(adjustment),previousValue!==this.input.value&&eventBus.emit("qty:change",{value:this.input.value,sectionId:this.sectionId})}onInput(event){event.preventDefault(),isNaN(this.input.value)&&(this.input.value=1),this.input.min&&parseInt(this.input.value)<parseInt(this.input.min)&&(this.input.value=this.input.min),eventBus.emit("qty:change",{value:this.input.value,sectionId:this.sectionId})}adjustQuantity(adjustment){const newValue=parseInt(this.input.value)+adjustment;this.input.value=isNaN(newValue)?1:newValue,this.input.min&&parseInt(this.input.value)<parseInt(this.input.min)&&(this.input.value=this.input.min)}onCartAdded(data){data.sectionId&&data.sectionId===this.sectionId&&(this.input.value=1)}disconnectedCallback(){this.detachEventListeners()}detachEventListeners(){this.buttonMinus.removeEventListener("click",this.onButtonClick),this.buttonPlus.removeEventListener("click",this.onButtonClick),this.input.removeEventListener("input",this.onInput)}});
2//# sourceMappingURL=/cdn/shop/t/2/assets/component-quantity-input.js.map?v=41944816862679691781732546863

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.