import{t as e}from"./parse-date-BdYTmLpo.mjs";import{t}from"./got-BBDj7u1e.mjs";import{t as n}from"./cookies-DVc9NKAF.mjs";import{load as r}from"cheerio";import i from"sanitize-html";import a from"query-string";const o={path:`/stock_info/:id/:type?`,categories:[`finance`],example:`/xueqiu/stock_info/SZ000002`,parameters:{id:`股票代码（需要带上交易所）`,type:`动态的类型, 不填则为股票公告`},features:{requireConfig:!1,requirePuppeteer:!1,antiCrawler:!1,supportBT:!1,supportPodcast:!1,supportScihub:!1},radar:[{source:[`xueqiu.com/S/:id`,`xueqiu.com/s/:id`],target:`/stock_info/:id`}],name:`股票信息`,maintainers:[`YuYang`],handler:s,description:`| 公告         | 新闻 | 研报     |
| ------------ | ---- | -------- |
| announcement | news | research |`};async function s(o){let s=o.req.param(`id`),c={announcement:`公告`,news:`自选股新闻`,research:`研报`,all:`all`}[o.req.param(`type`)||`announcement`],l=`https://xueqiu.com/S/${s}`,u=await t({method:`get`,url:l}),d=await n(l),f=r(u.data)(`.stock-name`).text().split(`(`)[0],p=`https://xueqiu.com/statuses`;p+=c===`all`?`/search.json`:`/stock_timeline.json`;let m=(await t({method:`get`,url:p,searchParams:a.stringify({symbol_id:s,symbol:s,source:c,count:10,page:1,sort:`alpha`,comment:`0`,hl:`0`}),headers:{Cookie:d,Referer:l}})).data.list;return{title:`${s} ${f} - ${c}`,link:l,description:`${f} - ${c}`,item:m.map(t=>({title:t.title||i(t.description,{allowedTags:[],allowedAttributes:{}}),description:t.description,pubDate:e(t.created_at),link:`https://xueqiu.com${t.target}`}))}}export{o as route};