import{t as e}from"./ofetch-Dl6dVB_5.mjs";import{t}from"./parse-date-BdYTmLpo.mjs";import{load as n}from"cheerio";const r={path:`/manga/:id`,categories:[`anime`],example:`/comic-fuz/manga/218`,parameters:{id:`ComicFuz中对应的漫画id`},features:{requireConfig:!1,requirePuppeteer:!1,antiCrawler:!1,supportBT:!1,supportPodcast:!1,supportScihub:!1},radar:[{source:[`comic-fuz.com/manga/:id`],target:`/manga/:id`}],name:`漫画详情`,maintainers:[`xiaobailoves`],handler:async r=>{let{id:i}=r.req.param(),a=`https://comic-fuz.com`,o=`${a}/manga/${i}`,s=n(await e(o,{headers:{Referer:`https://comic-fuz.com/`,"Accept-Language":`ja,en-US;q=0.9,en;q=0.8`}})),c=s(`#__NEXT_DATA__`).text();if(!c)throw Error(`无法解析页面数据，请检查漫画 ID 是否正确或页面结构是否变动`);let l=JSON.parse(c).props?.pageProps;if(!l)throw Error(`无法解析页面 Props 数据`);let u=s(`title`).text().trim(),d=l.authorships?.map(e=>e.author?.authorName).join(`, `)||``,f=l.manga?.longDescription||``,p=(l.chapters||[]).flatMap(e=>e.chapters||[]).map(e=>{let n=e.pointConsumption,r=n?.amount||0,i=``;n&&Object.keys(n).length===0?i=`无料`:r>0&&(i=`付费`);let o=e.thumbnailUrl;return o&&o.startsWith(`/`)&&(o=`https://img.comic-fuz.com${o}`),{title:`${e.chapterMainName}${e.chapterSubName?` - ${e.chapterSubName}`:``}`,link:`${a}/manga/viewer/${e.chapterId}`,description:`
                    ${o?`<img src="${o}" style="max-width: 100%;"><br>`:``}
                    ${r>0?`<p>价格: ${r} 金币/铜币</p>`:``}
                `,guid:`comicfuz-comic-id-${e.chapterId}`,category:i,author:d,pubDate:e.updatedDate?t(e.updatedDate,`YYYY/MM/DD`):void 0,upvotes:e.numberOfLikes||0,comments:e.numberOfComments||0}});return{title:`COMIC FUZ - ${u}`,link:o,description:f,item:p,language:`ja`}}};export{r as route};