1import{a as I,r as i,Q as L,P as S,y,z as M,m as g,g as d,e as P,E as _,w as R,l as V,b as h,a5 as O,f as v,j as T,_ as E}from"./DvZ2m6ok.js";import x from"./COpY_pC1.js";import F from"./woC3rRvz.js";import U from"./DYAdqQDx.js";import"./DTDMDQtn.js";import{u as $}from"./DHz8wIDK.js";import"./BVL1uAvx.js";import"./B0zDw-0K.js";import"./DPiJMyXm.js";import"./CqiGQnYk.js";import"./DMGKMEg3.js";import"./uWNB0wcE.js";import"./O0GmKXjU.js";import"./DtBP_0sx.js";import"./Drb_Rldx.js";import"./ColGyzY9.js";const j={key:1,class:"myarea-card"},z={key:2,class:"load-more-wrapper"},f=20,D=I({__name:"index",async setup(Q){let l,n;$();const c=L();O();const a=i(c.query.category?Number(c.query.category):null),r=i([]),u=i(!1),p=i(new Set([0])),o=i(!0),{data:k}=([l,n]=S(()=>h("/articles/carousel")),l=await l,n(),l);i(k.value??[]),y(()=>c.path==="/"),M(()=>c.query.category,(e,t)=>{e!==t&&(a.value=e?Number(e):null,q())});async function C(){try{const e=new URLSearchParams({limit:String(f),offset:"0"});a.value&&e.append("category_id",String(a.value));const{data:t}=await h(`/articles?${e.toString()}`),s=Array.isArray(t.value)?t.value:[];r.value=s,s.length<f&&(o.value=!1)}catch{r.value=[]}}[l,n]=S(()=>C()),await l,n();function q(){r.value=[],p.value=new Set([0]),o.value=!0,A(0,a.value),window.scrollTo(0,0)}async function A(e,t=null){if(!(u.value||!o.value)){u.value=!0;try{const s=new URLSearchParams({limit:String(f),offset:String(e)});t&&s.append("category_id",String(t));const{data:w}=await h(`/articles?${s.toString()}`),m=Array.isArray(w.value)?w.value:[];m.length<f&&(o.value=!1),m.length>0&&(r.value=e===0?m:[...r.value,...m],p.value.add(e))}finally{u.value=!1}}}function N(){const e=r.value.length;p.value.has(e)||A(e,a.value)}const b=y(()=>r.value.slice(0,3)),B=y(()=>r.value.slice(3));return(e,t)=>(v(),g("div",null,[d(x,{initialArticles:b.value},null,8,["initialArticles"]),a.value!==null?(v(),P(U,{key:0,"category-id":a.value},null,8,["category-id"])):_("",!0),a.value?_("",!0):(v(),g("div",j,[d(F)])),d(x,{initialArticles:B.value,startOffset:3,categoryId:a.value},null,8,["initialArticles","categoryId"]),o.value?(v(),g("div",z,[d(V,{variant:"outlined",color:"primary",loading:u.value,block:"",onClick:N},{default:R(()=>t[0]||(t[0]=[T("ãã£ã¨è¦ã")])),_:1},8,["loading"])])):_("",!0)]))}}),ne=E(D,[["__scopeId","data-v-77a2aed0"]]);export{ne 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.