1import{a as R}from"/build/_shared/chunk-DEEIYPRZ.js";import{f as C}from"/build/_shared/chunk-GOV2IL6E.js";import{j as S}from"/build/_shared/chunk-D7PKK72C.js";import{a as f,b as V}from"/build/_shared/chunk-GLNX7PBK.js";import{a as H}from"/build/_shared/chunk-QRABKZWD.js";import{f as A}from"/build/_shared/chunk-ZAG7ZERG.js";import{n as E}from"/build/_shared/chunk-XHXRPQY5.js";import{$ as L,O as T,aa as I,qa as N,t as v}from"/build/_shared/chunk-FES3B5QL.js";import{a as b}from"/build/_shared/chunk-G3QUQOKW.js";import{a as _}from"/build/_shared/chunk-F3RAJA4O.js";import{e as g}from"/build/_shared/chunk-O3BUCIVF.js";var w=g(_());var J=(a={})=>{let{debounceDelay:e=200,enableLogging:s=!0,eventName:o=R.home_scroll_depth}=a,p=C(),c=(0,w.useRef)([]),r=(0,w.useRef)(),l=(0,w.useCallback)((n,t=0)=>{if(!n)return!1;let m=n.getBoundingClientRect().top;return m+t>=0&&m-t<=window.innerHeight},[]),y=(0,w.useCallback)((n,t)=>{t&&(c.current[n]={element:t,isInViewport:l(t)})},[l]);return(0,w.useEffect)(()=>{if(!s)return;let n=()=>{r.current&&clearTimeout(r.current),r.current=setTimeout(()=>{let t=!1;c.current.forEach((m,k)=>{let x=m.isInViewport,u=l(m.element);(u&&!x||!u&&x)&&(c.current[k].isInViewport=u,t=!0)}),t&&p({eventName:o,logType:"ALL"})},e)};return window.addEventListener("scroll",n),()=>{window.removeEventListener("scroll",n),r.current&&clearTimeout(r.current)}},[p,o,e,s,l]),{setRef:y,elementsRef:c.current}};var h=g(_());var G="/build/_assets/styles-2SKV5XML.css";var d=g(b()),B=()=>[{rel:"stylesheet",href:G}];function M(){var y,n,t,m,k,x;let a=H(),{user:e}=S(),{assets:s}=A(),o=((t=(n=(y=s==null?void 0:s.assets)==null?void 0:y.data)==null?void 0:n[0])==null?void 0:t.attributes)||{},p=(0,h.useRef)(null),c=((x=(k=(m=o==null?void 0:o.weekly_ads_retailer_logo)==null?void 0:m.data)==null?void 0:k.attributes)==null?void 0:x.url)||"",[r,l]=(0,h.useState)(!1);return(0,h.useEffect)(()=>{let{current:u}=p;u!=null&&u.complete&&l(u.naturalHeight!==0)},[]),(0,d.jsxs)(E,{className:"circular-card",to:e!=null&&e.selectedStore?`/flyers?store=${e==null?void 0:e.selectedStore}`:"/flyers",tabIndex:0,children:[(0,d.jsxs)("div",{className:"circular-image-container",children:[(0,d.jsx)(I,{alt:(a==null?void 0:a.homepage_shop_weekly_ad_desc)||"Your Weekly Flyers",className:"circular-image",src:c,ref:p,role:"presentation",loading:"lazy",onLoad:()=>l(!0)}),(0,d.jsx)(N,{className:V("circular-image circular-image-skeleton",r&&"loaded")})]}),(0,d.jsxs)("div",{className:"circular-text-container",children:[(0,d.jsx)(T,{component:"span",className:"circular-weekly-ad-text",children:a==null?void 0:a.homepage_shop_weekly_ad}),(0,d.jsx)(T,{component:"span",className:"circular-weekly-ad-description",children:a==null?void 0:a.homepage_shop_weekly_ad_desc})]})]})}var O="/build/_assets/styles-T2IQQCF5.css";var i=g(b()),ie=()=>[{rel:"stylesheet",href:O},...B()],oe=a=>{let{ad:e,homepageWeeklyAd:s,index:o,setRef:p,squelchAd:c}=a,r=s&&o===0;return(0,i.jsxs)(L,{component:"section",className:f("homepage-ad-container"),ref:l=>p&&p(o,l),children:[(0,i.jsx)(L.Col,{span:r?{base:12,sm:9}:{base:12,sm:12},children:(0,i.jsxs)(v,{className:f("ad-wrapper",r&&"three-to-one"),children:[(0,i.jsx)("swiftly-ad",{"data-placement-id":e==null?void 0:e.placementId,"data-screen-name":e==null?void 0:e.screenName,"data-testid":"swiftly-ad",class:f(!c&&"loaded")}),(0,i.jsx)(v,{className:f("ad-skeleton-wrapper",r&&"three-to-one"),children:(0,i.jsx)(N,{className:f("homepage-ad-skeleton",!c&&"loaded")})})]})}),r&&(0,i.jsx)(L.Col,{span:{base:12,sm:3},mb:{base:24,sm:0},children:(0,i.jsx)(v,{className:"circular-container",children:(0,i.jsx)(M,{})})})]},`${e==null?void 0:e.placementId}-${o}`)};export{J as a,ie as b,oe as c};
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.