/* 活动名称:批量店铺签到 活动链接:https://h5.m.jd.com/babelDiy/Zeus/2PAAf74aG3D61qvfKUM5dxUssJQ9/index.html?token= 环境变量:jd_dpqd_tokens // 活动令牌,多个用英文逗号,@,&,换行分割 jd_dpqd_task_threads // 控制签到并发线程数(正整数),默认1 jd_dpqd_account_threads // 控制账号并发线程数(正整数),默认1 jd_dpqd_account_interval // 自定义运行间隔时长(整数,单位毫秒),默认0 jd_dpqd_max_retry // 签到火爆时的最大重试次数(整数),默认0 jd_dpqd_prize_notify // 是否推送中奖信息(true/false),默认不推送 此脚本为高并发签到本,需要读取主脚本生成的活动信息缓存,自动过滤无效活动,签到后如有奖品则自动到账 cron:1 1 1 1 * */ const $ = new Env('批量店铺签到') var iil='jsjiami.com.v7';const i1iIli=iii1II;(function(llIlIl,II11I,il1i1,lIIiIi,liI1iI,iI1Il1,i1iIl1){return llIlIl=llIlIl>>0x8,iI1Il1='hs',i1iIl1='hs',function(i1lli1,llIlII,IIlII,lIIiII,i1iIlI){const IIlI1=iii1II;lIIiII='tfi',iI1Il1=lIIiII+iI1Il1,i1iIlI='up',i1iIl1+=i1iIlI,iI1Il1=IIlII(iI1Il1),i1iIl1=IIlII(i1iIl1),IIlII=0x0;const li111=i1lli1();while(!![]&&--lIIiIi+llIlII){try{lIIiII=-parseInt(IIlI1(0x1ec,'G1Ww'))/0x1+parseInt(IIlI1(0x23b,'*&qc'))/0x2+-parseInt(IIlI1(0x28b,'flH1'))/0x3*(-parseInt(IIlI1(0x2f7,'s]1j'))/0x4)+parseInt(IIlI1(0x28a,'gd^M'))/0x5*(-parseInt(IIlI1(0x31f,'gd^M'))/0x6)+-parseInt(IIlI1(0x23f,'DO@I'))/0x7+parseInt(IIlI1(0x30d,'HB9Y'))/0x8+-parseInt(IIlI1(0x2ca,'[$nN'))/0x9*(-parseInt(IIlI1(0x238,'*VN@'))/0xa);}catch(liI1lI){lIIiII=IIlII;}finally{i1iIlI=li111[iI1Il1]();if(llIlIl<=lIIiIi)IIlII?liI1iI?lIIiII=i1iIlI:liI1iI=i1iIlI:IIlII=i1iIlI;else{if(IIlII==liI1iI['replace'](/[RkHFrVKMYGLNqTEpS=]/g,'')){if(lIIiII===llIlII){li111['un'+iI1Il1](i1iIlI);break;}li111[i1iIl1](i1iIlI);}}}}}(il1i1,II11I,function(lIIiI1,ll1I1,Ii1ili,iI1Ii1,Ii1ill,llIlI1,iI1IiI){return ll1I1='\x73\x70\x6c\x69\x74',lIIiI1=arguments[0x0],lIIiI1=lIIiI1[ll1I1](''),Ii1ili=`\x72\x65\x76\x65\x72\x73\x65`,lIIiI1=lIIiI1[Ii1ili]('\x76'),iI1Ii1=`\x6a\x6f\x69\x6e`,(0x17011d,lIIiI1[iI1Ii1](''));});}(0xc600,0xc20b9,Iii11l,0xc8),Iii11l)&&(iil=0x2cda);const jdCookie=require(i1iIli(0x2e5,'OF#E')),notify=require(i1iIli(0x295,'K[um')),common=require(i1iIli(0x2dc,'*VN@')),{H5st}=require(i1iIli(0x32c,'4r4o'));console['log'](''),console[i1iIli(0x288,'ld!k')](i1iIli(0x24e,'K[um')+$[i1iIli(0x2ff,'ePsi')]+i1iIli(0x327,'!t)e')),console[i1iIli(0x215,'HB9Y')]('jd_dpqd_tokens\x20//\x20活动ID,多个用英文逗号分割'),console[i1iIli(0x24b,'DO@I')](i1iIli(0x21d,'gd^M')),console[i1iIli(0x269,'ITkz')](i1iIli(0x265,'ePsi')),console[i1iIli(0x2a9,'3CcX')](i1iIli(0x26d,'E!Xy')),console[i1iIli(0x20c,'&3sR')](i1iIli(0x2cd,'GncB')+$[i1iIli(0x1f9,'8vd&')]+i1iIli(0x2da,'ITkz')),console[i1iIli(0x20f,'OF#E')]('');let tokensList=(process[i1iIli(0x283,'3bg!')][i1iIli(0x30c,'HYti')]||'')[i1iIli(0x259,'3CcX')](/[,@&|\n]+/g)[i1iIli(0x1ff,'3!FN')](Boolean),taskThreads=process[i1iIli(0x32b,'pmTn')]['jd_dpqd_task_threads']||'1',accountThreads=process[i1iIli(0x27f,'*VN@')][i1iIli(0x299,'rqan')]||'1';const runInterval=process['env'][i1iIli(0x293,'Ks]L')]||'';function Iii11l(){const iiIi1I=(function(){return[...[iil,'FjsVNjiaMqqmGYik.TcqoLmK.RLpvY7SHSrETqSK==','WPpcRmoCW47dNaS','uCkvWPyE','5lMr5PEY5BsV562a','WPxdHb1z','pfldHmkQiW','WQNdU1n+pG','W7RdLmot','fCkxv8ownW','W6HQWRlcNay','xUkFHetINQnk566H5yID5AA56lwVnq','CrxdHmkzk8o8W6frACoGxCk8omkm','BmkXWR9LW4VdTa','WOyzW4hcTCkL','WOBcU8oTW4S','WQzmWOldI18Xkmk1WOBdMLVdRH/cTG','WPFcOfFdI8oIWQZdIhLcsSo9WO3dLG','WPddHXztWPG','WRlcMSoSkwO','WRNcLSkpq0G','bmkOtmoQnW','iL7cHW','WOT6pSoDW7JdQSkifmkYBG','amoqlmkfWRm','WPxcR1NdJmoRWQ/dI0nmu8ojWONdMq','aeldQCk1nq','W5tdICkgxq','grbvW5VcVCk4W4nMWO0GW5RcUmk3mSoMWRuCfx0OWQTjhfDEdLDAWRWFW45xtrrEW5aRWQCfWPq','W5LhWQ3cIee','WOlcImkgwNu','WQdcOmooW4BcOa','5REa5yIg5BEy57Ub57Qa5PY5','WRNdGxLdea','44kx5O+456sa44kw6k2c5ywz6i2p5y+XW6eRefpdT8o0','FMBcUxJdU3ldLq','W79wWORcIbW','WOpcOq0KW5xcGa','WRJdGur6nGJcSKHFteil','W5BdGSkCqSkTW4ddKCoy','W57MTl/LIRVLPjZNGPhNIla','W5rBWQRcJqa','WONcU8oU','5y2p6yAe6k2n5PIEpCoEFSk6a1y2W7SjaG','W4OXbCoXE8ka','WOldQLHwaq','C8o5DSoFoG','W6bEWPa','W4VdRh9WWP8KBCk9WQe2nXfWlSkvxW','W73dRSkErSkc','WPldGf5RiqFcPrfBr1SuWQ57gCoWWOhdShSz','nmoWo8krWQm','gLNdQCkriq','n8oIW6mWWO/cPbyQfuqlna','l8kdksWg','W7FdG8kTucaCW6RcHCokDq','EZyomIC','W7hdNXpdOMW','s8k7W5KnprxcPG','xSkyWPC','W6Thxq','i8oGnCkQWQC','WQpdNhtdJs0','WOxdGXbAWP4','W7DDsCoV','WPnMW5u7ha','WQXSW7qm','p1lcP2ldQLpdTmkn','W6lNRBpLIQNMIBNLI6VVVki','f8oUiSkrWPK','WPZdJe/dSa','WPrrzfJcV34t','gdeiWPSpWQ0','WP/cNX0RW4G','emoVWOTEAdBcGuuPW7JcUq','xUESPUwjLoAlV+wlTq','sCkZWO4jka','5RwR5yQE5Bk75P+Z5B2K5AsJ','s2fCW5PtW6KDW7Olwt3dKWi','n3NcTwO/tG','WRNcOmo1m180lq','zConBSo9bmo1WRNcR8o8wSkZDW','W65yWPDjuW','FmoUD8o5WQK','jmkBjZK','W5aMyq','5lIt6loQ8ycGMa','iwVcR3C','pfNdHG','WONcPMrJWOiG','W7nAt8oI','jZLcW5FcHG','quWs','W58dCCkNW7a','W47dTGG','dd0fWOSSWRzbW60zBbtdTq','xCklxsSg','WQLrWR7dN0G','W5eFs8kQW7K','W6pIN4JcGUkDVCkL','WOC1WP/cSmoyotHgWOyH','W5tdNSocdqG','iLFcKxldJKVdVCk3WQhcMmkaA2BdRs3dSSodW4HCb8k8W6KHBoApVowjQEETM+wiHow6G+wpHE++HoM5SUIVOW8','5ysZ57UC5yYK8lceQa','ioEUQUwlOEwKS+I2MU++La','t8kXW58SkHu','W4ldNSk1tJK','m8kiy8oZhW','W69vW5i','w8okBmoaeG'],...(function(){return[...['WOpcRxJcMNG5WQSCDXS','WQxORyhMSlVLKyNLUR/dQG','W4bVFh3cJa','WQ9hWRNdIG','5BUf6zgd56AU5yUV8yQ8Po+6MG','cZCiWPKm','WQxNRy7LI5BLP67OTy3VVkS','rmkNCICK','W646oCoozW','WRvSW7aDiepcGJa','W68eW4nPua','xCkxEcGu','mCowl8kpWR7dNa','WOX8W7GbeG','vGGooYy','W4O7da','W6eUW5D0zCkrcSoJ','WQ5IW74','W5NdK8kLwXO','jmkzpmkUCSonWOhcGmo5DSkt','xdZcUSkRW6JdUHeIW5CZ','W65gwCoRW4b1WP1u','WQdcJSoWeMXxWOhcUSooCSo3WQhcGG','W4K9ymojWQ4','6lA75y2g5Pwh5Ps8','W5mAqSktW7W','mSoZb0bqfeGWWOn6dhNdLW','jCoEo8kgWR8','WRm1W5alW6a','WP7cMCoYn0G','gt0qWQDFWQXz','CIionq','WQpdN0vfgG','W6eYWQxdVCkZ','WPmUWP3dTq','WRNcPCo6ou4','jN/cTwS','cSkGq8oHiq','ACkQvG','W6BdMrFdP3/cQZ3cGq','W6BdKdhdRuW','WP85lGVdHWTIBmkfeq','W7VdLCkWrIySW5ZcKSoqC8oeWO3cPtXgW5pcV8kyW7bl','WPqJWOFdP0q','WQbnWRpdIfSO','W53cNb9BWR/dICkw','W7H1WPpcO0a','r8kXW5ym','W69pWRW','W7hdNSoa','s8kWWOLZW4G','qXldG8kqaq','BZmpore','W5K7DmklW6q','E8kVW5CIeq','WQ3dJwFdLH0','W7RdI8oobfldLxxdRLxcUuzfamodmCkVWQy','i1lcNhZdLq','6ls65y605PAd5PsyrFcRQBC','W6zBsCoUW5j/','W5e1aSoI','WPxcTNLS','WO3dKvxdSa','rCkIWR08cW','vCkqWQqFhSkiWRBdSColW5ZcQt3dHSkyW6ZcR8o+WPBcNWO+WQWTeh9Dk+AnPEwkUEI2R+woVow5KownIU+8OEM5M+IVMfW','rCk3W5qDpru','WOpdNMjjcq','gSkkwmo8fgWf','oMxcOq','W69FWO/cSq','zZJdTq','DCosumo2WPO','W61mzCoJW4vGWPX4W4mNhfFdQ8o/W7bmWR3dISkGW6tdGGldM0FcUNn7WQdOHztLRjtKUQdOVPFOOQRPL4NPMitMLQpPLk4','W5int8kLW6m','ECohEa','W78/W41GC8ozBmkOvL4LWQSAvCkUWOaJW5S+WRe','W5dORk7MSzVLKkxLUPHQ','WOBIN4Hl4P+AlW','WQWSWR/dON0','WQeWW7dcS8kJ','BSkZyrWL','WORdNNxdVc4','W4ZdJCkss8o1W4VdHSocrCotAG','WPq7WOldQeq','htCaWOO','WOBcRvbMWQe','WPhcVSoBW4tdKW','W4BdUbVcNW','zrxdHa','W4f+WQDjsa','CSogEq','W5bVwCoUW7W','W6PBW4LcAa','ymkXW5yDpqNcOsiRW5tcH8ok','WO/cOqG','W7tdN8oueqZcGq','W4fRD1m','W6RdKmooacRcNhZdRG','FSo4BW','WP7cSmoi','aM3dP8o1W53dVq','EWVdVctcIWNcQCkQWR3cQmkFDLm','r00zWOFcOCkUW6jhWQC2','W5VdSqJcN8kx','WPxdM0e','qsxdUmk0ka','WOxdNXHoWP43ACoPh8kY','4PI3A+IfK+wUIUs5IEI8S+IGJ+MvS+MAQUAwNEMvToITUoE9MUMuPUISPq','5PYA5yIj5zMN57Uy5B6B','WPXrWQ7dJMy'],...(function(){return['fmkYoSoYWQGbWODwdCoxpN1BW73cMc/cJ3r6eSolCCkMpa','yCkxEZ0Q','WOWRzKlcK1OSFSoQsCksW4hcMLzpW73dPIiUjJHbDSoygCo4WQi','o0pcON/dIG','WQZcVmo6jf81','E8ohAa','WO/cSmowW4RcPmktW5VdVbn7jCoAwmkpbbFcN0SlcCoSW77dOq','W5RdTJm','WQvjWQ7dPwu','WPixW7OXW4i','dLJcJ1KS','W4ZdTKlcNCk0W6JcIW','n13dHmk+kG','W4JdQ8kTAHO','uSkDWPu','W4/dUb8','iSkBCCo0ia','aMFdRG','W5ehkCo6vq','W7O4W54','WOWYWRtcVCoEisHGWR83smk/FSo2EZbRFrG7','WQBcUSoX','CcWe','W6BdNSk3vW','ASk3vJ45','W4u7d8oZ','W73dUqpdVxS','WPFdIa1vWPWTsSo5iSk+','WPa+WRlcVCo7','jfBcOhhdILi','zmoCBSoRnSoVWOlcO8oBsW','W5ZdG8kBsW','W7nbv8oI','W5fVzNJcM1S6','WR7dSxi','W5xdVHxcKCkZ','W7ldHmotmHlcLhy','r8kTWR1KW4K','WOxdMXvvWP4','juldH8o0xa','WP7dKvldIcvDh1eKW55MW4JcPCko','eWXeW5/cU8k8','h+kDQmoB4P2+tG','iokDImoX4P2oWP/NR6lLIB7LPzJOTBuO','5l2O5OkE5yIz8lc0NU+7LG','W7O1WQelpxNcPsBcPq','WPZdI15dnHxcTqrSua','WPZcTN4','ACkGxXuusq','aMVcJ1i1','W5GHsCkUW4e','W5HsW5jzEq','b3ZcGL3dNW','fSkotCo5','WOpcSe7cULS','EmooEwuGzmkmW67dH2e','W4zbq3ZcQG','CHhdHmk7','W5TRW5BdPmktBxecW7j4','ExJcTvW8umk0W6VcNCk3qmk1bmo/kmoZWOGPWRRdOW','W5NINkGg4P+iAG','WRNcSmoI','W6hdJ8kLusaCW67cLCoqFG','EmoDE8oFlSo9WRi','WPlNRPFLIzVLPkZOT7BVVQa','W5FcVsHnWOa','WOhcTCogW5NcUa','tIxcQq','nSo9a0bveKS6WQr+e07dKq','W61eWR4','W67dLmot','5O6g56sW57Iv5P2Czr3dUmkYW7/dVHldO1ZcRa','W63dGG3dTfJdSghdHCkmWPHbuSkLd8oLzhFdKKvQdSkWcmoF','oCkhESoTk8oWWQBdPCo9rSk/CuNcJCk6WR3dHedcINykmmkt','WPlNRPFLIzVMIi3LIyW','W47dVahcMCkVW7i','aaP+W47cPSk3','WRZdH17dQIu','4P6PW6pMNkdOG7NMRPxNOkBLPjRNKPtdKW','WOBIN4Hl6k2H5Rgn5AEz6lEH776q5Psq5zge5BIE5Pwy5O69772N8jwAVa','W4RcPHfKWOm','WOhdIHbi','FHNdI8k9j8khWPjEWOHN','WOhcTCo9W48','imkgvmo0fq','W4mThCopyW','tmkdwbyO','WOuEW63cLSkkWRfJ','W7yrWRddPmk8','WRlINkFdPokCPNq','WOZdJ0n6bW/cQWa','WOdcRmoGW5O','WPpcRCk/AG','WPhcRCkfsL8','WQ87W4u','4PQ8y+IgIEwVIUs4RoI+G+IIKoMwOEMyS+AxHoMuNUIVRUE9OoMxLEIUNq','WPHhW6GVlG','kSkKkG','jNhdLmkRiG','WQ8dW5tdRf3dJCkkBrVcVW','i8kUiCovWQBdUmoSW689','WRfCW5GAfq','4P66WOVMNzpOG4hMRONNOkRLPlRNKOzl','r8k/W7CEna','WPpcTN3cJq','WPtcHmkgEvi','W488zCkhW7pdRSk5'];}())];}())];}());Iii11l=function(){return iiIi1I;};return Iii11l();};let signHotMaxRetryTimes=process[i1iIli(0x255,'!mTz')]['jd_dpqd_max_retry']||'0';const isNotify=process[i1iIli(0x287,'s]1j')][i1iIli(0x2a7,'GncB')]===i1iIli(0x211,'E!Xy');function iii1II(_0x30cbe0,_0x38e123){const _0x4f608f=Iii11l();return iii1II=function(_0x23f5db,_0x3b951d){_0x23f5db=_0x23f5db-0x1e9;let _0x3bbd53=_0x4f608f[_0x23f5db];if(iii1II['dFBbqX']===undefined){var _0x25d53c=function(_0x5c43c5){const _0x3e0a8='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x11c5f0='',_0x3d4511='';for(let _0x708326=0x0,_0x2b9460,_0x9d7c1e,_0x392322=0x0;_0x9d7c1e=_0x5c43c5['charAt'](_0x392322++);~_0x9d7c1e&&(_0x2b9460=_0x708326%0x4?_0x2b9460*0x40+_0x9d7c1e:_0x9d7c1e,_0x708326++%0x4)?_0x11c5f0+=String['fromCharCode'](0xff&_0x2b9460>>(-0x2*_0x708326&0x6)):0x0){_0x9d7c1e=_0x3e0a8['indexOf'](_0x9d7c1e);}for(let _0x233ee8=0x0,_0x301800=_0x11c5f0['length'];_0x233ee8<_0x301800;_0x233ee8++){_0x3d4511+='%'+('00'+_0x11c5f0['charCodeAt'](_0x233ee8)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x3d4511);};const _0x42b75a=function(_0x55efd,_0x4682c7){let _0x1c5cb4=[],_0x7dc268=0x0,_0x5a2c57,_0x5aa06a='';_0x55efd=_0x25d53c(_0x55efd);let _0x313379;for(_0x313379=0x0;_0x313379<0x100;_0x313379++){_0x1c5cb4[_0x313379]=_0x313379;}for(_0x313379=0x0;_0x313379<0x100;_0x313379++){_0x7dc268=(_0x7dc268+_0x1c5cb4[_0x313379]+_0x4682c7['charCodeAt'](_0x313379%_0x4682c7['length']))%0x100,_0x5a2c57=_0x1c5cb4[_0x313379],_0x1c5cb4[_0x313379]=_0x1c5cb4[_0x7dc268],_0x1c5cb4[_0x7dc268]=_0x5a2c57;}_0x313379=0x0,_0x7dc268=0x0;for(let _0x4259ab=0x0;_0x4259ab<_0x55efd['length'];_0x4259ab++){_0x313379=(_0x313379+0x1)%0x100,_0x7dc268=(_0x7dc268+_0x1c5cb4[_0x313379])%0x100,_0x5a2c57=_0x1c5cb4[_0x313379],_0x1c5cb4[_0x313379]=_0x1c5cb4[_0x7dc268],_0x1c5cb4[_0x7dc268]=_0x5a2c57,_0x5aa06a+=String['fromCharCode'](_0x55efd['charCodeAt'](_0x4259ab)^_0x1c5cb4[(_0x1c5cb4[_0x313379]+_0x1c5cb4[_0x7dc268])%0x100]);}return _0x5aa06a;};iii1II['YnrVHJ']=_0x42b75a,_0x30cbe0=arguments,iii1II['dFBbqX']=!![];}const _0x4ff5bd=_0x4f608f[0x0],_0x335863=_0x23f5db+_0x4ff5bd,_0x28be5b=_0x30cbe0[_0x335863];return!_0x28be5b?(iii1II['qyyRGJ']===undefined&&(iii1II['qyyRGJ']=!![]),_0x3bbd53=iii1II['YnrVHJ'](_0x3bbd53,_0x3b951d),_0x30cbe0[_0x335863]=_0x3bbd53):_0x3bbd53=_0x28be5b,_0x3bbd53;},iii1II(_0x30cbe0,_0x38e123);}let TokensMap=new Map();const signStatusMessages={0x1805c007:i1iIli(0x300,'NWK('),0x181688ea:'已达到签到上限',0x1843da61:i1iIli(0x204,'OF#E'),0x1843da62:i1iIli(0x31c,'bQYb'),0x184253c7:i1iIli(0x23d,']f9K'),0x192:'活动无效','-1':i1iIli(0x291,'*VN@')},invalidTokensMap=new Map(),CacheFile=__dirname+i1iIli(0x2ce,'ITkz'),cookiesArr=Object[i1iIli(0x317,'xTBJ')](jdCookie)['map'](iiill1=>jdCookie[iiill1])[i1iIli(0x266,'&]x0')](lIli1i=>lIli1i);!cookiesArr[0x0]&&($['msg']($[i1iIli(0x20b,'[$nN')],i1iIli(0x31e,'E!Xy')),process[i1iIli(0x1fd,'btQJ')](0x1));!(async()=>{const i1iIll=i1iIli,IIIII1={'daOwl':function(I1lIlI,ii1ill){return I1lIlI===ii1ill;},'zflWt':function(II1iI,llI1II){return II1iI!==llI1II;},'sQAsa':'123','uPcjo':'⚠\x20请先定义必要的环境变量后再运行脚本!','eycpg':function(lIli1l,lillIi){return lIli1l!==lillIi;},'JKmkC':i1iIll(0x305,'^!hG'),'tmjZc':function(illIi1,ii1ili){return illIi1>ii1ili;},'KgQcM':function(liil1i,lI1lil){return liil1i<=lI1lil;},'PbtPg':i1iIll(0x214,'&3sR'),'eTCPS':i1iIll(0x2ba,'OF#E'),'HnRXh':'xpHGZ','IFidH':function(i1l1iI,liil1l){return i1l1iI===liil1l;},'NZDHu':i1iIll(0x31a,']btI'),'Ioeyv':i1iIll(0x2ab,'DO@I'),'wgzoh':function(lI1lii,Iiili1){return lI1lii(Iiili1);},'KhaxN':i1iIll(0x290,'!t)e'),'BBahZ':i1iIll(0x217,'DO@I'),'Gylfv':'EOcWX','SfgsP':function(Iil1l1,i1i11I){return Iil1l1!==i1i11I;}};try{if(IIIII1[i1iIll(0x1ed,'[$nN')](IIIII1[i1iIll(0x233,'3CcX')],i1iIll(0x20a,'s]1j'))){if(II1liI['includes'](':')&&IIIII1[i1iIll(0x2d5,'rqan')](IlI1i1[i1iIll(0x248,'y9Oa')](':')['length'],0x3)){const iii1ii=iillli[i1iIll(0x296,'gd^M')](':');if(!iii1ii[0x0]||!iii1ii[0x1]||!iii1ii[0x2])return;I1l1Ii=iii1ii[0x0];if(IIIII1[i1iIll(0x320,'pmTn')](I1i11i[i1iIll(0x251,'HYti')],0x20)||!/^[A-Z0-9]*$/[i1iIll(0x2aa,'*&qc')](I1i11l))return;llIlii=iii1ii[0x1],llIlil=iii1ii[0x2],iii1ii[0x2]['startsWith'](i1iIll(0x26b,'ITkz'))&&IIIII1[i1iIll(0x2fa,'&]x0')](iii1ii[0x2][i1iIll(0x2b0,'gd^M')],0x8)&&!iii1ii[0x1][i1iIll(0x28f,'A6$A')](IIIII1[i1iIll(0x2f8,'8vd&')])&&(IlI1ii=iii1ii[0x2],lIIiii=iii1ii[0x1]),IiiIll['set'](IIlii,{'index':null,'venderId':IlI1il,'shopName':'','activityId':IilliI,'startTime':'','endTime':'','isValid':!![],'rules':[],'minLevel':null,'maxLevel':null});}}else{notify[i1iIll(0x231,'iMnN')]({'title':$[i1iIll(0x244,'3CcX')]});if(IIIII1['tmjZc'](tokensList['length'],0x0))tokensList=[...new Set(tokensList[i1iIll(0x297,'y9Oa')](iii1il=>iii1il!==''))];if(IIIII1[i1iIll(0x273,'J1Z1')](tokensList['length'],0x0)){console[i1iIll(0x1f3,'E!Xy')](IIIII1[i1iIll(0x200,'3bg!')]);return;}const il1iIi=require('fs');if(il1iIi[i1iIll(0x1ee,'*&qc')](CacheFile)){if(IIIII1[i1iIll(0x2c6,'BvKs')]!=='AHBcR'){const II11li=il1iIi[i1iIll(0x208,'*VN@')](CacheFile,IIIII1[i1iIll(0x2d4,'Mo*M')]),I1l11i=JSON[i1iIll(0x241,'PUta')](II11li);for(const iIIiiI in I1l11i){IIIII1[i1iIll(0x218,'HYti')](i1iIll(0x306,'pmTn'),i1iIll(0x294,'DO@I'))?TokensMap[i1iIll(0x2d0,'y9Oa')](iIIiiI,I1l11i[iIIiiI]):Iiii1[i1iIll(0x2f1,'PUta')](''+lIIili+IiiIil+i1iIll(0x2bd,'ePsi')+IiiIii+i1iIll(0x202,'3!FN'));}}else I11iII[i1iIll(0x284,']f9K')](I1ilIi);}$['waitTime']=null;if(runInterval){if(IIIII1[i1iIll(0x22d,'3bic')]!==i1iIll(0x267,'bQYb'))ii1I1i[i1iIll(0x2d2,'*VN@')]=!![];else try{if(IIIII1[i1iIll(0x2e9,'DO@I')](IIIII1[i1iIll(0x310,']btI')],IIIII1[i1iIll(0x21c,']f9K')]))iIli11['set'](Iiiil,!![]);else{const liiI1l=IIIII1[i1iIll(0x240,'iMnN')](parseInt,runInterval);liiI1l>=0x0&&($['waitTime']=liiI1l);}}catch{console[i1iIll(0x326,'rqan')](IIIII1[i1iIll(0x237,'*&qc')]);}}try{if(IIIII1[i1iIll(0x32d,'xTBJ')]===i1iIll(0x22a,'3!FN'))i1III=0x3;else{const i1ill=IIIII1[i1iIll(0x2b6,'HB9Y')](parseInt,signHotMaxRetryTimes);signHotMaxRetryTimes=i1ill>0x0?i1ill:0x0;}}catch{signHotMaxRetryTimes=0x3;}try{const I1l11l=parseInt(taskThreads);I1l11l>0x0&&I1l11l!==0x1&&(taskThreads=I1l11l);}catch{taskThreads=0x1;}try{if(IIIII1[i1iIll(0x2b8,'G1Ww')]==='EOcWX'){const lilIIi=parseInt(accountThreads);lilIIi>0x0&&IIIII1[i1iIll(0x319,'!mTz')](lilIIi,0x1)&&(accountThreads=lilIIi);}else{IiilI1['log'](IIIII1['uPcjo']);return;}}catch{if(i1iIll(0x2c7,'gd^M')===i1iIll(0x242,'y9Oa')){const i1i11l=l1lIiI[i1iIll(0x1f6,'A6$A')]();llliiI++,IilIiI[i1iIll(0x262,'4r4o')](i1i1I1(i1i11l));}else accountThreads=0x1;}await common[i1iIll(0x24c,')p)j')](accountThreads,cookiesArr,async(i1i11i,II11l1)=>{const i1lliI=i1iIll;await concMain(taskThreads,tokensList,i1i11i,II11l1,Main);if($[i1lliI(0x286,']f9K')])await $[i1lliI(0x2e4,'A6$A')]($['waitTime']);}),isNotify&¬ify[i1iIll(0x2c1,'bQYb')]()&&await notify[i1iIll(0x1f7,'E!Xy')]();}}catch(Iil1lI){console['log']('❌\x20脚本运行遇到了错误\x0a'+Iil1lI);}})()[i1iIli(0x27b,'ld!k')](IiiliI=>$[i1iIli(0x220,'&]x0')](IiiliI))['finally'](()=>$[i1iIli(0x254,'&]x0')]());async function Main(iii1iI,llIll){const liI1l1=i1iIli,il1iII={'bkoKv':function(I1iIIi,I1iIIl){return I1iIIi>=I1iIIl;},'KdXqw':liI1l1(0x322,'bQYb'),'xOzyP':function(lI1IIl,i1ilI){return lI1IIl===i1ilI;},'cfHig':'yDrXR','WGciI':'signCollectGift','XqoKI':function(iii1lI,i1ilI1){return iii1lI!==i1ilI1;},'cHMro':liI1l1(0x31d,'bQYb'),'sjSxd':function(Iiilii,Iil1li){return Iiilii>Iil1li;},'WUHnl':'dLeuk','ldesG':'dKOAM','gumbB':liI1l1(0x232,'8vd&'),'qYtCp':liI1l1(0x2f0,']btI'),'LNMPv':function(Iiilil,Iil1ll){return Iiilil/Iil1ll;},'Peqmm':function(iillI,lI1III){return iillI===lI1III;},'tijfG':'yPKMs','nDIAu':function(IIliIi,IllIiI){return IIliIi===IllIiI;},'Ukolx':'【提示】请先获取Cookie','uOJwx':liI1l1(0x24f,'*&qc'),'JoHHE':function(i1il1,I1l111){return i1il1(I1l111);},'ZJqFZ':liI1l1(0x312,'AcV6'),'vGurF':function(IIii1l,I1iIII){return IIii1l!==I1iIII;},'nZrII':'keep-alive','Esxno':'text/plain','QCXIG':liI1l1(0x29e,'HB9Y'),'mJWyh':function(liiI11,ililI1){return liiI11===ililI1;},'UbsJE':liI1l1(0x2b5,'btQJ'),'TaIQm':liI1l1(0x2f6,'J1Z1'),'oSDwj':function(IIii1i,i1ili,Iiill1){return IIii1i(i1ili,Iiill1);},'mVMNo':function(I1iII1,lilII1){return I1iII1===lilII1;},'dPwoy':liI1l1(0x2a3,'^!hG'),'Rimld':liI1l1(0x22c,'DO@I'),'xndIz':liI1l1(0x32a,'*VN@'),'oHiiP':liI1l1(0x1fc,'iMnN'),'gkegN':liI1l1(0x213,'flH1'),'LbcYP':function(iill1,iii1l1){return iill1||iii1l1;},'ZPiIN':liI1l1(0x28c,'HB9Y'),'MUjnh':function(IIliIl,II11ll){return IIliIl>II11ll;}},{title:iilli,UA:IlllIl,cookie:II11lI,message:lI1IIi}=llIll;if(invalidTokensMap['get'](iii1iI))return;let I1l11I='',Ilil1l='';const iIIiii=TokensMap[liI1l1(0x304,']f9K')](iii1iI);if(iIIiii)I1l11I=iIIiii[liI1l1(0x235,'!t)e')],Ilil1l=iIIiii[liI1l1(0x21b,'GncB')];else{if(il1iII[liI1l1(0x203,'ePsi')](il1iII['dPwoy'],liI1l1(0x316,'OF#E'))){const ililII=IlI1l(lilIil);il1iII[liI1l1(0x281,'BvKs')](ililII,0x0)&&(i1l1li['waitTime']=ililII);}else try{if(il1iII[liI1l1(0x314,'iMnN')]===il1iII[liI1l1(0x2e7,'^!hG')]){if(iii1iI[liI1l1(0x23a,'E!Xy')](':')&&iii1iI[liI1l1(0x278,'J1Z1')](':')['length']===0x3){if(il1iII[liI1l1(0x26c,'s]1j')](il1iII['xndIz'],il1iII['oHiiP']))lilIi1[liI1l1(0x27d,'AcV6')](IiilII,IliI1I[lI1Iii]);else{const i1ilII=iii1iI['split'](':');if(!i1ilII[0x0]||!i1ilII[0x1]||!i1ilII[0x2])return;iii1iI=i1ilII[0x0];if(il1iII[liI1l1(0x311,'^!hG')](iii1iI[liI1l1(0x328,'3bic')],0x20)||!/^[A-Z0-9]*$/[liI1l1(0x263,'btQJ')](iii1iI))return;Ilil1l=i1ilII[0x1],I1l11I=i1ilII[0x2],i1ilII[0x2]['startsWith'](liI1l1(0x213,'flH1'))&&i1ilII[0x2][liI1l1(0x309,'G1Ww')]===0x8&&!i1ilII[0x1][liI1l1(0x225,'nuTi')](il1iII[liI1l1(0x29f,'OF#E')])&&(Ilil1l=i1ilII[0x2],I1l11I=i1ilII[0x1]),TokensMap['set'](iii1iI,{'index':null,'venderId':I1l11I,'shopName':'','activityId':Ilil1l,'startTime':'','endTime':'','isValid':!![],'rules':[],'minLevel':null,'maxLevel':null});}}}else delete IlI1Ii[liI1l1(0x2c8,'^!hG')],delete i11I1I[liI1l1(0x1f1,'&]x0')][il1iII[liI1l1(0x257,'G1Ww')]];}catch(IllIi1){return;}}if(il1iII[liI1l1(0x224,'*VN@')](!I1l11I,!Ilil1l)){if(il1iII['XqoKI'](il1iII['ZPiIN'],il1iII[liI1l1(0x2a0,'*&qc')]))lil[liI1l1(0x236,'8vd&')](liI1l1(0x2e1,'4r4o')+IllI1l+liI1l1(0x226,')p)j')+(i11I1i['message']||IillIl));else return;}const iilll=Math[liI1l1(0x30e,'A6$A')](Date[liI1l1(0x26f,'*VN@')]()/0x3e8)+'000';if(invalidTokensMap[liI1l1(0x223,'BvKs')](iii1iI))return;let il1iI1=![],IlllIi;await i1l1Ii(il1iII[liI1l1(0x212,'flH1')]);if($[liI1l1(0x1fa,'gd^M')])await $[liI1l1(0x261,'3bic')]($[liI1l1(0x22e,'8vd&')]);if(il1iI1&&il1iII['MUjnh'](signHotMaxRetryTimes,0x0)){let Ii1ilI=0x0;while(Ii1ilI0x0&&iliIii[IiillI(0x303,'bQYb')](i1iiI,0x1)&&(li1Il=i1iiI);}else{const i1ilIl=lill1l?.['type'],llI11I=lill1l?.['discount'];let Il1i11='';switch(i1ilIl){case 0x1:Il1i11=IiillI(0x2bf,'flH1');break;case 0x4:Il1i11=llI11I+IiillI(0x20d,'xTBJ');break;case 0x6:Il1i11=llI11I+IiillI(0x229,'iMnN');break;case 0x9:console[IiillI(0x2c2,'nuTi')](lill1l),Il1i11=(lill1l?.[IiillI(0x1e9,'bQYb')][0x0]?.[IiillI(0x2b4,'K[um')]||'未知')+'🎁';break;case 0xa:Il1i11=llI11I+'元E卡🎁';break;case 0xe:Il1i11=il1iII['LNMPv'](llI11I,0x64)+IiillI(0x21e,'flH1');break;default:Il1i11='未知奖品('+i1ilIl+')';}Ill11i[IiillI(0x249,'ITkz')](Il1i11);}}}}if(il1iII['sjSxd'](Ill11i[IiillI(0x210,'4r4o')],0x0)){if(IiillI(0x325,'pmTn')===IiillI(0x1f8,'8vd&')){console[IiillI(0x2a4,'s*oR')](''+iilli+iii1iI+IiillI(0x2ec,'*&qc')+IlllIi+IiillI(0x1fb,'8vd&')+Ill11i[IiillI(0x26a,'pmTn')](',')+')');for(const iii1li of Ill11i){il1iII[IiillI(0x221,'*&qc')](IiillI(0x264,'ePsi'),'LrmAI')?(IllI11[IiillI(0x298,'*VN@')](l1llIi),II1llI&&(l1llIl[IiillI(0x2b7,']f9K')]=!![])):lI1IIi[IiillI(0x321,'3bg!')](iii1li);}}else II1lli[IiillI(0x260,'E!Xy')](ii1I1I,IiIl);}else IiillI(0x27a,'4r4o')!=='cnZbW'?l11i1I=!![]:console[IiillI(0x28d,'btQJ')](''+iilli+iii1iI+IiillI(0x21a,'PUta')+IlllIi+IiillI(0x2dd,'Mo*M'));il1iI1=![];}else{li1[IiillI(0x2a8,'y9Oa')](''+illIl1+l1llII+IiillI(0x272,'3bic')+IilIll+IiillI(0x22b,'pmTn')+lI11Ii[IiillI(0x2a6,'!t)e')]+')');if(!Iiill[l11i1i[IiillI(0x2ac,'3bic')]])lI11I1=!![];}}else{if(il1iII[IiillI(0x25b,'&]x0')](iliIil[IiillI(0x279,'3!FN')],0xc8)){const iii1ll=signStatusMessages[iliIil[IiillI(0x285,'K[um')]]||iliIil[IiillI(0x2fb,'nuTi')]+IiillI(0x324,'K[um');[0x1843da61,0x1843da62,0x192][IiillI(0x323,'xTBJ')](iliIil[IiillI(0x2b2,'xTBJ')])&&(il1iII['Peqmm'](il1iII[IiillI(0x1f0,')p)j')],'yPKMs')?invalidTokensMap['set'](iii1iI,!![]):I1iIiI['waitTime']=li1I1),console['log'](''+iilli+iii1iI+IiillI(0x2cf,'btQJ')+IlllIi+IiillI(0x21f,'G1Ww')+iii1ll+')'),(il1iII[IiillI(0x26e,'&3sR')](iliIil[IiillI(0x30b,'rqan')],'-1')||iliIil[IiillI(0x228,'HYti')]===-0x1)&&(IiillI(0x1f5,'btQJ')===IiillI(0x253,'!mTz')?lilIii[IiillI(0x256,']f9K')](IiillI(0x2f2,'3CcX')):il1iI1=!![]);}else{if(iliIil['msg']){console['log'](''+iilli+iii1iI+'\x20➜\x20❌\x20'+IlllIi+IiillI(0x2d3,'Mo*M')+iliIil['msg']+')');if(!signStatusMessages[iliIil['code']])il1iI1=!![];}else console['log'](''+iilli+iii1iI+IiillI(0x2be,'G1Ww')+IlllIi+'\x20-\x20'+JSON['stringify'](iliIil));}}break;}else I1llil=0x1;}catch(I1il1l){console[IiillI(0x234,'3bic')](IiillI(0x2f9,'A6$A')+II11i1+IiillI(0x271,'nuTi')+(I1il1l['message']||I1il1l));}}async function i1l1Ii(lI1l1l){const ili11I=liI1l1;let IIliII='',iiliI=null,Ill11I=null,I1il1i='GET',IliIIi={},lI1l1i={};switch(lI1l1l){case'signCollectGift':lI1l1i={'appId':'4da33','functionId':ili11I(0x318,'flH1'),'appid':il1iII[ili11I(0x209,'NWK(')],'body':{'token':iii1iI,'venderId':il1iII[ili11I(0x1eb,'OF#E')](parseInt,I1l11I)||'','activityId':parseInt(Ilil1l)||'','type':0x38,'actionType':0x7},'version':il1iII[ili11I(0x2f3,'8vd&')],'ua':IlllIl},IliIIi=await H5st[ili11I(0x243,'3!FN')](lI1l1i),IIliII=ili11I(0x2db,')p)j'),Ill11I=Object[ili11I(0x206,'ITkz')]({},IliIIi['paramsData'],{'jsonp':'jsonp1003'});break;}const i1iil={'t':iilll,'loginType':'2'};iiliI&&(il1iII[ili11I(0x2f5,'OF#E')]('cyfwz','LIhPS')?Object[ili11I(0x2fe,'ld!k')](iiliI,i1iil):(I1iIli=lI1Ill['venderId'],lI1Ili=IliilI[ili11I(0x2ae,'A6$A')]));Ill11I&&('kieLl'===ili11I(0x1ea,'iMnN')?(lilIl1['msg'](i1l1ii['name'],il1iII['Ukolx']),i1l1[ili11I(0x2ee,'rqan')](0x1)):Object['assign'](Ill11I,i1iil));const llI11l={'url':IIliII,'method':I1il1i,'headers':{'Accept':ili11I(0x29a,'nuTi'),'Accept-Encoding':ili11I(0x25d,']f9K'),'Accept-Language':'zh-CN,zh-Hans;q=0.9','Connection':il1iII[ili11I(0x246,'e^f(')],'Content-Type':il1iII[ili11I(0x2e0,'btQJ')],'Host':'api.m.jd.com','Referer':ili11I(0x270,'!t)e'),'Sec-Fetch-Dest':'script','Sec-Fetch-Mode':il1iII[ili11I(0x29c,'PUta')],'Sec-Fetch-Site':ili11I(0x277,'xTBJ'),'User-Agent':IlllIl,'Cookie':II11lI},'params':Ill11I,'data':iiliI,'timeout':0x7530};il1iII['mJWyh'](I1il1i,il1iII[ili11I(0x258,'AcV6')])&&(delete llI11l['data'],delete llI11l[ili11I(0x268,'^!hG')][ili11I(0x282,'&]x0')]);const I1llIl=0x3;let i1iii=0x0,I1llIi=null,IIii1I=![];while(i1iiiil1il),Ilil1i=il1l1['iasJJ'](decodeURIComponent,common[li11l(0x308,'AcV6')](Il1i1I,il1l1[li11l(0x2cb,'K[um')])),iili1='【账号'+Ii1iii+'】'+Ilil1i+':',II11ii=await common[li11l(0x2bb,'btQJ')](Il1i1I);if(!II11ii&&il1l1[li11l(0x29d,'ITkz')](typeof II11ii,li11l(0x2ea,'9M8D'))){if('vCUNP'===li11l(0x2c5,'&3sR'))return;else{console['log'](iili1+li11l(0x25f,'3CcX'));return;}}const Iil1iI=notify[li11l(0x2bc,'flH1')](Ii1iii,Ilil1i),II11il=common['genUA'](Ilil1i),iIIil1={'cookie':Il1i1I,'index':Ii1iii,'title':iili1,'UA':II11il,'message':Iil1iI};let IlllII=0x0;async function I1il1I(iIIili){await iIIilI(iIIili,iIIil1),IlllII--,II111();}async function II111(){const lliiIl=li11l,Ii1iiI={'vhYdU':lliiIl(0x23c,'&3sR')};if(il1l1[lliiIl(0x2c9,'nuTi')]!==lliiIl(0x25c,'btQJ'))while(il1l1['rWHkD'](IlllII,iliIi1)&&Ii1iil[lliiIl(0x2c3,'DO@I')]>0x0){if(il1l1[lliiIl(0x230,'DO@I')]('eyvYl',lliiIl(0x2e8,'3bic'))){const Ilil1I=Ii1iil[lliiIl(0x250,'J1Z1')]();IlllII++,await il1l1[lliiIl(0x29b,'HYti')](I1il1I,Ilil1I);}else{const II11iI=II11Ii[lliiIl(0x216,'3!FN')](II11Il,Ii1iiI[lliiIl(0x2af,'GncB')]),Il1i1l=IlI11['parse'](II11iI);for(const Iil1ii in Il1i1l){lilIlI['set'](Iil1ii,Il1i1l[Iil1ii]);}}}else IiilI['log'](''+ii1I11+liIi1+lliiIl(0x307,'3!FN')+lI11II+lliiIl(0x2d6,'s*oR')+l1llI1['stringify'](llIIll));}const lI1l1I=Math[li11l(0x2a1,'ePsi')](Ii1iil[li11l(0x2de,'HB9Y')],iliIi1),lill11=[];for(let Ii1ii1=0x0;il1l1[li11l(0x275,'DO@I')](Ii1ii1,lI1l1I);Ii1ii1++){const Ilil11=Ii1iil['shift']();IlllII++,lill11['push'](I1il1I(Ilil11));}await Promise[li11l(0x1f2,'ePsi')](lill11),II111(),await new Promise(i1ii1=>{const li11i=li11l,il1ii={'Zizwc':function(i1iIiI,IlllI1){return i1iIiI===IlllI1;},'yygPF':il1l1[li11i(0x2a5,'3bic')],'kaRjk':function(I1il11,lI1l11){return I1il11(lI1l11);}},llI111=setInterval(()=>{const lliiIi=li11i;il1ii[lliiIi(0x27e,'NWK(')](IlllII,0x0)&&(lliiIi(0x274,'9M8D')===il1ii[lliiIi(0x2eb,'e^f(')]?i1IIl=I1lll1:(il1ii[lliiIi(0x25e,'gd^M')](clearInterval,llI111),i1ii1()));},0x64);});}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)}