import{t as e}from"./ofetch-Dl6dVB_5.mjs";import{t}from"./config-BYRrjYC5.mjs";import{t as n}from"./cache-DUthuMSu.mjs";import{t as r}from"./parse-date-BdYTmLpo.mjs";const i={path:`/user/:id`,categories:[`picture`],view:2,example:`/fantia/user/3498`,parameters:{id:`User id, can be found in user profile URL`},features:{requireConfig:[{name:`FANTIA_COOKIE`,optional:!0,description:"The `cookie` after login can be obtained by viewing the request header in the console, If not filled in will cause some posts that require login to read to get exceptions"}],requirePuppeteer:!1,antiCrawler:!1,supportBT:!1,supportPodcast:!1,supportScihub:!1,nsfw:!0},radar:[{source:[`fantia.jp/fanclubs/:id`]}],name:`User Posts`,maintainers:[`nczitzk`],handler:a};async function a(i){let a=`https://fantia.jp`,o=`${a}/api/v1/fanclubs/${i.req.param(`id`)}`,s=(await e(a,{headers:{Cookie:t.fantia.cookies??``}})).match(/name="csrf-token" content="(.*?)"\s?\/>/)[1],c=await e(o,{headers:{Cookie:t.fantia.cookies??``}}),l=c.fanclub,u=c.fanclub.recent_posts.map(e=>({title:e.title,link:`${a}/api/v1/posts/${e.id}`,description:e.comment?`<p>${e.comment}</p>`:``,pubDate:r(e.posted_at)})),d=await Promise.all(u.map(r=>n.tryGet(r.link,async()=>{let n=await e(r.link,{headers:{Cookie:t.fantia.cookies??``,"X-CSRF-Token":s,Accept:`application/json, text/plain, */*`,Referer:`${a}/`,"X-Requested-With":`XMLHttpRequest`}});return r.link=r.link.replace(`api/v1/`,``),r.description+=`<img src="${n.post?.thumb?.original??n.post.thumb_micro}">`,r})));return{title:`Fantia - ${l.fanclub_name_with_creator_name}`,description:l.comment?.replaceAll(`\r
`,` `)?.trim(),link:`${a}/fanclubs/${i.req.param(`id`)}`,image:l.icon.original??l.icon.main,item:d}}export{i as route};