diff --git a/dist/auto-task-v4-for-giveawaysu.user.js b/dist/auto-task-v4-for-giveawaysu.user.js index 54f0fff..04eed72 100644 --- a/dist/auto-task-v4-for-giveawaysu.user.js +++ b/dist/auto-task-v4-for-giveawaysu.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name auto-task-v4-for-giveawaysu // @namespace auto-task-v4-for-giveawaysu -// @version 4.1.1-Beta +// @version 4.1.2-Beta // @description 赠Key站自动任务 // @author HCLonely // @license MIT @@ -63,7 +63,7 @@ console.log('%c%s', 'color:blue', 'Auto Task GS特供脚本开始加载'); -!function(){var s={514:function(t,e){!function(t){"use strict";var i=function(){return(i=Object.assign||function(t){for(var e,s=1,i=arguments.length;s[a-z\d]+)(\/|\s)(?(\d+\.)+\d+)/i))||void 0===e?void 0:e.groups)&&void 0!==s?s:{},a=o.name,r=o.version,l={},u=0,c=Object.entries(this.browserNameMap);u(.*)=.+)/.exec(decodeURIComponent(t)))||void 0===t?void 0:t.groups;if(!t)return{};for(var e=t.params.split("&"),i={},s=0;s{var{isDenied:e,isConfirmed:t}=t;if(t)window.open(`https://github.com/HCLonely/auto-task-v4/issues/new?title=${encodeURIComponent("脚本报错: "+n)}&labels=bug&body=`+encodeURIComponent(`错误链接: [${window.location.href}](${window.location.href}) +!function(){var s={514:function(t,e){!function(t){"use strict";var i=function(){return(i=Object.assign||function(t){for(var e,s=1,i=arguments.length;s[a-z\d]+)(\/|\s)(?(\d+\.)+\d+)/i))||void 0===e?void 0:e.groups)&&void 0!==s?s:{},a=o.name,r=o.version,l={},u=0,c=Object.entries(this.browserNameMap);u(.*)=.+)/.exec(decodeURIComponent(t)))||void 0===t?void 0:t.groups;if(!t)return{};for(var e=t.params.split("&"),i={},s=0;s{var{isDenied:e,isConfirmed:t}=t;if(t)window.open(`https://github.com/HCLonely/auto-task-v4/issues/new?title=${encodeURIComponent("脚本报错: "+n)}&labels=bug&body=`+encodeURIComponent(`错误链接: [${window.location.href}](${window.location.href}) 环境: \`\`\` @@ -98,4 +98,4 @@ ${$.makeArray($("#auto-task-info>li")).map(t=>t.innerText).join("\n")} `+i.stack)}async function i(s){var t=1{s.dataType&&(s.responseType=s.dataType);var t={timeout:3e4,ontimeout(t){e({result:"Error",statusText:"Timeout",status:601,data:t,options:s})},onabort(t){e({result:"Error",statusText:"Aborted",status:602,data:t,options:s})},onerror(t){e({result:"Error",statusText:"Error",status:603,data:t,options:s})},onload(t){e({result:"Success",statusText:"Load",status:600,data:t,options:s})},...s};GM_xmlhttpRequest(t)});return console.log("发送请求:",e),600!==e.status&&t<2?await i(s,t+1):e}catch(t){return _(t,"httpRequest"),console.log("发送请求:",{errorMsg:t,options:s}),{result:"JsError",statusText:"Error",status:604,error:t,options:s}}}const I=i;function C(){let e=0{setTimeout(()=>{t(!0)},e)})}const V=t=>{let{type:e,text:s,html:i,id:n}=t;const o={success:()=>o,error:()=>o,warning:()=>o,info:()=>o,view:()=>o};try{var a;let t;if(e)switch(e){case"joiningSteamGroup":case"leavingSteamGroup":case"gettingSteamGroupId":t=$(`
  • ${E(e)}${s}...
  • `);break;case"subscribingForum":case"unsubscribingForum":case"gettingForumId":t=$(`
  • ${E(e)}${s}...
  • `);break;case"followingCurator":case"unfollowingCurator":case"getCuratorId":t=$(`
  • ${E(e)}${s}...
  • `);break;case"addingToWishlist":case"removingFromWishlist":case"followingGame":case"unfollowingGame":t=$(`
  • ${E(e)}${s}...
  • `);break;case"favoritingWorkshop":case"unfavoritingWorkshop":case"gettingWorkshopAppId":case"votingUpWorkshop":t=$(`
  • ${E(e)} ${s}...
  • `);break;case"gettingAnnouncementParams":case"likingAnnouncement":t=$(`
  • ${E(e)} ${n}...
  • `);break;case"joiningDiscordServer":case"gettingDiscordGuild":t=$(`
  • ${E(e)}${s}...
  • `);break;case"leavingDiscordServer":t=$(`
  • ${E(e)}${s}...
  • `);break;case"updateDiscordAuth":t=$(`
  • ${E("updateDiscordAuth")}
  • `);break;case"followingTwitchChannel":case"unfollowingTwitchChannel":case"gettingTwitchChannelId":t=$(`
  • ${E(e)}${s}...
  • `);break;case"gettingInsUserId":case"followingIns":case"unfollowingIns":t=$(`
  • ${E(e)}${s}...
  • `);break;case"gettingTwitterUserId":case"followingTwitterUser":case"unfollowingTwitterUser":t=$(`
  • ${E(e)}${s}...
  • `);break;case"retweetting":case"unretweetting":t=$(`
  • ${E(e)}${s}...
  • `);break;case"joiningReddit":case"leavingReddit":t=$(`
  • ${E(e)}${s}...
  • `);break;case"followingRedditUser":case"unfollowingRedditUser":t=$(`
  • ${E(e)} - ${null===s||void 0===s?void 0:s.replace("u_","")}...
  • `);break;case"followingYtbChannel":case"unfollowingYtbChannel":t=$(`
  • ${E(e)}${s}...
  • `);break;case"likingYtbVideo":case"unlikingYtbVideo":t=$(`
  • ${E(e)}${s}...
  • `);break;case"gettingVkId":case"joiningVkGroup":case"leavingVkGroup":case"joiningVkPublic":case"leavingVkPublic":case"sendingVkWall":case"deletingVkWall":t=$(`
  • ${E(e)}${s}...
  • `);break;case"visitingLink":t=$(`
  • ${E("visitingLink")}${s}...
  • `);break;case"verifyingInsAuth":case"text":t=$(`
  • ${E(s)}
  • `);break;case"html":t=$(s||i);break;case"whiteList":t=$(`
  • ${E("skipTask")}[${s}(${n})](${E("whiteList")})
  • `);break;case"globalOptionsSkip":t=$(`
  • ${E("skipTaskOption")}${s}
  • `);break;default:t=$(`
  • ${E("unKnown")}:${e}(${s})...
  • `)}else if(s)t=$(`
  • ${E(s)}
  • `);else{if(!i)return o;t=$(i)}return t.addClass("card-text"),$("#auto-task-info").append(t),null!==(a=t[0])&&void 0!==a&&a.scrollIntoView(),{font:t.find("font"),success(){var t,e,s=0{try{return[...new Set(t)]}catch(t){return _(t,"unique"),[]}};const l={doTask:{discord:{servers:!0},instagram:{users:!0},twitch:{channels:!0},twitter:{users:!0,retweets:!0},vk:{names:!0},youtube:{channels:!0,likes:!0},reddit:{reddits:!0},steam:{groups:!0,wishlists:!0,follows:!0,forums:!0,workshops:!0,curators:!0,workshopVotes:!0,announcements:!0}},undoTask:{discord:{servers:!0},instagram:{users:!0},twitch:{channels:!0},twitter:{users:!0,retweets:!0},vk:{names:!0},youtube:{channels:!0,likes:!0},reddit:{reddits:!0},steam:{groups:!0,wishlists:!0,follows:!0,forums:!0,workshops:!0,curators:!0}},position:{buttonSideX:"right",buttonSideY:"top",buttonDistance:"15,30",showButtonSideX:"right",showButtonSideY:"top",showButtonDistance:"15,30",logSideX:"right",logSideY:"bottom",logDistance:"10,10"},hotKey:{doTaskKey:"alt + d",undoTaskKey:"alt + u",toggleLogKey:"alt + l"},other:{twitterVerifyId:"783214",youtubeVerifyChannel:"UCrXUsMBcfTVqwAS7DKg9C0Q",autoUpdateSource:"jsDelivr",language:"zh",checkLogin:!0,checkLeftKey:!0,defaultShowButton:!0,defaultShowLog:!0}};t=GM_getValue("globalOptions")||{};const u=(t,e)=>{try{const n={};for(var[s,i]of Object.entries(t))"[object Object]"===Object.prototype.toString.call(i)&&"[object Object]"===Object.prototype.toString.call(e[s])?n[s]=u(i,e[s]):n[s]=e[s]??i;return n}catch(t){return _(t,"assignObject"),l}},A=u(l,t);const c={zh:{website:"网站",type:"类型",edit:"编辑",whiteList:"白名单",skipTask:"跳过撤销任务",whiteListOptions:"白名单设置",changeWhiteListOption:"设置白名单(%0)",whiteListNotFound:"找不到此项白名单: %0",changeWhiteListSuccess:"白名单修改成功,刷新生效!",changeWebsiteOptions:"网站设置",changeGlobalOptions:"全局设置",ok:"是",save:"保存",close:"关闭",return:"返回",option:"选项",value:"值",websiteOptions:"当前网站设置",changeWebsiteOptionsSuccess:"更改当前网站设置成功,刷新生效!",changeGlobalOptionsSuccess:"更改全局设置成功,刷新生效!",needLogin:"请先登录!",getTasksInfo:"正在获取并处理任务信息...",gettingKey:"正在获取Key...",verifyingTask:"正在验证任务",notice:"自动任务脚本提醒",noKeysLeft:"此页面已经没有剩余key了,是否关闭?",giveawayEnded:"此活动已结束,是否关闭?",giveawayNotWork:"此活动因某些原因(已结束/暂停/未开始...)不可用(如果是脚本误判请及时反馈),是否关闭?",confirm:"确定",cancel:"取消",unKnown:"未知",unKnownTaskType:"未识别的任务",doing:"正在做任务",allTasksComplete:"所有任务已完成!",getTaskIdFailed:"获取任务Id失败!",initSuccess:"%0 初始化成功!",initFailed:"%0 初始化失败!",errorLink:"链接错误: %0",needInit:"请先初始化",verifyingAuth:"正在验证%0凭证...",updatingAuth:"正在更新%0凭证...",initing:"正在初始化...",getFailed:"获取%0失败!",checkLoginFailed:"检测登录状态失败!",checkLeftKeyFailed:"检测剩余Key失败!",userId:"用户Id",joiningGiveaway:"正在加入赠Key",needJoinGiveaway:"需要先加入赠Key",cannotUndo:"此网站不支持取消任务",verifyAuth:"正在验证 %0 凭证...",closePageNotice:"如果此页面没有自动关闭,请自行关闭本页面。",errorReport:"检测到脚本报错,是否前往反馈BUG?",visitingLink:"正在访问链接: ",doTask:"做任务",undoTask:"撤销任务",verifyTask:"验证任务",getKey:"获取Key",selectAll:"全选",selectNone:"全不选",invertSelect:"反选",doFreeTask:"加入免费赠品",doPointTask:"加入点数赠品",skipTaskOption:"设置中已配置跳过任务",other:"其他",globalOptions:"全局设置",checkLogin:"登录检测
    需要登录的网站自动登录,部分本网站支持",checkLeftKey:"剩余Key检测
    赠Key活动结束提示是否关闭,部分本网站支持",twitterVerifyId:"通过尝试关注该账号验证Twitter凭证
    默认为Twitter官方帐号 783214",youtubeVerifyChannel:"通过尝试订阅该频道验证YouTube凭证
    默认为YouTube官方频道 UCrXUsMBcfTVqwAS7DKg9C0Q",autoUpdateSource:"更新源
    github: 需代理,实时更新
    jsdelivr: 可不用代理,更新有延迟
    auto: 首先使用github源更新,失败后尝试用jsdelivr源更新",saveGlobalOptions:"保存全局设置",settingPage:"设置页面",name:"名称",version:"版本",scriptManager:"脚本管理器",script:"脚本",environment:"环境",os:"系统",browser:"浏览器",getId:"获取 %0 id",getTwitterUserId:"获取Twitter用户id(获取id功能仅在设置页面可用)",getYoutubeChannelId:"获取Youtube频道id(获取id功能仅在设置页面可用)",showButton:"显示按钮",hideButton:"隐藏按钮",showLog:"显示日志",hideLog:"隐藏日志",defaultShowButton:"默认显示按钮",defaultShowLog:"默认显示日志",position:"组件位置",buttonSideX:"按钮区域水平方向定位(实时预览功能仅在设置页面可用)
    left: 靠左 | right: 靠右",buttonSideY:"按钮区域垂直方向定位(实时预览功能仅在设置页面可用)
    top: 靠上 | bottom: 靠下",buttonDistance:"按钮区域距边缘的距离(实时预览功能仅在设置页面可用)
    格式: X距离,Y距离",showButtonSideX:"显示按钮水平方向定位(实时预览功能仅在设置页面可用)
    left: 靠左 | right: 靠右",showButtonSideY:"显示按钮垂直方向定位(实时预览功能仅在设置页面可用)
    top: 靠上 | bottom: 靠下",showButtonDistance:"显示按钮距边缘的距离(实时预览功能仅在设置页面可用)
    格式: X距离,Y距离",logSideX:"日志区域水平方向定位(实时预览功能仅在设置页面可用)
    left: 靠左 | right: 靠右",logSideY:"日志区域垂直方向定位(实时预览功能仅在设置页面可用)
    top: 靠上 | bottom: 靠下",logDistance:"日志区域距边缘的距离(实时预览功能仅在设置页面可用)
    格式: X距离,Y距离",hotKey:"快捷键",doTaskKey:"做任务快捷键
    (实时预览功能仅在设置页面可用)",undoTaskKey:"撤销任务快捷键
    (实时预览功能仅在设置页面可用)",toggleLogKey:"显示/隐藏日志快捷键
    (实时预览功能仅在设置页面可用)",tasksHistory:"任务历史",clearHistory:"清空历史",clearHistoryFinished:"已清空任务历史!",deleteTask:"删除任务",lastChangeTime:"最后一次修改时间",clearTaskFinished:"删除以下任务完成!",clearTaskFailed:"删除任务失败,没有找到任务名!",syncData:"数据同步",settingData:"正在上传数据...",gettingData:"正在获取数据...",help:"帮助",fileName:"文件名",upload2gist:"同步到Gist",downloadFromGist:"从Gist同步",saveAndTest:"保存配置并测试",testSuccess:"测试成功!",testFailed:"测试失败!",saveAndTestNotice:"请先保存配置并测试!",processingData:"正在处理数据...",updatingData:"正在上传数据...",syncDataSuccess:"同步数据成功!",syncDataFailed:"同步数据失败,请在控制台查看错误信息!",downloadingData:"正在下载数据...",checkedNoData:"没有检测到远程数据,请确认配置是否正确!",savingData:"正在保存数据...",syncHistory:"同步任务历史",checkUpdateFailed:"检测更新失败",newVersionNotice:'检测到新版本V%0, 点此更新',language:"语言
    目前仅支持zh: 中文, en: 英文",gistOptions:"Gist 设置",swalNotice:"检测到您第一次安装V4版本脚本,请前往阅读用前必读内容!",echoNotice:'检测到您第一次安装V4版本脚本,请点此前往阅读用前必读内容!',noticeLink:"https://auto-task-doc.js.org/guide/#用前必读",toGithub:"前往Github反馈",toKeylol:"前往其乐论坛反馈",copySuccess:"错误信息已复制到剪切板,是否前往其乐论坛反馈?",copyFailed:"请复制下方错误信息后前往Keylol论坛反馈!",groups:"组",wishlists:"愿望单",follows:"游戏关注",forums:"论坛",workshops:"创意工坊收藏",curators:"鉴赏家",workshopVotes:"创意工坊点赞",announcements:"社区通知",steamCommunity:"Steam社区",steamStore:"Steam商店",needLoginSteamStore:'请先登录Steam商店',needLoginSteamCommunity:'请先登录Steam社区',joiningSteamGroup:"正在加入Steam组",leavingSteamGroup:"正在退出Steam组",gettingSteamGroupId:"正在获取Steam组Id",subscribingForum:"正在订阅Steam论坛",unsubscribingForum:"正在取消订阅Steam论坛",gettingForumId:"正在获取Steam论坛Id",followingCurator:"正在关注Steam鉴赏家",unfollowingCurator:"正在取关Steam鉴赏家",addingToWishlist:"正在添加游戏到Steam愿望单",removingFromWishlist:"正在从Steam愿望单移除游戏",followingGame:"正在关注Steam游戏",unfollowingGame:"正在取关Steam游戏",favoritingWorkshop:"正在收藏Steam创意工坊物品",unfavoritingWorkshop:"正在取消收藏Steam创意工坊物品",gettingWorkshopAppId:"正在获取Steam创意工坊物品Id",votingUpWorkshop:"正在点赞Steam创意工坊物品",gettingAnnouncementParams:"正在获取Steam通知信息",likingAnnouncement:"正在点赞Steam通知",changingArea:"正在更换Steam地区: %0...",notNeededChangeArea:"当前地区不需要更换",noAnotherArea:"请检测是否开启正确开启代理",gettingAreaInfo:"正在获取Steam地区信息...",changeAreaNotice:"疑似锁区游戏,尝试换区执行",steamFinishNotice:"Steam任务完成,尝试将购物车地区换回CN",servers:"服务器",joiningDiscordServer:"正在加入Discord服务器",leavingDiscordServer:"正在退出Discord服务器",gettingDiscordGuild:"正在获取Discord服务器Id",users:"用户",loginIns:'请先登录Instagram',insBanned:"您的Instagram账户已被封禁",verifyingInsAuth:"正在验证Instagram凭证...",gettingInsUserId:"正在获取Instagram用户Id",followingIns:"正在关注Instagram用户",unfollowingIns:"正在取关Instagram用户",reddits:"社区/用户",loginReddit:'请先登录Reddit',changingRedditVersion:"正在切换Reddit为新版页面...",joiningReddit:"正在加入Reddit社区",leavingReddit:"正在退出Reddit社区",followingRedditUser:"正在关注Reddit用户",unfollowingRedditUser:"正在取关Reddit用户",channels:"频道",followingTwitchChannel:"正在关注Twitch频道",unfollowingTwitchChannel:"正在取关Twitch频道",gettingTwitchChannelId:"正在获取Twitch频道Id",twitterUser:"推特用户",retweets:"转推",followingTwitterUser:"正在关注推特用户",unfollowingTwitterUser:"正在取关推特用户",retweetting:"正在转推",unretweetting:"正在撤销转推",names:"组/社区/动态",loginVk:'请先登录Vk',gettingVkId:"正在获取Vk任务Id",joiningVkGroup:"正在加入Vk组",leavingVkGroup:"正在退出Vk组",joiningVkPublic:"正在加入Vk社区",leavingVkPublic:"正在退出Vk社区",sendingVkWall:"正在转发Vk动态",deletingVkWall:"正在撤销转发Vk动态",youtubeChannel:"YouTube频道",likes:"点赞",loginYtb:'请先登录YouTube',tryUpdateYtbAuth:'请尝试更新YouTube凭证',gettingYtbToken:"正在获取YouTube Token...",followingYtbChannel:"正在订阅YouTube频道",unfollowingYtbChannel:"正在退订YouTube频道",likingYtbVideo:"正在点赞YouTube视频",unlikingYtbVideo:"正在取消点赞YouTube视频",giveKeyNoticeBefore:"每次验证间隔15s",giveKeyNoticeAfter:'如果没有key, 请在https://givekey.ru/profile查看',noPoints:"点数不够,跳过抽奖",getNeedPointsFailed:"获取所需点数失败,跳过抽奖",joiningLottery:"正在加入抽奖",doingGleamTask:"正在做Gleam任务...",gettingGleamLink:"正在获取Gleam任务链接...",gleamTaskNotice:"如果此页面长时间未关闭,请完成任一任务后自行关闭!",verifiedGleamTasks:"已尝试验证所有任务,验证失败的任务请尝试手动验证或完成!",SweepWidgetNotice:"正在处理并验证任务,每次验证任务有1~3s间隔防止触发验证过快警告..."},en:{website:"Website",type:"Type",edit:"Edit",whiteList:"Whitelist",skipTask:"Skip undo task",whiteListOptions:"Whitelist options",changeWhiteListOption:"Whitelist option(%0)",whiteListNotFound:"Cannot find this whitelist: %0",changeWhiteListSuccess:"The whitelist is successfully modified, and the page refresh will take effect!",changeWebsiteOptions:"Website options",changeGlobalOptions:"Global options",ok:"OK",save:"Save",close:"Close",return:"Return",option:"Option",value:"Value",websiteOptions:"Current website settings",changeWebsiteOptionsSuccess:"The current website setting is changed successfully, and the page refresh will take effect!",changeGlobalOptionsSuccess:"The global setting is changed successfully, and the refresh will take effect!",needLogin:"Please log in first!",getTasksInfo:"Obtaining and processing task information...",gettingKey:"Getting Key...",verifyingTask:"Verifying task",notice:"Automatic task script notice",noKeysLeft:"There are no more keys left on this page. Do you want to close it?",giveawayEnded:"This event has ended, do you want to close it?",giveawayNotWork:"This activity is unavailable for some reasons (ended/suspended/not started...) (if it is a script misjudgment, please give us feedback in time), is it closed?",confirm:"Confirm",cancel:"Cancel",unKnown:"Unknown",unKnownTaskType:"Unrecognized task",doing:"Doing a task",allTasksComplete:"All tasks have been completed!",getTaskIdFailed:"Failed to obtain task Id!",initSuccess:"%0 was initialized successfully!",initFailed:"%0 initialization failed!",errorLink:"Link error: %0",needInit:"Please initialize first",verifyingAuth:"Verifying %0 token...",updatingAuth:"Update %0 token...",initing:"Initializing...",getFailed:"Failed to get %0!",checkLoginFailed:"Failed to detect login status!",checkLeftKeyFailed:"Failed to detect the remaining keys!",userId:"User Id",joiningGiveaway:"Joining giveaway",needJoinGiveaway:"Need to join the giveaway first",cannotUndo:"This website does not support canceling tasks",verifyAuth:"Verifying %0 token...",closePageNotice:"f this page does not close automatically, please close this page yourself.",errorReport:"A script error is detected, do you want to report the BUG?",visitingLink:"Visiting link: ",doTask:"DoTask",undoTask:"UndoTask",verifyTask:"Verify",getKey:"GetKey",selectAll:"SelectAll",selectNone:"SelectNone",invertSelect:"InvertSelect",doFreeTask:"FreeTask",doPointTask:"PointTask",skipTaskOption:"Skip task has been configured in the settings",other:"Other",globalOptions:"Global Options",checkLogin:"Login detection
    Need to log in to the website automatically log in, part of this website supports.",checkLeftKey:"Key remaining detection
    The end of the giveaway event prompts whether to close or not, part of this website supports.",twitterVerifyId:"Verify Twitter token by trying to follow the account.
    The default is the official Twitter account 783214.",youtubeVerifyChannel:"Verify YouTube token by trying to subscribe to the channel.
    The default is the official YouTube channel UCrXUsMBcfTVqwAS7DKg9C0Q.",autoUpdateSource:"The source to update
    github: Fast update.
    jsdelivr: Update is delayed
    auto: First use github source to update, after failure, try to update with jsdelivr source.",saveGlobalOptions:"Save global settings",settingPage:"Setting Page",name:"Name",version:"Version",scriptManager:"Script Manager",script:"Script",environment:"Environment",os:"OS",browser:"Browser",getId:"Get %0 id",getTwitterUserId:"Get Twitter user id (Get id function is only available on the settings page).",getYoutubeChannelId:"Get Youtube channel id (Get id function is only available on the settings page).",showButton:"ShowButton",hideButton:"HideButton",showLog:"ShowLog",hideLog:"HideLog",defaultShowButton:"Default display button",defaultShowLog:"Display log by default",position:"Component position",buttonSideX:"Horizontal positioning of the button area (real-time preview function is only available on the setting page).
    left: left | right: right",buttonSideY:"The button area is positioned in the vertical direction (real-time preview function is only available on the settings page).
    top: top | bottom: bottom",buttonDistance:"The distance between the button area and the edge (the real-time preview function is only available on the setting page).
    Format: X distance, Y distance",showButtonSideX:"ShowButton horizontal positioning (real-time preview function is only available on the setting page).
    left: left | right: right",showButtonSideY:"ShowButton vertical positioning (real-time preview function is only available on the setting page).
    top: top | bottom: bottom",showButtonDistance:"The distance between the ShowButton and the edge (real-time preview function is only available on the setting page).
    Format: X distance, Y distance",logSideX:"Horizontal positioning of the log area (real-time preview function is only available on the setting page).
    left: left | right: right",logSideY:"Vertical positioning of the log area (real-time preview function is only available on the setting page).
    top: top | bottom: bottom",logDistance:"The distance between the log area and the edge (the real-time preview function is only available on the setting page).
    Format: X distance, Y distance",hotKey:"Shortcut key",doTaskKey:"DoTask shortcut keys
    (real-time preview function is only available on the settings page).",undoTaskKey:"UndoTask shortcut keys
    (real-time preview function is only available on the settings page).",toggleLogKey:"ShowLog/HideLog shortcut keys
    (real-time preview function is only available on the settings page).",tasksHistory:"Tasks history",clearHistory:"Clear history",clearHistoryFinished:"The mission history has been cleared!",deleteTask:"Delete task",lastChangeTime:"Last Change Time",clearTaskFinished:"Delete the following tasks completed!",clearTaskFailed:"Failed to delete the task, the task name was not found!",syncData:"Data synchronization",settingData:"Uploading data...",gettingData:"Getting data...",help:"Help",fileName:"Filename",upload2gist:"Sync to Gist",downloadFromGist:"Sync from Gist",saveAndTest:"Save configuration and test",testSuccess:"Test success!",testFailed:"Test failed!",saveAndTestNotice:"Please save the configuration and test first!",processingData:"Processing data...",updatingData:"Uploading data...",syncDataSuccess:"Synchronized data successfully!",syncDataFailed:"Failed to synchronize data, please check the error message on the console!",downloadingData:"Downloading data...",checkedNoData:"No remote data is detected, please confirm whether the configuration is correct!",savingData:"Saving data...",syncHistory:"Synchronize tasks history",checkUpdateFailed:"Check update failed",newVersionNotice:'Checked a new version V%0, click to update',language:"Language
    Currently only supports zh: Chinese, en: English",gistOptions:"Gist Settings",swalNotice:"It is detected that you are installing the V4 version script for the first time, please go to read the READ ME FIRST content before use!",echoNotice:'It is detected that you are installing the V4 version script for the first time, please click here to read the READ ME FIRST content before use!',noticeLink:"https://auto-task-doc.js.org/en/guide/#read-me-first",toGithub:"Feedback(Github)",toKeylol:"Feedback(Keylol)",copySuccess:"The error message has been copied to the clipboard. Do you want to go to the Keylol forum to give feedback?",copyFailed:"Please copy the error information below and report back to the Keylol forum!",groups:"Group",wishlists:"Wishlist",follows:"Follow Game",forums:"Forum",workshops:"Favorite Workshop",curators:"Curator",workshopVotes:"Voteup Workshop",announcements:"Announcement",steamCommunity:"Steam Community",steamStore:"Steam Store",needLoginSteamStore:'Please log in to the Steam Store',needLoginSteamCommunity:'Please log in to the Steam Community',joiningSteamGroup:"Joining Steam Group",leavingSteamGroup:"Leaving Steam Group",gettingSteamGroupId:"Getting Steam Group Id",subscribingForum:"Subscribing the Steam Forum",unsubscribingForum:"Unsubscribing the Steam Forum",gettingForumId:"Getting Steam Forum Id",followingCurator:"Following Steam Curator",unfollowingCurator:"Unfollowing Steam Curator",addingToWishlist:"Adding the game to the Steam wishlist",removingFromWishlist:"Removing the game from the Steam wishlist",followingGame:"Following Steam games",unfollowingGame:"Unfollowing Steam games",favoritingWorkshop:"Favouring Steam Workshop Items",unfavoritingWorkshop:"Unfavoriting Steam Workshop Items",gettingWorkshopAppId:"Getting Steam Workshop Item Id",votingUpWorkshop:"Liking Steam workshop items",gettingAnnouncementParams:"Getting Steam announcement information",likingAnnouncement:"Liking Steam announcement",changingArea:"Changing Steam area: %0...",notNeededChangeArea:"The current area does not need to be changed",noAnotherArea:"Please check whether the proxy is turned on correctly",gettingAreaInfo:"Getting Steam area information...",changeAreaNotice:"Suspected of a locked zone game, try to change the zone to execute",steamFinishNotice:"Steam task completed, try to change the shopping cart area back to CN",servers:"Server",joiningDiscordServer:"Joining Discord Server",leavingDiscordServer:"Leaving Discord Server",gettingDiscordGuild:"Getting Discord server Id",users:"User",loginIns:'Please log in to Instagram',insBanned:"Your Instagram account has been banned",verifyingInsAuth:"Verifying Instagram token...",gettingInsUserId:"Getting Instagram user Id",followingIns:"Following Instagram user",unfollowingIns:"Unfollowing Instagram user",reddits:"Reddit/User",loginReddit:'Please log in to Reddit',changingRedditVersion:"Switching Reddit to a new version page...",joiningReddit:"Joining the Reddit",leavingReddit:"Leaving the Reddit",followingRedditUser:"Following Reddit User",unfollowingRedditUser:"Unfollowing Reddit User",channels:"Channel",followingTwitchChannel:"Following Twitch Channel",unfollowingTwitchChannel:"Unfollowing Twitch Channel",gettingTwitchChannelId:"Getting Twitch Channel Id",twitterUser:"Twitter User",retweets:"Retweet",followingTwitterUser:"Following Twitter User",unfollowingTwitterUser:"Unfollowing Twitter User",retweetting:"Retweeting",unretweetting:"Unretweeting",names:"Group/Public/Wall",loginVk:'Please log in to Vk',gettingVkId:"Getting Vk task Id",joiningVkGroup:"Joining Vk Group",leavingVkGroup:"Leaving Vk Group",joiningVkPublic:"Joining Vk Public",leavingVkPublic:"Leaving Vk Public",sendingVkWall:"Sending Vk Wall",deletingVkWall:"Deleting Vk Wall",youtubeChannel:"YouTube Channel",likes:"Like",loginYtb:'Please log in to YouTube',tryUpdateYtbAuth:'Please try to update YouTube token',gettingYtbToken:"Getting YouTube Token...",followingYtbChannel:"Subscribing to YouTube channel",unfollowingYtbChannel:"Unsubscribing to YouTube channel",likingYtbVideo:"Liking YouTube video",unlikingYtbVideo:"Unliking YouTube video",giveKeyNoticeBefore:"Each verification interval is 15s",giveKeyNoticeAfter:'If there is no key, please check at https://givekey.ru/profile',noPoints:"Not enough points, skip the lottery",getNeedPointsFailed:"ailed to obtain the required points, skip the lottery",joiningLottery:"Joining the lottery",doingGleamTask:"Doing Gleam Task...",gettingGleamLink:"Getting Gleam task link...",gleamTaskNotice:"If this page has not been closed for a long time, please close it yourself after completing any task!",verifiedGleamTasks:"Attempted to verify all tasks. If the verification fails, please try to verify manually or complete it!",SweepWidgetNotice:"The task is being processed and verified. There is an interval of 1~3s for each verification task to prevent the triggering of too fast verification warning..."}},d=["zh","en"].includes(A.other.language)?A.other.language:"en";const E=function(t){for(var e,s=arguments.length,i=new Array(1i[parseInt(e,10)]):t};t=class{constructor(){var t,e,s;s=void 0,(e="tasks")in(t=this)?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s}getRealParams(e,s,i,n){try{let t=[];return 0n(t)).filter(t=>t)]),!i&&0{const t=GM_openInTab("https://discord.com/channels/@me#auth",{active:!0,insert:!0,setParent:!0});t.onclose=async()=>{var t=null===(t=GM_getValue("discordAuth"))||void 0===t?void 0:t.auth;t?(g(this,v,{auth:t}),s.success(),e(await p(this,b,W).call(this))):(s.error("Error: Update discord auth failed!"),e(!1))}})}catch(t){return _(t,"Discord.updateAuth"),!1}}async function O(t){try{const l=V({type:"joiningDiscordServer",text:t});var e,s,{result:i,statusText:n,status:o,data:a}=await I({url:"https://discord.com/api/v6/invites/"+t,method:"POST",dataType:"json",headers:{authorization:w(this,v).auth}});if("Success"!==i||200!==(null==a?void 0:a.status))return l.error(i+`:${n}(${o})`),!1;l.success();var r=String(null===(e=a.response)||void 0===e||null===(s=e.guild)||void 0===s?void 0:s.id);return r&&(p(this,P,j).call(this,t,r),this.tasks.servers=L([...this.tasks.servers,t])),!0}catch(t){return _(t,"Discord.joinServer"),!1}}async function D(t){try{if(this.whiteList.servers.includes(t))return V({type:"whiteList",text:"Discord.leaveServer",id:t}),!0;var e=await p(this,G,F).call(this,t);if(!e)return!1;const a=V({type:"leavingDiscordServer",text:e});var{result:s,statusText:i,status:n,data:o}=await I({url:"https://discord.com/api/v6/users/@me/guilds/"+e,method:"DELETE",headers:{authorization:w(this,v).auth}});return"Success"===s&&204===(null==o?void 0:o.status)?(a.success(),!0):(a.error(s+`:${i}(${n})`),!1)}catch(t){return _(t,"Discord.leaveServer"),!1}}async function F(t){try{const n=V({type:"gettingDiscordGuild",text:t});var e=w(this,k)[t];if(e)return n.success(),e;const{result:o,statusText:a,status:r,data:l}=await I({url:"https://discord.com/invite/"+t,method:"GET"});if("Success"!==o||200!==(null===l||void 0===l?void 0:l.status))return n.error(o+`:${a}(${r})`),!1;var s,i=null===(s=l.responseText.match(/https?:\/\/cdn\.discordapp\.com\/icons\/([\d]+?)\//))||void 0===s?void 0:s[1];return i?(n.success(),p(this,P,j).call(this,t,i),i):(n.error(o+`:${a}(${r})`),!1)}catch(t){return _(t,"Discord.getGuild"),!1}}function j(t,e){try{w(this,k)[t]=e,GM_setValue("discordCache",w(this,k))}catch(t){_(t,"Discord.setCache")}}const N=class extends t{constructor(){var t;super(...arguments),e(this,P),e(this,G),e(this,x),e(this,S),e(this,T),e(this,b),h(this,"tasks",{...m}),h(this,"whiteList",(null===(t=GM_getValue("whiteList"))||void 0===t?void 0:t.discord)||{...m}),s(this,v,{writable:!0,value:GM_getValue("discordAuth")||{}}),s(this,k,{writable:!0,value:GM_getValue("discordCache")||{}}),s(this,y,{writable:!0,value:!1})}async init(){try{return w(this,y)?!0:w(this,v).auth?await p(this,b,W).call(this)?(V({html:`
  • ${E("initSuccess","Discord")}
  • `}),g(this,y,!0),!0):(GM_setValue("discordAuth",{auth:null}),await p(this,T,U).call(this)?(V({html:`
  • ${E("initSuccess","Discord")}
  • `}),g(this,y,!0),!0):(V({html:`
  • ${E("initFailed","Discord")}
  • `}),!1)):!!await p(this,T,U).call(this)&&(g(this,y,!0),!0)}catch(t){return _(t,"Discord.init"),!1}}async toggle(t){var{doTask:e=!0,serverLinks:t=[]}=t;try{if(!w(this,y))return V({text:E("needInit")}),!1;const i=[];if(e&&!A.doTask.discord.servers||!e&&!A.undoTask.discord.servers)V({type:"globalOptionsSkip",text:"discord.servers"});else{var s=this.getRealParams("servers",t,e,t=>{return null===(t=t.match(/invite\/(.+)/))||void 0===t?void 0:t[1]});if(0!0)}catch(t){return _(t,"Discord.toggleServers"),!1}}};function M(t,e){Y(t,e),e.add(t)}function R(t,e,s){Y(t,e),e.set(t,s)}function Y(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function K(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function z(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,H(t,e,"set"),s),s}function B(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function q(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,H(t,e,"get"))}function H(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const J={users:[]};var X=new WeakMap,Q=new WeakMap,Z=new WeakMap,tt=new WeakSet,et=new WeakSet,st=new WeakSet,it=new WeakSet;async function nt(){var t=0${E("initSuccess","Instagram")}`}),z(this,Z,!0),!0):(V({html:`
  • ${E("initFailed","Instagram")}
  • `}),!1)}catch(t){return _(t,"Instagram.init"),!1}}async toggle(t){var{doTask:e=!0,userLinks:t=[]}=t;try{if(!q(this,Z))return V({text:E("needInit")}),!1;const i=[];if(e&&!A.doTask.instagram.users||!e&&!A.undoTask.instagram.users)V({type:"globalOptionsSkip",text:"instagram.users"});else{var s=this.getRealParams("users",t,e,t=>{return null===(t=t.match(/https:\/\/www\.instagram\.com\/(.+)?\//))||void 0===t?void 0:t[1]});if(0!0)}catch(t){return _(t,"Instagram.toggleUsers"),!1}}};function ut(t,e){dt(t,e),e.add(t)}function ct(t,e,s){dt(t,e),e.set(t,s)}function dt(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ht(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function gt(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,ft(t,e,"set"),s),s}function pt(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function wt(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,ft(t,e,"get"))}function ft(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const mt={reddits:[]};var vt=new WeakMap,kt=new WeakMap,yt=new WeakSet,bt=new WeakSet;async function Tt(){try{const s=V({text:E("changingRedditVersion")});return GM_setValue("redditAuth",null),await new Promise(t=>{const e=GM_openInTab("https://www.reddit.com/#auth",{active:!0,insert:!0,setParent:!0});e.onclose=async()=>{s.success(),t(await pt(this,bt,St).call(this,!0))}})}catch(t){return _(t,"Reddit.useBeta"),!1}}async function St(){var t,e=0${E("initSuccess","Reddit")}`}),gt(this,kt,!0),!0):(V({html:`
  • ${E("initFailed","Reddit")}
  • `}),!1)}catch(t){return _(t,"Reddit.init"),!1}}async toggleTask(e){var{name:s,doTask:e=!0}=e;try{if(!e&&this.whiteList.reddits.includes(s))return V({type:"whiteList",text:"Reddit.undoTask",id:s}),!0;let t=e?"joiningReddit":"leavingReddit";/^u_/.test(s)&&(t=e?"followingRedditUser":"unfollowingRedditUser");const r=V({type:t,text:s});var{result:i,statusText:n,status:o,data:a}=await I({url:"https://oauth.reddit.com/api/subscribe?redditWebClient=desktop2x&app=desktop2x-client-production&raw_json=1&gilding_detail=1",method:"POST",headers:{authorization:"Bearer "+wt(this,vt).token,"content-type":"application/x-www-form-urlencoded"},data:$.param({action:e?"sub":"unsub",sr_name:s,api_type:"json"})});return"Success"===i?200===(null==a?void 0:a.status)?(r.success(),e&&(this.tasks.reddits=L([...this.tasks.reddits,s])),!0):(r.error(`Error:${null==a?void 0:a.statusText}(${null==a?void 0:a.status})`),!1):(r.error(i+`:${n}(${o})`),!1)}catch(t){return _(t,"Reddit.toggleTask"),!1}}async toggle(t){var{doTask:e=!0,redditLinks:t=[]}=t;try{if(!wt(this,kt))return V({text:E("needInit")}),!1;const i=[];if(e&&!A.doTask.reddit.reddits||!e&&!A.undoTask.reddit.reddits)V({type:"globalOptionsSkip",text:"reddit.reddits"});else{var s=this.getRealParams("reddits",t,e,t=>{var e=null===(e=t.match(/https?:\/\/www\.reddit\.com\/r\/([^/]*)/))||void 0===e?void 0:e[1],t=null===(t=t.match(/https?:\/\/www\.reddit\.com\/user\/([^/]*)/))||void 0===t?void 0:t[1];return t?e||t:e});if(0!0)}catch(t){return _(t,"Reddit.toggle"),!1}}};function xt(t,e){Lt(t,e),e.add(t)}function It(t,e,s){Lt(t,e),e.set(t,s)}function Lt(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Gt(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function _t(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,At(t,e,"set"),s),s}function Ct(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function Vt(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,At(t,e,"get"))}function At(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const Et={channels:[]};var Pt=new WeakMap,Wt=new WeakMap,Ut=new WeakMap,Ot=new WeakSet,Dt=new WeakSet,Ft=new WeakSet,jt=new WeakSet,Nt=new WeakSet;async function Mt(){try{const r=V({text:E("verifyingAuth","Twitch")});var t,e,s,{result:i,statusText:n,status:o,data:a}=await I({url:"https://gql.twitch.tv/gql",method:"POST",dataType:"json",headers:{Authorization:"OAuth "+Vt(this,Pt).authToken,"Client-Id":Vt(this,Pt).clientId},data:'[{"operationName":"FrontPageNew_User","variables":{"limit":1},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"64bd07a2cbaca80699d62636d966cf6395a5d14a1f0a14282067dcb28b13eb11"}}}]'});return"Success"===i?200===(null==a?void 0:a.status)&&null!==(t=a.response)&&void 0!==t&&null!==(e=t[0])&&void 0!==e&&null!==(s=e.data)&&void 0!==s&&s.currentUser?(r.success(),!0):(r.error(`Error:${null==a?void 0:a.statusText}(${null==a?void 0:a.status})`),!1):(r.error(i+`:${n}(${o})`),!1)}catch(t){return _(t,"Twitch.verifyAuth"),!1}}async function Rt(){try{const s=V({text:E("updatingAuth","Twitch")});return await new Promise(e=>{const t=GM_openInTab("https://www.twitch.tv/#auth",{active:!0,insert:!0,setParent:!0});t.onclose=async()=>{var t=GM_getValue("twitchAuth");t?(_t(this,Pt,t),s.success(),e(await Ct(this,Ot,Mt).call(this))):(s.error("Error: Update twitch auth failed!"),e(!1))}})}catch(t){return _(t,"Twitch.updateAuth"),!1}}async function Yt(t){var{name:e,doTask:t=!0}=t;try{if(!t&&this.whiteList.channels.includes(e))return V({type:"whiteList",text:"Twitch.unfollowChannel",id:e}),!0;var s=await Ct(this,jt,Kt).call(this,e);if(!s)return!1;const u=V({type:`${t?"":"un"}followingTwitchChannel`,text:e});var i='[{"operationName":"FollowButton_FollowUser","variables":{"input":{"disableNotifications":false,"targetID":"'+s+'"}},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"3efee1acda90efdff9fef6e6b4a29213be3ee490781c5b54469717b6131ffdfe"}}}]',n=`[{"operationName":"FollowButton_UnfollowUser","variables":{"input":{"targetID":"${s}"}},`+'"extensions":{"persistedQuery":{"version":1,"sha256Hash":"d7fbdb4e9780dcdc0cc1618ec783309471cd05a59584fc3c56ea1c52bb632d41"}}}]',{result:o,statusText:a,status:r,data:l}=await I({url:"https://gql.twitch.tv/gql",method:"POST",dataType:"json",headers:{Authorization:"OAuth "+Vt(this,Pt).authToken},data:t?i:n});return"Success"===o?200===(null==l?void 0:l.status)?(u.success(),t&&(this.tasks.channels=L([...this.tasks.channels,e])),!0):(u.error(`Error:${null==l?void 0:l.statusText}(${null==l?void 0:l.status})`),!1):(u.error(o+`:${a}(${r})`),!1)}catch(t){return _(t,"Twitch.toggleChannel"),!1}}async function Kt(t){try{const d=V({type:"gettingTwitchChannelId",text:t});var e=Vt(this,Wt)[t];if(e)return d.success(),e;var{result:s,statusText:i,status:n,data:o}=await I({url:"https://gql.twitch.tv/gql",method:"POST",headers:{Authorization:"OAuth "+Vt(this,Pt).authToken,"Client-Id":Vt(this,Pt).clientId},responseType:"json",data:`[{"operationName":"ActiveWatchParty","variables":{"channelLogin":"${t}"},`+'"extensions":{"persistedQuery":{"version":1,"sha256Hash":"4a8156c97b19e3a36e081cf6d6ddb5dbf9f9b02ae60e4d2ff26ed70aebc80a30"}}}]'});if("Success"!==s)return d.error(s+`:${i}(${n})`),!1;if(200!==(null==o?void 0:o.status))return d.error(`Error:${null==o?void 0:o.statusText}(${null==o?void 0:o.status})`),!1;var a,r,l,u,c=String(null===(a=o.response)||void 0===a||null===(r=a[0])||void 0===r||null===(l=r.data)||void 0===l||null===(u=l.user)||void 0===u?void 0:u.id);return c?(Ct(this,Nt,zt).call(this,t,c),d.success(),c):(d.error(`Error:${o.statusText}(${o.status})`),!1)}catch(t){return _(t,"Twitch.getChannelId"),!1}}function zt(t,e){try{Vt(this,Wt)[t]=e,GM_setValue("twitchCache",Vt(this,Wt))}catch(t){_(t,"Twitch.setCache")}}const Bt=class extends t{constructor(){var t;super(...arguments),xt(this,Nt),xt(this,jt),xt(this,Ft),xt(this,Dt),xt(this,Ot),Gt(this,"tasks",{...Et}),Gt(this,"whiteList",(null===(t=GM_getValue("whiteList"))||void 0===t?void 0:t.twitch)||{...Et}),It(this,Pt,{writable:!0,value:GM_getValue("twitchAuth")||{}}),It(this,Wt,{writable:!0,value:GM_getValue("twitchCache")||{}}),It(this,Ut,{writable:!0,value:!1})}async init(){try{return Vt(this,Ut)?!0:Vt(this,Pt).authToken?await Ct(this,Ot,Mt).call(this)?(V({html:`
  • ${E("initSuccess","Twitch")}
  • `}),_t(this,Ut,!0),!0):(GM_setValue("twitchAuth",null),await Ct(this,Dt,Rt).call(this)?(V({html:`
  • ${E("initSuccess","Twitch")}
  • `}),_t(this,Ut,!0),!0):(V({html:`
  • ${E("initFailed","Twitch")}
  • `}),!1)):!!await Ct(this,Dt,Rt).call(this)&&(_t(this,Ut,!0),!0)}catch(t){return _(t,"Twitch.init"),!1}}async toggle(t){var{doTask:e=!0,channelLinks:t=[]}=t;try{if(!Vt(this,Ut))return V({text:E("needInit")}),!1;const i=[];if(e&&!A.doTask.twitch.channels||!e&&!A.undoTask.twitch.channels)V({type:"globalOptionsSkip",text:"twitch.channels"});else{var s=this.getRealParams("channels",t,e,t=>{return null===(t=t.match(/https:\/\/(www\.)?twitch\.tv\/(.+)/))||void 0===t?void 0:t[2]});if(0!0)}catch(t){return _(t,"Twitch.toggle"),!1}}};function qt(t,e){Jt(t,e),e.add(t)}function Ht(t,e,s){Jt(t,e),e.set(t,s)}function Jt(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Xt(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Qt(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,ee(t,e,"set"),s),s}function Zt(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function te(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,ee(t,e,"get"))}function ee(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const se={names:[]};var ie=new WeakMap,ne=new WeakMap,oe=new WeakMap,ae=new WeakSet,re=new WeakSet,le=new WeakSet,ue=new WeakSet,ce=new WeakSet,de=new WeakSet,he=new WeakSet,ge=new WeakSet;async function pe(){try{const e=V({text:E("verifyAuth","Vk")}),{result:s,statusText:i,status:n,data:o}=await I({url:"https://vk.com/im",method:"GET"});var t;return"Success"===s?null!==o&&void 0!==o&&o.finalUrl.includes("vk.com/login")?(e.error("Error:"+E("loginVk"),!0),!1):200===(null===o||void 0===o?void 0:o.status)?(Qt(this,ie,(null===(t=o.responseText.match(/TopNavBtn__profileLink" href="\/(.*?)"/))||void 0===t?void 0:t[1])||""),e.success(),!0):(e.error(`Error:${null===o||void 0===o?void 0:o.statusText}(${null===o||void 0===o?void 0:o.status})`),!1):(e.error(s+`:${i}(${n})`),!1)}catch(t){return _(t,"Vk.verifyAuth"),!1}}async function we(t,e){var s=!(2${E("initSuccess","Vk")}`}),Qt(this,oe,!0),!0):(V({html:`
  • ${E("initFailed","Vk")}
  • `}),!1)}catch(t){return _(t,"Vk.init"),!1}}async toggle(t){var{doTask:e=!0,nameLinks:t=[]}=t;try{if(!te(this,oe))return V({text:E("needInit")}),!1;const i=[];if(e&&!A.doTask.vk.names||!e&&!A.undoTask.vk.names)V({type:"globalOptionsSkip",text:"vk.names"});else{var s=this.getRealParams("names",t,e,t=>{return null===(t=t.match(/https:\/\/vk\.com\/([^/]+)/))||void 0===t?void 0:t[1]});if(0!0)}catch(t){return _(t,"Vk.toggle"),!1}}};function Se(t,e){xe(t,e),e.add(t)}function $e(t,e,s){xe(t,e),e.set(t,s)}function xe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Ie(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Le(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,Ce(t,e,"set"),s),s}function Ge(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function _e(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,Ce(t,e,"get"))}function Ce(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const Ve={channels:[],likes:[]},Ae=async function(t,e){try{const h=V({text:E("gettingYtbToken")}),{result:g,statusText:p,status:w,data:f}=await I({url:t,method:"GET"});if("Success"!==g)return h.error(g+`:${p}(${w})`),{};if(200!==(null===f||void 0===f?void 0:f.status))return h.error(`Error:${null===f||void 0===f?void 0:f.statusText}(${null===f||void 0===f?void 0:f.status})`),{};{var s,i;if(f.responseText.includes("accounts.google.com/ServiceLogin?service=youtube"))return h.error("Error:"+E("loginYtb"),!0),{needLogin:!0};var n=null===(s=f.responseText.match(/"INNERTUBE_API_KEY":"(.*?)"/))||void 0===s?void 0:s[1],o=(null===(i=f.responseText.match(/\(\{"INNERTUBE_CONTEXT":([\w\W]*?)\}\)/)||f.responseText.match(/"INNERTUBE_CONTEXT":([\w\W]*?\}),"INNERTUBE/))||void 0===i?void 0:i[1])||"{}";const{client:m,request:v}=JSON.parse(o);if(n&&m&&v){if(m.hl="en","channel"===e){var a,r=null===(a=f.responseText.match(//))||void 0===a?void 0:a[1];return r?(h.success(),{params:{apiKey:n,client:m,request:v,channelId:r}}):(h.error('Error: Get "channelId" failed!'),{})}if("likeVideo"!==e)return h.error("Error: Unknown type"),{};var l,u,c=null===(l=f.responseText.match(//))||void 0===l?void 0:l[1],d=null===(u=f.responseText.match(/"likeParams":"(.*?)"/))||void 0===u?void 0:u[1];return c?(h.success(),{params:{apiKey:n,client:m,request:v,videoId:c,likeParams:d}}):(h.error('Error: Get "videoId" failed!'),{})}return h.error('Error: Parameter "apiKey" not found!'),{}}}catch(t){return _(t,"Youtube.getInfo"),{}}};var Ee=new WeakMap,Pe=new WeakMap,We=new WeakMap,Ue=new WeakSet,Oe=new WeakSet,De=new WeakSet,Fe=new WeakSet,je=new WeakSet;class Ne extends t{constructor(){var t;super(...arguments),Se(this,je),Se(this,Fe),Se(this,De),Se(this,Oe),Se(this,Ue),Ie(this,"tasks",{...Ve}),Ie(this,"whiteList",(null===(t=GM_getValue("whiteList"))||void 0===t?void 0:t.youtube)||{...Ve}),$e(this,Ee,{writable:!0,value:GM_getValue("youtubeAuth")||{}}),$e(this,Pe,{writable:!0,value:!1}),$e(this,We,{writable:!0,value:"https://www.youtube.com/channel/"+A.other.youtubeVerifyChannel})}async init(){try{return _e(this,Pe)?!0:_e(this,Ee).PAPISID?await Ge(this,Ue,Me).call(this)?(V({html:`
  • ${E("initSuccess","Youtube")}
  • `}),Le(this,Pe,!0),!0):(GM_setValue("youtubeAuth",null),await Ge(this,Oe,Re).call(this)?(V({html:`
  • ${E("initSuccess","Youtube")}
  • `}),Le(this,Pe,!0),!0):(V({html:`
  • ${E("initFailed","Youtube")}
  • `}),!1)):!!await Ge(this,Oe,Re).call(this)&&(Le(this,Pe,!0),!0)}catch(t){return _(t,"Youtube.init"),!1}}async toggle(t){var{doTask:e=!0,channelLinks:s=[],videoLinks:t=[]}=t;try{if(!_e(this,Pe))return V({text:E("needInit")}),!1;const o=[];if(e&&!A.doTask.youtube.channels||!e&&!A.undoTask.youtube.channels)V({type:"globalOptionsSkip",text:"youtube.channels"});else{var i=this.getRealParams("channels",s,e,t=>{var e;return/^https:\/\/(www\.)?google\.com.*?\/url\?.*?url=https:\/\/www\.youtube\.com\/.*/.test(t)?null===(e=t.match(/url=(https:\/\/www\.youtube\.com\/.*)/))||void 0===e?void 0:e[1]:t});if(0{var e;return/^https:\/\/(www\.)?google\.com.*?\/url\?.*?url=https:\/\/www\.youtube\.com\/.*/.test(t)?null===(e=t.match(/url=(https:\/\/www\.youtube\.com\/.*)/))||void 0===e?void 0:e[1]:t});if(0!0)}catch(t){return _(t,"Youtube.toggle"),!1}}}async function Me(){try{return await Ge(this,Fe,Ke).call(this,{link:_e(this,We),doTask:!0,verify:!0})}catch(t){return _(t,"Youtube.verifyAuth"),!1}}async function Re(){try{const s=V({text:E("updatingAuth","Youtube")});return await new Promise(e=>{const t=GM_openInTab("https://www.youtube.com/#auth",{active:!0,insert:!0,setParent:!0});t.onclose=async()=>{var t=GM_getValue("youtubeAuth");t?(Le(this,Ee,t),s.success(),Ge(this,Ue,Me).call(this).then(t=>{e(t)})):(s.error("Error: Update youtube auth failed!"),e(!1))}})}catch(t){return _(t,"Discord.updateAuth"),!1}}function Ye(t,e){return Ae(t,e)}async function Ke(t){var{link:e,doTask:s=!0,verify:t=!1}=t;try{var{params:i,needLogin:n}=await Ge(this,De,Ye).call(this,e,"channel"),{apiKey:o,client:a,request:r,channelId:l}=i||{};if(n)return V({html:E("loginYtb")}),!1;if(!(o&&a&&r&&l))return V({text:'"getYtbToken" failed'}),!1;if(!s&&!t&&this.whiteList.channels.includes(l))return V({type:"whiteList",text:"Youtube.unfollowChannel",id:l}),!0;const c=t?V({text:E("verifyingAuth","Youtube")}):V({type:s?"followingYtbChannel":"unfollowingYtbChannel",text:l});var u=parseInt(String((new Date).getTime()/1e3),10);const{result:d,statusText:h,status:g,data:p}=await I({url:`https://www.youtube.com/youtubei/v1/subscription/${s?"":"un"}subscribe?key=`+o,method:"POST",headers:{origin:"https://www.youtube.com",referer:"https://www.youtube.com/channel/"+l,"content-type":"application/json","x-goog-authuser":"0","x-goog-visitor-id":null==a?void 0:a.visitorData,"x-origin":"https://www.youtube.com",authorization:`SAPISIDHASH ${u}_`+sha1(`${u} ${_e(this,Ee).PAPISID} https://www.youtube.com`)},data:JSON.stringify({context:{client:a,request:{sessionId:null==r?void 0:r.sessionId,internalExperimentFlags:[],consistencyTokenJars:[]},user:{}},channelIds:[l],params:s?"EgIIAhgA":"CgIIAhgA"})});return"Success"===d?200===(null===p||void 0===p?void 0:p.status)?s&&(/"subscribed": true/.test(p.responseText)||p.responseText.includes("The subscription already exists"))||!s&&/"subscribed": false/.test(p.responseText)?(c.success(),s&&!t&&(this.tasks.channels=L([...this.tasks.channels,e])),!0):(c.error(E("tryUpdateYtbAuth"),!0),!1):(c.error(`Error:${null===p||void 0===p?void 0:p.statusText}(${null===p||void 0===p?void 0:p.status})`),!1):(c.error(d+`:${h}(${g})`),!1)}catch(t){return _(t,"Youtube.toggleChannel"),!1}}async function ze(t){var{link:e,doTask:t=!0}=t;try{var{params:s,needLogin:i}=await Ge(this,De,Ye).call(this,e,"likeVideo"),{apiKey:n,client:o,request:a,videoId:r,likeParams:l}=s||{};if(i)return V({html:""+E("loginYtb")}),!1;if(!(n&&o&&a&&r&&l))return V({text:'"getYtbToken" failed'}),!1;if(!t&&this.whiteList.likes.includes(r))return V({type:"whiteList",text:"Youtube.unlikeVideo",id:r}),!0;const c=V({type:t?"likingYtbVideo":"unlikingYtbVideo",text:r});var u=parseInt(String((new Date).getTime()/1e3),10);const d={context:{client:o,request:{sessionId:a.sessionId,internalExperimentFlags:[],consistencyTokenJars:[]},user:{}},target:{videoId:r}};if(t){if(!l)return c.error("Empty likeParams"),!1;d.params=l}const{result:h,statusText:g,status:p,data:w}=await I({url:`https://www.youtube.com/youtubei/v1/like/${t?"":"remove"}like?key=`+n,method:"POST",headers:{origin:"https://www.youtube.com",referer:"https://www.youtube.com/watch?v="+r,"content-type":"application/json","x-goog-authuser":"0","x-goog-visitor-id":o.visitorData,"x-origin":"https://www.youtube.com",authorization:`SAPISIDHASH ${u}_`+sha1(`${u} ${_e(this,Ee).PAPISID} https://www.youtube.com`)},data:JSON.stringify(d)});return"Success"===h?200===(null===w||void 0===w?void 0:w.status)?t&&w.responseText.includes("Added to Liked videos")||!t&&(w.responseText.includes("Removed from Liked videos")||w.responseText.includes("Dislike removed"))?(c.success(),t&&(this.tasks.likes=L([...this.tasks.likes,e])),!0):(c.error(E("tryUpdateYtbAuth"),!0),!1):(c.error(`Error:${null===w||void 0===w?void 0:w.statusText}(${null===w||void 0===w?void 0:w.status})`),!1):(c.error(h+`:${g}(${p})`),!1)}catch(t){return _(t,"Youtube.toggleLikeVideo"),!1}}function Be(t,e){He(t,e),e.add(t)}function qe(t,e,s){He(t,e),e.set(t,s)}function He(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Je(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Xe(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,ts(t,e,"set"),s),s}function Qe(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function Ze(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,ts(t,e,"get"))}function ts(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const es={groups:[],wishlists:[],follows:[],forums:[],workshops:[],workshopVotes:[],curators:[],curatorLikes:[],announcements:[]};var ss=new WeakMap,is=new WeakMap,ns=new WeakMap,os=new WeakMap,as=new WeakSet,rs=new WeakSet,ls=new WeakSet,us=new WeakSet,cs=new WeakSet,ds=new WeakSet,hs=new WeakSet,gs=new WeakSet,ps=new WeakSet,ws=new WeakSet,fs=new WeakSet,ms=new WeakSet,vs=new WeakSet,ks=new WeakSet,ys=new WeakSet,bs=new WeakSet,Ts=new WeakSet,Ss=new WeakSet,$s=new WeakSet,xs=new WeakSet,Is=new WeakSet;async function Ls(){try{const s=V({text:E("updatingAuth",E("steamStore"))}),{result:i,statusText:n,status:o,data:a}=await I({url:"https://store.steampowered.com/stats/",method:"GET"});if("Success"!==i)return s.error(i+`:${n}(${o})`),!1;if(200!==(null===a||void 0===a?void 0:a.status))return s.error(`Error:${null===a||void 0===a?void 0:a.statusText}(${null===a||void 0===a?void 0:a.status})`),!1;var t;if(a.responseText.includes('href="https://store.steampowered.com/login/'))return s.error("Error:"+E("needLoginSteamStore"),!0),!1;var e=null===(t=a.responseText.match(/g_sessionID = "(.+?)";/))||void 0===t?void 0:t[1];return e?(Ze(this,is).storeSessionID=e,s.success(),!0):(s.error('Error: Get "sessionID" failed'),!1)}catch(t){return _(t,"Steam.updateStoreAuth"),!1}}async function Gs(){try{const a=V({text:E("updatingAuth",E("steamCommunity"))}),{result:r,statusText:l,status:u,data:c}=await I({url:"https://steamcommunity.com/my",method:"GET"});if("Success"!==r)return a.error(r+`:${l}(${u})`),!1;if(200!==(null===c||void 0===c?void 0:c.status))return a.error(`Error:${null===c||void 0===c?void 0:c.statusText}(${null===c||void 0===c?void 0:c.status})`),!1;var t,e,s;if(c.responseText.includes('href="https://steamcommunity.com/login/home/'))return a.error("Error:"+E("needLoginSteamCommunity"),!0),!1;var i=null===(t=c.responseText.match(/g_steamID = "(.+?)";/))||void 0===t?void 0:t[1],n=null===(e=c.responseText.match(/g_sessionID = "(.+?)";/))||void 0===e?void 0:e[1],o=null===(s=c.responseText.match(/steamcommunity.com\/id\/(.+?)\/friends\//))||void 0===s?void 0:s[1];return(i&&(Ze(this,is).steam64Id=i),o&&(Ze(this,is).userName=o),n)?(Ze(this,is).communitySessionID=n,a.success(),!0):(a.error('Error: Get "sessionID" failed'),!1)}catch(t){return _(t,"Steam.updateCommunityAuth"),!1}}async function _s(){try{const i=V({text:E("gettingAreaInfo")}),{result:n,statusText:o,status:a,data:r}=await I({url:"https://store.steampowered.com/cart/",method:"GET"});if("Success"!==n)return i.error(n+`:${o}(${a})`),{};if(200!==(null===r||void 0===r?void 0:r.status))return i.error(`Error:${null===r||void 0===r?void 0:r.statusText}(${null===r||void 0===r?void 0:r.status})`),{};var t,e=null===(t=r.responseText.match(//g)].map(t=>t[1]);return e&&0t&&"CN"!==t);if(!s||0===s.length)return V({text:"noAnotherArea"}),!1;[t]=s}const l=V({text:E("changingArea",t)});var{result:i,statusText:n,status:o,data:a}=await I({url:"https://store.steampowered.com/account/setcountry",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({cc:t,sessionid:Ze(this,is).storeSessionID})});if("Success"!==i)return l.error(i+`:${n}(${o})`),"CN";if(200!==(null==a?void 0:a.status)||"true"!==a.responseText)return l.error(`Error:${null==a?void 0:a.statusText}(${null==a?void 0:a.status})`),"CN";var r=(await Qe(this,ls,_s).call(this))["currentArea"];return r===t?(l.success(),r):(l.error("Error: change country filed"),"CN")}catch(t){return _(t,"Steam.changeArea"),!1}}async function Vs(t){try{const e=V({type:"joiningSteamGroup",text:t}),{result:s,statusText:i,status:n,data:o}=await I({url:"https://steamcommunity.com/groups/"+t,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({action:"join",sessionID:Ze(this,is).communitySessionID})});return"Success"===s?200!==(null===o||void 0===o?void 0:o.status)||o.responseText.includes("grouppage_join_area")?(e.error(`Error:${null===o||void 0===o?void 0:o.statusText}(${null===o||void 0===o?void 0:o.status})`),!1):(e.success(),this.tasks.groups=L([...this.tasks.groups,t]),!0):(e.error(s+`:${i}(${n})`),!1)}catch(t){return _(t,"Steam.joinGroup"),!1}}async function As(t){try{if(this.whiteList.groups.includes(t))return V({type:"whiteList",text:"Steam.leaveGroup",id:t}),!0;var e=await Qe(this,hs,Es).call(this,t);if(!e)return!1;const s=V({type:"leavingSteamGroup",text:t}),{result:i,statusText:n,status:o,data:a}=await I({url:`https://steamcommunity.com/id/${Ze(this,is).userName}/home_process`,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionID:Ze(this,is).communitySessionID,action:"leaveGroup",groupId:e})});return"Success"===i?200===(null===a||void 0===a?void 0:a.status)&&a.finalUrl.includes("groups")&&0===$(a.responseText.replace(//g,"").toLowerCase()).find(`a[href='https://steamcommunity.com/groups/${t.toLowerCase()}']`).length?(s.success(),!0):(s.error(`Error:${null===a||void 0===a?void 0:a.statusText}(${null===a||void 0===a?void 0:a.status})`),!1):(s.error(i+`:${n}(${o})`),!1)}catch(t){return _(t,"Steam.leaveGroup"),!1}}async function Es(t){try{const n=V({type:"gettingSteamGroupId",text:t});var e=Ze(this,ss).group[t];if(e)return n.success(),e;const{result:o,statusText:a,status:r,data:l}=await I({url:"https://steamcommunity.com/groups/"+t,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==o)return n.error(o+`:${a}(${r})`),!1;if(200!==(null===l||void 0===l?void 0:l.status))return n.error(`Error:${null===l||void 0===l?void 0:l.statusText}(${null===l||void 0===l?void 0:l.status})`),!1;var s,i=null===(s=l.responseText.match(/OpenGroupChat\( '([0-9]+)'/))||void 0===s?void 0:s[1];return i?(Qe(this,Is,Bs).call(this,"group",t,i),n.success(),i):(n.error(`Error:${l.statusText}(${l.status})`),!1)}catch(t){return _(t,"Steam.getGroupID"),!1}}async function Ps(t){try{var e;const n=V({type:"addingToWishlist",text:t});var{result:s,data:i}=await I({url:"https://store.steampowered.com/api/addtowishlist",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionid:Ze(this,is).storeSessionID,appid:t}),dataType:"json"});if("Success"===s&&200===(null==i?void 0:i.status)&&!0===(null===(e=i.response)||void 0===e?void 0:e.success))return n.success(),this.tasks.wishlists=L([...this.tasks.wishlists,t]),!0;const{result:o,statusText:a,status:r,data:l}=await I({url:"https://store.steampowered.com/app/"+t,method:"GET"});return"Success"===o?200===(null===l||void 0===l?void 0:l.status)?"CN"===Ze(this,os)&&l.responseText.includes('id="error_box"')?(n.warning(E("changeAreaNotice")),!!await Qe(this,us,Cs).call(this)&&await Qe(this,gs,Ps).call(this,t)):(!l.responseText.includes('class="queue_actions_ctn"')||!l.responseText.includes('class="already_in_library"'))&&(l.responseText.includes('class="queue_actions_ctn"')&&l.responseText.includes('id="add_to_wishlist_area_success" style="display: none;')||!l.responseText.includes('class="queue_actions_ctn"'))?(n.error(`Error:${l.statusText}(${l.status})`),!1):(n.success(),this.tasks.wishlists=L([...this.tasks.wishlists,t]),!0):(n.error(`Error:${null===l||void 0===l?void 0:l.statusText}(${null===l||void 0===l?void 0:l.status})`),!1):(n.error(o+`:${a}(${r})`),!1)}catch(t){return _(t,"Steam.addToWishlist"),!1}}async function Ws(t){try{var e;if(this.whiteList.wishlists.includes(t))return V({type:"whiteList",text:"Steam.removeFromWishlist",id:t}),!0;const o=V({type:"removingFromWishlist",text:t});var{result:s,data:i}=await I({url:"https://store.steampowered.com/api/removefromwishlist",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionid:Ze(this,is).storeSessionID,appid:t}),dataType:"json"});if("Success"===s&&200===(null==i?void 0:i.status)&&!0===(null===(e=i.response)||void 0===e?void 0:e.success))return o.success(),!0;const{result:a,statusText:r,status:l,data:u}=await I({url:"https://store.steampowered.com/app/"+t,method:"GET"});if("Success"!==a)return o.error(a+`:${r}(${l})`),!1;if(200!==(null===u||void 0===u?void 0:u.status))return o.error(`Error:${null===u||void 0===u?void 0:u.statusText}(${null===u||void 0===u?void 0:u.status})`),!1;if("CN"===Ze(this,os)&&u.responseText.includes('id="error_box"')){o.warning(E("changeAreaNotice"));var n=await Qe(this,us,Cs).call(this);return n&&"CN"!==n&&"skip"!==n?await Qe(this,ps,Ws).call(this,t):!1}return u.responseText.includes('class="queue_actions_ctn"')&&(u.responseText.includes("ds_owned_flag ds_flag")||u.responseText.includes("add_to_wishlist_area"))?(o.success(),!0):(o.error(`Error:${u.statusText}(${u.status})`),!1)}catch(t){return _(t,"Steam.removeFromWishlist"),!1}}async function Us(t,e){try{if(!e&&this.whiteList.follows.includes(t))return V({type:"whiteList",text:"Steam.unfollowGame",id:t}),!0;const o=V({type:`${e?"":"un"}followingGame`,text:t}),a={sessionid:Ze(this,is).storeSessionID,appid:t};e||(a.unfollow="1");var{result:s,data:i}=await I({url:"https://store.steampowered.com/explore/followgame/",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param(a)});if("Success"===s&&200===(null==i?void 0:i.status)&&"true"===i.responseText)return o.success(),!0;var n=await Qe(this,fs,Os).call(this,t);return"CN"===Ze(this,os)&&"areaLocked"===n?(o.warning(E("changeAreaNotice")),!!await Qe(this,us,Cs).call(this)&&await Qe(this,ps,Ws).call(this,t)):e===n?(o.success(),e&&(this.tasks.follows=L([...this.tasks.follows,t])),!0):(o.error(`Error:${null==i?void 0:i.statusText}(${null==i?void 0:i.status})`),!1)}catch(t){return _(t,"Steam.toggleFollowGame"),!1}}async function Os(t){try{const{result:e,data:s}=await I({url:"https://store.steampowered.com/app/"+t,method:"GET"});return"Success"===e?200===(null===s||void 0===s?void 0:s.status)&&("CN"===Ze(this,os)&&s.responseText.includes('id="error_box"')?"areaLocked":"none"!==$(s.responseText.replace(//g,"")).find(".queue_control_button.queue_btn_follow>.btnv6_blue_hoverfade.btn_medium.queue_btn_active").css("display")):!1}catch(t){return _(t,"Steam.isFollowedGame"),!1}}async function Ds(t){var e=!(1/))||void 0===s?void 0:s[1];return i?(Qe(this,Is,Bs).call(this,"workshop",t,i),n.success(),i):(n.error("Error: getWorkshopAppId failed"),!1)}catch(t){return _(t,"Steam.getWorkshopAppId"),!1}}async function Ms(t){try{const a=V({type:"votingUpWorkshop",text:t});var e,{result:s,statusText:i,status:n,data:o}=await I({url:"https://steamcommunity.com/sharedfiles/voteup",method:"POST",responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({id:t,sessionid:Ze(this,is).communitySessionID})});return"Success"===s?(200===(null==o?void 0:o.status)&&1===(null===(e=o.response)||void 0===e?void 0:e.success)?a.success():a.error(`Error:${null==o?void 0:o.statusText}(${null==o?void 0:o.status})`),!0):(a.error(s+`:${i}(${n})`),!0)}catch(t){return _(t,"Steam.voteupWorkshop"),!0}}async function Rs(t){var e=!(1${E("initSuccess","Steam")}`}),!0):(V({html:`
  • ${E("initFailed","Steam")}
  • `}),!1)}catch(t){return _(t,"Steam.init"),!1}}async getCuratorId(t,e){try{const o=V({type:"gettingCuratorId",text:t+"/"+e});var s=Ze(this,ss).curator[t+"/"+e];if(s)return o.success(),s;const{result:a,statusText:r,status:l,data:u}=await I({url:`https://store.steampowered.com/${t}/`+e,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==a)return o.error(a+`:${r}(${l})`),!1;if(200!==(null===u||void 0===u?void 0:u.status))return o.error(`Error:${null===u||void 0===u?void 0:u.statusText}(${null===u||void 0===u?void 0:u.status})`),!1;var i,n=null===(i=u.responseText.match(/g_pagingData.*?"clanid":([\d]+)/))||void 0===i?void 0:i[1];return n?(Qe(this,Is,Bs).call(this,"curator",t+"/"+e,n),o.success(),n):(o.error(`Error:${u.statusText}(${u.status})`),!1)}catch(t){return _(t,"Steam.getCuratorID"),!1}}async toggle(t){var{doTask:e=!0,groupLinks:s=[],wishlistLinks:i=[],followLinks:n=[],forumLinks:o=[],workshopLinks:a=[],workshopVoteLinks:r=[],curatorLinks:l=[],curatorLikeLinks:u=[],announcementLinks:t=[]}=t;try{if(!Ze(this,ns))return V({text:E("needInit")}),!1;const k=[];if(e&&!A.doTask.steam.groups||!e&&!A.undoTask.steam.groups)V({type:"globalOptionsSkip",text:"steam.groups"});else{var c=this.getRealParams("groups",s,e,t=>{return null===(t=t.match(/groups\/(.+)\/?/))||void 0===t?void 0:t[1]});if(0{return null===(t=t.match(/app\/([\d]+)/))||void 0===t?void 0:t[1]});if(0{return null===(t=t.match(/app\/([\d]+)/))||void 0===t?void 0:t[1]});if(0{return null===(t=t.match(/app\/([\d]+)/))||void 0===t?void 0:t[1]});if(0{return null===(t=t.match(/\?id=([\d]+)/))||void 0===t?void 0:t[1]});if(0{return null===(t=t.match(/\?id=([\d]+)/))||void 0===t?void 0:t[1]});if(e&&0{return null===(t=t.match(/curator\/([\d]+)/))||void 0===t?void 0:t[1]}),m=this.getRealParams("curatorLikes",u,e,t=>{return null===(t=t.match(/https?:\/\/store\.steampowered\.com\/(.*?)\/([^/?]+)/))||void 0===t?void 0:t.slice(1,3).join("/")});if(0{var e;return t.includes("store.steampowered.com")?null===(e=t.match(/store\.steampowered\.com\/news\/app\/([\d]+)\/view\/([\d]+)/))||void 0===e?void 0:e.slice(1,3).join("/"):null===(t=t.match(/steamcommunity\.com\/games\/([\d]+)\/announcements\/detail\/([\d]+)/))||void 0===t?void 0:t.slice(1,3).join("/")});if(e&&0("CN"!==Ze(this,os)&&(V({html:`
  • ${E("steamFinishNotice")}
  • `}),await Qe(this,us,Cs).call(this,"CN")),!0))}catch(t){return _(t,"Steam.toggle"),!1}}};function Hs(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function Js(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Xs(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}const Qs={steam:{groupLinks:[],wishlistLinks:[],curatorLinks:[],curatorLikeLinks:[],followLinks:[],forumLinks:[],announcementLinks:[],workshopVoteLinks:[]},discord:{serverLinks:[]},instagram:{userLinks:[]},vk:{nameLinks:[]},twitch:{channelLinks:[]},reddit:{redditLinks:[]},youtube:{channelLinks:[],likeLinks:[]}};var Zs,ti=new WeakSet,ei=new WeakSet,si=new WeakSet,ii=new WeakSet;function ni(){try{return A.other.checkLogin?(0<$("a.steam-login").length&&window.open("/steam/redirect","_self"),!0):!0}catch(t){return _(t,"Giveawaysu.checkLogin"),!1}}async function oi(){try{return A.other.checkLeftKey?(0<$(".giveaway-ended").length&&await o().fire({icon:"warning",title:E("notice"),text:E("noKeysLeft"),confirmButtonText:E("confirm"),cancelButtonText:E("cancel"),showCancelButton:!0}).then(t=>{t=t.value;t&&window.close()}),!0):!0}catch(t){return _(t,"Giveawaysu.checkLeftKey"),!1}}function ai(){var t=null===(t=window.location.href.match(/\/view\/([\d]+)/))||void 0===t?void 0:t[1];return t?(this.giveawayId=t,!0):(V({text:E("getFailed","GiveawayId")}),!1)}async function ri(e,t){try{return{name:e,result:await t}}catch(t){return _(t,"GiveawaySu.bind"),{name:e,result:!1}}}const li=class{constructor(){Hs(this,ii),Hs(this,si),Hs(this,ei),Hs(this,ti),Js(this,"undoneTasks",Qs),Js(this,"giveawayId",void 0),Js(this,"socialInitialized",{discord:!1,instagram:!1,reddit:!1,twitch:!1,vk:!1,youtube:!1,steam:!1}),Js(this,"initialized",!1),Js(this,"social",{})}static test(){return/^https?:\/\/giveaway\.su\/giveaway\/view\/[\d]+/.test(window.location.href)}async after(){try{Xs(this,ti,ni).call(this)||V({html:`
  • ${E("checkLoginFailed")}
  • `}),await Xs(this,ei,oi).call(this)||V({html:`
  • ${E("checkLeftKeyFailed")}
  • `})}catch(t){_(t,"Giveawaysu.after")}}init(){try{const t=V({text:E("initing")});return 0<$("a.steam-login").length?(window.open("/steam/redirect","_self"),t.warning(E("needLogin")),!1):!!Xs(this,si,ai).call(this)&&(this.initialized=!0,t.success(),!0)}catch(t){return _(t,"Giveawaysu.init"),!1}}async classifyTask(){try{const e=V({text:E("getTasksInfo")}),s=[];var t=$("#actions tr");$("div.bind-discord").is(":visible")&&$("div.bind-discord a")[0].click(),$("div.bind-twitch").is(":visible")&&$("div.bind-twitch a")[0].click();for(const r of t)s.push(new Promise(e=>{const t=$(r).find('td:not(".hidden")');var s=t.eq(1).find('a:not([data-trigger="link"])'),i=t.eq(2).find('a:not([data-trigger="link"])');const n=0{try{if(!e)return null;const s=GM_getValue("redirectLinks")||{};return s[e]&&s[e],await I({url:e,method:"GET"}).then(t=>{t=t.data;return null!=t&&t.finalUrl?(s[e]=t.finalUrl,GM_setValue("redirectLinks",s),t.finalUrl):null})}catch(t){return _(t,"getRedirectLink"),null}})(n.attr("href")).then(t=>t?(o.includes("steam")&&/join/gi.test(a)?this.undoneTasks.steam.groupLinks.push(t):/like.*announcement/gi.test(a)?this.undoneTasks.steam.announcementLinks.push(t):/(follow|subscribe).*curator/gim.test(a)&&/^https?:\/\/store\.steampowered\.com\/curator\//.test(t)?this.undoneTasks.steam.curatorLinks.push(t):o.includes("steam")&&/follow|subscribe/gim.test(a)?this.undoneTasks.steam.curatorLikeLinks.push(t):/subscribe.*steam.*forum/gim.test(a)?this.undoneTasks.steam.forumLinks.push(t):o.includes("thumbs-up")&&/^https?:\/\/steamcommunity\.com\/sharedfiles\/filedetails\/\?id=[\d]+/.test(t)?this.undoneTasks.steam.workshopVoteLinks.push(t):o.includes("discord")||/join.*discord/gim.test(a)?this.undoneTasks.discord.serverLinks.push(t):o.includes("instagram")||/follow.*instagram/gim.test(a)?this.undoneTasks.instagram.userLinks.push(t):o.includes("twitch")||/follow.*twitch.*channel/gim.test(a)?this.undoneTasks.twitch.channelLinks.push(t):o.includes("reddit")||/subscribe.*subreddit/gim.test(a)||/follow.*reddit/gim.test(a)?this.undoneTasks.reddit.redditLinks.push(t):/watch.*art/gim.test(a)?this.undoneTasks.steam.workshopVoteLinks.push(t):/subscribe.*youtube.*channel/gim.test(a)?this.undoneTasks.youtube.channelLinks.push(t):/(watch|like).*youtube.*video/gim.test(a)||(o.includes("youtube")||o.includes("thumbs-up"))&&/(watch|like).*video/gim.test(a)?this.undoneTasks.youtube.likeLinks.push(t):o.includes("vk")||/join.*vk.*group/gim.test(a)?this.undoneTasks.vk.nameLinks.push(t):/(on twitter)|(Follow.*on.*Facebook)/gim.test(a)||(/wishlist.*game|add.*wishlist/gim.test(a)&&this.undoneTasks.steam.wishlistLinks.push(t),/follow.*button/gim.test(a)&&this.undoneTasks.steam.followLinks.push(t)),void e(!0)):e(!1)).catch(t=>(_(t,"Giveawaysu.classifyTask->getRedirectLink"),!1))}));return await Promise.all(s),e.success(),this.undoneTasks=this.uniqueTasks(this.undoneTasks),!0}catch(t){return _(t,"Giveawaysu.classifyTask"),!1}}async initSocial(){try{const e=[];var t=this.undoneTasks;return t.discord&&0[...t,...e]).length&&!this.socialInitialized.discord&&(this.social.discord=new N,e.push(Xs(this,ii,ri).call(this,"discord",this.social.discord.init()))),t.instagram&&0[...t,...e]).length&&!this.socialInitialized.instagram&&(this.social.instagram=new lt,e.push(Xs(this,ii,ri).call(this,"instagram",this.social.instagram.init()))),t.reddit&&0[...t,...e]).length&&!this.socialInitialized.reddit&&(this.social.reddit=new $t,e.push(Xs(this,ii,ri).call(this,"reddit",this.social.reddit.init()))),t.twitch&&0[...t,...e]).length&&!this.socialInitialized.twitch&&(this.social.twitch=new Bt,e.push(Xs(this,ii,ri).call(this,"twitch",this.social.twitch.init()))),t.vk&&0[...t,...e]).length&&!this.socialInitialized.vk&&(this.social.vk=new Te,e.push(Xs(this,ii,ri).call(this,"vk",this.social.vk.init()))),t.youtube&&0[...t,...e]).length&&!this.socialInitialized.youtube&&(this.social.youtube=new Ne,e.push(Xs(this,ii,ri).call(this,"youtube",this.social.youtube.init()))),t.steam&&0[...t,...e]).length&&!this.socialInitialized.steam&&(this.social.steam=new qs,e.push(Xs(this,ii,ri).call(this,"steam",this.social.steam.init()))),await Promise.all(e).then(t=>{let e=!0;for(const s of t)s.result?this.socialInitialized[s.name]=s.result:e=!1;return e})}catch(t){return _(t,"GiveawaySu.initSocial"),!1}}uniqueTasks(t){const e={};for(var[s,i]of Object.entries(t)){e[s]={};for(var[n,o]of Object.entries(i))e[s][n]=L(o)}return e}async toggleTask(){try{if(!this.initialized&&!this.init())return!1;if(!await this.classifyTask())return!1;if(!await this.initSocial())return!1;const e=[];var t=this.undoneTasks;return this.social.discord&&e.push(this.social.discord.toggle({doTask:!0,...t.discord})),this.social.instagram&&e.push(this.social.instagram.toggle({doTask:!0,...t.instagram})),this.social.reddit&&e.push(this.social.reddit.toggle({doTask:!0,...t.reddit})),this.social.twitch&&e.push(this.social.twitch.toggle({doTask:!0,...t.twitch})),this.social.vk&&e.push(this.social.vk.toggle({doTask:!0,...t.vk})),this.social.youtube&&e.push(this.social.youtube.toggle({doTask:!0,...t.youtube})),this.social.steam&&e.push(this.social.steam.toggle({doTask:!0,...t.steam})),await Promise.all(e),V({html:`
  • ${E("allTasksComplete")}
  • `}),!0}catch(t){return _(t,"GiveawaySu.toggleTask"),!1}}async doTask(){try{return $("#getKey").on("click",()=>{$('#auto-task-info-div,style:contains(".swal2-popup.swal2-toast")').remove(),$("#getKey").off()}),await this.toggleTask()}catch(t){return _(t,"GiveawaySu.doTask"),!1}}};"discord.com"===window.location.hostname&&(Zs=null===(t=window.localStorage)||void 0===t||null===(Zs=t.getItem("token"))||void 0===Zs?void 0:Zs.replace(/^"|"$/g,""),GM_setValue("discordAuth",{auth:Zs}),Zs&&"#auth"===window.location.hash&&(window.close(),o().fire("",E("closePageNotice"))));$(async()=>{var t,e,s;if("www.twitch.tv"===window.location.hostname&&"#auth"===window.location.hash&&(t=a.get("auth-token"),!!a.get("login")?(GM_setValue("twitchAuth",{authToken:t,clientId:null===(t=commonOptions)||void 0===t||null===(e=t.headers)||void 0===e?void 0:e["Client-ID"]}),window.close(),o().fire("",E("closePageNotice"))):o().fire("",E("needLogin"))),"twitter.com"===window.location.hostname&&"#auth"===window.location.hash&&(s=a.get("ct0"),!!a.get("twid")&&s?(GM_setValue("twitterAuth",{ct0:s}),window.close(),o().fire("",E("closePageNotice"))):o().fire("",E("needLogin"))),"www.youtube.com"===window.location.hostname&&"#auth"===window.location.hash&&((s=a.get("__Secure-3PAPISID"))?(GM_setValue("youtubeAuth",{PAPISID:s}),window.close(),o().fire("",E("closePageNotice"))):o().fire("",E("needLogin"))),"www.reddit.com"===window.location.hostname&&("#auth"===window.location.hash||"#auth"===GM_getValue("redditAuth"))){const i=$("#redesign-beta-optin-btn");if(0

    `),await n.after(),$("#auto-do-task").on("click",()=>{n.doTask()}),console.log("%c%s","color:#1bbe1a","Auto TaskGS特供脚本初始化完成!")}})}()}(); \ No newline at end of file + ${null===s||void 0===s?void 0:s.replace("u_","")}...`);break;case"followingYtbChannel":case"unfollowingYtbChannel":t=$(`
  • ${E(e)}${s}...
  • `);break;case"likingYtbVideo":case"unlikingYtbVideo":t=$(`
  • ${E(e)}${s}...
  • `);break;case"gettingVkId":case"joiningVkGroup":case"leavingVkGroup":case"joiningVkPublic":case"leavingVkPublic":case"sendingVkWall":case"deletingVkWall":t=$(`
  • ${E(e)}${s}...
  • `);break;case"visitingLink":t=$(`
  • ${E("visitingLink")}${s}...
  • `);break;case"verifyingInsAuth":case"text":t=$(`
  • ${E(s)}
  • `);break;case"html":t=$(s||i);break;case"whiteList":t=$(`
  • ${E("skipTask")}[${s}(${n})](${E("whiteList")})
  • `);break;case"globalOptionsSkip":t=$(`
  • ${E("skipTaskOption")}${s}
  • `);break;default:t=$(`
  • ${E("unKnown")}:${e}(${s})...
  • `)}else t=s?$(`
  • ${E(s)}
  • `):i?$(i):$("
  • ");return t.addClass("card-text"),$("#auto-task-info").append(t),null!==(a=t[0])&&void 0!==a&&a.scrollIntoView(),{font:t.find("font"),success(){var t,e,s=0{try{return[...new Set(t)]}catch(t){return _(t,"unique"),[]}},l=async e=>{try{if(!e)return null;const s=GM_getValue("redirectLinks")||{};return s[e]&&s[e],await I({url:e,method:"GET"}).then(t=>{t=t.data;return null!=t&&t.finalUrl?(s[e]=t.finalUrl,GM_setValue("redirectLinks",s),t.finalUrl):null})}catch(t){return _(t,"getRedirectLink"),null}};const u={doTask:{discord:{servers:!0},instagram:{users:!0},twitch:{channels:!0},twitter:{users:!0,retweets:!0},vk:{names:!0},youtube:{channels:!0,likes:!0},reddit:{reddits:!0},steam:{groups:!0,wishlists:!0,follows:!0,forums:!0,workshops:!0,curators:!0,workshopVotes:!0,announcements:!0}},undoTask:{discord:{servers:!0},instagram:{users:!0},twitch:{channels:!0},twitter:{users:!0,retweets:!0},vk:{names:!0},youtube:{channels:!0,likes:!0},reddit:{reddits:!0},steam:{groups:!0,wishlists:!0,follows:!0,forums:!0,workshops:!0,curators:!0}},position:{buttonSideX:"right",buttonSideY:"top",buttonDistance:"15,30",showButtonSideX:"right",showButtonSideY:"top",showButtonDistance:"15,30",logSideX:"right",logSideY:"bottom",logDistance:"10,10"},hotKey:{doTaskKey:"alt + d",undoTaskKey:"alt + u",toggleLogKey:"alt + l"},other:{twitterVerifyId:"783214",youtubeVerifyChannel:"UCrXUsMBcfTVqwAS7DKg9C0Q",autoUpdateSource:"jsDelivr",language:"zh",checkLogin:!0,checkLeftKey:!0,defaultShowButton:!0,defaultShowLog:!0}};t=GM_getValue("globalOptions")||{};const c=(t,e)=>{try{const n={};for(var[s,i]of Object.entries(t))"[object Object]"===Object.prototype.toString.call(i)&&"[object Object]"===Object.prototype.toString.call(e[s])?n[s]=c(i,e[s]):n[s]=e[s]??i;return n}catch(t){return _(t,"assignObject"),u}},A=c(u,t);const d={zh:{website:"网站",type:"类型",edit:"编辑",whiteList:"白名单",skipTask:"跳过撤销任务",whiteListOptions:"白名单设置",changeWhiteListOption:"设置白名单(%0)",whiteListNotFound:"找不到此项白名单: %0",changeWhiteListSuccess:"白名单修改成功,刷新生效!",changeWebsiteOptions:"网站设置",changeGlobalOptions:"全局设置",ok:"是",save:"保存",close:"关闭",return:"返回",option:"选项",value:"值",websiteOptions:"当前网站设置",changeWebsiteOptionsSuccess:"更改当前网站设置成功,刷新生效!",changeGlobalOptionsSuccess:"更改全局设置成功,刷新生效!",needLogin:"请先登录!",getTasksInfo:"正在获取并处理任务信息...",gettingKey:"正在获取Key...",verifyingTask:"正在验证任务",notice:"自动任务脚本提醒",noKeysLeft:"此页面已经没有剩余key了,是否关闭?",giveawayEnded:"此活动已结束,是否关闭?",giveawayNotWork:"此活动因某些原因(已结束/暂停/未开始...)不可用(如果是脚本误判请及时反馈),是否关闭?",confirm:"确定",cancel:"取消",unKnown:"未知",unKnownTaskType:"未识别的任务",doing:"正在做任务",allTasksComplete:"所有任务已完成!",getTaskIdFailed:"获取任务Id失败!",initSuccess:"%0 初始化成功!",initFailed:"%0 初始化失败!",errorLink:"链接错误: %0",needInit:"请先初始化",verifyingAuth:"正在验证%0凭证...",updatingAuth:"正在更新%0凭证...",initing:"正在初始化...",getFailed:"获取%0失败!",checkLoginFailed:"检测登录状态失败!",checkLeftKeyFailed:"检测剩余Key失败!",userId:"用户Id",joiningGiveaway:"正在加入赠Key",needJoinGiveaway:"需要先加入赠Key",cannotUndo:"此网站不支持取消任务",verifyAuth:"正在验证 %0 凭证...",closePageNotice:"如果此页面没有自动关闭,请自行关闭本页面。",errorReport:"检测到脚本报错,是否前往反馈BUG?",visitingLink:"正在访问链接: ",doTask:"做任务",undoTask:"撤销任务",verifyTask:"验证任务",getKey:"获取Key",selectAll:"全选",selectNone:"全不选",invertSelect:"反选",doFreeTask:"加入免费赠品",doPointTask:"加入点数赠品",skipTaskOption:"设置中已配置跳过任务",other:"其他",globalOptions:"全局设置",checkLogin:"登录检测
    需要登录的网站自动登录,部分本网站支持",checkLeftKey:"剩余Key检测
    赠Key活动结束提示是否关闭,部分本网站支持",twitterVerifyId:"通过尝试关注该账号验证Twitter凭证
    默认为Twitter官方帐号 783214",youtubeVerifyChannel:"通过尝试订阅该频道验证YouTube凭证
    默认为YouTube官方频道 UCrXUsMBcfTVqwAS7DKg9C0Q",autoUpdateSource:"更新源
    github: 需代理,实时更新
    jsdelivr: 可不用代理,更新有延迟
    auto: 首先使用github源更新,失败后尝试用jsdelivr源更新",saveGlobalOptions:"保存全局设置",settingPage:"设置页面",name:"名称",version:"版本",scriptManager:"脚本管理器",script:"脚本",environment:"环境",os:"系统",browser:"浏览器",getId:"获取 %0 id",getTwitterUserId:"获取Twitter用户id(获取id功能仅在设置页面可用)",getYoutubeChannelId:"获取Youtube频道id(获取id功能仅在设置页面可用)",showButton:"显示按钮",hideButton:"隐藏按钮",showLog:"显示日志",hideLog:"隐藏日志",defaultShowButton:"默认显示按钮",defaultShowLog:"默认显示日志",position:"组件位置",buttonSideX:"按钮区域水平方向定位(实时预览功能仅在设置页面可用)
    left: 靠左 | right: 靠右",buttonSideY:"按钮区域垂直方向定位(实时预览功能仅在设置页面可用)
    top: 靠上 | bottom: 靠下",buttonDistance:"按钮区域距边缘的距离(实时预览功能仅在设置页面可用)
    格式: X距离,Y距离",showButtonSideX:"显示按钮水平方向定位(实时预览功能仅在设置页面可用)
    left: 靠左 | right: 靠右",showButtonSideY:"显示按钮垂直方向定位(实时预览功能仅在设置页面可用)
    top: 靠上 | bottom: 靠下",showButtonDistance:"显示按钮距边缘的距离(实时预览功能仅在设置页面可用)
    格式: X距离,Y距离",logSideX:"日志区域水平方向定位(实时预览功能仅在设置页面可用)
    left: 靠左 | right: 靠右",logSideY:"日志区域垂直方向定位(实时预览功能仅在设置页面可用)
    top: 靠上 | bottom: 靠下",logDistance:"日志区域距边缘的距离(实时预览功能仅在设置页面可用)
    格式: X距离,Y距离",hotKey:"快捷键",doTaskKey:"做任务快捷键
    (实时预览功能仅在设置页面可用)",undoTaskKey:"撤销任务快捷键
    (实时预览功能仅在设置页面可用)",toggleLogKey:"显示/隐藏日志快捷键
    (实时预览功能仅在设置页面可用)",tasksHistory:"任务历史",clearHistory:"清空历史",clearHistoryFinished:"已清空任务历史!",deleteTask:"删除任务",lastChangeTime:"最后一次修改时间",clearTaskFinished:"删除以下任务完成!",clearTaskFailed:"删除任务失败,没有找到任务名!",syncData:"数据同步",settingData:"正在上传数据...",gettingData:"正在获取数据...",help:"帮助",fileName:"文件名",upload2gist:"同步到Gist",downloadFromGist:"从Gist同步",saveAndTest:"保存配置并测试",testSuccess:"测试成功!",testFailed:"测试失败!",saveAndTestNotice:"请先保存配置并测试!",processingData:"正在处理数据...",updatingData:"正在上传数据...",syncDataSuccess:"同步数据成功!",syncDataFailed:"同步数据失败,请在控制台查看错误信息!",downloadingData:"正在下载数据...",checkedNoData:"没有检测到远程数据,请确认配置是否正确!",savingData:"正在保存数据...",syncHistory:"同步任务历史",checkUpdateFailed:"检测更新失败",newVersionNotice:'检测到新版本V%0, 点此更新',language:"语言
    目前仅支持zh: 中文, en: 英文",gistOptions:"Gist 设置",swalNotice:"检测到您第一次安装V4版本脚本,请前往阅读用前必读内容!",echoNotice:'检测到您第一次安装V4版本脚本,请点此前往阅读用前必读内容!',noticeLink:"https://auto-task-doc.js.org/guide/#用前必读",toGithub:"前往Github反馈",toKeylol:"前往其乐论坛反馈",copySuccess:"错误信息已复制到剪切板,是否前往其乐论坛反馈?",copyFailed:"请复制下方错误信息后前往Keylol论坛反馈!",groups:"组",wishlists:"愿望单",follows:"游戏关注",forums:"论坛",workshops:"创意工坊收藏",curators:"鉴赏家",workshopVotes:"创意工坊点赞",announcements:"社区通知",steamCommunity:"Steam社区",steamStore:"Steam商店",needLoginSteamStore:'请先登录Steam商店',needLoginSteamCommunity:'请先登录Steam社区',joiningSteamGroup:"正在加入Steam组",leavingSteamGroup:"正在退出Steam组",gettingSteamGroupId:"正在获取Steam组Id",subscribingForum:"正在订阅Steam论坛",unsubscribingForum:"正在取消订阅Steam论坛",gettingForumId:"正在获取Steam论坛Id",followingCurator:"正在关注Steam鉴赏家",unfollowingCurator:"正在取关Steam鉴赏家",addingToWishlist:"正在添加游戏到Steam愿望单",removingFromWishlist:"正在从Steam愿望单移除游戏",followingGame:"正在关注Steam游戏",unfollowingGame:"正在取关Steam游戏",favoritingWorkshop:"正在收藏Steam创意工坊物品",unfavoritingWorkshop:"正在取消收藏Steam创意工坊物品",gettingWorkshopAppId:"正在获取Steam创意工坊物品Id",votingUpWorkshop:"正在点赞Steam创意工坊物品",gettingAnnouncementParams:"正在获取Steam通知信息",likingAnnouncement:"正在点赞Steam通知",changingArea:"正在更换Steam地区: %0...",notNeededChangeArea:"当前地区不需要更换",noAnotherArea:"请检测是否开启正确开启代理",gettingAreaInfo:"正在获取Steam地区信息...",changeAreaNotice:"疑似锁区游戏,尝试换区执行",steamFinishNotice:"Steam任务完成,尝试将购物车地区换回CN",servers:"服务器",joiningDiscordServer:"正在加入Discord服务器",leavingDiscordServer:"正在退出Discord服务器",gettingDiscordGuild:"正在获取Discord服务器Id",users:"用户",loginIns:'请先登录Instagram',insBanned:"您的Instagram账户已被封禁",verifyingInsAuth:"正在验证Instagram凭证...",gettingInsUserId:"正在获取Instagram用户Id",followingIns:"正在关注Instagram用户",unfollowingIns:"正在取关Instagram用户",reddits:"社区/用户",loginReddit:'请先登录Reddit',changingRedditVersion:"正在切换Reddit为新版页面...",joiningReddit:"正在加入Reddit社区",leavingReddit:"正在退出Reddit社区",followingRedditUser:"正在关注Reddit用户",unfollowingRedditUser:"正在取关Reddit用户",channels:"频道",followingTwitchChannel:"正在关注Twitch频道",unfollowingTwitchChannel:"正在取关Twitch频道",gettingTwitchChannelId:"正在获取Twitch频道Id",twitterUser:"推特用户",retweets:"转推",followingTwitterUser:"正在关注推特用户",unfollowingTwitterUser:"正在取关推特用户",retweetting:"正在转推",unretweetting:"正在撤销转推",names:"组/社区/动态",loginVk:'请先登录Vk',gettingVkId:"正在获取Vk任务Id",joiningVkGroup:"正在加入Vk组",leavingVkGroup:"正在退出Vk组",joiningVkPublic:"正在加入Vk社区",leavingVkPublic:"正在退出Vk社区",sendingVkWall:"正在转发Vk动态",deletingVkWall:"正在撤销转发Vk动态",youtubeChannel:"YouTube频道",likes:"点赞",loginYtb:'请先登录YouTube',tryUpdateYtbAuth:'请尝试更新YouTube凭证',gettingYtbToken:"正在获取YouTube Token...",followingYtbChannel:"正在订阅YouTube频道",unfollowingYtbChannel:"正在退订YouTube频道",likingYtbVideo:"正在点赞YouTube视频",unlikingYtbVideo:"正在取消点赞YouTube视频",giveKeyNoticeBefore:"每次验证间隔15s",giveKeyNoticeAfter:'如果没有key, 请在https://givekey.ru/profile查看',noPoints:"点数不够,跳过抽奖",getNeedPointsFailed:"获取所需点数失败,跳过抽奖",joiningLottery:"正在加入抽奖",doingGleamTask:"正在做Gleam任务...",gettingGleamLink:"正在获取Gleam任务链接...",gleamTaskNotice:"如果此页面长时间未关闭,请完成任一任务后自行关闭!",verifiedGleamTasks:"已尝试验证所有任务,验证失败的任务请尝试手动验证或完成!",SweepWidgetNotice:"正在处理并验证任务,每次验证任务有1~3s间隔防止触发验证过快警告..."},en:{website:"Website",type:"Type",edit:"Edit",whiteList:"Whitelist",skipTask:"Skip undo task",whiteListOptions:"Whitelist options",changeWhiteListOption:"Whitelist option(%0)",whiteListNotFound:"Cannot find this whitelist: %0",changeWhiteListSuccess:"The whitelist is successfully modified, and the page refresh will take effect!",changeWebsiteOptions:"Website options",changeGlobalOptions:"Global options",ok:"OK",save:"Save",close:"Close",return:"Return",option:"Option",value:"Value",websiteOptions:"Current website settings",changeWebsiteOptionsSuccess:"The current website setting is changed successfully, and the page refresh will take effect!",changeGlobalOptionsSuccess:"The global setting is changed successfully, and the refresh will take effect!",needLogin:"Please log in first!",getTasksInfo:"Obtaining and processing task information...",gettingKey:"Getting Key...",verifyingTask:"Verifying task",notice:"Automatic task script notice",noKeysLeft:"There are no more keys left on this page. Do you want to close it?",giveawayEnded:"This event has ended, do you want to close it?",giveawayNotWork:"This activity is unavailable for some reasons (ended/suspended/not started...) (if it is a script misjudgment, please give us feedback in time), is it closed?",confirm:"Confirm",cancel:"Cancel",unKnown:"Unknown",unKnownTaskType:"Unrecognized task",doing:"Doing a task",allTasksComplete:"All tasks have been completed!",getTaskIdFailed:"Failed to obtain task Id!",initSuccess:"%0 was initialized successfully!",initFailed:"%0 initialization failed!",errorLink:"Link error: %0",needInit:"Please initialize first",verifyingAuth:"Verifying %0 token...",updatingAuth:"Update %0 token...",initing:"Initializing...",getFailed:"Failed to get %0!",checkLoginFailed:"Failed to detect login status!",checkLeftKeyFailed:"Failed to detect the remaining keys!",userId:"User Id",joiningGiveaway:"Joining giveaway",needJoinGiveaway:"Need to join the giveaway first",cannotUndo:"This website does not support canceling tasks",verifyAuth:"Verifying %0 token...",closePageNotice:"f this page does not close automatically, please close this page yourself.",errorReport:"A script error is detected, do you want to report the BUG?",visitingLink:"Visiting link: ",doTask:"DoTask",undoTask:"UndoTask",verifyTask:"Verify",getKey:"GetKey",selectAll:"SelectAll",selectNone:"SelectNone",invertSelect:"InvertSelect",doFreeTask:"FreeTask",doPointTask:"PointTask",skipTaskOption:"Skip task has been configured in the settings",other:"Other",globalOptions:"Global Options",checkLogin:"Login detection
    Need to log in to the website automatically log in, part of this website supports.",checkLeftKey:"Key remaining detection
    The end of the giveaway event prompts whether to close or not, part of this website supports.",twitterVerifyId:"Verify Twitter token by trying to follow the account.
    The default is the official Twitter account 783214.",youtubeVerifyChannel:"Verify YouTube token by trying to subscribe to the channel.
    The default is the official YouTube channel UCrXUsMBcfTVqwAS7DKg9C0Q.",autoUpdateSource:"The source to update
    github: Fast update.
    jsdelivr: Update is delayed
    auto: First use github source to update, after failure, try to update with jsdelivr source.",saveGlobalOptions:"Save global settings",settingPage:"Setting Page",name:"Name",version:"Version",scriptManager:"Script Manager",script:"Script",environment:"Environment",os:"OS",browser:"Browser",getId:"Get %0 id",getTwitterUserId:"Get Twitter user id (Get id function is only available on the settings page).",getYoutubeChannelId:"Get Youtube channel id (Get id function is only available on the settings page).",showButton:"ShowButton",hideButton:"HideButton",showLog:"ShowLog",hideLog:"HideLog",defaultShowButton:"Default display button",defaultShowLog:"Display log by default",position:"Component position",buttonSideX:"Horizontal positioning of the button area (real-time preview function is only available on the setting page).
    left: left | right: right",buttonSideY:"The button area is positioned in the vertical direction (real-time preview function is only available on the settings page).
    top: top | bottom: bottom",buttonDistance:"The distance between the button area and the edge (the real-time preview function is only available on the setting page).
    Format: X distance, Y distance",showButtonSideX:"ShowButton horizontal positioning (real-time preview function is only available on the setting page).
    left: left | right: right",showButtonSideY:"ShowButton vertical positioning (real-time preview function is only available on the setting page).
    top: top | bottom: bottom",showButtonDistance:"The distance between the ShowButton and the edge (real-time preview function is only available on the setting page).
    Format: X distance, Y distance",logSideX:"Horizontal positioning of the log area (real-time preview function is only available on the setting page).
    left: left | right: right",logSideY:"Vertical positioning of the log area (real-time preview function is only available on the setting page).
    top: top | bottom: bottom",logDistance:"The distance between the log area and the edge (the real-time preview function is only available on the setting page).
    Format: X distance, Y distance",hotKey:"Shortcut key",doTaskKey:"DoTask shortcut keys
    (real-time preview function is only available on the settings page).",undoTaskKey:"UndoTask shortcut keys
    (real-time preview function is only available on the settings page).",toggleLogKey:"ShowLog/HideLog shortcut keys
    (real-time preview function is only available on the settings page).",tasksHistory:"Tasks history",clearHistory:"Clear history",clearHistoryFinished:"The mission history has been cleared!",deleteTask:"Delete task",lastChangeTime:"Last Change Time",clearTaskFinished:"Delete the following tasks completed!",clearTaskFailed:"Failed to delete the task, the task name was not found!",syncData:"Data synchronization",settingData:"Uploading data...",gettingData:"Getting data...",help:"Help",fileName:"Filename",upload2gist:"Sync to Gist",downloadFromGist:"Sync from Gist",saveAndTest:"Save configuration and test",testSuccess:"Test success!",testFailed:"Test failed!",saveAndTestNotice:"Please save the configuration and test first!",processingData:"Processing data...",updatingData:"Uploading data...",syncDataSuccess:"Synchronized data successfully!",syncDataFailed:"Failed to synchronize data, please check the error message on the console!",downloadingData:"Downloading data...",checkedNoData:"No remote data is detected, please confirm whether the configuration is correct!",savingData:"Saving data...",syncHistory:"Synchronize tasks history",checkUpdateFailed:"Check update failed",newVersionNotice:'Checked a new version V%0, click to update',language:"Language
    Currently only supports zh: Chinese, en: English",gistOptions:"Gist Settings",swalNotice:"It is detected that you are installing the V4 version script for the first time, please go to read the READ ME FIRST content before use!",echoNotice:'It is detected that you are installing the V4 version script for the first time, please click here to read the READ ME FIRST content before use!',noticeLink:"https://auto-task-doc.js.org/en/guide/#read-me-first",toGithub:"Feedback(Github)",toKeylol:"Feedback(Keylol)",copySuccess:"The error message has been copied to the clipboard. Do you want to go to the Keylol forum to give feedback?",copyFailed:"Please copy the error information below and report back to the Keylol forum!",groups:"Group",wishlists:"Wishlist",follows:"Follow Game",forums:"Forum",workshops:"Favorite Workshop",curators:"Curator",workshopVotes:"Voteup Workshop",announcements:"Announcement",steamCommunity:"Steam Community",steamStore:"Steam Store",needLoginSteamStore:'Please log in to the Steam Store',needLoginSteamCommunity:'Please log in to the Steam Community',joiningSteamGroup:"Joining Steam Group",leavingSteamGroup:"Leaving Steam Group",gettingSteamGroupId:"Getting Steam Group Id",subscribingForum:"Subscribing the Steam Forum",unsubscribingForum:"Unsubscribing the Steam Forum",gettingForumId:"Getting Steam Forum Id",followingCurator:"Following Steam Curator",unfollowingCurator:"Unfollowing Steam Curator",addingToWishlist:"Adding the game to the Steam wishlist",removingFromWishlist:"Removing the game from the Steam wishlist",followingGame:"Following Steam games",unfollowingGame:"Unfollowing Steam games",favoritingWorkshop:"Favouring Steam Workshop Items",unfavoritingWorkshop:"Unfavoriting Steam Workshop Items",gettingWorkshopAppId:"Getting Steam Workshop Item Id",votingUpWorkshop:"Liking Steam workshop items",gettingAnnouncementParams:"Getting Steam announcement information",likingAnnouncement:"Liking Steam announcement",changingArea:"Changing Steam area: %0...",notNeededChangeArea:"The current area does not need to be changed",noAnotherArea:"Please check whether the proxy is turned on correctly",gettingAreaInfo:"Getting Steam area information...",changeAreaNotice:"Suspected of a locked zone game, try to change the zone to execute",steamFinishNotice:"Steam task completed, try to change the shopping cart area back to CN",servers:"Server",joiningDiscordServer:"Joining Discord Server",leavingDiscordServer:"Leaving Discord Server",gettingDiscordGuild:"Getting Discord server Id",users:"User",loginIns:'Please log in to Instagram',insBanned:"Your Instagram account has been banned",verifyingInsAuth:"Verifying Instagram token...",gettingInsUserId:"Getting Instagram user Id",followingIns:"Following Instagram user",unfollowingIns:"Unfollowing Instagram user",reddits:"Reddit/User",loginReddit:'Please log in to Reddit',changingRedditVersion:"Switching Reddit to a new version page...",joiningReddit:"Joining the Reddit",leavingReddit:"Leaving the Reddit",followingRedditUser:"Following Reddit User",unfollowingRedditUser:"Unfollowing Reddit User",channels:"Channel",followingTwitchChannel:"Following Twitch Channel",unfollowingTwitchChannel:"Unfollowing Twitch Channel",gettingTwitchChannelId:"Getting Twitch Channel Id",twitterUser:"Twitter User",retweets:"Retweet",followingTwitterUser:"Following Twitter User",unfollowingTwitterUser:"Unfollowing Twitter User",retweetting:"Retweeting",unretweetting:"Unretweeting",names:"Group/Public/Wall",loginVk:'Please log in to Vk',gettingVkId:"Getting Vk task Id",joiningVkGroup:"Joining Vk Group",leavingVkGroup:"Leaving Vk Group",joiningVkPublic:"Joining Vk Public",leavingVkPublic:"Leaving Vk Public",sendingVkWall:"Sending Vk Wall",deletingVkWall:"Deleting Vk Wall",youtubeChannel:"YouTube Channel",likes:"Like",loginYtb:'Please log in to YouTube',tryUpdateYtbAuth:'Please try to update YouTube token',gettingYtbToken:"Getting YouTube Token...",followingYtbChannel:"Subscribing to YouTube channel",unfollowingYtbChannel:"Unsubscribing to YouTube channel",likingYtbVideo:"Liking YouTube video",unlikingYtbVideo:"Unliking YouTube video",giveKeyNoticeBefore:"Each verification interval is 15s",giveKeyNoticeAfter:'If there is no key, please check at https://givekey.ru/profile',noPoints:"Not enough points, skip the lottery",getNeedPointsFailed:"ailed to obtain the required points, skip the lottery",joiningLottery:"Joining the lottery",doingGleamTask:"Doing Gleam Task...",gettingGleamLink:"Getting Gleam task link...",gleamTaskNotice:"If this page has not been closed for a long time, please close it yourself after completing any task!",verifiedGleamTasks:"Attempted to verify all tasks. If the verification fails, please try to verify manually or complete it!",SweepWidgetNotice:"The task is being processed and verified. There is an interval of 1~3s for each verification task to prevent the triggering of too fast verification warning..."}},h=["zh","en"].includes(A.other.language)?A.other.language:"en";const E=function(t){for(var e,s=arguments.length,i=new Array(1i[parseInt(e,10)]):t};t=class{constructor(){var t,e,s;s=void 0,(e="tasks")in(t=this)?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s}getRealParams(e,s,i,n){try{let t=[];return 0n(t)).filter(t=>t)]),!i&&0{const t=GM_openInTab("https://discord.com/channels/@me#auth",{active:!0,insert:!0,setParent:!0});t.onclose=async()=>{var t=null===(t=GM_getValue("discordAuth"))||void 0===t?void 0:t.auth;t?(p(this,k,{auth:t}),s.success(),e(await w(this,T,U).call(this))):(s.error("Error: Update discord auth failed!"),e(!1))}})}catch(t){return _(t,"Discord.updateAuth"),!1}}async function D(t){try{const l=V({type:"joiningDiscordServer",text:t});var e,s,{result:i,statusText:n,status:o,data:a}=await I({url:"https://discord.com/api/v6/invites/"+t,method:"POST",dataType:"json",headers:{authorization:f(this,k).auth}});if("Success"!==i||200!==(null==a?void 0:a.status))return l.error(i+`:${n}(${o})`),!1;l.success();var r=String(null===(e=a.response)||void 0===e||null===(s=e.guild)||void 0===s?void 0:s.id);return r&&(w(this,W,N).call(this,t,r),this.tasks.servers=L([...this.tasks.servers,t])),!0}catch(t){return _(t,"Discord.joinServer"),!1}}async function F(t){try{if(this.whiteList.servers.includes(t))return V({type:"whiteList",text:"Discord.leaveServer",id:t}),!0;var e=await w(this,P,j).call(this,t);if(!e)return!1;const a=V({type:"leavingDiscordServer",text:e});var{result:s,statusText:i,status:n,data:o}=await I({url:"https://discord.com/api/v6/users/@me/guilds/"+e,method:"DELETE",headers:{authorization:f(this,k).auth}});return"Success"===s&&204===(null==o?void 0:o.status)?(a.success(),!0):(a.error(s+`:${i}(${n})`),!1)}catch(t){return _(t,"Discord.leaveServer"),!1}}async function j(t){try{const n=V({type:"gettingDiscordGuild",text:t});var e=f(this,y)[t];if(e)return n.success(),e;const{result:o,statusText:a,status:r,data:l}=await I({url:"https://discord.com/invite/"+t,method:"GET"});if("Success"!==o||200!==(null===l||void 0===l?void 0:l.status))return n.error(o+`:${a}(${r})`),!1;var s,i=null===(s=l.responseText.match(/https?:\/\/cdn\.discordapp\.com\/icons\/([\d]+?)\//))||void 0===s?void 0:s[1];return i?(n.success(),w(this,W,N).call(this,t,i),i):(n.error(o+`:${a}(${r})`),!1)}catch(t){return _(t,"Discord.getGuild"),!1}}function N(t,e){try{f(this,y)[t]=e,GM_setValue("discordCache",f(this,y))}catch(t){_(t,"Discord.setCache")}}const M=class extends t{constructor(){var t;super(...arguments),e(this,W),e(this,P),e(this,G),e(this,x),e(this,S),e(this,T),g(this,"tasks",{...v}),g(this,"whiteList",(null===(t=GM_getValue("whiteList"))||void 0===t?void 0:t.discord)||{...v}),s(this,k,{writable:!0,value:GM_getValue("discordAuth")||{}}),s(this,y,{writable:!0,value:GM_getValue("discordCache")||{}}),s(this,b,{writable:!0,value:!1})}async init(){try{return f(this,b)?!0:f(this,k).auth?await w(this,T,U).call(this)?(V({}).success(E("initSuccess","Discord")),p(this,b,!0),!0):(GM_setValue("discordAuth",{auth:null}),await w(this,S,O).call(this)?(V({}).success(E("initSuccess","Discord")),p(this,b,!0),!0):(V({}).error(E("initFailed","Discord")),!1)):!!await w(this,S,O).call(this)&&(p(this,b,!0),!0)}catch(t){return _(t,"Discord.init"),!1}}async toggle(t){var{doTask:e=!0,serverLinks:t=[]}=t;try{if(!f(this,b))return V({text:E("needInit")}),!1;const i=[];if(e&&!A.doTask.discord.servers||!e&&!A.undoTask.discord.servers)V({type:"globalOptionsSkip",text:"discord.servers"});else{var s=this.getRealParams("servers",t,e,t=>{return null===(t=t.match(/invite\/(.+)/))||void 0===t?void 0:t[1]});if(0!0)}catch(t){return _(t,"Discord.toggleServers"),!1}}};function R(t,e){K(t,e),e.add(t)}function Y(t,e,s){K(t,e),e.set(t,s)}function K(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function z(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function B(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,J(t,e,"set"),s),s}function q(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function H(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,J(t,e,"get"))}function J(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const X={users:[]};var Q=new WeakMap,Z=new WeakMap,tt=new WeakMap,et=new WeakSet,st=new WeakSet,it=new WeakSet,nt=new WeakSet;async function ot(){var t=0{return null===(t=t.match(/https:\/\/www\.instagram\.com\/(.+)?\//))||void 0===t?void 0:t[1]});if(0!0)}catch(t){return _(t,"Instagram.toggleUsers"),!1}}};function ct(t,e){ht(t,e),e.add(t)}function dt(t,e,s){ht(t,e),e.set(t,s)}function ht(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function gt(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function pt(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,mt(t,e,"set"),s),s}function wt(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function ft(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,mt(t,e,"get"))}function mt(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const vt={reddits:[]};var kt=new WeakMap,yt=new WeakMap,bt=new WeakSet,Tt=new WeakSet;async function St(){try{const s=V({text:E("changingRedditVersion")});return GM_setValue("redditAuth",null),await new Promise(t=>{const e=GM_openInTab("https://www.reddit.com/#auth",{active:!0,insert:!0,setParent:!0});e.onclose=async()=>{s.success(),t(await wt(this,Tt,xt).call(this,!0))}})}catch(t){return _(t,"Reddit.useBeta"),!1}}async function xt(){var t,e=0{var e=null===(e=t.match(/https?:\/\/www\.reddit\.com\/r\/([^/]*)/))||void 0===e?void 0:e[1],t=null===(t=t.match(/https?:\/\/www\.reddit\.com\/user\/([^/]*)/))||void 0===t?void 0:t[1];return t?e||t:e});if(0!0)}catch(t){return _(t,"Reddit.toggle"),!1}}};function It(t,e){Gt(t,e),e.add(t)}function Lt(t,e,s){Gt(t,e),e.set(t,s)}function Gt(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _t(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Ct(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,Et(t,e,"set"),s),s}function Vt(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function At(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,Et(t,e,"get"))}function Et(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const Pt={channels:[]};var Wt=new WeakMap,Ut=new WeakMap,Ot=new WeakMap,Dt=new WeakSet,Ft=new WeakSet,jt=new WeakSet,Nt=new WeakSet,Mt=new WeakSet;async function Rt(){try{const r=V({text:E("verifyingAuth","Twitch")});var t,e,s,{result:i,statusText:n,status:o,data:a}=await I({url:"https://gql.twitch.tv/gql",method:"POST",dataType:"json",headers:{Authorization:"OAuth "+At(this,Wt).authToken,"Client-Id":At(this,Wt).clientId},data:'[{"operationName":"FrontPageNew_User","variables":{"limit":1},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"64bd07a2cbaca80699d62636d966cf6395a5d14a1f0a14282067dcb28b13eb11"}}}]'});return"Success"===i?200===(null==a?void 0:a.status)&&null!==(t=a.response)&&void 0!==t&&null!==(e=t[0])&&void 0!==e&&null!==(s=e.data)&&void 0!==s&&s.currentUser?(r.success(),!0):(r.error(`Error:${null==a?void 0:a.statusText}(${null==a?void 0:a.status})`),!1):(r.error(i+`:${n}(${o})`),!1)}catch(t){return _(t,"Twitch.verifyAuth"),!1}}async function Yt(){try{const s=V({text:E("updatingAuth","Twitch")});return await new Promise(e=>{const t=GM_openInTab("https://www.twitch.tv/#auth",{active:!0,insert:!0,setParent:!0});t.onclose=async()=>{var t=GM_getValue("twitchAuth");t?(Ct(this,Wt,t),s.success(),e(await Vt(this,Dt,Rt).call(this))):(s.error("Error: Update twitch auth failed!"),e(!1))}})}catch(t){return _(t,"Twitch.updateAuth"),!1}}async function Kt(t){var{name:e,doTask:t=!0}=t;try{if(!t&&this.whiteList.channels.includes(e))return V({type:"whiteList",text:"Twitch.unfollowChannel",id:e}),!0;var s=await Vt(this,Nt,zt).call(this,e);if(!s)return!1;const u=V({type:`${t?"":"un"}followingTwitchChannel`,text:e});var i='[{"operationName":"FollowButton_FollowUser","variables":{"input":{"disableNotifications":false,"targetID":"'+s+'"}},"extensions":{"persistedQuery":{"version":1,"sha256Hash":"3efee1acda90efdff9fef6e6b4a29213be3ee490781c5b54469717b6131ffdfe"}}}]',n=`[{"operationName":"FollowButton_UnfollowUser","variables":{"input":{"targetID":"${s}"}},`+'"extensions":{"persistedQuery":{"version":1,"sha256Hash":"d7fbdb4e9780dcdc0cc1618ec783309471cd05a59584fc3c56ea1c52bb632d41"}}}]',{result:o,statusText:a,status:r,data:l}=await I({url:"https://gql.twitch.tv/gql",method:"POST",dataType:"json",headers:{Authorization:"OAuth "+At(this,Wt).authToken},data:t?i:n});return"Success"===o?200===(null==l?void 0:l.status)?(u.success(),t&&(this.tasks.channels=L([...this.tasks.channels,e])),!0):(u.error(`Error:${null==l?void 0:l.statusText}(${null==l?void 0:l.status})`),!1):(u.error(o+`:${a}(${r})`),!1)}catch(t){return _(t,"Twitch.toggleChannel"),!1}}async function zt(t){try{const d=V({type:"gettingTwitchChannelId",text:t});var e=At(this,Ut)[t];if(e)return d.success(),e;var{result:s,statusText:i,status:n,data:o}=await I({url:"https://gql.twitch.tv/gql",method:"POST",headers:{Authorization:"OAuth "+At(this,Wt).authToken,"Client-Id":At(this,Wt).clientId},responseType:"json",data:`[{"operationName":"ActiveWatchParty","variables":{"channelLogin":"${t}"},`+'"extensions":{"persistedQuery":{"version":1,"sha256Hash":"4a8156c97b19e3a36e081cf6d6ddb5dbf9f9b02ae60e4d2ff26ed70aebc80a30"}}}]'});if("Success"!==s)return d.error(s+`:${i}(${n})`),!1;if(200!==(null==o?void 0:o.status))return d.error(`Error:${null==o?void 0:o.statusText}(${null==o?void 0:o.status})`),!1;var a,r,l,u,c=String(null===(a=o.response)||void 0===a||null===(r=a[0])||void 0===r||null===(l=r.data)||void 0===l||null===(u=l.user)||void 0===u?void 0:u.id);return c?(Vt(this,Mt,Bt).call(this,t,c),d.success(),c):(d.error(`Error:${o.statusText}(${o.status})`),!1)}catch(t){return _(t,"Twitch.getChannelId"),!1}}function Bt(t,e){try{At(this,Ut)[t]=e,GM_setValue("twitchCache",At(this,Ut))}catch(t){_(t,"Twitch.setCache")}}const qt=class extends t{constructor(){var t;super(...arguments),It(this,Mt),It(this,Nt),It(this,jt),It(this,Ft),It(this,Dt),_t(this,"tasks",{...Pt}),_t(this,"whiteList",(null===(t=GM_getValue("whiteList"))||void 0===t?void 0:t.twitch)||{...Pt}),Lt(this,Wt,{writable:!0,value:GM_getValue("twitchAuth")||{}}),Lt(this,Ut,{writable:!0,value:GM_getValue("twitchCache")||{}}),Lt(this,Ot,{writable:!0,value:!1})}async init(){try{return At(this,Ot)?!0:At(this,Wt).authToken?await Vt(this,Dt,Rt).call(this)?(V({}).success(E("initSuccess","Twitch")),Ct(this,Ot,!0),!0):(GM_setValue("twitchAuth",null),await Vt(this,Ft,Yt).call(this)?(V({}).success(E("initSuccess","Twitch")),Ct(this,Ot,!0),!0):(V({}).error(E("initFailed","Twitch")),!1)):!!await Vt(this,Ft,Yt).call(this)&&(Ct(this,Ot,!0),!0)}catch(t){return _(t,"Twitch.init"),!1}}async toggle(t){var{doTask:e=!0,channelLinks:t=[]}=t;try{if(!At(this,Ot))return V({text:E("needInit")}),!1;const i=[];if(e&&!A.doTask.twitch.channels||!e&&!A.undoTask.twitch.channels)V({type:"globalOptionsSkip",text:"twitch.channels"});else{var s=this.getRealParams("channels",t,e,t=>{return null===(t=t.match(/https:\/\/(www\.)?twitch\.tv\/(.+)/))||void 0===t?void 0:t[2]});if(0!0)}catch(t){return _(t,"Twitch.toggle"),!1}}};function Ht(t,e){Xt(t,e),e.add(t)}function Jt(t,e,s){Xt(t,e),e.set(t,s)}function Xt(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Qt(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Zt(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,se(t,e,"set"),s),s}function te(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function ee(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,se(t,e,"get"))}function se(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const ie={names:[]};var ne=new WeakMap,oe=new WeakMap,ae=new WeakMap,re=new WeakSet,le=new WeakSet,ue=new WeakSet,ce=new WeakSet,de=new WeakSet,he=new WeakSet,ge=new WeakSet,pe=new WeakSet;async function we(){try{const e=V({text:E("verifyAuth","Vk")}),{result:s,statusText:i,status:n,data:o}=await I({url:"https://vk.com/im",method:"GET"});var t;return"Success"===s?null!==o&&void 0!==o&&o.finalUrl.includes("vk.com/login")?(e.error("Error:"+E("loginVk"),!0),!1):200===(null===o||void 0===o?void 0:o.status)?(Zt(this,ne,(null===(t=o.responseText.match(/TopNavBtn__profileLink" href="\/(.*?)"/))||void 0===t?void 0:t[1])||""),e.success(),!0):(e.error(`Error:${null===o||void 0===o?void 0:o.statusText}(${null===o||void 0===o?void 0:o.status})`),!1):(e.error(s+`:${i}(${n})`),!1)}catch(t){return _(t,"Vk.verifyAuth"),!1}}async function fe(t,e){var s=!(2{return null===(t=t.match(/https:\/\/vk\.com\/([^/]+)/))||void 0===t?void 0:t[1]});if(0!0)}catch(t){return _(t,"Vk.toggle"),!1}}};function xe(t,e){Ie(t,e),e.add(t)}function $e(t,e,s){Ie(t,e),e.set(t,s)}function Ie(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Le(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Ge(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,Ve(t,e,"set"),s),s}function _e(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function Ce(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,Ve(t,e,"get"))}function Ve(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const Ae={channels:[],likes:[]},Ee=async function(t,e){try{const h=V({text:E("gettingYtbToken")}),{result:g,statusText:p,status:w,data:f}=await I({url:t,method:"GET"});if("Success"!==g)return h.error(g+`:${p}(${w})`),{};if(200!==(null===f||void 0===f?void 0:f.status))return h.error(`Error:${null===f||void 0===f?void 0:f.statusText}(${null===f||void 0===f?void 0:f.status})`),{};{var s,i;if(f.responseText.includes("accounts.google.com/ServiceLogin?service=youtube"))return h.error("Error:"+E("loginYtb"),!0),{needLogin:!0};var n=null===(s=f.responseText.match(/"INNERTUBE_API_KEY":"(.*?)"/))||void 0===s?void 0:s[1],o=(null===(i=f.responseText.match(/\(\{"INNERTUBE_CONTEXT":([\w\W]*?)\}\)/)||f.responseText.match(/"INNERTUBE_CONTEXT":([\w\W]*?\}),"INNERTUBE/))||void 0===i?void 0:i[1])||"{}";const{client:m,request:v}=JSON.parse(o);if(n&&m&&v){if(m.hl="en","channel"===e){var a,r=null===(a=f.responseText.match(//))||void 0===a?void 0:a[1];return r?(h.success(),{params:{apiKey:n,client:m,request:v,channelId:r}}):(h.error('Error: Get "channelId" failed!'),{})}if("likeVideo"!==e)return h.error("Error: Unknown type"),{};var l,u,c=null===(l=f.responseText.match(//))||void 0===l?void 0:l[1],d=null===(u=f.responseText.match(/"likeParams":"(.*?)"/))||void 0===u?void 0:u[1];return c?(h.success(),{params:{apiKey:n,client:m,request:v,videoId:c,likeParams:d}}):(h.error('Error: Get "videoId" failed!'),{})}return h.error('Error: Parameter "apiKey" not found!'),{}}}catch(t){return _(t,"Youtube.getInfo"),{}}};var Pe=new WeakMap,We=new WeakMap,Ue=new WeakMap,Oe=new WeakSet,De=new WeakSet,Fe=new WeakSet,je=new WeakSet,Ne=new WeakSet;class Me extends t{constructor(){var t;super(...arguments),xe(this,Ne),xe(this,je),xe(this,Fe),xe(this,De),xe(this,Oe),Le(this,"tasks",{...Ae}),Le(this,"whiteList",(null===(t=GM_getValue("whiteList"))||void 0===t?void 0:t.youtube)||{...Ae}),$e(this,Pe,{writable:!0,value:GM_getValue("youtubeAuth")||{}}),$e(this,We,{writable:!0,value:!1}),$e(this,Ue,{writable:!0,value:"https://www.youtube.com/channel/"+A.other.youtubeVerifyChannel})}async init(){try{return Ce(this,We)?!0:Ce(this,Pe).PAPISID?await _e(this,Oe,Re).call(this)?(V({}).success(E("initSuccess","Youtube")),Ge(this,We,!0),!0):(GM_setValue("youtubeAuth",null),await _e(this,De,Ye).call(this)?(V({}).success(E("initSuccess","Youtube")),Ge(this,We,!0),!0):(V({}).error(E("initFailed","Youtube")),!1)):!!await _e(this,De,Ye).call(this)&&(Ge(this,We,!0),!0)}catch(t){return _(t,"Youtube.init"),!1}}async toggle(t){var{doTask:e=!0,channelLinks:s=[],videoLinks:t=[]}=t;try{if(!Ce(this,We))return V({text:E("needInit")}),!1;const o=[];if(e&&!A.doTask.youtube.channels||!e&&!A.undoTask.youtube.channels)V({type:"globalOptionsSkip",text:"youtube.channels"});else{var i=this.getRealParams("channels",s,e,t=>{var e;return/^https:\/\/(www\.)?google\.com.*?\/url\?.*?url=https:\/\/www\.youtube\.com\/.*/.test(t)?null===(e=t.match(/url=(https:\/\/www\.youtube\.com\/.*)/))||void 0===e?void 0:e[1]:t});if(0{var e;return/^https:\/\/(www\.)?google\.com.*?\/url\?.*?url=https:\/\/www\.youtube\.com\/.*/.test(t)?null===(e=t.match(/url=(https:\/\/www\.youtube\.com\/.*)/))||void 0===e?void 0:e[1]:t});if(0!0)}catch(t){return _(t,"Youtube.toggle"),!1}}}async function Re(){try{return await _e(this,je,ze).call(this,{link:Ce(this,Ue),doTask:!0,verify:!0})}catch(t){return _(t,"Youtube.verifyAuth"),!1}}async function Ye(){try{const s=V({text:E("updatingAuth","Youtube")});return await new Promise(e=>{const t=GM_openInTab("https://www.youtube.com/#auth",{active:!0,insert:!0,setParent:!0});t.onclose=async()=>{var t=GM_getValue("youtubeAuth");t?(Ge(this,Pe,t),s.success(),_e(this,Oe,Re).call(this).then(t=>{e(t)})):(s.error("Error: Update youtube auth failed!"),e(!1))}})}catch(t){return _(t,"Discord.updateAuth"),!1}}function Ke(t,e){return Ee(t,e)}async function ze(t){var{link:e,doTask:s=!0,verify:t=!1}=t;try{var{params:i,needLogin:n}=await _e(this,Fe,Ke).call(this,e,"channel"),{apiKey:o,client:a,request:r,channelId:l}=i||{};if(n)return V({html:E("loginYtb")}),!1;if(!(o&&a&&r&&l))return V({text:'"getYtbToken" failed'}),!1;if(!s&&!t&&this.whiteList.channels.includes(l))return V({type:"whiteList",text:"Youtube.unfollowChannel",id:l}),!0;const c=t?V({text:E("verifyingAuth","Youtube")}):V({type:s?"followingYtbChannel":"unfollowingYtbChannel",text:l});var u=parseInt(String((new Date).getTime()/1e3),10);const{result:d,statusText:h,status:g,data:p}=await I({url:`https://www.youtube.com/youtubei/v1/subscription/${s?"":"un"}subscribe?key=`+o,method:"POST",headers:{origin:"https://www.youtube.com",referer:"https://www.youtube.com/channel/"+l,"content-type":"application/json","x-goog-authuser":"0","x-goog-visitor-id":null==a?void 0:a.visitorData,"x-origin":"https://www.youtube.com",authorization:`SAPISIDHASH ${u}_`+sha1(`${u} ${Ce(this,Pe).PAPISID} https://www.youtube.com`)},data:JSON.stringify({context:{client:a,request:{sessionId:null==r?void 0:r.sessionId,internalExperimentFlags:[],consistencyTokenJars:[]},user:{}},channelIds:[l],params:s?"EgIIAhgA":"CgIIAhgA"})});return"Success"===d?200===(null===p||void 0===p?void 0:p.status)?s&&(/"subscribed": true/.test(p.responseText)||p.responseText.includes("The subscription already exists"))||!s&&/"subscribed": false/.test(p.responseText)?(c.success(),s&&!t&&(this.tasks.channels=L([...this.tasks.channels,e])),!0):(c.error(E("tryUpdateYtbAuth"),!0),!1):(c.error(`Error:${null===p||void 0===p?void 0:p.statusText}(${null===p||void 0===p?void 0:p.status})`),!1):(c.error(d+`:${h}(${g})`),!1)}catch(t){return _(t,"Youtube.toggleChannel"),!1}}async function Be(t){var{link:e,doTask:t=!0}=t;try{var{params:s,needLogin:i}=await _e(this,Fe,Ke).call(this,e,"likeVideo"),{apiKey:n,client:o,request:a,videoId:r,likeParams:l}=s||{};if(i)return V({html:""+E("loginYtb")}),!1;if(!(n&&o&&a&&r&&l))return V({text:'"getYtbToken" failed'}),!1;if(!t&&this.whiteList.likes.includes(r))return V({type:"whiteList",text:"Youtube.unlikeVideo",id:r}),!0;const c=V({type:t?"likingYtbVideo":"unlikingYtbVideo",text:r});var u=parseInt(String((new Date).getTime()/1e3),10);const d={context:{client:o,request:{sessionId:a.sessionId,internalExperimentFlags:[],consistencyTokenJars:[]},user:{}},target:{videoId:r}};if(t){if(!l)return c.error("Empty likeParams"),!1;d.params=l}const{result:h,statusText:g,status:p,data:w}=await I({url:`https://www.youtube.com/youtubei/v1/like/${t?"":"remove"}like?key=`+n,method:"POST",headers:{origin:"https://www.youtube.com",referer:"https://www.youtube.com/watch?v="+r,"content-type":"application/json","x-goog-authuser":"0","x-goog-visitor-id":o.visitorData,"x-origin":"https://www.youtube.com",authorization:`SAPISIDHASH ${u}_`+sha1(`${u} ${Ce(this,Pe).PAPISID} https://www.youtube.com`)},data:JSON.stringify(d)});return"Success"===h?200===(null===w||void 0===w?void 0:w.status)?t&&w.responseText.includes("Added to Liked videos")||!t&&(w.responseText.includes("Removed from Liked videos")||w.responseText.includes("Dislike removed"))?(c.success(),t&&(this.tasks.likes=L([...this.tasks.likes,e])),!0):(c.error(E("tryUpdateYtbAuth"),!0),!1):(c.error(`Error:${null===w||void 0===w?void 0:w.statusText}(${null===w||void 0===w?void 0:w.status})`),!1):(c.error(h+`:${g}(${p})`),!1)}catch(t){return _(t,"Youtube.toggleLikeVideo"),!1}}function qe(t,e){Je(t,e),e.add(t)}function He(t,e,s){Je(t,e),e.set(t,s)}function Je(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Xe(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Qe(t,e,s){return function(t,e,s){if(e.set)e.set.call(t,s);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=s}}(t,es(t,e,"set"),s),s}function Ze(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}function ts(t,e){return function(t,e){if(e.get)return e.get.call(t);return e.value}(t,es(t,e,"get"))}function es(t,e,s){if(!e.has(t))throw new TypeError("attempted to "+s+" private field on non-instance");return e.get(t)}const ss={groups:[],wishlists:[],follows:[],forums:[],workshops:[],workshopVotes:[],curators:[],curatorLikes:[],announcements:[]};var is=new WeakMap,ns=new WeakMap,os=new WeakMap,as=new WeakMap,rs=new WeakSet,ls=new WeakSet,us=new WeakSet,cs=new WeakSet,ds=new WeakSet,hs=new WeakSet,gs=new WeakSet,ps=new WeakSet,ws=new WeakSet,fs=new WeakSet,ms=new WeakSet,vs=new WeakSet,ks=new WeakSet,ys=new WeakSet,bs=new WeakSet,Ts=new WeakSet,Ss=new WeakSet,xs=new WeakSet,$s=new WeakSet,Is=new WeakSet,Ls=new WeakSet;async function Gs(){try{const s=V({text:E("updatingAuth",E("steamStore"))}),{result:i,statusText:n,status:o,data:a}=await I({url:"https://store.steampowered.com/stats/",method:"GET"});if("Success"!==i)return s.error(i+`:${n}(${o})`),!1;if(200!==(null===a||void 0===a?void 0:a.status))return s.error(`Error:${null===a||void 0===a?void 0:a.statusText}(${null===a||void 0===a?void 0:a.status})`),!1;var t;if(a.responseText.includes('href="https://store.steampowered.com/login/'))return s.error("Error:"+E("needLoginSteamStore"),!0),!1;var e=null===(t=a.responseText.match(/g_sessionID = "(.+?)";/))||void 0===t?void 0:t[1];return e?(ts(this,ns).storeSessionID=e,s.success(),!0):(s.error('Error: Get "sessionID" failed'),!1)}catch(t){return _(t,"Steam.updateStoreAuth"),!1}}async function _s(){try{const a=V({text:E("updatingAuth",E("steamCommunity"))}),{result:r,statusText:l,status:u,data:c}=await I({url:"https://steamcommunity.com/my",method:"GET"});if("Success"!==r)return a.error(r+`:${l}(${u})`),!1;if(200!==(null===c||void 0===c?void 0:c.status))return a.error(`Error:${null===c||void 0===c?void 0:c.statusText}(${null===c||void 0===c?void 0:c.status})`),!1;var t,e,s;if(c.responseText.includes('href="https://steamcommunity.com/login/home/'))return a.error("Error:"+E("needLoginSteamCommunity"),!0),!1;var i=null===(t=c.responseText.match(/g_steamID = "(.+?)";/))||void 0===t?void 0:t[1],n=null===(e=c.responseText.match(/g_sessionID = "(.+?)";/))||void 0===e?void 0:e[1],o=null===(s=c.responseText.match(/steamcommunity.com\/id\/(.+?)\/friends\//))||void 0===s?void 0:s[1];return(i&&(ts(this,ns).steam64Id=i),o&&(ts(this,ns).userName=o),n)?(ts(this,ns).communitySessionID=n,a.success(),!0):(a.error('Error: Get "sessionID" failed'),!1)}catch(t){return _(t,"Steam.updateCommunityAuth"),!1}}async function Cs(){try{const i=V({text:E("gettingAreaInfo")}),{result:n,statusText:o,status:a,data:r}=await I({url:"https://store.steampowered.com/cart/",method:"GET"});if("Success"!==n)return i.error(n+`:${o}(${a})`),{};if(200!==(null===r||void 0===r?void 0:r.status))return i.error(`Error:${null===r||void 0===r?void 0:r.statusText}(${null===r||void 0===r?void 0:r.status})`),{};var t,e=null===(t=r.responseText.match(//g)].map(t=>t[1]);return e&&0t&&"CN"!==t);if(!s||0===s.length)return V({text:"noAnotherArea"}),!1;[t]=s}const l=V({text:E("changingArea",t)});var{result:i,statusText:n,status:o,data:a}=await I({url:"https://store.steampowered.com/account/setcountry",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({cc:t,sessionid:ts(this,ns).storeSessionID})});if("Success"!==i)return l.error(i+`:${n}(${o})`),"CN";if(200!==(null==a?void 0:a.status)||"true"!==a.responseText)return l.error(`Error:${null==a?void 0:a.statusText}(${null==a?void 0:a.status})`),"CN";var r=(await Ze(this,us,Cs).call(this))["currentArea"];return r===t?(l.success(),r):(l.error("Error: change country filed"),"CN")}catch(t){return _(t,"Steam.changeArea"),!1}}async function As(t){try{const e=V({type:"joiningSteamGroup",text:t}),{result:s,statusText:i,status:n,data:o}=await I({url:"https://steamcommunity.com/groups/"+t,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({action:"join",sessionID:ts(this,ns).communitySessionID})});return"Success"===s?200!==(null===o||void 0===o?void 0:o.status)||o.responseText.includes("grouppage_join_area")?(e.error(`Error:${null===o||void 0===o?void 0:o.statusText}(${null===o||void 0===o?void 0:o.status})`),!1):(e.success(),this.tasks.groups=L([...this.tasks.groups,t]),!0):(e.error(s+`:${i}(${n})`),!1)}catch(t){return _(t,"Steam.joinGroup"),!1}}async function Es(t){try{if(this.whiteList.groups.includes(t))return V({type:"whiteList",text:"Steam.leaveGroup",id:t}),!0;var e=await Ze(this,gs,Ps).call(this,t);if(!e)return!1;const s=V({type:"leavingSteamGroup",text:t}),{result:i,statusText:n,status:o,data:a}=await I({url:`https://steamcommunity.com/id/${ts(this,ns).userName}/home_process`,method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionID:ts(this,ns).communitySessionID,action:"leaveGroup",groupId:e})});return"Success"===i?200===(null===a||void 0===a?void 0:a.status)&&a.finalUrl.includes("groups")&&0===$(a.responseText.replace(//g,"").toLowerCase()).find(`a[href='https://steamcommunity.com/groups/${t.toLowerCase()}']`).length?(s.success(),!0):(s.error(`Error:${null===a||void 0===a?void 0:a.statusText}(${null===a||void 0===a?void 0:a.status})`),!1):(s.error(i+`:${n}(${o})`),!1)}catch(t){return _(t,"Steam.leaveGroup"),!1}}async function Ps(t){try{const n=V({type:"gettingSteamGroupId",text:t});var e=ts(this,is).group[t];if(e)return n.success(),e;const{result:o,statusText:a,status:r,data:l}=await I({url:"https://steamcommunity.com/groups/"+t,method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"}});if("Success"!==o)return n.error(o+`:${a}(${r})`),!1;if(200!==(null===l||void 0===l?void 0:l.status))return n.error(`Error:${null===l||void 0===l?void 0:l.statusText}(${null===l||void 0===l?void 0:l.status})`),!1;var s,i=null===(s=l.responseText.match(/OpenGroupChat\( '([0-9]+)'/))||void 0===s?void 0:s[1];return i?(Ze(this,Ls,qs).call(this,"group",t,i),n.success(),i):(n.error(`Error:${l.statusText}(${l.status})`),!1)}catch(t){return _(t,"Steam.getGroupID"),!1}}async function Ws(t){try{var e;const n=V({type:"addingToWishlist",text:t});var{result:s,data:i}=await I({url:"https://store.steampowered.com/api/addtowishlist",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionid:ts(this,ns).storeSessionID,appid:t}),dataType:"json"});if("Success"===s&&200===(null==i?void 0:i.status)&&!0===(null===(e=i.response)||void 0===e?void 0:e.success))return n.success(),this.tasks.wishlists=L([...this.tasks.wishlists,t]),!0;const{result:o,statusText:a,status:r,data:l}=await I({url:"https://store.steampowered.com/app/"+t,method:"GET"});return"Success"===o?200===(null===l||void 0===l?void 0:l.status)?"CN"===ts(this,as)&&l.responseText.includes('id="error_box"')?(n.warning(E("changeAreaNotice")),!!await Ze(this,cs,Vs).call(this)&&await Ze(this,ps,Ws).call(this,t)):(!l.responseText.includes('class="queue_actions_ctn"')||!l.responseText.includes('class="already_in_library"'))&&(l.responseText.includes('class="queue_actions_ctn"')&&l.responseText.includes('id="add_to_wishlist_area_success" style="display: none;')||!l.responseText.includes('class="queue_actions_ctn"'))?(n.error(`Error:${l.statusText}(${l.status})`),!1):(n.success(),this.tasks.wishlists=L([...this.tasks.wishlists,t]),!0):(n.error(`Error:${null===l||void 0===l?void 0:l.statusText}(${null===l||void 0===l?void 0:l.status})`),!1):(n.error(o+`:${a}(${r})`),!1)}catch(t){return _(t,"Steam.addToWishlist"),!1}}async function Us(t){try{var e;if(this.whiteList.wishlists.includes(t))return V({type:"whiteList",text:"Steam.removeFromWishlist",id:t}),!0;const o=V({type:"removingFromWishlist",text:t});var{result:s,data:i}=await I({url:"https://store.steampowered.com/api/removefromwishlist",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({sessionid:ts(this,ns).storeSessionID,appid:t}),dataType:"json"});if("Success"===s&&200===(null==i?void 0:i.status)&&!0===(null===(e=i.response)||void 0===e?void 0:e.success))return o.success(),!0;const{result:a,statusText:r,status:l,data:u}=await I({url:"https://store.steampowered.com/app/"+t,method:"GET"});if("Success"!==a)return o.error(a+`:${r}(${l})`),!1;if(200!==(null===u||void 0===u?void 0:u.status))return o.error(`Error:${null===u||void 0===u?void 0:u.statusText}(${null===u||void 0===u?void 0:u.status})`),!1;if("CN"===ts(this,as)&&u.responseText.includes('id="error_box"')){o.warning(E("changeAreaNotice"));var n=await Ze(this,cs,Vs).call(this);return n&&"CN"!==n&&"skip"!==n?await Ze(this,ws,Us).call(this,t):!1}return u.responseText.includes('class="queue_actions_ctn"')&&(u.responseText.includes("ds_owned_flag ds_flag")||u.responseText.includes("add_to_wishlist_area"))?(o.success(),!0):(o.error(`Error:${u.statusText}(${u.status})`),!1)}catch(t){return _(t,"Steam.removeFromWishlist"),!1}}async function Os(t,e){try{if(!e&&this.whiteList.follows.includes(t))return V({type:"whiteList",text:"Steam.unfollowGame",id:t}),!0;const o=V({type:`${e?"":"un"}followingGame`,text:t}),a={sessionid:ts(this,ns).storeSessionID,appid:t};e||(a.unfollow="1");var{result:s,data:i}=await I({url:"https://store.steampowered.com/explore/followgame/",method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param(a)});if("Success"===s&&200===(null==i?void 0:i.status)&&"true"===i.responseText)return o.success(),!0;var n=await Ze(this,ms,Ds).call(this,t);return"CN"===ts(this,as)&&"areaLocked"===n?(o.warning(E("changeAreaNotice")),!!await Ze(this,cs,Vs).call(this)&&await Ze(this,ws,Us).call(this,t)):e===n?(o.success(),e&&(this.tasks.follows=L([...this.tasks.follows,t])),!0):(o.error(`Error:${null==i?void 0:i.statusText}(${null==i?void 0:i.status})`),!1)}catch(t){return _(t,"Steam.toggleFollowGame"),!1}}async function Ds(t){try{const{result:e,data:s}=await I({url:"https://store.steampowered.com/app/"+t,method:"GET"});return"Success"===e?200===(null===s||void 0===s?void 0:s.status)&&("CN"===ts(this,as)&&s.responseText.includes('id="error_box"')?"areaLocked":"none"!==$(s.responseText.replace(//g,"")).find(".queue_control_button.queue_btn_follow>.btnv6_blue_hoverfade.btn_medium.queue_btn_active").css("display")):!1}catch(t){return _(t,"Steam.isFollowedGame"),!1}}async function Fs(t){var e=!(1/))||void 0===s?void 0:s[1];return i?(Ze(this,Ls,qs).call(this,"workshop",t,i),n.success(),i):(n.error("Error: getWorkshopAppId failed"),!1)}catch(t){return _(t,"Steam.getWorkshopAppId"),!1}}async function Rs(t){try{const a=V({type:"votingUpWorkshop",text:t});var e,{result:s,statusText:i,status:n,data:o}=await I({url:"https://steamcommunity.com/sharedfiles/voteup",method:"POST",responseType:"json",headers:{"Content-Type":"application/x-www-form-urlencoded; charset=UTF-8"},data:$.param({id:t,sessionid:ts(this,ns).communitySessionID})});return"Success"===s?(200===(null==o?void 0:o.status)&&1===(null===(e=o.response)||void 0===e?void 0:e.success)?a.success():a.error(`Error:${null==o?void 0:o.statusText}(${null==o?void 0:o.status})`),!0):(a.error(s+`:${i}(${n})`),!0)}catch(t){return _(t,"Steam.voteupWorkshop"),!0}}async function Ys(t){var e=!(1{return null===(t=t.match(/groups\/(.+)\/?/))||void 0===t?void 0:t[1]});if(0{return null===(t=t.match(/app\/([\d]+)/))||void 0===t?void 0:t[1]});if(0{return null===(t=t.match(/app\/([\d]+)/))||void 0===t?void 0:t[1]});if(0{return null===(t=t.match(/app\/([\d]+)/))||void 0===t?void 0:t[1]});if(0{return null===(t=t.match(/\?id=([\d]+)/))||void 0===t?void 0:t[1]});if(0{return null===(t=t.match(/\?id=([\d]+)/))||void 0===t?void 0:t[1]});if(e&&0{return null===(t=t.match(/curator\/([\d]+)/))||void 0===t?void 0:t[1]}),m=this.getRealParams("curatorLikes",u,e,t=>{return null===(t=t.match(/https?:\/\/store\.steampowered\.com\/(.*?)\/([^/?]+)/))||void 0===t?void 0:t.slice(1,3).join("/")});if(0{var e;return t.includes("store.steampowered.com")?null===(e=t.match(/store\.steampowered\.com\/news\/app\/([\d]+)\/view\/([\d]+)/))||void 0===e?void 0:e.slice(1,3).join("/"):null===(t=t.match(/steamcommunity\.com\/games\/([\d]+)\/announcements\/detail\/([\d]+)/))||void 0===t?void 0:t.slice(1,3).join("/")});if(e&&0("CN"!==ts(this,as)&&(V({}).warning(E("steamFinishNotice")),await Ze(this,cs,Vs).call(this,"CN")),!0))}catch(t){return _(t,"Steam.toggle"),!1}}};function Js(t,e){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.add(t)}function Xs(t,e,s){return e in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}function Qs(t,e,s){if(!e.has(t))throw new TypeError("attempted to get private field on non-instance");return s}const Zs={steam:{groupLinks:[],wishlistLinks:[],curatorLinks:[],curatorLikeLinks:[],followLinks:[],forumLinks:[],announcementLinks:[],workshopVoteLinks:[]},discord:{serverLinks:[]},instagram:{userLinks:[]},vk:{nameLinks:[]},twitch:{channelLinks:[]},reddit:{redditLinks:[]},youtube:{channelLinks:[],likeLinks:[]}};var ti,ei=new WeakSet,si=new WeakSet,ii=new WeakSet,ni=new WeakSet,oi=new WeakSet,ai=new WeakSet,ri=new WeakSet,li=new WeakSet;async function ui(){try{const e=V({text:E("getTasksInfo")}),s=[];var t=$("#actions tr");$("div.bind-discord").is(":visible")&&$("div.bind-discord a")[0].click(),$("div.bind-twitch").is(":visible")&&$("div.bind-twitch a")[0].click();for(const r of t)s.push(new Promise(e=>{const t=$(r).find('td:not(".hidden")');var s=t.eq(1).find('a:not([data-trigger="link"])'),i=t.eq(2).find('a:not([data-trigger="link"])');const n=0t?(o.includes("steam")&&/join/gi.test(a)?this.undoneTasks.steam.groupLinks.push(t):/like.*announcement/gi.test(a)?this.undoneTasks.steam.announcementLinks.push(t):/(follow|subscribe).*curator/gim.test(a)&&/^https?:\/\/store\.steampowered\.com\/curator\//.test(t)?this.undoneTasks.steam.curatorLinks.push(t):o.includes("steam")&&/follow|subscribe/gim.test(a)?this.undoneTasks.steam.curatorLikeLinks.push(t):/subscribe.*steam.*forum/gim.test(a)?this.undoneTasks.steam.forumLinks.push(t):o.includes("thumbs-up")&&/^https?:\/\/steamcommunity\.com\/sharedfiles\/filedetails\/\?id=[\d]+/.test(t)?this.undoneTasks.steam.workshopVoteLinks.push(t):o.includes("discord")||/join.*discord/gim.test(a)?this.undoneTasks.discord.serverLinks.push(t):o.includes("instagram")||/follow.*instagram/gim.test(a)?this.undoneTasks.instagram.userLinks.push(t):o.includes("twitch")||/follow.*twitch.*channel/gim.test(a)?this.undoneTasks.twitch.channelLinks.push(t):o.includes("reddit")||/subscribe.*subreddit/gim.test(a)||/follow.*reddit/gim.test(a)?this.undoneTasks.reddit.redditLinks.push(t):/watch.*art/gim.test(a)?this.undoneTasks.steam.workshopVoteLinks.push(t):/subscribe.*youtube.*channel/gim.test(a)?this.undoneTasks.youtube.channelLinks.push(t):/(watch|like).*youtube.*video/gim.test(a)||(o.includes("youtube")||o.includes("thumbs-up"))&&/(watch|like).*video/gim.test(a)?this.undoneTasks.youtube.likeLinks.push(t):o.includes("vk")||/join.*vk.*group/gim.test(a)?this.undoneTasks.vk.nameLinks.push(t):/(on twitter)|(Follow.*on.*Facebook)/gim.test(a)||(/wishlist.*game|add.*wishlist/gim.test(a)&&this.undoneTasks.steam.wishlistLinks.push(t),/follow.*button/gim.test(a)&&this.undoneTasks.steam.followLinks.push(t)),void e(!0)):e(!1)).catch(t=>(_(t,"Giveawaysu.classifyTask->getRedirectLink"),!1))}));return await Promise.all(s),e.success(),this.undoneTasks=Qs(this,ri,wi).call(this,this.undoneTasks),!0}catch(t){return _(t,"Giveawaysu.classifyTask"),!1}}function ci(){try{return A.other.checkLogin?(0<$("a.steam-login").length&&window.open("/steam/redirect","_self"),!0):!0}catch(t){return _(t,"Giveawaysu.checkLogin"),!1}}async function di(){try{return A.other.checkLeftKey?(0<$(".giveaway-ended").length&&await o().fire({icon:"warning",title:E("notice"),text:E("noKeysLeft"),confirmButtonText:E("confirm"),cancelButtonText:E("cancel"),showCancelButton:!0}).then(t=>{t=t.value;t&&window.close()}),!0):!0}catch(t){return _(t,"Giveawaysu.checkLeftKey"),!1}}function hi(){var t=null===(t=window.location.href.match(/\/view\/([\d]+)/))||void 0===t?void 0:t[1];return t?(this.giveawayId=t,!0):(V({text:E("getFailed","GiveawayId")}),!1)}async function gi(e,t){try{return{name:e,result:await t}}catch(t){return _(t,"GiveawaySu.bind"),{name:e,result:!1}}}async function pi(){try{const e=[];var t=this.undoneTasks;return t.discord&&0[...t,...e]).length&&!this.socialInitialized.discord&&(this.social.discord=new M,e.push(Qs(this,oi,gi).call(this,"discord",this.social.discord.init()))),t.instagram&&0[...t,...e]).length&&!this.socialInitialized.instagram&&(this.social.instagram=new ut,e.push(Qs(this,oi,gi).call(this,"instagram",this.social.instagram.init()))),t.reddit&&0[...t,...e]).length&&!this.socialInitialized.reddit&&(this.social.reddit=new $t,e.push(Qs(this,oi,gi).call(this,"reddit",this.social.reddit.init()))),t.twitch&&0[...t,...e]).length&&!this.socialInitialized.twitch&&(this.social.twitch=new qt,e.push(Qs(this,oi,gi).call(this,"twitch",this.social.twitch.init()))),t.vk&&0[...t,...e]).length&&!this.socialInitialized.vk&&(this.social.vk=new Se,e.push(Qs(this,oi,gi).call(this,"vk",this.social.vk.init()))),t.youtube&&0[...t,...e]).length&&!this.socialInitialized.youtube&&(this.social.youtube=new Me,e.push(Qs(this,oi,gi).call(this,"youtube",this.social.youtube.init()))),t.steam&&0[...t,...e]).length&&!this.socialInitialized.steam&&(this.social.steam=new Hs,e.push(Qs(this,oi,gi).call(this,"steam",this.social.steam.init()))),await Promise.all(e).then(t=>{let e=!0;for(const s of t)s.result?this.socialInitialized[s.name]=s.result:e=!1;return e})}catch(t){return _(t,"GiveawaySu.initSocial"),!1}}function wi(t){const e={};for(var[s,i]of Object.entries(t)){e[s]={};for(var[n,o]of Object.entries(i))e[s][n]=L(o)}return e}async function fi(){try{if(!this.initialized&&!this.init())return!1;if(!await Qs(this,ei,ui).call(this))return!1;if(!await Qs(this,ai,pi).call(this))return!1;const e=[];var t=this.undoneTasks;return this.social.discord&&e.push(this.social.discord.toggle({doTask:!0,...t.discord})),this.social.instagram&&e.push(this.social.instagram.toggle({doTask:!0,...t.instagram})),this.social.reddit&&e.push(this.social.reddit.toggle({doTask:!0,...t.reddit})),this.social.twitch&&e.push(this.social.twitch.toggle({doTask:!0,...t.twitch})),this.social.vk&&e.push(this.social.vk.toggle({doTask:!0,...t.vk})),this.social.youtube&&e.push(this.social.youtube.toggle({doTask:!0,...t.youtube})),this.social.steam&&e.push(this.social.steam.toggle({doTask:!0,...t.steam})),await Promise.all(e),V({}).success(E("allTasksComplete")),!0}catch(t){return _(t,"GiveawaySu.toggleTask"),!1}}const mi=class{constructor(){Js(this,li),Js(this,ri),Js(this,ai),Js(this,oi),Js(this,ni),Js(this,ii),Js(this,si),Js(this,ei),Xs(this,"undoneTasks",Zs),Xs(this,"giveawayId",void 0),Xs(this,"socialInitialized",{discord:!1,instagram:!1,reddit:!1,twitch:!1,vk:!1,youtube:!1,steam:!1}),Xs(this,"initialized",!1),Xs(this,"social",{})}static test(){return/^https?:\/\/giveaway\.su\/giveaway\/view\/[\d]+/.test(window.location.href)}async after(){try{Qs(this,si,ci).call(this)||V({}).warning(E("checkLoginFailed")),await Qs(this,ii,di).call(this)||V({}).warning(E("checkLeftKeyFailed"))}catch(t){_(t,"Giveawaysu.after")}}init(){try{const t=V({text:E("initing")});return 0<$("a.steam-login").length?(window.open("/steam/redirect","_self"),t.warning(E("needLogin")),!1):!!Qs(this,ni,hi).call(this)&&(this.initialized=!0,t.success(),!0)}catch(t){return _(t,"Giveawaysu.init"),!1}}async doTask(){try{return $("#getKey").on("click",()=>{$('#auto-task-info-div,style:contains(".swal2-popup.swal2-toast")').remove(),$("#getKey").off()}),await Qs(this,li,fi).call(this)}catch(t){return _(t,"GiveawaySu.doTask"),!1}}async verifyTask(){try{var t;for(const e of $("#actions tr")){const s=$(e);if("adjs"!==s.attr("data-action-id")){const i=s.find("i.glyphicon-refresh"),n=i.parent();"A"!==n.prop("tagName")?i.hasClass("spin")||i.hasClass("glyphicon-ok")||(n[0].click(),await C(1e3)):(t=n.attr("href"),n.attr("href","javascript:void(0);").attr("target","_self")[0].click(),n.attr("href",t))}}}catch(t){_(t,"GiveawaySu.verifyTask")}}};"discord.com"===window.location.hostname&&(ti=null===(t=window.localStorage)||void 0===t||null===(ti=t.getItem("token"))||void 0===ti?void 0:ti.replace(/^"|"$/g,""),GM_setValue("discordAuth",{auth:ti}),ti&&"#auth"===window.location.hash&&(window.close(),o().fire("",E("closePageNotice"))));$(async()=>{var t,e,s;if("www.twitch.tv"===window.location.hostname&&"#auth"===window.location.hash&&(t=a.get("auth-token"),!!a.get("login")?(GM_setValue("twitchAuth",{authToken:t,clientId:null===(t=commonOptions)||void 0===t||null===(e=t.headers)||void 0===e?void 0:e["Client-ID"]}),window.close(),o().fire("",E("closePageNotice"))):o().fire("",E("needLogin"))),"twitter.com"===window.location.hostname&&"#auth"===window.location.hash&&(s=a.get("ct0"),!!a.get("twid")&&s?(GM_setValue("twitterAuth",{ct0:s}),window.close(),o().fire("",E("closePageNotice"))):o().fire("",E("needLogin"))),"www.youtube.com"===window.location.hostname&&"#auth"===window.location.hash&&((s=a.get("__Secure-3PAPISID"))?(GM_setValue("youtubeAuth",{PAPISID:s}),window.close(),o().fire("",E("closePageNotice"))):o().fire("",E("needLogin"))),"www.reddit.com"===window.location.hostname&&("#auth"===window.location.hash||"#auth"===GM_getValue("redditAuth"))){const i=$("#redesign-beta-optin-btn");if(0

    `),await n.after(),$("#auto-do-task").on("click",()=>{n.doTask()}),$("#auto-verify-task").on("click",()=>{n.verifyTask()}),console.log("%c%s","color:#1bbe1a","Auto TaskGS特供脚本初始化完成!")}})}()}(); \ No newline at end of file diff --git a/dist/auto-task-v4.compatibility.user.js b/dist/auto-task-v4.compatibility.user.js index 3cf5fb8..2cd51ef 100644 --- a/dist/auto-task-v4.compatibility.user.js +++ b/dist/auto-task-v4.compatibility.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name auto-task-v4.compatibility // @namespace auto-task-v4.compatibility -// @version 4.1.1-Beta +// @version 4.1.2-Beta // @description 赠Key站自动任务 // @author HCLonely // @license MIT @@ -38,11 +38,9 @@ // @grant GM_deleteValue // @grant GM_addStyle // @grant GM_xmlhttpRequest -// @grant GM_getResourceText // @grant GM_registerMenuCommand // @grant GM_info // @grant GM_openInTab -// @grant GM_notification // @grant unsafeWindow // @grant window.close // @grant window.localStorage @@ -88,10 +86,10 @@ console.log('%c%s', 'color:blue', 'Auto Task脚本开始加载'); -!function(){var s={514:function(t,e){!function(t){"use strict";var i=function(){return(i=Object.assign||function(t){for(var e,s=1,i=arguments.length;s[a-z\d]+)(\/|\s)(?(\d+\.)+\d+)/i))||void 0===e?void 0:e.groups)&&void 0!==s?s:{},o=a.name,r=a.version,l={},c=0,u=Object.entries(this.browserNameMap);c(.*)=.+)/.exec(decodeURIComponent(t)))||void 0===t?void 0:t.groups;if(!t)return{};for(var e=t.params.split("&"),i={},s=0;s=e?t:""+Array(e+1-i.length).join(s)+t},e={s:a,z:function(t){var e=-t.utcOffset(),s=Math.abs(e),i=Math.floor(s/60),n=s%60;return(e<=0?"+":"-")+a(i,2,"0")+":"+a(n,2,"0")},m:function t(e,s){if(e.date(){s.dataType&&(s.responseType=s.dataType);var t={timeout:3e4,ontimeout(t){e({result:"Error",statusText:"Timeout",status:601,data:t,options:s})},onabort(t){e({result:"Error",statusText:"Aborted",status:602,data:t,options:s})},onerror(t){e({result:"Error",statusText:"Error",status:603,data:t,options:s})},onload(t){e({result:"Success",statusText:"Load",status:600,data:t,options:s})},...s};GM_xmlhttpRequest(t)});return console.log("发送请求:",e),600!==e.status&&t<2?await i(s,t+1):e}catch(t){return O(t,"httpRequest"),console.log("发送请求:",{errorMsg:t,options:s}),{result:"JsError",statusText:"Error",status:604,error:t,options:s}}}const L=i;function G(){let e=0{setTimeout(()=>{t(!0)},e)})}const C=t=>{let{type:e,text:s,html:i,id:n}=t;const a={success:()=>a,error:()=>a,warning:()=>a,info:()=>a,view:()=>a};try{var o;let t;if(e)switch(e){case"joiningSteamGroup":case"leavingSteamGroup":case"gettingSteamGroupId":t=$(`
  • ${E(e)}${s}...
  • `);break;case"subscribingForum":case"unsubscribingForum":case"gettingForumId":t=$(`
  • ${E(e)}${s}...
  • `);break;case"followingCurator":case"unfollowingCurator":case"getCuratorId":t=$(`
  • ${E(e)}${s}...
  • `);break;case"addingToWishlist":case"removingFromWishlist":case"followingGame":case"unfollowingGame":t=$(`
  • ${E(e)}${s}...
  • `);break;case"favoritingWorkshop":case"unfavoritingWorkshop":case"gettingWorkshopAppId":case"votingUpWorkshop":t=$(`
  • ${E(e)} +!function(){var s={514:function(t,e){!function(t){"use strict";var i=function(){return(i=Object.assign||function(t){for(var e,s=1,i=arguments.length;s[a-z\d]+)(\/|\s)(?(\d+\.)+\d+)/i))||void 0===e?void 0:e.groups)&&void 0!==s?s:{},o=a.name,r=a.version,l={},c=0,u=Object.entries(this.browserNameMap);c(.*)=.+)/.exec(decodeURIComponent(t)))||void 0===t?void 0:t.groups;if(!t)return{};for(var e=t.params.split("&"),i={},s=0;s=e?t:""+Array(e+1-i.length).join(s)+t},e={s:a,z:function(t){var e=-t.utcOffset(),s=Math.abs(e),i=Math.floor(s/60),n=s%60;return(e<=0?"+":"-")+a(i,2,"0")+":"+a(n,2,"0")},m:function t(e,s){if(e.date(){s.dataType&&(s.responseType=s.dataType);var t={timeout:3e4,ontimeout(t){e({result:"Error",statusText:"Timeout",status:601,data:t,options:s})},onabort(t){e({result:"Error",statusText:"Aborted",status:602,data:t,options:s})},onerror(t){e({result:"Error",statusText:"Error",status:603,data:t,options:s})},onload(t){e({result:"Success",statusText:"Load",status:600,data:t,options:s})},...s};GM_xmlhttpRequest(t)});return console.log("发送请求:",e),600!==e.status&&t<2?await i(s,t+1):e}catch(t){return O(t,"httpRequest"),console.log("发送请求:",{errorMsg:t,options:s}),{result:"JsError",statusText:"Error",status:604,error:t,options:s}}}const L=i;function G(){let e=0{setTimeout(()=>{t(!0)},e)})}const C=t=>{let{type:e,text:s,html:i,id:n}=t;const a={success:()=>a,error:()=>a,warning:()=>a,info:()=>a,view:()=>a};try{var o;let t;if(e)switch(e){case"joiningSteamGroup":case"leavingSteamGroup":case"gettingSteamGroupId":t=$(`
  • ${E(e)}${s}...
  • `);break;case"subscribingForum":case"unsubscribingForum":case"gettingForumId":t=$(`
  • ${E(e)}${s}...
  • `);break;case"followingCurator":case"unfollowingCurator":case"getCuratorId":t=$(`
  • ${E(e)}${s}...
  • `);break;case"addingToWishlist":case"removingFromWishlist":case"followingGame":case"unfollowingGame":t=$(`
  • ${E(e)}${s}...
  • `);break;case"favoritingWorkshop":case"unfavoritingWorkshop":case"gettingWorkshopAppId":case"votingUpWorkshop":t=$(`
  • ${E(e)} ${s}...
  • `);break;case"gettingAnnouncementParams":case"likingAnnouncement":t=$(`
  • ${E(e)} ${n}...
  • `);break;case"joiningDiscordServer":case"gettingDiscordGuild":t=$(`
  • ${E(e)}${s}...
  • `);break;case"leavingDiscordServer":t=$(`
  • ${E(e)}${s}...
  • `);break;case"updateDiscordAuth":t=$(`
  • ${E("updateDiscordAuth")}
  • `);break;case"followingTwitchChannel":case"unfollowingTwitchChannel":case"gettingTwitchChannelId":t=$(`
  • ${E(e)}${s}...
  • `);break;case"gettingInsUserId":case"followingIns":case"unfollowingIns":t=$(`
  • ${E(e)}${s}...
  • `);break;case"gettingTwitterUserId":case"followingTwitterUser":case"unfollowingTwitterUser":t=$(`
  • ${E(e)}${s}...
  • `);break;case"retweetting":case"unretweetting":t=$(`
  • ${E(e)}${s}...
  • `);break;case"joiningReddit":case"leavingReddit":t=$(`
  • ${E(e)}${s}...
  • `);break;case"followingRedditUser":case"unfollowingRedditUser":t=$(`
  • ${E(e)} - ${null===s||void 0===s?void 0:s.replace("u_","")}...
  • `);break;case"followingYtbChannel":case"unfollowingYtbChannel":t=$(`
  • ${E(e)}${s}...
  • `);break;case"likingYtbVideo":case"unlikingYtbVideo":t=$(`
  • ${E(e)}${s}...
  • `);break;case"gettingVkId":case"joiningVkGroup":case"leavingVkGroup":case"joiningVkPublic":case"leavingVkPublic":case"sendingVkWall":case"deletingVkWall":t=$(`
  • ${E(e)}${s}...
  • `);break;case"visitingLink":t=$(`
  • ${E("visitingLink")}${s}...
  • `);break;case"verifyingInsAuth":case"text":t=$(`
  • ${E(s)}
  • `);break;case"html":t=$(s||i);break;case"whiteList":t=$(`
  • ${E("skipTask")}[${s}(${n})](${E("whiteList")})
  • `);break;case"globalOptionsSkip":t=$(`
  • ${E("skipTaskOption")}${s}
  • `);break;default:t=$(`
  • ${E("unKnown")}:${e}(${s})...
  • `)}else if(s)t=$(`
  • ${E(s)}
  • `);else{if(!i)return a;t=$(i)}return t.addClass("card-text"),$("#auto-task-info").append(t),null!==(o=t[0])&&void 0!==o&&o.scrollIntoView(),{font:t.find("font"),success(){var t,e,s=0{try{return[...new Set(t)]}catch(t){return O(t,"unique"),[]}},u=async e=>{try{if(!e)return null;const s=GM_getValue("redirectLinks")||{};return s[e]&&s[e],await L({url:e,method:"GET"}).then(t=>{t=t.data;return null!=t&&t.finalUrl?(s[e]=t.finalUrl,GM_setValue("redirectLinks",s),t.finalUrl):null})}catch(t){return O(t,"getRedirectLink"),null}},n=async(t,e)=>{try{const i=C({type:"visitLink",text:t});return await L({url:t,method:"GET",...e}).then(t=>{var{result:e,statusText:s,status:t}=t;return"Success"===e?(i.success(),!0):(i.error(e+`:${s}(${t})`),!1)})}catch(t){return O(t,"visitLink"),!1}};const l=i=>{try{let e=0;for(let t=0;t>8*t&255;s+=("00"+n.toString(16)).slice(-2)}return s}catch(t){return O(t,"stringToColour"),"#fff"}},o={doTask:{discord:{servers:!0},instagram:{users:!0},twitch:{channels:!0},twitter:{users:!0,retweets:!0},vk:{names:!0},youtube:{channels:!0,likes:!0},reddit:{reddits:!0},steam:{groups:!0,wishlists:!0,follows:!0,forums:!0,workshops:!0,curators:!0,workshopVotes:!0,announcements:!0}},undoTask:{discord:{servers:!0},instagram:{users:!0},twitch:{channels:!0},twitter:{users:!0,retweets:!0},vk:{names:!0},youtube:{channels:!0,likes:!0},reddit:{reddits:!0},steam:{groups:!0,wishlists:!0,follows:!0,forums:!0,workshops:!0,curators:!0}},position:{buttonSideX:"right",buttonSideY:"top",buttonDistance:"15,30",showButtonSideX:"right",showButtonSideY:"top",showButtonDistance:"15,30",logSideX:"right",logSideY:"bottom",logDistance:"10,10"},hotKey:{doTaskKey:"alt + d",undoTaskKey:"alt + u",toggleLogKey:"alt + l"},other:{twitterVerifyId:"783214",youtubeVerifyChannel:"UCrXUsMBcfTVqwAS7DKg9C0Q",autoUpdateSource:"jsDelivr",language:"zh",checkLogin:!0,checkLeftKey:!0,defaultShowButton:!0,defaultShowLog:!0}};var e=GM_getValue("globalOptions")||{};const r=(t,e)=>{try{const n={};for(var[s,i]of Object.entries(t))"[object Object]"===Object.prototype.toString.call(i)&&"[object Object]"===Object.prototype.toString.call(e[s])?n[s]=r(i,e[s]):n[s]=e[s]??i;return n}catch(t){return O(t,"assignObject"),o}},A=r(o,e),c=()=>{try{const i={};$("#globalOptionsForm").serializeArray().map(t=>(i[t.name]=t.value,t)),$.makeArray($("#globalOptionsForm input")).map(t=>{const e=$(t).attr("name");var s=e.split(".");return 3===s.length?A[s[0]][s[1]][s[2]]=!!i[e]&&("on"===i[e]||i[e]):2===s.length&&(A[s[0]][s[1]]=!!i[e]&&("on"===i[e]||i[e])),t}),GM_setValue("globalOptions",A),h().fire({title:E("changeGlobalOptionsSuccess"),icon:"success"})}catch(t){O(t,"saveData")}},w=e=>{try{let t=`
    + ${null===s||void 0===s?void 0:s.replace("u_","")}...`);break;case"followingYtbChannel":case"unfollowingYtbChannel":t=$(`
  • ${E(e)}${s}...
  • `);break;case"likingYtbVideo":case"unlikingYtbVideo":t=$(`
  • ${E(e)}${s}...
  • `);break;case"gettingVkId":case"joiningVkGroup":case"leavingVkGroup":case"joiningVkPublic":case"leavingVkPublic":case"sendingVkWall":case"deletingVkWall":t=$(`
  • ${E(e)}${s}...
  • `);break;case"visitingLink":t=$(`
  • ${E("visitingLink")}${s}...
  • `);break;case"verifyingInsAuth":case"text":t=$(`
  • ${E(s)}
  • `);break;case"html":t=$(s||i);break;case"whiteList":t=$(`
  • ${E("skipTask")}[${s}(${n})](${E("whiteList")})
  • `);break;case"globalOptionsSkip":t=$(`
  • ${E("skipTaskOption")}${s}
  • `);break;default:t=$(`
  • ${E("unKnown")}:${e}(${s})...
  • `)}else t=s?$(`
  • ${E(s)}
  • `):i?$(i):$("
  • ");return t.addClass("card-text"),$("#auto-task-info").append(t),null!==(o=t[0])&&void 0!==o&&o.scrollIntoView(),{font:t.find("font"),success(){var t,e,s=0{try{return[...new Set(t)]}catch(t){return O(t,"unique"),[]}},u=async e=>{try{if(!e)return null;const s=GM_getValue("redirectLinks")||{};return s[e]&&s[e],await L({url:e,method:"GET"}).then(t=>{t=t.data;return null!=t&&t.finalUrl?(s[e]=t.finalUrl,GM_setValue("redirectLinks",s),t.finalUrl):null})}catch(t){return O(t,"getRedirectLink"),null}},n=async(t,e)=>{try{const i=C({type:"visitLink",text:t});return await L({url:t,method:"GET",...e}).then(t=>{var{result:e,statusText:s,status:t}=t;return"Success"===e?(i.success(),!0):(i.error(e+`:${s}(${t})`),!1)})}catch(t){return O(t,"visitLink"),!1}};const l=i=>{try{let e=0;for(let t=0;t>8*t&255;s+=("00"+n.toString(16)).slice(-2)}return s}catch(t){return O(t,"stringToColour"),"#fff"}},o={doTask:{discord:{servers:!0},instagram:{users:!0},twitch:{channels:!0},twitter:{users:!0,retweets:!0},vk:{names:!0},youtube:{channels:!0,likes:!0},reddit:{reddits:!0},steam:{groups:!0,wishlists:!0,follows:!0,forums:!0,workshops:!0,curators:!0,workshopVotes:!0,announcements:!0}},undoTask:{discord:{servers:!0},instagram:{users:!0},twitch:{channels:!0},twitter:{users:!0,retweets:!0},vk:{names:!0},youtube:{channels:!0,likes:!0},reddit:{reddits:!0},steam:{groups:!0,wishlists:!0,follows:!0,forums:!0,workshops:!0,curators:!0}},position:{buttonSideX:"right",buttonSideY:"top",buttonDistance:"15,30",showButtonSideX:"right",showButtonSideY:"top",showButtonDistance:"15,30",logSideX:"right",logSideY:"bottom",logDistance:"10,10"},hotKey:{doTaskKey:"alt + d",undoTaskKey:"alt + u",toggleLogKey:"alt + l"},other:{twitterVerifyId:"783214",youtubeVerifyChannel:"UCrXUsMBcfTVqwAS7DKg9C0Q",autoUpdateSource:"jsDelivr",language:"zh",checkLogin:!0,checkLeftKey:!0,defaultShowButton:!0,defaultShowLog:!0}};var e=GM_getValue("globalOptions")||{};const r=(t,e)=>{try{const n={};for(var[s,i]of Object.entries(t))"[object Object]"===Object.prototype.toString.call(i)&&"[object Object]"===Object.prototype.toString.call(e[s])?n[s]=r(i,e[s]):n[s]=e[s]??i;return n}catch(t){return O(t,"assignObject"),o}},A=r(o,e),c=()=>{try{const i={};$("#globalOptionsForm").serializeArray().map(t=>(i[t.name]=t.value,t)),$.makeArray($("#globalOptionsForm input")).map(t=>{const e=$(t).attr("name");var s=e.split(".");return 3===s.length?A[s[0]][s[1]][s[2]]=!!i[e]&&("on"===i[e]||i[e]):2===s.length&&(A[s[0]][s[1]]=!!i[e]&&("on"===i[e]||i[e])),t}),GM_setValue("globalOptions",A),h().fire({title:E("changeGlobalOptionsSuccess"),icon:"success"})}catch(t){O(t,"saveData")}},w=e=>{try{let t=` `;for(const[o,r]of Object.entries(A))for(var[s,i]of Object.entries(r))if(["other","position","hotKey"].includes(o))"boolean"==typeof i?t+=`${0===Object.keys(r).indexOf(s)?``:""}`:t+=`${0===Object.keys(r).indexOf(s)?``:""}`;else for(var[n,a]of Object.entries(i))t+=`${0===Object.keys(r).indexOf(s)?``:""}`;t+="
    ${E("type")}${E("option")}${E("value")}
    ${E(o)}${E(s)}
    ${E(o)}${E(s)}
    ${E(o)}${s}.${E(n)}
    ","swal"===e?h().fire({title:E("globalOptions"),html:t,showConfirmButton:!0,confirmButtonText:E("save"),showCancelButton:!0,cancelButtonText:E("close")}).then(t=>{t=t.isConfirmed;t&&c()}):$("body").append(`

    ${E("globalOptions")}

    `+t)}catch(t){O(t,"changeGlobalOptions")}};const d={zh:{website:"网站",type:"类型",edit:"编辑",whiteList:"白名单",skipTask:"跳过撤销任务",whiteListOptions:"白名单设置",changeWhiteListOption:"设置白名单(%0)",whiteListNotFound:"找不到此项白名单: %0",changeWhiteListSuccess:"白名单修改成功,刷新生效!",changeWebsiteOptions:"网站设置",changeGlobalOptions:"全局设置",ok:"是",save:"保存",close:"关闭",return:"返回",option:"选项",value:"值",websiteOptions:"当前网站设置",changeWebsiteOptionsSuccess:"更改当前网站设置成功,刷新生效!",changeGlobalOptionsSuccess:"更改全局设置成功,刷新生效!",needLogin:"请先登录!",getTasksInfo:"正在获取并处理任务信息...",gettingKey:"正在获取Key...",verifyingTask:"正在验证任务",notice:"自动任务脚本提醒",noKeysLeft:"此页面已经没有剩余key了,是否关闭?",giveawayEnded:"此活动已结束,是否关闭?",giveawayNotWork:"此活动因某些原因(已结束/暂停/未开始...)不可用(如果是脚本误判请及时反馈),是否关闭?",confirm:"确定",cancel:"取消",unKnown:"未知",unKnownTaskType:"未识别的任务",doing:"正在做任务",allTasksComplete:"所有任务已完成!",getTaskIdFailed:"获取任务Id失败!",initSuccess:"%0 初始化成功!",initFailed:"%0 初始化失败!",errorLink:"链接错误: %0",needInit:"请先初始化",verifyingAuth:"正在验证%0凭证...",updatingAuth:"正在更新%0凭证...",initing:"正在初始化...",getFailed:"获取%0失败!",checkLoginFailed:"检测登录状态失败!",checkLeftKeyFailed:"检测剩余Key失败!",userId:"用户Id",joiningGiveaway:"正在加入赠Key",needJoinGiveaway:"需要先加入赠Key",cannotUndo:"此网站不支持取消任务",verifyAuth:"正在验证 %0 凭证...",closePageNotice:"如果此页面没有自动关闭,请自行关闭本页面。",errorReport:"检测到脚本报错,是否前往反馈BUG?",visitingLink:"正在访问链接: ",doTask:"做任务",undoTask:"撤销任务",verifyTask:"验证任务",getKey:"获取Key",selectAll:"全选",selectNone:"全不选",invertSelect:"反选",doFreeTask:"加入免费赠品",doPointTask:"加入点数赠品",skipTaskOption:"设置中已配置跳过任务",other:"其他",globalOptions:"全局设置",checkLogin:"登录检测
    需要登录的网站自动登录,部分本网站支持",checkLeftKey:"剩余Key检测
    赠Key活动结束提示是否关闭,部分本网站支持",twitterVerifyId:"通过尝试关注该账号验证Twitter凭证
    默认为Twitter官方帐号 783214",youtubeVerifyChannel:"通过尝试订阅该频道验证YouTube凭证
    默认为YouTube官方频道 UCrXUsMBcfTVqwAS7DKg9C0Q",autoUpdateSource:"更新源
    github: 需代理,实时更新
    jsdelivr: 可不用代理,更新有延迟
    auto: 首先使用github源更新,失败后尝试用jsdelivr源更新",saveGlobalOptions:"保存全局设置",settingPage:"设置页面",name:"名称",version:"版本",scriptManager:"脚本管理器",script:"脚本",environment:"环境",os:"系统",browser:"浏览器",getId:"获取 %0 id",getTwitterUserId:"获取Twitter用户id(获取id功能仅在设置页面可用)",getYoutubeChannelId:"获取Youtube频道id(获取id功能仅在设置页面可用)",showButton:"显示按钮",hideButton:"隐藏按钮",showLog:"显示日志",hideLog:"隐藏日志",defaultShowButton:"默认显示按钮",defaultShowLog:"默认显示日志",position:"组件位置",buttonSideX:"按钮区域水平方向定位(实时预览功能仅在设置页面可用)
    left: 靠左 | right: 靠右",buttonSideY:"按钮区域垂直方向定位(实时预览功能仅在设置页面可用)
    top: 靠上 | bottom: 靠下",buttonDistance:"按钮区域距边缘的距离(实时预览功能仅在设置页面可用)
    格式: X距离,Y距离",showButtonSideX:"显示按钮水平方向定位(实时预览功能仅在设置页面可用)
    left: 靠左 | right: 靠右",showButtonSideY:"显示按钮垂直方向定位(实时预览功能仅在设置页面可用)
    top: 靠上 | bottom: 靠下",showButtonDistance:"显示按钮距边缘的距离(实时预览功能仅在设置页面可用)
    格式: X距离,Y距离",logSideX:"日志区域水平方向定位(实时预览功能仅在设置页面可用)
    left: 靠左 | right: 靠右",logSideY:"日志区域垂直方向定位(实时预览功能仅在设置页面可用)
    top: 靠上 | bottom: 靠下",logDistance:"日志区域距边缘的距离(实时预览功能仅在设置页面可用)
    格式: X距离,Y距离",hotKey:"快捷键",doTaskKey:"做任务快捷键
    (实时预览功能仅在设置页面可用)",undoTaskKey:"撤销任务快捷键
    (实时预览功能仅在设置页面可用)",toggleLogKey:"显示/隐藏日志快捷键
    (实时预览功能仅在设置页面可用)",tasksHistory:"任务历史",clearHistory:"清空历史",clearHistoryFinished:"已清空任务历史!",deleteTask:"删除任务",lastChangeTime:"最后一次修改时间",clearTaskFinished:"删除以下任务完成!",clearTaskFailed:"删除任务失败,没有找到任务名!",syncData:"数据同步",settingData:"正在上传数据...",gettingData:"正在获取数据...",help:"帮助",fileName:"文件名",upload2gist:"同步到Gist",downloadFromGist:"从Gist同步",saveAndTest:"保存配置并测试",testSuccess:"测试成功!",testFailed:"测试失败!",saveAndTestNotice:"请先保存配置并测试!",processingData:"正在处理数据...",updatingData:"正在上传数据...",syncDataSuccess:"同步数据成功!",syncDataFailed:"同步数据失败,请在控制台查看错误信息!",downloadingData:"正在下载数据...",checkedNoData:"没有检测到远程数据,请确认配置是否正确!",savingData:"正在保存数据...",syncHistory:"同步任务历史",checkUpdateFailed:"检测更新失败",newVersionNotice:'检测到新版本V%0, 点此更新',language:"语言
    目前仅支持zh: 中文, en: 英文",gistOptions:"Gist 设置",swalNotice:"检测到您第一次安装V4版本脚本,请前往阅读用前必读内容!",echoNotice:'检测到您第一次安装V4版本脚本,请点此前往阅读用前必读内容!',noticeLink:"https://auto-task-doc.js.org/guide/#用前必读",toGithub:"前往Github反馈",toKeylol:"前往其乐论坛反馈",copySuccess:"错误信息已复制到剪切板,是否前往其乐论坛反馈?",copyFailed:"请复制下方错误信息后前往Keylol论坛反馈!",groups:"组",wishlists:"愿望单",follows:"游戏关注",forums:"论坛",workshops:"创意工坊收藏",curators:"鉴赏家",workshopVotes:"创意工坊点赞",announcements:"社区通知",steamCommunity:"Steam社区",steamStore:"Steam商店",needLoginSteamStore:'请先登录Steam商店',needLoginSteamCommunity:'请先登录Steam社区',joiningSteamGroup:"正在加入Steam组",leavingSteamGroup:"正在退出Steam组",gettingSteamGroupId:"正在获取Steam组Id",subscribingForum:"正在订阅Steam论坛",unsubscribingForum:"正在取消订阅Steam论坛",gettingForumId:"正在获取Steam论坛Id",followingCurator:"正在关注Steam鉴赏家",unfollowingCurator:"正在取关Steam鉴赏家",addingToWishlist:"正在添加游戏到Steam愿望单",removingFromWishlist:"正在从Steam愿望单移除游戏",followingGame:"正在关注Steam游戏",unfollowingGame:"正在取关Steam游戏",favoritingWorkshop:"正在收藏Steam创意工坊物品",unfavoritingWorkshop:"正在取消收藏Steam创意工坊物品",gettingWorkshopAppId:"正在获取Steam创意工坊物品Id",votingUpWorkshop:"正在点赞Steam创意工坊物品",gettingAnnouncementParams:"正在获取Steam通知信息",likingAnnouncement:"正在点赞Steam通知",changingArea:"正在更换Steam地区: %0...",notNeededChangeArea:"当前地区不需要更换",noAnotherArea:"请检测是否开启正确开启代理",gettingAreaInfo:"正在获取Steam地区信息...",changeAreaNotice:"疑似锁区游戏,尝试换区执行",steamFinishNotice:"Steam任务完成,尝试将购物车地区换回CN",servers:"服务器",joiningDiscordServer:"正在加入Discord服务器",leavingDiscordServer:"正在退出Discord服务器",gettingDiscordGuild:"正在获取Discord服务器Id",users:"用户",loginIns:'请先登录Instagram',insBanned:"您的Instagram账户已被封禁",verifyingInsAuth:"正在验证Instagram凭证...",gettingInsUserId:"正在获取Instagram用户Id",followingIns:"正在关注Instagram用户",unfollowingIns:"正在取关Instagram用户",reddits:"社区/用户",loginReddit:'请先登录Reddit',changingRedditVersion:"正在切换Reddit为新版页面...",joiningReddit:"正在加入Reddit社区",leavingReddit:"正在退出Reddit社区",followingRedditUser:"正在关注Reddit用户",unfollowingRedditUser:"正在取关Reddit用户",channels:"频道",followingTwitchChannel:"正在关注Twitch频道",unfollowingTwitchChannel:"正在取关Twitch频道",gettingTwitchChannelId:"正在获取Twitch频道Id",twitterUser:"推特用户",retweets:"转推",followingTwitterUser:"正在关注推特用户",unfollowingTwitterUser:"正在取关推特用户",retweetting:"正在转推",unretweetting:"正在撤销转推",names:"组/社区/动态",loginVk:'请先登录Vk',gettingVkId:"正在获取Vk任务Id",joiningVkGroup:"正在加入Vk组",leavingVkGroup:"正在退出Vk组",joiningVkPublic:"正在加入Vk社区",leavingVkPublic:"正在退出Vk社区",sendingVkWall:"正在转发Vk动态",deletingVkWall:"正在撤销转发Vk动态",youtubeChannel:"YouTube频道",likes:"点赞",loginYtb:'请先登录YouTube',tryUpdateYtbAuth:'请尝试更新YouTube凭证',gettingYtbToken:"正在获取YouTube Token...",followingYtbChannel:"正在订阅YouTube频道",unfollowingYtbChannel:"正在退订YouTube频道",likingYtbVideo:"正在点赞YouTube视频",unlikingYtbVideo:"正在取消点赞YouTube视频",giveKeyNoticeBefore:"每次验证间隔15s",giveKeyNoticeAfter:'如果没有key, 请在https://givekey.ru/profile查看',noPoints:"点数不够,跳过抽奖",getNeedPointsFailed:"获取所需点数失败,跳过抽奖",joiningLottery:"正在加入抽奖",doingGleamTask:"正在做Gleam任务...",gettingGleamLink:"正在获取Gleam任务链接...",gleamTaskNotice:"如果此页面长时间未关闭,请完成任一任务后自行关闭!",verifiedGleamTasks:"已尝试验证所有任务,验证失败的任务请尝试手动验证或完成!",SweepWidgetNotice:"正在处理并验证任务,每次验证任务有1~3s间隔防止触发验证过快警告..."},en:{website:"Website",type:"Type",edit:"Edit",whiteList:"Whitelist",skipTask:"Skip undo task",whiteListOptions:"Whitelist options",changeWhiteListOption:"Whitelist option(%0)",whiteListNotFound:"Cannot find this whitelist: %0",changeWhiteListSuccess:"The whitelist is successfully modified, and the page refresh will take effect!",changeWebsiteOptions:"Website options",changeGlobalOptions:"Global options",ok:"OK",save:"Save",close:"Close",return:"Return",option:"Option",value:"Value",websiteOptions:"Current website settings",changeWebsiteOptionsSuccess:"The current website setting is changed successfully, and the page refresh will take effect!",changeGlobalOptionsSuccess:"The global setting is changed successfully, and the refresh will take effect!",needLogin:"Please log in first!",getTasksInfo:"Obtaining and processing task information...",gettingKey:"Getting Key...",verifyingTask:"Verifying task",notice:"Automatic task script notice",noKeysLeft:"There are no more keys left on this page. Do you want to close it?",giveawayEnded:"This event has ended, do you want to close it?",giveawayNotWork:"This activity is unavailable for some reasons (ended/suspended/not started...) (if it is a script misjudgment, please give us feedback in time), is it closed?",confirm:"Confirm",cancel:"Cancel",unKnown:"Unknown",unKnownTaskType:"Unrecognized task",doing:"Doing a task",allTasksComplete:"All tasks have been completed!",getTaskIdFailed:"Failed to obtain task Id!",initSuccess:"%0 was initialized successfully!",initFailed:"%0 initialization failed!",errorLink:"Link error: %0",needInit:"Please initialize first",verifyingAuth:"Verifying %0 token...",updatingAuth:"Update %0 token...",initing:"Initializing...",getFailed:"Failed to get %0!",checkLoginFailed:"Failed to detect login status!",checkLeftKeyFailed:"Failed to detect the remaining keys!",userId:"User Id",joiningGiveaway:"Joining giveaway",needJoinGiveaway:"Need to join the giveaway first",cannotUndo:"This website does not support canceling tasks",verifyAuth:"Verifying %0 token...",closePageNotice:"f this page does not close automatically, please close this page yourself.",errorReport:"A script error is detected, do you want to report the BUG?",visitingLink:"Visiting link: ",doTask:"DoTask",undoTask:"UndoTask",verifyTask:"Verify",getKey:"GetKey",selectAll:"SelectAll",selectNone:"SelectNone",invertSelect:"InvertSelect",doFreeTask:"FreeTask",doPointTask:"PointTask",skipTaskOption:"Skip task has been configured in the settings",other:"Other",globalOptions:"Global Options",checkLogin:"Login detection
    Need to log in to the website automatically log in, part of this website supports.",checkLeftKey:"Key remaining detection
    The end of the giveaway event prompts whether to close or not, part of this website supports.",twitterVerifyId:"Verify Twitter token by trying to follow the account.
    The default is the official Twitter account 783214.",youtubeVerifyChannel:"Verify YouTube token by trying to subscribe to the channel.
    The default is the official YouTube channel UCrXUsMBcfTVqwAS7DKg9C0Q.",autoUpdateSource:"The source to update
    github: Fast update.
    jsdelivr: Update is delayed
    auto: First use github source to update, after failure, try to update with jsdelivr source.",saveGlobalOptions:"Save global settings",settingPage:"Setting Page",name:"Name",version:"Version",scriptManager:"Script Manager",script:"Script",environment:"Environment",os:"OS",browser:"Browser",getId:"Get %0 id",getTwitterUserId:"Get Twitter user id (Get id function is only available on the settings page).",getYoutubeChannelId:"Get Youtube channel id (Get id function is only available on the settings page).",showButton:"ShowButton",hideButton:"HideButton",showLog:"ShowLog",hideLog:"HideLog",defaultShowButton:"Default display button",defaultShowLog:"Display log by default",position:"Component position",buttonSideX:"Horizontal positioning of the button area (real-time preview function is only available on the setting page).
    left: left | right: right",buttonSideY:"The button area is positioned in the vertical direction (real-time preview function is only available on the settings page).
    top: top | bottom: bottom",buttonDistance:"The distance between the button area and the edge (the real-time preview function is only available on the setting page).
    Format: X distance, Y distance",showButtonSideX:"ShowButton horizontal positioning (real-time preview function is only available on the setting page).
    left: left | right: right",showButtonSideY:"ShowButton vertical positioning (real-time preview function is only available on the setting page).
    top: top | bottom: bottom",showButtonDistance:"The distance between the ShowButton and the edge (real-time preview function is only available on the setting page).
    Format: X distance, Y distance",logSideX:"Horizontal positioning of the log area (real-time preview function is only available on the setting page).
    left: left | right: right",logSideY:"Vertical positioning of the log area (real-time preview function is only available on the setting page).
    top: top | bottom: bottom",logDistance:"The distance between the log area and the edge (the real-time preview function is only available on the setting page).
    Format: X distance, Y distance",hotKey:"Shortcut key",doTaskKey:"DoTask shortcut keys
    (real-time preview function is only available on the settings page).",undoTaskKey:"UndoTask shortcut keys
    (real-time preview function is only available on the settings page).",toggleLogKey:"ShowLog/HideLog shortcut keys
    (real-time preview function is only available on the settings page).",tasksHistory:"Tasks history",clearHistory:"Clear history",clearHistoryFinished:"The mission history has been cleared!",deleteTask:"Delete task",lastChangeTime:"Last Change Time",clearTaskFinished:"Delete the following tasks completed!",clearTaskFailed:"Failed to delete the task, the task name was not found!",syncData:"Data synchronization",settingData:"Uploading data...",gettingData:"Getting data...",help:"Help",fileName:"Filename",upload2gist:"Sync to Gist",downloadFromGist:"Sync from Gist",saveAndTest:"Save configuration and test",testSuccess:"Test success!",testFailed:"Test failed!",saveAndTestNotice:"Please save the configuration and test first!",processingData:"Processing data...",updatingData:"Uploading data...",syncDataSuccess:"Synchronized data successfully!",syncDataFailed:"Failed to synchronize data, please check the error message on the console!",downloadingData:"Downloading data...",checkedNoData:"No remote data is detected, please confirm whether the configuration is correct!",savingData:"Saving data...",syncHistory:"Synchronize tasks history",checkUpdateFailed:"Check update failed",newVersionNotice:'Checked a new version V%0, click to update',language:"Language
    Currently only supports zh: Chinese, en: English",gistOptions:"Gist Settings",swalNotice:"It is detected that you are installing the V4 version script for the first time, please go to read the READ ME FIRST content before use!",echoNotice:'It is detected that you are installing the V4 version script for the first time, please click here to read the READ ME FIRST content before use!',noticeLink:"https://auto-task-doc.js.org/en/guide/#read-me-first",toGithub:"Feedback(Github)",toKeylol:"Feedback(Keylol)",copySuccess:"The error message has been copied to the clipboard. Do you want to go to the Keylol forum to give feedback?",copyFailed:"Please copy the error information below and report back to the Keylol forum!",groups:"Group",wishlists:"Wishlist",follows:"Follow Game",forums:"Forum",workshops:"Favorite Workshop",curators:"Curator",workshopVotes:"Voteup Workshop",announcements:"Announcement",steamCommunity:"Steam Community",steamStore:"Steam Store",needLoginSteamStore:'Please log in to the Steam Store',needLoginSteamCommunity:'Please log in to the Steam Community',joiningSteamGroup:"Joining Steam Group",leavingSteamGroup:"Leaving Steam Group",gettingSteamGroupId:"Getting Steam Group Id",subscribingForum:"Subscribing the Steam Forum",unsubscribingForum:"Unsubscribing the Steam Forum",gettingForumId:"Getting Steam Forum Id",followingCurator:"Following Steam Curator",unfollowingCurator:"Unfollowing Steam Curator",addingToWishlist:"Adding the game to the Steam wishlist",removingFromWishlist:"Removing the game from the Steam wishlist",followingGame:"Following Steam games",unfollowingGame:"Unfollowing Steam games",favoritingWorkshop:"Favouring Steam Workshop Items",unfavoritingWorkshop:"Unfavoriting Steam Workshop Items",gettingWorkshopAppId:"Getting Steam Workshop Item Id",votingUpWorkshop:"Liking Steam workshop items",gettingAnnouncementParams:"Getting Steam announcement information",likingAnnouncement:"Liking Steam announcement",changingArea:"Changing Steam area: %0...",notNeededChangeArea:"The current area does not need to be changed",noAnotherArea:"Please check whether the proxy is turned on correctly",gettingAreaInfo:"Getting Steam area information...",changeAreaNotice:"Suspected of a locked zone game, try to change the zone to execute",steamFinishNotice:"Steam task completed, try to change the shopping cart area back to CN",servers:"Server",joiningDiscordServer:"Joining Discord Server",leavingDiscordServer:"Leaving Discord Server",gettingDiscordGuild:"Getting Discord server Id",users:"User",loginIns:'Please log in to Instagram',insBanned:"Your Instagram account has been banned",verifyingInsAuth:"Verifying Instagram token...",gettingInsUserId:"Getting Instagram user Id",followingIns:"Following Instagram user",unfollowingIns:"Unfollowing Instagram user",reddits:"Reddit/User",loginReddit:'Please log in to Reddit',changingRedditVersion:"Switching Reddit to a new version page...",joiningReddit:"Joining the Reddit",leavingReddit:"Leaving the Reddit",followingRedditUser:"Following Reddit User",unfollowingRedditUser:"Unfollowing Reddit User",channels:"Channel",followingTwitchChannel:"Following Twitch Channel",unfollowingTwitchChannel:"Unfollowing Twitch Channel",gettingTwitchChannelId:"Getting Twitch Channel Id",twitterUser:"Twitter User",retweets:"Retweet",followingTwitterUser:"Following Twitter User",unfollowingTwitterUser:"Unfollowing Twitter User",retweetting:"Retweeting",unretweetting:"Unretweeting",names:"Group/Public/Wall",loginVk:'Please log in to Vk',gettingVkId:"Getting Vk task Id",joiningVkGroup:"Joining Vk Group",leavingVkGroup:"Leaving Vk Group",joiningVkPublic:"Joining Vk Public",leavingVkPublic:"Leaving Vk Public",sendingVkWall:"Sending Vk Wall",deletingVkWall:"Deleting Vk Wall",youtubeChannel:"YouTube Channel",likes:"Like",loginYtb:'Please log in to YouTube',tryUpdateYtbAuth:'Please try to update YouTube token',gettingYtbToken:"Getting YouTube Token...",followingYtbChannel:"Subscribing to YouTube channel",unfollowingYtbChannel:"Unsubscribing to YouTube channel",likingYtbVideo:"Liking YouTube video",unlikingYtbVideo:"Unliking YouTube video",giveKeyNoticeBefore:"Each verification interval is 15s",giveKeyNoticeAfter:'If there is no key, please check at https://givekey.ru/profile',noPoints:"Not enough points, skip the lottery",getNeedPointsFailed:"ailed to obtain the required points, skip the lottery",joiningLottery:"Joining the lottery",doingGleamTask:"Doing Gleam Task...",gettingGleamLink:"Getting Gleam task link...",gleamTaskNotice:"If this page has not been closed for a long time, please close it yourself after completing any task!",verifiedGleamTasks:"Attempted to verify all tasks. If the verification fails, please try to verify manually or complete it!",SweepWidgetNotice:"The task is being processed and verified. There is an interval of 1~3s for each verification task to prevent the triggering of too fast verification warning..."}},g=["zh","en"].includes(A.other.language)?A.other.language:"en";const E=function(t){for(var e,s=arguments.length,i=new Array(1i[parseInt(e,10)]):t};function O(i,n){h().fire({title:E("errorReport"),icon:"error",showCancelButton:!0,confirmButtonText:E("toGithub"),showDenyButton:!0,denyButtonText:E("toKeylol"),cancelButtonText:E("close")}).then(t=>{var{isDenied:e,isConfirmed:t}=t;if(t)window.open(`https://github.com/HCLonely/auto-task-v4/issues/new?title=${encodeURIComponent("脚本报错: "+n)}&labels=bug&body=`+encodeURIComponent(`错误链接: [${window.location.href}](${window.location.href}) 环境: @@ -124,10 +122,10 @@ ${$.makeArray($("#auto-task-info>li")).map(t=>t.innerText).join("\n")} 执行日志: [code]${$.makeArray($("#auto-task-info>li")).map(t=>t.innerText).join("\n")}[/code]`;const s=$("