import{t as e}from"./cache-DUthuMSu.mjs";import{t}from"./parse-date-BdYTmLpo.mjs";import{t as n}from"./got-BBDj7u1e.mjs";import{n as r,t as i}from"./utils-DQygUH812.mjs";import{load as a}from"cheerio";const o={path:`/top/:type`,categories:[`design`],view:2,example:`/zcool/top/design`,parameters:{type:{description:`推荐类型`,options:[{value:`design`,label:`作品榜单`},{value:`article`,label:`文章榜单`}]}},features:{requireConfig:!1,requirePuppeteer:!1,antiCrawler:!1,supportBT:!1,supportPodcast:!1,supportScihub:!1},name:`作品总榜单`,maintainers:[`yuuow`],handler:s};async function s(o){let s=`https://www.zcool.com.cn/top/${o.req.param(`type`)===`design`?`index.do`:`article.do?rankType=8`}`,{data:c}=await n(s),l=a(c),u=JSON.parse(l(`script#__NEXT_DATA__`).text()),d=u.props.pageProps.listResult.data.map(e=>({title:e.rankingTitle,author:e.member.name,category:[e.productCategoryStr,e.productSubCateStr,...e.tags],link:e.pageUrl,pubDate:t(e.rankingPublishTime)})),f=await Promise.all(d.map(o=>e.tryGet(o.link,async()=>{let{data:e}=await n(o.link),s=a(e),c=JSON.parse(s(`script#__NEXT_DATA__`).text());return o.pubDate=t(c.props.pageProps.data.publishTime,`x`),o.link.startsWith(`https://www.zcool.com.cn/article/`)?o.description=i(c):o.link.startsWith(`https://www.zcool.com.cn/work/`)&&(o.description=r(c)),o})));return{title:u.props.pageProps.seo.title,description:u.props.pageProps.seo.description,link:s,item:f}}export{o as route};