import{t as e}from"./cache-DUthuMSu.mjs";import{t}from"./parse-date-BdYTmLpo.mjs";import{t as n}from"./got-BBDj7u1e.mjs";import{load as r}from"cheerio";const i=`https://jwc.ecust.edu.cn`,a={mto:{link:`/3938`,name:`教学运行管理`},mttb:{link:`/3939`,name:`培养与教学建设管理`},gi:{link:`/zhglbgs`,name:`综合信息`},mpt:{link:`/3940`,name:`实践教学管理`},fai:{link:`/3941`,name:`学院教务信息`}},o=async e=>{let{data:a}=await n(e),o=r(a);return o(`div#wp_news_w2 table[width="100%"]`).toArray().map(e=>{let n=o(e).find(`a`),r=o(e).find(`div[style="white-space:nowrap"]`).first(),a=n.attr(`href`);return a.startsWith(`http`)||(a=`${i}${a}`),a=a.replace(/^https:\/\/(\w+)-ecust-edu-cn-s\.sslvpn\.ecust\.edu\.cn:8118/,`https://$1.ecust.edu.cn`).replace(/^https:\/\/ecust-edu-cn-s\.sslvpn\.ecust\.edu\.cn:8118/,`https://ecust.edu.cn`),{title:n.text(),link:a,pubDate:t(r.text())}})},s={path:`/jwc/:category?`,categories:[`university`],example:`/ecust/jwc/mto`,parameters:{category:`订阅板块，默认为全部订阅`},features:{requireConfig:!1,requirePuppeteer:!1,antiCrawler:!1,supportBT:!1,supportPodcast:!1,supportScihub:!1},name:`本科教务处信息网`,maintainers:[`lxl66566`],handler:c,description:`| 其他任意值 | mto          | mttb               | gi       | mpt          | fai          |
| ---------- | ------------ | ------------------ | -------- | ------------ | ------------ |
| 全部订阅   | 教学运行管理 | 培养与教学建设管理 | 综合信息 | 实践教学管理 | 学院教务信息 |`};async function c(t){let{category:s=`all`}=t.req.param(),c=a[s]||null,l=c?[`${i}${c.link}/list.htm`]:Object.values(a).map(e=>`${i}${e.link}/list.htm`),u=(await Promise.all(l.map(e=>o(e)))).flat(),d=await Promise.all(u.map(t=>e.tryGet(t.link,async()=>{let{data:e}=await n(t.link),i=r(e);i(`div.wp_articlecontent *`).each(function(){if(!i(this).text().trim())return i(this).remove();for(let e in this.attribs)i(this).removeAttr(e)});let a=i(`div.wp_articlecontent`).first().html();return a&&(t.description=a.replaceAll(/<\/(p|span|strong)>\s*<\1>/g,``).replaceAll(/<\/(p|span|strong)>\s*<\1>/g,``)),t})));return{title:`华理教务处 - ${c?c.name:`全部`}`,link:c?l[0]:i,item:d}}export{s as route};