PageSourceSearch

https://www.homesandgardens.com/vite/assets/Article/GroupProductCarousel.ts-C36Yusa-.js

js homesandgardens.com collected 2026-09-24 08:45:25 UTC 1,838 bytes, 1 lines download raw bytes

1const e=e=>Array.from(e.children).filter((e=>e instanceof HTMLElement)),t=t=>{var o;let r=null,n=1;const l=t.querySelector("[data-group-product-carousel-controls]"),c=t.querySelector("[data-group-product-carousel-products]"),i=t.querySelector('[data-group-product-carousel-arrow="left"]'),a=t.querySelector('[data-group-product-carousel-arrow="right"]');if(!(l&&c&&i&&a))return;const s=(e,t,o)=>{e.style.display=t?"inline-flex":"none",e.disabled=o},d=e=>e.getBoundingClientRect().left-c.getBoundingClientRect().left+c.scrollLeft,u=()=>{const t=e(c).at(-1);return t?Math.max(d(t)+t.offsetWidth-c.clientWidth,0):0},h=()=>{const e=u(),t=e>1,o=c.scrollLeft<=1,r=c.scrollLeft>=e-1;if(l.hidden=!t,!t)return s(i,!1,!0),void s(a,!1,!0);s(i,!0,o),s(a,!0,r)},m=()=>{n=window.matchMedia("(max-width: 699px)").matches?2:4,h()},f=()=>{const t=e(c).length,o=(()=>{const t=e(c);let o=0;return t.forEach(((e,t)=>{d(e)<=c.scrollLeft+1&&(o=t)})),o})(),r=Math.max(t-n,0),l=t-(o+n),i=Math.min(o+n,r);(e=>{const t=c.children[e];if(!t)return;const o=u(),r=Math.min(d(t),o);c.scrollTo({left:r,behavior:"smooth"})})(l<=n?r:i)};i.addEventListener("click",(()=>{c.scrollTo({left:0,behavior:"smooth"})})),a.addEventListener("click",(()=>{f()})),c.addEventListener("scroll",(()=>{h()}),{passive:!0});const w=()=>{r&&window.clearTimeout(r),r=window.setTimeout((()=>m()),200)};window.addEventListener("resize",w);const p=new ResizeObserver((()=>{w()}));p.observe(c),p.observe(t),c.querySelectorAll("img").forEach((e=>{e.complete||e.addEventListener("load",w,{once:!0})})),null==(o=document.fonts)||o.ready.then((()=>{w()})),window.requestAnimationFrame((()=>{m(),window.requestAnimationFrame(m)})),window.setTimeout(m,300),window.setTimeout(m,1e3)};window.reliablePageLoad.then((()=>{document.querySelectorAll("[data-group-product-carousel]").forEach((e=>{t(e)}))}));

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.