import{t as e}from"./cache-DUthuMSu.mjs";import{t}from"./parse-date-BdYTmLpo.mjs";import{t as n}from"./got-BBDj7u1e.mjs";import{load as r}from"cheerio";const i={path:`/materials/:id?`,categories:[`finance`],view:0,example:`/youzhiyouxing/materials`,parameters:{id:{description:`分类`,options:[{value:`0`,label:`全部`},{value:`4`,label:`知行小酒馆`},{value:`2`,label:`知行黑板报`},{value:`10`,label:`无人知晓`},{value:`1`,label:`孟岩专栏`},{value:`3`,label:`知行读书会`},{value:`11`,label:`你好，同路人`}],default:`0`}},features:{requireConfig:!1,requirePuppeteer:!1,antiCrawler:!1,supportBT:!1,supportPodcast:!1,supportScihub:!1},radar:[{source:[`youzhiyouxing.cn/materials`],target:`/materials`}],name:`有知文章`,maintainers:[`broven`,`Fatpandac`,`nczitzk`],handler:a,url:`youzhiyouxing.cn/materials`,description:`| 全部 | 知行小酒馆 | 知行黑板报 | 无人知晓 | 孟岩专栏 | 知行读书会 | 你好，同路人 |
| :--: | :--------: | :--------: | :------: | :------: | :--------: | :----------: |
|   0  |      4     |      2     |    10    |     1    |      3     |      11      |`};async function a(i){let a=i.req.param(`id`)??``,o=`https://youzhiyouxing.cn`,s=`${o}/materials?column_id=${a}`,c=r((await n({method:`get`,url:s})).data),l=c(`li[id*="material"]`).toArray().map(e=>(e=c(e),{title:e.text(),link:`${o}${e.find(`a`).attr(`href`)}`,pubDate:t(e.find(`.tw-text-t-muted`).text(),[`YYYY年M月D日`,`M月D日`])}));return l=await Promise.all(l.map(t=>e.tryGet(t.link,async()=>{let e=r((await n({method:`get`,url:t.link})).data);return t.author=e(`.tw-inline`).text().replace(`·`,``),t.description=e(`#zx-material-marker-root`).html().replaceAll(/(<img.*?) src(=.*?>)/g,`$1 data$2`).replaceAll(/(<img.*?) data-src(=.*?>)/g,`$1 src$2`),t}))),{title:`有知有行 - ${c(`a[phx-value-column_id="${a===``?0:a}"]`).text()}`,link:s,item:l}}export{i as route};