PageSourceSearch

https://www.hypebeverages.com/assets/js/BlogListingPage-GvaH8WYN.js

js hypebeverages.com collected 2026-09-25 12:55:05 UTC 9,273 bytes, 4 lines download raw bytes

1import{aV as K,b6 as Z,r as l,j as e,b4 as q,b7 as Q,aW as X}from"./vendor-react-BzspNr1T.js";import{b as w}from"./blogService-gJUmXQ5E.js";import{b as g,c as F,d as ee,e as P}from"./index-Ca0tFk1S.js";import{B as r,C as te,Y as A,T as i,ae as S,ag as v,aH as se,G as u,f as ae,aC as re,al as M,am as W,an as U,a8 as d,b as E,A as ne,af as ie,ah as C,aI as oe,aJ as le,aK as ce,aL as de}from"./vendor-mui-UOmyAJXi.js";import"./vendor-maps-C7wV7spV.js";import"./vendor-animations-TYrwaXAM.js";import"./vendor-redux-CWo-c314.js";import"./vendor-icons-DRsno-dh.js";/* empty css                        */const we=()=>{K();const[m,I]=Z(),[x,L]=l.useState([]),[O,B]=l.useState(!0),[k,T]=l.useState(null),[me,D]=l.useState([]),[H,N]=l.useState([]),[o,h]=l.useState({current:1,pages:1,total:0,limit:9}),[c,f]=l.useState({search:m.get("search")||"",category:m.get("category")||"",tag:m.get("tag")||"",sort:m.get("sort")||"-publishedAt"});l.useEffect(()=>{_(),R(),G()},[o.current,c]);const _=async()=>{try{B(!0);const t={page:o.current,limit:o.limit,...c},a=await w.getBlogs(t);L(a.data);const s=a.pagination||{};h({current:s.current??s.page??1,pages:s.pages??s.totalPages??1,total:s.total??0,limit:s.limit??9})}catch(t){T(t.message||"Failed to fetch blogs")}finally{B(!1)}},R=async()=>{try{const t=await w.getBlogCategories();D(t.data)}catch(t){console.error("Failed to fetch categories:",t)}},G=async()=>{try{const t=await w.getBlogTags();N(t.data)}catch(t){console.error("Failed to fetch tags:",t)}},$=(t,a)=>{h(s=>({...s,current:a}))},y=(t,a)=>{f(n=>({...n,[t]:a})),h(n=>({...n,current:1}));const s=new URLSearchParams(m);a?s.set(t,a):s.delete(t),I(s)},J=t=>{t.preventDefault(),y("search",c.search)},V=()=>{f({search:"",category:"",tag:"",sort:"-publishedAt"}),h(t=>({...t,current:1})),I({})},Y=t=>{if(!t||typeof t!="string")return 1;const a=200,s=t.split(/\s+/).length;return Math.ceil(s/a)},j="Blog - Latest News & Updates | Cocaine Energy Supplement®️",p="Stay updated with the latest news, tips, and insights about energy drinks, healthy lifestyle, and more from Cocaine Energy Supplement®️",b=`${window.location.origin}/blog`;return O&&x.length===0?e.jsx(r,{display:"flex",justifyContent:"center",alignItems:"center",minHeight:"400px",children:e.jsx(te,{})}):e.jsxs(e.Fragment,{children:[e.jsxs(q,{children:[e.jsx("title",{children:j}),e.jsx("meta",{name:"description",content:p}),e.jsx("meta",{name:"keywords",content:"energy drinks, blog, news, tips, healthy lifestyle, cocaine energy supplement®"}),e.jsx("link",{rel:"canonical",href:b}),e.jsx("meta",{property:"og:title",content:j}),e.jsx("meta",{property:"og:description",content:p}),e.jsx("meta",{property:"og:type",content:"website"}),e.jsx("meta",{property:"og:url",content:b}),e.jsx("meta",{property:"og:site_name",content:"Cocaine Energy Supplement®️"}),e.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),e.jsx("meta",{name:"twitter:title",content:j}),e.jsx("meta",{name:"twitter:description",content:p}),e.jsx("script",{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@type":"Blog",name:"Cocaine Energy Supplement®️ Supplement®️ Blog",description:p,url:b,publisher:{"@type":"Organization",name:"Cocaine Energy Supplement®️ Supplement®️",url:window.location.origin}})})]}),e.jsxs(r,{sx:{py:4},children:[e.jsxs(r,{fullWidth:!0,sx:{p:4,backgroundImage:`
2      url('/assets/blogbg.jpeg'),
3      radial-gradient(circle, rgba(0,0,0,0.1) 1px, transparent 1px)
4    `},children:[e.jsxs(r,{display:"flex",alignItems:"center",gap:2,sx:{mb:4,flexDirection:{xs:"column",sm:"row"},textAlign:{xs:"center",sm:"left"}},children:[e.jsx(A,{color:"primary",sx:{fontSize:{xs:32,sm:40}}}),e.jsxs(r,{children:[e.jsx(i,{variant:"h3",component:"h1",fontWeight:"bold",color:"white",gutterBottom:!0,sx:{fontSize:{xs:"1.8rem",sm:"2.4rem",md:"3rem"}},children:"Our Blog"}),e.jsx(i,{variant:"h6",color:"white",sx:{fontSize:{xs:"1rem",sm:"1.25rem"}},children:"Stay updated with the latest news, tips, and insights"})]})]}),e.jsx(S,{sx:{mb:4},children:e.jsxs(v,{children:[e.jsxs(r,{display:"flex",alignItems:"center",gap:2,mb:3,children:[e.jsx(se,{color:"primary"}),e.jsx(i,{variant:"h6",children:"Filter & Search"})]}),e.jsxs(u,{container:!0,spacing:2,alignItems:"center",children:[e.jsx(u,{item:!0,xs:12,sm:6,children:e.jsx("form",{onSubmit:J,children:e.jsx(ae,{fullWidth:!0,placeholder:"Search blog posts...",value:c.search,onChange:t=>f(a=>({...a,search:t.target.value})),InputProps:{startAdornment:e.jsx(re,{sx:{mr:1,color:"text.secondary"}})}})})}),e.jsx(u,{item:!0,xs:12,sm:6,children:e.jsxs(M,{sx:{width:"100px"},children:[e.jsx(W,{children:"Tag"}
4),e.jsxs(U,{value:c.tag,label:"Tag",onChange:t=>y("tag",t.target.value),children:[e.jsx(d,{value:"",children:"All Tags"}),H.map(t=>e.jsx(d,{value:t,children:t},t))]})]})}),e.jsx(u,{item:!0,xs:12,sm:6,children:e.jsx(E,{variant:"outlined",onClick:V,fullWidth:!0,children:"Clear Filters"})})]})]})})]}),k&&e.jsx(ne,{severity:"error",sx:{mb:3},onClose:()=>T(null),children:k}),e.jsxs(r,{display:"flex",justifyContent:"space-between",alignItems:"center",sx:{flexDirection:{xs:"column",sm:"row"},gap:{xs:2,sm:0},mb:3,mt:3,px:{xs:2,sm:4,md:5}},children:[e.jsxs(i,{variant:"body1",color:"text.secondary",children:["Showing ",x.length," of ",o.total," blog posts"]}),e.jsxs(M,{size:"small",sx:{minWidth:150},children:[e.jsx(W,{children:"Sort by"}),e.jsxs(U,{value:c.sort,label:"Sort by",onChange:t=>y("sort",t.target.value),children:[e.jsx(d,{value:"-publishedAt",children:"Newest First"}),e.jsx(d,{value:"publishedAt",children:"Oldest First"}),e.jsx(d,{value:"-viewCount",children:"Most Popular"}),e.jsx(d,{value:"title",children:"Title A-Z"})]})]})]}),x.length===0?e.jsx(S,{children:e.jsxs(v,{sx:{textAlign:"center",py:6},children:[e.jsx(A,{sx:{fontSize:64,color:"text.secondary",mb:2}}),e.jsx(i,{variant:"h6",color:"text.secondary",gutterBottom:!0,children:"No blog posts found"}),e.jsx(i,{variant:"body2",color:"text.secondary",children:"Try adjusting your search criteria or check back later for new content."})]})}):e.jsx(r,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",sm:"repeat(2, 1fr)",md:"repeat(3, 1fr)",lg:"repeat(3, 1fr)"},gap:3,width:"100%",px:{xs:2,sm:4,md:5}},children:x.map(t=>{const a=g(t.featuredImage,"medium")||F(P()),s=ee(t.featuredImage)||void 0;return console.log("📝 Blog Card Image Debug:",{blogTitle:t.title,blogId:t._id,featuredImage:t.featuredImage,constructedUrl:a,srcSet:s,thumbnailUrl:g(t.featuredImage,"thumbnail"),mediumUrl:g(t.featuredImage,"medium"),largeUrl:g(t.featuredImage,"large"),originalUrl:g(t.featuredImage,"original")}),e.jsxs(S,{sx:{height:"100%",display:"flex",flexDirection:"column",transition:"all 0.3s ease","&:hover":{transform:"translateY(-4px)",boxShadow:"0 8px 25px rgba(0,0,0,0.15)"}},children:[e.jsx(ie,{component:"img",height:"200",src:a,srcSet:s,crossOrigin:"anonymous",loading:"lazy",decoding:"async",alt:t.featuredImage?.alt||t.title,onError:n=>{if(console.error("❌ Blog Card Image failed to load:",{src:n.target.src,blogTitle:t.title,featuredImage:t.featuredImage,error:n.type}),!n.target.src.includes("hype")){const z=F(P());console.log("🔄 Trying fallback image:",z),n.target.src=z}},sx:{objectFit:"fill",backgroundColor:"#fafafa"}}),e.jsxs(v,{sx:{flexGrow:1},children:[e.jsxs(r,{display:"flex",justifyContent:"space-between",alignItems:"center",mb:2,children:[e.jsx(C,{label:t.category,color:"primary",variant:"outlined",size:"small"}),e.jsxs(i,{variant:"caption",color:"text.secondary",children:[Y(t.content)," min read"]})]}),e.jsx(i,{variant:"h6",component:"h2",sx:{fontWeight:"bold",mb:2,overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",lineHeight:1.3,fontSize:{xs:"1rem",sm:"1.25rem"}},children:t.title}),e.jsx(i,{variant:"body2",color:"text.secondary",sx:{mb:3,overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:3,WebkitBoxOrient:"vertical",lineHeight:1.5},children:t.excerpt}),e.jsxs(r,{display:"flex",alignItems:"center",gap:1,mb:2,children:[e.jsx(oe,{sx:{fontSize:16,color:"text.secondary"}}),e.jsx(i,{variant:"caption",color:"text.secondary",children:Q(new Date(t.publishedAt),"MMM dd, yyyy")})]}),t.tags&&t.tags.length>0&&e.jsxs(r,{display:"flex",flexWrap:"wrap",gap:.5,mb:2,children:[t.tags.slice(0,3).map(n=>e.jsx(C,{label:n,size:"small",variant:"outlined",sx:{fontSize:"0.7rem"}},n)),t.tags.length>3&&e.jsx(C,{label:`+${t.tags.length-3}`,size:"small",variant:"outlined",sx:{fontSize:"0.7rem"}})]}),e.jsx(r,{display:"flex",alignItems:"center",gap:2,children:e.jsxs(r,{display:"flex",alignItems:"center",gap:.5,children:[e.jsx(le,{sx:{fontSize:16,color:"text.secondary"}}),e.jsxs(i,{variant:"caption",color:"text.secondary",children:[t.viewCount||0," views"]})]})})]}),e.jsx(ce,{sx:{p:2,pt:0},children:e.jsx(E,{component:X,to:`/blog/${t.slug}`,variant:"contained",fullWidth:!0,sx:{textTransform:"none"},children:"Read More"})})]},t._id)})}),o.pages>1&&e.jsx(r,{display:"flex",justifyContent:"center",mt:6,sx:{px:{xs:1,sm:0}},children:e.jsx(de,{count:Math.max(1,o.pages||1),page:Math.min(Math.max(1,o.current||1),Math.max(1,o.pages||1)),onChange:$,color:"primary",size:"medium",showFirstButton:!0,showLastButton:!0})})]})]})};export{we 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.