import{t as e}from"./ofetch-Dl6dVB_5.mjs";import{t}from"./config-BYRrjYC5.mjs";import{t as n}from"./parse-date-BdYTmLpo.mjs";import{load as r}from"cheerio";const i=e=>function(e,t){let n=``;for(let r=0;r<e.length&&r<t.length;r+=2){let i=(Number.parseInt(e.slice(r,r+2),16)^Number.parseInt(t.slice(r,r+2),16)).toString(16);i.length===1&&(i=`0`+i),n+=i}return n}(function(e){let t=[15,35,29,24,33,16,1,38,10,9,19,31,40,27,22,23,25,13,6,11,39,18,20,8,14,21,32,26,2,30,7,4,17,5,3,28,34,37,12,36],n=[];for(let r=0;r<e.length;r++){let i=e[r];for(let e=0;e<t.length;e++)t[e]===r+1&&(n[e]=i)}return n.join(``)}(e),`3000176000856006061501533003690027800375`),a=`https://segmentfault.com`,o=(n,r)=>r(`segmentfault:acw_sc__v2`,async()=>{let t=await e(n),r=``,a=t.match(/var arg1='(.*?)';/);return a&&(r=i(a[1])),r},t.cache.routeExpire,!1),s=e=>e.map(e=>({title:e.title,link:new URL(e.url,a).href,author:e.user.name,pubDate:n(e.created||e.modified,`X`),description:e.excerpt})),c=(t,n,i)=>i(n.link,async()=>{let i;try{i=await e(n.link,{headers:{cookie:`acw_sc__v2=${t};`}});let a=r(i);n.description=a(`article`).html(),n.category=a(`.badge-tag`).toArray().map(e=>a(e).text())}catch{}return n});export{s as i,a as n,c as r,o as t};