1import{d as N,u as F,a3 as L,o as a,c as i,F as M,m as l,D as u,j as y,l as h,f as t,e as g,q as T,p as v,k as H,T as S,g as k,M as w,_ as V,s as I,r as C,i as D,a5 as U,w as A,t as q,a as j}from"./BQIE75eK.js";import{u as z}from"./CrPUGc-D.js";import{_ as R}from"./BK6_9FE4.js";import{f as Q,g as W,a as P,F as B,b as G}from"./aITtCVgB.js";import{a as Y,u as J}from"./HCHRiIe0.js";import{S as K}from"./Dc52MYiQ.js";import{_ as O}from"./DKN481pw.js";import{_ as X}from"./C-d_efNh.js";import{a as E}from"./Dh-6RZTZ.js";import{_ as Z}from"./DrqDoF56.js";import{u as ee}from"./CFh6ZAub.js";import"./bH8vGOJ-.js";import"./DwCJcHO-.js";import"./xNrvDHIw.js";import"./DLwvYgdZ.js";import"./DhBs_wBa.js";import"./BcmFhtS7.js";import"./Dj4MUURy.js";import"./CVe8w9kw.js";import"./BgXNj_I8.js";import"./DS5tOlR3.js";import"./xsgx1dhO.js";try{let e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="a81ea28f-8b5d-468d-85c2-3d540d861ef2",e._sentryDebugIdIdentifier="sentry-dbid-a81ea28f-8b5d-468d-85c2-3d540d861ef2")}catch{}const te={class:"flex gap-2","data-testid":"flash-news-card"},se={class:"flex w-11 flex-col items-center"},ae={key:0,class:"h-5 w-px bg-ct-ds-border-default"},le=["datetime"],ne={key:1,class:"w-px flex-1 bg-ct-ds-border-default"},oe={class:"text-base/6 font-semibold"},ie={class:"flex flex-col gap-2 py-2"},re=["innerHTML"],ce=["href"],de={key:1,class:"inline-flex items-center gap-1 text-xs font-medium text-ct-ds-fg-default","data-testid":"flash-news-card__source-name"},me=N({__name:"FlashNewsCard",props:{item:{},first:{type:Boolean,default:!1},last:{type:Boolean,default:!1}},setup(e){const s=F(),f=L(),r=ee().host||void 0,d=k(()=>Q(e.item.publishedAt,f.value)),m=k(()=>W(e.item.description,r)),o=w(!1),_=c=>{c.preventDefault(),e.item.sourceUrl&&(o.value=!0)},b=()=>{e.item.sourceUrl&&window.open(e.item.sourceUrl,"_blank"),o.value=!1},p=()=>{o.value=!1};return(c,n)=>{const x=V;return a(),i(M,null,[l("article",te,[l("div",se,[e.first?u("",!0):(a(),i("div",ae)),l("time",{datetime:e.item.publishedAt,class:y(["flex h-6 w-full items-center justify-center rounded-full border text-xs font-medium",e.item.isImportant?"border-ct-ds-border-clear bg-ct-ds-accent-primary-default text-black":"border-ct-ds-border-default text-ct-ds-fg-default"]),"data-testid":"flash-news-card__time"},h(t(d)),11,le),e.last?u("",!0):(a(),i("div",ne))]),l("div",{class:y(["flex min-w-0 flex-1 flex-col pb-3",e.first?"pt-0":"pt-5",!e.last&&"border-b border-ct-ds-border-default"])},[l("h3",oe,[g(x,{to:`/flash-news/${e.item.slug}`,class:y(["hover:underline",e.item.isImportant?"rounded-sm bg-ct-ds-accent-primary-default box-decoration-clone px-1 py-[0.2rem] text-black":"text-ct-ds-fg-strong"]),"data-testid":"flash-news-card__title"},{default:T(()=>[e.item.isImportant?(a(),v(t(E),{key:0,name:"comm-fire",size:20,class:"mr-0.5 align-text-bottom"})):u("",!0),H(" "+h(e.item.title),1)]),_:1},8,["to","class"])]),l("div",ie,[l("div",{class:"line-clamp-2 text-xs font-normal tracking-lean text-ct-ds-fg-default opacity-90 tablet:text-sm/5.5","data-testid":"flash-news-card__description",innerHTML:t(m)},null,8,re),e.item.sourceUrl?(a(),i("a",{key:0,href:e.item.sourceUrl,target:"_blank",rel:"nofollow",class:"inline-flex items-center gap-1 text-xs font-medium text-ct-ds-fg-default","data-testid":"flash-news-card__source-link",onClick:_},[g(t(E),{name:"app-editor-link",size:16}),l("span",null,h(e.item.sourceName),1)],8,ce)):(a(),i("span",de,h(e.item.sourceName),1))])],2)]),g(t(Z),{modelValue:t(o),"onUpdate:modelValue":n[0]||(n[0]=$=>S(o)?o.value=$:null),title:t(s).t("flash-news.external-source-modal.title"),description:t(s).t("flash-news.external-source-modal.description"),"confirm-text":t(s).t("flash-news.external-source-modal.open-button"),"cancel-text":t(s).t("flash-news.external-source-modal.stay-button"),onConfirm:b,onCancel:p},null,8,["modelValue","title","description","confirm-text","cancel-text"])],64)}}}),fe={class:"pb-5","data-testid":"flash-news-disclaimer"},ue={class:"border-b border-ct-ds-border-default pb-5"},he={class:"text-sm font-medium text-ct-ds-fg-strong tablet:text-base/6 desktop:tracking-lean","data-testid":"flash-news-disclaimer__text"},xe=N({__name:"FlashNewsDisclaimer",setup(e){const s=F();return(f,r)=>(a(),i("div",fe,[l("div",ue,[l("p",he,h(t(s).t("flash-news.disclaimer")),1)])]))}}),_e=async(e={})=>{const s=e.perPage??10,{client:f}=Y(),r=w([]),d=w(null),m=w(!1),o=w(!1),{data:_,error:b}=await J({query:P,variables:{last:s,before:null},context:{requestPolicy:"cache-first"}});return I(_,c=>{const n=c?.flashNews;n&&(r.value=n.items.map(x=>C(B,x)),d.value=n.next??null,m.value=!!n.next)},{immediate:!0}),{items:r,hasNextPage:m,loadingMore:o,loadMore:async()=>
1{if(!(o.value||!m.value||!d.value)){o.value=!0;try{const n=(await f.query(P,{last:s,before:d.value},{requestPolicy:"cache-first"}).toPromise()).data?.flashNews;if(!n)return;r.value=[...r.value,...n.items.map(x=>C(B,x))],d.value=n.next??null,m.value=!!n.next}finally{o.value=!1}}},error:b}},ge={class:"flex flex-col gap-8","data-testid":"flash-news-list"},be={key:0,class:"py-10 text-center text-ct-ds-fg-muted","data-testid":"flash-news-list__empty"},pe={key:1,class:"flex flex-col gap-8"},we=["data-testid"],ye={class:"flex flex-col"},ke={key:2,class:"pb-10"},ve={key:3,class:"flex justify-center pb-10 text-ct-ds-fg-muted","data-testid":"flash-news-list__no-more"},Ne=N({__name:"FlashNewsList",props:{items:{},loadingMore:{type:Boolean},hasNextPage:{type:Boolean}},emits:["loadMore"],setup(e,{emit:s}){const f=s,r=F(),d=L(),m=k(()=>G(e.items,d.value)),o=k(()=>!e.loadingMore&&e.items.length===0),_=k(()=>!e.loadingMore&&!e.hasNextPage&&e.items.length>0);return(b,p)=>(a(),i("div",ge,[t(o)?(a(),i("p",be,h(t(r).t("flash-news.empty")),1)):u("",!0),t(m).length>0?(a(),i("div",pe,[(a(!0),i(M,null,D(t(m),(c,n)=>(a(),i("section",{key:c.date},[l("h2",{class:y(["text-xl/6 font-semibold tracking-lean text-ct-ds-fg-strong desktop:text-2xl desktop:tracking-normal",n===0?"mb-5":"mb-6"]),"data-testid":`flash-news-list__date--${n}`},h(c.date),11,we),n===0?(a(),v(t(xe),{key:0})):u("",!0),l("div",ye,[(a(!0),i(M,null,D(c.items,(x,$)=>(a(),v(t(me),{key:x.slug,item:x,first:$===0,last:$===c.items.length-1},null,8,["item","first","last"]))),128))])]))),128))])):u("",!0),e.hasNextPage||e.loadingMore?(a(),i("footer",ke,[g(t(X),{loading:e.loadingMore,"data-testid":"flash-news-list__load-more",onLoadMore:p[0]||(p[0]=c=>f("loadMore"))},null,8,["loading"])])):u("",!0),t(_)?(a(),i("p",ve,h(t(r).t("flash-news.no-more-content")),1)):u("",!0)]))}}),$e={class:"container pt-4 pb-10","data-testid":"flash-news-page"},Me={class:"flex min-w-0 flex-1 flex-col"},Fe={class:"mb-5 tablet:mb-8"},Ce={class:"text-xl/tighter font-semibold tracking-leaner text-ct-ds-fg-strong tablet:text-2xl/tighter desktop:text-3xl/tighter desktop:tracking-normal","data-testid":"flash-news-page__title"},De=N({__name:"FlashNewsPage",async setup(e){let s,f;const r=F(),d=U(),{items:m,hasNextPage:o,loadingMore:_,loadMore:b}=([s,f]=A(()=>_e()),s=await s,f(),s);return(p,c)=>(a(),i(M,null,[g(t(K)),l("div",$e,[g(t(R),{placement:"leaderboard",class:"mb-5 tablet:mb-8"}),l("div",{class:y(t(d).isDesktop&&"flex items-start justify-between gap-10")},[l("div",Me,[l("header",Fe,[l("h1",Ce,h(t(r).t("flash-news.main-title")),1)]),g(Ne,{items:t(m),"loading-more":t(_),"has-next-page":t(o),onLoadMore:t(b)},null,8,["items","loading-more","has-next-page","onLoadMore"])]),t(d).isDesktop?(a(),v(t(O),{key:0})):u("",!0)],2)])],64))}}),Xe=N({__name:"index",setup(e){const s=z("show_flash_news");return q(s)||j({notFoundMessage:"flash news list not found"}),(f,r)=>(a(),v(t(De)))}});export{Xe 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.