import{t as e}from"./ofetch-Dl6dVB_5.mjs";import{t}from"./cache-DUthuMSu.mjs";import{t as n}from"./parse-date-BdYTmLpo.mjs";import{t as r}from"./timezone-keeL11Io.mjs";import{load as i}from"cheerio";const a={path:`/monthly-labour-survey`,categories:[`government`],example:`/mhlw/monthly-labour-survey`,radar:[{source:[`www.mhlw.go.jp/toukei/list/30-1a.html`]}],name:`毎月勤労統計調査 全国調査（月別結果）`,maintainers:[`TonyRL`],handler:s,url:`www.mhlw.go.jp/toukei/list/30-1a.html`};async function o(t){let n=await e(t,{responseType:`arrayBuffer`});return new TextDecoder(`shift-jis`).decode(n)}async function s(e){let a=Number.parseInt(e.req.query(`limit`)||`24`,10),s=`https://www.mhlw.go.jp`,c=`${s}/toukei/list/30-1a.html`,l=i(await o(c)),u=l(`table.xgengo:first tr`).toArray().flatMap(e=>{let t=l(e),n=t.find(`h3`).text().trim();return t.find(`ul.ico-link li a`).toArray().map(e=>{let t=l(e);return{title:`${n}${t.text().trim()}`,link:new URL(t.attr(`href`),s).href}}).toReversed()}).slice(0,a),d=await Promise.all(u.map(e=>t.tryGet(e.link,async()=>{let t=i(await o(e.link)),a=t(`.prt-topContents .al-right`).text().trim().replaceAll(/（[^）]+）/g,``),s=t(`#contentsInner`);return s.find(`.prt-topContents, .prt-linkNavi, .prt-plugin`).remove(),e.title=t(`h1#pageTitle`).text().trim()||e.title,e.pubDate=r(n(a,`YYYY年M月D日`),9),e.description=s.html()?.trim(),e})));return{title:l(`head title`).text().trim(),description:l(`meta[name="description"]`).attr(`content`)?.trim(),link:c,image:`${s}/favicon.ico`,language:l(`html`).attr(`lang`),item:d}}export{a as route};