1import{u as z,s as P,n as Y,h as $,av as H,E as K,r as Q,R as a,z as _,j as e,B as W,S as w,F as q}from"./index-B9ovCa2o.js";import{C as S,a as J,b as V}from"./CategorySkeleton-CLTU8Jha.js";import{M as X}from"./MoreForYouSection-CKmWqIAS.js";import"./sanitize-html-si29paC7.js";import"./Skeleton-zUPlhBiS.js";import"./MoreForYouSkeleton-B6BnX1k0.js";const ie=()=>{var v;const L=z(P),y=Y(L),j=$(1),I=H(),{data:l}=K({populate:"*"}),E=Q.useMemo(()=>{var r,u;const s=(r=l==null?void 0:l.allItems)==null?void 0:r.find(d=>d.label&&d.label.toLowerCase().includes("deals")||d.path&&d.path.includes("/deals-contests")),t={title:"Deals & Contest - My Military Lifestyle",description:"Discover healthy recipes, wellness tips, and nutrition advice for the military community.",canonicalUrl:window.location.href,keywords:"food, wellness, military health, recipes, nutrition, self-care",siteName:"My Military Lifestyle",imageUrl:window.location.origin+"/assets/img/default-article.jpg"};return s?{title:s.seoTitle||s.metaTitle||s.title||t.title,de
1scription:s.seoDescription||s.metaDescription||s.description||t.description,canonicalUrl:s.canonicalUrl||t.canonicalUrl,keywords:s.keywords||s.metaKeywords||t.keywords,siteName:t.siteName,imageUrl:(u=s.metaImage)!=null&&u.url?s.metaImage.url.startsWith("http")?s.metaImage.url:window.location.origin+s.metaImage.url:t.imageUrl,structuredData:{"@context":"https://schema.org","@type":"CollectionPage",name:s.seoTitle||s.title||t.title,description:s.seoDescription||s.description||t.description,url:window.location.href}}:{...t,structuredData:{"@context":"https://schema.org","@type":"CollectionPage",name:t.title,description:t.description,url:window.location.href}}},[l]),n=(v=l==null?void 0:l.allItems)==null?void 0:v.find(s=>s.label&&s.label.toLowerCase().includes("deals")||s.path&&s.path.includes("/deals-contests")),M=(n==null?void 0:n.label)||"Deals & Contest",k=(n==null?void 0:n.description)||"Discover healthy recipes, wellness tips, and nutrition advice for the military community.",[p,D]=a.useState(1),[i,b]=a.useState([]),[h,A]=a.useState(!0),g=a.useRef(null),c=a.useRef(null),{data:o,isLoading:f,isFetching:m,isError:Z}=_({categorySlug:"deals-contests",populate:"*",filters:{publishedAt:{$notNull:!0}},pagination:{page:p,pageSize:15},sort:"publishedAt:desc",userId:y,now:j});a.useEffect(()=>{var s;if(o!=null&&o.data){const t=Array.isArray(o.data)?o.data:[];b(p===1?t:u=>{const d=new Set(u.map(x=>x.id)),R=t.filter(x=>!d.has(x.id));return[...u,...R]});const r=(s=o.meta)==null?void 0:s.pagination;A(r?r.page<r.pageCount:!1)}},[o,p]);const C=a.useCallback(s=>{s[0].isIntersecting&&h&&!m&&!f&&D(r=>r+1)},[h,m,f]);a.useEffect(()=>(c.current&&c.current.disconnect(),c.current=new IntersectionObserver(C,{root:null,rootMargin:"20px",threshold:.1}),g.current&&c.current.observe(g.current),()=>{c.current&&c.current.disconnect()}),[C,i.length]);const N=I.showCategoryCarousel?i.slice(0,5):[],F=N.length>0,O=i,T=a.useMemo(()=>{const s={publishedAt:{$notNull:!0}};if(i.length>0){const t=i.map(r=>r.id).filter(Boolean);t.length>0&&(s.id={$notIn:t.slice(0,20)})}return s},[i]),{data:U,isLoading:B,isError:G}=_({populate:"*",filters:T,pagination:{pageSize:10},sort:"publishedAt:desc",userId:y,now:j});return e.jsxs(e.Fragment,{children:[e.jsx(W,{...E}),e.jsxs("main",{children:[e.jsx(w,{location:"GLOBAL_TOP_MOBILE",showSection:!0,sectionClassName:"pt-25 d-lg-none"}),e.jsx("section",{className:"tp-advertise-area pt-25 pb-20",children:e.jsx("div",{className:"container",children:e.jsxs("div",{className:"row",children:[e.jsx("div",{className:"col-xl-9 col-lg-8 col-md-12 col-sm-12 col-12 mb-30 allpagesdtl_left",children:e.jsxs("div",{className:"card shadow-none border-0 brdr_radius20 p-0",children:[e.jsx("div",{className:"d-flex mb-10",children:e.jsx("h3",{className:"f_plusjakartasanssemibold postdtl_title f_primary",children:M})}),e.jsx("div",{className:"d-flex mb-3",children:k}),f?e.jsx(S,{itemsCount:6}):e.jsxs(e.Fragment,{children:[F&&e.jsx("div",{className:"row mb-50",children:e.jsx("div",{className:"col-xl-12 col-lg-12 col-md-12 col-sm-12 col-12",children:e.jsx("div",{className:"allcontent_carouselwrapper card shadow-sm brdr_radius20 p-3",children:e.jsx(J,{articles:N,isLoading:!1,carouselId:"foodWellnessCarousel"})})})}),e.jsxs("div",{className:"allcontent_articles_wrapper scrollbar_style",children:[e.jsx(V,{articles:O,isLoading:!1}),e.jsxs("div",{ref:g,className:"text-center py-4",children:[m&&p>1&&e.jsx(S,{itemsCount:3,showCarousel:!1}),!h&&i.length>0&&!m&&e.jsxs("div",{className:"no-more-data-container mt-30 mb-20 text-center",children:[e.jsx("hr",{className:"f_darkgrey3",style:{opacity:.1}}),e.jsx("p",{className:"f_sz16 f_darkgrey2 f_plusjakartasanssemibold",children:"You've reached the end of the results."})]})]})]})]})]})}),e.jsx("div",{className:"col-xl-3 col-lg-4 col-md-12 col-sm-12 col-12 allpagesdtl_right d-none d-lg-block",children:e.jsx("div",{className:"postdtl_adwrapper postdtl_adwrapper_sticky text-center mb-15",children:e.jsx(w,{location:"GLOBAL_SIDEBAR_STICKY"})})})]})})}),e.jsx(w,{location:"GLOBAL_BOTTOM_WIDE",showSection:!0,sectionClassName:"pb-20"}),e.jsx(X,{data:U,isLoading:B,isError:G})]}),e.jsx(q,{})]})};export{ie as default};
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.