import{t as e}from"./ofetch-Dl6dVB_5.mjs";import{t}from"./parse-date-BdYTmLpo.mjs";const n={0:{title:`全部`,slug:``,id:0},1:{title:`要闻`,slug:`news`,id:101},2:{title:`商业`,slug:`finance`,id:108},3:{title:`快讯`,slug:`lifestyle`,id:106},8:{title:`财富`,slug:`finance`,id:108},6:{title:`生活`,slug:`lifestyle`,id:106}},r={path:`/:category?`,categories:[`new-media`],example:`/caus`,parameters:{category:`分类，见下表，默认为全部`},features:{requireConfig:!1,requirePuppeteer:!1,antiCrawler:!1,supportBT:!1,supportPodcast:!1,supportScihub:!1},name:`分类`,maintainers:[`nczitzk`,`pseudoyu`],handler:i,description:`| 全部 | 要闻 | 商业 | 快讯 | 财富 | 生活 |
| ---- | ---- | ---- | ---- | ---- | ---- |
| 0    | 1    | 2    | 3    | 8    | 6    |`};async function i(r){let i=n[r.req.param(`category`)||`0`]||n[0],a=`https://caus.com`,o=`${a}/wp-json/wp/v2/posts`,s={per_page:20,_embed:`author,wp:term`};i.id&&(s.categories=i.id);let c=(await e(o,{query:s})).map(e=>({title:e.title.rendered,link:e.link,description:e.content.rendered,pubDate:t(e.date_gmt),author:e._embedded?.author?.[0]?.name,category:e._embedded?.[`wp:term`]?.[0]?.map(e=>e.name)})),l=i.slug?`${a}/category/${i.slug}/`:a;return{title:`${i.title} - 加美财经`,link:l,item:c}}export{r as route};