import{t as e}from"./parse-date-BdYTmLpo.mjs";import{t}from"./got-BBDj7u1e.mjs";import{Fragment as n,jsx as r,jsxs as i}from"hono/jsx/jsx-runtime";import{load as a}from"cheerio";import{renderToString as o}from"hono/jsx/dom/server";const s={path:`/:category?`,radar:[{source:[`xyzrank.com/`],target:``}],name:`Unknown`,maintainers:[],handler:c,url:`xyzrank.com/`};async function c(s){let c=s.req.param(`category`)??``,l=`https://xyzrank.com`,u=`${l}/#/${c}`,d=await t({method:`get`,url:l}),f=a(d.data);d=await t({method:`get`,url:d.data.match(/<script type="module" crossorigin src="(.*?)"><\/script>/)[1]});let p=d.data.match(/pI="(.*?)",gI="(.*?)",mI="(.*?)",_I="(.*?)";var/),m={"":{url:p[3],title:`热门节目`,id:`hot-episodes`,type:`episodes`},"hot-podcasts":{url:p[1],title:`热门播客`,id:`full`,type:`podcasts`},"hot-episodes-new":{url:p[4],title:`新锐节目`,id:`hot-episodes-new`,type:`episodes`},"new-podcasts":{url:p[2],title:`新锐播客`,id:`new-podcasts`,type:`podcasts`}};d=await t({method:`get`,url:m[c].url});let h=m[c].type,g=d.data.data[h].slice(0,s.req.query(`limit`)?Number.parseInt(s.req.query(`limit`)):250).map((t,a)=>({title:`#${a+1} ${t.title??t.name}`,category:[t.primaryGenreName],author:t.authorsText,link:`${t.link??t.links[0].url}${t.trackCount?`#${t.trackCount}`:``}`,pubDate:e(t.postTime??t.lastReleaseDate),description:o(i(n,{children:[t.logoURL?r(`img`,{src:t.logoURL}):null,r(`table`,{children:Object.entries(h===`podcasts`?{"#":a+1,播客电台:t.name,主持:t.authorsText,分类:t.primaryGenreName,更新频率:`${(t.avgUpdateFreq/24).toFixed(1)}天`,最近更新:`${t.lastReleaseDateDayCount.toFixed(1)}天前`,总集数:t.trackCount,平均时长:`${t.avgDuration}′`,平均播放量:t.avgPlayCount,平均评论量:t.avgCommentCount,千播互动量:(t.avgInteractIndicator*1e3).toFixed(0),平均打开率:`${(t.avgOpenRate*100).toFixed(1)}%`,小宇宙:t.links[0].url,"Apple Podcasts":t.links[1].url,官方网站:t.links[2].url,"RSS 订阅":t.links[3].url}:{"#":a+1,节目标题:t.title,播客电台:t.podcastName,播放量:t.playCount,评论量:t.commentCount,互动率:`${(t.commentCount/t.playCount*100).toFixed(1)}%`,打开率:`${(t.openRate*100).toFixed(1)}%`,时长:`${t.duration}′`,发布时间:t.postTime,分类:t.primaryGenreName,链接:t.link}).map(([e,t])=>t?i(`tr`,{children:[r(`td`,{children:r(`b`,{children:e})}),r(`td`,{children:t})]}):null)})]}))}));return{title:`${f(`title`).text()} - ${m[c].title}`,link:u,item:g,description:f(`meta[property="og:description"]`).attr(`content`)}}export{s as route};