PageSourceSearch

https://fellowproducts.com/cdn/shop/t/1298/assets/component-sticky-add-to-cart.vZF3mwHP.min.js

js fellowproducts.com collected 2026-09-24 17:57:23 UTC 2,605 bytes, 1 lines download raw bytes

1import{B as a}from"./BaseElement.CsZ3Pn0g.min.js";import{x as b}from"./lit-element.D1QXZDXi.min.js";import{n as c}from"./property.CoOWCv8E.min.js";var l=Object.defineProperty,u=(o,t,e,n)=>{for(var i=void 0,r=o.length-1,d;r>=0;r--)(d=o[r])&&(i=d(t,e,i)||i);return i&&l(t,e,i),i};class s extends a{constructor(){super(...arguments),this.sectionId="",this.buyBoxId="",this.mainButtonId="pdp-atc",this.boundClick=this.handleClick.bind(this)}connectedCallback(){super.connectedCallback();const t=this.buyBoxId?document.getElementById(this.buyBoxId):null;this.addEventListener("click",this.boundClick),this.setupVisibility(t),this.observeButtonState(t),this.syncStickyButton()}disconnectedCallback(){var t,e;super.disconnectedCallback(),this.removeEventListener("click",this.boundClick),(t=this.buyBoxObserver)==null||t.disconnect(),this.buyBoxObserver=void 0,(e=this.buttonStateObserver)==null||e.disconnect(),this.buttonStateObserver=void 0}render(){return b``}get stickyBar(){return document.getElementById(`StickyAddToCart-${this.sectionId}`)}get stickyButton(){return document.getElementById(`StickyAddToCartButton-${this.sectionId}`)}get stickyButtonText(){return document.getElementById(`StickyAddToCartButtonText-${this.sectionId}`)}get mainButton(){return document.getElementById(this.mainButtonId)}setVisibility(t){const e=this.stickyBar;e&&(e.classList.toggle("opacity-0",!t),e.classList.toggle("pointer-events-none",!t),e.classList.toggle("invisible",!t),e.setAttribute("aria-hidden",t?"false":"true"))}setupVisibility(t){t&&"IntersectionObserver"in window?(this.buyBoxObserver=new IntersectionObserver(e=>{e.forEach(n=>this.setVisibility(!n.isIntersecting))},{root:null,rootMargin:"0px",threshold:0}),this.buyBoxObserver.observe(t)):this.setVisibility(!0)}observeButtonState(t){const e=t??this.mainButton;e&&(this.buttonStateObserver=new MutationObserver(()=>this.syncStickyButton()),this.buttonStateObserver.observe(e,{attributes:!0,attributeFilter:["disabled"],childList:!0,subtree:!0}))}syncStickyButton(){const t=this.mainButton,e=this.stickyButton;if(!t||!e)return;e.disabled=t.disabled;const n=t.querySelector("span"),i=this.stickyButtonText;n&&i&&(i.textContent=n.textContent)}handleClick(t){const e=this.stickyButton;if(!e)return;const n=t.target;if(n!==e&&!e.contains(n))return;const i=this.mainButton;i&&!i.disabled&&i.click()}}u([c({type:String,attribute:"section-id"})],s.prototype,"sectionId");u([c({type:String,attribute:"buy-box-id"})],s.prototype,"buyBoxId");u([c({type:String,attribute:"main-button-id"})],s.prototype,"mainButtonId");customElements.define("sticky-add-to-cart",s);

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.