1import{_ as O}from"./pavanVpq.js";import{_ as R}from"./CYfjXOEd.js";import{_ as D}from"./BNVJQ_Jn.js";import{_ as j}from"./DRHNlYNM.js";import{a6 as r,ao as e,aB as w,Z as o,j as m,h as $,aF as f,o as v,n as x,L as A,i as g,F as E,a7 as F,ah as P,av as S}from"./DLbABYnb.js";import{u as T}from"./C4_QyQ5x.js";import{u as V}from"./CTfXv1NM.js";import"./DbHSgv2O.js";import"./oBp65Ksk.js";import"./Cpj98o6Y.js";import"./Der3YjJ3.js";import"./SwV2H2nh.js";import"./DyG2fEZ9.js";const Z={class:"news-listing"},K={key:1,class:"reiv-container mb-8 grid grid-cols-1 gap-8 md:grid-cols-2 xl:grid-cols-3"},U={key:2,class:"mb-8 flex items-center justify-center bg-neutral-light-tenth p-8"},Y={key:3,class:"my-8 text-center"},se={__name:"NewsListing",props:{blok:{type:Object,default:()=>({})},data:{type:Object,default:()=>({articlesPending:!1,articles:[],totalCount:0})}},setup(u){const n=u,b=S(),C=Date.now(),t=r([...e(n?.data?.articles?n?.data?.articles:[])]),h=r(n?.data?.totalCount),c=r(1),k=r(12),i=r(""),_=r(!1);async function N(){const{getReleaseParam:s}=T(),{data:a,error:p}=await V(async()=>{const d=await $fetch.raw(`${b.public.STORYBLOK_API_URL}/stories?starts_with=our-industry/news&content_type=NewsDetail&excluding_fields=body&sort_by=first_published_at:desc&per_page=${n.blok.feature_latest_article&&c.value===1?k.value+1:k.value}&page=${c.value}&version=${b.public.NUXT_ENV==="development"?"draft":"published"}&token=${b.public.STORYBLOK_KEY}&cv=${C}`+(s()||"&filter_query[title][is]=not_empty"));return{...d._data,total_count:parseInt(d.headers.get("total"))}},"$p2gZoUlbyM");return p.value||!a?.value?{error:p.value||"Error fetching news articles."}:{data:a}}async function y(){_.value=!0,c.value===1&&(i.value="Loading news articles...");try{const{data:s,error:a}=await N();if(a)throw a;h.value=s.value.total_count,s.value.stories?.length?(i.value="",t.value.push(...s.value.stories)):i.value="Could not find any more news articles."}catch(s){console.error(s),i.value=s}_.value=!1}return w(()=>n.data,()=>{t.value=[...n?.data?.articles],h.value=n.data.totalCount},{deep:!0}),w(c,()=>{y()}),!n?.data?.articlesPending&&!t.value.length&&y(),(s,a)=>{const p=O,d=R,B=D,L=j;return o(),m("section",Z,[e(t).length&&u.blok.feature_latest_article?(o(),$(B,{key:0,class:"mb-8 md:col-span-2 xl:col-span-3",blok:{heading:e(t)[0].content.title,description:e(t)[0].content.snippet,background_color:"neutral-light",image:u.blok.feature_image,wide_card:!0}},{sub_heading:f(()=>[v(p,{class:A(["mt-4 text-xs",e(t)[0].content.snippet||"mb-4"]),datetime:e(t)[0].meta_data?.migrated_from==="kentico"?e(t)[0].first_published_at.replace(/Z$/,"+10:00"):e(t)[0].first_published_at},null,8,["class","datetime"])]),default:f(()=>[v(d,{class:"mt-8 inline-block","nuxt-link":"/"+e(t)[0].full_slug},{default:f(()=>[...a[1]||(a[1]=[x("Read more",-1)])]),_:1},8,["nuxt-link"])]),_:1},8,["blok"])):g("",!0),u.blok.feature_latest_article&&e(t).length>1||e(t).length?(o(),m("div",K,[(o(!0),m(E,null,F(e(t).slice(u.blok.feature_latest_article?1:0),l=>(o(),$(L,{key:l.id,title:l.content.title,datetime:l.meta_data?.migrated_from==="kentico"?l.first_published_at.replace(/Z$/,"+10:00"):l.first_published_at,snippet:l.content.snippet,slug:l.full_slug},null,8,["title","datetime","snippet","slug"]))),128))])):g("",!0),e(i)?(o(),m("p",U,P(e(i)),1)):g("",!0),e(t).length&&e(h)>e(t).length?(o(),m("div",Y,[v(d,{disabled:e(_),"show-spinner":e(_),"use-spinner":"",onClick:a[0]||(a[0]=l=>c.value++)},{default:f(()=>[...a[2]||(a[2]=[x(" Load more articles ",-1)])]),_:1},8,["disabled","show-spinner"])])):g("",!0)])}}};export{se 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.