1import{P as B,c as G}from"../chunks/page_settings.wQR04nIy.js";import{k as Q,a as T,L as W}from"../chunks/Loading.SFBe-MN4.js";import{g as H}from"../chunks/runtime.C1AkxtCQ.js";import{e as F}from"../chunks/index.g5YcAAdQ.js";import{t as I,e as v,d as J,b as V,f as X}from"../chunks/disclose-version.CTolbDz-.js";import{a1 as Y,ah as L,a7 as Z,K as j,x as t,a2 as d,a4 as $,a6 as g,a3 as C,y as x,a5 as tt}from"../chunks/runtime.xahfhZnB.js";import{e as et,i as at}from"../chunks/attributes.rBD47DPj.js";import{s as ot,p as _,a as rt}from"../chunks/store.B-43Gd6y.js";/* empty css */import{p as st}from"../chunks/stores.C3HlVqG_.js";import{o as it}from"../chunks/index-client.B-G9cTOh.js";import{c as nt,d as ct}from"../chunks/utils.BzubWJxs.js";import{g as gt}from"../chunks/entry.RzYF83DH.js";import{P as lt}from"../chunks/Pagination.DlvO-V3k.js";import{L as pt}from"../chunks/ListRow.kVbQa-TG.js";const dt=async({url:m,fetch:s,parent:h})=>{const l=B().NEWS.supportedLangs;if(!(!l||l.includes(H())))throw F(404,"Not Found");const i=30,{layoutPromise:f}=await h(),r=m.searchParams.get("p");let n=null;if(r){let e=[];await f?.then(a=>{e=a?.categories||[],n=e.find(o=>o.slug===r)?.topics_id})}return{listPromise:(async()=>{try{const e=m.searchParams.get("page")||"1",a={endpoint:"categorized-news",apiId:G,cnt:i,pageID:e};r&&r!=="all"&&(a.filter=`categories.module_id contains ${n}`);const{list:o,pageInfo:p}=await Q.getContents(a,s);return{list:o,pageNo:Number(e),totalPage:Math.ceil(p.totalCnt/i)}}catch{return null}})()}},Ft=Object.freeze(Object.defineProperty({__proto__:null,load:dt},Symbol.toStringTag,{value:"Module"}));var mt=I("<li><!></li>"),ut=I('<div class="category-news svelte-1bjx9sg"><div class="filtered-list line-deco svelte-1bjx9sg"><h2 class="filtered-list__title svelte-1bjx9sg"> </h2> <ul></ul></div> <!></div>'),ft=I("<div><!></div>");function Ot(m,s){Y(s,!0);const h=ot(),l=()=>rt(st,"$page",h);let u,i=L(_([])),f=L(""),r=L("");it(async()=>{j(r,_(l().url.pathname)),u=l().url.searchParams;const e=u.get("p"),a=u.get("page");await s.data.layoutPromise?.then(o=>{o&&(j(i,_(o.categories)),j(f,_(t(i).find(p=>p.slug===e)?.subject||"")))}),await s.data.listPromise.then(o=>{if(!o||a==="0")throw gt("/404.html"),F(404,"Not Found")})});var n=ft(),S=d(n);T(S,()=>s.data.listPromise,e=>{W(e)},(e,a)=>{var o=J(),p=$(o);{var O=y=>{var P=ut(),b=d(P),w=d(b),K=d(w,!0);g(w);var k=C(w,2);et(k,21,()=>t(a).list,at,(z,c)=>{var N=mt();const A=x(()=>t(c).categories.map(U=>t(i).find(q=>q.topics_id===U.module_id)?.subject||"")),D=x(()=>nt(t(c).ymd));var E=d(N),R=x(()=>ct(t(c).ymd));pt(E,{get topics_id(){return t(c).topics_id},get slug(){return t(c).slug},get ymd(){return t(R)},get categories(){return t(A)},get subject(){return t(c).subject},get isNew(){return t(D)}}),g(N),v(z,N)}),g(k),g(b);var M=C(b,2);lt(M,{get totalPage(){return t(a).totalPage},get pageNo(){return t(a).pageNo},get pagePath(){return t(r)}}),g(P),tt(()=>X(K,t(f))),v(y,P)};V(p,y=>{t(a)&&y(O)})}v(e,o)}),g(n),v(m,n),Z()}export{Ot as component,Ft as universal};
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.