diff --git a/dist/bilibili-live-tasks-helper.min.user.js b/dist/bilibili-live-tasks-helper.min.user.js index 4b8cde44..b6cfda25 100644 --- a/dist/bilibili-live-tasks-helper.min.user.js +++ b/dist/bilibili-live-tasks-helper.min.user.js @@ -3,7 +3,7 @@ // @name:en Bilibili Live Tasks Helper // @name:zh Bilibili Live Tasks Helper // @namespace https://github.com/andywang425 -// @version 7.0.5 +// @version 7.0.6 // @author andywang425 // @description Enhancing the experience of watching Bilibili live streaming. // @description:en Enhancing the experience of watching Bilibili live streaming. @@ -39,4 +39,4 @@ // @grant unsafeWindow // @run-at document-end // ==/UserScript== -(e=>{const t=document.createElement("style");t.dataset.source="vite-plugin-monkey",t.textContent=" .title[data-v-dda95e10]{padding-left:20px;align-items:center;display:flex}.header-big-text[data-v-dda95e10]{font-size:var(--big-text-size)}.header-small-text[data-v-dda95e10]{font-size:var(--small-text-size);padding-top:calc(var(--big-text-size) - var(--small-text-size));margin-left:10px;--small-text-size: 18px}.collapse-btn[data-v-dda95e10]{display:flex;justify-content:center;align-items:center;height:100%;float:left;cursor:pointer}.avatar-wrap[data-v-eac67691]{width:80px;height:80px}.avatar[data-v-eac67691]{display:flex;justify-content:center;align-items:center;border-radius:50%}.base[data-v-4aed17ff]{z-index:1003;position:absolute;background-color:#fff;border-bottom:1px solid #e3e5e7;border-left:1px solid #e3e5e7;border-right:1px solid #e3e5e7}.header[data-v-4aed17ff]{position:relative;box-sizing:border-box;width:100%;font-size:var(--big-text-size);align-items:center;display:flex;border-bottom:1px solid #e3e5e7;height:60px;--big-text-size: 25px}.aside[data-v-4aed17ff]{width:auto}.aside #aside-el-menu[data-v-4aed17ff]:not(.el-menu--collapse){width:150px}.main[data-v-4aed17ff]{--main-top-botton-padding: calc(var(--el-main-padding) * .625);padding-top:var(--main-top-botton-padding);padding-bottom:var(--main-top-botton-padding)}.fade-enter-active[data-v-4aed17ff],.fade-leave-active[data-v-4aed17ff]{transition:opacity .1s ease}.fade-enter-from[data-v-4aed17ff],.fade-leave-to[data-v-4aed17ff]{opacity:0}.info-icon[data-v-c1d8df5e]{font-size:var(--el-font-size-base);cursor:pointer}.status-icon[data-v-2f9d6050]{font-size:var(--el-font-size-base)}.blth_btn{background-color:#23ade5;font-size:small;margin-inline-start:5px;color:#fff;border-radius:4px;border:none;padding:5px;cursor:pointer;box-shadow:0 0 2px #00000075;line-height:10px;margin-left:15px}.blth_btn:hover{background-color:#1097cc}.blth_btn:hover:active{background-color:#0e86b6;position:relative;top:1px}.el-link-va-baseline{vertical-align:baseline} ",document.head.append(t)})(),function(e,t,i,s,o,a,n,l){"use strict";function r(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const i in e)if("default"!==i){const s=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>e[i]})}return t.default=e,Object.freeze(t)}const c=r(a);var d=Object.defineProperty,u=(e,t,i)=>(((e,t,i)=>{t in e?d(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i})(e,"symbol"!=typeof t?t+"":t,i),i),h=(()=>"undefined"!=typeof GM_getValue?GM_getValue:void 0)(),m=(()=>"undefined"!=typeof GM_setValue?GM_setValue:void 0)(),g=(()=>"undefined"!=typeof GM_xmlhttpRequest?GM_xmlhttpRequest:void 0)(),f=(()=>"undefined"!=typeof unsafeWindow?unsafeWindow:void 0)();const p={ui:{isCollapse:!1,isShowPanel:!0,activeMenuIndex:"MainSiteTasks"},modules:{DailyTasks:{MainSiteTasks:{login:{enabled:!1,_lastCompleteTime:0},watch:{enabled:!1,_lastCompleteTime:0},coin:{enabled:!1,num:1,_lastCompleteTime:0},share:{enabled:!1,_lastCompleteTime:0}},LiveTasks:{sign:{enabled:!1,_lastCompleteTime:0},appUser:{enabled:!1,_lastCompleteTime:0},medalTasks:{danmu:{enabled:!1,list:["(⌒▽⌒)","( ̄▽ ̄)","(=・ω・=)","(`・ω・´)","(〜 ̄△ ̄)〜","(・∀・)","(°∀°)ノ","╮( ̄▽ ̄)╭","_(:3」∠)_","(^・ω・^ )","(● ̄(エ) ̄●)","ε=ε=(ノ≧∇≦)ノ","⁄(⁄ ⁄•⁄ω⁄•⁄ ⁄)⁄","←◡←","(●'◡'●)ノ♥"],_lastCompleteTime:0},like:{enabled:!1,_lastCompleteTime:0},watch:{enabled:!1,time:70,_watchedSecondsToday:0,_lastWatchTime:0,_lastCompleteTime:0},isWhiteList:!1,roomidList:[]}},OtherTasks:{groupSign:{enabled:!1,_lastCompleteTime:0},silverToCoin:{enabled:!1,_lastCompleteTime:0},coinToSilver:{enabled:!1,num:1,_lastCompleteTime:0}}},EnhanceExperience:{switchLiveStreamQuality:{enabled:!1,qualityDesc:"原画"},banp2p:{enabled:!1}}},cache:{lastAliveHeartBeatTime:0}};class v{static mergeConfigs(e,t){const s=i.difference(i.keys(e),i.keys(t));e=i.omit(e,s);const o=i.difference(i.keys(t),i.keys(e));i.assign(e,i.pick(t,o));for(const[s,a]of Object.entries(e).filter((e=>!o.includes(e[0]))))i.isPlainObject(a)&&(e[s]=this.mergeConfigs(a,t[s]));return e}static setUiConfig(e){m("ui",e)}static getUiConfig(){return this.mergeConfigs(h("ui",{}),p.ui)}static setModuleConfig(e){m("modules",e)}static getModuleConfig(){return this.mergeConfigs(h("modules",{}),p.modules)}static setCache(e){m("cache",e)}static getCache(){return this.mergeConfigs(h("cache",{}),p.cache)}}const T=t.defineStore("ui",(()=>{const t=e.reactive(v.getUiConfig()),s=e.computed((()=>({MainSiteTasks:"主站任务",LiveTasks:"直播任务",OtherTasks:"其它任务"}[t.activeMenuIndex]))),o=e.reactive({top:0,left:0,height:0,width:0}),a=e.computed((()=>({top:o.top.toString()+"px",left:o.left.toString()+"px",height:o.height.toString()+"px",width:o.width.toString()+"px"}))),n=e.computed((()=>t.isShowPanel?"隐藏控制面板":"显示控制面板")),l=e.computed((()=>(o.height-60).toString()+"px"));return e.watch(t,i.debounce((e=>v.setUiConfig(e)),350)),{isShowPanelButtonText:n,activeMenuName:s,baseStyleValue:o,baseStyle:a,scrollBarHeight:l,uiConfig:t,changeCollapse:function(){t.isCollapse=!t.isCollapse},changeShowPanel:function(){t.isShowPanel=!t.isShowPanel},setActiveMenuIndex:function(e){t.activeMenuIndex=e}}})),k=t.defineStore("bili",(()=>{const t=e.ref(),i=e.ref(),s=e.ref(),o=e.ref(),a=e.ref(),n=e.ref(),l=e.ref(),r=e.computed((()=>l.value?l.value.filter((e=>0!==e.room_info.room_id)):null));return{BilibiliLive:t,userInfo:s,giftConfig:o,cookies:i,dailyRewardInfo:a,dynamicVideos:n,fansMedals:l,filteredFansMedals:r}}));class w{constructor(e,t){u(this,"url_prefix"),u(this,"origin"),this.url_prefix=e??"",this.origin=t??"https://bilibili.com"}get(e,t,s){return new Promise(((o,a)=>{const n={method:"GET",url:this.url_prefix+e+(t?"?"+new URLSearchParams(t).toString():""),responseType:"json",headers:{Accept:"application/json, text/plain, */*",Referer:this.origin,Origin:this.origin,"Sec-Fetch-Site":"same-site"},onload:function(e){o(e.response)},onerror:function(e){a(e)}},l=i.defaultsDeep(s,n);g(l)}))}post(e,t,s){return new Promise(((o,a)=>{const n={method:"POST",url:this.url_prefix.concat(e),data:new URLSearchParams(t).toString(),responseType:"json",headers:{Accept:"application/json, text/plain, */*",Referer:this.origin,Origin:this.origin,"Sec-Fetch-Site":"same-site","Content-Type":"application/x-www-form-urlencoded"},onload:function(e){o(e.response)},onerror:function(e){a(e)}},l=i.defaultsDeep(s,n);"multipart/form-data"===l.headers["Content-Type"]&&delete l.headers["Content-Type"],g(l)}))}}function y(e){return new Promise((t=>setTimeout(t,e)))}function _(e){const t=new FormData;return i.forEach(e,((e,i)=>t.append(i,e.toString()))),t}function x(e,t,s){i.forOwn(e,(function(e,o){const a=s?s+"."+o:o;i.isPlainObject(e)&&!i.isEmpty(e)?x(e,t,a):t(e,a)}))}function b(e,t=0,i=5){const o=s.DateTime.fromMillis(e),a=s.DateTime.now().set({hour:t,minute:i,second:0,millisecond:0}),n=a.plus({days:1}),l=a.minus({days:1});return s.DateTime.now()>=a?o>=a&&o=l&&oo&&(o=o.plus({days:1}));const a=o.diff(i);return{ms:a.toMillis(),str:a.toFormat("h小时m分钟s秒").replace(/^0小时/,"").replace(/^0分钟/,"")}}function V(e,t,i,o){const a=s.DateTime.now(),n=s.DateTime.local(a.year,a.month,a.day,e,t),l=s.DateTime.local(a.year,a.month,a.day,i,o);return a>=n&&aP.live.get("/xlive/web-room/v1/giftPanel/roomGiftConfig",{platform:s,room_id:e,area_parent_id:t,area_id:i}),doSign:()=>P.live.get("/xlive/web-ucenter/v1/sign/DoSign"),getSignInfo:()=>P.live.get("/xlive/web-ucenter/v1/sign/WebGetSignInfo"),fansMedalPanel:(e,t=10)=>P.live.get("/xlive/app-ucenter/v1/fansMedal/panel",{page:e,page_size:t},{Origin:"https://link.bilibili.com",Referer:"https://link.bilibili.com/p/center/index"}),sendMsg:(e,t,i=0,s=1,o=0,a=25,n=16777215,l=0)=>{const r=k().cookies.bili_jct;return P.live.post("/msg/send",void 0,{data:_({roomid:t,room_type:i,rnd:S(),msg:e,mode:s,jumpfrom:o,fontsize:a,csrf:r,csrf_token:r,color:n,bubble:l}),headers:{"Content-Type":"multipart/form-data"}})},likeReport:(e,t)=>{const i=k().cookies.bili_jct;return P.live.post("/xlive/app-ucenter/v1/like_info_v3/like/likeReportV3",{room_id:e,anchor_id:t,uid:t,ts:S(),csrf:i})},getInfoByRoom:e=>P.live.get("/xlive/web-room/v1/index/getInfoByRoom",{room_id:e}),getUserTaskProgress:(e=11153765)=>{const t=k().cookies.bili_jct;return P.live.get("/xlive/app-ucenter/v1/userTask/GetUserTaskProgress",{target_id:e,csrf:t,ts:S()})},userTaskReceiveRewards:(e=11153765)=>{const t=k().cookies.bili_jct;return P.live.post("/xlive/app-ucenter/v1/userTask/UserTaskReceiveRewards",{actionKey:"csrf",target_id:e,csrf:t,ts:S()})},silver2coin:(e="")=>{const t=k().cookies.bili_jct;return P.live.post("/xlive/revenue/v1/wallet/silver2coin",{csrf:t,csrf_token:t,visit_id:e})},coin2silver:(e,t="pc",i="")=>{const s=k().cookies.bili_jct;return P.live.post("/xlive/revenue/v1/wallet/coin2silver",{num:e,csrf:s,csrf_token:s,platform:t,visit_id:i})}},I={E:(e,t,i,s=0,o=[],a="")=>{const n=k().cookies.bili_jct;return P.liveTrace.post("/xlive/data-interface/v1/x25Kn/E",{id:JSON.stringify(e),device:JSON.stringify(t),ruid:i,ts:N(),is_patch:s,heart_beat:JSON.stringify(o),ua:navigator.userAgent,csrf_token:n,csrf:n,visit_id:a})},X:(e,t,i,s,o,a,n,l,r="")=>{const c=k().cookies.bili_jct;return P.liveTrace.post("/xlive/data-interface/v1/x25Kn/X",{s:e,id:JSON.stringify(t),device:JSON.stringify(i),ruid:s,ets:o,benchmark:a,time:n,ts:l,ua:navigator.userAgent,csrf_token:c,csrf:c,visit_id:r})}},D={nav:()=>P.main.get("/x/web-interface/nav"),reward:()=>P.main.get("/x/member/web/exp/reward"),dynamicAll:(e,t=1,i=-480,s="itemOpusStyle")=>P.main.get("/x/polymer/web-dynamic/v1/feed/all",{timezone_offset:i,type:e,page:t,features:s}),videoHeartbeat:(e,t="",i=0,s=0,o=0,a="https://t.bilibili.com/?spm_id_from=444.3.0.0",n=116,l=100,r=3,c=0,d=0,u=2,h=0,m=0,g="333.488.0.0",f="333.31.list.card_archive.click",p='{"player_version":"4.1.21-rc.1727.0"}')=>{const v=k();return P.main.post("/x/click-interface/web/heartbeat",{start_ts:S(),mid:k().BilibiliLive.UID,aid:e,cid:t,type:r,sub_type:c,dt:u,play_type:d,realtime:i,played_time:s,real_played_time:o,refer_url:a,quality:n,video_duration:l,last_play_progress_time:h,max_play_progress_time:m,spmid:g,from_spmid:f,extra:p,csrf:v.cookies.bili_jct})},share:(e,t="pc_client_normal",i=2,s=0,o=1)=>{const a=k().cookies.bili_jct;return P.main.post("/x/web-interface/share/add",{aid:e,eab_x:i,ramval:s,source:t,ga:o,csrf:a})},coinAdd:(e,t,i=0,s=!0,o=2,a=6,n="web_normal",l=1)=>{const r=k().cookies.bili_jct;return P.main.post("/x/web-interface/coin/add ",{aid:e,multiply:t,select_like:i,cross_domain:s,eab_x:o,ramval:a,source:n,ga:l,csrf:r})},videoRelation:(e,t="")=>P.main.get("/x/web-interface/archive/relation",{aid:e,bvid:t})},M={myGroups:(e=0,t="web")=>P.vc.get("/link_group/v1/member/my_groups",{build:e,mobi_app:t}),signIn:(e,t)=>P.vc.get("/link_setting/v1/link_setting/sign_in",{group_id:e,owner_id:t})};class L{constructor(e){u(this,"NAME","BLTH"),u(this,"prefix_title_str"),u(this,"_title"),this._title=e,this.prefix_title_str=e.split("_").join("][")}get prefix(){return[`%c${this.NAME}%c[${(new Date).toLocaleString()}]%c[${this.prefix_title_str}]%c:`,"font-weight: bold; color: white; background-color: #23ade5; padding: 1px 4px; border-radius: 4px;","font-weight: bold; color: #0920e6;","font-weight: bold;",""]}log(...e){console.log(...this.prefix,...e)}error(...e){console.error(...this.prefix,...e)}warn(...e){console.warn(...this.prefix,...e)}}class ${constructor(e){u(this,"moduleName"),u(this,"logger"),u(this,"moduleStore",W()),u(this,"config"),this.moduleName=e,this.logger=new L(this.moduleName)}set status(e){throw new Error("Method not implemented.")}run(){throw new Error("Method not implemented.")}}u($,"runMultiple",!1);class A extends ${run(){throw new Error("Method not implemented.")}}u(A,"sequence");class E extends A{getBilibiliLive(){return this.logger.log("unsafeWindow.BilibiliLive",f.BilibiliLive),f.BilibiliLive}getCookies(){return function(e){const t={};for(const i of e)t[i]=null;for(const i of document.cookie.split("; ")){for(let s=0;se.enabled&&!b(e._lastCompleteTime))))return Promise.reject();try{const e=await D.reward();return this.logger.log("BAPI.main.reward response",e),0===e.code?Promise.resolve(e.data):(this.logger.error("获取主站每日任务完成情况失败",e.message),Promise.reject(e.message))}catch(e){return this.logger.error("获取主站每日任务完成情况出错",e),Promise.reject(e)}}async getDynamicVideo(){const e=this.moduleStore.moduleConfig.DailyTasks.MainSiteTasks;if(!Object.entries(e).filter((([e])=>["watch","share","coin"].includes(e))).some((e=>e[1].enabled&&!b(e[1]._lastCompleteTime))))return Promise.reject();try{const e=await D.dynamicAll("video");return this.logger.log("BAPI.main.dynamicAll response",e),0===e.code?Promise.resolve(e.data.items):(this.logger.error("获取主站每日任务完成情况失败",e.message),Promise.reject(e.message))}catch(e){return this.logger.error("获取主站每日任务完成情况出错",e),Promise.reject(e)}}async getFansMetals(e=10,t=!1){const i=this.moduleStore.moduleConfig.DailyTasks.LiveTasks.medalTasks;if(!t&&!Object.entries(i).filter((([e])=>["danmu","like","watch"].includes(e))).some((e=>e[1].enabled&&!b(e[1]._lastCompleteTime))))return Promise.reject();{const t=[];let i=1;try{const s=await B.fansMedalPanel(1);if(this.logger.log("BAPI.live.fansMedalPanel(1) response",s),0!==s.code)return this.logger.error("获取粉丝勋章列表第1页失败",s.message),Promise.reject(s.message);i=s.data.page_info.total_page,t.push(...s.data.special_list,...s.data.list);for(let o=2;o<=Math.min(i,e);o++){const e=await B.fansMedalPanel(o);if(this.logger.log(`BAPI.live.fansMedalPanel(${o}) response`,e),0!==s.code)return this.logger.error(`获取粉丝勋章列表第${o}页失败`,s.message),t;t.push(...e.data.list),await y(250)}return Promise.resolve(t)}catch(e){return Promise.reject(e)}}}async run(){const e=k();e.BilibiliLive=this.getBilibiliLive(),e.cookies=this.getCookies(),e.userInfo=await this.getUserInfo(),setTimeout((async()=>{e.userInfo=await this.getUserInfo()}),C(0,4).ms);const t=await Promise.allSettled([this.getGiftConfig(),this.getDailyRewardInfo(),this.getDynamicVideo(),this.getFansMetals()]);this.logger.log("allPromiseResult",t),e.giftConfig="fulfilled"===t[0].status?t[0].value:null,e.dailyRewardInfo="fulfilled"===t[1].status?t[1].value:null,setTimeout((async()=>{const e=k();e.dailyRewardInfo&&(e.dailyRewardInfo.login=!1,e.dailyRewardInfo.share=!1,e.dailyRewardInfo.watch=!1,e.dailyRewardInfo.coins=0),e.dailyRewardInfo=await this.getDailyRewardInfo()}),C(0,4).ms),e.dynamicVideos="fulfilled"===t[2].status?t[2].value:null,setTimeout((async()=>{e.dynamicVideos=await this.getDynamicVideo()}),C(0,4).ms),e.fansMedals="fulfilled"===t[3].status?t[3].value:null,setTimeout((async()=>{e.fansMedals=await this.getFansMetals()}),C(0,4).ms),W().emitter.on(this.moduleName,(async t=>{"getFansMetals"===t.target&&(e.fansMedals=await this.getFansMetals(10,!0))}))}}u(E,"sequence",0);const R=Object.freeze(Object.defineProperty({__proto__:null,BiliInfo:E},Symbol.toStringTag,{value:"Module"}));const O=document.querySelector.bind(document);document.querySelectorAll.bind(document);const j=document.createElement.bind(document);class U{constructor(e,t,i,s,o,a=!1){u(this,"logger",new L("RoomHeart")),u(this,"config"),u(this,"isLast"),u(this,"watchedSeconds"),u(this,"timer"),u(this,"stop",!1),u(this,"areaID"),u(this,"parentID"),u(this,"roomID"),u(this,"ruid"),u(this,"seq",0),u(this,"buvid",function(e){const t=e+"=";for(const e of document.cookie.split("; "))if(e.startsWith(t)){const i=e.substring(t.length);return decodeURIComponent(i)}return null}("LIVE_BUVID")),u(this,"uuid","xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))),u(this,"device",[this.buvid,this.uuid]),u(this,"ua",navigator.userAgent),u(this,"heartBeatInterval"),u(this,"secretKey"),u(this,"secretRule"),u(this,"timestamp"),this.roomID=e,this.areaID=t,this.parentID=i,this.ruid=s,this.watchedSeconds=o,this.isLast=a,this.config=W().moduleConfig.DailyTasks.LiveTasks.medalTasks.watch}set status(e){W().moduleStatus.DailyTasks.LiveTasks.medalTasks.watch=e}get id(){return[this.parentID,this.areaID,this.seq,this.roomID]}start(){if(this.buvid)return this.timer=setTimeout((()=>this.stop=!0),C(0,0).ms),this.E()}async E(){if(this.stop)this.status="";else try{const e=await I.E(this.id,this.device,this.ruid);this.logger.log(`BAPI.liveTrace.E(${this.id}, ${this.device}, ${this.ruid}) response`,e),0===e.code?(this.seq+=1,({heartbeat_interval:this.heartBeatInterval,secret_key:this.secretKey,secret_rule:this.secretRule,timestamp:this.timestamp}=e.data),setTimeout((()=>this.X()),1e3*this.heartBeatInterval)):this.logger.error(`BAPI.liveTrace.E(${this.id}, ${this.device}, ${this.ruid}) 失败`,e.message)}catch(e){this.logger.error(`BAPI.liveTrace.E(${this.id}, ${this.device}, ${this.ruid}) 出错`,e)}}async X(){if(this.stop)this.status="";else try{const e={id:JSON.stringify(this.id),device:JSON.stringify(this.device),ets:this.timestamp,benchmark:this.secretKey,time:this.heartBeatInterval,ts:N(),ua:this.ua},t=this.sypder(JSON.stringify(e),this.secretRule),i=await I.X(t,this.id,this.device,this.ruid,this.timestamp,this.secretKey,this.heartBeatInterval,e.ts);if(this.logger.log(`BAPI.liveTrace.X(${t}, ${this.id}, ${this.device}, ${this.ruid}, ${this.timestamp}, ${this.secretKey}, ${this.heartBeatInterval}, ${e.ts}) response`,i),0===i.code){if(this.seq+=1,this.watchedSeconds+=this.heartBeatInterval,this.isLast&&(this.config._watchedSecondsToday=this.watchedSeconds),this.watchedSeconds>=60*this.config.time)return this.isLast&&(this.config._lastCompleteTime=N(),this.logger.log("观看直播任务已完成"),this.status="done"),void clearTimeout(this.timer);({heartbeat_interval:this.heartBeatInterval,secret_key:this.secretKey,secret_rule:this.secretRule,timestamp:this.timestamp}=i.data),setTimeout((()=>this.X()),1e3*this.heartBeatInterval)}else this.logger.error(`BAPI.liveTrace.X(${t}, ${this.id}, ${this.device}, ${this.ruid}, ${this.timestamp}, ${this.secretKey}, ${this.heartBeatInterval}) 失败`,i.message)}catch(e){this.logger.error(`BAPI.liveTrace.X(s, ${this.id}, ${this.device}, ${this.ruid}, ${this.timestamp}, ${this.secretKey}, ${this.heartBeatInterval}) 出错`,e)}}sypder(e,t){const i=JSON.parse(e),[s,a,n,l]=JSON.parse(i.id),[r,c]=JSON.parse(i.device),d=i.benchmark,u={platform:"web",parent_id:s,area_id:a,seq_id:n,room_id:l,buvid:r,uuid:c,ets:i.ets,time:i.time,ts:i.ts};let h=JSON.stringify(u);for(const e of t)switch(e){case 0:default:h=o.HmacMD5(h,d).toString(o.enc.Hex);break;case 1:h=o.HmacSHA1(h,d).toString(o.enc.Hex);break;case 2:h=o.HmacSHA256(h,d).toString(o.enc.Hex);break;case 3:h=o.HmacSHA224(h,d).toString(o.enc.Hex);break;case 4:h=o.HmacSHA512(h,d).toString(o.enc.Hex);break;case 5:h=o.HmacSHA384(h,d).toString(o.enc.Hex)}return h}}class H extends ${constructor(){super(...arguments),u(this,"config",this.moduleStore.moduleConfig.EnhanceExperience.switchLiveStreamQuality)}async waitForPlayer(){return new Promise(((e,t)=>{const i=f.top?f.top:f,s=setInterval((()=>{i.livePlayer&&Object.prototype.hasOwnProperty.call(i.livePlayer,"switchQuality")&&Object.prototype.hasOwnProperty.call(i.livePlayer,"getPlayerInfo")&&(clearInterval(s),clearTimeout(o),e(i.livePlayer))}),200),o=setTimeout((()=>{clearInterval(s),clearTimeout(o),t()}),1e4)}))}switchQuality(e){const t=e.getPlayerInfo();if(0===t.liveStatus)this.logger.log("当前直播间未开播");else{const i=t.qualityCandidates.find((({desc:e})=>e===this.config.qualityDesc));i&&t.quality!==i.qn&&(e.switchQuality(i.qn),this.logger.log(`已将画质切换为${this.config.qualityDesc}`,i))}}async run(){if(this.logger.log("自动切换画质模块开始运行"),this.config.enabled)try{const e=await this.waitForPlayer();this.switchQuality(e)}catch(e){this.logger.error("等待播放器超时")}}}u(H,"runMultiple",!0);class z extends ${constructor(){super(...arguments),u(this,"config",this.moduleStore.moduleConfig.EnhanceExperience.banp2p)}async banP2P(){var e;const t=["RTCPeerConnection","mozRTCPeerConnection","webkitRTCPeerConnection"];for(const i of t)Object.prototype.hasOwnProperty.call(f,i)&&(null==(e=Object.getOwnPropertyDescriptor(f,i))?void 0:e.configurable)&&Object.defineProperty(f,i,{value:function(){this.addEventListener=function(){},this.createDataChannel=function(){return{close:function(){}}},this.createOffer=function(){},this.setLocalDescription=function(){},this.close=function(){},this.setRemoteDescription=function(){},this.createAnswer=function(){}},enumerable:!1,writable:!1,configurable:!1})}async run(){if(this.logger.log("禁用P2P模块开始运行"),this.config.enabled)try{await this.banP2P()}catch(e){this.logger.error("禁用P2P失败",e)}}}u(z,"runMultiple",!0);const F=Object.freeze(Object.defineProperty({__proto__:null,DailyTask_LiveTask_AppUserTask:class extends ${constructor(){super(...arguments),u(this,"config",this.moduleStore.moduleConfig.DailyTasks.LiveTasks.appUser)}set status(e){this.moduleStore.moduleStatus.DailyTasks.LiveTasks.appUser=e}async getUserTaskProgress(){try{const e=await B.getUserTaskProgress();return this.logger.log("BAPI.live.getUserTaskProgress response",e),0===e.code?e.data:(this.logger.error("获取APP用户任务进度失败",e.message),this.status="error",null)}catch(e){return this.logger.error("获取APP用户任务进度出错",e),this.status="error",null}}async userTaskReceiveRewards(){try{const e=await B.userTaskReceiveRewards();return this.logger.log("BAPI.live.userTaskReceiveRewards response",e),0===e.code?e.data:(this.logger.error("获取APP用户任务进度失败",e.message),this.status="error",null)}catch(e){return this.logger.error("获取APP用户任务进度出错",e),this.status="error",null}}async sendDanmu(e,t){try{const i=await B.sendMsg(e,t);this.logger.log(`BAPI.live.sendMsg(${e}, ${t})`,i),0===i.code?this.logger.log(`在直播间 ${t} 发送弹幕 ${e} 成功`):this.logger.error(`在直播间 ${t} 发送弹幕 ${e} 失败`,i.message)}catch(i){this.logger.error(`在直播间 ${t} 发送弹幕 ${e} 出错`,i)}}async run(){if(this.logger.log("APP用户任务模块开始运行"),this.logger.warn("APP用户任务暂时没有,该模块不运行"),this.config.enabled=!1,this.config.enabled)if(b(this.config._lastCompleteTime))V(0,0,0,5)?this.logger.log("昨天的APP用户任务已经完成过了,等到今天的00:05再执行"):(this.logger.log("今天已经完成过APP用户任务了"),this.status="done");else{this.status="running";const e=this.moduleStore.moduleConfig.DailyTasks.LiveTasks.medalTasks.danmu;e.enabled&&!b(e._lastCompleteTime)&&await function(e,t=-1){return new Promise((i=>{W().emitter.on(e,(e=>i(e))),-1!==t&&setTimeout(i,t)}))}(this.moduleName,3e5);const t=await this.getUserTaskProgress();if(t)if(-1!==t.is_surplus)if(3===t.day_task.status)this.config._lastCompleteTime=N(),this.status="done";else if(2===t.day_task.status){const e=await this.userTaskReceiveRewards();if(e){const t=e.num;t?this.logger.log(`领取奖励成功:${t}个电池`):this.logger.warn("领取奖励失败:未领取到电池"),this.config._lastCompleteTime=N(),this.status="done"}}else{let e=t.day_task.target-t.day_task.progress;for(;e>0;)await this.sendDanmu(`打卡${e}`,22474988),await y(2e3),e--;const i=await this.userTaskReceiveRewards();if(i){const e=i.num;e?this.logger.log(`领取奖励成功:${e}个电池`):this.logger.warn("领取奖励失败:未领取到电池"),this.config._lastCompleteTime=N(),this.status="done"}}else this.logger.log("今天APP用户任务的奖励已经没有了,明天早点来吧"),this.config._lastCompleteTime=N(),this.status="done"}const e=C();setTimeout((()=>this.run()),e.ms),this.logger.log("距离APP用户任务模块下次运行时间:",e.str)}},DailyTask_LiveTask_DanmuTask:class extends ${constructor(){super(...arguments),u(this,"medalTasksConfig",this.moduleStore.moduleConfig.DailyTasks.LiveTasks.medalTasks),u(this,"config",this.medalTasksConfig.danmu)}set status(e){this.moduleStore.moduleStatus.DailyTasks.LiveTasks.medalTasks.danmu=e}getRoomidList(){const e=k();return e.filteredFansMedals?e.filteredFansMedals.filter((e=>e.medal.level<20&&910884!=e.room_info.room_id&&(this.medalTasksConfig.isWhiteList?this.medalTasksConfig.roomidList.includes(e.room_info.room_id):!this.medalTasksConfig.roomidList.includes(e.room_info.room_id)))).map((e=>e.room_info.room_id)).slice(0,100):(this.status="error",null)}async sendDanmu(e,t){try{const i=await B.sendMsg(e,t);this.logger.log(`BAPI.live.sendMsg(${e}, ${t})`,i),0===i.code?this.logger.log(`在直播间 ${t} 发送弹幕 ${e} 成功`):this.logger.error(`在直播间 ${t} 发送弹幕 ${e} 失败`,i.message)}catch(i){this.logger.error(`在直播间 ${t} 发送弹幕 ${e} 出错`,i)}}async run(){if(this.logger.log("发送弹幕模块开始运行"),this.config.enabled)if(b(this.config._lastCompleteTime))V(0,0,0,5)?this.logger.log("昨天的发送弹幕任务已经完成过了,等到今天的00:05再执行"):(this.logger.log("今天已经完成过发送弹幕任务了"),this.status="done");else{this.status="running";const e=this.getRoomidList();if(e){const t=this.config.list;for(let i=0;ithis.run()),e.ms),this.logger.log("距离发送弹幕模块下次运行时间:",e.str)}},DailyTask_LiveTask_LikeTask:class extends ${constructor(){super(...arguments),u(this,"medalTasksConfig",this.moduleStore.moduleConfig.DailyTasks.LiveTasks.medalTasks),u(this,"config",this.medalTasksConfig.like)}set status(e){this.moduleStore.moduleStatus.DailyTasks.LiveTasks.medalTasks.like=e}getRoomidUidList(){const e=k();return e.filteredFansMedals?e.filteredFansMedals.filter((e=>e.medal.level<20&&(this.medalTasksConfig.isWhiteList?this.medalTasksConfig.roomidList.includes(e.room_info.room_id):!this.medalTasksConfig.roomidList.includes(e.room_info.room_id)))).map((e=>[e.room_info.room_id,e.medal.target_id])).slice(0,100):(this.status="error",null)}async like(e,t){try{const i=await B.likeReport(e,t);this.logger.log(`BAPI.live.likeReport(${e}, ${t})`,i),0===i.code?this.logger.log(`给主播点赞 房间号 = ${e} 主播UID = ${t} 成功`):this.logger.error(`给主播点赞 房间号 = ${e} 主播UID = ${t} 失败`,i.message)}catch(i){this.logger.error(`给主播点赞 房间号 = ${e} 主播UID = ${t} 出错`,i)}}async run(){if(this.logger.log("给主播点赞模块开始运行"),this.config.enabled)if(b(this.config._lastCompleteTime))V(0,0,0,5)?this.logger.log("昨天的给主播点赞任务已经完成过了,等到今天的00:05再执行"):(this.logger.log("今天已经完成过给主播点赞任务了"),this.status="done");else{this.status="running";const e=this.getRoomidUidList();if(e){for(const[t,i]of e)await this.like(t,i),await y(2e3);this.config._lastCompleteTime=N(),this.status="done",this.logger.log("给主播点赞任务已完成")}}const e=C();setTimeout((()=>this.run()),e.ms),this.logger.log("距离给主播点赞模块下次运行时间:",e.str)}},DailyTask_LiveTask_SignTask:class extends ${constructor(){super(...arguments),u(this,"config",this.moduleStore.moduleConfig.DailyTasks.LiveTasks.sign)}set status(e){this.moduleStore.moduleStatus.DailyTasks.LiveTasks.sign=e}async getSignInfo(){try{const e=await B.getSignInfo();return this.logger.log("BAPI.live.getSignInfo response",e),0===e.code?e.data:(this.logger.error("获取直播签到信息失败",e.message),null)}catch(e){return this.logger.error("获取直播签到信息出错",e),null}}async sign(){try{const e=await B.doSign();if(this.logger.log("BAPI.live.doSign response",e),0===e.code){this.logger.log("直播签到成功,获得奖励:",e.data.text),this.config._lastCompleteTime=N(),this.status="done",this.logger.log("直播签到任务已完成");const t=O(".checkin-btn");t&&t.remove()}else this.logger.error("直播签到失败",e.message),this.status="error"}catch(e){this.logger.error("执行直播签到任务出错",e),this.status="error"}}async run(){if(this.logger.log("直播签到模块开始运行"),this.config.enabled)if(b(this.config._lastCompleteTime))V(0,0,0,5)?this.logger.log("昨天的直播签到任务已经完成过了,等到今天的00:05再执行"):(this.logger.log("今天已经完成过直播签到任务了"),this.status="done");else{this.status="running";const e=await this.getSignInfo();e?0===e.status?await this.sign():(this.config._lastCompleteTime=N(),this.status="done"):await this.sign()}const e=C();setTimeout((()=>this.run()),e.ms),this.logger.log("距离直播签到模块下次运行时间:",e.str)}},DailyTask_LiveTask_WatchTask:class extends ${constructor(){super(...arguments),u(this,"medalTasksConfig",this.moduleStore.moduleConfig.DailyTasks.LiveTasks.medalTasks),u(this,"config",this.medalTasksConfig.watch)}set status(e){this.moduleStore.moduleStatus.DailyTasks.LiveTasks.medalTasks.watch=e}getRoomidUidList(){const e=k();return e.filteredFansMedals?e.filteredFansMedals.filter((e=>e.medal.level<20&&(this.medalTasksConfig.isWhiteList?this.medalTasksConfig.roomidList.includes(e.room_info.room_id):!this.medalTasksConfig.roomidList.includes(e.room_info.room_id)))).map((e=>[e.room_info.room_id,e.medal.target_id])).slice(0,100):null}async getAreaInfo(e){try{const t=await B.getInfoByRoom(e);if(this.logger.log(`BAPI.live.getInfoByRoom(${e}) response`,t),0===t.code){const e=t.data.room_info;return[e.area_id,e.parent_area_id]}return null}catch(t){return this.logger.error(`获取指定直播间的 area_id 和 parent_area_id(roomid = ${e}) 出错`,t),null}}async run(){if(this.logger.log("观看直播模块开始运行"),this.config.enabled)if(b(this.config._lastCompleteTime))V(0,0,0,5)?this.logger.log("昨天的观看直播任务已经完成过了,等到今天的00:05再执行"):(this.logger.log("今天已经完成过观看直播任务了"),this.status="done");else{this.status="running",b(this.config._lastWatchTime,0,0)?this.config._watchedSecondsToday-=this.config._watchedSecondsToday%300:this.config._watchedSecondsToday=0,this.config._lastWatchTime=N();const e=this.getRoomidUidList();if(e)if(0===e.length)this.status="done",this.config._lastCompleteTime=N();else for(let t=0;te>0))&&new U(i,o[0],o[1],s,this.config._watchedSecondsToday,t===e.length-1).start(),await y(3e3)}}const e=C();setTimeout((()=>this.run()),e.ms),this.logger.log("距离观看直播模块下次运行时间:",e.str)}},DailyTask_MainSiteTask_CoinTask:class extends ${constructor(){super(...arguments),u(this,"config",this.moduleStore.moduleConfig.DailyTasks.MainSiteTasks.coin),u(this,"MAX_COIN",1)}set status(e){this.moduleStore.moduleStatus.DailyTasks.MainSiteTasks.coin=e}getDynamicVideoIds(){const e=k();return i.isEmpty(e.dynamicVideos)?(this.status="error",null):e.dynamicVideos.map((e=>{const t=e.modules.module_dynamic.major.archive;return{aid:t.aid,bvid:t.bvid}}))}async getVideoCoinInfo(e,t){try{const i=await D.videoRelation(e,t);return this.logger.log(`BAPI.main.videoRelation(${e}, ${t}) response`,i),0===i.code?i.data.coin:(this.logger.error(`获取视频投币信息失败 aid = ${e} bvid = ${t}`,i.message),0)}catch(i){return this.logger.error(`获取视频投币信息出错 aid = ${e} bvid = ${t}`,i),0}}async coinDynamicVideos(e){const t=this.getDynamicVideoIds();if(t)for(const{aid:i,bvid:s}of t){const t=await this.getVideoCoinInfo(i,s),o=this.MAX_COIN-t;if(o>0){const t=Math.min(o,e),s=await this.coin(i,t);if(0===s){if(0===(e-=t)){this.logger.log("每日投币任务已完成"),this.config._lastCompleteTime=N(),this.status="done";break}}else if(1===s){this.status="error";break}}}}async coin(e,t){try{const i=await D.coinAdd(e,t);return this.logger.log(`BAPI.main.coinAdd(${e}) response`,i),0===i.code?(this.logger.log(`投币成功 视频aid = ${e} 投币数量num = ${t}`),0):-104===i.code?(this.logger.warn("硬币余额不足,每日投币任务终止"),1):(this.logger.error(`投币失败 视频aid = ${e} 投币数量num = ${t}`,i.message),2)}catch(i){return this.logger.error(`投币出错 视频aid = ${e} 投币数量num = ${t}`,i),3}}async run(){if(this.logger.log("每日投币模块开始运行"),this.config.enabled){const e=k();if(b(this.config._lastCompleteTime))V(0,0,0,5)?this.logger.log("昨天的每日投币任务已经完成过了,等到今天的00:05再执行"):(this.logger.log("今天已经完成过每日投币任务了"),this.status="done");else if(this.status="running",e.dailyRewardInfo){const t=e.dailyRewardInfo.coins/10;if(t(k().userInfo.money??5)?(this.logger.log("硬币余额不足,不执行每日投币任务"),this.status="done"):await this.coinDynamicVideos(e)}else this.config._lastCompleteTime=N(),this.status="done",this.logger.log("每日投币任务已完成")}}const e=C();setTimeout((()=>this.run()),e.ms),this.logger.log("距离每日投币模块下次运行时间:",e.str)}},DailyTask_MainSiteTask_LoginTask:class extends ${constructor(){super(...arguments),u(this,"config",this.moduleStore.moduleConfig.DailyTasks.MainSiteTasks.login)}set status(e){this.moduleStore.moduleStatus.DailyTasks.MainSiteTasks.login=e}async login(){return this.logger.log("每日登录任务已完成"),this.config._lastCompleteTime=N(),this.status="done",Promise.resolve()}async run(){if(this.logger.log("每日登录模块开始运行"),this.config.enabled){const e=k();b(this.config._lastCompleteTime)?V(0,0,0,5)?this.logger.log("昨天的每日登录任务已经完成过了,等到今天的00:05再执行"):(this.logger.log("今天已经完成过每日登录任务了"),this.status="done"):(this.status="running",e.dailyRewardInfo&&!e.dailyRewardInfo.login?await this.login():(this.config._lastCompleteTime=N(),this.status="done"))}const e=C();setTimeout((()=>this.run()),e.ms),this.logger.log("距离每日登录模块下次运行时间:",e.str)}},DailyTask_MainSiteTask_ShareTask:class extends ${constructor(){super(...arguments),u(this,"config",this.moduleStore.moduleConfig.DailyTasks.MainSiteTasks.share)}set status(e){this.moduleStore.moduleStatus.DailyTasks.MainSiteTasks.share=e}getAid(){const e=k();return i.isEmpty(e.dynamicVideos)?"2":e.dynamicVideos[0].modules.module_dynamic.major.archive.aid}async share(e){try{const t=await D.share(e);this.logger.log(`BAPI.main.share(${e}) response`,t),0===t.code||71e3===t.code?(this.logger.log("每日分享视频任务已完成"),this.config._lastCompleteTime=N(),this.status="done"):(this.logger.error("分享视频失败",t.message),this.status="error")}catch(e){this.logger.error("执行每日分享视频任务出错",e),this.status="error"}}async run(){if(this.logger.log("每日分享视频模块开始运行"),this.config.enabled){const e=k();if(b(this.config._lastCompleteTime))V(0,0,0,5)?this.logger.log("昨天的每日分享任务已经完成过了,等到今天的00:05再执行"):(this.logger.log("今天已经完成过每日分享任务了"),this.status="done");else if(this.status="running",e.dailyRewardInfo&&!e.dailyRewardInfo.share){const e=this.getAid();await this.share(e)}else this.config._lastCompleteTime=N(),this.status="done",this.logger.log("每日分享视频任务已完成")}const e=C();setTimeout((()=>this.run()),e.ms),this.logger.log("距离每日分享视频模块下次运行时间:",e.str)}},DailyTask_MainSiteTask_WatchTask:class extends ${constructor(){super(...arguments),u(this,"config",this.moduleStore.moduleConfig.DailyTasks.MainSiteTasks.watch)}set status(e){this.moduleStore.moduleStatus.DailyTasks.MainSiteTasks.watch=e}getAid(){const e=k();return i.isEmpty(e.dynamicVideos)?"2":e.dynamicVideos[0].modules.module_dynamic.major.archive.aid}async watch(e){try{const t=await D.videoHeartbeat(e);this.logger.log(`BAPI.main.videoHeartbeat(${e}) response`,t),0===t.code?(this.logger.log("每日观看视频任务已完成"),this.config._lastCompleteTime=N(),this.status="done"):(this.logger.error("发送观看视频心跳失败",t.message),this.status="error")}catch(e){this.logger.error("执行每日观看视频任务出错",e),this.status="error"}}async run(){if(this.logger.log("每日观看视频模块开始运行"),this.config.enabled){const e=k();if(b(this.config._lastCompleteTime))V(0,0,0,5)?this.logger.log("昨天的每日观看视频任务已经完成过了,等到今天的00:05再执行"):(this.logger.log("今天已经完成过每日观看视频任务了"),this.status="done");else if(this.status="running",e.dailyRewardInfo&&!e.dailyRewardInfo.watch){const e=this.getAid();await this.watch(e)}else this.config._lastCompleteTime=N(),this.status="done",this.logger.log("每日观看视频任务已完成")}const e=C();setTimeout((()=>this.run()),e.ms),this.logger.log("距离每日观看视频模块下次运行时间:",e.str)}},DailyTask_OtherTask_CoinToSilver:class extends ${constructor(){super(...arguments),u(this,"config",this.moduleStore.moduleConfig.DailyTasks.OtherTasks.coinToSilver)}set status(e){this.moduleStore.moduleStatus.DailyTasks.OtherTasks.coinToSilver=e}async exchange(){try{const e=await B.coin2silver(this.config.num);this.logger.log(`BAPI.live.coin2silver{${this.config.num}} response`,e),0===e.code?(this.logger.log("硬币换银瓜子已完成,获得银瓜子:",e.data.silver),this.config._lastCompleteTime=N(),this.status="done"):(this.logger.error("硬币换银瓜子失败",e.message),this.status="error")}catch(e){this.logger.error("硬币换银瓜子出错",e),this.status="error"}}async run(){this.logger.log("硬币换银瓜子模块开始运行"),this.config.enabled&&(b(this.config._lastCompleteTime)?V(0,0,0,5)?this.logger.log("昨天的硬币换银瓜子任务已经完成过了,等到今天的00:05再执行"):(this.logger.log("今天已经完成过硬币换银瓜子任务了"),this.status="done"):(this.status="running",await this.exchange()));const e=C();setTimeout((()=>this.run()),e.ms),this.logger.log("硬币换银瓜子模块下次运行时间:",e.str)}},DailyTask_OtherTask_GroupSignTask:class extends ${constructor(){super(...arguments),u(this,"config",this.moduleStore.moduleConfig.DailyTasks.OtherTasks.groupSign)}set status(e){this.moduleStore.moduleStatus.DailyTasks.OtherTasks.groupSign=e}async getGroupidOwneruidList(){try{const e=await M.myGroups();if(this.logger.log("BAPI.vc.myGroups response",e),0===e.code)return e.data.list.map((e=>[e.group_id,e.owner_uid]));this.logger.error("获取应援团信息失败",e.message),this.status="error"}catch(e){this.logger.error("获取应援团信息出错",e),this.status="error"}}async sign(e,t){try{const i=await M.signIn(e,t);this.logger.log(`BAPI.vc.signIn(${e}, ${t}) response`,i),0===i.code?this.logger.log(`应援团签到 应援团ID = ${e} 拥有者UID = ${t} 成功, 粉丝勋章亲密度+${i.data.add_num}`):this.logger.error(`应援团签到 应援团ID = ${e} 拥有者UID = ${t} 失败`,i.message)}catch(i){this.logger.error(`应援团签到 应援团ID = ${e} 拥有者UID = ${t} 出错`,i)}}async run(){if(this.logger.log("应援团签到模块开始运行"),this.config.enabled)if(b(this.config._lastCompleteTime,8,5))V(0,0,8,5)?this.logger.log("昨天的应援团签到任务已经完成过了,等到今天早上八点零五分再次执行"):(this.logger.log("今天已经完成过应援团签到任务了"),this.status="done");else{this.status="running";const e=await this.getGroupidOwneruidList();if(e){for(const[t,i]of e)await this.sign(t,i),await y(2e3);this.config._lastCompleteTime=N(),this.logger.log("应援团签到任务已完成"),this.status="done"}}const e=C(8,5);setTimeout((()=>this.run()),e.ms),this.logger.log("距离应援团签到模块下次运行时间:",e.str)}},DailyTask_OtherTask_SilverToCoin:class extends ${constructor(){super(...arguments),u(this,"config",this.moduleStore.moduleConfig.DailyTasks.OtherTasks.silverToCoin)}set status(e){this.moduleStore.moduleStatus.DailyTasks.OtherTasks.silverToCoin=e}async exchange(){try{const e=await B.silver2coin();this.logger.log("BAPI.live.silver2coin response",e),0===e.code?(this.logger.log("银瓜子换硬币已完成,获得硬币:",e.data.coin),this.config._lastCompleteTime=N(),this.status="done"):403===e.code?(this.logger.log("每天最多只能用银瓜子兑换1个硬币"),this.config._lastCompleteTime=N(),this.status="done"):(this.logger.error("银瓜子换硬币失败",e.message),this.status="error")}catch(e){this.logger.error("银瓜子换硬币出错",e),this.status="error"}}async run(){this.logger.log("银瓜子换硬币模块开始运行"),this.config.enabled&&(b(this.config._lastCompleteTime)?V(0,0,0,5)?this.logger.log("昨天的银瓜子换硬币任务已经完成过了,等到今天的00:05再执行"):(this.logger.log("今天已经完成过银瓜子换硬币任务了"),this.status="done"):(this.status="running",await this.exchange()));const e=C();setTimeout((()=>this.run()),e.ms),this.logger.log("银瓜子换硬币模块下次运行时间:",e.str)}},EnhanceExperience_BanP2P:z,EnhanceExperience_SwitchLiveStreamQuality:H},Symbol.toStringTag,{value:"Module"}));const q=t.defineStore("cache",(()=>{const t=e.reactive(v.getCache()),i=e.ref(!1);return e.watch(t,(e=>v.setCache(e))),{cache:t,isMainBLTHRunning:i,startAliveHeartBeat:function(){t.lastAliveHeartBeatTime=Date.now();const e=setInterval((()=>t.lastAliveHeartBeatTime=Date.now()),5e3);window.onunload=()=>{clearInterval(e),t.lastAliveHeartBeatTime=0}},checkIfMainBLTHRunning:function(){0!==t.lastAliveHeartBeatTime&&Date.now()-t.lastAliveHeartBeatTime<8e3?i.value=!0:i.value=!1}}})),G={DailyTasks:{MainSiteTasks:{login:"",watch:"",coin:"",share:""},LiveTasks:{sign:"",appUser:"",medalTasks:{danmu:"",like:"",watch:""}},OtherTasks:{groupSign:"",silverToCoin:"",coinToSilver:""}}},W=t.defineStore("module",(()=>{const t=e.reactive(v.getModuleConfig()),s={all:o=o||new Map,on:function(e,t){var i=o.get(e);i?i.push(t):o.set(e,[t])},off:function(e,t){var i=o.get(e);i&&(t?i.splice(i.indexOf(t)>>>0,1):o.set(e,[]))},emit:function(e,t){var i=o.get(e);i&&i.slice().map((function(e){e(t)})),(i=o.get("*"))&&i.slice().map((function(i){i(e,t)}))}};var o;const a=e.reactive(G);return e.watch(t,i.debounce((e=>v.setModuleConfig(e)),250,{leading:!0,trailing:!0})),function e(){setTimeout((()=>{x(a,((e,t)=>{i.set(a,t,"")})),e()}),C(0,0).ms)}(),{moduleConfig:t,emitter:s,moduleStatus:a,loadModules:async function(){const e=q();for(const[t,i]of Object.entries(R).sort(((e,t)=>e[1].sequence-t[1].sequence)))try{!i.runMultiple&&e.isMainBLTHRunning||await new i(t).run()}catch(e){return void new L("loadModules").error("加载默认模块时发生致命错误,挂机助手停止运行:",e)}for(const[t,i]of Object.entries(F))!i.runMultiple&&e.isMainBLTHRunning||new i(t).run()}}})),J={class:"title"},K=(e,t)=>{const i=e.__vccOpts||e;for(const[e,s]of t)i[e]=s;return i},Q=K(e.defineComponent({__name:"PanelHeader",setup(t){const i=T();return(t,s)=>{const o=e.resolveComponent("el-icon"),n=e.resolveComponent("el-text");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"collapse-btn",onClick:s[0]||(s[0]=t=>e.unref(i).changeCollapse())},[e.unref(i).uiConfig.isCollapse?(e.openBlock(),e.createBlock(o,{key:0},{default:e.withCtx((()=>[e.createVNode(e.unref(a.Expand))])),_:1})):(e.openBlock(),e.createBlock(o,{key:1},{default:e.withCtx((()=>[e.createVNode(e.unref(a.Fold))])),_:1}))]),e.createElementVNode("div",J,[e.createVNode(n,{tag:"b",class:"header-big-text"},{default:e.withCtx((()=>[e.createTextVNode("控制面板")])),_:1}),e.createVNode(n,{class:"header-small-text"},{default:e.withCtx((()=>[e.createTextVNode(e.toDisplayString(e.unref(i).activeMenuName),1)])),_:1})])],64)}}}),[["__scopeId","data-v-dda95e10"]]),X=e.defineComponent({__name:"PanelAside",setup(t){const i=T(),s=[{icon:"Tasks",title:"每日任务",index:"DailyTasks",subs:[{title:"主站任务",index:"MainSiteTasks"},{title:"直播任务",index:"LiveTasks"},{title:"其它任务",index:"OtherTasks"}]},{icon:"Monitor",title:"体验优化",index:"EnhanceExperience"}];return(t,o)=>{const a=e.resolveComponent("el-icon"),n=e.resolveComponent("el-menu-item"),l=e.resolveComponent("el-sub-menu"),r=e.resolveComponent("el-menu");return e.openBlock(),e.createBlock(r,{"default-active":e.unref(i).uiConfig.activeMenuIndex,style:e.normalizeStyle({"min-height":e.unref(i).scrollBarHeight}),collapse:e.unref(i).uiConfig.isCollapse,"unique-opened":"",onSelect:e.unref(i).setActiveMenuIndex,id:"aside-el-menu"},{default:e.withCtx((()=>[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(s,(t=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[t.subs?(e.openBlock(),e.createBlock(l,{index:t.index,key:t.index},{title:e.withCtx((()=>[e.createVNode(a,null,{default:e.withCtx((()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.icon)))])),_:2},1024),e.createElementVNode("span",null,e.toDisplayString(t.title),1)])),default:e.withCtx((()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.subs,(t=>(e.openBlock(),e.createBlock(n,{key:t.index,index:t.index},{default:e.withCtx((()=>[e.createTextVNode(e.toDisplayString(t.title),1)])),_:2},1032,["index"])))),128))])),_:2},1032,["index"])):(e.openBlock(),e.createBlock(n,{index:t.index,key:t.index},{title:e.withCtx((()=>[e.createTextVNode(e.toDisplayString(t.title),1)])),default:e.withCtx((()=>[e.createVNode(a,null,{default:e.withCtx((()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.icon)))])),_:2},1024)])),_:2},1032,["index"]))],64)))),64))])),_:1},8,["default-active","style","collapse","onSelect"])}}}),Z=e.defineComponent({__name:"MainSiteTasks",setup(t){const i=W(),s=i.moduleConfig.DailyTasks.MainSiteTasks,o=i.moduleStatus.DailyTasks.MainSiteTasks;return(t,i)=>{const a=e.resolveComponent("el-switch"),n=e.resolveComponent("Info"),l=e.resolveComponent("TaskStatus"),r=e.resolveComponent("el-space"),c=e.resolveComponent("el-row"),d=e.resolveComponent("el-option"),u=e.resolveComponent("el-select"),h=e.resolveComponent("el-text"),m=e.resolveComponent("el-divider"),g=e.resolveComponent("el-link");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(c,null,{default:e.withCtx((()=>[e.createVNode(r,{wrap:""},{default:e.withCtx((()=>[e.createVNode(a,{modelValue:e.unref(s).login.enabled,"onUpdate:modelValue":i[0]||(i[0]=t=>e.unref(s).login.enabled=t),"active-text":"每日登录"},null,8,["modelValue"]),e.createVNode(n,{id:"DailyTasks.MainSiteTasks.login"}),e.createVNode(l,{status:e.unref(o).login},null,8,["status"])])),_:1})])),_:1}),e.createVNode(c,null,{default:e.withCtx((()=>[e.createVNode(r,{wrap:""},{default:e.withCtx((()=>[e.createVNode(a,{modelValue:e.unref(s).watch.enabled,"onUpdate:modelValue":i[1]||(i[1]=t=>e.unref(s).watch.enabled=t),"active-text":"每日观看视频"},null,8,["modelValue"]),e.createVNode(n,{id:"DailyTasks.MainSiteTasks.watch"}),e.createVNode(l,{status:e.unref(o).watch},null,8,["status"])])),_:1})])),_:1}),e.createVNode(c,null,{default:e.withCtx((()=>[e.createVNode(r,{wrap:""},{default:e.withCtx((()=>[e.createVNode(a,{modelValue:e.unref(s).coin.enabled,"onUpdate:modelValue":i[2]||(i[2]=t=>e.unref(s).coin.enabled=t),"active-text":"每日投币"},null,8,["modelValue"]),e.createVNode(u,{modelValue:e.unref(s).coin.num,"onUpdate:modelValue":i[3]||(i[3]=t=>e.unref(s).coin.num=t),placeholder:"Select",style:{width:"64px"}},{default:e.withCtx((()=>[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(5,(t=>e.createVNode(d,{key:t,label:t,value:t},null,8,["label","value"]))),64))])),_:1},8,["modelValue"]),e.createVNode(h,null,{default:e.withCtx((()=>[e.createTextVNode("个")])),_:1}),e.createVNode(n,{id:"DailyTasks.MainSiteTasks.coin"}),e.createVNode(l,{status:e.unref(o).coin},null,8,["status"])])),_:1})])),_:1}),e.createVNode(c,null,{default:e.withCtx((()=>[e.createVNode(r,{wrap:""},{default:e.withCtx((()=>[e.createVNode(a,{modelValue:e.unref(s).share.enabled,"onUpdate:modelValue":i[4]||(i[4]=t=>e.unref(s).share.enabled=t),"active-text":"每日分享视频"},null,8,["modelValue"]),e.createVNode(n,{id:"DailyTasks.MainSiteTasks.share"}),e.createVNode(l,{status:e.unref(o).share},null,8,["status"])])),_:1})])),_:1}),e.createVNode(m),e.createElementVNode("div",null,[e.createVNode(h,null,{default:e.withCtx((()=>[e.createTextVNode("  主站每日任务的完成情况可在")])),_:1}),e.createVNode(g,{class:"el-link-va-baseline",rel:"noreferrer",type:"primary",href:"https://account.bilibili.com/account/home",target:"_blank"},{default:e.withCtx((()=>[e.createTextVNode("个人中心")])),_:1}),e.createVNode(h,null,{default:e.withCtx((()=>[e.createTextVNode("查看。数据更新可能有一定的延时。")])),_:1})])])}}}),Y=(t=>(e.pushScopeId("data-v-eac67691"),t=t(),e.popScopeId(),t))((()=>e.createElementVNode("br",null,null,-1))),ee={class:"avatar-wrap"},te={components:{MainSiteTasks:Z,LiveTasks:K(e.defineComponent({__name:"LiveTasks",setup(t){const i=W(),s=k(),o=i.moduleConfig.DailyTasks.LiveTasks,l=i.moduleStatus.DailyTasks.LiveTasks,r=e.ref(!1),c=e.computed((()=>o.medalTasks.danmu.list.map((e=>({content:e}))))),d=()=>{n.ElMessageBox.prompt("请输入新增的弹幕内容","新增弹幕",{confirmButtonText:"确认",cancelButtonText:"取消",inputPattern:/^.{1,30}$/,inputErrorMessage:"弹幕内容不得为空且长度不能超过30",lockScroll:!1}).then((({value:e})=>{o.medalTasks.danmu.list.push(e)})).catch((()=>{}))},u=e.ref(!1),h=e.computed((()=>{var e;return null==(e=s.filteredFansMedals)?void 0:e.map((e=>({avatar:e.anchor_info.avatar,nick_name:e.anchor_info.nick_name,medal_name:e.medal.medal_name,medal_level:e.medal.level,roomid:e.room_info.room_id})))})),m=e.ref(!1);let g=!0;const f=()=>{if(u.value=!u.value,g)if(s.fansMedals)T(h.value);else{m.value=!0;const t=e.watch(h,(e=>{e&&(t(),g=!1,T(h.value),m.value=!1)}));i.emitter.emit("BiliInfo",{target:"getFansMetals"})}},p=e.ref();let v=!1;const T=t=>{if(v=!0,t){const i=e.watch((()=>p.value),(e=>{setTimeout((()=>i()),0),e&&o.medalTasks.roomidList.forEach((i=>e.toggleRowSelection(t.find((e=>e.roomid===i)),!0)))}),{immediate:!0})}v=!1};function w(e){v||(o.medalTasks.roomidList=e.map((e=>e.roomid)))}return(t,i)=>{const s=e.resolveComponent("el-switch"),g=e.resolveComponent("Info"),v=e.resolveComponent("TaskStatus"),T=e.resolveComponent("el-space"),k=e.resolveComponent("el-row"),y=e.resolveComponent("el-divider"),_=e.resolveComponent("el-button"),x=e.resolveComponent("el-option"),b=e.resolveComponent("el-select"),C=e.resolveComponent("el-text"),V=e.resolveComponent("el-link"),S=e.resolveComponent("el-table-column"),N=e.resolveComponent("el-dialog"),P=e.resolveComponent("el-image"),B=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(k,null,{default:e.withCtx((()=>[e.createVNode(T,{wrap:""},{default:e.withCtx((()=>[e.createVNode(s,{modelValue:e.unref(o).sign.enabled,"onUpdate:modelValue":i[0]||(i[0]=t=>e.unref(o).sign.enabled=t),"active-text":"直播签到"},null,8,["modelValue"]),e.createVNode(g,{id:"DailyTasks.LiveTasks.sign"}),e.createVNode(v,{status:e.unref(l).sign},null,8,["status"])])),_:1})])),_:1}),e.createVNode(k,null,{default:e.withCtx((()=>[e.createVNode(T,{wrap:""},{default:e.withCtx((()=>[e.createVNode(s,{modelValue:e.unref(o).appUser.enabled,"onUpdate:modelValue":i[1]||(i[1]=t=>e.unref(o).appUser.enabled=t),disabled:"","active-text":"APP用户任务"},null,8,["modelValue"]),e.createVNode(g,{id:"DailyTasks.LiveTasks.appUser"}),e.createVNode(v,{status:e.unref(l).appUser},null,8,["status"])])),_:1})])),_:1}),e.createVNode(y),e.createVNode(k,null,{default:e.withCtx((()=>[e.createVNode(T,{wrap:""},{default:e.withCtx((()=>[e.createVNode(s,{modelValue:e.unref(o).medalTasks.like.enabled,"onUpdate:modelValue":i[2]||(i[2]=t=>e.unref(o).medalTasks.like.enabled=t),"active-text":"给主播点赞"},null,8,["modelValue"]),e.createVNode(g,{id:"DailyTasks.LiveTasks.medalTasks.like"}),e.createVNode(v,{status:e.unref(l).medalTasks.like},null,8,["status"])])),_:1})])),_:1}),e.createVNode(k,null,{default:e.withCtx((()=>[e.createVNode(T,{wrap:""},{default:e.withCtx((()=>[e.createVNode(s,{modelValue:e.unref(o).medalTasks.danmu.enabled,"onUpdate:modelValue":i[3]||(i[3]=t=>e.unref(o).medalTasks.danmu.enabled=t),"active-text":"发送弹幕"},null,8,["modelValue"]),e.createVNode(_,{type:"primary",size:"small",icon:e.unref(a.Edit),onClick:i[4]||(i[4]=e=>r.value=!r.value)},{default:e.withCtx((()=>[e.createTextVNode("编辑弹幕")])),_:1},8,["icon"]),e.createVNode(g,{id:"DailyTasks.LiveTasks.medalTasks.danmu"}),e.createVNode(v,{status:e.unref(l).medalTasks.danmu},null,8,["status"])])),_:1})])),_:1}),e.createVNode(k,null,{default:e.withCtx((()=>[e.createVNode(T,{wrap:""},{default:e.withCtx((()=>[e.createVNode(s,{modelValue:e.unref(o).medalTasks.watch.enabled,"onUpdate:modelValue":i[5]||(i[5]=t=>e.unref(o).medalTasks.watch.enabled=t),"active-text":"观看直播"},null,8,["modelValue"]),e.createVNode(b,{modelValue:e.unref(o).medalTasks.watch.time,"onUpdate:modelValue":i[6]||(i[6]=t=>e.unref(o).medalTasks.watch.time=t),placeholder:"Select",style:{width:"64px"}},{default:e.withCtx((()=>[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(24,(t=>e.createVNode(x,{key:t,label:5*t,value:5*t},null,8,["label","value"]))),64))])),_:1},8,["modelValue"]),e.createVNode(C,null,{default:e.withCtx((()=>[e.createTextVNode("分钟")])),_:1}),e.createVNode(g,{id:"DailyTasks.LiveTasks.medalTasks.watch"}),e.createVNode(v,{status:e.unref(l).medalTasks.watch},null,8,["status"])])),_:1})])),_:1}),e.createVNode(k,null,{default:e.withCtx((()=>[e.createVNode(T,{wrap:""},{default:e.withCtx((()=>[e.createVNode(s,{modelValue:e.unref(o).medalTasks.isWhiteList,"onUpdate:modelValue":i[7]||(i[7]=t=>e.unref(o).medalTasks.isWhiteList=t),"active-text":"白名单","inactive-text":"黑名单"},null,8,["modelValue"]),e.createVNode(_,{type:"primary",size:"small",icon:e.unref(a.Edit),onClick:f},{default:e.withCtx((()=>[e.createTextVNode("编辑名单")])),_:1},8,["icon"]),e.createVNode(g,{id:"DailyTasks.LiveTasks.medalTasks.list"})])),_:1})])),_:1}),e.createVNode(y),e.createVNode(k,null,{default:e.withCtx((()=>[e.createVNode(C,null,{default:e.withCtx((()=>[e.createTextVNode("直播任务相关信息可在")])),_:1}),e.createVNode(V,{class:"el-link-va-baseline",rel:"noreferrer",type:"primary",href:"https://link.bilibili.com/p/help/index#/audience-fans-medal",target:"_blank"},{default:e.withCtx((()=>[e.createTextVNode("帮助中心")])),_:1}),e.createVNode(C,null,{default:e.withCtx((()=>[e.createTextVNode("查看。")])),_:1})])),_:1}),Y,e.createVNode(k,null,{default:e.withCtx((()=>[e.createVNode(C,{tag:"b"},{default:e.withCtx((()=>[e.createTextVNode("注意:")])),_:1})])),_:1}),e.createVNode(k,null,{default:e.withCtx((()=>[e.createVNode(C,null,{default:e.withCtx((()=>[e.createTextVNode("  由于每天能通过完成任务获得亲密度的粉丝勋章数量有限,目前脚本仅为最多100个等级小于20的粉丝勋章完成给主播点赞,发送弹幕,观看直播任务。")])),_:1})])),_:1}),e.createVNode(N,{modelValue:r.value,"onUpdate:modelValue":i[8]||(i[8]=e=>r.value=e),title:"编辑弹幕内容","lock-scroll":!1,width:"40%"},{footer:e.withCtx((()=>[e.createVNode(_,{type:"primary",onClick:d},{default:e.withCtx((()=>[e.createTextVNode("新增弹幕")])),_:1})])),default:e.withCtx((()=>[e.createVNode(e.unref(n.ElTable),{data:c.value,"max-height":"500"},{default:e.withCtx((()=>[e.createVNode(S,{type:"index",width:"50"}),e.createVNode(S,{prop:"content",label:"弹幕内容"}),e.createVNode(S,{label:"操作",width:"220",align:"center"},{default:e.withCtx((t=>[e.createVNode(_,{text:"",icon:e.unref(a.Edit),onClick:e=>{return i=t.$index,s=t.row,void n.ElMessageBox.prompt("请输入新的弹幕内容","修改弹幕",{confirmButtonText:"确认",cancelButtonText:"取消",inputPattern:/^.{1,30}$/,inputErrorMessage:"弹幕内容不得为空且长度不能超过30",inputValue:s.content,lockScroll:!1}).then((({value:e})=>{o.medalTasks.danmu.list[i]=e})).catch((()=>{}));var i,s}},{default:e.withCtx((()=>[e.createTextVNode(" 修改 ")])),_:2},1032,["icon","onClick"]),e.createVNode(_,{text:"",icon:e.unref(a.Delete),type:"danger",onClick:e=>{return i=t.$index,void(1!==o.medalTasks.danmu.list.length?o.medalTasks.danmu.list.splice(i,1):n.ElMessage.warning({message:"至少要有一条弹幕",appendTo:".el-dialog"}));var i}},{default:e.withCtx((()=>[e.createTextVNode(" 删除 ")])),_:2},1032,["icon","onClick"])])),_:1})])),_:1},8,["data"])])),_:1},8,["modelValue"]),e.createVNode(N,{modelValue:u.value,"onUpdate:modelValue":i[9]||(i[9]=e=>u.value=e),title:"编辑粉丝勋章名单","lock-scroll":!1,width:"40%"},{default:e.withCtx((()=>[e.withDirectives((e.openBlock(),e.createBlock(e.unref(n.ElTable),{ref_key:"medalInfoTableRef",ref:p,data:h.value,"max-height":"500","empty-text":"没有粉丝勋章",onSelectionChange:w},{default:e.withCtx((()=>[e.createVNode(S,{type:"selection",align:"center",width:"55"}),e.createVNode(S,{prop:"avatar",label:"头像"},{default:e.withCtx((t=>[e.createElementVNode("div",ee,[e.createVNode(P,{src:t.row.avatar,loading:"lazy",referrerpolicy:"origin",class:"avatar"},{error:e.withCtx((()=>[e.createVNode(P,{src:"//i0.hdslb.com/bfs/face/member/noface.jpg",referrerpolicy:"origin",class:"avatar"})])),_:2},1032,["src"])])])),_:1}),e.createVNode(S,{prop:"nick_name",label:"昵称"}),e.createVNode(S,{prop:"medal_name",label:"粉丝勋章"}),e.createVNode(S,{prop:"medal_level",label:"等级",sortable:""}),e.createVNode(S,{prop:"roomid",label:"房间号"},{default:e.withCtx((t=>[e.createVNode(V,{href:"https://live.bilibili.com/"+t.row.roomid+"?visit_id=",rel:"noreferrer",type:"primary",target:"_blank"},{default:e.withCtx((()=>[e.createTextVNode(e.toDisplayString(t.row.roomid),1)])),_:2},1032,["href"])])),_:1})])),_:1},8,["data"])),[[B,m.value]])])),_:1},8,["modelValue"])])}}}),[["__scopeId","data-v-eac67691"]]),OtherTasks:e.defineComponent({__name:"OtherTasks",setup(t){const i=W(),s=i.moduleConfig.DailyTasks.OtherTasks,o=i.moduleStatus.DailyTasks.OtherTasks;return(t,i)=>{const a=e.resolveComponent("el-switch"),n=e.resolveComponent("Info"),l=e.resolveComponent("TaskStatus"),r=e.resolveComponent("el-space"),c=e.resolveComponent("el-row"),d=e.resolveComponent("el-text"),u=e.resolveComponent("el-option"),h=e.resolveComponent("el-select"),m=e.resolveComponent("el-divider");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(c,null,{default:e.withCtx((()=>[e.createVNode(r,{wrap:""},{default:e.withCtx((()=>[e.createVNode(a,{modelValue:e.unref(s).groupSign.enabled,"onUpdate:modelValue":i[0]||(i[0]=t=>e.unref(s).groupSign.enabled=t),"active-text":"应援团签到"},null,8,["modelValue"]),e.createVNode(n,{id:"DailyTasks.OtherTasks.groupSign"}),e.createVNode(l,{status:e.unref(o).groupSign},null,8,["status"])])),_:1})])),_:1}),e.createVNode(c,null,{default:e.withCtx((()=>[e.createVNode(r,{wrap:""},{default:e.withCtx((()=>[e.createVNode(a,{modelValue:e.unref(s).silverToCoin.enabled,"onUpdate:modelValue":i[1]||(i[1]=t=>e.unref(s).silverToCoin.enabled=t),"active-text":"银瓜子换硬币"},null,8,["modelValue"]),e.createVNode(n,{id:"DailyTasks.OtherTasks.silverToCoin"}),e.createVNode(l,{status:e.unref(o).silverToCoin},null,8,["status"])])),_:1})])),_:1}),e.createVNode(c,null,{default:e.withCtx((()=>[e.createVNode(r,{wrap:""},{default:e.withCtx((()=>[e.createVNode(a,{modelValue:e.unref(s).coinToSilver.enabled,"onUpdate:modelValue":i[2]||(i[2]=t=>e.unref(s).coinToSilver.enabled=t),"active-text":"硬币换银瓜子"},null,8,["modelValue"]),e.createVNode(d,null,{default:e.withCtx((()=>[e.createTextVNode("花费硬币")])),_:1}),e.createVNode(h,{modelValue:e.unref(s).coinToSilver.num,"onUpdate:modelValue":i[3]||(i[3]=t=>e.unref(s).coinToSilver.num=t),placeholder:"Select",style:{width:"64px"}},{default:e.withCtx((()=>[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(50,(t=>e.createVNode(u,{key:t,label:t,value:t},null,8,["label","value"]))),64))])),_:1},8,["modelValue"]),e.createVNode(d,null,{default:e.withCtx((()=>[e.createTextVNode("个")])),_:1}),e.createVNode(n,{id:"DailyTasks.OtherTasks.coinToSilver"}),e.createVNode(l,{status:e.unref(o).coinToSilver},null,8,["status"])])),_:1})])),_:1}),e.createVNode(m)])}}}),EnhanceExperience:e.defineComponent({__name:"EnhanceExperience",setup(t){const i=W().moduleConfig.EnhanceExperience,s=["原画","蓝光PRO","蓝光","超清PRO","超清","高清"];return(t,o)=>{const a=e.resolveComponent("el-switch"),n=e.resolveComponent("el-option"),l=e.resolveComponent("el-select"),r=e.resolveComponent("Info"),c=e.resolveComponent("el-space"),d=e.resolveComponent("el-row"),u=e.resolveComponent("el-divider");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(d,null,{default:e.withCtx((()=>[e.createVNode(c,{wrap:""},{default:e.withCtx((()=>[e.createVNode(a,{modelValue:e.unref(i).switchLiveStreamQuality.enabled,"onUpdate:modelValue":o[0]||(o[0]=t=>e.unref(i).switchLiveStreamQuality.enabled=t),"active-text":"自动切换画质"},null,8,["modelValue"]),e.createVNode(l,{modelValue:e.unref(i).switchLiveStreamQuality.qualityDesc,"onUpdate:modelValue":o[1]||(o[1]=t=>e.unref(i).switchLiveStreamQuality.qualityDesc=t),placeholder:"Select",style:{width:"110px"}},{default:e.withCtx((()=>[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(s,(t=>e.createVNode(n,{key:t,label:t,value:t},null,8,["label","value"]))),64))])),_:1},8,["modelValue"]),e.createVNode(r,{id:"EnhanceExperience.switchLiveStreamQuality"})])),_:1})])),_:1}),e.createVNode(d,null,{default:e.withCtx((()=>[e.createVNode(c,{wrap:""},{default:e.withCtx((()=>[e.createVNode(a,{modelValue:e.unref(i).banp2p.enabled,"onUpdate:modelValue":o[2]||(o[2]=t=>e.unref(i).banp2p.enabled=t),"active-text":"禁用P2P"},null,8,["modelValue"]),e.createVNode(r,{id:"EnhanceExperience.banp2p"})])),_:1})])),_:1}),e.createVNode(u)])}}})}},ie=e.defineComponent({...te,__name:"PanelMain",setup(t){const i=T();return(t,s)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(i).uiConfig.activeMenuIndex)))}}),se=K(e.defineComponent({__name:"App",setup(t){const s=T(),o=W(),a=new L("App.vue");let n,r,c=s.uiConfig.isShowPanel;function d(){const e=n.getBoundingClientRect();s.baseStyleValue.top=e.top+window.scrollY,s.baseStyleValue.left=e.left+window.scrollX,s.baseStyleValue.height=e.height,s.baseStyleValue.width=.4*e.width}s.uiConfig.isShowPanel=!1;const u=i.throttle((function(){s.changeShowPanel(),r.innerText=s.isShowPanelButtonText}),300);return o.loadModules(),window.onload=()=>{if(n=O("#live-player-ctnr"),n){d(),(e=document,t=".left-ctnr.left-header-area",i=300,o=3e3,new Promise(((s,a)=>{const n=setInterval((()=>{const i=e.querySelector(t);i&&(clearTimeout(n),s(i))}),i),l=setTimeout((()=>{clearTimeout(n),clearTimeout(l),a()}),o)}))).then((e=>{var t;r=j("button"),r.setAttribute("class","blth_btn"),r.onclick=u,r.innerText=s.isShowPanelButtonText,e.append(r),f.self!==f.top&&l("alt+b",{element:null==(t=f.top)?void 0:t.document},u),l("alt+b",u)})).catch((()=>a.error("Can't find playerHeaderLeft in time"))),window.onresize=d;const n=new MutationObserver((()=>d()));n.observe(document.documentElement,{attributes:!0}),n.observe(document.body,{attributes:!0}),c&&(s.uiConfig.isShowPanel=!0)}else a.error("livePlayer not found");var e,t,i,o},(t,i)=>{const o=e.resolveComponent("el-header"),a=e.resolveComponent("el-aside"),n=e.resolveComponent("el-main"),l=e.resolveComponent("el-container"),r=e.resolveComponent("el-scrollbar"),c=e.resolveComponent("el-collapse-transition");return e.openBlock(),e.createBlock(c,null,{default:e.withCtx((()=>[e.withDirectives(e.createElementVNode("div",{style:e.normalizeStyle(e.unref(s).baseStyle),class:"base"},[e.createVNode(l,null,{default:e.withCtx((()=>[e.createVNode(o,{class:"header"},{default:e.withCtx((()=>[e.createVNode(Q)])),_:1}),e.createVNode(r,{height:e.unref(s).scrollBarHeight},{default:e.withCtx((()=>[e.createVNode(l,null,{default:e.withCtx((()=>[e.createVNode(a,{class:"aside"},{default:e.withCtx((()=>[e.createVNode(X)])),_:1}),e.createVNode(n,{class:"main"},{default:e.withCtx((()=>[(e.openBlock(),e.createBlock(e.KeepAlive,null,[e.createVNode(e.Transition,{name:"fade",mode:"out-in"},{default:e.withCtx((()=>[e.createVNode(ie)])),_:1})],1024))])),_:1})])),_:1})])),_:1},8,["height"])])),_:1})],4),[[e.vShow,e.unref(s).uiConfig.isShowPanel]])])),_:1})}}}),[["__scopeId","data-v-4aed17ff"]]);(e=>{const t=GM_getResourceText(e),i=document.createElement("style");i.innerText=t,document.head.append(i)})("element-plus/dist/index.css");const oe={},ae={xmlns:"http://www.w3.org/2000/svg",width:"128",height:"128",class:"icon",viewBox:"0 0 1024 1024"},ne=[e.createElementVNode("path",{d:"M831.825 63.94H191.94c-70.692 0-128 57.308-128 128v639.885c0 70.692 57.308 128 128 128h639.885c70.692 0 128-57.308 128-128V191.94c0-70.692-57.308-128-128-128zM895.885 832a63.835 63.835 0 0 1-63.973 63.886H192.088c-17.112 0-33.27-6.575-45.372-18.676S127.88 849.112 127.88 832V192a64.236 64.236 0 0 1 64.208-64.12h639.824A64.038 64.038 0 0 1 895.885 192v640z"},null,-1),e.createElementVNode("path",{d:"M791.998 351.852H536a31.97 31.97 0 0 0 0 63.94h256a31.97 31.97 0 0 0 0-63.94zm0 256.121H536a31.97 31.97 0 0 0 0 63.94h256a31.97 31.97 0 0 0 0-63.94zm-447.996-79.975c-61.856 0-111.986 50.144-111.986 111.985S282.16 751.97 344.002 751.97s111.985-50.144 111.985-111.986-50.13-111.985-111.985-111.985zm33.982 145.982a48.045 48.045 0 1 1 14.088-33.982 47.746 47.746 0 0 1-14.088 33.986zm39.412-376.586L311.999 402.787l-41.391-41.395a31.97 31.97 0 1 0-45.213 45.213l63.997 64.002a31.97 31.97 0 0 0 45.214 0l128-128a31.97 31.97 0 0 0-45.21-45.213z"},null,-1)];const le=K(oe,[["render",function(t,i){return e.openBlock(),e.createElementBlock("svg",ae,ne)}]]),re={DailyTasks:{MainSiteTasks:{login:{title:"每日登录",message:"完成主站的每日登录任务。"},watch:{title:"每日观看视频",message:e.h("p",[e.h("div","完成主站的每日观看视频任务。"),e.h("div","从动态中选取视频观看,会产生观看历史记录。")])},coin:{title:"每日投币",message:e.h("p",[e.h("div","完成主站的每日投币任务。"),e.h("div","从动态中选取视频投币,会根据你今天已经投过的币的数量计算还要投几个币。")])},share:{title:"每日分享视频",message:e.h("p",[e.h("div","完成主站的每日分享视频任务。"),e.h("div","不会真的分享到某处。")])}},LiveTasks:{sign:{title:"直播签到",message:e.h("p",[e.h("div","完成直播签到任务。"),e.h("div","完成后会移除当前直播间右上角签到窗口中的签到按钮。")])},appUser:{title:"APP用户任务",message:e.h("p",[e.h("div","完成APP用户任务并领取奖励。"),e.h("div",[e.h("strong","由于曾经的APP用户任务下架已久,目前的新任务(观看新主播直播并发弹幕)又没有对全部用户开放,故改功能暂时被禁用。"),e.h("div",[e.h("span","在APP中观看直播时右下角可能会有个电池图标,点击即可查看APP用户任务内容。并非所有账号都可以参加该任务。 如果开启了发送弹幕功能,该功能会在发送弹幕功能运行完毕后再运行。如果之前发送的弹幕数量不够,会先在直播间"),e.h("a",{class:"el-link el-link--primary is-underline el-link-va-baseline",href:"https://live.bilibili.com/22474988",rel:"noreferrer",target:"_blank"},"22474988"),e.h("span","发送弹幕再领取奖励。")])])])},medalTasks:{list:{title:"黑白名单",message:e.h("p",[e.h("div","为更精细地控制为哪些粉丝勋章执行任务,你可以使用黑名单或白名单模式。"),e.h("div",[e.h("li",[e.h("span","黑名单:仅为"),e.h("strong","不在"),e.h("span","名单中的粉丝勋章执行任务。")]),e.h("li",[e.h("span","白名单:仅为"),e.h("strong","在"),e.h("span","名单中的粉丝勋章执行任务。")])]),e.h("div","点击编辑名单按钮,然后使用第一列的多选框即可编辑名单中的粉丝勋章。")])},like:{title:"给主播点赞",message:e.h("p",[e.h("div","在你的每个粉丝勋章对应的直播间给主播点赞。"),e.h("div","部分直播间无法完成该任务,原因未知。")])},danmu:{title:"发送弹幕",message:e.h("p",[e.h("div","在你的每个粉丝勋章对应的直播间发送一条弹幕。"),e.h("div",[e.h("span","点击编辑弹幕按钮编辑发送的弹幕,脚本会从中按顺序循环抽取弹幕发送。"),e.h("span","部分直播间无法完成该任务,可能的原因有:,"),e.h("li","你被禁言了"),e.h("li","发言有粉丝勋章等级要求"),e.h("li",[e.h("span","特殊直播间(比如"),e.h("a",{href:"https://live.bilibili.com/54",rel:"noreferrer",target:"_blank"},"54"),e.h("span",")")])])])},watch:{title:"观看直播",message:e.h("p",[e.h("div","完成观看持有粉丝勋章对应主播直播的任务。"),e.h("div","部分直播间因为没有设置直播分区导致任务无法完成。主播当前是否开播不会影响该任务的完成。")])}}},OtherTasks:{groupSign:{title:"应援团签到",message:"完成应援团签到任务。"},silverToCoin:{title:"银瓜子换硬币",message:e.h("p",[e.h("div","把银瓜子兑换为硬币。"),e.h("div","具体兑换规则请点击直播间页面的“立即充值→银瓜子商店”查看。")])},coinToSilver:{title:"硬币换银瓜子",message:e.h("p",[e.h("div","把硬币兑换为银瓜子。"),e.h("div","具体兑换规则请点击直播间页面的“立即充值→银瓜子商店”查看。")])}}},EnhanceExperience:{switchLiveStreamQuality:{title:"自动切换画质",message:e.h("p",[e.h("div","打开直播间后自动把播放器切换到指定画质。"),e.h("div","如果指定画质不存在,则还是使用B站的默认画质。")])},banp2p:{title:"禁用P2P",message:e.h("p",[e.h("div","禁用直播流的P2P上传/下载"),e.h("div","B站使用WebRTC技术把许多浏览器点对点(P2P)地连接起来,实现视频流和音频流的传输。这样做是为了减轻B站服务器的压力,但是会占用你一定的上行带宽(大约几百kb每秒)。如果你不想被占用上行带宽,可以开启该功能。若开启后发现观看直播时有明显卡顿,请关闭。")])}}},ce=(t=>(e.pushScopeId("data-v-c1d8df5e"),t=t(),e.popScopeId(),t))((()=>e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"128",height:"128",class:"icon",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"#276BC0",d:"M512.67 959.47c-246.343 0-446.76-200.632-446.76-447.24S266.326 64.98 512.67 64.98s446.76 200.642 446.76 447.25-200.416 447.24-446.76 447.24zm0-829.04c-210.291 0-381.38 171.283-381.38 381.8s171.089 381.79 381.38 381.79 381.381-171.273 381.381-381.79-171.09-381.8-381.38-381.8z"}),e.createElementVNode("path",{fill:"#276BC0",d:"M447.29 317.172a63.891 63.959 0 1 0 130.76 0 63.891 63.959 0 1 0-130.76 0Zm64.907 503.047c-30.093 0-54.235-24.416-54.235-54.541V482.062c0-30.126 24.142-54.541 54.235-54.541 30.094 0 54.236 24.416 54.236 54.541v283.616c0 30.125-24.142 54.54-54.236 54.54z"})],-1))),de=K(e.defineComponent({__name:"InfoIcon",props:{id:{}},setup(t){const s=t,o=()=>{const{title:e,message:t}=i.get(re,s.id,{title:"无",message:"无"});n.ElMessageBox({title:e,message:t,lockScroll:!1,autofocus:!0,confirmButtonText:"OK"})};return(t,i)=>{const s=e.resolveComponent("el-icon");return e.openBlock(),e.createBlock(s,{class:"info-icon",onClick:o},{default:e.withCtx((()=>[ce])),_:1})}}}),[["__scopeId","data-v-c1d8df5e"]]),ue=K(e.defineComponent({__name:"TaskStatusIcon",props:{status:{}},setup:t=>(t,i)=>{const s=e.resolveComponent("Loading"),o=e.resolveComponent("el-icon"),a=e.resolveComponent("Select"),n=e.resolveComponent("CloseBold");return"running"===t.status?(e.openBlock(),e.createBlock(o,{key:0,class:"status-icon is-loading"},{default:e.withCtx((()=>[e.createVNode(s)])),_:1})):"done"===t.status?(e.openBlock(),e.createBlock(o,{key:1,class:"status-icon",style:{color:"#1ab059"}},{default:e.withCtx((()=>[e.createVNode(a)])),_:1})):"error"===t.status?(e.openBlock(),e.createBlock(o,{key:2,class:"status-icon",style:{color:"#ff6464"}},{default:e.withCtx((()=>[e.createVNode(n)])),_:1})):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-2f9d6050"]]),he=Object.freeze(Object.defineProperty({__proto__:null,Info:de,TaskStatus:ue,Tasks:le},Symbol.toStringTag,{value:"Module"}));!function(){if(f.BilibiliLive){const i=e.createApp(se),s=t.createPinia();i.use(n),i.use(s);const o=new L("main.ts"),a=q();a.checkIfMainBLTHRunning(),a.isMainBLTHRunning?o.log("其它页面上存在正在运行的Main BLTH"):(o.log("当前脚本是Main BLTH,开始存活心跳"),a.startAliveHeartBeat());for(const[e,t]of Object.entries(c))i.component(e,t);for(const[e,t]of Object.entries(he))i.component(e,t);i.mount((()=>{try{const e=j("div");return e.id="BLTH",document.body.append(e),e}catch(e){return o.error("挂载Vue app时发送错误",e),"Error"}})())}}()}(Vue,Pinia,_,luxon,CryptoJS,ElementPlusIconsVue,ElementPlus,hotkeys); \ No newline at end of file +(e=>{const t=document.createElement("style");t.dataset.source="vite-plugin-monkey",t.textContent=" .title[data-v-dda95e10]{padding-left:20px;align-items:center;display:flex}.header-big-text[data-v-dda95e10]{font-size:var(--big-text-size)}.header-small-text[data-v-dda95e10]{font-size:var(--small-text-size);padding-top:calc(var(--big-text-size) - var(--small-text-size));margin-left:10px;--small-text-size: 18px}.collapse-btn[data-v-dda95e10]{display:flex;justify-content:center;align-items:center;height:100%;float:left;cursor:pointer}.avatar-wrap[data-v-f7944e85]{width:80px;height:80px}.avatar[data-v-f7944e85]{display:flex;justify-content:center;align-items:center;border-radius:50%}.base[data-v-4aed17ff]{z-index:1003;position:absolute;background-color:#fff;border-bottom:1px solid #e3e5e7;border-left:1px solid #e3e5e7;border-right:1px solid #e3e5e7}.header[data-v-4aed17ff]{position:relative;box-sizing:border-box;width:100%;font-size:var(--big-text-size);align-items:center;display:flex;border-bottom:1px solid #e3e5e7;height:60px;--big-text-size: 25px}.aside[data-v-4aed17ff]{width:auto}.aside #aside-el-menu[data-v-4aed17ff]:not(.el-menu--collapse){width:150px}.main[data-v-4aed17ff]{--main-top-botton-padding: calc(var(--el-main-padding) * .625);padding-top:var(--main-top-botton-padding);padding-bottom:var(--main-top-botton-padding)}.fade-enter-active[data-v-4aed17ff],.fade-leave-active[data-v-4aed17ff]{transition:opacity .1s ease}.fade-enter-from[data-v-4aed17ff],.fade-leave-to[data-v-4aed17ff]{opacity:0}.info-icon[data-v-c1d8df5e]{font-size:var(--el-font-size-base);cursor:pointer}.status-icon[data-v-2f9d6050]{font-size:var(--el-font-size-base)}.blth_btn{background-color:#23ade5;font-size:small;margin-inline-start:5px;color:#fff;border-radius:4px;border:none;padding:5px;cursor:pointer;box-shadow:0 0 2px #00000075;line-height:10px;margin-left:15px}.blth_btn:hover{background-color:#1097cc}.blth_btn:hover:active{background-color:#0e86b6;position:relative;top:1px}.el-link-va-baseline{vertical-align:baseline} ",document.head.append(t)})(),function(e,t,i,s,o,a,n,l){"use strict";function r(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const i in e)if("default"!==i){const s=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:()=>e[i]})}return t.default=e,Object.freeze(t)}const c=r(a);var d=Object.defineProperty,u=(e,t,i)=>(((e,t,i)=>{t in e?d(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i})(e,"symbol"!=typeof t?t+"":t,i),i),h=(()=>"undefined"!=typeof GM_getValue?GM_getValue:void 0)(),m=(()=>"undefined"!=typeof GM_setValue?GM_setValue:void 0)(),g=(()=>"undefined"!=typeof GM_xmlhttpRequest?GM_xmlhttpRequest:void 0)(),f=(()=>"undefined"!=typeof unsafeWindow?unsafeWindow:void 0)();const p={ui:{isCollapse:!1,isShowPanel:!0,activeMenuIndex:"MainSiteTasks"},modules:{DailyTasks:{MainSiteTasks:{login:{enabled:!1,_lastCompleteTime:0},watch:{enabled:!1,_lastCompleteTime:0},coin:{enabled:!1,num:1,_lastCompleteTime:0},share:{enabled:!1,_lastCompleteTime:0}},LiveTasks:{sign:{enabled:!1,_lastCompleteTime:0},appUser:{enabled:!1,_lastCompleteTime:0},medalTasks:{danmu:{enabled:!1,list:["(⌒▽⌒)","( ̄▽ ̄)","(=・ω・=)","(`・ω・´)","(〜 ̄△ ̄)〜","(・∀・)","(°∀°)ノ","╮( ̄▽ ̄)╭","_(:3」∠)_","(^・ω・^ )","(● ̄(エ) ̄●)","ε=ε=(ノ≧∇≦)ノ","⁄(⁄ ⁄•⁄ω⁄•⁄ ⁄)⁄","←◡←","(●'◡'●)ノ♥"],_lastCompleteTime:0},like:{enabled:!1,includeHighLevelMedals:!1,_lastCompleteTime:0},watch:{enabled:!1,time:70,_watchedSecondsToday:0,_lastWatchTime:0,_lastCompleteTime:0},isWhiteList:!1,roomidList:[]}},OtherTasks:{groupSign:{enabled:!1,_lastCompleteTime:0},silverToCoin:{enabled:!1,_lastCompleteTime:0},coinToSilver:{enabled:!1,num:1,_lastCompleteTime:0}}},EnhanceExperience:{switchLiveStreamQuality:{enabled:!1,qualityDesc:"原画"},banp2p:{enabled:!1}}},cache:{lastAliveHeartBeatTime:0}};class v{static mergeConfigs(e,t){const s=i.difference(i.keys(e),i.keys(t));e=i.omit(e,s);const o=i.difference(i.keys(t),i.keys(e));i.assign(e,i.pick(t,o));for(const[s,a]of Object.entries(e).filter((e=>!o.includes(e[0]))))i.isPlainObject(a)&&(e[s]=this.mergeConfigs(a,t[s]));return e}static setUiConfig(e){m("ui",e)}static getUiConfig(){return this.mergeConfigs(h("ui",{}),p.ui)}static setModuleConfig(e){m("modules",e)}static getModuleConfig(){return this.mergeConfigs(h("modules",{}),p.modules)}static setCache(e){m("cache",e)}static getCache(){return this.mergeConfigs(h("cache",{}),p.cache)}}const T=t.defineStore("ui",(()=>{const t=e.reactive(v.getUiConfig()),s=e.computed((()=>({MainSiteTasks:"主站任务",LiveTasks:"直播任务",OtherTasks:"其它任务"}[t.activeMenuIndex]))),o=e.reactive({top:0,left:0,height:0,width:0}),a=e.computed((()=>({top:o.top.toString()+"px",left:o.left.toString()+"px",height:o.height.toString()+"px",width:o.width.toString()+"px"}))),n=e.computed((()=>t.isShowPanel?"隐藏控制面板":"显示控制面板")),l=e.computed((()=>(o.height-60).toString()+"px"));return e.watch(t,i.debounce((e=>v.setUiConfig(e)),350)),{isShowPanelButtonText:n,activeMenuName:s,baseStyleValue:o,baseStyle:a,scrollBarHeight:l,uiConfig:t,changeCollapse:function(){t.isCollapse=!t.isCollapse},changeShowPanel:function(){t.isShowPanel=!t.isShowPanel},setActiveMenuIndex:function(e){t.activeMenuIndex=e}}})),k=t.defineStore("bili",(()=>{const t=e.ref(),i=e.ref(),s=e.ref(),o=e.ref(),a=e.ref(),n=e.ref(),l=e.ref(),r=e.computed((()=>l.value?l.value.filter((e=>0!==e.room_info.room_id)):null));return{BilibiliLive:t,userInfo:s,giftConfig:o,cookies:i,dailyRewardInfo:a,dynamicVideos:n,fansMedals:l,filteredFansMedals:r}}));class w{constructor(e,t){u(this,"url_prefix"),u(this,"origin"),this.url_prefix=e??"",this.origin=t??"https://bilibili.com"}get(e,t,s){return new Promise(((o,a)=>{const n={method:"GET",url:this.url_prefix+e+(t?"?"+new URLSearchParams(t).toString():""),responseType:"json",headers:{Accept:"application/json, text/plain, */*",Referer:this.origin,Origin:this.origin,"Sec-Fetch-Site":"same-site"},onload:function(e){o(e.response)},onerror:function(e){a(e)}},l=i.defaultsDeep(s,n);g(l)}))}post(e,t,s){return new Promise(((o,a)=>{const n={method:"POST",url:this.url_prefix.concat(e),data:new URLSearchParams(t).toString(),responseType:"json",headers:{Accept:"application/json, text/plain, */*",Referer:this.origin,Origin:this.origin,"Sec-Fetch-Site":"same-site","Content-Type":"application/x-www-form-urlencoded"},onload:function(e){o(e.response)},onerror:function(e){a(e)}},l=i.defaultsDeep(s,n);"multipart/form-data"===l.headers["Content-Type"]&&delete l.headers["Content-Type"],g(l)}))}}function y(e){return new Promise((t=>setTimeout(t,e)))}function _(e){const t=new FormData;return i.forEach(e,((e,i)=>t.append(i,e.toString()))),t}function x(e,t,s){i.forOwn(e,(function(e,o){const a=s?s+"."+o:o;i.isPlainObject(e)&&!i.isEmpty(e)?x(e,t,a):t(e,a)}))}function b(e,t=0,i=5){const o=s.DateTime.fromMillis(e),a=s.DateTime.now().set({hour:t,minute:i,second:0,millisecond:0}),n=a.plus({days:1}),l=a.minus({days:1});return s.DateTime.now()>=a?o>=a&&o=l&&oo&&(o=o.plus({days:1}));const a=o.diff(i);return{ms:a.toMillis(),str:a.toFormat("h小时m分钟s秒").replace(/^0小时/,"").replace(/^0分钟/,"")}}function V(e,t,i,o){const a=s.DateTime.now(),n=s.DateTime.local(a.year,a.month,a.day,e,t),l=s.DateTime.local(a.year,a.month,a.day,i,o);return a>=n&&aP.live.get("/xlive/web-room/v1/giftPanel/roomGiftConfig",{platform:s,room_id:e,area_parent_id:t,area_id:i}),doSign:()=>P.live.get("/xlive/web-ucenter/v1/sign/DoSign"),getSignInfo:()=>P.live.get("/xlive/web-ucenter/v1/sign/WebGetSignInfo"),fansMedalPanel:(e,t=10)=>P.live.get("/xlive/app-ucenter/v1/fansMedal/panel",{page:e,page_size:t},{Origin:"https://link.bilibili.com",Referer:"https://link.bilibili.com/p/center/index"}),sendMsg:(e,t,i=0,s=1,o=0,a=25,n=16777215,l=0)=>{const r=k().cookies.bili_jct;return P.live.post("/msg/send",void 0,{data:_({roomid:t,room_type:i,rnd:S(),msg:e,mode:s,jumpfrom:o,fontsize:a,csrf:r,csrf_token:r,color:n,bubble:l}),headers:{"Content-Type":"multipart/form-data"}})},likeReport:(e,t)=>{const i=k().cookies.bili_jct;return P.live.post("/xlive/app-ucenter/v1/like_info_v3/like/likeReportV3",{room_id:e,anchor_id:t,uid:t,ts:S(),csrf:i})},getInfoByRoom:e=>P.live.get("/xlive/web-room/v1/index/getInfoByRoom",{room_id:e}),getUserTaskProgress:(e=11153765)=>{const t=k().cookies.bili_jct;return P.live.get("/xlive/app-ucenter/v1/userTask/GetUserTaskProgress",{target_id:e,csrf:t,ts:S()})},userTaskReceiveRewards:(e=11153765)=>{const t=k().cookies.bili_jct;return P.live.post("/xlive/app-ucenter/v1/userTask/UserTaskReceiveRewards",{actionKey:"csrf",target_id:e,csrf:t,ts:S()})},silver2coin:(e="")=>{const t=k().cookies.bili_jct;return P.live.post("/xlive/revenue/v1/wallet/silver2coin",{csrf:t,csrf_token:t,visit_id:e})},coin2silver:(e,t="pc",i="")=>{const s=k().cookies.bili_jct;return P.live.post("/xlive/revenue/v1/wallet/coin2silver",{num:e,csrf:s,csrf_token:s,platform:t,visit_id:i})}},I={E:(e,t,i,s=0,o=[],a="")=>{const n=k().cookies.bili_jct;return P.liveTrace.post("/xlive/data-interface/v1/x25Kn/E",{id:JSON.stringify(e),device:JSON.stringify(t),ruid:i,ts:N(),is_patch:s,heart_beat:JSON.stringify(o),ua:navigator.userAgent,csrf_token:n,csrf:n,visit_id:a})},X:(e,t,i,s,o,a,n,l,r="")=>{const c=k().cookies.bili_jct;return P.liveTrace.post("/xlive/data-interface/v1/x25Kn/X",{s:e,id:JSON.stringify(t),device:JSON.stringify(i),ruid:s,ets:o,benchmark:a,time:n,ts:l,ua:navigator.userAgent,csrf_token:c,csrf:c,visit_id:r})}},D={nav:()=>P.main.get("/x/web-interface/nav"),reward:()=>P.main.get("/x/member/web/exp/reward"),dynamicAll:(e,t=1,i=-480,s="itemOpusStyle")=>P.main.get("/x/polymer/web-dynamic/v1/feed/all",{timezone_offset:i,type:e,page:t,features:s}),videoHeartbeat:(e,t="",i=0,s=0,o=0,a="https://t.bilibili.com/?spm_id_from=444.3.0.0",n=116,l=100,r=3,c=0,d=0,u=2,h=0,m=0,g="333.488.0.0",f="333.31.list.card_archive.click",p='{"player_version":"4.1.21-rc.1727.0"}')=>{const v=k();return P.main.post("/x/click-interface/web/heartbeat",{start_ts:S(),mid:k().BilibiliLive.UID,aid:e,cid:t,type:r,sub_type:c,dt:u,play_type:d,realtime:i,played_time:s,real_played_time:o,refer_url:a,quality:n,video_duration:l,last_play_progress_time:h,max_play_progress_time:m,spmid:g,from_spmid:f,extra:p,csrf:v.cookies.bili_jct})},share:(e,t="pc_client_normal",i=2,s=0,o=1)=>{const a=k().cookies.bili_jct;return P.main.post("/x/web-interface/share/add",{aid:e,eab_x:i,ramval:s,source:t,ga:o,csrf:a})},coinAdd:(e,t,i=0,s=!0,o=2,a=6,n="web_normal",l=1)=>{const r=k().cookies.bili_jct;return P.main.post("/x/web-interface/coin/add ",{aid:e,multiply:t,select_like:i,cross_domain:s,eab_x:o,ramval:a,source:n,ga:l,csrf:r})},videoRelation:(e,t="")=>P.main.get("/x/web-interface/archive/relation",{aid:e,bvid:t})},M={myGroups:(e=0,t="web")=>P.vc.get("/link_group/v1/member/my_groups",{build:e,mobi_app:t}),signIn:(e,t)=>P.vc.get("/link_setting/v1/link_setting/sign_in",{group_id:e,owner_id:t})};class L{constructor(e){u(this,"NAME","BLTH"),u(this,"prefix_title_str"),u(this,"_title"),this._title=e,this.prefix_title_str=e.split("_").join("][")}get prefix(){return[`%c${this.NAME}%c[${(new Date).toLocaleString()}]%c[${this.prefix_title_str}]%c:`,"font-weight: bold; color: white; background-color: #23ade5; padding: 1px 4px; border-radius: 4px;","font-weight: bold; color: #0920e6;","font-weight: bold;",""]}log(...e){console.log(...this.prefix,...e)}error(...e){console.error(...this.prefix,...e)}warn(...e){console.warn(...this.prefix,...e)}}class ${constructor(e){u(this,"moduleName"),u(this,"logger"),u(this,"moduleStore",W()),u(this,"config"),this.moduleName=e,this.logger=new L(this.moduleName)}set status(e){throw new Error("Method not implemented.")}run(){throw new Error("Method not implemented.")}}u($,"runMultiple",!1);class A extends ${run(){throw new Error("Method not implemented.")}}u(A,"sequence");class E extends A{getBilibiliLive(){return this.logger.log("unsafeWindow.BilibiliLive",f.BilibiliLive),f.BilibiliLive}getCookies(){return function(e){const t={};for(const i of e)t[i]=null;for(const i of document.cookie.split("; ")){for(let s=0;se.enabled&&!b(e._lastCompleteTime))))return Promise.reject();try{const e=await D.reward();return this.logger.log("BAPI.main.reward response",e),0===e.code?Promise.resolve(e.data):(this.logger.error("获取主站每日任务完成情况失败",e.message),Promise.reject(e.message))}catch(e){return this.logger.error("获取主站每日任务完成情况出错",e),Promise.reject(e)}}async getDynamicVideo(){const e=this.moduleStore.moduleConfig.DailyTasks.MainSiteTasks;if(!Object.entries(e).filter((([e])=>["watch","share","coin"].includes(e))).some((e=>e[1].enabled&&!b(e[1]._lastCompleteTime))))return Promise.reject();try{const e=await D.dynamicAll("video");return this.logger.log("BAPI.main.dynamicAll response",e),0===e.code?Promise.resolve(e.data.items):(this.logger.error("获取主站每日任务完成情况失败",e.message),Promise.reject(e.message))}catch(e){return this.logger.error("获取主站每日任务完成情况出错",e),Promise.reject(e)}}async getFansMetals(e=10,t=!1){const i=this.moduleStore.moduleConfig.DailyTasks.LiveTasks.medalTasks;if(!t&&!Object.entries(i).filter((([e])=>["danmu","like","watch"].includes(e))).some((e=>e[1].enabled&&!b(e[1]._lastCompleteTime))))return Promise.reject();{const t=[];let i=1;try{const s=await B.fansMedalPanel(1);if(this.logger.log("BAPI.live.fansMedalPanel(1) response",s),0!==s.code)return this.logger.error("获取粉丝勋章列表第1页失败",s.message),Promise.reject(s.message);i=s.data.page_info.total_page,t.push(...s.data.special_list,...s.data.list);for(let o=2;o<=Math.min(i,e);o++){const e=await B.fansMedalPanel(o);if(this.logger.log(`BAPI.live.fansMedalPanel(${o}) response`,e),0!==s.code)return this.logger.error(`获取粉丝勋章列表第${o}页失败`,s.message),t;t.push(...e.data.list),await y(250)}return Promise.resolve(t)}catch(e){return Promise.reject(e)}}}async run(){const e=k();e.BilibiliLive=this.getBilibiliLive(),e.cookies=this.getCookies(),e.userInfo=await this.getUserInfo(),setTimeout((async()=>{e.userInfo=await this.getUserInfo()}),C(0,4).ms);const t=await Promise.allSettled([this.getGiftConfig(),this.getDailyRewardInfo(),this.getDynamicVideo(),this.getFansMetals()]);this.logger.log("allPromiseResult",t),e.giftConfig="fulfilled"===t[0].status?t[0].value:null,e.dailyRewardInfo="fulfilled"===t[1].status?t[1].value:null,setTimeout((async()=>{const e=k();e.dailyRewardInfo&&(e.dailyRewardInfo.login=!1,e.dailyRewardInfo.share=!1,e.dailyRewardInfo.watch=!1,e.dailyRewardInfo.coins=0),e.dailyRewardInfo=await this.getDailyRewardInfo()}),C(0,4).ms),e.dynamicVideos="fulfilled"===t[2].status?t[2].value:null,setTimeout((async()=>{e.dynamicVideos=await this.getDynamicVideo()}),C(0,4).ms),e.fansMedals="fulfilled"===t[3].status?t[3].value:null,setTimeout((async()=>{e.fansMedals=await this.getFansMetals()}),C(0,4).ms),W().emitter.on(this.moduleName,(async t=>{"getFansMetals"===t.target&&(e.fansMedals=await this.getFansMetals(10,!0))}))}}u(E,"sequence",0);const R=Object.freeze(Object.defineProperty({__proto__:null,BiliInfo:E},Symbol.toStringTag,{value:"Module"}));const O=document.querySelector.bind(document);document.querySelectorAll.bind(document);const U=document.createElement.bind(document);class j{constructor(e,t,i,s,o,a=!1){u(this,"logger",new L("RoomHeart")),u(this,"config"),u(this,"isLast"),u(this,"watchedSeconds"),u(this,"timer"),u(this,"stop",!1),u(this,"areaID"),u(this,"parentID"),u(this,"roomID"),u(this,"ruid"),u(this,"seq",0),u(this,"buvid",function(e){const t=e+"=";for(const e of document.cookie.split("; "))if(e.startsWith(t)){const i=e.substring(t.length);return decodeURIComponent(i)}return null}("LIVE_BUVID")),u(this,"uuid","xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))),u(this,"device",[this.buvid,this.uuid]),u(this,"ua",navigator.userAgent),u(this,"heartBeatInterval"),u(this,"secretKey"),u(this,"secretRule"),u(this,"timestamp"),this.roomID=e,this.areaID=t,this.parentID=i,this.ruid=s,this.watchedSeconds=o,this.isLast=a,this.config=W().moduleConfig.DailyTasks.LiveTasks.medalTasks.watch}set status(e){W().moduleStatus.DailyTasks.LiveTasks.medalTasks.watch=e}get id(){return[this.parentID,this.areaID,this.seq,this.roomID]}start(){if(this.buvid)return this.timer=setTimeout((()=>this.stop=!0),C(0,0).ms),this.E()}async E(){if(this.stop)this.status="";else try{const e=await I.E(this.id,this.device,this.ruid);this.logger.log(`BAPI.liveTrace.E(${this.id}, ${this.device}, ${this.ruid}) response`,e),0===e.code?(this.seq+=1,({heartbeat_interval:this.heartBeatInterval,secret_key:this.secretKey,secret_rule:this.secretRule,timestamp:this.timestamp}=e.data),setTimeout((()=>this.X()),1e3*this.heartBeatInterval)):this.logger.error(`BAPI.liveTrace.E(${this.id}, ${this.device}, ${this.ruid}) 失败`,e.message)}catch(e){this.logger.error(`BAPI.liveTrace.E(${this.id}, ${this.device}, ${this.ruid}) 出错`,e)}}async X(){if(this.stop)this.status="";else try{const e={id:JSON.stringify(this.id),device:JSON.stringify(this.device),ets:this.timestamp,benchmark:this.secretKey,time:this.heartBeatInterval,ts:N(),ua:this.ua},t=this.sypder(JSON.stringify(e),this.secretRule),i=await I.X(t,this.id,this.device,this.ruid,this.timestamp,this.secretKey,this.heartBeatInterval,e.ts);if(this.logger.log(`BAPI.liveTrace.X(${t}, ${this.id}, ${this.device}, ${this.ruid}, ${this.timestamp}, ${this.secretKey}, ${this.heartBeatInterval}, ${e.ts}) response`,i),0===i.code){if(this.seq+=1,this.watchedSeconds+=this.heartBeatInterval,this.isLast&&(this.config._watchedSecondsToday=this.watchedSeconds),this.watchedSeconds>=60*this.config.time)return this.isLast&&(this.config._lastCompleteTime=N(),this.logger.log("观看直播任务已完成"),this.status="done"),void clearTimeout(this.timer);({heartbeat_interval:this.heartBeatInterval,secret_key:this.secretKey,secret_rule:this.secretRule,timestamp:this.timestamp}=i.data),setTimeout((()=>this.X()),1e3*this.heartBeatInterval)}else this.logger.error(`BAPI.liveTrace.X(${t}, ${this.id}, ${this.device}, ${this.ruid}, ${this.timestamp}, ${this.secretKey}, ${this.heartBeatInterval}) 失败`,i.message)}catch(e){this.logger.error(`BAPI.liveTrace.X(s, ${this.id}, ${this.device}, ${this.ruid}, ${this.timestamp}, ${this.secretKey}, ${this.heartBeatInterval}) 出错`,e)}}sypder(e,t){const i=JSON.parse(e),[s,a,n,l]=JSON.parse(i.id),[r,c]=JSON.parse(i.device),d=i.benchmark,u={platform:"web",parent_id:s,area_id:a,seq_id:n,room_id:l,buvid:r,uuid:c,ets:i.ets,time:i.time,ts:i.ts};let h=JSON.stringify(u);for(const e of t)switch(e){case 0:default:h=o.HmacMD5(h,d).toString(o.enc.Hex);break;case 1:h=o.HmacSHA1(h,d).toString(o.enc.Hex);break;case 2:h=o.HmacSHA256(h,d).toString(o.enc.Hex);break;case 3:h=o.HmacSHA224(h,d).toString(o.enc.Hex);break;case 4:h=o.HmacSHA512(h,d).toString(o.enc.Hex);break;case 5:h=o.HmacSHA384(h,d).toString(o.enc.Hex)}return h}}class H extends ${constructor(){super(...arguments),u(this,"config",this.moduleStore.moduleConfig.EnhanceExperience.switchLiveStreamQuality)}async waitForPlayer(){return new Promise(((e,t)=>{const i=f.top?f.top:f,s=setInterval((()=>{i.livePlayer&&Object.prototype.hasOwnProperty.call(i.livePlayer,"switchQuality")&&Object.prototype.hasOwnProperty.call(i.livePlayer,"getPlayerInfo")&&(clearInterval(s),clearTimeout(o),e(i.livePlayer))}),200),o=setTimeout((()=>{clearInterval(s),clearTimeout(o),t()}),1e4)}))}switchQuality(e){const t=e.getPlayerInfo();if(0===t.liveStatus)this.logger.log("当前直播间未开播");else{const i=t.qualityCandidates.find((({desc:e})=>e===this.config.qualityDesc));i&&t.quality!==i.qn&&(e.switchQuality(i.qn),this.logger.log(`已将画质切换为${this.config.qualityDesc}`,i))}}async run(){if(this.logger.log("自动切换画质模块开始运行"),this.config.enabled)try{const e=await this.waitForPlayer();this.switchQuality(e)}catch(e){this.logger.error("等待播放器超时")}}}u(H,"runMultiple",!0);class z extends ${constructor(){super(...arguments),u(this,"config",this.moduleStore.moduleConfig.EnhanceExperience.banp2p)}async banP2P(){var e;const t=["RTCPeerConnection","mozRTCPeerConnection","webkitRTCPeerConnection"];for(const i of t)Object.prototype.hasOwnProperty.call(f,i)&&(null==(e=Object.getOwnPropertyDescriptor(f,i))?void 0:e.configurable)&&Object.defineProperty(f,i,{value:function(){this.addEventListener=function(){},this.createDataChannel=function(){return{close:function(){}}},this.createOffer=function(){},this.setLocalDescription=function(){},this.close=function(){},this.setRemoteDescription=function(){},this.createAnswer=function(){}},enumerable:!1,writable:!1,configurable:!1})}async run(){if(this.logger.log("禁用P2P模块开始运行"),this.config.enabled)try{await this.banP2P()}catch(e){this.logger.error("禁用P2P失败",e)}}}u(z,"runMultiple",!0);const F=Object.freeze(Object.defineProperty({__proto__:null,DailyTask_LiveTask_AppUserTask:class extends ${constructor(){super(...arguments),u(this,"config",this.moduleStore.moduleConfig.DailyTasks.LiveTasks.appUser)}set status(e){this.moduleStore.moduleStatus.DailyTasks.LiveTasks.appUser=e}async getUserTaskProgress(){try{const e=await B.getUserTaskProgress();return this.logger.log("BAPI.live.getUserTaskProgress response",e),0===e.code?e.data:(this.logger.error("获取APP用户任务进度失败",e.message),this.status="error",null)}catch(e){return this.logger.error("获取APP用户任务进度出错",e),this.status="error",null}}async userTaskReceiveRewards(){try{const e=await B.userTaskReceiveRewards();return this.logger.log("BAPI.live.userTaskReceiveRewards response",e),0===e.code?e.data:(this.logger.error("获取APP用户任务进度失败",e.message),this.status="error",null)}catch(e){return this.logger.error("获取APP用户任务进度出错",e),this.status="error",null}}async sendDanmu(e,t){try{const i=await B.sendMsg(e,t);this.logger.log(`BAPI.live.sendMsg(${e}, ${t})`,i),0===i.code?this.logger.log(`在直播间 ${t} 发送弹幕 ${e} 成功`):this.logger.error(`在直播间 ${t} 发送弹幕 ${e} 失败`,i.message)}catch(i){this.logger.error(`在直播间 ${t} 发送弹幕 ${e} 出错`,i)}}async run(){if(this.logger.log("APP用户任务模块开始运行"),this.logger.warn("APP用户任务暂时没有,该模块不运行"),this.config.enabled=!1,this.config.enabled)if(b(this.config._lastCompleteTime))V(0,0,0,5)?this.logger.log("昨天的APP用户任务已经完成过了,等到今天的00:05再执行"):(this.logger.log("今天已经完成过APP用户任务了"),this.status="done");else{this.status="running";const e=this.moduleStore.moduleConfig.DailyTasks.LiveTasks.medalTasks.danmu;e.enabled&&!b(e._lastCompleteTime)&&await function(e,t=-1){return new Promise((i=>{W().emitter.on(e,(e=>i(e))),-1!==t&&setTimeout(i,t)}))}(this.moduleName,3e5);const t=await this.getUserTaskProgress();if(t)if(-1!==t.is_surplus)if(3===t.day_task.status)this.config._lastCompleteTime=N(),this.status="done";else if(2===t.day_task.status){const e=await this.userTaskReceiveRewards();if(e){const t=e.num;t?this.logger.log(`领取奖励成功:${t}个电池`):this.logger.warn("领取奖励失败:未领取到电池"),this.config._lastCompleteTime=N(),this.status="done"}}else{let e=t.day_task.target-t.day_task.progress;for(;e>0;)await this.sendDanmu(`打卡${e}`,22474988),await y(2e3),e--;const i=await this.userTaskReceiveRewards();if(i){const e=i.num;e?this.logger.log(`领取奖励成功:${e}个电池`):this.logger.warn("领取奖励失败:未领取到电池"),this.config._lastCompleteTime=N(),this.status="done"}}else this.logger.log("今天APP用户任务的奖励已经没有了,明天早点来吧"),this.config._lastCompleteTime=N(),this.status="done"}const e=C();setTimeout((()=>this.run()),e.ms),this.logger.log("距离APP用户任务模块下次运行时间:",e.str)}},DailyTask_LiveTask_DanmuTask:class extends ${constructor(){super(...arguments),u(this,"medalTasksConfig",this.moduleStore.moduleConfig.DailyTasks.LiveTasks.medalTasks),u(this,"config",this.medalTasksConfig.danmu)}set status(e){this.moduleStore.moduleStatus.DailyTasks.LiveTasks.medalTasks.danmu=e}getRoomidList(){const e=k();return e.filteredFansMedals?e.filteredFansMedals.filter((e=>e.medal.level<20&&910884!=e.room_info.room_id&&(this.medalTasksConfig.isWhiteList?this.medalTasksConfig.roomidList.includes(e.room_info.room_id):!this.medalTasksConfig.roomidList.includes(e.room_info.room_id)))).map((e=>e.room_info.room_id)).slice(0,100):(this.status="error",null)}async sendDanmu(e,t){try{const i=await B.sendMsg(e,t);this.logger.log(`BAPI.live.sendMsg(${e}, ${t})`,i),0===i.code?this.logger.log(`在直播间 ${t} 发送弹幕 ${e} 成功`):this.logger.error(`在直播间 ${t} 发送弹幕 ${e} 失败`,i.message)}catch(i){this.logger.error(`在直播间 ${t} 发送弹幕 ${e} 出错`,i)}}async run(){if(this.logger.log("发送弹幕模块开始运行"),this.config.enabled)if(b(this.config._lastCompleteTime))V(0,0,0,5)?this.logger.log("昨天的发送弹幕任务已经完成过了,等到今天的00:05再执行"):(this.logger.log("今天已经完成过发送弹幕任务了"),this.status="done");else{this.status="running";const e=this.getRoomidList();if(e){const t=this.config.list;for(let i=0;ithis.run()),e.ms),this.logger.log("距离发送弹幕模块下次运行时间:",e.str)}},DailyTask_LiveTask_LikeTask:class extends ${constructor(){super(...arguments),u(this,"medalTasksConfig",this.moduleStore.moduleConfig.DailyTasks.LiveTasks.medalTasks),u(this,"config",this.medalTasksConfig.like)}set status(e){this.moduleStore.moduleStatus.DailyTasks.LiveTasks.medalTasks.like=e}getRoomidUidList(){const e=k();return e.filteredFansMedals?e.filteredFansMedals.filter((e=>(!!this.config.includeHighLevelMedals||e.medal.level<20)&&(this.medalTasksConfig.isWhiteList?this.medalTasksConfig.roomidList.includes(e.room_info.room_id):!this.medalTasksConfig.roomidList.includes(e.room_info.room_id)))).map((e=>[e.room_info.room_id,e.medal.target_id])).slice(0,100):(this.status="error",null)}async like(e,t){try{const i=await B.likeReport(e,t);this.logger.log(`BAPI.live.likeReport(${e}, ${t})`,i),0===i.code?this.logger.log(`给主播点赞 房间号 = ${e} 主播UID = ${t} 成功`):this.logger.error(`给主播点赞 房间号 = ${e} 主播UID = ${t} 失败`,i.message)}catch(i){this.logger.error(`给主播点赞 房间号 = ${e} 主播UID = ${t} 出错`,i)}}async run(){if(this.logger.log("给主播点赞模块开始运行"),this.config.enabled)if(b(this.config._lastCompleteTime))V(0,0,0,5)?this.logger.log("昨天的给主播点赞任务已经完成过了,等到今天的00:05再执行"):(this.logger.log("今天已经完成过给主播点赞任务了"),this.status="done");else{this.status="running";const e=this.getRoomidUidList();if(e){for(const[t,i]of e)await this.like(t,i),await y(2e3);this.config._lastCompleteTime=N(),this.status="done",this.logger.log("给主播点赞任务已完成")}}const e=C();setTimeout((()=>this.run()),e.ms),this.logger.log("距离给主播点赞模块下次运行时间:",e.str)}},DailyTask_LiveTask_SignTask:class extends ${constructor(){super(...arguments),u(this,"config",this.moduleStore.moduleConfig.DailyTasks.LiveTasks.sign)}set status(e){this.moduleStore.moduleStatus.DailyTasks.LiveTasks.sign=e}async getSignInfo(){try{const e=await B.getSignInfo();return this.logger.log("BAPI.live.getSignInfo response",e),0===e.code?e.data:(this.logger.error("获取直播签到信息失败",e.message),null)}catch(e){return this.logger.error("获取直播签到信息出错",e),null}}async sign(){try{const e=await B.doSign();if(this.logger.log("BAPI.live.doSign response",e),0===e.code){this.logger.log("直播签到成功,获得奖励:",e.data.text),this.config._lastCompleteTime=N(),this.status="done",this.logger.log("直播签到任务已完成");const t=O(".checkin-btn");t&&t.remove()}else this.logger.error("直播签到失败",e.message),this.status="error"}catch(e){this.logger.error("执行直播签到任务出错",e),this.status="error"}}async run(){if(this.logger.log("直播签到模块开始运行"),this.config.enabled)if(b(this.config._lastCompleteTime))V(0,0,0,5)?this.logger.log("昨天的直播签到任务已经完成过了,等到今天的00:05再执行"):(this.logger.log("今天已经完成过直播签到任务了"),this.status="done");else{this.status="running";const e=await this.getSignInfo();e?0===e.status?await this.sign():(this.config._lastCompleteTime=N(),this.status="done"):await this.sign()}const e=C();setTimeout((()=>this.run()),e.ms),this.logger.log("距离直播签到模块下次运行时间:",e.str)}},DailyTask_LiveTask_WatchTask:class extends ${constructor(){super(...arguments),u(this,"medalTasksConfig",this.moduleStore.moduleConfig.DailyTasks.LiveTasks.medalTasks),u(this,"config",this.medalTasksConfig.watch)}set status(e){this.moduleStore.moduleStatus.DailyTasks.LiveTasks.medalTasks.watch=e}getRoomidUidList(){const e=k();return e.filteredFansMedals?e.filteredFansMedals.filter((e=>e.medal.level<20&&(this.medalTasksConfig.isWhiteList?this.medalTasksConfig.roomidList.includes(e.room_info.room_id):!this.medalTasksConfig.roomidList.includes(e.room_info.room_id)))).map((e=>[e.room_info.room_id,e.medal.target_id])).slice(0,100):null}async getAreaInfo(e){try{const t=await B.getInfoByRoom(e);if(this.logger.log(`BAPI.live.getInfoByRoom(${e}) response`,t),0===t.code){const e=t.data.room_info;return[e.area_id,e.parent_area_id]}return null}catch(t){return this.logger.error(`获取指定直播间的 area_id 和 parent_area_id(roomid = ${e}) 出错`,t),null}}async run(){if(this.logger.log("观看直播模块开始运行"),this.config.enabled)if(b(this.config._lastCompleteTime))V(0,0,0,5)?this.logger.log("昨天的观看直播任务已经完成过了,等到今天的00:05再执行"):(this.logger.log("今天已经完成过观看直播任务了"),this.status="done");else{this.status="running",b(this.config._lastWatchTime,0,0)?this.config._watchedSecondsToday-=this.config._watchedSecondsToday%300:this.config._watchedSecondsToday=0,this.config._lastWatchTime=N();const e=this.getRoomidUidList();if(e)if(0===e.length)this.status="done",this.config._lastCompleteTime=N();else for(let t=0;te>0))&&new j(i,o[0],o[1],s,this.config._watchedSecondsToday,t===e.length-1).start(),await y(3e3)}}const e=C();setTimeout((()=>this.run()),e.ms),this.logger.log("距离观看直播模块下次运行时间:",e.str)}},DailyTask_MainSiteTask_CoinTask:class extends ${constructor(){super(...arguments),u(this,"config",this.moduleStore.moduleConfig.DailyTasks.MainSiteTasks.coin),u(this,"MAX_COIN",1)}set status(e){this.moduleStore.moduleStatus.DailyTasks.MainSiteTasks.coin=e}getDynamicVideoIds(){const e=k();return i.isEmpty(e.dynamicVideos)?(this.status="error",null):e.dynamicVideos.map((e=>{const t=e.modules.module_dynamic.major.archive;return{aid:t.aid,bvid:t.bvid}}))}async getVideoCoinInfo(e,t){try{const i=await D.videoRelation(e,t);return this.logger.log(`BAPI.main.videoRelation(${e}, ${t}) response`,i),0===i.code?i.data.coin:(this.logger.error(`获取视频投币信息失败 aid = ${e} bvid = ${t}`,i.message),0)}catch(i){return this.logger.error(`获取视频投币信息出错 aid = ${e} bvid = ${t}`,i),0}}async coinDynamicVideos(e){const t=this.getDynamicVideoIds();if(t)for(const{aid:i,bvid:s}of t){const t=await this.getVideoCoinInfo(i,s),o=this.MAX_COIN-t;if(o>0){const t=Math.min(o,e),s=await this.coin(i,t);if(0===s){if(0===(e-=t)){this.logger.log("每日投币任务已完成"),this.config._lastCompleteTime=N(),this.status="done";break}}else if(1===s){this.status="error";break}}}}async coin(e,t){try{const i=await D.coinAdd(e,t);return this.logger.log(`BAPI.main.coinAdd(${e}) response`,i),0===i.code?(this.logger.log(`投币成功 视频aid = ${e} 投币数量num = ${t}`),0):-104===i.code?(this.logger.warn("硬币余额不足,每日投币任务终止"),1):(this.logger.error(`投币失败 视频aid = ${e} 投币数量num = ${t}`,i.message),2)}catch(i){return this.logger.error(`投币出错 视频aid = ${e} 投币数量num = ${t}`,i),3}}async run(){if(this.logger.log("每日投币模块开始运行"),this.config.enabled){const e=k();if(b(this.config._lastCompleteTime))V(0,0,0,5)?this.logger.log("昨天的每日投币任务已经完成过了,等到今天的00:05再执行"):(this.logger.log("今天已经完成过每日投币任务了"),this.status="done");else if(this.status="running",e.dailyRewardInfo){const t=e.dailyRewardInfo.coins/10;if(t(k().userInfo.money??5)?(this.logger.log("硬币余额不足,不执行每日投币任务"),this.status="done"):await this.coinDynamicVideos(e)}else this.config._lastCompleteTime=N(),this.status="done",this.logger.log("每日投币任务已完成")}}const e=C();setTimeout((()=>this.run()),e.ms),this.logger.log("距离每日投币模块下次运行时间:",e.str)}},DailyTask_MainSiteTask_LoginTask:class extends ${constructor(){super(...arguments),u(this,"config",this.moduleStore.moduleConfig.DailyTasks.MainSiteTasks.login)}set status(e){this.moduleStore.moduleStatus.DailyTasks.MainSiteTasks.login=e}async login(){return this.logger.log("每日登录任务已完成"),this.config._lastCompleteTime=N(),this.status="done",Promise.resolve()}async run(){if(this.logger.log("每日登录模块开始运行"),this.config.enabled){const e=k();b(this.config._lastCompleteTime)?V(0,0,0,5)?this.logger.log("昨天的每日登录任务已经完成过了,等到今天的00:05再执行"):(this.logger.log("今天已经完成过每日登录任务了"),this.status="done"):(this.status="running",e.dailyRewardInfo&&!e.dailyRewardInfo.login?await this.login():(this.config._lastCompleteTime=N(),this.status="done"))}const e=C();setTimeout((()=>this.run()),e.ms),this.logger.log("距离每日登录模块下次运行时间:",e.str)}},DailyTask_MainSiteTask_ShareTask:class extends ${constructor(){super(...arguments),u(this,"config",this.moduleStore.moduleConfig.DailyTasks.MainSiteTasks.share)}set status(e){this.moduleStore.moduleStatus.DailyTasks.MainSiteTasks.share=e}getAid(){const e=k();return i.isEmpty(e.dynamicVideos)?"2":e.dynamicVideos[0].modules.module_dynamic.major.archive.aid}async share(e){try{const t=await D.share(e);this.logger.log(`BAPI.main.share(${e}) response`,t),0===t.code||71e3===t.code?(this.logger.log("每日分享视频任务已完成"),this.config._lastCompleteTime=N(),this.status="done"):(this.logger.error("分享视频失败",t.message),this.status="error")}catch(e){this.logger.error("执行每日分享视频任务出错",e),this.status="error"}}async run(){if(this.logger.log("每日分享视频模块开始运行"),this.config.enabled){const e=k();if(b(this.config._lastCompleteTime))V(0,0,0,5)?this.logger.log("昨天的每日分享任务已经完成过了,等到今天的00:05再执行"):(this.logger.log("今天已经完成过每日分享任务了"),this.status="done");else if(this.status="running",e.dailyRewardInfo&&!e.dailyRewardInfo.share){const e=this.getAid();await this.share(e)}else this.config._lastCompleteTime=N(),this.status="done",this.logger.log("每日分享视频任务已完成")}const e=C();setTimeout((()=>this.run()),e.ms),this.logger.log("距离每日分享视频模块下次运行时间:",e.str)}},DailyTask_MainSiteTask_WatchTask:class extends ${constructor(){super(...arguments),u(this,"config",this.moduleStore.moduleConfig.DailyTasks.MainSiteTasks.watch)}set status(e){this.moduleStore.moduleStatus.DailyTasks.MainSiteTasks.watch=e}getAid(){const e=k();return i.isEmpty(e.dynamicVideos)?"2":e.dynamicVideos[0].modules.module_dynamic.major.archive.aid}async watch(e){try{const t=await D.videoHeartbeat(e);this.logger.log(`BAPI.main.videoHeartbeat(${e}) response`,t),0===t.code?(this.logger.log("每日观看视频任务已完成"),this.config._lastCompleteTime=N(),this.status="done"):(this.logger.error("发送观看视频心跳失败",t.message),this.status="error")}catch(e){this.logger.error("执行每日观看视频任务出错",e),this.status="error"}}async run(){if(this.logger.log("每日观看视频模块开始运行"),this.config.enabled){const e=k();if(b(this.config._lastCompleteTime))V(0,0,0,5)?this.logger.log("昨天的每日观看视频任务已经完成过了,等到今天的00:05再执行"):(this.logger.log("今天已经完成过每日观看视频任务了"),this.status="done");else if(this.status="running",e.dailyRewardInfo&&!e.dailyRewardInfo.watch){const e=this.getAid();await this.watch(e)}else this.config._lastCompleteTime=N(),this.status="done",this.logger.log("每日观看视频任务已完成")}const e=C();setTimeout((()=>this.run()),e.ms),this.logger.log("距离每日观看视频模块下次运行时间:",e.str)}},DailyTask_OtherTask_CoinToSilver:class extends ${constructor(){super(...arguments),u(this,"config",this.moduleStore.moduleConfig.DailyTasks.OtherTasks.coinToSilver)}set status(e){this.moduleStore.moduleStatus.DailyTasks.OtherTasks.coinToSilver=e}async exchange(){try{const e=await B.coin2silver(this.config.num);this.logger.log(`BAPI.live.coin2silver{${this.config.num}} response`,e),0===e.code?(this.logger.log("硬币换银瓜子已完成,获得银瓜子:",e.data.silver),this.config._lastCompleteTime=N(),this.status="done"):(this.logger.error("硬币换银瓜子失败",e.message),this.status="error")}catch(e){this.logger.error("硬币换银瓜子出错",e),this.status="error"}}async run(){this.logger.log("硬币换银瓜子模块开始运行"),this.config.enabled&&(b(this.config._lastCompleteTime)?V(0,0,0,5)?this.logger.log("昨天的硬币换银瓜子任务已经完成过了,等到今天的00:05再执行"):(this.logger.log("今天已经完成过硬币换银瓜子任务了"),this.status="done"):(this.status="running",await this.exchange()));const e=C();setTimeout((()=>this.run()),e.ms),this.logger.log("硬币换银瓜子模块下次运行时间:",e.str)}},DailyTask_OtherTask_GroupSignTask:class extends ${constructor(){super(...arguments),u(this,"config",this.moduleStore.moduleConfig.DailyTasks.OtherTasks.groupSign)}set status(e){this.moduleStore.moduleStatus.DailyTasks.OtherTasks.groupSign=e}async getGroupidOwneruidList(){try{const e=await M.myGroups();if(this.logger.log("BAPI.vc.myGroups response",e),0===e.code)return e.data.list.map((e=>[e.group_id,e.owner_uid]));this.logger.error("获取应援团信息失败",e.message),this.status="error"}catch(e){this.logger.error("获取应援团信息出错",e),this.status="error"}}async sign(e,t){try{const i=await M.signIn(e,t);this.logger.log(`BAPI.vc.signIn(${e}, ${t}) response`,i),0===i.code?this.logger.log(`应援团签到 应援团ID = ${e} 拥有者UID = ${t} 成功, 粉丝勋章亲密度+${i.data.add_num}`):this.logger.error(`应援团签到 应援团ID = ${e} 拥有者UID = ${t} 失败`,i.message)}catch(i){this.logger.error(`应援团签到 应援团ID = ${e} 拥有者UID = ${t} 出错`,i)}}async run(){if(this.logger.log("应援团签到模块开始运行"),this.config.enabled)if(b(this.config._lastCompleteTime,8,5))V(0,0,8,5)?this.logger.log("昨天的应援团签到任务已经完成过了,等到今天早上八点零五分再次执行"):(this.logger.log("今天已经完成过应援团签到任务了"),this.status="done");else{this.status="running";const e=await this.getGroupidOwneruidList();if(e){for(const[t,i]of e)await this.sign(t,i),await y(2e3);this.config._lastCompleteTime=N(),this.logger.log("应援团签到任务已完成"),this.status="done"}}const e=C(8,5);setTimeout((()=>this.run()),e.ms),this.logger.log("距离应援团签到模块下次运行时间:",e.str)}},DailyTask_OtherTask_SilverToCoin:class extends ${constructor(){super(...arguments),u(this,"config",this.moduleStore.moduleConfig.DailyTasks.OtherTasks.silverToCoin)}set status(e){this.moduleStore.moduleStatus.DailyTasks.OtherTasks.silverToCoin=e}async exchange(){try{const e=await B.silver2coin();this.logger.log("BAPI.live.silver2coin response",e),0===e.code?(this.logger.log("银瓜子换硬币已完成,获得硬币:",e.data.coin),this.config._lastCompleteTime=N(),this.status="done"):403===e.code?(this.logger.log("每天最多只能用银瓜子兑换1个硬币"),this.config._lastCompleteTime=N(),this.status="done"):(this.logger.error("银瓜子换硬币失败",e.message),this.status="error")}catch(e){this.logger.error("银瓜子换硬币出错",e),this.status="error"}}async run(){this.logger.log("银瓜子换硬币模块开始运行"),this.config.enabled&&(b(this.config._lastCompleteTime)?V(0,0,0,5)?this.logger.log("昨天的银瓜子换硬币任务已经完成过了,等到今天的00:05再执行"):(this.logger.log("今天已经完成过银瓜子换硬币任务了"),this.status="done"):(this.status="running",await this.exchange()));const e=C();setTimeout((()=>this.run()),e.ms),this.logger.log("银瓜子换硬币模块下次运行时间:",e.str)}},EnhanceExperience_BanP2P:z,EnhanceExperience_SwitchLiveStreamQuality:H},Symbol.toStringTag,{value:"Module"}));const q=t.defineStore("cache",(()=>{const t=e.reactive(v.getCache()),i=e.ref(!1);return e.watch(t,(e=>v.setCache(e))),{cache:t,isMainBLTHRunning:i,startAliveHeartBeat:function(){t.lastAliveHeartBeatTime=Date.now();const e=setInterval((()=>t.lastAliveHeartBeatTime=Date.now()),5e3);window.onunload=()=>{clearInterval(e),t.lastAliveHeartBeatTime=0}},checkIfMainBLTHRunning:function(){0!==t.lastAliveHeartBeatTime&&Date.now()-t.lastAliveHeartBeatTime<8e3?i.value=!0:i.value=!1}}})),G={DailyTasks:{MainSiteTasks:{login:"",watch:"",coin:"",share:""},LiveTasks:{sign:"",appUser:"",medalTasks:{danmu:"",like:"",watch:""}},OtherTasks:{groupSign:"",silverToCoin:"",coinToSilver:""}}},W=t.defineStore("module",(()=>{const t=e.reactive(v.getModuleConfig()),s={all:o=o||new Map,on:function(e,t){var i=o.get(e);i?i.push(t):o.set(e,[t])},off:function(e,t){var i=o.get(e);i&&(t?i.splice(i.indexOf(t)>>>0,1):o.set(e,[]))},emit:function(e,t){var i=o.get(e);i&&i.slice().map((function(e){e(t)})),(i=o.get("*"))&&i.slice().map((function(i){i(e,t)}))}};var o;const a=e.reactive(G);return e.watch(t,i.debounce((e=>v.setModuleConfig(e)),250,{leading:!0,trailing:!0})),function e(){setTimeout((()=>{x(a,((e,t)=>{i.set(a,t,"")})),e()}),C(0,0).ms)}(),{moduleConfig:t,emitter:s,moduleStatus:a,loadModules:async function(){const e=q();for(const[t,i]of Object.entries(R).sort(((e,t)=>e[1].sequence-t[1].sequence)))try{!i.runMultiple&&e.isMainBLTHRunning||await new i(t).run()}catch(e){return void new L("loadModules").error("加载默认模块时发生致命错误,挂机助手停止运行:",e)}for(const[t,i]of Object.entries(F))!i.runMultiple&&e.isMainBLTHRunning||new i(t).run()}}})),J={class:"title"},K=(e,t)=>{const i=e.__vccOpts||e;for(const[e,s]of t)i[e]=s;return i},Q=K(e.defineComponent({__name:"PanelHeader",setup(t){const i=T();return(t,s)=>{const o=e.resolveComponent("el-icon"),n=e.resolveComponent("el-text");return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{class:"collapse-btn",onClick:s[0]||(s[0]=t=>e.unref(i).changeCollapse())},[e.unref(i).uiConfig.isCollapse?(e.openBlock(),e.createBlock(o,{key:0},{default:e.withCtx((()=>[e.createVNode(e.unref(a.Expand))])),_:1})):(e.openBlock(),e.createBlock(o,{key:1},{default:e.withCtx((()=>[e.createVNode(e.unref(a.Fold))])),_:1}))]),e.createElementVNode("div",J,[e.createVNode(n,{tag:"b",class:"header-big-text"},{default:e.withCtx((()=>[e.createTextVNode("控制面板")])),_:1}),e.createVNode(n,{class:"header-small-text"},{default:e.withCtx((()=>[e.createTextVNode(e.toDisplayString(e.unref(i).activeMenuName),1)])),_:1})])],64)}}}),[["__scopeId","data-v-dda95e10"]]),X=e.defineComponent({__name:"PanelAside",setup(t){const i=T(),s=[{icon:"Tasks",title:"每日任务",index:"DailyTasks",subs:[{title:"主站任务",index:"MainSiteTasks"},{title:"直播任务",index:"LiveTasks"},{title:"其它任务",index:"OtherTasks"}]},{icon:"Monitor",title:"体验优化",index:"EnhanceExperience"}];return(t,o)=>{const a=e.resolveComponent("el-icon"),n=e.resolveComponent("el-menu-item"),l=e.resolveComponent("el-sub-menu"),r=e.resolveComponent("el-menu");return e.openBlock(),e.createBlock(r,{"default-active":e.unref(i).uiConfig.activeMenuIndex,style:e.normalizeStyle({"min-height":e.unref(i).scrollBarHeight}),collapse:e.unref(i).uiConfig.isCollapse,"unique-opened":"",onSelect:e.unref(i).setActiveMenuIndex,id:"aside-el-menu"},{default:e.withCtx((()=>[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(s,(t=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[t.subs?(e.openBlock(),e.createBlock(l,{index:t.index,key:t.index},{title:e.withCtx((()=>[e.createVNode(a,null,{default:e.withCtx((()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.icon)))])),_:2},1024),e.createElementVNode("span",null,e.toDisplayString(t.title),1)])),default:e.withCtx((()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.subs,(t=>(e.openBlock(),e.createBlock(n,{key:t.index,index:t.index},{default:e.withCtx((()=>[e.createTextVNode(e.toDisplayString(t.title),1)])),_:2},1032,["index"])))),128))])),_:2},1032,["index"])):(e.openBlock(),e.createBlock(n,{index:t.index,key:t.index},{title:e.withCtx((()=>[e.createTextVNode(e.toDisplayString(t.title),1)])),default:e.withCtx((()=>[e.createVNode(a,null,{default:e.withCtx((()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.icon)))])),_:2},1024)])),_:2},1032,["index"]))],64)))),64))])),_:1},8,["default-active","style","collapse","onSelect"])}}}),Z=e.defineComponent({__name:"MainSiteTasks",setup(t){const i=W(),s=i.moduleConfig.DailyTasks.MainSiteTasks,o=i.moduleStatus.DailyTasks.MainSiteTasks;return(t,i)=>{const a=e.resolveComponent("el-switch"),n=e.resolveComponent("Info"),l=e.resolveComponent("TaskStatus"),r=e.resolveComponent("el-space"),c=e.resolveComponent("el-row"),d=e.resolveComponent("el-option"),u=e.resolveComponent("el-select"),h=e.resolveComponent("el-text"),m=e.resolveComponent("el-divider"),g=e.resolveComponent("el-link");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(c,null,{default:e.withCtx((()=>[e.createVNode(r,{wrap:""},{default:e.withCtx((()=>[e.createVNode(a,{modelValue:e.unref(s).login.enabled,"onUpdate:modelValue":i[0]||(i[0]=t=>e.unref(s).login.enabled=t),"active-text":"每日登录"},null,8,["modelValue"]),e.createVNode(n,{id:"DailyTasks.MainSiteTasks.login"}),e.createVNode(l,{status:e.unref(o).login},null,8,["status"])])),_:1})])),_:1}),e.createVNode(c,null,{default:e.withCtx((()=>[e.createVNode(r,{wrap:""},{default:e.withCtx((()=>[e.createVNode(a,{modelValue:e.unref(s).watch.enabled,"onUpdate:modelValue":i[1]||(i[1]=t=>e.unref(s).watch.enabled=t),"active-text":"每日观看视频"},null,8,["modelValue"]),e.createVNode(n,{id:"DailyTasks.MainSiteTasks.watch"}),e.createVNode(l,{status:e.unref(o).watch},null,8,["status"])])),_:1})])),_:1}),e.createVNode(c,null,{default:e.withCtx((()=>[e.createVNode(r,{wrap:""},{default:e.withCtx((()=>[e.createVNode(a,{modelValue:e.unref(s).coin.enabled,"onUpdate:modelValue":i[2]||(i[2]=t=>e.unref(s).coin.enabled=t),"active-text":"每日投币"},null,8,["modelValue"]),e.createVNode(u,{modelValue:e.unref(s).coin.num,"onUpdate:modelValue":i[3]||(i[3]=t=>e.unref(s).coin.num=t),placeholder:"Select",style:{width:"64px"}},{default:e.withCtx((()=>[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(5,(t=>e.createVNode(d,{key:t,label:t,value:t},null,8,["label","value"]))),64))])),_:1},8,["modelValue"]),e.createVNode(h,null,{default:e.withCtx((()=>[e.createTextVNode("个")])),_:1}),e.createVNode(n,{id:"DailyTasks.MainSiteTasks.coin"}),e.createVNode(l,{status:e.unref(o).coin},null,8,["status"])])),_:1})])),_:1}),e.createVNode(c,null,{default:e.withCtx((()=>[e.createVNode(r,{wrap:""},{default:e.withCtx((()=>[e.createVNode(a,{modelValue:e.unref(s).share.enabled,"onUpdate:modelValue":i[4]||(i[4]=t=>e.unref(s).share.enabled=t),"active-text":"每日分享视频"},null,8,["modelValue"]),e.createVNode(n,{id:"DailyTasks.MainSiteTasks.share"}),e.createVNode(l,{status:e.unref(o).share},null,8,["status"])])),_:1})])),_:1}),e.createVNode(m),e.createElementVNode("div",null,[e.createVNode(h,null,{default:e.withCtx((()=>[e.createTextVNode("  主站每日任务的完成情况可在")])),_:1}),e.createVNode(g,{class:"el-link-va-baseline",rel:"noreferrer",type:"primary",href:"https://account.bilibili.com/account/home",target:"_blank"},{default:e.withCtx((()=>[e.createTextVNode("个人中心")])),_:1}),e.createVNode(h,null,{default:e.withCtx((()=>[e.createTextVNode("查看。数据更新可能有一定的延时。")])),_:1})])])}}}),Y=(t=>(e.pushScopeId("data-v-f7944e85"),t=t(),e.popScopeId(),t))((()=>e.createElementVNode("br",null,null,-1))),ee={class:"avatar-wrap"},te={components:{MainSiteTasks:Z,LiveTasks:K(e.defineComponent({__name:"LiveTasks",setup(t){const i=W(),s=k(),o=i.moduleConfig.DailyTasks.LiveTasks,l=i.moduleStatus.DailyTasks.LiveTasks,r=e.ref(!1),c=e.computed((()=>o.medalTasks.danmu.list.map((e=>({content:e}))))),d=()=>{n.ElMessageBox.prompt("请输入新增的弹幕内容","新增弹幕",{confirmButtonText:"确认",cancelButtonText:"取消",inputPattern:/^.{1,30}$/,inputErrorMessage:"弹幕内容不得为空且长度不能超过30",lockScroll:!1}).then((({value:e})=>{o.medalTasks.danmu.list.push(e)})).catch((()=>{}))},u=e.ref(!1),h=e.computed((()=>{var e;return null==(e=s.filteredFansMedals)?void 0:e.map((e=>({avatar:e.anchor_info.avatar,nick_name:e.anchor_info.nick_name,medal_name:e.medal.medal_name,medal_level:e.medal.level,roomid:e.room_info.room_id})))})),m=e.ref(!1);let g=!0;const f=()=>{if(u.value=!u.value,g)if(s.fansMedals)T(h.value);else{m.value=!0;const t=e.watch(h,(e=>{e&&(t(),g=!1,T(h.value),m.value=!1)}));i.emitter.emit("BiliInfo",{target:"getFansMetals"})}},p=e.ref();let v=!1;const T=t=>{if(v=!0,t){const i=e.watch((()=>p.value),(e=>{setTimeout((()=>i()),0),e&&o.medalTasks.roomidList.forEach((i=>e.toggleRowSelection(t.find((e=>e.roomid===i)),!0)))}),{immediate:!0})}v=!1};function w(e){v||(o.medalTasks.roomidList=e.map((e=>e.roomid)))}return(t,i)=>{const s=e.resolveComponent("el-switch"),g=e.resolveComponent("Info"),v=e.resolveComponent("TaskStatus"),T=e.resolveComponent("el-space"),k=e.resolveComponent("el-row"),y=e.resolveComponent("el-divider"),_=e.resolveComponent("SemiSelect"),x=e.resolveComponent("el-icon"),b=e.resolveComponent("el-button"),C=e.resolveComponent("el-option"),V=e.resolveComponent("el-select"),S=e.resolveComponent("el-text"),N=e.resolveComponent("el-link"),P=e.resolveComponent("el-table-column"),B=e.resolveComponent("el-dialog"),I=e.resolveComponent("el-image"),D=e.resolveDirective("loading");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(k,null,{default:e.withCtx((()=>[e.createVNode(T,{wrap:""},{default:e.withCtx((()=>[e.createVNode(s,{modelValue:e.unref(o).sign.enabled,"onUpdate:modelValue":i[0]||(i[0]=t=>e.unref(o).sign.enabled=t),"active-text":"直播签到"},null,8,["modelValue"]),e.createVNode(g,{id:"DailyTasks.LiveTasks.sign"}),e.createVNode(v,{status:e.unref(l).sign},null,8,["status"])])),_:1})])),_:1}),e.createVNode(k,null,{default:e.withCtx((()=>[e.createVNode(T,{wrap:""},{default:e.withCtx((()=>[e.createVNode(s,{modelValue:e.unref(o).appUser.enabled,"onUpdate:modelValue":i[1]||(i[1]=t=>e.unref(o).appUser.enabled=t),disabled:"","active-text":"APP用户任务"},null,8,["modelValue"]),e.createVNode(g,{id:"DailyTasks.LiveTasks.appUser"}),e.createVNode(v,{status:e.unref(l).appUser},null,8,["status"])])),_:1})])),_:1}),e.createVNode(y),e.createVNode(k,null,{default:e.withCtx((()=>[e.createVNode(T,{wrap:""},{default:e.withCtx((()=>[e.createVNode(s,{modelValue:e.unref(o).medalTasks.like.enabled,"onUpdate:modelValue":i[2]||(i[2]=t=>e.unref(o).medalTasks.like.enabled=t),"active-text":"给主播点赞"},null,8,["modelValue"]),e.createVNode(g,{id:"DailyTasks.LiveTasks.medalTasks.like"}),e.createVNode(v,{status:e.unref(l).medalTasks.like},null,8,["status"])])),_:1})])),_:1}),e.createVNode(k,null,{default:e.withCtx((()=>[e.createVNode(T,{wrap:""},{default:e.withCtx((()=>[e.createVNode(x,null,{default:e.withCtx((()=>[e.createVNode(_)])),_:1}),e.createVNode(s,{modelValue:e.unref(o).medalTasks.like.includeHighLevelMedals,"onUpdate:modelValue":i[3]||(i[3]=t=>e.unref(o).medalTasks.like.includeHighLevelMedals=t),"active-text":"包含等级≥20的粉丝勋章"},null,8,["modelValue"])])),_:1})])),_:1}),e.createVNode(k,null,{default:e.withCtx((()=>[e.createVNode(T,{wrap:""},{default:e.withCtx((()=>[e.createVNode(s,{modelValue:e.unref(o).medalTasks.danmu.enabled,"onUpdate:modelValue":i[4]||(i[4]=t=>e.unref(o).medalTasks.danmu.enabled=t),"active-text":"发送弹幕"},null,8,["modelValue"]),e.createVNode(b,{type:"primary",size:"small",icon:e.unref(a.Edit),onClick:i[5]||(i[5]=e=>r.value=!r.value)},{default:e.withCtx((()=>[e.createTextVNode("编辑弹幕")])),_:1},8,["icon"]),e.createVNode(g,{id:"DailyTasks.LiveTasks.medalTasks.danmu"}),e.createVNode(v,{status:e.unref(l).medalTasks.danmu},null,8,["status"])])),_:1})])),_:1}),e.createVNode(k,null,{default:e.withCtx((()=>[e.createVNode(T,{wrap:""},{default:e.withCtx((()=>[e.createVNode(s,{modelValue:e.unref(o).medalTasks.watch.enabled,"onUpdate:modelValue":i[6]||(i[6]=t=>e.unref(o).medalTasks.watch.enabled=t),"active-text":"观看直播"},null,8,["modelValue"]),e.createVNode(V,{modelValue:e.unref(o).medalTasks.watch.time,"onUpdate:modelValue":i[7]||(i[7]=t=>e.unref(o).medalTasks.watch.time=t),placeholder:"Select",style:{width:"64px"}},{default:e.withCtx((()=>[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(24,(t=>e.createVNode(C,{key:t,label:5*t,value:5*t},null,8,["label","value"]))),64))])),_:1},8,["modelValue"]),e.createVNode(S,null,{default:e.withCtx((()=>[e.createTextVNode("分钟")])),_:1}),e.createVNode(g,{id:"DailyTasks.LiveTasks.medalTasks.watch"}),e.createVNode(v,{status:e.unref(l).medalTasks.watch},null,8,["status"])])),_:1})])),_:1}),e.createVNode(k,null,{default:e.withCtx((()=>[e.createVNode(T,{wrap:""},{default:e.withCtx((()=>[e.createVNode(s,{modelValue:e.unref(o).medalTasks.isWhiteList,"onUpdate:modelValue":i[8]||(i[8]=t=>e.unref(o).medalTasks.isWhiteList=t),"active-text":"白名单","inactive-text":"黑名单"},null,8,["modelValue"]),e.createVNode(b,{type:"primary",size:"small",icon:e.unref(a.Edit),onClick:f},{default:e.withCtx((()=>[e.createTextVNode("编辑名单")])),_:1},8,["icon"]),e.createVNode(g,{id:"DailyTasks.LiveTasks.medalTasks.list"})])),_:1})])),_:1}),e.createVNode(y),e.createVNode(k,null,{default:e.withCtx((()=>[e.createVNode(S,null,{default:e.withCtx((()=>[e.createTextVNode("直播任务相关信息可在")])),_:1}),e.createVNode(N,{class:"el-link-va-baseline",rel:"noreferrer",type:"primary",href:"https://link.bilibili.com/p/help/index#/audience-fans-medal",target:"_blank"},{default:e.withCtx((()=>[e.createTextVNode("帮助中心")])),_:1}),e.createVNode(S,null,{default:e.withCtx((()=>[e.createTextVNode("查看。")])),_:1})])),_:1}),Y,e.createVNode(k,null,{default:e.withCtx((()=>[e.createVNode(S,{tag:"b"},{default:e.withCtx((()=>[e.createTextVNode("注意:")])),_:1})])),_:1}),e.createVNode(k,null,{default:e.withCtx((()=>[e.createVNode(S,null,{default:e.withCtx((()=>[e.createTextVNode("  由于每天能通过完成任务获得亲密度的粉丝勋章数量有限,脚本默认仅为最多100个等级小于20的粉丝勋章完成给主播点赞,发送弹幕,观看直播任务。")])),_:1})])),_:1}),e.createVNode(B,{modelValue:r.value,"onUpdate:modelValue":i[9]||(i[9]=e=>r.value=e),title:"编辑弹幕内容","lock-scroll":!1,width:"40%"},{footer:e.withCtx((()=>[e.createVNode(b,{type:"primary",onClick:d},{default:e.withCtx((()=>[e.createTextVNode("新增弹幕")])),_:1})])),default:e.withCtx((()=>[e.createVNode(e.unref(n.ElTable),{data:c.value,"max-height":"500"},{default:e.withCtx((()=>[e.createVNode(P,{type:"index",width:"50"}),e.createVNode(P,{prop:"content",label:"弹幕内容"}),e.createVNode(P,{label:"操作",width:"220",align:"center"},{default:e.withCtx((t=>[e.createVNode(b,{text:"",icon:e.unref(a.Edit),onClick:e=>{return i=t.$index,s=t.row,void n.ElMessageBox.prompt("请输入新的弹幕内容","修改弹幕",{confirmButtonText:"确认",cancelButtonText:"取消",inputPattern:/^.{1,30}$/,inputErrorMessage:"弹幕内容不得为空且长度不能超过30",inputValue:s.content,lockScroll:!1}).then((({value:e})=>{o.medalTasks.danmu.list[i]=e})).catch((()=>{}));var i,s}},{default:e.withCtx((()=>[e.createTextVNode(" 修改 ")])),_:2},1032,["icon","onClick"]),e.createVNode(b,{text:"",icon:e.unref(a.Delete),type:"danger",onClick:e=>{return i=t.$index,void(1!==o.medalTasks.danmu.list.length?o.medalTasks.danmu.list.splice(i,1):n.ElMessage.warning({message:"至少要有一条弹幕",appendTo:".el-dialog"}));var i}},{default:e.withCtx((()=>[e.createTextVNode(" 删除 ")])),_:2},1032,["icon","onClick"])])),_:1})])),_:1},8,["data"])])),_:1},8,["modelValue"]),e.createVNode(B,{modelValue:u.value,"onUpdate:modelValue":i[10]||(i[10]=e=>u.value=e),title:"编辑粉丝勋章名单","lock-scroll":!1,width:"40%"},{default:e.withCtx((()=>[e.withDirectives((e.openBlock(),e.createBlock(e.unref(n.ElTable),{ref_key:"medalInfoTableRef",ref:p,data:h.value,"max-height":"500","empty-text":"没有粉丝勋章",onSelectionChange:w},{default:e.withCtx((()=>[e.createVNode(P,{type:"selection",align:"center",width:"55"}),e.createVNode(P,{prop:"avatar",label:"头像"},{default:e.withCtx((t=>[e.createElementVNode("div",ee,[e.createVNode(I,{src:t.row.avatar,loading:"lazy",referrerpolicy:"origin",class:"avatar"},{error:e.withCtx((()=>[e.createVNode(I,{src:"//i0.hdslb.com/bfs/face/member/noface.jpg",referrerpolicy:"origin",class:"avatar"})])),_:2},1032,["src"])])])),_:1}),e.createVNode(P,{prop:"nick_name",label:"昵称"}),e.createVNode(P,{prop:"medal_name",label:"粉丝勋章"}),e.createVNode(P,{prop:"medal_level",label:"等级",sortable:""}),e.createVNode(P,{prop:"roomid",label:"房间号"},{default:e.withCtx((t=>[e.createVNode(N,{href:"https://live.bilibili.com/"+t.row.roomid+"?visit_id=",rel:"noreferrer",type:"primary",target:"_blank"},{default:e.withCtx((()=>[e.createTextVNode(e.toDisplayString(t.row.roomid),1)])),_:2},1032,["href"])])),_:1})])),_:1},8,["data"])),[[D,m.value]])])),_:1},8,["modelValue"])])}}}),[["__scopeId","data-v-f7944e85"]]),OtherTasks:e.defineComponent({__name:"OtherTasks",setup(t){const i=W(),s=i.moduleConfig.DailyTasks.OtherTasks,o=i.moduleStatus.DailyTasks.OtherTasks;return(t,i)=>{const a=e.resolveComponent("el-switch"),n=e.resolveComponent("Info"),l=e.resolveComponent("TaskStatus"),r=e.resolveComponent("el-space"),c=e.resolveComponent("el-row"),d=e.resolveComponent("el-text"),u=e.resolveComponent("el-option"),h=e.resolveComponent("el-select"),m=e.resolveComponent("el-divider");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(c,null,{default:e.withCtx((()=>[e.createVNode(r,{wrap:""},{default:e.withCtx((()=>[e.createVNode(a,{modelValue:e.unref(s).groupSign.enabled,"onUpdate:modelValue":i[0]||(i[0]=t=>e.unref(s).groupSign.enabled=t),"active-text":"应援团签到"},null,8,["modelValue"]),e.createVNode(n,{id:"DailyTasks.OtherTasks.groupSign"}),e.createVNode(l,{status:e.unref(o).groupSign},null,8,["status"])])),_:1})])),_:1}),e.createVNode(c,null,{default:e.withCtx((()=>[e.createVNode(r,{wrap:""},{default:e.withCtx((()=>[e.createVNode(a,{modelValue:e.unref(s).silverToCoin.enabled,"onUpdate:modelValue":i[1]||(i[1]=t=>e.unref(s).silverToCoin.enabled=t),"active-text":"银瓜子换硬币"},null,8,["modelValue"]),e.createVNode(n,{id:"DailyTasks.OtherTasks.silverToCoin"}),e.createVNode(l,{status:e.unref(o).silverToCoin},null,8,["status"])])),_:1})])),_:1}),e.createVNode(c,null,{default:e.withCtx((()=>[e.createVNode(r,{wrap:""},{default:e.withCtx((()=>[e.createVNode(a,{modelValue:e.unref(s).coinToSilver.enabled,"onUpdate:modelValue":i[2]||(i[2]=t=>e.unref(s).coinToSilver.enabled=t),"active-text":"硬币换银瓜子"},null,8,["modelValue"]),e.createVNode(d,null,{default:e.withCtx((()=>[e.createTextVNode("花费硬币")])),_:1}),e.createVNode(h,{modelValue:e.unref(s).coinToSilver.num,"onUpdate:modelValue":i[3]||(i[3]=t=>e.unref(s).coinToSilver.num=t),placeholder:"Select",style:{width:"64px"}},{default:e.withCtx((()=>[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(50,(t=>e.createVNode(u,{key:t,label:t,value:t},null,8,["label","value"]))),64))])),_:1},8,["modelValue"]),e.createVNode(d,null,{default:e.withCtx((()=>[e.createTextVNode("个")])),_:1}),e.createVNode(n,{id:"DailyTasks.OtherTasks.coinToSilver"}),e.createVNode(l,{status:e.unref(o).coinToSilver},null,8,["status"])])),_:1})])),_:1}),e.createVNode(m)])}}}),EnhanceExperience:e.defineComponent({__name:"EnhanceExperience",setup(t){const i=W().moduleConfig.EnhanceExperience,s=["原画","蓝光PRO","蓝光","超清PRO","超清","高清"];return(t,o)=>{const a=e.resolveComponent("el-switch"),n=e.resolveComponent("el-option"),l=e.resolveComponent("el-select"),r=e.resolveComponent("Info"),c=e.resolveComponent("el-space"),d=e.resolveComponent("el-row"),u=e.resolveComponent("el-divider");return e.openBlock(),e.createElementBlock("div",null,[e.createVNode(d,null,{default:e.withCtx((()=>[e.createVNode(c,{wrap:""},{default:e.withCtx((()=>[e.createVNode(a,{modelValue:e.unref(i).switchLiveStreamQuality.enabled,"onUpdate:modelValue":o[0]||(o[0]=t=>e.unref(i).switchLiveStreamQuality.enabled=t),"active-text":"自动切换画质"},null,8,["modelValue"]),e.createVNode(l,{modelValue:e.unref(i).switchLiveStreamQuality.qualityDesc,"onUpdate:modelValue":o[1]||(o[1]=t=>e.unref(i).switchLiveStreamQuality.qualityDesc=t),placeholder:"Select",style:{width:"110px"}},{default:e.withCtx((()=>[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(s,(t=>e.createVNode(n,{key:t,label:t,value:t},null,8,["label","value"]))),64))])),_:1},8,["modelValue"]),e.createVNode(r,{id:"EnhanceExperience.switchLiveStreamQuality"})])),_:1})])),_:1}),e.createVNode(d,null,{default:e.withCtx((()=>[e.createVNode(c,{wrap:""},{default:e.withCtx((()=>[e.createVNode(a,{modelValue:e.unref(i).banp2p.enabled,"onUpdate:modelValue":o[2]||(o[2]=t=>e.unref(i).banp2p.enabled=t),"active-text":"禁用P2P"},null,8,["modelValue"]),e.createVNode(r,{id:"EnhanceExperience.banp2p"})])),_:1})])),_:1}),e.createVNode(u)])}}})}},ie=e.defineComponent({...te,__name:"PanelMain",setup(t){const i=T();return(t,s)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(i).uiConfig.activeMenuIndex)))}}),se=K(e.defineComponent({__name:"App",setup(t){const s=T(),o=W(),a=new L("App.vue");let n,r,c=s.uiConfig.isShowPanel;function d(){const e=n.getBoundingClientRect();s.baseStyleValue.top=e.top+window.scrollY,s.baseStyleValue.left=e.left+window.scrollX,s.baseStyleValue.height=e.height,s.baseStyleValue.width=.4*e.width}s.uiConfig.isShowPanel=!1;const u=i.throttle((function(){s.changeShowPanel(),r.innerText=s.isShowPanelButtonText}),300);return o.loadModules(),window.onload=()=>{if(n=O("#live-player-ctnr"),n){d(),(e=document,t=".left-ctnr.left-header-area",i=300,o=3e3,new Promise(((s,a)=>{const n=setInterval((()=>{const i=e.querySelector(t);i&&(clearTimeout(n),s(i))}),i),l=setTimeout((()=>{clearTimeout(n),clearTimeout(l),a()}),o)}))).then((e=>{var t;r=U("button"),r.setAttribute("class","blth_btn"),r.onclick=u,r.innerText=s.isShowPanelButtonText,e.append(r),f.self!==f.top&&l("alt+b",{element:null==(t=f.top)?void 0:t.document},u),l("alt+b",u)})).catch((()=>a.error("Can't find playerHeaderLeft in time"))),window.onresize=d;const n=new MutationObserver((()=>d()));n.observe(document.documentElement,{attributes:!0}),n.observe(document.body,{attributes:!0}),c&&(s.uiConfig.isShowPanel=!0)}else a.error("livePlayer not found");var e,t,i,o},(t,i)=>{const o=e.resolveComponent("el-header"),a=e.resolveComponent("el-aside"),n=e.resolveComponent("el-main"),l=e.resolveComponent("el-container"),r=e.resolveComponent("el-scrollbar"),c=e.resolveComponent("el-collapse-transition");return e.openBlock(),e.createBlock(c,null,{default:e.withCtx((()=>[e.withDirectives(e.createElementVNode("div",{style:e.normalizeStyle(e.unref(s).baseStyle),class:"base"},[e.createVNode(l,null,{default:e.withCtx((()=>[e.createVNode(o,{class:"header"},{default:e.withCtx((()=>[e.createVNode(Q)])),_:1}),e.createVNode(r,{height:e.unref(s).scrollBarHeight},{default:e.withCtx((()=>[e.createVNode(l,null,{default:e.withCtx((()=>[e.createVNode(a,{class:"aside"},{default:e.withCtx((()=>[e.createVNode(X)])),_:1}),e.createVNode(n,{class:"main"},{default:e.withCtx((()=>[(e.openBlock(),e.createBlock(e.KeepAlive,null,[e.createVNode(e.Transition,{name:"fade",mode:"out-in"},{default:e.withCtx((()=>[e.createVNode(ie)])),_:1})],1024))])),_:1})])),_:1})])),_:1},8,["height"])])),_:1})],4),[[e.vShow,e.unref(s).uiConfig.isShowPanel]])])),_:1})}}}),[["__scopeId","data-v-4aed17ff"]]);(e=>{const t=GM_getResourceText(e),i=document.createElement("style");i.innerText=t,document.head.append(i)})("element-plus/dist/index.css");const oe={},ae={xmlns:"http://www.w3.org/2000/svg",width:"128",height:"128",class:"icon",viewBox:"0 0 1024 1024"},ne=[e.createElementVNode("path",{d:"M831.825 63.94H191.94c-70.692 0-128 57.308-128 128v639.885c0 70.692 57.308 128 128 128h639.885c70.692 0 128-57.308 128-128V191.94c0-70.692-57.308-128-128-128zM895.885 832a63.835 63.835 0 0 1-63.973 63.886H192.088c-17.112 0-33.27-6.575-45.372-18.676S127.88 849.112 127.88 832V192a64.236 64.236 0 0 1 64.208-64.12h639.824A64.038 64.038 0 0 1 895.885 192v640z"},null,-1),e.createElementVNode("path",{d:"M791.998 351.852H536a31.97 31.97 0 0 0 0 63.94h256a31.97 31.97 0 0 0 0-63.94zm0 256.121H536a31.97 31.97 0 0 0 0 63.94h256a31.97 31.97 0 0 0 0-63.94zm-447.996-79.975c-61.856 0-111.986 50.144-111.986 111.985S282.16 751.97 344.002 751.97s111.985-50.144 111.985-111.986-50.13-111.985-111.985-111.985zm33.982 145.982a48.045 48.045 0 1 1 14.088-33.982 47.746 47.746 0 0 1-14.088 33.986zm39.412-376.586L311.999 402.787l-41.391-41.395a31.97 31.97 0 1 0-45.213 45.213l63.997 64.002a31.97 31.97 0 0 0 45.214 0l128-128a31.97 31.97 0 0 0-45.21-45.213z"},null,-1)];const le=K(oe,[["render",function(t,i){return e.openBlock(),e.createElementBlock("svg",ae,ne)}]]),re={DailyTasks:{MainSiteTasks:{login:{title:"每日登录",message:"完成主站的每日登录任务。"},watch:{title:"每日观看视频",message:e.h("p",[e.h("div","完成主站的每日观看视频任务。"),e.h("div","从动态中选取视频观看,会产生观看历史记录。")])},coin:{title:"每日投币",message:e.h("p",[e.h("div","完成主站的每日投币任务。"),e.h("div","从动态中选取视频投币,会根据你今天已经投过的币的数量计算还要投几个币。")])},share:{title:"每日分享视频",message:e.h("p",[e.h("div","完成主站的每日分享视频任务。"),e.h("div","不会真的分享到某处。")])}},LiveTasks:{sign:{title:"直播签到",message:e.h("p",[e.h("div","完成直播签到任务。"),e.h("div","完成后会移除当前直播间右上角签到窗口中的签到按钮。")])},appUser:{title:"APP用户任务",message:e.h("p",[e.h("div","完成APP用户任务并领取奖励。"),e.h("div",[e.h("strong","由于曾经的APP用户任务下架已久,目前的新任务(观看新主播直播并发弹幕)又没有对全部用户开放,故改功能暂时被禁用。"),e.h("div",[e.h("span","在APP中观看直播时右下角可能会有个电池图标,点击即可查看APP用户任务内容。并非所有账号都可以参加该任务。 如果开启了发送弹幕功能,该功能会在发送弹幕功能运行完毕后再运行。如果之前发送的弹幕数量不够,会先在直播间"),e.h("a",{class:"el-link el-link--primary is-underline el-link-va-baseline",href:"https://live.bilibili.com/22474988",rel:"noreferrer",target:"_blank"},"22474988"),e.h("span","发送弹幕再领取奖励。")])])])},medalTasks:{list:{title:"黑白名单",message:e.h("p",[e.h("div","为更精细地控制为哪些粉丝勋章执行任务,你可以使用黑名单或白名单模式。"),e.h("div",[e.h("li",[e.h("span","黑名单:仅为"),e.h("strong","不在"),e.h("span","名单中的粉丝勋章执行任务。")]),e.h("li",[e.h("span","白名单:仅为"),e.h("strong","在"),e.h("span","名单中的粉丝勋章执行任务。")])]),e.h("div","点击编辑名单按钮,然后使用第一列的多选框即可编辑名单中的粉丝勋章。")])},like:{title:"给主播点赞",message:e.h("p",[e.h("div","在你的每个粉丝勋章对应的直播间给主播点赞。"),e.h("div","如果你不希望等级≥20的粉丝勋章熄灭,可以勾选下面的“包含等级≥20的粉丝勋章”。"),e.h("div","部分直播间无法完成该任务,原因未知。")])},danmu:{title:"发送弹幕",message:e.h("p",[e.h("div","在你的每个粉丝勋章对应的直播间发送一条弹幕。"),e.h("div",[e.h("span","点击编辑弹幕按钮编辑发送的弹幕,脚本会从中按顺序循环抽取弹幕发送。"),e.h("span","部分直播间无法完成该任务,可能的原因有:,"),e.h("li","你被禁言了"),e.h("li","发言有粉丝勋章等级要求"),e.h("li",[e.h("span","特殊直播间(比如"),e.h("a",{href:"https://live.bilibili.com/54",rel:"noreferrer",target:"_blank"},"54"),e.h("span",")")])])])},watch:{title:"观看直播",message:e.h("p",[e.h("div","完成观看持有粉丝勋章对应主播直播的任务。"),e.h("div","部分直播间因为没有设置直播分区导致任务无法完成。主播当前是否开播不会影响该任务的完成。")])}}},OtherTasks:{groupSign:{title:"应援团签到",message:"完成应援团签到任务。"},silverToCoin:{title:"银瓜子换硬币",message:e.h("p",[e.h("div","把银瓜子兑换为硬币。"),e.h("div","具体兑换规则请点击直播间页面的“立即充值→银瓜子商店”查看。")])},coinToSilver:{title:"硬币换银瓜子",message:e.h("p",[e.h("div","把硬币兑换为银瓜子。"),e.h("div","具体兑换规则请点击直播间页面的“立即充值→银瓜子商店”查看。")])}}},EnhanceExperience:{switchLiveStreamQuality:{title:"自动切换画质",message:e.h("p",[e.h("div","打开直播间后自动把播放器切换到指定画质。"),e.h("div","如果指定画质不存在,则还是使用B站的默认画质。")])},banp2p:{title:"禁用P2P",message:e.h("p",[e.h("div","禁用直播流的P2P上传/下载"),e.h("div","B站使用WebRTC技术把许多浏览器点对点(P2P)地连接起来,实现视频流和音频流的传输。这样做是为了减轻B站服务器的压力,但是会占用你一定的上行带宽(大约几百kb每秒)。如果你不想被占用上行带宽,可以开启该功能。若开启后发现观看直播时有明显卡顿,请关闭。")])}}},ce=(t=>(e.pushScopeId("data-v-c1d8df5e"),t=t(),e.popScopeId(),t))((()=>e.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",width:"128",height:"128",class:"icon",viewBox:"0 0 1024 1024"},[e.createElementVNode("path",{fill:"#276BC0",d:"M512.67 959.47c-246.343 0-446.76-200.632-446.76-447.24S266.326 64.98 512.67 64.98s446.76 200.642 446.76 447.25-200.416 447.24-446.76 447.24zm0-829.04c-210.291 0-381.38 171.283-381.38 381.8s171.089 381.79 381.38 381.79 381.381-171.273 381.381-381.79-171.09-381.8-381.38-381.8z"}),e.createElementVNode("path",{fill:"#276BC0",d:"M447.29 317.172a63.891 63.959 0 1 0 130.76 0 63.891 63.959 0 1 0-130.76 0Zm64.907 503.047c-30.093 0-54.235-24.416-54.235-54.541V482.062c0-30.126 24.142-54.541 54.235-54.541 30.094 0 54.236 24.416 54.236 54.541v283.616c0 30.125-24.142 54.54-54.236 54.54z"})],-1))),de=K(e.defineComponent({__name:"InfoIcon",props:{id:{}},setup(t){const s=t,o=()=>{const{title:e,message:t}=i.get(re,s.id,{title:"无",message:"无"});n.ElMessageBox({title:e,message:t,lockScroll:!1,autofocus:!0,confirmButtonText:"OK"})};return(t,i)=>{const s=e.resolveComponent("el-icon");return e.openBlock(),e.createBlock(s,{class:"info-icon",onClick:o},{default:e.withCtx((()=>[ce])),_:1})}}}),[["__scopeId","data-v-c1d8df5e"]]),ue=K(e.defineComponent({__name:"TaskStatusIcon",props:{status:{}},setup:t=>(t,i)=>{const s=e.resolveComponent("Loading"),o=e.resolveComponent("el-icon"),a=e.resolveComponent("Select"),n=e.resolveComponent("CloseBold");return"running"===t.status?(e.openBlock(),e.createBlock(o,{key:0,class:"status-icon is-loading"},{default:e.withCtx((()=>[e.createVNode(s)])),_:1})):"done"===t.status?(e.openBlock(),e.createBlock(o,{key:1,class:"status-icon",style:{color:"#1ab059"}},{default:e.withCtx((()=>[e.createVNode(a)])),_:1})):"error"===t.status?(e.openBlock(),e.createBlock(o,{key:2,class:"status-icon",style:{color:"#ff6464"}},{default:e.withCtx((()=>[e.createVNode(n)])),_:1})):e.createCommentVNode("",!0)}}),[["__scopeId","data-v-2f9d6050"]]),he=Object.freeze(Object.defineProperty({__proto__:null,Info:de,TaskStatus:ue,Tasks:le},Symbol.toStringTag,{value:"Module"}));!function(){if(f.BilibiliLive){const i=e.createApp(se),s=t.createPinia();i.use(n),i.use(s);const o=new L("main.ts"),a=q();a.checkIfMainBLTHRunning(),a.isMainBLTHRunning?o.log("其它页面上存在正在运行的Main BLTH"):(o.log("当前脚本是Main BLTH,开始存活心跳"),a.startAliveHeartBeat());for(const[e,t]of Object.entries(c))i.component(e,t);for(const[e,t]of Object.entries(he))i.component(e,t);i.mount((()=>{try{const e=U("div");return e.id="BLTH",document.body.append(e),e}catch(e){return o.error("挂载Vue app时发送错误",e),"Error"}})())}}()}(Vue,Pinia,_,luxon,CryptoJS,ElementPlusIconsVue,ElementPlus,hotkeys); \ No newline at end of file diff --git a/dist/bilibili-live-tasks-helper.user.js b/dist/bilibili-live-tasks-helper.user.js index 0e99f562..0c286e91 100644 --- a/dist/bilibili-live-tasks-helper.user.js +++ b/dist/bilibili-live-tasks-helper.user.js @@ -3,7 +3,7 @@ // @name:en Bilibili Live Tasks Helper // @name:zh Bilibili Live Tasks Helper // @namespace https://github.com/andywang425 -// @version 7.0.5 +// @version 7.0.6 // @author andywang425 // @description Enhancing the experience of watching Bilibili live streaming. // @description:en Enhancing the experience of watching Bilibili live streaming. @@ -40,7 +40,7 @@ // @run-at document-end // ==/UserScript== -(a=>{const e=document.createElement("style");e.dataset.source="vite-plugin-monkey",e.textContent=a,document.head.append(e)})(" .title[data-v-dda95e10]{padding-left:20px;align-items:center;display:flex}.header-big-text[data-v-dda95e10]{font-size:var(--big-text-size)}.header-small-text[data-v-dda95e10]{font-size:var(--small-text-size);padding-top:calc(var(--big-text-size) - var(--small-text-size));margin-left:10px;--small-text-size: 18px}.collapse-btn[data-v-dda95e10]{display:flex;justify-content:center;align-items:center;height:100%;float:left;cursor:pointer}.avatar-wrap[data-v-eac67691]{width:80px;height:80px}.avatar[data-v-eac67691]{display:flex;justify-content:center;align-items:center;border-radius:50%}.base[data-v-4aed17ff]{z-index:1003;position:absolute;background-color:#fff;border-bottom:1px solid #e3e5e7;border-left:1px solid #e3e5e7;border-right:1px solid #e3e5e7}.header[data-v-4aed17ff]{position:relative;box-sizing:border-box;width:100%;font-size:var(--big-text-size);align-items:center;display:flex;border-bottom:1px solid #e3e5e7;height:60px;--big-text-size: 25px}.aside[data-v-4aed17ff]{width:auto}.aside #aside-el-menu[data-v-4aed17ff]:not(.el-menu--collapse){width:150px}.main[data-v-4aed17ff]{--main-top-botton-padding: calc(var(--el-main-padding) * .625);padding-top:var(--main-top-botton-padding);padding-bottom:var(--main-top-botton-padding)}.fade-enter-active[data-v-4aed17ff],.fade-leave-active[data-v-4aed17ff]{transition:opacity .1s ease}.fade-enter-from[data-v-4aed17ff],.fade-leave-to[data-v-4aed17ff]{opacity:0}.info-icon[data-v-c1d8df5e]{font-size:var(--el-font-size-base);cursor:pointer}.status-icon[data-v-2f9d6050]{font-size:var(--el-font-size-base)}.blth_btn{background-color:#23ade5;font-size:small;margin-inline-start:5px;color:#fff;border-radius:4px;border:none;padding:5px;cursor:pointer;box-shadow:0 0 2px #00000075;line-height:10px;margin-left:15px}.blth_btn:hover{background-color:#1097cc}.blth_btn:hover:active{background-color:#0e86b6;position:relative;top:1px}.el-link-va-baseline{vertical-align:baseline} "); +(a=>{const e=document.createElement("style");e.dataset.source="vite-plugin-monkey",e.textContent=a,document.head.append(e)})(" .title[data-v-dda95e10]{padding-left:20px;align-items:center;display:flex}.header-big-text[data-v-dda95e10]{font-size:var(--big-text-size)}.header-small-text[data-v-dda95e10]{font-size:var(--small-text-size);padding-top:calc(var(--big-text-size) - var(--small-text-size));margin-left:10px;--small-text-size: 18px}.collapse-btn[data-v-dda95e10]{display:flex;justify-content:center;align-items:center;height:100%;float:left;cursor:pointer}.avatar-wrap[data-v-f7944e85]{width:80px;height:80px}.avatar[data-v-f7944e85]{display:flex;justify-content:center;align-items:center;border-radius:50%}.base[data-v-4aed17ff]{z-index:1003;position:absolute;background-color:#fff;border-bottom:1px solid #e3e5e7;border-left:1px solid #e3e5e7;border-right:1px solid #e3e5e7}.header[data-v-4aed17ff]{position:relative;box-sizing:border-box;width:100%;font-size:var(--big-text-size);align-items:center;display:flex;border-bottom:1px solid #e3e5e7;height:60px;--big-text-size: 25px}.aside[data-v-4aed17ff]{width:auto}.aside #aside-el-menu[data-v-4aed17ff]:not(.el-menu--collapse){width:150px}.main[data-v-4aed17ff]{--main-top-botton-padding: calc(var(--el-main-padding) * .625);padding-top:var(--main-top-botton-padding);padding-bottom:var(--main-top-botton-padding)}.fade-enter-active[data-v-4aed17ff],.fade-leave-active[data-v-4aed17ff]{transition:opacity .1s ease}.fade-enter-from[data-v-4aed17ff],.fade-leave-to[data-v-4aed17ff]{opacity:0}.info-icon[data-v-c1d8df5e]{font-size:var(--el-font-size-base);cursor:pointer}.status-icon[data-v-2f9d6050]{font-size:var(--el-font-size-base)}.blth_btn{background-color:#23ade5;font-size:small;margin-inline-start:5px;color:#fff;border-radius:4px;border:none;padding:5px;cursor:pointer;box-shadow:0 0 2px #00000075;line-height:10px;margin-left:15px}.blth_btn:hover{background-color:#1097cc}.blth_btn:hover:active{background-color:#0e86b6;position:relative;top:1px}.el-link-va-baseline{vertical-align:baseline} "); (function (vue, pinia, _, luxon, CryptoJS, ElementPlusIconsVue, ElementPlus, hotkeys) { 'use strict'; @@ -134,6 +134,7 @@ }, like: { enabled: false, + includeHighLevelMedals: false, _lastCompleteTime: 0 }, watch: { @@ -1543,7 +1544,7 @@ const biliStore = useBiliStore(); if (biliStore.filteredFansMedals) { return biliStore.filteredFansMedals.filter( - (medal) => medal.medal.level < 20 && (this.medalTasksConfig.isWhiteList ? this.medalTasksConfig.roomidList.includes(medal.room_info.room_id) : !this.medalTasksConfig.roomidList.includes(medal.room_info.room_id)) + (medal) => (this.config.includeHighLevelMedals ? true : medal.medal.level < 20) && (this.medalTasksConfig.isWhiteList ? this.medalTasksConfig.roomidList.includes(medal.room_info.room_id) : !this.medalTasksConfig.roomidList.includes(medal.room_info.room_id)) ).map((medal) => [medal.room_info.room_id, medal.medal.target_id]).slice(0, 100); } else { this.status = "error"; @@ -2665,7 +2666,7 @@ }; } }); - const _withScopeId$1 = (n) => (vue.pushScopeId("data-v-eac67691"), n = n(), vue.popScopeId(), n); + const _withScopeId$1 = (n) => (vue.pushScopeId("data-v-f7944e85"), n = n(), vue.popScopeId(), n); const _hoisted_1$2 = /* @__PURE__ */ _withScopeId$1(() => /* @__PURE__ */ vue.createElementVNode("br", null, null, -1)); const _hoisted_2$1 = { class: "avatar-wrap" }; const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({ @@ -2787,6 +2788,8 @@ const _component_el_space = vue.resolveComponent("el-space"); const _component_el_row = vue.resolveComponent("el-row"); const _component_el_divider = vue.resolveComponent("el-divider"); + const _component_SemiSelect = vue.resolveComponent("SemiSelect"); + const _component_el_icon = vue.resolveComponent("el-icon"); const _component_el_button = vue.resolveComponent("el-button"); const _component_el_option = vue.resolveComponent("el-option"); const _component_el_select = vue.resolveComponent("el-select"); @@ -2856,20 +2859,41 @@ ]), _: 1 }), + vue.createVNode(_component_el_row, null, { + default: vue.withCtx(() => [ + vue.createVNode(_component_el_space, { wrap: "" }, { + default: vue.withCtx(() => [ + vue.createVNode(_component_el_icon, null, { + default: vue.withCtx(() => [ + vue.createVNode(_component_SemiSelect) + ]), + _: 1 + }), + vue.createVNode(_component_el_switch, { + modelValue: vue.unref(config).medalTasks.like.includeHighLevelMedals, + "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => vue.unref(config).medalTasks.like.includeHighLevelMedals = $event), + "active-text": "包含等级≥20的粉丝勋章" + }, null, 8, ["modelValue"]) + ]), + _: 1 + }) + ]), + _: 1 + }), vue.createVNode(_component_el_row, null, { default: vue.withCtx(() => [ vue.createVNode(_component_el_space, { wrap: "" }, { default: vue.withCtx(() => [ vue.createVNode(_component_el_switch, { modelValue: vue.unref(config).medalTasks.danmu.enabled, - "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => vue.unref(config).medalTasks.danmu.enabled = $event), + "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => vue.unref(config).medalTasks.danmu.enabled = $event), "active-text": "发送弹幕" }, null, 8, ["modelValue"]), vue.createVNode(_component_el_button, { type: "primary", size: "small", icon: vue.unref(ElementPlusIconsVue.Edit), - onClick: _cache[4] || (_cache[4] = ($event) => medalDanmuPanelVisible.value = !medalDanmuPanelVisible.value) + onClick: _cache[5] || (_cache[5] = ($event) => medalDanmuPanelVisible.value = !medalDanmuPanelVisible.value) }, { default: vue.withCtx(() => [ vue.createTextVNode("编辑弹幕") @@ -2892,12 +2916,12 @@ default: vue.withCtx(() => [ vue.createVNode(_component_el_switch, { modelValue: vue.unref(config).medalTasks.watch.enabled, - "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => vue.unref(config).medalTasks.watch.enabled = $event), + "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => vue.unref(config).medalTasks.watch.enabled = $event), "active-text": "观看直播" }, null, 8, ["modelValue"]), vue.createVNode(_component_el_select, { modelValue: vue.unref(config).medalTasks.watch.time, - "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => vue.unref(config).medalTasks.watch.time = $event), + "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => vue.unref(config).medalTasks.watch.time = $event), placeholder: "Select", style: { "width": "64px" } }, { @@ -2934,7 +2958,7 @@ default: vue.withCtx(() => [ vue.createVNode(_component_el_switch, { modelValue: vue.unref(config).medalTasks.isWhiteList, - "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => vue.unref(config).medalTasks.isWhiteList = $event), + "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => vue.unref(config).medalTasks.isWhiteList = $event), "active-text": "白名单", "inactive-text": "黑名单" }, null, 8, ["modelValue"]), @@ -3002,7 +3026,7 @@ default: vue.withCtx(() => [ vue.createVNode(_component_el_text, null, { default: vue.withCtx(() => [ - vue.createTextVNode("  由于每天能通过完成任务获得亲密度的粉丝勋章数量有限,目前脚本仅为最多100个等级小于20的粉丝勋章完成给主播点赞,发送弹幕,观看直播任务。") + vue.createTextVNode("  由于每天能通过完成任务获得亲密度的粉丝勋章数量有限,脚本默认仅为最多100个等级小于20的粉丝勋章完成给主播点赞,发送弹幕,观看直播任务。") ]), _: 1 }) @@ -3011,7 +3035,7 @@ }), vue.createVNode(_component_el_dialog, { modelValue: medalDanmuPanelVisible.value, - "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => medalDanmuPanelVisible.value = $event), + "onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => medalDanmuPanelVisible.value = $event), title: "编辑弹幕内容", "lock-scroll": false, width: "40%" @@ -3079,7 +3103,7 @@ }, 8, ["modelValue"]), vue.createVNode(_component_el_dialog, { modelValue: medalInfoPanelVisible.value, - "onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => medalInfoPanelVisible.value = $event), + "onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => medalInfoPanelVisible.value = $event), title: "编辑粉丝勋章名单", "lock-scroll": false, width: "40%" @@ -3168,7 +3192,7 @@ }; } }); - const LiveTasks = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-eac67691"]]); + const LiveTasks = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-f7944e85"]]); const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({ __name: "OtherTasks", setup(__props) { @@ -3600,6 +3624,7 @@ title: "给主播点赞", message: vue.h("p", [ vue.h("div", "在你的每个粉丝勋章对应的直播间给主播点赞。"), + vue.h("div", "如果你不希望等级≥20的粉丝勋章熄灭,可以勾选下面的“包含等级≥20的粉丝勋章”。"), vue.h("div", "部分直播间无法完成该任务,原因未知。") ]) },