import{t as e}from"./ofetch-Dl6dVB_5.mjs";import{t}from"./cache-DUthuMSu.mjs";import{t as n}from"./parse-date-BdYTmLpo.mjs";import{t as r}from"./timezone-keeL11Io.mjs";import{Fragment as i,jsx as a,jsxs as o}from"hono/jsx/jsx-runtime";import{load as s}from"cheerio";import{renderToString as c}from"hono/jsx/dom/server";import{raw as l}from"hono/html";const u=({images:e,intro:t,description:n})=>c(o(i,{children:[e?.map(e=>e?.src?a(`figure`,{children:a(`img`,{src:e.src,alt:e.alt??void 0})}):null),t?a(`blockquote`,{children:t}):null,n?a(i,{children:l(n)}):null]})),d=async i=>{let{category:a=`thelatest`}=i.req.param(),o=Number.parseInt(i.req.query(`limit`)??`30`,10),c=new URL(a,`https://language.chinadaily.com.cn`).href,l=s(await e(c)),d=l(`html`).attr(`lang`)??`zh-CN`,f=l(`div.gy_box, ul.content_list li`).slice(0,o).toArray().map(e=>{let t=l(e),n=t.find(`a:not(.gy_box_img):not(.a_img)`).first(),r=n.text(),i=t.find(`a.gy_box_img img, a.a_img img`).attr(`src`),a=u({images:i?[{src:i,alt:r}]:void 0,intro:t.find(`p.gy_box_txt3 a`).text()}),o=n.attr(`href`);return{title:r,description:a,link:o?.startsWith(`//`)?`https:${o}`:o,content:{html:a,text:a},image:i,banner:i,language:d}});f=(await Promise.all(f.map(i=>i.link?t.tryGet(i.link,async()=>{let t=s(await e(i.link)),a=t(`meta[ property="og:title"]`).attr(`content`),o=t(`p.main_title3`).text().split(/\s/).pop(),c=t(`meta[name="keywords"]`).attr(`content`)?.split(/,/),l=t(`meta[name="source"], meta[name="author"], meta[name="editor"]`).toArray(),f=[...new Set(l.map(e=>t(e).attr(`content`)).filter(e=>e!==void 0))].map(e=>({name:e})),p=t(`meta[property="og:image"]`).attr(`content`),m=o,h={title:a,pubDate:o?r(n(o),8):i.pubDate,category:c,author:f,image:p,banner:p,updated:m?r(n(m),8):i.updated,language:d},g=t(`iframe#playerFrame, audio`).first().attr(`src`);g&&(h={...h,enclosure_url:g?.startsWith(`//`)?`https:${g}`:g,enclosure_title:a,enclosure_length:void 0,itunes_duration:void 0,itunes_item_image:p}),t(`div.urlShareArea`).remove();let _=i.description+u({description:t(`div#Content`).html()??void 0});return h={...h,description:_,content:{html:_,text:_}},{...i,...h}}):i))).filter(e=>!0);let p=l(`title`).text(),m=p.split(/-\s/).pop();return{title:p,description:l(`meta[name="description"]`).attr(`content`),link:c,item:f,allowEmpty:!0,image:l(`a.header2_logo1 img`).attr(`src`),author:m,language:d,itunes_author:m,itunes_category:`Language`,id:c}},f={path:`/language/:category{.+}?`,name:`英语点津`,url:`language.chinadaily.com.cn`,maintainers:[`nczitzk`],handler:d,example:`/chinadaily/language/thelatest`,parameters:{category:{description:"分类，默认为 `thelatest`，即精彩推荐，可在对应分类页 URL 中找到, Category, `thelatest`，即精彩推荐  by default",options:[{label:`精彩推荐`,value:`thelatest`},{label:`每日一词`,value:`news_hotwords/word_of_the_day`},{label:`双语新闻`,value:`news_bilingual`},{label:`新闻热词`,value:`news_hotwords`},{label:`实用口语`,value:`practice_tongue`},{label:`译词课堂`,value:`trans_collect`},{label:`图片新闻`,value:`news_photo`},{label:`视频精选`,value:`video_links`},{label:`新闻播报`,value:`audio_cd`},{label:`专栏作家`,value:`columnist`},{label:`权威发布`,value:`5af95d44a3103f6866ee845c`}]}},description:`::: tip
若订阅 [精彩推荐](https://language.chinadaily.com.cn/thelatest)，网址为 \`https://language.chinadaily.com.cn/thelatest\`，请截取 \`https://language.chinadaily.com.cn/\` 到末尾的部分 \`thelatest\` 作为 \`category\` 参数填入，此时目标路由为 [\`/chinadaily/language/thelatest\`](https://rsshub.app/chinadaily/language/thelatest)。
:::

<details>
  <summary>更多分类</summary>

| 分类                                                                         | ID                                                                                                    |
| ---------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| [精彩推荐](https://language.chinadaily.com.cn/thelatest)                     | [thelatest](https://rsshub.app/chinadaily/language/thelatest)                                         |
| [每日一词](https://language.chinadaily.com.cn/news_hotwords/word_of_the_day) | [news_hotwords/word_of_the_day](https://rsshub.app/chinadaily/language/news_hotwords/word_of_the_day) |
| [双语新闻](https://language.chinadaily.com.cn/news_bilingual)                | [news_bilingual](https://rsshub.app/chinadaily/language/news_bilingual)                               |
| [新闻热词](https://language.chinadaily.com.cn/news_hotwords)                 | [news_hotwords](https://rsshub.app/chinadaily/language/news_hotwords)                                 |
| [实用口语](https://language.chinadaily.com.cn/practice_tongue)               | [practice_tongue](https://rsshub.app/chinadaily/language/practice_tongue)                             |
| [译词课堂](https://language.chinadaily.com.cn/trans_collect)                 | [trans_collect](https://rsshub.app/chinadaily/language/trans_collect)                                 |
| [图片新闻](https://language.chinadaily.com.cn/news_photo)                    | [news_photo](https://rsshub.app/chinadaily/language/news_photo)                                       |
| [视频精选](https://language.chinadaily.com.cn/video_links)                   | [video_links](https://rsshub.app/chinadaily/language/video_links)                                     |
| [新闻播报](https://language.chinadaily.com.cn/audio_cd)                      | [audio_cd](https://rsshub.app/chinadaily/language/audio_cd)                                           |
| [专栏作家](https://language.chinadaily.com.cn/columnist)                     | [audio_cd](https://rsshub.app/chinadaily/language/columnist)                                          |
| [权威发布](https://language.chinadaily.com.cn/5af95d44a3103f6866ee845c)      | [5af95d44a3103f6866ee845c](https://rsshub.app/chinadaily/language/5af95d44a3103f6866ee845c)           |

</details>
`,categories:[`traditional-media`],features:{requireConfig:!1,requirePuppeteer:!1,antiCrawler:!1,supportRadar:!0,supportBT:!1,supportPodcast:!0,supportScihub:!1},radar:[{source:[`language.chinadaily.com.cn/:category`],target:e=>{let t=e.category;return`/chinadaily/language${t?`/${t}`:``}`}},{title:`精彩推荐`,source:[`language.chinadaily.com.cn/thelatest`],target:`/language/thelatest`},{title:`每日一词`,source:[`language.chinadaily.com.cn/news_hotwords/word_of_the_day`],target:`/language/news_hotwords/word_of_the_day`},{title:`双语新闻`,source:[`language.chinadaily.com.cn/news_bilingual`],target:`/language/news_bilingual`},{title:`新闻热词`,source:[`language.chinadaily.com.cn/news_hotwords`],target:`/language/news_hotwords`},{title:`实用口语`,source:[`language.chinadaily.com.cn/practice_tongue`],target:`/language/practice_tongue`},{title:`译词课堂`,source:[`language.chinadaily.com.cn/trans_collect`],target:`/language/trans_collect`},{title:`图片新闻`,source:[`language.chinadaily.com.cn/news_photo`],target:`/language/news_photo`},{title:`视频精选`,source:[`language.chinadaily.com.cn/video_links`],target:`/language/video_links`},{title:`新闻播报`,source:[`language.chinadaily.com.cn/audio_cd`],target:`/language/audio_cd`},{title:`专栏作家`,source:[`language.chinadaily.com.cn/columnist`],target:`/language/columnist`},{title:`权威发布`,source:[`language.chinadaily.com.cn/5af95d44a3103f6866ee845c`],target:`/language/5af95d44a3103f6866ee845c`}],view:0};export{d as handler,f as route};