PageSourceSearch

https://www.canterbury.com/cdn/shop/t/16/assets/sticky-add-to-cart-mobile2.js?v=19551419135490725461790852455

js canterbury.com collected 2026-10-02 10:52:07 UTC 3,240 bytes, 1 lines download raw bytes

1import{d as T}from"./_debounce.DH6pRMXB.js?v=722daec315";const q=(()=>{let o=null,a=null,f=null,l=null,d=null,m=!1,i=null,u=null,c=null,s=null;const E=(t,e,n,r)=>{t&&(e!==void 0&&t.style.setProperty("bottom",e,"important"),n!==void 0&&t.style.setProperty("right",n,"important"),r!==void 0&&t.style.setProperty("left",r,"important"))},v=t=>t?"86px":"16px",p=(t,{bottom:e,right:n,left:r})=>{document.querySelectorAll(t).forEach(g=>{E(g,e,n,r)})},y=t=>{const e=v(t),n="5px";p('[id^="dimelo_chat_button_"] .item-reset.button-wrapper, .dimelo_chat_item.dimelo_chat_button .item-reset.button-wrapper',{bottom:e,right:n}),p(".dimelo-chat-bubble.dimelo-chat-round-button",{bottom:e,right:n})},b=t=>{const e=v(t);p(".ot-floating-button",{bottom:e,left:"5px"})},w=t=>{!o||!f||!i||(t?(u=i.offsetHeight,i.style.height=`${u}px`,o.classList.add("is-sticky"),document.body.classList.add("has-sticky-atc-mobile"),o.setAttribute("data-reveal-fake-atc",""),b(!0),y(!0)):(o.classList.remove("is-sticky"),document.body.classList.remove("has-sticky-atc-mobile"),i.style.removeProperty("height"),u=null,o.removeAttribute("data-reveal-fake-atc"),b(!1),y(!1)))},I=(t=500)=>{let e=0;const n=()=>{b(document.body.classList.contains("has-sticky-atc-mobile")),y(document.body.classList.contains("has-sticky-atc-mobile")),e++<t&&requestAnimationFrame(n)};n()},L=()=>
1{if(!a)return;const t=a.getBoundingClientRect(),r=window.innerHeight-10,g=t.bottom-r;window.scrollBy({top:g,behavior:"smooth"})},h=t=>{const e=s.parentElement;if(!e)return;const n=e.classList.contains("is-sticky"),r=e.hasAttribute("data-product-no-variants");n&&(r?c&&!c.disabled?c.click():c.disabled&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),L()):(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),L()))},P=t=>{t.key==="Enter"&&h(t)},S=()=>{s&&(s.addEventListener("click",h),s.addEventListener("keydown",P))},x=()=>{!o||!a||(l=new IntersectionObserver(([t])=>{w(!t.isIntersecting)},{root:null,threshold:0,rootMargin:"-10px 0px 60px 0px"}),l.observe(a))},A=()=>{l&&(l.disconnect(),l=null),d&&(d.disconnect(),d=null),s&&(s.removeEventListener("click",h),s.removeEventListener("keydown",P)),o&&(o.classList.remove("is-sticky"),o.removeAttribute("data-reveal-fake-atc")),document.body.classList.remove("has-sticky-atc-mobile"),i&&u&&i.style.removeProperty("height"),o=null,a=null,f=null,l=null,d=null,i=null,u=null,c=null,s=null,m=!1},C=()=>window.innerWidth<=1024,B=()=>{C()?m||k():A()},_=()=>{const t=T(B,100);window.addEventListener("resize",t),window.addEventListener("orientationchange",t)},k=()=>{if(m){console.error("StickyAddToCart.init() already initialised.");return}if(o=document.querySelector("[data-sticky-atc-button]"),a=document.querySelector("[data-sticky-atc-waypoint]"),f=document.documentElement,c=document.querySelector("[data-sticky-atc-button] .product-form__submit"),s=document.querySelector("[data-sticky-atc-button] .fake-sticky-atc"),i=o?o.parentElement:null,!o||!a||!i){console.error("[Sticky ATC] A required element was not found");return}x(),S(),I(),w(!0),m=!0};return{init:k,cleanup:A,autoInit:()=>{const t=()=>{C()&&k(),_()};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",t):t()}}})();q.autoInit();

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.