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:`/news/:category?`,categories:[`government`],example:`/whitehouse/news`,parameters:{category:`Category, see below, all by default`},features:{requireConfig:!1,requirePuppeteer:!1,antiCrawler:!1,supportBT:!1,supportPodcast:!1,supportScihub:!1},radar:[{source:[`whitehouse.gov/:category`,`whitehouse.gov/`],target:`/news/:category`}],name:`News`,maintainers:[`nczitzk`,`hkamran80`],handler:a,description:`| All | Articles | Briefings and Statements | Presidential Actions | Remarks |
| --- | -------- | ------------------------ | -------------------- | ------- |
|     | articles | briefings-statements     | presidential-actions | remarks |`};async function a(i){let a=`https://www.whitehouse.gov/${i.req.param(`category`)??`news`}/`,o=r((await n({method:`get`,url:a})).data),s=o(`.post`).toArray().map(e=>{e=o(e);let n=e.find(`a`).first();return{title:n.text(),link:n.attr(`href`),pubDate:t(e.find(`time`).attr(`datetime`)),category:[e.find(`a[rel^=tag]`).first().text()]}}),c=await Promise.all(s.map(t=>e.tryGet(t.link,async()=>{let e=r((await n({method:`get`,url:t.link})).data);return e(`.wp-block-whitehouse-topper`).remove(),t.description=e(`.entry-content`).html(),t})));return{title:o(`title`).text(),link:a,item:c}}export{i as route};