import{t as e}from"./got-BBDj7u1e.mjs";import{jsx as t,jsxs as n}from"hono/jsx/jsx-runtime";import{renderToString as r}from"hono/jsx/dom/server";const i={switch:1,steam:4,ps4:51,ps5:52},a={switch:{jx:16,all:17,sd:18},steam:{jx:26,all:27,dl:28,sd:29},ps4:{jx:19,all:20,sd:21,vip:22},ps5:{all:23,sd:24,vip:25}},o={jx:`精选`,sd:`史低`,all:`全部`,vip:`会员`,dl:`独立`},s=e=>r(n(`div`,{children:[t(`img`,{src:e.banner}),n(`table`,{style:`font-family: verdana,arial,sans-serif;font-size:11px;color:#333333;border-width: 1px;border-color: #999999;border-collapse: collapse;`,children:[n(`tr`,{style:`background-color:#d4e3e5;`,children:[t(`td`,{style:` border-width: 1px;padding: 8px;border-style: solid;border-color: #a9c6c9;`,children:`名称`}),t(`td`,{style:` border-width: 1px;padding: 8px;border-style: solid;border-color: #a9c6c9;`,children:e.name})]}),e.subName?n(`tr`,{style:`background-color:#d4e3e5;`,children:[t(`td`,{style:` border-width: 1px;padding: 8px;border-style: solid;border-color: #a9c6c9;`,children:`别名`}),t(`td`,{style:` border-width: 1px;padding: 8px;border-style: solid;border-color: #a9c6c9;`,children:e.subName})]}):null,n(`tr`,{style:`background-color:#d4e3e5;`,children:[t(`td`,{style:` border-width: 1px;padding: 8px;border-style: solid;border-color: #a9c6c9;`,children:`中文支持`}),t(`td`,{style:` border-width: 1px;padding: 8px;border-style: solid;border-color: #a9c6c9;`,children:e.chinese})]}),e.lowestPriceCountry?n(`tr`,{style:`background-color:#d4e3e5;`,children:[t(`td`,{style:` border-width: 1px;padding: 8px;border-style: solid;border-color: #a9c6c9;`,children:`史低地区`}),t(`td`,{style:` border-width: 1px;padding: 8px;border-style: solid;border-color: #a9c6c9;`,children:e.lowestPriceCountry})]}):null,n(`tr`,{style:`background-color:#d4e3e5;`,children:[t(`td`,{style:` border-width: 1px;padding: 8px;border-style: solid;border-color: #a9c6c9;`,children:`史低`}),t(`td`,{style:` border-width: 1px;padding: 8px;border-style: solid;border-color: #a9c6c9;`,children:e.isLowest?`是`:`否`})]}),e.pubDate?n(`tr`,{style:`background-color:#d4e3e5;`,children:[t(`td`,{style:` border-width: 1px;padding: 8px;border-style: solid;border-color: #a9c6c9;`,children:`发布日期`}),t(`td`,{style:` border-width: 1px;padding: 8px;border-style: solid;border-color: #a9c6c9;`,children:e.pubDate})]}):null,n(`tr`,{style:`background-color:#d4e3e5;`,children:[t(`td`,{style:` border-width: 1px;padding: 8px;border-style: solid;border-color: #a9c6c9;`,children:`当前价格`}),n(`td`,{style:` border-width: 1px;padding: 8px;border-style: solid;border-color: #a9c6c9;`,children:[`￥`,e.price]})]}),n(`tr`,{style:`background-color:#d4e3e5;`,children:[t(`td`,{style:` border-width: 1px;padding: 8px;border-style: solid;border-color: #a9c6c9;`,children:`原价`}),n(`td`,{style:` border-width: 1px;padding: 8px;border-style: solid;border-color: #a9c6c9;`,children:[`￥`,e.originPrice]})]}),n(`tr`,{style:`background-color:#d4e3e5;`,children:[t(`td`,{style:` border-width: 1px;padding: 8px;border-style: solid;border-color: #a9c6c9;`,children:`折扣地区`}),t(`td`,{style:` border-width: 1px;padding: 8px;border-style: solid;border-color: #a9c6c9;`,children:e.priceCountry})]}),n(`tr`,{style:`background-color:#d4e3e5;`,children:[t(`td`,{style:` border-width: 1px;padding: 8px;border-style: solid;border-color: #a9c6c9;`,children:`折扣`}),n(`td`,{style:` border-width: 1px;padding: 8px;border-style: solid;border-color: #a9c6c9;`,children:[e.cutOff,`%`]})]}),e.mcScore?n(`tr`,{style:`background-color:#d4e3e5;`,children:[t(`td`,{style:` border-width: 1px;padding: 8px;border-style: solid;border-color: #a9c6c9;`,children:`metacritic评分`}),t(`td`,{style:` border-width: 1px;padding: 8px;border-style: solid;border-color: #a9c6c9;`,children:e.mcScore})]}):null]})]})),c=async t=>{let n=(await e.get(`https://switch.jumpvg.com/jump/platform/order/v2?needCount=1&needFilter=1&version=3`)).data.data,r=0;for(let e in n)if(n[e].platformAlias.toLocaleLowerCase()===t.toLocaleLowerCase()){r=n[e].gameNum;break}return r},l=async(t,n,r,i)=>(await e.get(`https://switch.jumpvg.com/jump/discount/find4Discount/5/v2?countries=${t}&offset=${n}&platform=${r}&size=10&termsId=${i}&version=3`)).data.data,u=async(e,t,n,r)=>{let i=[];for(let a=0;a<=Math.round(r/10);a++){let r=await l(e,a*10,t,n);i=[...i,...r]}return i},d={path:`/discount/:platform/:filter?/:countries?`,categories:[`game`],example:`/jump/discount/ps5/all`,parameters:{platform:`平台:switch,ps4,ps5,xbox,steam,epic`,filter:`过滤参数,all-全部，jx-精选，sd-史低，dl-独立，vip-会员`,countries:`地区，具体支持较多，可自信查看地区简写`},features:{requireConfig:!1,requirePuppeteer:!1,antiCrawler:!1,supportBT:!1,supportPodcast:!1,supportScihub:!1},name:`游戏折扣`,maintainers:[`zytomorrow`],handler:f,description:`| switch | ps4  | ps5  | xbox   | steam | epic   |
| ------ | ---- | ---- | ------ | ----- | ------ |
| 可用   | 可用 | 可用 | 不可用 | 可用  | 不可用 |

| filter | switch | ps4 | ps5 | steam |
| ------ | ------ | --- | --- | ----- |
| all    | ✔     | ✔  | ✔  | ✔    |
| jx     | ✔     | ✔  | ❌  | ✔    |
| sd     | ✔     | ✔  | ✔  | ✔    |
| dl     | ❌     | ✔  | ❌  | ✔    |
| vip    | ❌     | ❌  | ✔  | ❌    |

| 北美 | 欧洲（英语） | 法国 | 德国 | 日本 |
| ---- | ------------ | ---- | ---- | ---- |
| na   | eu           | fr   | de   | jp   |`};async function f(e){let t=e.req.param(`platform`),n=e.req.param(`filter`)||`all`,r=e.req.param(`countries`)||``,l=await c(t),d=await u(r,i[t.toLocaleLowerCase()],a[t.toLocaleLowerCase()][n],l);return{title:`jump 折扣-${t}-${o[n]}${r?`-${r}`:``}`,link:`https://jumpvg.com/`,description:`jump 发现游戏`,item:d.map(e=>({title:`${e.name}-${e.cutOff}%-￥${e.price}`,description:s(e),link:e.banner,guid:`${t}-${e.oldGameId}-${e.cutOff}`}))}}export{d as route};