1const t=".js-add-cart",e=".header-group",i=".js-sticky-atc",s=".js-size-select",o=".js-cta-btn",c=".js-close-size-select",n=".js-scroll-top",l=".js-sticky-variant-title",h=".js-base-modal-toggle.how-to-order",a="form#bisForm",r=".js-bis-email",d=".js-sticky-bis-message",u="is-show",S="hidden",m="how-to-order";class v extends window.HTMLElement{connectedCallback(){this.addCartBtn=document.querySelector(t),this.headerGroup=document.querySelector(e),this.stickyAtc=this.querySelector(i),this.sizeSelect=this.querySelector(s),this.ctaBtn=this.querySelector(o),this.closeSizeSelect=this.querySelector(c),this.scrollTopEl=this.querySelector(n),this.stickyVariantTitle=this.querySelector(l),this.howToOrderBtn=document.querySelector(h),this.isB2B="true"===this.getAttribute("data-b2b"),this.oosWithNotification=document.querySelector(a),this._eventRemovers=[],this.stickyAtc&&(this.initializeToggleStickyAtc(),this.initializeChangeState(),this.initializeScrollTop())}disconnectedCallback(){this._eventRemovers&&(this._eventRemovers.forEach(t=>t()),this._eventRemovers=[])}initializeToggleStickyAtc(){const t=()=>{this.handleCheckAtcOnViewport()};t(),window.addEventListener("scroll",t),this._eventRemovers.push(()=>window.removeEventListener("scroll",t))}handleCheckAtcOnViewport(){let t=null;if(t=this.isB2B?this.howToOrderBtn:this.oosWithNotification&&!this.oosWithNotification.closest(".js-oos-with-notification").classList.contains(S)?this.oosWithNotification:this.addCartBtn,t){const e=t.getBoundingClientRect(),i=this.headerGroup?this.headerGroup.clientHeight:0;e.top+e.height<=i||e.bottom>=e.height+window.innerHeight?this.classList.add(u):(this.classList.remove(u),setTimeout(()=>{this.handleBackDefaultState()},400))}}initializeChangeState(){if(!this.sizeSelect||!this.ctaBtn)return;const t=t=>{this.handleClickCtaBtn(t)};this.ctaBtn.addEventListener("click",t),this._eventRemovers.push(()=>this.ctaBtn.removeEventListener("click",t));const e=()=>{this.handleChangeState()};this.closeSizeSelect&&(this.closeSizeSelect.addEventListener("click",e),this._eventRemovers.push(()=>this.closeSizeSelect.removeEventListener("click",e))),this.stickyVariantTitle&&(this.stickyVariantTitle.addEventListener("click",e),this._eventRemovers.push(()=>this.stickyVariantTitle.removeEventListener("click",e)))}handleClickCtaBtn(t){const e=this.querySelector('input[name="id"]');if(e&&e.value&&!this.isB2B){const e=this.querySelector("product-form");if("notify me"===this.ctaBtn.querySelector("span").innerText.toLowerCase()){const t=e.querySelector(r);if(t.value){const i=this.querySelector(d);e.handleSubmitBackInStock(i,null,t,this.ctaBtn)}else this.handleChangeState()}else e.onSubmitHandler(t,!0)}else if(this.isB2B&&this.ctaBtn.classList.contains(m)){const t=this.howToOrderBtn.getAttribute("data-modal-id"),e=document.querySelector(`base-modal#${t}`);e&&e.handleOpenModal()}else this.handleChangeState()}handleChangeState(t=!1){t?(this.stickyAtc.classList.remove(S),this.sizeSelect.classList.add(S)):(this.stickyAtc.classList.toggle(S),this.sizeSelect.classList.toggle(S))}handleBackDefaultState(){this.stickyAtc.classList.remove(S),this.sizeSelect.classList.add(S)}initializeScrollTop(){if(!this.scrollTopEl)return;const t=()=>{window.scrollTo({top:0,behavior:"smooth"})};this.scrollTopEl.addEventListener("click",t),this._eventRemovers.push(()=>this.scrollTopEl.removeEventListener("click",t))}}window.customElements.define("sticky-atc",v);
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.