1import{o as C}from"./rolldown-runtime-CPfWejcf.js";import{A as B,O as z,b as _,i as R,n as A,r as m,t as P,y as I}from"./chunk-JFAXFPC7-DtzA310i.js";import{t as M}from"./arrow-right-CTkvd-AC.js";import{t as U}from"./arrow-up-right-D6M8jYzG.js";import{t as v}from"./book-open-xVSbMwgl.js";import{t as L}from"./calendar-days-BP2tD3kE.js";import{i as T,r as $,t as E}from"./blog-CLFqyWVW.js";import{ft as d,st as D}from"./index-DXDNpk5j.js";var r=C(B(),1),e=z();function K(s){if(!s)return"Publication date unavailable";const t=new Date(s);return Number.isNaN(t.getTime())?"Publication date unavailable":t.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}function O(s){return Math.max(1,Math.ceil(s.bodyMarkdown.trim().split(/\s+/).filter(Boolean).length/220))}function q(s){return window.location.hostname==="blog.synergy-network.io"?`/${encodeURIComponent(s)}`:`/blog/${encodeURIComponent(s)}`}function f({post:s}){return(0,e.jsxs)("div",{className:"blog-meta",children:[(0,e.jsxs)("span",{children:[(0,e.jsx)(L,{"aria-hidden":"true",size:14}),K(s.publishedAt)]}),(0,e.jsxs)("span",{children:[(0,e.jsx)(T,{"aria-hidden":"true",size:14}),O(s)," min read"]})]})}function y({post:s,featured:t=!1}){const n=s.category?.color?{"--blog-category":s.category.color}:void 0,l=q(s.slug);return t?(0,e.jsxs)(_,{appearance:"deep-glass",glow:"cyan",padding:"none",radius:"xl",className:"blog-featured",children:[(0,e.jsx)("div",{className:"blog-featured__media",children:s.heroImageUrl?(0,e.jsx)("img",{alt:s.heroImageAlt||"",src:s.heroImageUrl}):(0,e.jsx)(v,{"aria-hidden":"true",size:48})}),(0,e.jsxs)("div",{className:"blog-featured__content",children:[(0,e.jsx)("div",{className:"blog-post-card__category",style:n,children:s.category?.name||"Synergy Network"}),(0,e.jsx)("h2",{children:(0,e.jsx)(d,{to:l,children:s.title})}),(0,e.jsx)("p",{children:s.excerpt}),(0,e.jsx)(f,{post:s}),(0,e.jsxs)(d,{className:"sds-button sds-button--cyan sds-button--md",to:l,children:["Read article ",(0,e.jsx)(M,{"aria-hidden":"true",size:16})]})]})]}):(0,e.jsx)("article",{className:"blog-post-card",children:(0,e.jsxs)(_,{appearance:"inset",padding:"none",radius:"xl",children:[s.heroImageUrl?(0,e.jsx)(d,{"aria-label":`Read ${s.title}`,className:"blog-post-card__image-link",to:l,children:(0,e.jsx)("img",{alt:s.heroImageAlt||"",className:"blog-post-card__image",src:s.heroImageUrl})}):null,(0,e.jsxs)("div",{className:"blog-post-card__content",children:[(0,e.jsx)("div",{className:"blog-post-card__category",style:n,children:s.category?.name||"Synergy Network"}),(0,e.jsx)("h2",{children:(0,e.jsx)(d,{to:l,children:s.title})}),(0,e.jsx)("p",{children:s.excerpt}),(0,e.jsx)(f,{post:s}),(0,e.jsxs)(d,{className:"blog-post-card__link",to:l,children:["Read article ",(0,e.jsx)(U,{"aria-hidden":"true",size:16})]})]})]})})}function Y(){const[s,t]=(0,r.useState)([]),[n,l]=(0,r.useState)([]),[i,b]=(0,r.useState)(""),[o,x]=(0,r.useState)(!0),[c,j]=(0,r.useState)(""),[N,w]=(0,r.useState)(0);(0,r.useEffect)(()=>{let a=!1;const k=window.setTimeout(()=>{x(!0),j(""),Promise.all([$({category:i,limit:24}),E()]).then(([u,S])=>{a||(t(u.items),l(S))}).catch(u=>{a||j(u instanceof Error?u.message:"The blog could not be loaded.")}).finally(()=>{a||x(!1)})},0);return()=>{a=!0,window.clearTimeout(k)}},[i,N]);const h=(0,r.useMemo)(()=>s.find(a=>a.featured)||s[0]||null,[s]),g=(0,r.useMemo)(()=>s.filter(a=>a.id!==h?.id),[h,s]),p=s.length;return(0,e.jsxs)("main",{className:"blog-hub",children:[(0,e.jsxs)("section",{className:"blog-hub__masthead",children:[(0,e.jsxs)("div",{className:"blog-hub__intro",children:[(0,e.jsx)(A,{dot:!0,tone:"lime",children:"Synergy Blog"}),(0,e.jsxs)("h1",{children:["Building what comes",(0,e.jsx)("br",{}),(0,e.jsx)("em",{children:"after"})," ordinary blockchains."]}),(0,e.jsx)("p",{children:"Official protocol decisions, ecosystem dispatches, and product updatesâpublished directly by Synergy Network."})]}),(0,e.jsxs)("div",{className:"blog-hub__masthead-rail","aria-label":"Blog status",children:[(0,e.jsx)(v,{"aria-hidden":"true",size:25}),(0,e.jsxs)("div",{children:[(0,e.jsx)("span",{children:"Published blog"}),(0,e.jsx)("strong",{children:o?"Loading archive":`${p} ${p===1?"article":"articles"}`})]}),(0,e.jsx)("span",{className:"blog-hub__masthead-rule","aria-hidden":"true"}),(0,e.jsx)("p",{children:"Read the latest verified reports from the network."})]})]}),(0,e.jsxs)("section",{className:"blog-hub__controls","aria-label":"Blog categories",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("span",{children:"Browse by topic"}),(0,e.jsx)("strong",{children:i?n.find(a=>a.slug===i)?.name||"Selected category":"All published articles"})]}),(0,e.jsxs)("div",{className:"blog-hub__categories",role:"toolbar","aria-label":"Filter published articles",children:[(0,e.jsx)(m,{"aria-pressed":!i,onClick:()=>b(""),size:"sm",variant:i?"ghost":"cyan",children:"All articles"}),n.map(a=>(0,e.jsxs)(m,{"aria-pressed":i===a.slug,onClick:()=>b(a.slug),size:"sm",variant:i===a.slug?"cyan":"ghost",children:[a.name," ",(0,e.jsx)("span",{className:"blog-hub__category-count",children:a.publishedCount})]},a.id))]})]}),o?(0,e.jsxs)("div",{className:"blog-hub__status",role:"status",children:[(0,e.jsx)(I,{size:"sm"})," Loading published articlesâ¦"]}):null,c?(0,e.jsx)(P,{actions:(0,e.jsxs)(m,{onClick:()=>w(a=>a+1),size:"sm",variant:"cyan",children:[(0,e.jsx)(D,{"aria-hidden":"true",size:15})," Retry"]}),heading:"Blog unavailable",tone:"warning",children:c}):null,!o&&!c&&h?(0,e.jsxs)("section",{"aria-labelledby":"blog-featured-heading",className:"blog-hub__featured",children:[(0,e.jsxs)("div",{className:"blog-hub__section-heading",children:[(0,e.jsx)("p",{children:"Latest dispatch"}),(0,e.jsx)("h2",{id:"blog-featured-heading",children:"From the network."})]}),(0,e.jsx)(y,{featured:!0,post:h})]}):null,!o&&!c&&g.length?(0,e.jsxs)("section",{"aria-labelledby":"blog-archive-heading",className:"blog-hub__archive-section",children:[(0,e.jsxs)("div",{className:"blog-hub__section-heading blog-hub__section-heading--split",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{children:"Published archive"}),(0,e.jsx)("h2",{id:"blog-archive-heading",children:"Keep up with the work."})]}),(0,e.jsxs)("span",{children:[g.length," more ",g.length===1?"article":"articles"]})]}),(0,e.jsx)("div",{className:"blog-hub__archive",children:g.map(a=>(0,e.jsx)(y,{post:a},a.id))})]}):null,!o&&!c&&!s.length?(0,e.jsx)(R,{title:"No published articles in this category",description:"Choose another category to view the available official articles."}):null]})}export{Y as BlogPage};
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.