/* 10豆 一次性脚本 2 15 * * * jd_10.js, tag=10豆, img-url=https://raw.githubusercontent.com/Orz-3/mini/master/Color/jd.png, enabled=true */ const $ = new Env('10豆'); var iil='jsjiami.com.v7';const Iiili=iii1II;(function(l1iIIl,iiilll,lI11Il,lIII1i,l11i11,IilIl1,lIII1l){return l1iIIl=l1iIIl>>0x6,IilIl1='hs',lIII1l='hs',function(l1iIIi,lilIi,l1l11I,lilIl,IilIlI){const l1il1I=iii1II;lilIl='tfi',IilIl1=lilIl+IilIl1,IilIlI='up',lIII1l+=IilIlI,IilIl1=l1l11I(IilIl1),lIII1l=l1l11I(lIII1l),l1l11I=0x0;const iIli11=l1iIIi();while(!![]&&--lIII1i+lilIi){try{lilIl=parseInt(l1il1I(0xcb,'jg4q'))/0x1*(-parseInt(l1il1I(0xa1,'iXiH'))/0x2)+parseInt(l1il1I(0xa4,'gHN6'))/0x3+-parseInt(l1il1I(0x9c,'4Q#h'))/0x4+parseInt(l1il1I(0xc7,'H@iZ'))/0x5*(-parseInt(l1il1I(0xbe,'8of['))/0x6)+-parseInt(l1il1I(0x81,'l6)p'))/0x7*(-parseInt(l1il1I(0xd8,'kPUR'))/0x8)+-parseInt(l1il1I(0xa5,'@j6^'))/0x9*(parseInt(l1il1I(0x7e,'cNQ8'))/0xa)+parseInt(l1il1I(0xa2,'jg4q'))/0xb*(parseInt(l1il1I(0x83,'bNIo'))/0xc);}catch(Iiiil){lilIl=l1l11I;}finally{IilIlI=iIli11[IilIl1]();if(l1iIIl<=lIII1i)l1l11I?l11i11?lilIl=IilIlI:l11i11=IilIlI:l1l11I=IilIlI;else{if(l1l11I==l11i11['replace'](/[IGMypgVdnLqCXJUePOWTA=]/g,'')){if(lilIl===lilIi){iIli11['un'+IilIl1](IilIlI);break;}iIli11[lIII1l](IilIlI);}}}}}(lI11Il,iiilll,function(Iiiii,l11i1I,IiII,llIIli,lIII1I,illIlI,liIiI){return l11i1I='\x73\x70\x6c\x69\x74',Iiiii=arguments[0x0],Iiiii=Iiiii[l11i1I](''),IiII=`\x72\x65\x76\x65\x72\x73\x65`,Iiiii=Iiiii[IiII]('\x76'),llIIli=`\x6a\x6f\x69\x6e`,(0x149589,Iiiii[llIIli](''));});}(0x3280,0x82992,Iii11l,0xcc),Iii11l)&&(iil=0xcc);function Iii11l(){const l11i1i=(function(){return[...[iil,'IIjpqsUVOjIiACaXgmdi.WPTcJeopmg.vn7GMUyL==','kHJcLY7dN1y','l2VcISkqhW','WRKXWQuCW7y','WPxcKshcSbDRkNGjW70Zux4','WOlcR8oqaa','aa1oW6ZcIq','WRVdO8o3gCk7','lWtcVG','6k6H5yUq6zQd5OEl5zYlsCowWRJcLttOVOBLHPhMOOBKV7/MLklLHyZLR6BdHEw7SEISOoMcIEI9SoIgJUADIUwmGEIpQ+wpPbBcKCkFW7JcISkp','W6JcINFcRSkL','oSocWONcOG','CwnXW5PcWPtdHLG','sCknW47cImky','yuWfpSoC','WQPAWQOkWP4','vaVcMGf+W6xdVCoknq','pW5AxSkWWPVcOow9I+wMH+odTUs7Uos4IUI2TEwoTW','bSoVW5NdQ8k/rSkPW5TuW7W','W71YW7tcSw7cIwxcQSkIWQWzmW','k8o2W51mWOuVyNXiusP1ChVcJmogW4VdTM4VWR5MlcKFW609xmo5W7atihhcLKyoWORdJSktFIRdQcBcUWhcRXBdH0beW4/cKxnyW7JdH1tdRCk1W7BdSSoJWP3dKCotWRtdLuJdJ8olbd/dKmoCi24jWProWRahWOXkW4vOqSoilfPsWPXosCoBWRmHW43dJCoVWRbqWP/dOaKPeCkcWOueW6/dLCkTBmkpWPdcUN/cUCoBWQzQASkgrSoOFCk4WQ/cJadcJt5BWQhdRhJdGhhcQCkFFCowWQvXWQWhA0FcM8o0W5dcN8oAWPldQHFdTYiWcCoAgCooWQ7cLmkucCkvWQ/dHfWioCkSWOXhWRqZW6lcTrXxWR8wwfNcVhfqW4LjWQOzW5NdTYhdGmkuWQJdTMRdTSk8W5FdTIuGW752WPnaqCoRWPyhm0ddQC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6mdm8o5EgtdMmoZkX50ogJdLriHuYRdNsC5WQJcRJ3dICkrvr89uCkjESk+FmoAqqRdHCktW6a3W6FcQquQW4fuWQZcIGtdSCkiW7yuW44hWRddPJvpDCkFWQC/eNWiimkDfhnbvmoqWOvvW5lcPqVdQ0mHWOL7CCouW4DIsSoQW4vGl8oJi8opg8o7t8kelCk7cGFdLK9qdWddR8kIASoYnZ7dQSoBhxlcKr1pWQ8uWO/cMvXyzsBdVmkwWQ1tWO0Lmq53W48OiSk/kCkJxSoSp8oCWRjZAeFdNLFcLmk2amktW6ZdJ8ouEt7dGmkUdmogprZcJSkHqXeIW4PptmozmSoryhFcMqCwgNWBymkzW7CvWQ1NW7D1leJdMCoPWQyRW5RcGYBdNXZcL1KOf8kHWQnC','WRaYWQJcTCoinqZdP8kPWQdcNSkyFa','WRC1W4iezW','p3Dl','F8kPW5lcGSkdW44F','6k6N5yQh6zIc5Owd5z+1BCkzp8keWP3OVy3LH7/MOl3KVB3MLAhLHPtLR5ZdHEw7KoIVVEMdSoI+L+IhV+AER+woSoInQ+wmLHqsAhmYoW','W7vWW7NcLq','paP2W5FcJCojW6O8ymkNdxddJCkgW7VcVmk5W5VdKCozEuVdMq3dI3zDW4/cQGmAW7ldP8oqWOu8BaNcNCoxwhlcUG','WR3cMSkRWPuRsSoOWR0','W7tcPvxcOW','WPbFBdS5WOm','W4pdGMddPeqQCW','l8oABmoQWOBdLq','WP0yWR8DW7ddVW','WO3cT8kyW6tdOSok','ndmTma'],...(function(){return[...['W7pcRSo3g8k2WRL3yKLyW4L/W7y','tCkNqSkNuW3cIGW','u8k0W483Eq','m8oJW5TpWPm','WO7cM8kS','tCoFW6qtWPi','nSoXW4XoWRb6it9gvMmAtrZORjhMS6dLP5tOTRdVVi3ORRxMOzhMNQZNVj7OTQRPHRVORz0','WRhdRSo6','qSkfASkytq','iSoHW51vWOb8osP9wdm+','kSozAcbEzhvbCdZdRa4','5lUe5lIW6lES5y23','W5xdUmkku8o6W5nfW7KzWR3cRMe','B8k4xCkGuWVcOtWgWOnAWQpdVb9GW5FdSWWSW4n8WO3dUCkbBuKpj8k+iCobseW','W69VW7K','W45kWRzLnmoNz8k+W4nyr8kA','W4Omvra8WPNcRW8','pqHMW77cTa','W7JdR8kgk8kxtSkaqSkYuCkjxWK','WQ3dSa/dSSofW4VcTv99WR4uWPC','5l+p5BAY57M85yAq5RoD6lYC5zEi','ySkNsG','W4viAaewWPXz','oCoiWPpcO2ddUcu','FSkJW5tcO8kdW5Kw','WPerW6m','v0HjW5T1WQq','yfCvbSouW5ddPY4','lSoTWRTNgSoA5BA95Awp5PwUW53dKCkK','pq1oW4JcMCkAWQS','WRn8w8k2jSo/hSoMWQr0zSkj','lSoQW5uWucRcK8kI','WQBcISoIiCkjWQLCW5a','FCoJW4RdSq','W6tdG8k4','BCkPwCkVuG','nxddHaTC'],...(function(){return['lqRcTcq','sCkRWOu','W61nW7xdQ8kv','y3lcPKFcUG','W5H+cbNdVG','o8odWPe','WOdcOCoA','fCkdW4OgWO3dKZ0k','W57dSSoCj1bzs8o1WQpdISooBq','umkamh0bouPLrq','d8kAWQnFgSoeWPOLx8oWC8kv','cXRcVYBdNmolhbDSW6CMW5C','44oA5O2X56Ar44kI6kYr5yE66i2N5yYr5lQi5lMJ6lEW5y6O5lUgW7PegCooW65HrUEBJoAnOUs/U+EvUmoBWRaVW5hcKNVNMRpKUAJKUB/NR4/LI4ROJipLJRm','x8kXWOhcQmo7cW','r8oCWR5BgmomWQ0','W6RdSCoqE3mwtmo0','e8kfW6KorCkqW6eCB8oyy8k4W5q','W4NdHMddO00','fSknW5ldNCoFWQJdMq7cHq','WPDQzqRcG2m','W4HYuX4dWP3cGq','5lUZ5lMk6lwY5y60','DmkNW5tcPmkk','wSkQjMuL','5l2B5BEv57UH5yET5RoV6lYr5zE1','gv3cN8kMmq','ge3cUmoZFG','FmoPW4/dOetcOaJdIWFcQIKYmmkThCoZwSk+d8kfdmoXW5FdNCokkmoQW4C9hCk0WQ5LyN3dSLr6W6RcPH/dU3pdRCkHW5POW7hcVmobWQddVCofF312','WPupeLPdW4rXiIxcRXVcHW','A8ktWOdcHmo5','W65ZW7K','W6HM5AEZ6lAGFCky5y685zIzW4ZdLa','jhT/W5nZ','WPhcKwddPw4Pr3q'];}())];}())];}());Iii11l=function(){return l11i1i;};return Iii11l();};const ii1ll=$[Iiili(0x8f,'efYD')]()?require(Iiili(0xc1,'H@iZ')):'',IliI1l=$[Iiili(0xd9,'FA&o')]()?require(Iiili(0x92,'W2c*')):'';let lliiil=!![],lliiii=[],IliI1i='',ll1ii;function iii1II(_0xc4cc1,_0x5a49df){const _0x89cd6c=Iii11l();return iii1II=function(_0x31ebf6,_0x24e4d2){_0x31ebf6=_0x31ebf6-0x71;let _0x502015=_0x89cd6c[_0x31ebf6];if(iii1II['WGUMhJ']===undefined){var _0x1ea232=function(_0x322de5){const _0x3efa53='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x974154='',_0x44de2='';for(let _0x562dc9=0x0,_0x1d3e48,_0x3519b2,_0x140ea0=0x0;_0x3519b2=_0x322de5['charAt'](_0x140ea0++);~_0x3519b2&&(_0x1d3e48=_0x562dc9%0x4?_0x1d3e48*0x40+_0x3519b2:_0x3519b2,_0x562dc9++%0x4)?_0x974154+=String['fromCharCode'](0xff&_0x1d3e48>>(-0x2*_0x562dc9&0x6)):0x0){_0x3519b2=_0x3efa53['indexOf'](_0x3519b2);}for(let _0x9b5a39=0x0,_0x13e9fb=_0x974154['length'];_0x9b5a39<_0x13e9fb;_0x9b5a39++){_0x44de2+='%'+('00'+_0x974154['charCodeAt'](_0x9b5a39)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x44de2);};const _0x3f38a8=function(_0x299d4f,_0x589b4a){let _0x1faade=[],_0x5c0e74=0x0,_0x5ba195,_0x218e66='';_0x299d4f=_0x1ea232(_0x299d4f);let _0x2564de;for(_0x2564de=0x0;_0x2564de<0x100;_0x2564de++){_0x1faade[_0x2564de]=_0x2564de;}for(_0x2564de=0x0;_0x2564de<0x100;_0x2564de++){_0x5c0e74=(_0x5c0e74+_0x1faade[_0x2564de]+_0x589b4a['charCodeAt'](_0x2564de%_0x589b4a['length']))%0x100,_0x5ba195=_0x1faade[_0x2564de],_0x1faade[_0x2564de]=_0x1faade[_0x5c0e74],_0x1faade[_0x5c0e74]=_0x5ba195;}_0x2564de=0x0,_0x5c0e74=0x0;for(let _0x534ddd=0x0;_0x534ddd<_0x299d4f['length'];_0x534ddd++){_0x2564de=(_0x2564de+0x1)%0x100,_0x5c0e74=(_0x5c0e74+_0x1faade[_0x2564de])%0x100,_0x5ba195=_0x1faade[_0x2564de],_0x1faade[_0x2564de]=_0x1faade[_0x5c0e74],_0x1faade[_0x5c0e74]=_0x5ba195,_0x218e66+=String['fromCharCode'](_0x299d4f['charCodeAt'](_0x534ddd)^_0x1faade[(_0x1faade[_0x2564de]+_0x1faade[_0x5c0e74])%0x100]);}return _0x218e66;};iii1II['OfqIVP']=_0x3f38a8,_0xc4cc1=arguments,iii1II['WGUMhJ']=!![];}const _0x172b68=_0x89cd6c[0x0],_0x367d51=_0x31ebf6+_0x172b68,_0x3c39c4=_0xc4cc1[_0x367d51];return!_0x3c39c4?(iii1II['MhByTO']===undefined&&(iii1II['MhByTO']=!![]),_0x502015=iii1II['OfqIVP'](_0x502015,_0x24e4d2),_0xc4cc1[_0x367d51]=_0x502015):_0x502015=_0x3c39c4,_0x502015;},iii1II(_0xc4cc1,_0x5a49df);}if($['isNode']()){Object[Iiili(0x91,'(lUy')](IliI1l)[Iiili(0x86,'X9hp')](ii1li=>{lliiii['push'](IliI1l[ii1li]);});if(process[Iiili(0xbc,'qIRe')][Iiili(0x7a,'rQNx')]&&process[Iiili(0xb8,'1kZ3')][Iiili(0xb2,'!$O%')]==='false')console['log']=()=>{};}else lliiii=[$[Iiili(0xaa,'X9hp')](Iiili(0x93,'p2^J')),$[Iiili(0x8d,'kPUR')]('CookieJD2'),...IllIII($[Iiili(0xa9,'qIRe')](Iiili(0xc0,'4Q#h'))||'[]')['map'](IIll1=>IIll1[Iiili(0xca,'6oYT')])][Iiili(0x8e,'(jX5')](ll1il=>!!ll1il);!(async()=>{const IilIli=Iiili,IiiIiI={'GVsEl':function(lilii,l1iiI){return lilii==l1iiI;},'LMGTw':IilIli(0xa6,'y84j'),'IEysM':IilIli(0x87,'D)pI'),'LlPwN':IilIli(0xc3,'obS@'),'MZTnb':IilIli(0x89,'MHhh'),'WwYav':function(ll1li,Illl1I){return ll1li{const li1=Iiili;$[li1(0x99,'W2c*')]('','❌\x20'+$[li1(0x8b,'@j6^')]+li1(0xd6,'l6)p')+llIlli+'!','');})[Iiili(0xc5,'H@iZ')](()=>{const illIl1=Iiili;$[illIl1(0x79,'qIRe')]();});function IIli11(){const l1llII=Iiili,llIlll={'jEoTY':function(lliii1,Iiii1){return lliii1==Iiii1;},'KDOVl':l1llII(0xcf,'rQNx'),'nMkik':function(lIIili){return lIIili();},'KaYAp':'body=%7B%22businessId%22%3A%221%22%2C%22themeId%22%3A%22838%22%2C%22type%22%3A%221%22%7D&','fgAWh':l1llII(0x9f,'p2^J'),'ivdYJ':l1llII(0xbf,'0yd6')};return new Promise(IiiIil=>{const IilIll=l1llII;$[IilIll(0x88,'AMsd')]({'url':IilIll(0x82,'zHd5'),'body':llIlll['KaYAp'],'headers':{'Content-Type':llIlll['fgAWh'],'Cookie':IliI1i,'Host':llIlll[IilIll(0xa3,'MHhh')],'User-Agent':IilIll(0xd2,'V!ep')}},async(IiiIii,IIlll,liliI)=>{const lI11Ii=IilIll;try{IiiIii?(console[lI11Ii(0x76,'FA&o')](''+$['toStr'](IiiIii)),console[lI11Ii(0xa0,'bNIo')](lI11Ii(0x98,'zHd5'))):(liliI=JSON['parse'](liliI),liliI&&llIlll['jEoTY'](liliI[lI11Ii(0xc2,'QlHf')],'2')?console[lI11Ii(0xb4,'734D')](liliI['resultMsg']):console[lI11Ii(0xab,'iXiH')](llIlll[lI11Ii(0xd7,'6H]$')]));}catch(ll1lI){$[lI11Ii(0xac,'rQNx')](ll1lI,IIlll);}finally{llIlll[lI11Ii(0xb9,'bNIo')](IiiIil);}});});}function IllIII(l1iii){const Iiill=Iiili,IIlli={'EhEUC':function(l1iil,ii1l1){return l1iil==ii1l1;},'biGXM':Iiill(0x90,'eaMW'),'rNOhP':Iiill(0x77,'Q)u0')};if(IIlli['EhEUC'](typeof l1iii,IIlli['biGXM']))try{return JSON[Iiill(0x95,'zHd5')](l1iii);}catch(lIIill){return console[Iiill(0xa7,'p2^J')](lIIill),$['msg']($['name'],'',IIlli[Iiill(0x78,'@j6^')]),[];}}var version_ = 'jsjiami.com.v7'; // prettier-ignore function Env(t, e) { "undefined" != typeof process && JSON.stringify(process.env).indexOf("GITHUB") > -1 && process.exit(0); class s { constructor(t) { this.env = t } send(t, e = "GET") { t = "string" == typeof t ? { url: t } : t; let s = this.get; return "POST" === e && (s = this.post), new Promise((e, i) => { s.call(this, t, (t, s, r) => { t ? i(t) : e(s) }) }) } get(t) { return this.send.call(this.env, t) } post(t) { return this.send.call(this.env, t, "POST") } } return new class { constructor(t, e) { this.name = t, this.http = new s(this), this.data = null, this.dataFile = "box.dat", this.logs = [], this.isMute = !1, this.isNeedRewrite = !1, this.logSeparator = "\n", this.startTime = (new Date).getTime(), Object.assign(this, e), this.log("", `🔔${this.name}, 开始!`) } isNode() { return "undefined" != typeof module && !!module.exports } isQuanX() { return "undefined" != typeof $task } isSurge() { return "undefined" != typeof $httpClient && "undefined" == typeof $loon } isLoon() { return "undefined" != typeof $loon } toObj(t, e = null) { try { return JSON.parse(t) } catch { return e } } toStr(t, e = null) { try { return JSON.stringify(t) } catch { return e } } getjson(t, e) { let s = e; const i = this.getdata(t); if (i) try { s = JSON.parse(this.getdata(t)) } catch { } return s } setjson(t, e) { try { return this.setdata(JSON.stringify(t), e) } catch { return !1 } } getScript(t) { return new Promise(e => { this.get({ url: t }, (t, s, i) => e(i)) }) } runScript(t, e) { return new Promise(s => { let i = this.getdata("@chavy_boxjs_userCfgs.httpapi"); i = i ? i.replace(/\n/g, "").trim() : i; let r = this.getdata("@chavy_boxjs_userCfgs.httpapi_timeout"); r = r ? 1 * r : 20, r = e && e.timeout ? e.timeout : r; const [o, h] = i.split("@"), n = { url: `http://${h}/v1/scripting/evaluate`, body: { script_text: t, mock_type: "cron", timeout: r }, headers: { "X-Key": o, Accept: "*/*" } }; this.post(n, (t, e, i) => s(i)) }).catch(t => this.logErr(t)) } loaddata() { if (!this.isNode()) return {}; { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e); if (!s && !i) return {}; { const i = s ? t : e; try { return JSON.parse(this.fs.readFileSync(i)) } catch (t) { return {} } } } } writedata() { if (this.isNode()) { this.fs = this.fs ? this.fs : require("fs"), this.path = this.path ? this.path : require("path"); const t = this.path.resolve(this.dataFile), e = this.path.resolve(process.cwd(), this.dataFile), s = this.fs.existsSync(t), i = !s && this.fs.existsSync(e), r = JSON.stringify(this.data); s ? this.fs.writeFileSync(t, r) : i ? this.fs.writeFileSync(e, r) : this.fs.writeFileSync(t, r) } } lodash_get(t, e, s) { const i = e.replace(/\[(\d+)\]/g, ".$1").split("."); let r = t; for (const t of i) if (r = Object(r)[t], void 0 === r) return s; return r } lodash_set(t, e, s) { return Object(t) !== t ? t : (Array.isArray(e) || (e = e.toString().match(/[^.[\]]+/g) || []), e.slice(0, -1).reduce((t, s, i) => Object(t[s]) === t[s] ? t[s] : t[s] = Math.abs(e[i + 1]) >> 0 == +e[i + 1] ? [] : {}, t)[e[e.length - 1]] = s, t) } getdata(t) { let e = this.getval(t); if (/^@/.test(t)) { const [, s, i] = /^@(.*?)\.(.*?)$/.exec(t), r = s ? this.getval(s) : ""; if (r) try { const t = JSON.parse(r); e = t ? this.lodash_get(t, i, "") : e } catch (t) { e = "" } } return e } setdata(t, e) { let s = !1; if (/^@/.test(e)) { const [, i, r] = /^@(.*?)\.(.*?)$/.exec(e), o = this.getval(i), h = i ? "null" === o ? null : o || "{}" : "{}"; try { const e = JSON.parse(h); this.lodash_set(e, r, t), s = this.setval(JSON.stringify(e), i) } catch (e) { const o = {}; this.lodash_set(o, r, t), s = this.setval(JSON.stringify(o), i) } } else s = this.setval(t, e); return s } getval(t) { return this.isSurge() || this.isLoon() ? $persistentStore.read(t) : this.isQuanX() ? $prefs.valueForKey(t) : this.isNode() ? (this.data = this.loaddata(), this.data[t]) : this.data && this.data[t] || null } setval(t, e) { return this.isSurge() || this.isLoon() ? $persistentStore.write(t, e) : this.isQuanX() ? $prefs.setValueForKey(t, e) : this.isNode() ? (this.data = this.loaddata(), this.data[e] = t, this.writedata(), !0) : this.data && this.data[e] || null } initGotEnv(t) { this.got = this.got ? this.got : require("got"), this.cktough = this.cktough ? this.cktough : require("tough-cookie"), this.ckjar = this.ckjar ? this.ckjar : new this.cktough.CookieJar, t && (t.headers = t.headers ? t.headers : {}, void 0 === t.headers.Cookie && void 0 === t.cookieJar && (t.cookieJar = this.ckjar)) } get(t, e = (() => { })) { t.headers && (delete t.headers["Content-Type"], delete t.headers["Content-Length"]), this.isSurge() || this.isLoon() ? (this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.get(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) })) : this.isQuanX() ? (this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t))) : this.isNode() && (this.initGotEnv(t), this.got(t).on("redirect", (t, e) => { try { if (t.headers["set-cookie"]) { const s = t.headers["set-cookie"].map(this.cktough.Cookie.parse).toString(); s && this.ckjar.setCookieSync(s, null), e.cookieJar = this.ckjar } } catch (t) { this.logErr(t) } }).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) })) } post(t, e = (() => { })) { if (t.body && t.headers && !t.headers["Content-Type"] && (t.headers["Content-Type"] = "application/x-www-form-urlencoded"), t.headers && delete t.headers["Content-Length"], this.isSurge() || this.isLoon()) this.isSurge() && this.isNeedRewrite && (t.headers = t.headers || {}, Object.assign(t.headers, { "X-Surge-Skip-Scripting": !1 })), $httpClient.post(t, (t, s, i) => { !t && s && (s.body = i, s.statusCode = s.status), e(t, s, i) }); else if (this.isQuanX()) t.method = "POST", this.isNeedRewrite && (t.opts = t.opts || {}, Object.assign(t.opts, { hints: !1 })), $task.fetch(t).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => e(t)); else if (this.isNode()) { this.initGotEnv(t); const { url: s, ...i } = t; this.got.post(s, i).then(t => { const { statusCode: s, statusCode: i, headers: r, body: o } = t; e(null, { status: s, statusCode: i, headers: r, body: o }, o) }, t => { const { message: s, response: i } = t; e(s, i, i && i.body) }) } } time(t, e = null) { const s = e ? new Date(e) : new Date; let i = { "M+": s.getMonth() + 1, "d+": s.getDate(), "H+": s.getHours(), "m+": s.getMinutes(), "s+": s.getSeconds(), "q+": Math.floor((s.getMonth() + 3) / 3), S: s.getMilliseconds() }; /(y+)/.test(t) && (t = t.replace(RegExp.$1, (s.getFullYear() + "").substr(4 - RegExp.$1.length))); for (let e in i) new RegExp("(" + e + ")").test(t) && (t = t.replace(RegExp.$1, 1 == RegExp.$1.length ? i[e] : ("00" + i[e]).substr(("" + i[e]).length))); return t } msg(e = t, s = "", i = "", r) { const o = t => { if (!t) return t; if ("string" == typeof t) return this.isLoon() ? t : this.isQuanX() ? { "open-url": t } : this.isSurge() ? { url: t } : void 0; if ("object" == typeof t) { if (this.isLoon()) { let e = t.openUrl || t.url || t["open-url"], s = t.mediaUrl || t["media-url"]; return { openUrl: e, mediaUrl: s } } if (this.isQuanX()) { let e = t["open-url"] || t.url || t.openUrl, s = t["media-url"] || t.mediaUrl; return { "open-url": e, "media-url": s } } if (this.isSurge()) { let e = t.url || t.openUrl || t["open-url"]; return { url: e } } } }; if (this.isMute || (this.isSurge() || this.isLoon() ? $notification.post(e, s, i, o(r)) : this.isQuanX() && $notify(e, s, i, o(r))), !this.isMuteLog) { let t = ["", "==============📣系统通知📣=============="]; t.push(e), s && t.push(s), i && t.push(i), console.log(t.join("\n")), this.logs = this.logs.concat(t) } } log(...t) { t.length > 0 && (this.logs = [...this.logs, ...t]), console.log(t.join(this.logSeparator)) } logErr(t, e) { const s = !this.isSurge() && !this.isQuanX() && !this.isLoon(); s ? this.log("", `❗️${this.name}, 错误!`, t.stack) : this.log("", `❗️${this.name}, 错误!`, t) } wait(t) { return new Promise(e => setTimeout(e, t)) } done(t = {}) { const e = (new Date).getTime(), s = (e - this.startTime) / 1e3; this.log("", `🔔${this.name}, 结束! 🕛 ${s} 秒`), this.log(), (this.isSurge() || this.isQuanX() || this.isLoon()) && $done(t) } }(t, e) }