import{t as e}from"./timezone-keeL11Io.mjs";import{n as t}from"./playwright-1-2p8zlN.mjs";import{load as n}from"cheerio";const r={path:`/lordslibrary/type/:topic?`,categories:[`government`],example:`/parliament.uk/lordslibrary/type/research-briefing`,parameters:{topic:`research by topic, string, example: [research-briefing|buisness|economy]`},features:{requireConfig:!1,requirePuppeteer:!0,antiCrawler:!1,supportBT:!1,supportPodcast:!1,supportScihub:!1},name:`House of Lords Library`,maintainers:[`AntiKnot`],handler:i};async function i(r){let{topic:i}=r.req.param(),a=`https://lordslibrary.parliament.uk/type/${i}/`,o=await t(),s=await o.newPage();await s.setRequestInterception(!0),s.on(`request`,e=>{e.resourceType()===`document`?e.continue():e.abort()}),await s.goto(a,{waitUntil:`domcontentloaded`});let c=await s.evaluate(()=>document.documentElement.innerHTML);await s.close();let l=n(c),u=l(`div.l-box.l-box--no-border.card__text`).toArray().map(t=>({title:l(t).find(`.card__text a`).text().trim(),link:l(t).find(`.card__text a`).attr(`href`),description:l(t).find(`p`).last().text().trim(),pubDate:e(l(t).find(`.card__date time`).attr(`datetime`))}));return await o.close(),{title:`parliament - lordslibrary - ${i}`,link:a,item:u}}export{r as route};