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{load as r}from"cheerio";const i=async i=>{let a=Number.parseInt(i.req.query(`limit`)??`30`,10),o=`https://kiro.dev`,s=new URL(`changelog/`,o).href,c=r(await e(s)),l=c(`html`).attr(`lang`)??`en`,u=c(`a.block`).slice(0,a).toArray().map(e=>{let t=c(e),r=`${t.parent().find(`span`).text()} ${t.find(`h3`).text()}`,i=t.parent().parent().find(`div.prose`).html()??void 0,a=t.parent().parent().parent().find(`time`).text(),s=t.attr(`href`),u=a;return{title:r,description:i,pubDate:a?n(a):void 0,link:s?new URL(s,o).href:void 0,content:{html:i,text:i},updated:u?n(u):void 0,language:l}});return u=await Promise.all(u.map(i=>i.link?t.tryGet(i.link,async()=>{let t=r(await e(i.link)),a=`${t(`article span`).first().text()} ${t(`article h3`).text()}`,o=t(`div.prose`).html()??void 0,s=t(`time`).text(),c=t(`meta[property="og:image"]`).attr(`content`),u=s,d={title:a,description:o,pubDate:s?n(s):i.pubDate,content:{html:o,text:o},image:c,banner:c,updated:u?n(u):i.updated,language:l};return{...i,...d}}):i)),{title:c(`title`).text(),description:c(`meta[property="og:description"]`).attr(`content`),link:s,item:u,allowEmpty:!0,image:c(`meta[property="og:image"]`).attr(`content`),author:c(`meta[property="og:site_name"]`).attr(`content`),language:l,id:s}},a={path:`/changelog`,name:`Changelog`,url:`kiro.dev`,maintainers:[`nczitzk`],handler:i,example:`/kiro/changelog`,parameters:void 0,description:void 0,categories:[`program-update`],features:{requireConfig:!1,requirePuppeteer:!1,antiCrawler:!1,supportRadar:!0,supportBT:!1,supportPodcast:!1,supportScihub:!1},radar:[{source:[`kiro.dev`,`kiro.dev/changelog/`],target:`/changelog`}],view:0};export{i as handler,a as route};