【FSU】FIFA FUT WEB 增强器

FIFAFUT模式SBC任务便捷操作增强器👍👍👍,额外信息展示、近期低价自动查询、一键挂出球员、跳转FUTBIN、快捷搜索、拍卖行优化等等...👍👍👍

目前为 2023-07-11 提交的版本。查看 最新版本

// ==UserScript==
// @name         【FSU】FIFA FUT WEB 增强器
// @namespace    https://futcd.com/
// @version      4.0
// @description  FIFAFUT模式SBC任务便捷操作增强器👍👍👍,额外信息展示、近期低价自动查询、一键挂出球员、跳转FUTBIN、快捷搜索、拍卖行优化等等...👍👍👍
// @author       Futcd_kcka
// @match        https://www.ea.com/fifa/ultimate-team/web-app/*
// @match        https://www.easports.com/*/fifa/ultimate-team/web-app/*
// @match        https://www.ea.com/*/fifa/ultimate-team/web-app/*
// @icon         data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABkCAYAAABw4pVUAAAACXBIWXMAAAsTAAALEwEAmpwYAAAJ/ElEQVR4nO2dfbRVRRmHHxRNxDBNQlCWSqQ3MgOzUsNSCmOR5CIM+iJcZbhSpGWJSCpiUIvKzDJcoRCGRJlUrK5laloKSqRSkHx5L9GqqFiBukjFoAv98bunS+fMPmdmz+zZe9/O8w+LzZx3hv07Zz7eeeedHvv376eas+burnlWMHoBZwIXAAOAE4AewDbgb8DPgceB5/JqoA2rrulV86xnDu3woQ9wLTAJ6Fen3BRgF/AD4EbgL9k3LQwH5d0ABz4NtAFXU1+MCn2AS4DNwOeBg7NrWjjKIMi7gJXALcBrUnz+cOB6YCPwoXDNyoYiC/J64IfAL4C3B7D3OmAp8BBwXgB7mVBEQQ4B5gAbgPdnYH8E8DAwH+ifgX0viibIeNTnXxuhrsloTPpUhLqsKYogI4AVwN3ASRHr7Q3cBqwHPhyx3kTyFmQg6joeAobn2I4hwHeBVmBoju3IVZCrgHbUdRSFC4DfAjcDr8qjAXkIMg7YBHwFODSH+m24EthCDuNLTEHejKawy4BTItablqPR+LIGOD9WpTEEOQKYBzyJFnllYxhwP3AP8pllStaCVNwdlwWy9zTwReB24IU65fYBi5Efa2Wgui+iyw3TO5DNGrISZAxa2N0CHBvA3g7gE8Ab0RrlUmAwsNVQ9gU0a5oEzALOAd6LXCe+vAK5YbYAnwxgr4bQgrQAy4GfINdHCOYit8e3q55vB6Yays9E3+QD+RkSaTrwYoA29UO/0l8Sxq3zX0IJ8krUlWwELgxksxU4A5gBPJ9QxvQL+X0dm19GE4pvebWsi3NRlzgfOD6EwRCCXIamsTMC2ALNakYD7wOealD2MMOz2l2f/2Ubms6eBdzn3Dozk9E7uNLXkI8gI4FH0AxqgG9D0O7e1Wh6bPuiTO23/T/9Ggk/CfiD5Wfq0RstKB8A3pPWSBpBTgQWdFb8jrQVV/Ed4GS0WIzN4s66vwTsCWBvJNpCXgi8wfXDroLcCDyDZjwhaAXOBi5GM6m86ACuQZOSBYFsfhxN07+OxlgrbAU5Fg1eM9F+hS9bgY+gcWJVAHuh2Iqms+8kXLumIm/yMJvCNoIMANYRZnq3B5iNZjpLA9jbF8CGiUfRL3cKml77MhBNVs5sVLCRIIcAq4G+ARq1BC3mZgJ7A9iD5OlwKOYBr0XT5Y4A9lYCx9Ur0EiQxfjPr1ehvY6JwJ89bVUzJrA9Ey+iBWUL8CNPWwejRXMi9QQZCnzQo/KdKAznbOAxDzsmjkJuka8FtluPdrR1MBqNCWk5HU21jdQT5JspK9xPl7tjYUobSZwIfAP5km4IbNuW+4BT0WC9K6WNm5L+IUmQAaQbxJegPncGYcM4hwF3oQXcFegXkje3AoNIt3Y6BrldakgSZJxjBX9HHtWJmP1LaXkbis1aA3wUxe8WiZ10eReedPzseNPDpNjeMxwMP4vGmxDTwwrvRuPPhIA2s2QN8BbgN51/2tBiepgkyCCHxowinBgT0F5HzMjCowjXvZ6Lou/7WJQ1zl6TuqxjLBvwK+AJy7L1uBg5+75PXDFGo8j4LWh30zfo4iUUcW/DEaaHSYLYroBXW5Yz0RNN/9YBi9B4EZupKBh7ENrd3NL57EgPmw9aljO+4yRBak/xmHnZstyBHIkWWs8Ad6Jt2bx4vurvxyNnYBuKL667qk7AtvszvmPfDSqXAz89gOvQAmsucUNGk0hyh/RFe/dtwOccbXo5X2OeoLoX9dllohfwBdSV3W35Ga+peaxAuVMonxgHcolD2VIIMiRSPVnh4p22HX+NxBIkzeBfJEJtFzQkliBe35r/J/I+H9KkiqYgBaMpSMGIJUhm0eKR+JdD2bSbVkA8QTZFqicrjnYo6xXFGWulvh45EiuRfNWzrh6GZyYqi64O5KK4EG0VZ815aIewjeQvcQda2XvF98Z0nSzOwOZStDl0IFlMsQ9CMVqZU/ZB3bRgK0WSmSTKLohpZ64pSI6YuqdSewXKLoiJokWmONEdBWn+QnLENKg3fyE54rUqLiIx1yFvoiulhm+3sg+F0ZhOcmW1d/EoOm6dNIvbixLWjMPjvcYS5CTgd5HqyoLV6FSVDZeTPlA9Wpd1eqR6ssIlXrnac+BEkiChB8aXAtuLzeEOZV0ckTX4BsrZUuqpaEzKPsvqdjQFKRhNQQpGUxA7onmQm4LY0SjDUDCagtjRGquipiCNuQMd5omCryBZ5RqJRb3//xKUgcI10bOXLy3Jl2W7Ui+1qxt4teHZ7cgXVS9VYD1MWe6sSfqG2M4qTvOpvAB8r/PPPSgb3BB0CjitGGCfw974jpN+Ic9aGh2FAsP+alm+aCxCp4ifQ7kYQzDRspzx5rWkX8gfLY0eim42KDNPE06MZdjnKTbWmSTIOodGtKC7P051+Ex3oy+67sIlJUm76WGSID92bNBw1O/egHkR1Z29vZeiEFPXC2GMebOSBNlMupxQs9CJ1epDkt1u7xvdNbIeJWV2TTTwMo6CAHzGsZIK/dFiajVKXgbh0o4XgcEoQ1Er6Q+zziZhDVdvT/0BlCMw7VVEb0WZ5NYRJ0I9aw5DNyNM87SzDaVlN9JopX4R/smFTyOicy4jJqNUIL5iQIM8kY0E2U6+l3XlzXCUpWg+SvXqywR0x1UiNr6sJ1BCs9Jc8BuAgciXtYIwWYr+DYzFInWTrXPxKZQ17q70bSoFPVGCnE0o83YI7kUZj5bbFHbx9u4EPoaypj3u2qoSMAmNE7NxC/tJog1dHTsGhzOWadzvj6CMpVOAP6X4fNEYjlK/3kmYlFG7UFbWFtwX2F77IfM6K72ZYq3EbdtyHMoBvAI5SUOwBL2TuaTcK/LdoNoNfBYtkGzzSWWNTaKb6ahLuSJQnZUrxieiJJipCbWFuwmlJR+LZ2xrAOqdEx8LrEXf4BBro3bkJhpJoHE19J76cpRU+Crgn4Ft2zKL2oyfLcBPUTL9UJtqN6HjFUHTqWcV5PBVlOkzdVi+Byeg2dJ16JabRej2uFAZ7ZYiV9A0MogpyPJ8yA7URy9A+dFHZlhXNf3R9DUka9F4memGXIwwoLXoct/xaCAtG/9Ah3CGEmF3NGZc1j3IDT+d+vfYFonKOHFbrApjB8p1oOuDBqOr8orK/cjdMY2w1240JK/Ixe0o3/s5FCtIYiO6OW4UCn6ITt6hpCvpupoiVORHGnajTNZDiBjHayJvQSosRLdtXp9D3beiW4ESd/FiUhRBQAdD56BFXIg7DhvxIOoyp+Lp7ghJkQSpsJmuW0BD3E1STTu6zfN81GUWiiIKUqEVBUpMRndc+bIXdYknE+6+2+AUWZAKd6CX6LMWqKyB5lCsrYIayiAIyFF5OUqiuczhcw+jDajxKICv8MRMPhOCDcAH0M7eaGAE0I+uAOcdaI3zGNrL3pBDG734D+mntpkNC0pxAAAAAElFTkSuQmCC
// @grant        GM_addStyle
// @grant        GM_openInTab
// @grant        GM_xmlhttpRequest
// @grant        GM_getValue
// @grant        GM_setValue
// @connect      ea.com
// @connect      futbin.com
// @connect      futbin.org
// @connect      futcd.com
// @license      MIT
// ==/UserScript==

(function () {
    'use strict';
    window.requirementTarget = "";
    var events = {},info = {},cntlr = {},html = {},call = {},set = {},pdb = {};
    info = {
        "unassigned":{"state":false,"run":0,"playerId":[],"rating":0,"rlist":[]},
        "task":{"obj":{"stat":{},"html":""},"sbc":{"stat":{},"html":""}},
        "base":{"state":false,"platform":"pc","price":{},"sId":"","localization":"",autoLoad:true,"ratings":{},"input":true,"promo":0,"template":false,"losauction":false},
        "criteria":{"state":false,"data":{},"repeat":0},
        "roster":{"state":false,"data":{},"page":-1,"element":{},"thousand":{"lowest":99}},
        "language":"en",
        "localization":{},
        "quick":{},
        "build":{"league":true,"rare":true},
        "league":{2012:'中超',61:'英乙',60:'英甲',14:'英冠',13:'英超',2208:'英丙',2149:'印超',32:'意乙',31:'意甲',54:'西乙',53:'西甲',68:'土超',50:'苏超',308:'葡超',39:'美职联',17:'法乙',16:'法甲',20:'德乙',19:'德甲',2076:'德丙',2118:'传奇',353:'阿甲'},
        "setfield":{"card":["pos","lea","price","other","club","low"],"player":["auction","futbin","getprice","loas"],"sbc":["top","right","quick","duplicate","records","input","template","market"],"info":["obj","sbc","sbcf","sbcs","pack","auction","squad"]},
        "set":{},
        "formation":{23:[25,18,25,16,14,14,12,5,5,5,0],
            24:[21,25,21,16,14,14,12,5,5,5,0],
            25:[27,25,23,16,14,14,12,5,5,5,0],
            27:[25,18,25,16,10,10,12,5,5,5,0],
            14:[25,18,25,16,10,12,7,5,5,3,0],
            15:[25,18,25,14,10,14,7,5,5,3,0],
            2:[25,16,14,14,12,10,7,5,5,3,0],
            3:[25,18,18,18,10,10,7,5,5,3,0],
            4:[25,16,18,12,10,10,7,5,5,3,0],
            13:[25,25,18,18,10,10,7,5,5,3,0],
            6:[25,25,18,14,14,14,7,5,5,3,0],
            7:[21,25,21,14,14,14,7,5,5,3,0],
            8:[27,25,23,14,14,14,7,5,5,3,0],
            9:[27,25,23,14,10,14,7,5,5,3,0],
            10:[27,25,23,10,14,10,7,5,5,3,0],
            11:[27,25,23,14,18,14,7,5,5,3,0],
            12:[27,21,23,14,10,14,7,5,5,3,0],
            19:[25,21,16,14,14,12,7,5,5,3,0],
            16:[25,25,16,14,14,12,7,5,5,3,0],
            17:[25,25,16,10,10,12,7,5,5,3,0],
            21:[25,16,18,14,18,12,7,5,5,3,0],
            20:[25,16,14,14,14,12,7,5,5,3,0],
            29:[25,18,25,14,14,8,5,5,5,2,0],
            30:[27,25,23,14,14,8,5,5,5,2,0],
            31:[25,25,14,10,14,8,5,5,5,2,0],
            33:[25,16,14,14,12,8,5,5,5,2,0],
            18:[25,18,16,14,14,12,7,5,5,3,0],
            5:[25,25,27,23,14,14,7,5,5,3,0],
            1:[25,25,14,16,10,12,7,5,5,3,0],
            22:[25,25,16,14,10,14,12,5,5,5,0],
        }
    };
    cntlr = {
        "current":function(){return getAppMain().getRootViewController().getPresentedViewController().getCurrentViewController().getCurrentController();},
        "right":function(){return getAppMain().getRootViewController().getPresentedViewController().getCurrentViewController().getCurrentController()._rightController._currentController},
        "left":function(){return getAppMain().getRootViewController().getPresentedViewController().getCurrentViewController().getCurrentController()._leftController},
    };
    events.notice = function(text,type){
        services.Notification.queue([fy(text),type])
    };
    events.init =  async function(){
        set.init();
        info.base.sId = services.Authentication.sessionUtas.id;
        console.log(info.base.sId)
        let locale = services.Messages.messagesDAO.authDelegate.sessionUtas.locale;
        info.language = 2;
        info.base.year = APP_YEAR_SHORT;
        if(locale.language == "zh"){
            info.language = locale.variant == "Hans" ? 0 : 1;
        }
        console.log(info.language)
        GM_xmlhttpRequest({
            method:"GET",
            url:"https://futcd.com/data/fsuupdata.json",
            timeout:8000,
            headers: {
                "Content-type": "application/json"
            },
            onload:function(res){
                let urlText = fy("top.readme");
                let urlLink = "https://mfrasi851i.feishu.cn/wiki/wikcng1Ih7fFRidBfMdNS9SrucR";
                if(res.status == 404){
                    events.notice("notice.upgradefailed",2);
                }else{
                    let data = JSON.parse(res.response);
                    let myVersion = Number(GM_info.script.version) || 0;
                    if(data["version"] > myVersion){
                        urlText = fy("top.upgrade");
                        urlLink = data["updateURL"];
                        events.notice("notice.upgradeconfirm",1);
                    }
                }
                getAppMain()._FIFAHeader._view.__fifaLink.insertAdjacentHTML('afterend', `<a class="header_explain" href="${urlLink}" target="_blank">${urlText}</a>`);
            },
            onerror:function(){
                events.notice("notice.upgrade.failed",2);
            }
        })
        let user = services.User.getUser().getSelectedPersona();
        if(user.isXbox || user.isPlaystation || user.isStadia){
            info.base.platform = "ps";
            info.base.platform = "ps";
        }
        services.User.maxAllowedAuctions = 100;
        GM_xmlhttpRequest({
            method:"GET",
            url:"https://futcd.com/data/futpricenew.json",
            headers: {
                "Content-type": "application/json"
            },
            onload:function(res){
                let data = JSON.parse(res.response);
                if(info.base.platform == "pc"){
                    info.base.price = data["pc"];
                }else{
                    info.base.price = data["tv"];
                }
            },
        });
        let lb = events.createButton(
            new UTButtonControl(),
            fy("loadingclose.text"),
            async(e) => {
                events.hideLoader()
            },
            "fsu-loading-close"
        )
        info.base.close = lb;
        document.querySelector(".ut-click-shield").append(info.base.close.__root);
        info.base.localization = services.Localization.repository._collection;
        await events.wait(0.5,1);
        GM_xmlhttpRequest({
            method:"GET",
            url:`https://utas.mob.v1.fut.ea.com/ut/game/fifa${info.base.year}/scmp/campaign/categories`,
            headers: {
                "Content-type": "application/json",
                "X-UT-SID": info.base.sId
            },
            onload:function(response){
                if(response.response){
                    let data = JSON.parse(response.response);
                    let nowDate = Math.round(new Date().getTime()/1000);
                    let objJson = {reward:"",new:{"-1":0}};
                    let rewardJson = {"player":0,"pack":0};
                    for (let i = 0; i < data.length; i++) {
                        data[i].groupsList.forEach( (item,key) => {
                            let tempJson = {"f":0,"e":0}
                            if(item.groupType !== 2){
                                if(item.startTime >= nowDate - 86400){
                                    tempJson.f = 1;
                                    objJson.new["-1"]++;
                                    if(objJson.new.hasOwnProperty(data[i].categoryId)){
                                        objJson.new[data[i].categoryId]++;
                                    }else{
                                        objJson.new[data[i].categoryId] = 1;
                                    }
                                    for (let z = 0; z < item.awardsList.length; z++) {
                                        if(item.awardsList[z].awardType == "pack"){
                                            rewardJson["pack"]++;
                                        }
                                        if(item.awardsList[z].awardType == "item"){
                                            if(item.awardsList[z].itemDataReduced.itemType == "player"){
                                                rewardJson["player"]++;
                                            }
                                        }
                                    }
                                }
                                if(item.endTime <= nowDate + 86400 && item.endTime !== 0){
                                    tempJson.e = 1;
                                }
                            }
                            objJson[`${item.groupType.toString()}-${item.groupId.toString()}`] = tempJson;
                        })
                    }
                    let reward = [];
                    if(rewardJson["player"] > 0){
                        reward.push(fy("task.player"))
                    }
                    if(rewardJson["pack"] > 0){
                        reward.push(fy("task.pack"))
                    }
                    objJson.reward = reward.join("、");
                    info.task.obj.stat = objJson;
                    info.task.obj.html = events.taskHtml(objJson.new["-1"],objJson.reward);
                }
                
            },
        })
        GM_xmlhttpRequest({
            method:"GET",
            url:"https://futcd.com/data/futsbc.json",
            headers: {
                "Content-type": "application/json",
                "Cache-Control": "600"
            },
            onload:function(res){
                let sbcJson = JSON.parse(res.response);
                info.task.sbc.stat = sbcJson;
                info.task.sbc.html = events.taskHtml(sbcJson.new["0"],sbcJson.reward);
            },
        })

        GM_xmlhttpRequest({
            method:"GET",
            url:"https://futcd.com/data/promo.json",
            headers: {
                "Content-type": "application/json",
                "Cache-Control": "600"
            },
            onload:function(res){
                let n = JSON.parse(res.response);
                info.base.promo = n.n;
            },
        })
        events.notice("notice.succeeded",0);
        const staticData = services.Item.itemDao.itemRepo.getStaticData();
        for (let item of staticData) {
            if(!info.base.ratings.hasOwnProperty(item.rating)){
                info.base.ratings[item.rating] = [];
            }
            info.base.ratings[item.rating].push(item.id)
        }
        var dataNumber = [0,250,500,750];
        const itemFactory = new UTItemEntityFactory();
        for (const key in dataNumber) {
            console.log("读取第几页",key)
            let tempData = await getThousand(dataNumber[key]);
            for (let item of tempData.itemData) {
                if(!item.hasOwnProperty("loans")){
                    info.roster.thousand[item.resourceId] = {"untradeable":item.untradeable,"rating":item.rating,"id":item.id};
                    if(!info.base.ratings.hasOwnProperty(item.rating)){
                        info.base.ratings[item.rating] = [];
                    }
                    if(!info.base.ratings[item.rating].includes(item.resourceId)){
                        info.base.ratings[item.rating].push(item.resourceId)
                    }
                    services.Item.itemDao.itemRepo.club.addClubItem(itemFactory.createItem(item))
                    if(item.rating < info.roster.thousand.lowest){
                        info.roster.thousand.lowest = item.rating;
                    }
                }
            }
        }
    };
    function getThousand(dataNumber){
        return new Promise(res => {
            let postData = {"count": 250,"sort": "desc","sortBy": "ovr","start": dataNumber,"type": "player"};
            GM_xmlhttpRequest({
                method:"POST",
                url:`https://utas.mob.v1.fut.ea.com/ut/game/fifa${info.base.year}/club`,
                headers: {
                    "Content-type": "application/json",
                    "X-UT-SID": info.base.sId
                },
                data:JSON.stringify(postData),
                onload:function(response){
                    if(response.response){res(JSON.parse(response.response))}
                },
            })
        })
    };
    events.taskHtml = function(number,text){
        let html = "<div>{Number}</div><div>{reward}</div>";
        if(number > 0){
            html = html.replace("{Number}",fy("task.added") + number);
        }else{
            html = html.replace("fsu-task","fsu-task no");
            html = html.replace("{Number}",fy("task.noadded"));
        }
        if(text == "、"){
            text = "";
        }
        let reward = text;
        reward = reward.replace("组合包",fy("task.pack"));
        reward = reward.replace("球员",fy("task.player"));
        html = html.replace("{reward}",reward);
        return html;
    };
    events.showLoader = () => {
        document.querySelector(".ut-click-shield").classList.add("showing","fsu-loading");
        document.querySelector(".loaderIcon").style.display = "block";
    };
    events.hideLoader = () => {
        document.querySelector(".ut-click-shield").classList.remove("showing","fsu-loading");
        document.querySelector(".loaderIcon").style.display = "none";
        if(info.base.template){
            info.base.template = false;
            isPhone() ? cntlr.current()._view._fsuSquad.setInteractionState(1) : cntlr.right().getView()._fsuSquad.setInteractionState(1);
        }
        if(info.base.losauction){
            info.base.losauction = false;
            if(isPhone()){
                events.notice("notice.phoneloas",0)
            }
        }
        events.changeLoadingText("loadingclose.text");
    };
    events.L10n = function(param) {
        let text = "";
        if(param.indexOf("{") !== -1){
            text = param;
            let paramArr = param.match(/{(.*?)}/g);
            for (let item of paramArr) {
                let paramFormat = item.match(/{(.*?)}/)[1];
                if(info.localization[info.language].hasOwnProperty(paramFormat)){
                    text = text.replace(item,info.localization[info.language][paramFormat]);
                }
            }
        }else{
            text = info.localization[info.language].hasOwnProperty(param) ? info.localization[info.language][param] : param;
        }
        return text;
    }
    const fy = function(p){
        let t = "";
        if(Array.isArray(p)){
            t = info.localization[p.shift()][info.language];
            let s = p.slice();
            for (let n in s) {
                t = t.replace(`%${Number(n) + 1}`,`${s[n]}`);
            }
        }else if(p.indexOf("{") !== -1){
            t = p;
            let pa = p.match(/{(.*?)}/g);
            for (let i of pa) {
                let pf = i.match(/{(.*?)}/)[1];
                if(info.localization.hasOwnProperty(pf)){
                    t = t.replace(i,info.localization[pf][info.language]);
                }
            }
        }else{
            t = info.localization.hasOwnProperty(p) ? info.localization[p][info.language] : p;
        }
        return t;
    }
    info.localization = {
        "price.btntext":["查询价格","查詢價格","Check Price"],
        "price.formatno":["无数据","沒有數據","No Data"],
        "price.formatcompany":["万","萬","ten thousand"],
        "price.now":["球员低价","最低價格","Low Price"],
        "price.low":["评分低价","評分最低價格","Rating Price"],
        "price.last":["购买价格","購入價格","Bought Price"],
        "duplicate.swap":["可发送俱乐部","可以送到球會","Can be Sent to Club"],
        "duplicate.not":["队内不可交易","球會球員無法交易","Club Players are Untradeable"],
        "duplicate.yes":["队内可交易","球會球員可交易","Club Players are Tradable"],
        "duplicate.nodata":["无队内数据","沒有球員數據","No Club Players Data"],
        "duplicate.lowprice":["评分低价:","評分最低價格:","Rating Price "],
        "top.readme":["【FSU】插件使用说明","【FSU】插件使用說明","【FSU】Plugin Instructions"],
        "top.upgrade":["有新版FSU插件可升级","有新版本的FSU插件可更新","There is a new version of the FSU plugin that can be upgraded"],
        "notice.upgradefailed":["查询新版本失败","查詢新版本失敗","Query new version failed"],
        "notice.upgradeconfirm":["有新版本点击顶部链接查看","有新版本點擊頂部鏈接查看","There is a new version, click the top link to view"],
        "notice.uasreset":["已重新载入列表 请重新进入查看","已重新載入列表 請重新進入查看","The list has been reloaded, please re-enter to view"],
        "notice.priceloading":["开始读取价格数据 请稍等","開始讀取價格數據 請稍等","Start reading price data, please wait"],
        "notice.loaderror":["读取数据失败 请检查网络","讀取數據失敗 請檢查網絡","Failed to read data, please check the network"],
        "notice.succeeded":["FSU插件加载成功","FSU插件載入成功","FSU plugin loaded successfully"],
        "notice.duplicateloading":["开始读取重复球员数据 请稍等","開始讀取重複球員數據 請稍等","Start reading duplicate player data, please wait"],
        "notice.quicksearch":["使用快捷添加 直接沿用上次配置搜索球员","使用快捷增加球員 直接沿用上次配置搜索球員","Use the shortcut to add, directly follow the last configuration to search for players"],
        "notice.appointloading":["开始读取指定评分球员 请稍等","開始讀取指定評分球員 請稍等","Start reading assigned rating player please wait "],
        "notice.noduplicate":["已无重复球员","已經沒有重複球員","no duplicate player"],
        "notice.quickauction":["球员将按照最低售价作为即买价挂出","球員將按最低價格列在轉會市場上","Players will be listed at the lowest selling price as an immediate purchase price"],
        "task.player":["球员","球員","Player"],
        "task.pack":["组合包","組合包","Pack"],
        "task.added":["今日新增:","今日新增:","Added today "],
        "task.noadded":["今日无新增","今日沒有新增","No new additions today"],
        "task.new":["新","新","New"],
        "task.expire":["即将到期","即將過期","Expiring"],
        "task.nodata":["无数据请过段时间重新进入WEBAPP再查看","沒有數據請過段時間重新進入WEBAPP再查看","No data, please re-enter WEBAPP after a while to check"],
        "sbc.price":["造价预估:","製作價格:","Cost estimate:"],
        "sbc.topprice":["预估造价","製作價格","Estimate"],
        "sbc.topsquad":["阵容价值","球隊價格","Squad"],
        "sbc.like":["值得做:","贊成:","Thumbs Up:"],
        "sbc.dislike":["不值得:","反對:","Thumbs Down:"],
        "sbc.consult":["抄作业","參考方案","See Plan"],
        "sbc.count":["算评分","計算評分","Calculate Score"],
        "sbc.duplicates":["重复球员名单","重複球員名單","Duplicate Players List"],
        "sbc.qucikdupes":["重","重","D"],
        "sbc.appoint":["指定评分球员名单","指定評分球員名單","Assign Rating Players List"],
        "sbc.addduplicate":["添加重复球员","新增重複球員","Add Duplicate Players"],
        "sbc.swapduplicate":["替换为重复球员","交換為重複球員","Swap Duplicate Players"],
        "sbc.notduplicate":["无重复球员","沒有重複球員","No Duplicate Players"],
        "sbc.addquick":["快捷添加球员","快速新增球員","Quick Add Player"],
        "sbc.swapquick":["快捷替换球员","快速交換球員","Quick Swap Player"],
        "sbc.watchplayer":["查看球员","查看球員","Watch Player"],
        "uasreset.btntext":["重载名单","重新載入名單","Reload List"],
        "sbc.filtert":["筛选","篩選","Filter"],
        "sbc.filter0":["全部","全部","All"],
        "sbc.filter1":["新增","新增","New"],
        "sbc.filter2":["临期","即期","Expiring"],
        "sbc.filter3":["高评价","高評價","Approval"],
        "loadingclose.text":["数据载入 如卡顿点此关闭","數據載入中 如長時間未響應 請點擊此處關閉","If you encounter stuck, click here to close"],
        "quicklist.gotofutbin":["前往FUTBIN查看","前往FUTBIN查看","Go to FUTBIN"],
        "quicklist.auction":["按低价快速拍卖","使用最低價格列入轉會","Quick Auction at Low Price"],
        "pack.promo":["特殊球员","特殊球員","PROMO"],
        "emptylist.t":["处理后无符合条件球员","處理後無符合條件球員","No eligible players after processing"],
        "emptylist.c":["请改变条件或翻页查看","請改變條件或翻頁查看","Please change the criteria or flip the page to view"],
        "set.title":["FSU设置","FSU設定","FSU Settings"],
        "set.card.title":["球员卡信息","球員卡資訊","Player Card Information"],
        "set.card.pos":["额外位置","額外位置","Extra Position"],
        "set.card.lea":["所属联赛","所屬聯賽","Affiliated League"],
        "set.card.price":["球员价格","球員價格","Player Price"],
        "set.card.other":["其他属性","其他屬性","Other Attributes"],
        "set.card.club":["俱乐部内球员","俱樂部內球員","Club Players"],
        "set.card.low":["评分低价","評分低價","Low Rating Price"],
        "set.sbc.title":["SBC操作","SBC 操作","SBC Operations"],
        "set.sbc.top":["阵容顶部按钮","陣容頂部按鈕","Top Buttons"],
        "set.sbc.right":["阵容右侧按钮","陣容右側按鈕","Right-side Buttons"],
        "set.sbc.quick":["快捷添加球员","快速添加球員","Quick Add Players"],
        "set.sbc.duplicate":["重复球员填充","重複球員填充","Fill with Duplicate Players"],
        "set.sbc.records":["选项记录","選項記錄","Option Records"],
        "set.sbc.input":["信息输入检索","資訊輸入檢索","Information Input Search"],
        "set.info.title":["信息展示","資訊展示","Information Display"],
        "set.info.obj":["目标顶部显示","目標頂部顯示","Objective top display"],
        "set.info.sbc":["SBC","SBC","SBC"],
        "set.info.sbcf":["SBC筛选","SBC篩選","SBC Filters"],
        "set.info.sbcs":["SBC子任务","SBC子任務","SBC Subtasks"],
        "set.info.pack":["球员包可开球员","球員包可開球員","Pack PROMO"],
        "set.info.auction":["拍卖紧凑显示","拍賣緊湊顯示","Compact Auction Display"],
        "set.info.squad":["阵容价值","陣容價值","Squad Value"],
        "set.style.title":["球员卡信息样式","球員卡資訊樣式","Player Card Information Style"],
        "set.style.new":["随品质变化","隨品質變化","Varies with Quality"],
        "set.style.old":["纯色样式","純色樣式","Solid Color Style"],
        "set.player.title":["选中球员操作","選中球員操作","Select Player Action"],
        "set.player.auction":["按低价快速拍卖","按低價快速拍賣","Quick Auction at Low Price"],
        "set.player.futbin":["前往FUTBIN查看","前往FUTBIN查看","Go to FUTBIN for Details"],
        "quicklist.getprice":["查询拍卖低价","查詢拍賣低價","Search for Auction Price"],
        "quicklist.getpricey":["刷新拍卖低价","重新整理拍賣低價","Refresh Auction Price"],
        "set.player.getprice":["查询拍卖低价","查詢拍賣低價","Search for Auction Price"],
        "quicklist.getpricelt":["最低价","最低價","Lowest price"],
        "quicklist.getpriceload":["读取中","讀取中","Loading"],
        "sbc.swaprating":["替换为同评分","替換為同評分","Replace with the same rating"],
        "sbc.squadfill":["FUTBIN方案智能填充","FUTBIN方案智能填充","FUTBIN squad intelligent autofill"],
        "notice.templateload":["读取FUTBIN方案并比价中 请稍后","讀取FUTBIN方案並比價中 請稍後","Reading FUTBIN squad and comparing prices. Please wait."],
        "notice.templateerror":["方案保存失败 请重新尝试","方案保存失敗 請重新嘗試","Failed to save the squad. Please try again."],
        "notice.templatesuccess":["FUTBIN方案加载成功","成功載入 FUTBIN 方案","FUTBIN squad loaded successfully"],
        "notice.templatezero":["无可加载方案 请稍后再试","無可載入的方案 請稍後再試","No available squad to load. Please try again later."],
        "set.sbc.template":["FUTBIN方案填充","FUTBIN方案填充","FUTBIN squad autofill"],
        "notice.marketsetmax":["已修改优化搜索信息可直接搜索 如无结果请返回调整参数","已修改優化搜尋資訊,可直接搜尋。如無結果,請返回調整參數。","Optimizations have been made to the search information. You can now search directly. If there are no results, please return and adjust the parameters."],
        "set.sbc.market":["假想球员拍卖搜索优化","假想球员拍賣搜尋優化","Fantasy Player Auction Search Optimization"],
        "notice.auctionsuccess":["%1 挂牌 %2 成功","%1 掛牌 %2 成功","%1 listed %2 successfully."],
        "notice.auctionnoplayer":["%1 没有找到球员","%1 沒有找到球員","%1 player not found."],
        "notice.auctionlimits":["%1 FUTBIN价格超出球员限价","%1 FUTBIN價格超出球員限價","The FUTBIN price for %1 exceeds player limit."],
        "notice.auctionmax":["已达到拍卖行上限","已達到拍賣行上限","Auction house limit reached."],
        "losa.all":["全选","全選","Select All"],
        "losa.select":["已选球员","已選球員","Selected"],
        "losa.price":["共计可售","共計可售","Total"],
        "loas.button":["拍卖所选球员","拍賣所選球員","Auction Selected Players"],
        "loas.popupt":["球员批量挂拍卖提示","球員批量掛拍賣提示","Bulk Auction Listing Reminder for Players"],
        "loas.popupm":["已选择本列表中 %1 个球员拍卖价格大致为 %2 ,请点击确认开始陆续上架拍卖,途中可点击加载图标下文字取消。","已選擇本列表中 %1 個球員拍賣價格大致為 %2 ,請點擊確認開始陸續上架拍賣,途中可點擊加載圖標下文字取消。","You have selected approximately %1 players from this list, with an estimated auction price of %2. Please click confirm to start listing them for auction one by one. You can click the text below the loading icon to cancel during the process."],
        "loas.start":["程序开始批量售卖球员 预计耗费 %1 秒","程式開始批量售賣球員 預計耗費 %1 秒","The program starts to sell players in bulk, which is expected to take %1 of seconds"],
        "loadingclose.template1":["读取FUTBIN阵容中 点此可结束程序","讀取FUTBIN陣容中 點此可結束程式","Read the FUTBIN lineup, click here to end the program"],
        "loadingclose.template2":["正在读取方案 %1 阵容 剩余 %2 方案 点此可结束程序","正在讀取和比對方案 %1 陣容 剩餘 %2 方案 點此可結束程式","Reading and comparing plan %1 lineup, remaining %2 plans, click here to end the program"],
        "loadingclose.loas":["正在挂牌第 %1 个球员 剩余 %2 个 点此可结束程序","正在掛牌第 %1 個球員 剩餘 %2 個 點此可結束程式","The %1 players are being listed, and the remaining %2, click here to end the program"],
        "set.player.loas":["批量拍卖球员","批量拍賣球員","Bulk Auction Players"],
        "notice.squaderror":["阵容位置匹配失败 请联系解决","陣容位置匹配失敗 請聯絡解決","Lineup position matching failed, please contact to solve it."],
        "set.getdoc":["查看设置说明","檢視設定說明","View setup instructions"],
        "builder.league":["排除五大联赛球员","排除五大聯賽球員","Exclude top five leagues"],
        "builder.rare":["排除周最佳球员","排除周最佳球員","Exclude TOTW"],
        "notice.phoneloas":["请注意手机端挂牌后需重新进入拍卖清单才会刷新显示。","請注意手機端掛牌後需重新進入拍賣清單才會重新整理顯示。","Please note that after listing on the mobile terminal, you need to re-enter the auction list before refreshing the display."],
        "notice.builder":["通过排除后球员数量已不足11位,如需要请调整条件再次搜索。","通過排除後球員數量已不足11位,如需要請調整條件再次搜尋。","After the exclusion, the number of players is less than 11. If necessary, please adjust the conditions to search again."],
        "notice.conceptdiff":["发现所购买的假想球员有多个版本,已经将非搜索版本的亮度。","發現所購買的假想球員有多個版本,已經將非搜尋版本的亮度。","Found that there are multiple versions of the purchased hypothetical player, the brightness of the non-searched version has been added."],
    }
    html = {
        "priceBtn":"<button class=\"flat pagination fsu-getprice\" id=\"getprice\">{price.btntext}</button>",
        "priceBtn2":"<button class=\"btn-standard section-header-btn mini call-to-action fsu-getprice\" id=\"getprice\">{price.btntext}</button>",
        "taskBar":"<div class=\"fsu-task-bar\">{Number}</div>",
        "sbcInfo":"<div class=\"fsu-sbc-info\"><div class=\"currency-coins\">{sbc.price}{price}</div><div><span>{sbc.like}{up}</span><span>{sbc.dislike}{down}</span></div></div>",
        "consultBtn":"<a href=\"https://www.futbin.com/squad-building-challenges/ALL/{sbcId}\" target=\"_blank\" class=\"fsu-consult fsu-sbcButton\">{sbc.consult}</a>",
        "countBtn":"<a id=\"goToCount\" href=\"javascript:void(0)\" class=\"fsu-count\">{sbc.count}</a>",
        "searchInput":"<input type=\"text\" class=\"fsu-input\" placeholder=\"{text}\" maxlength=\"50\">",
        "uasBtn":"<button class=\"btn-standard section-header-btn mini call-to-action fsu-getprice\" id=\"uasreset\">{uasreset.btntext}</button>",
    };
    info.base.sytle = ".tns-horizontal.tns-subpixel>.tns-item{position: relative;}button.notevents{pointer-events: none;color: #a4a9b4;}.btn-standard.section-header-btn.mini.call-to-action.fsu-getprice{margin-left: 1rem;}.btn-standard.section-header-btn.mini.call-to-action.fsu-getprice:hover{background-color:#e9dfcd}.view-modal-container.form-modal header .fsu-getprice{position: absolute;top: .5rem;left: 0;height: 2rem;line-height: 2rem;}.fsu-task-bar{position: absolute;right: .2rem;top: 0;}.ut-objective-entry-view--title span.task-new{padding-left: 0.5rem;padding-right: 0.8rem;background-color: #d31332;margin-right: 0.2rem;}.ut-sbc-set-tile-view .tileHeader span.task-new{padding-left: 0.3rem;padding-right: 0.8rem;background-color: #d31332;margin-right: 0.2rem;}.ut-sbc-set-tile-view.production-tagged .tileHeader::before{display:none;}.fsu-task{display: flex;justify-content: space-between;padding: 0.5rem;background-color: #d31332;}.fsu-task.no{background-color: #d313325c;}.task-expire{background-color: #d313325c;height: 2rem;line-height: 2rem;text-align: center;}a.header_explain{color: #a2a2a2;text-decoration: none;line-height: 3rem;}a.header_explain:hover{color: #ffffff;}.ut-fifa-header-view{display: flex;justify-content: space-between;}    .fsu-loading-close{display: none;position: absolute;bottom: 40%;z-index: 999;}.fsu-loading .fsu-loading-close{display: block;}          .fsu-task-bar-favorite{background-color: rgb(255,86,48);right: 0.2rem;top: 2px;color: #ffffff;padding: 0 6px;border-radius: 4px;line-height: 1.2rem;position: absolute;}                                                     .fsu-sbc-info{padding: 0.5rem;background-color: #d313325c;display: flex;font-family: UltimateTeamCondensed,sans-serif;justify-content: space-between;font-size: 1rem;}.fsu-sbc-info div{width: 50%;}.fsu-sbc-info div:last-child{display: flex;justify-content: space-around;}.fsu-sbc-info .currency-coins::after{font-size:16px}                .rewards-footer li{position: relative;}.fsu-sbc-vplayer {position: absolute;bottom: .25rem;right:0;background-color: #8A6E2C;padding: .5rem;color: #15191d;line-height: 1rem;font-size: 16px;}.fsu-sbc-vplayer:hover{background-color: #f6b803;}                 @media screen and (min-width:1280px) and (max-width:1441px) {.ut-split-view {padding:0;}.ut-split-view>.ut-content {max-height:100%;}}            .fsu-squad-pBox{display:flex}.fsu-squad-pWrap{margin:.5em}.fsu-squad-pTitle{width:100%;word-break:keep-all;font-size:.8em;display:block;overflow:hidden;text-overflow:ellipsis;text-transform:uppercase;white-space:nowrap}.fsu-squad-pValue{font-family:UltimateTeamCondensed,sans-serif;font-weight:400;font-size:1.125em;text-overflow:ellipsis;white-space:nowrap;line-height: 1.8rem;}.fsu-squad-pValue.currency-coins::after{font-size:1rem;margin-left:.2em !important;margin-top:-.2em !important}.fsu-squad-pTitle .plus{color:#36b84b;padding-left:.1rem}.fsu-squad-pTitle .minus{color:#d21433;padding-left:.1rem}         li.with-icon.hide {display: none;}                      .fsu-input{border: 0 !important;background-color: rgba(0,0,0,0) !important;padding-left: 0 !important;font-family: UltimateTeamCondensed,sans-serif;font-size: 1em;color: #f8eede;}                  .fsu-quick{position:absolute;top:100%;width:100%;display:flex;align-items:center;font-family:UltimateTeam,sans-serif;justify-content:center;margin-top:.2rem}.fsu-quick.top .fsu-quick-list{display:flex;align-items:center}.fsu-quick-list .im{height:1.8rem;line-height:1.8rem;cursor:pointer;background-color:#2b3540;font-family:UltimateTeam,sans-serif;border-radius:4px;padding:0 .2rem;font-size:1rem;font-weight:900;color:#f2f2f2;overflow: hidden;}.fsu-quick-list .im:hover{background-color:#394754}.fsu-quick-list.other .im{background-color:#f8eede;color:#ef6405;font-weight:500;margin-left:.3rem;text-align:center;}.fsu-quick-list.other .im:hover{background-color:#f5efe6}.fsu-quick-list .im span{font-size:.8rem;font-weight:300;color:#a4a9b4}.fsu-quick-list.left .im{margin-right:.3rem}.fsu-quick-list.right .im{margin-left:.3rem}.fsu-quick-inr{font-size:.8rem;margin:0 .3rem}.fsu-quick.right{position:absolute;top:50%;width:2rem;display:block;right:0%;z-index:3;-webkit-transform:translateY(-50%) !important;transform:translateY(-50%) !important}.fsu-quick.right .fsu-quick-list .im{width:1.4rem;margin-bottom:.2rem;text-align:center}.entityContainer>.name.untradeable{color:#f6b803}        .btn-standard.section-header-btn.mini.call-to-action.fsu-uasreset{margin-left: 1rem;}                                      .fsu-promo-box{flex:auto;display:flex;justify-content:flex-end}.landscape button.currency.fsu-promo{margin-top:-.25rem;text-align:justify;padding:.25rem .5rem;width:6.6rem;color:#f2f2f2;background-color:#556c95}.landscape button.currency.fsu-promo:hover{background-color:#ef6405}.landscape button.currency.fsu-promo .text{font-size:2rem;font-weight:600;height:2rem;line-height:2rem}.landscape button.currency.fsu-promo .subtext{font-size:.6rem;line-height:1rem;font-weight:600;text-transform:uppercase}.landscape button.currency.fsu-promo::after{background-image:url(https://www.ea.com/fifa/ultimate-team/web-app/images/branding/settings.png) !important;background-position:center;background-repeat:no-repeat;background-size:100%;content:'';display:inline-block;top:-.8rem;vertical-align:middle;height:5rem;margin-top:0;position:absolute;width:5rem;right:-1.2rem}                           .fsu-cards-pos,.fsu-cards-attr,.fsu-cards-lea-small,.fsu-cards-lea-large,.fsu-cards-price{position:absolute;z-index:2;font-family:UltimateTeamCondensed,sans-serif;font-weight:300;text-align:center;width:1.6rem;top:25%}.fsu-cards-pos{right:0}.fsu-cards-pos>div,div:not(.small)>.fsu-cards-attr>div{border:1px solid;border-color:inherit;background-color:#13151d;line-height:100%;border-radius:5px;font-size:.875rem;margin-bottom:4px}.small>.fsu-cards-pos{width:1.4rem;top:30%}.small~.fsu-cards-pos{width:1.4rem;top:30%;right:-10px}.small>.fsu-cards-pos>div,.small~.fsu-cards-pos>div,.small~.fsu-cards-attr>div{border-radius:3px !important;font-size:0.75rem !important;margin-bottom:2px !important}div:not(.small)>.fsu-cards-attr{left:0}.small~.fsu-cards-attr{width:1.4rem;top:30%;left:-10px !important}.small>.fsu-cards-attr{width:88%;display:flex;justify-content:space-between;align-items:center;bottom:0px;top:auto;z-index:0;background-color:#13151d;font-size:.875rem;left:4%;padding:0 2%;border-radius:4px}.fsu-cards-lea-small{bottom:8%;height:16%;font-size:70%;width:100%;top:auto;font-weight:500;line-height:1}.fsu-cards-lea-small~.playStyle,.ut-squad-pitch-view:not(.sbc) .fsu-cards-lea-small{display:none !important}.specials .fsu-cards-lea-small{bottom:10%}.fsu-cards-lea-large,.fsu-cards-price{width:auto !important;padding:0 0.2rem;left:50%;-webkit-transform:translateX(-50%) !important;transform:translateX(-50%) !important;white-space:nowrap;background-color:#13151d;border:1px solid;border-radius:5px}.fsu-cards-lea-large{bottom:0;top:auto !important}.fsu-cards-price{top:0 !important}.fsu-cards-price::after{font-size:1rem}.ut-squad-pitch-view:not(.sbc) .fsu-cards-lea-small~.playStyle{display:block !important}.fsu-price-box{font-family:UltimateTeamCondensed,sans-serif}.fsu-price-box.right{position:absolute;right:0%;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);display:flex;align-items:center}.fsu-price-box.right>div{background-color:#36b84b33;padding:0.5rem;text-align:center;border-radius:4px;margin-top:0;display:block}.fsu-price-box.right>div .title{color:#a4a9b4;padding:0;font-size:1rem;line-height:1rem}.fsu-price-box.right>div .title span.plus{color:#36b84b;font-weight:500;padding-left:.2rem}.fsu-price-box.right>div .title span.minus{color:#d21433;font-weight:500;padding-left:.2rem}.fsu-price-box.right>div .value{font-size:1.2rem;margin-top:.5rem;line-height:1.2rem}.fsu-price-val[data-value='0']{display:none !important}.fsu-price-val .currency-coins::after{font-size:1rem;margin-top:-3px}.fsu-price-box.bottom{padding-left:6.3rem;margin:.2rem 0rem}.fsu-price-box.bottom>div{display:flex;align-items:center;font-size:0.9375rem}.fsu-price-box.bottom>div .title{color:#a4a9b4;margin-right:.2rem}.fsu-price-box.bottom .fsu-price-val .currency-coins::after{font-size:inherit}.fsu-price-box.trf{position:absolute;left:54%;margin-top:.2rem}.fsu-price-box.trf .fsu-price-val{display:flex;align-items:center;background-color:#36b84b33;text-align:center;border-radius:4px;padding:0 .3rem;height:20px}.fsu-price-box.trf .fsu-price-val .title{font-size:.875rem;margin-right:.2rem}.fsu-price-box.trf .fsu-price-val .currency-coins::after{margin-top:-2px}.fsu-price-box.top{position:absolute;right:0%;top:8%;display:flex;align-items:center}.fsu-price-box.top>div{display:flex;align-items:center;background-color:#36b84b33;padding:.1rem 0.5rem;text-align:center;border-radius:4px}.fsu-price-box.top>div .title{font-size:0.875rem;margin-right:0.5rem}.fsu-price-last{margin-right:.5rem}.fsu-player-other{display:flex;margin-top:.2rem;font-family:UltimateTeamCondensed,sans-serif;font-size:1rem;line-height:1rem}.fsu-price-box.top+.fsu-player-other{margin-top:.4rem}.fsu-player-other>div{background-color:#3B4754;color:#a4a9b4;padding:0.1rem 0.5rem;text-align:center;border-radius:20px;font-size:0.9rem;margin-right:0.5rem;white-space: nowrap;}.fsu-player-other>div.swap{background-color:#36b84b;color:#201e20}.fsu-player-other>div.not{background-color:#8A6E2C;color:#201e20}.fsu-player-other>div.yes{background-color:#264A35;color:#201e20}.large.player+.fsu-player-other{justify-content:center}.large.player+.fsu-player-other>div{margin-right:0rem}.fsu-player-other .currency-coins::after{font-size:.875rem;margin-top:-1px;margin-left:2px !important}@media (max-width:1130px){.has-auction-data .fsu-player-other{margin-top:5rem !important}.has-auction-data .fsu-price-box.trf{margin-top:5rem !important;left:auto;right:3%}}                       .phone .fsu-sbc-info{font-size:.875rem}.phone .fsu-task{display:block;font-size:.875rem}.phone .fsu-price-box.right > div .value{font-size:1rem;margin-top:.2rem}.phone .fsu-price-box.right > div .title{font-size:.875rem}.phone button.currency.fsu-promo{line-height:1.6rem;padding:0 .3rem;height:3rem}.phone button.currency.fsu-promo .subtext{display:block;font-size:.6rem;line-height:1rem;text-transform:uppercase}.phone .fsu-player-other > div{font-size:0.6rem}.phone .small.player .fsu-cards-price{font-size:.6rem}.phone .small.player .fsu-cards-price{font-size:.6rem}.phone .small.player .fsu-cards-price::after{font-size:.875rem}.phone .fsu-cards.fsu-cards-attr{font-size:.6rem}.phone .fsu-quick-list .im{font-size:.875rem}        .fsu-cards-loan{left:auto;right:5% !important;top:72% !important;line-height:1.2rem !important;width:1rem !important;height:1rem !important;box-shadow:0 1px 3px #000 !important}.fsu-cards-chem{right:auto;left:5% !important;top:72% !important;line-height:.9rem !important;width:1rem !important;height:1rem !important;box-shadow:0 1px 3px #000 !important}.large.player .fsu-cards-loan{line-height:1.7rem !important;width:1.5rem !important;height:1.5rem !important;font-size:1.2rem !important;top:82% !important}                                      .ut-pinned-item .listFUTItem.has-auction-data .fsu-player-other{margin-top:0 !important;top:.8rem;right:.2rem;position:absolute;z-index:2}        .fsu-sbcfilter-box{align-items:center;background-color:#394754;display:flex;justify-content:center;padding:1rem;z-index:1}.fsu-sbcfilter-option{align-items:center;box-sizing:border-box;display:flex;flex:1;max-width:300px}.fsu-sbcfilter-option .ut-drop-down-control{margin-left:1rem;flex:1}             .fsu-cards-pos.old>div,div:not(.small)>.fsu-cards-attr.old>div{background-color:#0040A6}.small.player .fsu-price-box{font-size:.875rem}.large.player .fsu-price-box{font-size:1rem}.fsu-price-box.old{background-color:#0f1417;color:#a4a9b4;border:0}.small>.fsu-cards-attr.old{background-color:#0040A6}                         .fsu-setbox{display: grid;grid-template-columns: repeat(3, minmax(0, 1fr));}.phone .fsu-setbox{display: grid;grid-template-columns: repeat(1, minmax(0, 1fr));}             .fsu-compact{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.fsu-compact > .listFUTItem.selected > .has-tap-callback{background-color:#2c319b8f}.fsu-compact > .listFUTItem.selected > .has-tap-callback::before{display:none}.fsu-compact > .listFUTItem .entityContainer{width:100%}.fsu-compact > .listFUTItem .player-stats-data-component{width:44%}.fsu-compact > .listFUTItem .player-stats-data-component ul{display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}.fsu-compact > .listFUTItem .player-stats-data-component ul li{padding:0;margin-top:0.2rem}.fsu-compact > .listFUTItem .auction{display:flex;width:46%;right:0;top:2.7rem}                     .fsu-akb .ut-toggle-cell-view>.ut-toggle-control{width:0.75rem;min-width:0.75rem}.fsu-akb .ut-toggle-cell-view>.ut-toggle-control .ut-toggle-control--track{height:2.5rem}.fsu-akb .ut-toggle-cell-view>.ut-toggle-control .ut-toggle-control--grip{left:0 !important}.fsu-akb .ut-toggle-cell-view>.ut-toggle-control:not(.toggled) .ut-toggle-control--grip{top:calc(100% - 1.5rem)}.fsu-akb .ut-toggle-cell-view>.ut-toggle-control .ut-toggle-control--grip,.fsu-akb-title .ut-toggle-cell-view>.ut-toggle-control .ut-toggle-control--grip{font-family:UltimateTeam-Icons,sans-serif;font-style:normal;font-variant:normal;font-weight:400;text-transform:none;flex-shrink:0;font-size:1em;text-decoration:none;text-align:center;line-height:1.5rem;transition:color .3s,bottom .3s,top .3s}.fsu-akb .ut-toggle-cell-view>.ut-toggle-control .ut-toggle-control--grip::before,.fsu-akb-title .ut-toggle-cell-view>.ut-toggle-control .ut-toggle-control--grip::before{content:'\\E026';color:#3a4755}.fsu-akb .ut-toggle-cell-view>.ut-toggle-control.toggled:not(.disabled) .ut-toggle-control--grip::before,.fsu-akb-title .ut-toggle-cell-view>.ut-toggle-control.toggled:not(.disabled) .ut-toggle-control--grip::before{content:'\\E009';color:#36b94b}.fsu-akb .ut-toggle-cell-view>.ut-toggle-control.toggled:not(.disabled) .ut-toggle-control--track,.fsu-akb-title .ut-toggle-cell-view>.ut-toggle-control.toggled:not(.disabled) .ut-toggle-control--track{background-color:#36b94b}.fsu-akb .ut-toggle-cell-view>.ut-toggle-cell-view--label{display:none}@media (max-width:1130px){.fsu-akb.listFUTItem .rowContent::before{display:none !important}.fsu-akb .entityContainer{width:98%;padding:.25rem .25rem .25rem 0}.fsu-akb.listFUTItem .auction{right:0 !important;left:calc(108px + 3rem) !important}.fsu-akb .ut-toggle-cell-view{padding:.3rem}}.fsu-akb-title{align-items:center;background-color:#2b3540;display:flex;justify-content:space-between;padding:.75rem .5rem;border-top:solid 1px #556c95}.fsu-akb-left{display:flex;align-items:center}.fsu-akb-title .ut-toggle-cell-view>.ut-toggle-control .ut-toggle-control--grip{transition:color .3s,left .3s,right .3s}.fsu-akb-left>div{padding:0 .675rem 0 0}.fsu-akb-left>div:last-child{padding-right:0}.btn-standard.mini.fsu-reward-but{height:2rem;line-height:2rem;position:absolute;top:.2rem;left:50%;transform:translateX(-50%)}.btn-standard.mini.fsu-reward-but.pcr{bottom:1.9rem;top:auto}"


    function getFutbin(url){
        return new Promise(res => {
            GM_xmlhttpRequest({
                method:"GET",
                url:url,
                headers: {
                    "Content-type": "application/json"
                },
                onload:function(response){
                    if(response.status == 404){
                        events.notice("notice.loaderror",2);
                        if(document.querySelector(".ut-click-shield").classList.contains("showing")){
                            events.hideLoader()
                        }
                        return;
                    }
                    res(JSON.parse(response.response))
                },
                onerror:function(){
                    events.notice("notice.loaderror",2);
                    if(document.querySelector(".ut-click-shield").classList.contains("showing")){
                        events.hideLoader()
                    }
                }
            })
        })
    };
    const leagueCnName = {2012:'中超',61:'英乙',60:'英甲',14:'英冠',13:'英超',2208:'英丙',2149:'印超',32:'意乙',31:'意甲',54:'西乙',53:'西甲',68:'土超',50:'苏超',308:'葡超',39:'美职联',17:'法乙',16:'法甲',20:'德乙',19:'德甲',2076:'德丙',2118:'传奇',353:'阿甲',10:'荷甲',10010:'荷乙'};


    call.view = {
        card:UTPlayerItemView.prototype.renderItem,
        squad:UTBaseSquadSplitViewController.prototype.viewDidAppear,
        unassigned:UTUnassignedItemsViewController.prototype._renderView,
        pack:UTStorePackDetailsView.prototype._generate,
        build:UTSquadBuilderViewController.prototype.viewDidAppear,
        market:UTMarketSearchView.prototype._generate,
        setting:UTAppSettingsView.prototype._generate
    }
    UTSquadBuilderViewController.prototype.viewDidAppear = function() {
        call.view.build.call(this)
        if(this.squad.isSBC()){
            this._view.getSortDropDown().setIndexById(3);

            this._view._fsuleague = events.createToggle(
                fy(`builder.league`),
                async(e) => {
                    info.build.league = e.getToggleState();
                }
            )
            this._view._fsuleague.toggle(info.build.league);
            this._view._searchOptions.__root.appendChild(this._view._fsuleague.__root);

            this._view._fsurare = events.createToggle(
                fy(`builder.rare`),
                async(e) => {
                    info.build.rare = e.getToggleState();
                }
            )
            this._view._fsurare.toggle(info.build.rare);
            this._view._searchOptions.__root.appendChild(this._view._fsurare.__root);
        }
    }
    UTPlayerItemView.prototype.renderItem = function (p, t) {
        call.view.card.call(this, p, t);
        if (p.isValid()) {
            setTimeout(() => {
                //卡片样式 0新版 1旧版
                let stc = info.set.card_style == 1 ? "old" : "new" ;
                let ct = t.getExpColorMap(p.getTier());
                let cr = info.set.card_style == 1 ? `rgb(0,64,166)` : `rgb(${ct.dividers.r},${ct.dividers.g},${ct.dividers.b})` ;
                let cf = `rgb(${ct.footer.r},${ct.footer.g},${ct.footer.b})`;

                //位置区块添加
                let fcp = document.createElement("div");
                fcp.classList.add("fsu-cards","fsu-cards-pos",stc);
                fcp.style.borderColor = cr;
                fcp.setAttribute('data-id',p.id);
                fcp.innerHTML = p.possiblePositions.filter((z) => {return z !== p.preferredPosition}).map((z) => {return "<div>" + UTLocalizationUtil.positionIdToName(z, services.Localization) + "</div>"}).join("");
                this._fsuCardPos = fcp;

                //额外属性区块
                let pwork = ["?","M","L","H"];
                let fca = document.createElement("div");
                fca.classList.add("fsu-cards","fsu-cards-attr",stc);
                fca.style.borderColor = cr;
                fca.style.borderStyle = "solid";
                fca.style.borderWidth = "1px";
                fca.innerHTML = `<div>${p.isLeftFoot() ? "L" : "R"}</div><div>${pwork[p.getOffensiveWorkRate() + 1]}/${pwork[p.getDefensiveWorkRate() + 1]}</div><div>${p._skillMoves + 1}/${p._weakFoot}</div>`;
                this._fsuCardAttr = fca;

                //价格区块
                let pp = info.roster.data.hasOwnProperty(p.definitionId) ? info.roster.data[p.definitionId].prices[info.base.platform].LCPrice : "0";

                let fcpr = document.createElement("div");
                fcpr.classList.add("fsu-cards-price","fsu-price-box","fsu-price-val","fsu-cards","currency-coins",stc);
                fcpr.setAttribute('data-id',p.definitionId);
                fcpr.setAttribute('data-value',pp);
                fcpr.style.borderColor = cr;
                fcpr.innerText = pp;
                this._fsuCardPrice = fcpr;

                let fcpb = document.createElement("div");
                fcpb.classList.add("fsu-price-box");
                fcpb.setAttribute('data-id',p.definitionId);
                let plast = "",ptl ="";
                if(p.lastSalePrice !== 0){
                    plast = `<div class="fsu-price-last"><div class="title">${fy("price.last")}</div><div class="value currency-coins">${p.lastSalePrice.toLocaleString()}</div></div>`;
                    ptl = pp ? events.priceLastDiff(pp.replace(/,/g, ''),p.lastSalePrice) : "<span></span>";
                }
                fcpb.innerHTML = `${plast}<div class="fsu-price-val" data-value="${pp}"><div class="title">${fy("price.now")}${ptl}</div><div class="value currency-coins">${pp}</div></div>`
                this._fsuCardPriceBox = fcpb;

                let plow = info.base.price.hasOwnProperty(p.rating) ? `<div class="fsu-other-low currency-coins">${fy("duplicate.lowprice")}${Number(info.base.price[p.rating]["p"]).toLocaleString()}</div>` : `<span class="fsu-other-low"></span>`;

                let pe = -1;
                if(p.duplicateId){
                    if(services.Item.itemDao.itemRepo.club.items._collection.hasOwnProperty(p.duplicateId)){
                        pe = services.Item.itemDao.itemRepo.club.items._collection[p.duplicateId].untradeable ? 0 : 1;
                    }
                }else{
                    if(info.roster.thousand.hasOwnProperty(p.definitionId)){
                        pe = info.roster.thousand[p.definitionId].untradeable ? 0 : 1;
                    }
                }
                let pd = "";
                if(pe == -1){
                    if(p.duplicateId !== 0 || p.rating <= info.roster.thousand.lowest){
                        pd = `<div class="fsu-other-dup">${fy("duplicate.nodata")}</div>`;
                    }else{
                        pd = `<div class="fsu-other-dup swap">${fy("duplicate.swap")}</div>`;
                    }
                }else if(pe == 0){
                    pd = `<div class="fsu-other-dup not">${fy("duplicate.not")}</div>`;
                }else{
                    pd = `<div class="fsu-other-dup yes">${fy("duplicate.yes")}</div>`;
                }

                let fco = document.createElement("div");
                fco.classList.add("fsu-player-other","fsu-cards");
                fco.innerHTML = `${pd}${plow}`;
                this._fsuCardOther = fco;

                let fcll = document.createElement("div");
                fcll.classList.add("fsu-cards-lea-large","fsu-cards");
                fcll.style.borderColor = cr;
                fcll.innerHTML = `${UTLocalizationUtil.leagueIdToName(p.leagueId, services.Localization)}`;
                this._fsuCardLeaL = fcll;

                let fcls = document.createElement("div");
                fcls.classList.add("fsu-cards-lea-small","fsu-cards");
                fcls.style.color = cf;
                fcls.innerHTML = `${services.Localization.locale.name == "简体中文" && leagueCnName.hasOwnProperty(p.leagueId) ? leagueCnName[p.leagueId] : UTLocalizationUtil.leagueIdToAbbr5(p.leagueId,services.Localization)}`;
                this._fsuCardLeaS = fcls;
                let pId = p.id ? p.id : p.definitionId;
                if(!this.__root) return;
                if(!this.__root.querySelector("span[p-id]")){
                    let fpi = document.createElement("span");
                    fpi.setAttribute('p-id',pId);
                    fpi.style.display = "none";
                    this._fsuCardPid = fpi;
                    this.__root.append(this._fsuCardPid);
                }else{
                    this.__root.querySelector("span[p-id]").setAttribute('p-id',pId);
                }
                this.__root.parentNode.querySelectorAll(".fsu-cards").forEach(e => e.remove());
                if(this.__root.classList.contains("small")){
                    let sp = `span[p-id="${pId}"]`;
                    let pm = {
                        1:`.itemList > .listFUTItem.won ${sp}`,
                        2:`.itemList > .listFUTItem.has-auction-data ${sp}`,
                        3:`.itemList > .listFUTItem ${sp}`,
                        //拍卖行
                        7:`.SearchResults .paginated-item-list .listFUTItem.has-auction-data ${sp}`,
                        //替换球员上部
                        5:`.ut-pinned-item.has-iterator .listFUTItem ${sp}`,
                        //比较价格上部
                        6:`.ut-pinned-item .listFUTItem ${sp}`,
                        //比较价格
                        //普通样式
                        8:`.ut-club-search-results-view .paginated-item-list .listFUTItem ${sp}`,
                        //俱乐部

                        10:`.paginated-item-list .listFUTItem ${sp}`,
                        21:`.ut-squad-pitch-view.sbc ${sp}`,
                        22:`.ut-squad-pitch-view ${sp}`,
                        23:`.ut-squad-slot-dock-view.sbc ${sp}`,
                        24:`.ut-squad-slot-dock-view ${sp}`,
                        25:`.reward.small ${sp}`,

                    }
                    let cs = 0;
                    for (let i in pm) {
                        if(document.querySelector(pm[i])){
                            if(!document.querySelector(pm[i]).parentNode.querySelectorAll(".fsu-cards").length){
                                cs = Number(i);
                                break
                            }
                        }
                    }
                    if(cs == 7 && document.querySelector(".icon-transfer.selected")) cs = 4;
                    if(cs == 8 && document.querySelector(".icon-club.selected")) cs = 9;
                    if(cs == 2 && cntlr.current().className == "UTWatchListViewController") cs = 11;
                    if(cs !== 0){
                        //位置区块添加
                        //额外属性区块
                        if([21,22].indexOf(cs) !== -1){
                            this.__root.after(this._fsuCardPos);
                            this._fsuCardAttr.style.borderWidth = 0;
                            this.__root.after(this._fsuCardAttr);
                        }else{
                            this.__root.prepend(this._fsuCardPos);
                            this._fsuCardAttr.children[0].remove();
                            this.__root.prepend(this._fsuCardAttr);
                        }
                        if([5,7,21,22,23,24,25].indexOf(cs) !== -1){
                            this.__root.prepend(this._fsuCardPrice);
                        }else{
                            let pbc = "right";
                            if(cs == 11) pbc = "trf";
                            if(cs == 4){
                                pbc = info.set.info_auction ? "trf" : "top";
                            }
                            if(cs == 1 || cs == 2) pbc = "top";
                            this._fsuCardPriceBox.classList.add(pbc);
                            if(cs == 4 || cs == 11){
                                if(this._fsuCardPriceBox.querySelector(".fsu-price-last")){
                                    this._fsuCardPriceBox.querySelector(".fsu-price-last").remove();
                                    this._fsuCardPriceBox.querySelector(".fsu-price-val .title span").remove();
                                }
                                if(cs == 4 && !info.set.info_auction){
                                    this.__root.after(this._fsuCardPriceBox);
                                }else{
                                    this.__root.parentNode.append(this._fsuCardPriceBox);
                                }
                            }else if(cs == 6 || cs == 8){
                                this.__root.prepend(this._fsuCardPrice);
                            }else{
                                this.__root.after(this._fsuCardPriceBox);
                            }

                            if(cs == 4 || cs == 6) this._fsuCardOther.querySelector(".fsu-other-low").remove();
                            if(cs == 1 || cs == 8  || cs == 9) this._fsuCardOther.querySelector(".fsu-other-dup").remove();
                            this.__root.parentNode.append(this._fsuCardOther);
                        }
                        if(cs !== 22 && cs !== 24) this.__root.prepend(this._fsuCardLeaS);

                    }
                }else{
                    this.__root.prepend(this._fsuCardPos);
                    this._fsuCardAttr.style.borderWidth = 0;
                    this.__root.prepend(this._fsuCardAttr);
                    this.__root.prepend(this._fsuCardPrice);
                    this.__root.prepend(this._fsuCardLeaL);
                    if(document.querySelector(`.player-pick-option  span[p-id="${pId}"]`)){
                        this._fsuCardOther.querySelector(".fsu-other-low").remove();
                        this.__root.after(this._fsuCardOther)
                    }
                }

                if(!info.set.card_pos){
                    this._fsuCardPos.remove();
                }
                if(!info.set.card_lea){
                    this._fsuCardLeaL.remove();
                    this._fsuCardLeaS.remove();
                }
                if(!info.set.card_price){
                    this._fsuCardPriceBox.remove();
                    this._fsuCardPrice.remove();
                }
                if(!info.set.card_other){
                    this._fsuCardAttr.remove();
                }
                if(!info.set.card_low){
                    this._fsuCardOther.querySelector(".fsu-other-low")?.remove();
                }
                if(!info.set.card_club){
                    this._fsuCardOther.querySelector(".fsu-other-dup")?.remove();
                }

                let ccv = this.__root.parentNode.querySelector(".ut-squad-slot-chemistry-points-view.item");
                if(ccv){
                    ccv.classList.add("fsu-cards-chem")
                }
                this.__loanInfoTab.classList.add("fsu-cards-loan");
            }, 10);
        };
    };
    call.plist = {
        sectioned:UTSectionedItemListView.prototype.addItems,
        paginated:UTPaginatedItemListView.prototype.renderItems,
        storeReveal:UTStoreRevealModalListView.prototype.addItems,
        picks:UTPlayerPicksViewController.prototype.viewDidAppear,
        club:UTClubRepository.prototype.removeClubItem,
        squadSet:UTSquadEntity.prototype.setPlayers,
        squadGR:UTSquadEntity.prototype.getRating,
        squad:UTSquadOverviewViewController.prototype.viewDidAppear
    }

    UTSquadOverviewViewController.prototype.viewDidAppear = function() {
        call.plist.squad.call(this);
        let p = this._squad._players.map(function (i) {if(i._item.type == "player" && !info.roster.data.hasOwnProperty(i._item.definitionId)){return i._item.definitionId}}).filter(i => i > 0);
        events.loadPlayerPrice(p);


        if(this._squad.isSBC()){
            let sp = this._view;
            let e = this._challenge.eligibilityRequirements;
            let t = 0;
            let th = document.createElement("div");
            th.classList.add("fsu-quick","top")
            sp._fsuQuickTop = th;
            let to = document.createElement("div");
            to.classList.add("fsu-quick-list","other");
            sp._fsuQuickOther = to;
            sp._fsuRlist = {};
            for (let i of e) {
                if(i.kvPairs._collection.hasOwnProperty(19)){
                    t = i.kvPairs._collection[19][0];
                    sp._fsuCount = events.createButton(
                        new UTButtonControl(),
                        fy("sbc.count"),
                        (e) => {events.squadCount(e);},
                        "im"
                    )
                    sp._fsuCount.__root.setAttribute("data-r",t);
                    sp._fsuQuickOther.append(sp._fsuCount.__root);
                }
                if(i.kvPairs._collection.hasOwnProperty(35)){
                    sp._fsuConsult = events.createButton(
                        new UTButtonControl(),
                        fy("sbc.consult"),
                        (e) => {events.squadConsult(e);},
                        "im"
                    )
                    sp._fsuConsult.__root.setAttribute("data-id",this._challenge.id);
                    sp._fsuQuickOther.append(sp._fsuConsult.__root);
                }
            }
            if(t !== 0){
                let l = [[1,6,3,1],[0,9,2,0]];
                let h = `<div class="fsu-rlist top"><div class="fsu-rlist-item left">{list}</div><div class="fsu-rlist-inr">OR</div><div class="fsu-rlist-item right">{list}</div></div>`

                for (let i in l) {
                    let tn = i == 0 ? "left" : "right";
                    let ts = document.createElement("div");
                    ts.classList.add("fsu-quick-list",tn);
                    sp._fsuQuickTop.append(ts);
                    if(i == 0){
                        sp._fsuQuickTop.append(events.createDF(`<div class="fsu-quick-inr">OR</div>`));
                    }
                    for (let si in l[i]) {
                        if(l[i][si] !== 0){
                            let o = t+1-Number(si);
                            let n = `t_${i}_${o}`
                            let r = events.createButton(
                                new UTButtonControl(),
                                "",
                                (e) => {events.SBCSetRatingPlayers(e);},
                                "im"
                            )
                            r.__root.innerHTML = `${o}<span>×${l[i][si]}</span>`;
                            r.__root.setAttribute("data-r",o);
                            sp._fsuRlist[n] = r;
                            sp._fsuQuickTop.querySelector(`.${tn}`).append(sp._fsuRlist[n].__root);
                        }
                    }
                }
            }
            if(sp._fsuQuickOther.innerHTML !== ""){
                sp._fsuQuickTop.append(sp._fsuQuickOther);
            }
            sp._summaryPanel.__root.append(sp._fsuQuickTop)
            let y = t !== 0 ? t : 75;
            let rh = document.createElement("div");
            rh.classList.add("fsu-quick","right");
            rh.innerHTML = `<div class="fsu-quick-list"></div>`;
            sp._fsuQuickRight = rh;
            for (let i = 0; i < 10; i++) {
                let o = y+3-i;
                let n = `r_${o}`
                let r = events.createButton(
                    new UTButtonControl(),
                    o,
                    (e) => {events.SBCSetRatingPlayers(e);},
                    "im"
                );
                r.__root.setAttribute("data-r",o);
                sp._fsuRlist[n] = r;
                sp._fsuQuickRight.querySelector(".fsu-quick-list").append(sp._fsuRlist[n].__root);
            }
            let rd = events.createButton(
                new UTButtonControl(),
                fy("sbc.qucikdupes"),
                (e) => {events.SBCSetRatingPlayers(e);},
                "im"
            );
            rd.__root.setAttribute("data-r","d");
            sp._fsuRlist["r_d"] = rd;
            sp._fsuQuickRight.querySelector(".fsu-quick-list").append(sp._fsuRlist["r_d"].__root);
            sp._summaryPanel.__root.after(sp._fsuQuickRight);
            if(!info.set.sbc_top){
                sp._fsuQuickTop.remove();
            }
            if(!info.set.sbc_top){
                sp._fsuQuickRight.remove();
            }
        }
    }
    //分个形式(拍卖行待售、待分配)球员列表 读取球员列表查询价格
    UTSectionedItemListView.prototype.addItems = function(t, e, i, r) {
        call.plist.sectioned.call(this,t, e, i, r);
        let p = this.listRows.map(function (i) {if(i.data.type == "player" && !info.roster.data.hasOwnProperty(i.data.definitionId)){return i.data.definitionId}}).filter(Boolean);
        events.loadPlayerPrice(p,this);
        if(info.set.player_loas && (cntlr.current().getNavigationTitle() !== services.Localization.localize("navbar.label.assigncards") || repositories.Item.getPileSize(ItemPile.TRANSFER) - repositories.Item.numItemsInCache(ItemPile.TRANSFER) > 0)){
            let pn = 0,pr = {},ln = 0;
            for (let n of this.listRows) {
                if(!n.data.untradeable && n.data.loans == -1 && n.data.type == "player" && !n.data._auction.isClosedTrade()){
                    pn++;
                    n.__root.classList.add("fsu-akb");
                    n._fsuLosAuction = events.createToggle(
                        "",
                        async(e) => {
                            if(e.getToggleState()){
                                e._parent._fsuAkbCurrent++;
                                e._parent._fsuAkbArray[e._id] = e;
                            }else{
                                e._parent._fsuAkbCurrent--;
                                delete e._parent._fsuAkbArray[e._id];
                            }
                            e._parent._fsuAkbToggle.toggle(e._parent._fsuAkbCurrent == e._parent._fsuAkbNumber);
                            events.losAuctionCount(e._parent,1)
                        },
                        ""
                    )
                    n._fsuLosAuction.toggle(1);
                    n._fsuLosAuction._parent = this;
                    pr[n.data.id] = n._fsuLosAuction;
                    n._fsuLosAuction._id = n.data.id;
                    n._fsuLosAuction._pId = n.data.definitionId;
                    n._fsuLosAuction._l = ln;
                    n._fsuLosAuction.setInteractionState(0);
                    n.__root.insertBefore(n._fsuLosAuction.__root,n.__root.firstChild)
                }
                ln++;
            }
            if(pn){
                let b = document.createElement("div");
                b.classList.add("fsu-akb-left");
                this._fsuAkbToggle = events.createToggle(
                    fy("losa.all"),
                    async(e) => {
                        let sf = e.getToggleState() ? true : false;
                        e._parent._fsuAkbCurrent = sf ? e._parent._fsuAkbNumber : 0;
                        e._parent._fsuAkbArray = {};
                        for (let n of e._parent.listRows) {
                            if(n.hasOwnProperty("_fsuLosAuction") && n._fsuLosAuction._interactionState){
                                n._fsuLosAuction.toggle(sf)
                                if(sf){
                                    if(n.hasOwnProperty("_fsuLosAuction")){
                                        if(events.getCachePrice(n._fsuLosAuction._pId,2)){
                                            e._parent._fsuAkbArray[n._fsuLosAuction._id] = n._fsuLosAuction;
                                        }
                                    }
                                }
                            }
                        }
                        events.losAuctionCount(e._parent,1)
                    },
                    ""
                )
                this._fsuAkbToggle.toggle(1);
                this._fsuAkbToggle.setInteractionState(0);
                this._fsuAkbToggle._parent = this;
                b.appendChild(this._fsuAkbToggle.__root);

                let bnd = document.createElement("div");
                bnd.insertAdjacentHTML('beforeend', `${fy("losa.select")} `);
                let bns = document.createElement("span");
                bns.classList.add("fsu-akb-num");
                bns.innerText = `${pn}`;
                bnd.appendChild(bns);
                bnd.insertAdjacentHTML('beforeend', `/`);
                let bnn = document.createElement("span");
                bnn.classList.add("fsu-akb-max");
                bnn.innerText = `${pn}`;
                bnd.appendChild(bnn);
                b.appendChild(bnd);

                let bpd = document.createElement("div");
                bpd.insertAdjacentHTML('beforeend', `${fy("losa.price")} `);
                let bpp = document.createElement("span");
                bpp.classList.add("fsu-akb-price","currency-coins");
                bpp.innerText = `0`;
                bpd.appendChild(bpp);
                b.appendChild(bpd);
                this._fsuAkbArray = pr;
                this._fsuAkbCurrent = pn;
                this._fsuAkbNumber = pn;
                this._fsuAkb = document.createElement("div");
                this._fsuAkb.classList.add("fsu-akb-title");
                this._fsuAkb.appendChild(b);

                this._fsuAkbButton = events.createButton(
                    new UTStandardButtonControl(),
                    fy("loas.button"),
                    (e) => {
                        events.popup(
                            [
                                { labelEnum: enums.UIDialogOptions.OK },
                                { labelEnum: enums.UIDialogOptions.CANCEL },
                            ],
                            fy("loas.popupt"),
                            fy(["loas.popupm",e._parent._fsuAkb.querySelector(".fsu-akb-num").innerText,e._parent._fsuAkb.querySelector(".fsu-akb-price").innerText]),
                            (t) => {
                                if(t === 2){
                                    events.losAuctionSell(e);
                                }
                            }
                        )
                    },
                    "btn-standard section-header-btn mini"
                )
                this._fsuAkbButton.setInteractionState(0);
                this._fsuAkbButton._parent = this;

                this._fsuAkb.appendChild(this._fsuAkbButton.__root);
                this._header.__root.after(this._fsuAkb);
                events.losAuctionCount(this,0);
            }
        }
    }
    events.popup = (o,t,m,c) => {
        let mp = new EADialogViewController({
            dialogOptions: o,
            message: m,
            title: t,
            type: EADialogView.Type.MESSAGE
        });
        mp.init();
        mp.modalDisplayDimensions.minWidth = "300px";
        mp.onExit.observe(this, function (e, z) {
            e.unobserve(this), c.call(this, z);
        });
        gPopupClickShield.setActivePopup(mp);
    }
    events.wait = (min,max) => {
        let delay = Math.floor(Math.random() * (max * 1000 - min * 1000 + 1)) + min * 1000;
        return new Promise(resolve => setTimeout(resolve, delay));
    }
    events.changeLoadingText = (t) =>{
        document.querySelector('.fsu-loading-close').innerHTML = fy(t);
    }
    events.losAuctionSell = async(e) => {
        e.setInteractionState(0);
        info.base.losauction = true;
        events.showLoader();
        let a = e._parent._fsuAkbArray,b = e._parent._fsuAkbCurrent,pn = 0;
        events.notice(["loas.start",`${b}`,`${b * 5}`],1);
        for (let n in a) {
            if(!info.base.losauction){
                break;
            }
            pn++;
            events.changeLoadingText(["loadingclose.loas",`${pn}`,`${b - pn}`]);
            await events.playerToAuction(n,events.getCachePrice(a[n]._pId,1));
            console.log(a[n]._l)
            if(isPhone()){
                a[n].toggle(false);
                e._parent.listRows[a[n]._l].hide();
                e._parent._fsuAkbCurrent--;
                e._parent._fsuAkbNumber--;
                delete e._parent._fsuAkbArray[a[n]._id];
                events.losAuctionCount(e._parent)
            }
            await events.wait(2,4);
        }
        events.hideLoader();
        info.base.losauction = false;
        e.setInteractionState(e._parent._fsuAkbCurrent);
    }
    events.getCachePrice = (i,t) => {
        if(t == 1){
            return info.roster.data.hasOwnProperty(i) ? Number(info.roster.data[i].prices[info.base.platform].LCPrice.replace(/,/g, '')) : 0;
        }else{
            return info.roster.data.hasOwnProperty(i);
        }
    }
    events.losAuctionCount = (e,t) => {
        if(e.hasOwnProperty("_fsuAkbCurrent") && e.hasOwnProperty("_fsuAkbNumber") && e.hasOwnProperty("_fsuAkbArray")){
            let pn = 0,qs = {};
            for (let n in e._fsuAkbArray) {
                let p = events.getCachePrice(e._fsuAkbArray[n]._pId,1),j = events.getCachePrice(e._fsuAkbArray[n]._pId,2);
                pn += p;
                if(!j){
                    e._fsuAkbArray[n].setInteractionState(0);
                }else if(j && p == 0){
                    e._fsuAkbArray[n].setInteractionState(0);
                    e._fsuAkbCurrent--;
                    e._fsuAkbNumber--;
                    delete e._fsuAkbArray[n];
                }else{
                    e._fsuAkbArray[n].setInteractionState(1);
                }
            }
            e._fsuAkb.querySelector(".fsu-akb-num").innerText = e._fsuAkbCurrent;
            e._fsuAkb.querySelector(".fsu-akb-max").innerText = e._fsuAkbNumber;
            e._fsuAkb.querySelector(".fsu-akb-price").innerText = pn.toLocaleString();
            if(pn){
                e._fsuAkbButton.setInteractionState(1);
                e._fsuAkbToggle.setInteractionState(1);
            }else if(pn == 0){
                e._fsuAkbButton.setInteractionState(0);
            }
        }
    }
    //列表形式(右侧、拍卖行搜索结果、俱乐部)球员列表 读取球员列表查询价格
    UTPaginatedItemListView.prototype.renderItems = function(t) {
        call.plist.paginated.call(this,t);
        let p = this.listRows.map(function (i) {if(i.data.type == "player" && !info.roster.data.hasOwnProperty(i.data.definitionId)){return i.data.definitionId}}).filter(Boolean);
        let ct = isPhone() ? getAppMain().getRootViewController().getPresentedViewController().getCurrentViewController().getNavigationTitle() : getAppMain().getRootViewController().getPresentedViewController().getCurrentViewController().getCurrentController()._rightController.getNavigationTitle();
        let ctt = ct == services.Localization.localize("navbar.label.clubsearch") ? 1 : 0;
        if(ctt){
            let z = getAppMain().getRootViewController().getPresentedViewController().getCurrentViewController()._childViewControllers,q = false;
            for (let n of z) {
                if(n.className.indexOf("UTSBC") !== -1){
                    q = true;
                    break;
                }
            }
            let s = true;
            this.listRows.forEach(function(i) {
                if(q){
                    if(info.unassigned.rlist.length !== 0){
                        if(info.unassigned.rlist.indexOf(i.data.definitionId) == -1){
                            i.hide();
                        }else{
                            s = false;
                        }
                    }else{
                        s = false;
                    }
                }
            })
            if(s && q){
                this.__itemList.prepend(events.createDF(`<div class="ut-no-results-view"><div class="contents"><span class="no-results-icon"></span><h2>${fy("emptylist.t")}</h2><p>${fy("emptylist.c")}</p></div></div>`));
            }else{
                if(this.__itemList.querySelector(".ut-no-results-view")){
                    this.__itemList.querySelector(".ut-no-results-view").remove()
                }
            }

        }else{
            //假想球员搜索结果排除其他版本项目
            let pn = this._targets._collection.rowselect[0].target;
            if(pn.hasOwnProperty("pinnedItemView")){
                pn._list.__itemList.classList.remove("fsu-compact");
            }
            if(info.set.sbc_market && pn.hasOwnProperty("pinnedItemView") && pn.pinnedItemView && pn.pinnedItemView.itemCell.data.concept){
                let z = 0;
                let pi = pn.pinnedItemView.itemCell.data.definitionId;
                this.listRows.forEach(function(i) {
                    if(i.data.definitionId !== pi){
                        i.__root.style.filter = "brightness(0.5)";
                        z++;
                    }
                })
                if(z && !isPhone()){
                    events.notice("notice.conceptdiff",1)
                }
            }
            
        }
        events.loadPlayerPrice(p);
    }

    //球员预览包打开 读取球员列表查询价格
    UTStoreRevealModalListView.prototype.addItems = function(e, t, i, o) {
        call.plist.storeReveal.call(this, e, t, i, o);
        let p = e.map(function (it) {if(it.type == "player" && !info.roster.data.hasOwnProperty(it.definitionId)){return it.definitionId}}).filter(Boolean);
        events.loadPlayerPrice(p);
    }

    //球员挑选包打开 读取球员列表查询价格
    UTPlayerPicksViewController.prototype.viewDidAppear = function() {
        call.plist.picks.call(this);
        let p = this.picks.map(function (i) {if(i.type == "player" && !info.roster.data.hasOwnProperty(i.definitionId)){return i.definitionId}}).filter(Boolean);
        events.loadPlayerPrice(p);
    }

    //俱乐部卖掉球员 移除在阵容列表内球员 以便计算重复效果
    UTClubRepository.prototype.removeClubItem = function(t) {
        call.plist.club.call(this,t);
        if(info.roster.thousand.hasOwnProperty(t.definitionId)){
            delete(info.roster.thousand[t.definitionId]);
        }
    }

    //阵容评分获取 每次球员变化都会获取 主要计算阵容整体价格
    UTSquadEntity.prototype.getRating = function() {
        let r = call.plist.squadGR.call(this);
        let p = [];
        for (let i of this.getFieldPlayers()) {
            let id = i._item.definitionId;
            if(id > 0 && info.roster.data.hasOwnProperty(id)){
                p.push(id)
            }
        }
        events.squadTotal(this.getFieldPlayers().map(function (i) {if(info.roster.data.hasOwnProperty(i._item.definitionId)){return i._item.definitionId}}).filter(i => i > 0));
        return r;
    }

    //阵容的总价格计算填充 需要传递阵容球员ID列表(数组)
    events.squadTotal = (p) => {
        let e = document.getElementById("squadTotal");
        if(e){
            let n = 0;
            for (let i of p) {
                if(info.roster.data.hasOwnProperty(i)){
                    let s = info.roster.data[i].prices[info.base.platform].LCPrice;
                    n += isNaN(s) ? Number((s).replace(/,/g, "")) : Number(s);
                }
            }
            e.innerText = n.toLocaleString();
            if(n !== 0 && document.getElementById("sbcPrice")){
                let p = e.parentNode.querySelector(".fsu-squad-pTitle");
                if(p.querySelector("span")){
                    p.querySelector("span").remove();
                }
                p.append(events.createDF(events.priceLastDiff(n,document.getElementById("sbcPrice").innerText.replace(/,/g, ''))))
            }
        }
    }

    //差价计算 需要传递购买价格和预估价格
    events.priceLastDiff = (p,l) => {
        let n = ((Number(p)/Number(l)-1)*100).toFixed(0);
        if (!isFinite(n)) {
            n = 0;
        }
        let v = ("+" + n +"%").replace("+-","-");
        return v.indexOf("+") != -1 ? `<span class="plus">${v}</span>` : `<span class="minus">${v}</span>`;
    }

    //球员价格读取 需要传递球员ID列表(数组)
    events.loadPlayerPrice = async(list,el) => {
        if(list.length > 0){
            let la = Array.from(new Set(list));
            let pu = [];
            let gr = Math.ceil(la.length / 23);
            for (let i = 0; i < gr; i++) {
                let lt = la.splice(-23).join();
                pu.push(`https://www.futbin.com/${info.base.year}/playerPrices?player=&rids=${lt}`)
            }
            for (let k in pu) {
                let t = await getFutbin(pu[k]);
                info.roster.data = Object.assign(info.roster.data,t);
                for (let k in t) {
                    let e = document.querySelectorAll(`.fsu-price-box[data-id='${k}']`);
                    let p = t[k].prices[info.base.platform].LCPrice;
                    if(e.length > 0){
                        for (let i of e) {
                            if(i.classList.contains("fsu-price-val")){
                                i.setAttribute("data-value",p);
                                i.innerText = p;
                            }else{
                                i.querySelector(".fsu-price-val").setAttribute("data-value",p);
                                i.querySelector(".fsu-price-val .value").innerText = p;
                            }
                            if(i.querySelectorAll(".fsu-price-last").length > 0){
                                i.querySelector(".fsu-price-val .title span").outerHTML = events.priceLastDiff(p.replace(/,/g, ''),i.querySelector(".fsu-price-last .value").innerText.replace(/,/g, ''));
                            }
                        }
                    }
                }
            }
            if(document.getElementById("squadTotal")){
                events.squadTotal(cntlr.current()._squad.getFieldPlayers().map(function (i) {return i._item.definitionId}).filter(i => i > 0));
            }
        }
        if(el){
            events.losAuctionCount(el,0)
        }
    }

    //阵容页面显示 添加阵容价值部分
    UTBaseSquadSplitViewController.prototype.viewDidAppear = function(){
        call.view.squad.call(this);

        if(info.set.info_squad){
            let p = this._squad.getPlayers().map(function (i) {if(i._item.type == "player" && !info.roster.data.hasOwnProperty(i._item.definitionId)){return i._item.definitionId}}).filter(i => i > 0);


            this._getLeftController().getView().getSummaryPanel().getRootElement().querySelector(`.ut-squad-summary-info${this.className == "UTSBCSquadSplitViewController" ? "--right" : ""}`).after(events.createDF(`<div class="fsu-squad-pBox"><div class="fsu-squad-pWrap"><span class="fsu-squad-pTitle">${fy("sbc.topsquad")}</span><span id="squadTotal" class="fsu-squad-pValue currency-coins">0</span></div></div>`))

            if(!p.length){
                events.squadTotal(this._squad.getFieldPlayers().map(function (i) {if(info.roster.data.hasOwnProperty(i._item.definitionId)){return i._item.definitionId}}).filter(i => i > 0));
            }


            if(this._squad.isSBC()){
                let si;
                if(info.task.sbc.stat.hasOwnProperty(this._set.id)){
                    if(this._set.challengesCount == 1){
                        si = info.task.sbc.stat.hasOwnProperty(this._set.id) ? info.task.sbc.stat[this._set.id] : -1;
                    }else{
                        si = info.task.sbc.stat[this._set.id].hasOwnProperty("c") ? info.task.sbc.stat[this._set.id].c[this._challengeId] : -1;
                    }
                }else{
                    si = -1;
                }
                if(si !== -1 && !document.getElementById("sbcPrice")){
                    this._getLeftController().getView().getRootElement().querySelector(".fsu-squad-pBox .fsu-squad-pWrap").after(events.createDF(`<div class="fsu-squad-pWrap"><span class="fsu-squad-pTitle">${fy("sbc.topprice")}</span><span id="sbcPrice" class="fsu-squad-pValue currency-coins">${Number(info.base.platform == "pc" ? si.pc : si.tv).toLocaleString()}</span></div>`))
                }
            }
        }
    }
    call.task = {
        sbcT:UTSBCHubView.prototype.populateTiles,
        sbcC:UTSBCChallengesViewController.prototype.viewDidAppear,
        sbcN:UTSBCHubView.prototype.populateNavigation,
        objN:UTObjectivesHubView.prototype.setupNavigation,
        objG:UTObjectiveCategoryView.prototype.setCategoryGroups,
        home:UTHomeHubView.prototype._generate,
        homeG:UTHomeHubView.prototype.getObjectivesTile,
    }
    events.squadCount = (e) => {
        let t = e.__root.getAttribute("data-r");
        let pa = cntlr.current()._squad.getFieldPlayers(),pn = [],pr = "";
        for (let i of pa) {
            if(i.isBrick()){
                pn.push(0);
            }else{
                if(i.item.rating !== 0){
                    pn.push(i.item.rating)
                }
            }
        }
        if(pn.length > 0){
            pr = "&ratings=" + pn.join(",");
        }
        GM_openInTab(`https://futcd.com/sbc.html?target=${t}${pr}`, { active: true, insert: true, setParent :true });
    }
    events.squadConsult = (e) => {
        let i = e.__root.getAttribute("data-id");
        GM_openInTab(`https://www.futbin.com/squad-building-challenges/ALL/${i}/list`, { active: true, insert: true, setParent :true });
    }
    //SBC阵容填充指定评分 需要元素携带data-r(评分),切换球员填充状态为3
    events.SBCSetRatingPlayers = async(e) => {
        let r = e.__root.getAttribute('data-r'),x = e.__text ? e.__text.textContent : "";
        let pi = 0,w,b;
        if(isPhone()){
            w = cntlr.current();
        }else{
            w = cntlr.left();
        }
        if(x !== fy("sbc.swaprating")){
            if(w.getView().getSelectedSlot() !== null){
                pi = w.getView().getSelectedSlot().getIndex();
            }
            if(w._squad._getSlotByIndex(pi).isBrick() || w._squad._getSlotByIndex(pi).isValid()){
                let pl = w._squad.getNonBrickSlots()
                for (const i of pl) {
                    if(!i.isValid()){
                        pi = i.getIndex();
                        break;
                    }
                }
            }
            await w.getView().selectSlot(pi);
            await w.getView().getSelectedSlot()._tapDetected(this);
        }
        if(isPhone()){
            b = cntlr.current()._rootController;
        }else{
            b = cntlr.right();
        }
        if(r == "d"){
            if(b._panelView._fsuUn._interactionState){
                await b._panelView._fsuUn._tapDetected(this);
            }else{
                events.notice("notice.noduplicate",2);
            }
        }else{
            info.unassigned.state = true;
            info.unassigned.run = 3;
            info.unassigned.rating = r;
            await b._panelView._btnAddSwap._tapDetected(this);
        }
    }

    //SBC填充导航题头 加载导航额外信息
    UTSBCHubView.prototype.populateNavigation = function(e, t) {
        call.task.sbcN.call(this, e, t);
        setTimeout(() => {
            if(info.task.sbc.stat.hasOwnProperty("new") && info.set.info_sbc){
                if(info.task.sbc.stat.new[0] > 0){
                    let t = this._SBCCategoriesTM.items;
                    let j = info.task.sbc.stat.new;
                    for (let n in j) {
                        if(t[n]){
                            t[n].__root.append(events.createDF(fy(html.taskBar).replace("{Number}",`+${j[n]}`)));
                        }
                    }
                }
                if(services.SBC.repository.categories._collection.hasOwnProperty("Favourite")){
                    let f = services.SBC.repository.categories._collection.Favourite.setIds;
                    let se = 0;
                    for (let si of f) {
                        if(info.task.sbc.stat.hasOwnProperty(si)){
                            if(info.task.sbc.stat[si].e == "1") se++;
                        }
                    }
                    if(se > 0){
                        this._SBCCategoriesTM.items[1].__root.append(events.createDF(`<div class="fsu-task-bar-favorite">${se}</div>`));
                    }
                }

            }
        },10);
    }

    //SBC填充任务列表 每次切换类型都重新填充 加载任务额外信息
    UTSBCHubView.prototype.populateTiles = function(e, t) {
        call.task.sbcT.call(this, e, t);
        if(info.set.info_sbc){
            let l = this.sbcSetTiles;
            for (let i of l) {
                events.sbcInfoFill(i.data.id,i);
            }
            if(t.isFavourite){
                let f = t.setIds;
                let se = 0;
                for (let si of f) {
                    if(info.task["sbc"].stat.hasOwnProperty(si)){
                        if(info.task["sbc"].stat[si].e == "1") se++;
                    }
                }
                let el = this._SBCCategoriesTM.items[1].__root;
                if(el.querySelector(".fsu-task-bar-favorite")){
                    el.querySelector(".fsu-task-bar-favorite").remove();
                }
                if(se > 0){
                    el.append(events.createDF(`<div class="fsu-task-bar-favorite">${se}</div>`));
                }
            }
        }

        if(Object.keys(info.task.sbc.stat).length && info.set.info_sbcf){
            this._fsuSbcFilter = new UTDropDownControl();
            let fa = [];
            for (let i = 0; i < 4; i++) {
                fa.push(new UTDataProviderEntryDTO(i,i,fy(`sbc.filter${i}`)))
            }
            this._fsuSbcFilter.init();
            this._fsuSbcFilter.setOptions(fa);
            this._fsuSbcFilter.addTarget(this._fsuSbcFilter, (e) => {events.sbcFilter(e);}, EventType.CHANGE);
            let b = document.createElement("div");
            b.classList.add("fsu-sbcfilter-box");
            let o = document.createElement("div");
            o.classList.add("fsu-sbcfilter-option");
            let s = document.createElement("div");
            s.innerText = fy(`sbc.filtert`);
            o.appendChild(s);
            o.appendChild(this._fsuSbcFilter.__root);
            b.appendChild(o);
            if(this.__root.querySelector(".fsu-sbcfilter-box")){
                this.__root.querySelector(".fsu-sbcfilter-box").remove()
            }
            this._SBCCategoriesTM.__root.after(b);
        }
    }
    events.sbcFilter = e => {
        let t = cntlr.current()._view.sbcSetTiles,g = e.getIndex();
        for (let i of t) {
            let y = true,d = i.data.id;
            if(info.task.sbc.stat.hasOwnProperty(d)){
                let s = info.task.sbc.stat[d];
                if(g == 1 && s.f !== "1") y = false;
                if(g == 2 && s.e !== "1") y = false;
                if(g == 3){
                    let n = parseFloat(s.u);
                    if(!isNaN(n)){
                        if(n < 65) y = false;
                    }else{
                        y = false
                    }
                }
            }
            y ? i.show() : i.hide();
        }
    }
    //SBC子任务列表展示 填充额外信息和读取价格
    UTSBCChallengesViewController.prototype.viewDidAppear = function() {
        call.task.sbcC.call(this);
        if(info.set.info_sbcs){
            events.sbcInfoFill(this.sbset.id,this.getView()._setInfo);
            events.sbcSubPrice(this.sbset.id,this.getView()._challengeTiles);
        }
    }

    //打开futbin球员链接,需要元素携带data-id(球员id)和data-name(球员全称)
    events.openFutbinPlayerUrl = async(e) => {
        events.showLoader();
        let di = e.__root.getAttribute('data-id');
        let n = e.__root.getAttribute('data-name').normalize("NFKD").replace(/[\u0300-\u036f]/g, "").replace(/ø/g, "o");
        let u = `https://www.futbin.org/futbin/api/searchPlayersByName?playername=${n}&year=${info.base.year}`;
        let d = await getFutbin(u);
        let fi = "";
        for (let i of d.data) {
            if(i.resource_id == di){
                fi = i.ID;
                break;
            }
        }
        events.hideLoader();
        GM_openInTab(`https://www.futbin.com/${info.base.year}/player/${fi}/`, { active: true, insert: true, setParent :true });
    };
    //SBC信息填充,需要传递sbcid和需填充的元素
    events.sbcInfoFill = (d,e) => {
        if(!info.task.sbc.stat.hasOwnProperty(d)) return;
        let s = info.task.sbc.stat[d];
        if(s !== undefined){
            if(e.hasOwnProperty("__tileTitle")) e.__tileTitle.prepend(events.createDF(`${s.f == "1" ? "<span class='task-new'>" + fy("task.new") + "</span>" : ""}`));
            if(!e.__root.querySelector(".task-expire")){
                e.__root.prepend(events.createDF(`${s.e == "1" ? "<div class='task-expire'>" + fy("task.expire") + "</div>" : ""}`));
            }
        }
        if(e._interactionState && !e.__root.querySelector(".fsu-sbc-info")){
            let p = s.type == "7" ? "0" : info.base.platform == "pc" ? s.pc : s.tv;
            e.__root.lastChild.before(events.createDF(fy(html.sbcInfo).replace("{price}",Number(p).toLocaleString()).replace("{up}",s.u).replace("{down}",s.d)))
        }
        if(e._rewards.rewards.length == 1 && e._rewards.rewards[0].isItem){
            let it = e._rewards.rewards[0].item;
            if(it.type == "player"){
                let fb = events.createButton(
                    new UTStandardButtonControl(),
                    fy("sbc.watchplayer"),
                    (e) => {events.openFutbinPlayerUrl(e);},
                    "mini"
                )
                fb.__root.setAttribute("data-id",it.definitionId);
                fb.__root.setAttribute("data-name",`${it._staticData.name}`);
                e._rewards._fsuPlayer = fb;
                e._rewards.__root.children[0].append(e._rewards._fsuPlayer.__root);
            }
        }
    }
    events.createDF = (t) => {
        let f = document.createRange().createContextualFragment(t);
        return f;
    }

    events.sbcSubPrice = async(id,e) => {
        if(!info.task.sbc.stat[id].hasOwnProperty("c")){
            let u = `https://www.futbin.org/futbin/api/getChallengesBySetId?set_id=${id}`;
            let d = await getFutbin(u);
            info.task.sbc.stat[id].c = {};
            for (let i of d.data) {
                let j = {"tv":i.price.ps,"pc":i.price.pc};
                info.task.sbc.stat[id].c[i.challengeId] = j;
            }
        }
        if(info.task.sbc.stat[id].hasOwnProperty("c")){
            for (let i of e) {
                i.__tileContent.before(events.createDF(`<div class="fsu-sbc-info"><span class="currency-coins">${fy("sbc.price")}${Number(info.base.platform == "pc" ? info.task.sbc.stat[id].c[i._data.id].pc : info.task.sbc.stat[id].c[i._data.id].tv).toLocaleString()}</span></div>`));
            }
        }
    }

    call.panel = {
        default:UTDefaultActionPanelView.prototype._generate,
        auction:UTAuctionActionPanelView.prototype._generate,
        slot:UTSlotActionPanelView.prototype._generate,
        transfer:UTTransferActionPanelView.prototype._generate,
        quickRender:UTQuickListPanelViewController.prototype.renderView,
        quick:UTQuickListPanelView.prototype._generate,
        loan:UTDuplicateLoanActionPanelView.prototype._generate,
        sbc:UTSBCSquadDetailPanelView.prototype.render,
        market:UTMarketSearchFiltersView.prototype.setPinnedItem,
        reward:UTRewardSelectionChoiceView.prototype.expandRewardSet
    }
    UTMarketSearchFiltersView.prototype.setPinnedItem = function(e, t) {
        call.panel.market.call(this,e,t)
        let sbc = isPhone() ? cntlr.current()._squadContext.squad.isSBC() : cntlr.current()._squad.isSBC();
        if(e.definitionId && sbc && info.set.sbc_market && e.concept){
            let p = info.roster.data.hasOwnProperty(e.definitionId) ? Number(info.roster.data[e.definitionId].prices[info.base.platform].LCPrice.replace(/,/g, '')) : 0,v = this._maxBuyNowPriceRow._currencyInput,f = this._searchFilters.filters;
            if(f[1].setId == "rarity" && f[1].getValue() == -1){
                f[1].setIndexByValue(e.rareflag);
            }
            if(f[2].setId == "position" && f[2].getIndex() !== 0){
                f[2].setIndex(0)
            }
            if(v.getValue() == 0){
                if(pdb.hasOwnProperty(e.definitionId)){
                    v.setValue(pdb[e.definitionId]);
                    if(!isPhone()){
                        events.notice("notice.marketsetmax",1);
                    }
                }else if(p !== 0){
                    v.setValue(p);
                    if(!isPhone()){
                        events.notice("notice.marketsetmax",1);
                    }
                }
            }
        }
    }
    UTQuickListPanelViewController.prototype.renderView = function () {
        call.panel.quickRender.call(this);
        events.detailsButtonSet(this)
    };

    UTRewardSelectionChoiceView.prototype.expandRewardSet = function(e) {
        call.panel.reward.call(this,e);
        let p = this.rewardViews.get(e).primaryReward.item,tn = this._rewardsCarousel._tnsCarousel.__root;
        if(info.set.player_futbin && p.type == "player" && tn.classList.length === 2 && tn.classList.contains("slider") && tn.classList.contains("rewards-slider-container")){
            this._fsuPlayer = events.createButton(
                new UTStandardButtonControl(),
                fy("quicklist.gotofutbin"),
                (e) => {events.openFutbinPlayerUrl(e);},
                "call-to-action mini fsu-reward-but"
            )
            if(!isPhone()){
                this._fsuPlayer.__root.classList.add("pcr")
            }
            this._fsuPlayer.__root.setAttribute("data-id",p.definitionId);
            this._fsuPlayer.__root.setAttribute("data-name",p._staticData.name);
            tn.querySelector(".reward").appendChild(this._fsuPlayer.__root);
        }
    }
    UTQuickListPanelView.prototype._generate = function (...args) {
        if (!this._generated) {
            call.panel.quick.call(this, ...args);
            events.detailsButtonQuick(this)
        }
    };
    UTDefaultActionPanelView.prototype._generate = function (...args) {
        if (!this._generated) {
            call.panel.default.call(this, ...args);
            events.detailsButtonAction(this)
        }
    };

    UTDuplicateLoanActionPanelView.prototype._generate = function (...args) {
        if (!this._generated) {
            call.panel.loan.call(this, ...args);
            events.detailsButtonAction(this)
        }
    }
    UTAuctionActionPanelView.prototype._generate = function (...args) {
        if (!this._generated) {
            call.panel.auction.call(this, ...args);
            events.detailsButtonAction(this)
        }
    };
    UTSlotActionPanelView.prototype._generate = function (...args) {
        if (!this._generated) {
            call.panel.slot.call(this, ...args);
            events.detailsButtonAction(this)
            info.criteria.state = true
        }
    };
    UTTransferActionPanelView.prototype._generate = function (...args) {
        if (!this._generated) {
            call.panel.transfer.call(this, ...args);
            events.detailsButtonAction(this)
        }
    };

    events.detailsButtonSet = (e) => {
        if(!isPhone() && !cntlr.current()._rightController) return;
        let w = isPhone() ? cntlr.current() : cntlr.right();
        if(w.hasOwnProperty("_rootController")) w = w._rootController;
        let a = w._panelView || w._panel;
        if(e.item.isPlayer()){
            let pid = e.item.definitionId || 0;
            if(pid && a.hasOwnProperty("_fsuPlayer")){
                a._fsuPlayer.__root.setAttribute("data-id",pid);
                a._fsuPlayer.__root.setAttribute("data-name",`${e.item._staticData.name}`);
                a._fsuPlayer.setDisplay(1);
                if(!info.set.player_futbin){
                    a._fsuPlayer.hide();
                }
            }
            if(pid && a.hasOwnProperty("_fsuGP")){
                a._fsuGP.__root.setAttribute("data-id",pid);
                if(pdb.hasOwnProperty(pid)){
                    a._fsuGP.setText(fy("quicklist.getpricey"));
                    a._fsuGP.setSubtext(pdb[pid]);
                    a._fsuGP.displayCurrencyIcon(!0);
                }
            }
            e._view._fsuAuction.__subtext.setAttribute('data-id',pid);
            e._view._fsuAuction.__subtext.setAttribute('data-i',e.item.id || 0);
            if(info.roster.data.hasOwnProperty(pid)){
                let lp = info.roster.data[pid].prices[info.base.platform].LCPrice;
                if(lp !== "0"){
                    e._view._fsuAuction.setSubtext(lp);
                    e._view._fsuAuction.setInteractionState(1);
                    if(a.hasOwnProperty("_fsuGP")){
                        a._fsuGP.__root.setAttribute("data-p",lp);
                        a._fsuGP.show();
                    }
                }else{
                    e._view._fsuAuction.setSubtext(lp);
                    e._view._fsuAuction.setInteractionState(0);
                }
            }
            if(!info.set.player_auction){
                e._view._fsuAuction.hide();
            }
            if(a.hasOwnProperty("_fsuRat") && e.item.rating > 0){
                a._fsuRat.__root.setAttribute("data-r",e.item.rating);
                a._fsuRat.setInteractionState(1);
            }
        }else{
            e._view._fsuAuction.setDisplay(!1);
        }
        if(!info.set.player_getprice){
            a._fsuGP.hide();
        }
        if(a.hasOwnProperty("_fsuSwap") && a.hasOwnProperty("_fsuUn")){
            if(e.item.id){
                a._fsuSwap.__text.innerText = fy("sbc.swapquick");
                a._fsuUn.__text.innerText = fy("sbc.swapduplicate");
            }else{
                a._fsuSwap.__text.innerText = fy("sbc.addquick");
                a._fsuUn.__text.innerText = fy("sbc.addduplicate");
            }
            if(Object.keys(info.criteria.data).length){
                a._fsuSwap.setInteractionState(1);
            }
            let unj = services.Item.itemDao.itemRepo.unassigned._collection;
            if(!info.unassigned.state){
                info.unassigned.run = 0;
            }
            info.unassigned.playerId = [];
            if(Object.keys(unj).length > 0){
                let p = cntlr.current()._squad._players.map(function (i) {if(i.item.definitionId > 0){return i.item.definitionId}}).filter(Boolean);
                for (let i in unj) {
                    if(unj[i].isDuplicate() && unj[i].loans == -1 && unj[i].type == "player" && p.indexOf(unj[i].definitionId) == -1){
                        info.unassigned.playerId.push(unj[i].definitionId);
                    }
                }
            }
            if(info.unassigned.playerId.length){
                a._fsuUn.setInteractionState(1);
            }else{
                a._fsuUn.__text.innerText = fy("sbc.notduplicate")
            }
            if(!info.set.sbc_quick){
                a._fsuSwap.hide();
            }
            if(!info.set.sbc_duplicate){
                a._fsuUn.hide();
            }
        }
    }
    events.detailsButtonQuick = (e) => {
        let pa = events.createButton(
            new UTGroupButtonControl(),
            fy("quicklist.auction"),
            (e) => {
                events.showLoader();
                let p = Number(e.__subtext.innerText.replace(/,/g, '')),i = Number(e.__subtext.getAttribute("data-i"));
                events.playerToAuction(i,p);
                events.hideLoader();
            },
            "accordian fsuBuy"
        )
        pa.setSubtext(0);
        pa.displayCurrencyIcon(!0);
        pa.setInteractionState(!1);
        e._fsuAuction = pa;
        e._btnToggle.__root.after(e._fsuAuction.__root);
    }
    //添加fut默认按钮
    events.createButton = (s,t,b,c) => {
        const btn = s;
        btn.init();
        btn.addTarget(btn, b.bind(btn), EventType.TAP);
        btn.setText(t);
        if(c){
            const cl = c.split(" ").filter(Boolean);
            for (let ci of cl) btn.getRootElement().classList.add(ci);
        }
        return btn;
    }

    //添加fut默认按钮
    events.createToggle = (t,b) => {
        const te = new UTToggleCellView;
        te.init();
        te.addTarget(te, b.bind(te), EventType.TAP);
        te.setLabel(t);
        return te;
    }
    events.detailsButtonAction = (e) =>{
        let fb = events.createButton(
            new UTGroupButtonControl(),
            fy("quicklist.gotofutbin"),
            (e) => {events.openFutbinPlayerUrl(e);},
            "more"
        )
        fb.setDisplay(!1)
        e._fsuPlayer = fb;
        let pb = e._playerBioButton || e._btnPlayerBio;
        pb.__root.after(e._fsuPlayer.__root);
        let fg = events.createButton(
            new UTGroupButtonControl(),
            fy("quicklist.getprice"),
            (e) => {events.getAuction(e);},
            "accordian fsuGP"
        )
        fg.hide();
        e._fsuGP = fg;
        let pg = e._btnDiscard || e._findRelatedButton || e._btnSearchMarket || e._discardButton;
        if(pg){
            pg.__root.after(e._fsuGP.__root);
        }
        if(e.hasOwnProperty("_btnAddSwap") && cntlr.current()._squad.isSBC()){
            let fbg = document.createElement("div");
            fbg.classList.add("ut-button-group");

            let fq = events.createButton(
                new UTGroupButtonControl(),
                "quickSwap",
                async() => {
                    info.criteria.repeat = 1;
                    if(isPhone()){
                        await cntlr.current()._rootController._panelView._btnAddSwap._tapDetected(this)
                    }else{
                        await cntlr.right()._panelView._btnAddSwap._tapDetected(this);
                    }
                    console.log("快捷添加状态变为",1)
                },
                ""
            )
            fq.setInteractionState(!1);
            e._fsuSwap = fq;
            fbg.appendChild(e._fsuSwap.__root);

            let fu = events.createButton(
                new UTGroupButtonControl(),
                "unassigned",
                async() => {
                    info.unassigned.state = true;
                    info.unassigned.run = 1;
                    if(isPhone()){
                        await cntlr.current()._rootController._panelView._btnAddSwap._tapDetected(this)
                    }else{
                        await cntlr.right()._panelView._btnAddSwap._tapDetected(this);
                    }
                    console.log("点击按钮变为状态",1)
                },
                ""
            )
            fu.setInteractionState(!1);
            e._fsuUn = fu;
            fbg.appendChild(e._fsuUn.__root);

            let fr = events.createButton(
                new UTGroupButtonControl(),
                fy("sbc.swaprating"),
                (e) => {events.SBCSetRatingPlayers(e);},
                ""
            )
            fr.setInteractionState(!1);
            e._fsuRat = fr;
            fbg.appendChild(e._fsuRat.__root);

            e._fsuButtons = fbg;
            e.__itemActions.before(e._fsuButtons)
        }
    }

    events.playerQuickAuction = async(e) => {
        let p = Number(e.__subtext.innerText.replace(/,/g, ''));
        if(!p) return;
        let w = isPhone() ? cntlr.current() : cntlr.right();
        await w._quickListPanel._view._bidNumericStepper.setValue(p);
        await w._quickListPanel._view._buyNowNumericStepper.setValue(p);
        await w._quickListPanel._view._listButton._tapDetected(this);
        events.notice("notice.quickauction",1);
    }

    UTObjectivesHubView.prototype.setupNavigation = function(e) {
        call.task.objN.call(this,e)
        let t = this._objectivesTM.items;
        if(info.task.obj){return}
        for (let i of t) {
            if(info.task.obj.stat.new.hasOwnProperty(i.id)){
                if(!info.set.info_obj) return;
                i.__root.append(events.createDF(fy(html.taskBar).replace("{Number}",`+${info.task.obj.stat.new[i.id]}`)))
            }
        }
    }

    UTObjectiveCategoryView.prototype.setCategoryGroups = function(t, e) {
        call.task.objG.call(this ,t, e)
        let g = this.groups;
        for (let i of g) {
            if(!info.set.info_obj) return;
            if(info.task.obj.stat[i.id].f){
                i.__title.prepend(events.createDF(`<span class="task-new">${fy("task.new")}</span>`))
            }
            if(info.task.obj.stat[i.id].e){
                i.__title.parentNode.after(events.createDF(`<div class="task-expire">${fy("task.expire")}</div>`))
            }
        }
    }
    UTHomeHubView.prototype._generate = function (...args) {
        if (!this._generated) {
            call.task.home.call(this, ...args);
            GM_addStyle(info.base.sytle);
            events.init();
            info.base.state = true;
        }
    };
    UTHomeHubView.prototype.getObjectivesTile = function() {
        let r = call.task.homeG.call(this);
        if(info.task.obj.html && !this._objectivesTile.__root.querySelector(".fsu-task")){
            if(!info.set.info_obj) return;
            this._objectivesTile.__tileContent.before(
                events.createDF(`<div class="fsu-task">${info.task.obj.html}</div>`)
            )
        }
        if(info.task.sbc.html && !this._sbcTile.__root.querySelector(".fsu-task")){
            if(!info.set.info_sbc) return;
            this._sbcTile.__tileContent.before(
                events.createDF(`<div class="fsu-task">${info.task.sbc.html}</div>`)
            )
        }
        return r;
    }
    call.search = {
        did:UTClubSearchFiltersViewController.prototype.viewDidAppear,
        filters:UTItemSearchView.prototype.setFilters ,
        result:UTPaginatedItemListView.prototype.setPaginationState,

    };
    UTClubSearchFiltersViewController.prototype.viewDidAppear = function() {
        call.search.did.call(this)
        if(info.criteria.state && this.squad._isSBC){
            events.searchFill(this,-1);
        }else{
            info.unassigned.rlist = []
        }
    }
    UTItemSearchView.prototype.setFilters = function(e, t) {
        call.search.filters.call(this,e, t)
        if(e.searchCriteria.type == "player" && !isPhone()){
            events.searchInput(this)
        }
    }
    events.searchFill = async(e,t) =>{
        if(t == -1){
            t = info.unassigned.run;
        }
        let c = e.viewmodel.searchCriteria;
        info.unassigned.rlist = [];
        if(t == 1){
            let s = new UTSearchCriteriaDTO();
            s._type = "player";
            s.count = 21;
            s.sortBy = Object.keys(info.criteria.data).length ? info.criteria.data.sortBy : "ovr";
            s._sort = Object.keys(info.criteria.data).length ? info.criteria.data._sort : "asc";
            s.defId = info.unassigned.playerId;
            info.unassigned.rlist = s.defId;
            await e.setSearchCriteria(s);
            await e._view.getSearchButton()._tapDetected(this);
            events.notice("notice.duplicateloading",1);
            return;
        }
        if(t == 3){
            let s = new UTSearchCriteriaDTO();
            s._type = "player";
            s.count = 21;
            s.sortBy = "value";
            s._sort = "asc";
            let sr,r = info.base.ratings[info.unassigned.rating];
            if(r.length > 650){
                if (Math.random() > 0.5) {
                    sr = r.sort((a, b) => a - b).slice(0, 650);
                } else {
                    sr = r.sort((a, b) => b - a).slice(0, 650);
                }
            }else{
                sr = r;
            }
            s.defId = sr;
            info.unassigned.rlist = s.defId;
            await e.setSearchCriteria(s);
            await e._view.getSearchButton()._tapDetected(this);
            events.notice("notice.appointloading",1);
            return;
        }
        if(t !== 0 && c.defId.length == 0){
            console.log("状态不是0","但是判断符合条件给变成0")
            t = 0;
            info.unassigned.run = 0;
            if(isPhone()){
                getAppMain().getRootViewController().getPresentedViewController().getCurrentViewController()._eBackButtonTapped();
                return;
            }
        }
        if(t == 4){
            console.log("状态4","修改input")
            await e._view.getPlayerNameSearch()._playerNameInput.setValue(fy("sbc.appoint"));
            e._view.getPlayerNameSearch().selected.firstName = fy("sbc.appoint");
            e._view.getPlayerNameSearch().selected.lastName = "";
            await e._view.getSortDropDown().setIndexById(2);
            return;
        }
        if(t == 2){
            console.log("状态2","修改input")
            await e._view.getPlayerNameSearch()._playerNameInput.setValue(fy("sbc.duplicates"));
            e._view.getPlayerNameSearch().selected.firstName = fy("sbc.duplicates");
            e._view.getPlayerNameSearch().selected.lastName = "";
            await e._view.getSortDropDown().setIndexById(2);
            return;
        }
        console.log("开始判断进行填充选项","此时的saveCriteria为:",info.criteria.data)
        if(Object.keys(info.criteria.data).length == 0){
            await e._view.getSortDropDown().setIndexById(2);
            info.criteria.state = false;
        }else{
            info.criteria.state = false;
            if(!info.set.sbc_records) return;
            //交易选项匹配判断
            c._untradeables = info.criteria.data._untradeables;
            if(info.criteria.data._untradeables == "true"){
                await e._view.getSortOptions().toggles._collection["sort-untradeable"].toggle(true);
            }else{
                await e._view.getSortOptions().toggles._collection["sort-untradeable"].toggle(false);
            }
            //排除队伍选项匹配判断
            if(cntlr.current().className == `UTSquadSplitViewController`){
                c.excludeDefIds = [];
            }else{
                c.excludeDefIds = info.criteria.data.excludeDefIds;
                if(info.criteria.data.excludeDefIds.length > 0){
                    await e._view.getSortOptions().toggles._collection["sort-exclude-squad"].toggle(true);
                }else{
                    await e._view.getSortOptions().toggles._collection["sort-exclude-squad"].toggle(false);
                }
            }
            //排序条件选项匹配判断
            if(info.criteria.data.sortBy !== c.sortBy || info.criteria.data._sort !== c._sort){
                let sort = ["valuedesc","valueasc","ovrdesc","ovrasc","recentdesc"]
                for (let i = 0; i < sort.length; i++) {
                    if(info.criteria.data.sortBy + info.criteria.data._sort == sort[i]){
                        await e._view.getSortDropDown().setIndexById(i);
                        break;
                    }
                }
            }
            //品质条件选项匹配判断
            if(info.criteria.data.level !== c.level){
                for (const v of e._view._filterContainer.filters[0].options) {
                    if(v.value == info.criteria.data.level){
                        await e._view._filterContainer.filters[0].setIndexById(v.id);
                        break;
                    }
                }
            }
            //稀有条件选项匹配判断
            if(info.criteria.data.rarities !== c.rarities){
                if(info.criteria.data.rarities.length == 1){
                    await e._view._filterContainer.filters[1].setIndexById(info.criteria.data.rarities[0])
                }
            }
            //位置条件选项匹配判断
            if(info.criteria.data._position == "any"){
                await e._view._filterContainer.filters[2].setIndexById(-1)
            }else{
                let posId = -1;
                if(cntlr.current()._squad._players[cntlr.left().getView().getSelectedSlot()._slotIndex].position !== null){
                    posId = cntlr.current()._squad._players[cntlr.left().getView().getSelectedSlot()._slotIndex].position.typeId;
                }
                await e._view._filterContainer.filters[2].setIndexById(posId)
            }
            if(info.criteria.data.nation !== c.nation){
                await e._view._filterContainer.filters[4].setIndexById(info.criteria.data.nation)
            }
            if(info.criteria.data.league !== c.league){
                await e._view._filterContainer.filters[5].setIndexById(info.criteria.data.league)
            }
            if(info.criteria.data.club !== c.club){
                await e._view._filterContainer.filters[6].setIndexById(info.criteria.data.club)
            }
            if(info.criteria.repeat == 1){
                setTimeout(() => {
                    e._view.getSearchButton()._tapDetected(this);
                }, 50);
                info.criteria.repeat = 0;
                events.notice("notice.quicksearch",1);
                console.log("快捷添加状态变为",0)
                return;
            }
        }
    }

    UTPaginatedItemListView.prototype.setPaginationState = function(t, e) {
        call.search.result.call(this , t ,e)
        if(this._interactionState){
            info.unassigned.state = false;
            if(info.unassigned.run == 1){
                info.unassigned.run = 2;
                console.log("状态1","有结果变为状态2")
                if(!this.getRows()){
                    events.notice("notice.noduplicate",2);
                    services.Item.itemDao.itemRepo.unassigned.reset();
                    return;
                }
            }
            if(info.unassigned.run == 3){
                info.unassigned.run = 4;
                if(!this.getRows()){
                    console.log("状态3","有结果变为状态4")
                    events.notice("notice.noduplicate",2);
                    return;
                }
            }
            if(cntlr.current().hasOwnProperty("_squad")){
                if(cntlr.current()._squad.isSBC()){
                    let w;
                    if(isPhone()){
                        w = cntlr.current()._currentController;
                    }else{
                        w = cntlr.right();
                    }
                    if(w.searchCriteria){
                        if(w.searchCriteria.defId.length == 0){
                            info.criteria.data = JSON.parse(JSON.stringify(w.searchCriteria));
                        }
                    }
                }
            }
        }
    }
    events.searchInput = (c) => {
        if(!info.set.sbc_input) return;
        for (let i of ["club","nation","league"]) {
            let s = c.searchFilters._collection[i];
            let a = s.options.map(e => e.label);
            s.__root.setAttribute("data-f",i);
            let st = s.__label.innerText;
            s.__label.innerHTML = "";
            s.__label.style.marginRight = 0
            0;
            s.__list.style.height = "14rem";
            s.__list.style.backgroundColor = "#171826";
            s.__list.setAttribute("data-f",i);
            let ip = document.createElement("input");
            ip.classList.remove("ut-text-input-control");
            ip.classList.add("fsu-input");
            if(st == services.Localization.localize(`sbc.requirements.subType.${i}`)){
                ip.setAttribute("placeholder",st);
            }else{
                ip.setAttribute("value",st);
            }
            ip.setAttribute("maxlength","50");
            ip.setAttribute("data-f",i);
            ip._oData = a;
            ip.addEventListener('compositionstart', events.searchInputEvent);
            ip.addEventListener('compositionend', events.searchInputEvent);
            ip.addEventListener('input', events.searchInputEvent);
            ip.addEventListener('blur', events.searchInputEvent);
            ip.addEventListener('focus', events.searchInputEvent);
            s[`_fsu${i}`] = ip;
            s.__label.append(s[`_fsu${i}`]);
        }
    }
    events.searchInputEvent = (e) => {
        let iz = cntlr.current()._view;
        if(cntlr.current().hasOwnProperty("_rightController")){
            iz = cntlr.right()._view;
        }
        if(e.type == "compositionstart"){
            info.base.input = false;
        }
        if(e.type == "compositionend"){
            info.base.input = true;
        }
        if(e.type == "input"){
            setTimeout(() => {
                if(info.base.input){
                    let v = e.target.value;
                    let f = e.target.getAttribute("data-f");
                    let z = iz.hasOwnProperty("_filterContainer") ? iz._filterContainer.searchFilters._collection[f] : iz._searchFilters.searchFilters._collection[f];
                    let p = `ul[data-f='${f}'] li`;
                    if(!z.isOpen){
                        z.open()
                    }
                    e.target._oData.forEach(function(el, i) {
                        let a = document.querySelectorAll(p)[i];
                        if(el.includes(v)){
                            a.classList.remove("hide");
                        }else{
                            a.classList.add("hide");
                        }
                    })
                }
            }, 0);
        }
        if(e.type == "blur"){
            let v = e.target.value;
            let f = e.target.getAttribute("data-f");
            let z = iz.hasOwnProperty("_filterContainer") ? iz._filterContainer.searchFilters._collection[f] : iz._searchFilters.searchFilters._collection[f];
            if(v !== z.label){
                if(z.id == -1){
                    e.target.value = "";
                }else{
                    e.target.value = z.label;
                }
            }
        }
        if(e.type == "focus"){
            e.target.value = "";
        }
    }
    UTUnassignedItemsViewController.prototype._renderView = function(...args) {
        let r = call.view.unassigned.call(this, ...args);
        if(this._view.sections.length){
            this._view._fsuUasreset = events.createButton(
                new UTStandardButtonControl(),
                fy("uasreset.btntext"),
                async(e) => {
                    await services.Item.itemDao.itemRepo.unassigned.reset();
                    await getAppMain().getRootViewController().getPresentedViewController().getCurrentViewController()._backButton._tapDetected(this);
                    events.notice("notice.uasreset",0);
                },
                "mini call-to-action section-header-btn fsu-uasreset"
            )
            this._view.__root.querySelector(".ut-section-header-view").append(this._view._fsuUasreset.__root)
        }
        return r;
    }

    //SBC无须排列创建队伍
    UTSquadBuilderViewModel.prototype.generatePlayerCollection = function (e,o,n) {
        let c = 0;
        let ls = info.build.league ? [31,16,13,19,53] : [];
        let rs = info.build.rare ? [3] : [];
        let p = o.filter(item => !ls.includes(item.leagueId) && !rs.includes(item.rareflag))
        if(p.length < e.length && (ls.length || rs.length)){
            events.notice("notice.builder",2)
        }
        return e.map(function (_, t) {
            var i = n ? n.getSlot(t) : null;
            return i && (i.isValid() || i.isBrick()) ?
                i.getItem() :
                p[c++];
        });
    };
    //拍卖优化部分代码加载
    UTMarketSearchView.prototype._generate = function(...args) {
        if (!this._generated) {
            call.view.market.call(this,...args)
            if(info.set.info_auction && cntlr.current().getNavigationTitle() == services.Localization.localize("navbar.label.search")){
                this._list.__itemList?.classList.add("fsu-compact")
            }
        }
    }

    //商店可开特殊球员数量显示加载
    UTStorePackDetailsView.prototype._generate = function(...args) {
        if (!this._generated) {
            call.view.pack.call(this,...args)
            if(info.base.promo && info.set.info_pack){
                let f = events.createButton(
                    new UTCurrencyButtonControl(),
                    info.base.promo,
                    (e) => {
                        GM_openInTab(`https://www.fut.gg/players/?in_packs=1`, { active: true, insert: true, setParent :true });
                    },
                    "fsu-promo"
                )
                f.setSubText(fy("pack.promo"))
                this._fsuPromo = f;
                this._fsuPromoBox = document.createElement("div");
                this._fsuPromoBox.classList.add("fsu-promo-box");
                this._fsuPromoBox.append(this._fsuPromo.__root);
                this.__root.querySelector(".ut-store-pack-details-view--pack-counts").append(this._fsuPromoBox)
            }
        }
    }


    //配置页面创建

    const fsuSV = function (t) {
        UTView.call(this);
    };
    JSUtils.inherits(fsuSV, UTView);
    fsuSV.prototype._generate = function _generate() {
        if (!this._generated) {
            let w = document.createElement("div");
            w.classList.add("ut-club-search-filters-view");
            let e = document.createElement("div");
            e.classList.add("ut-pinned-list-container","ut-content-container");
            this.__content = document.createElement("div");
            this.__content.classList.add("ut-content");
            let i = document.createElement("div");
            i.classList.add("ut-pinned-list");

            let ics = document.createElement("div");
            ics.classList.add("sort-filter-container");
            let icst = document.createElement("h4");
            icst.textContent = fy("set.style.title");
            ics.appendChild(icst);
            let icsb = document.createElement("div");
            icsb.classList.add("fsu-setbox");
            this._cStyle = {};
            this._cStyle.new = events.createToggle(
                fy(`set.style.new`),
                async(e) => {
                    set.save("card_style", e.getToggleState() ? 2 : 1);
                    cntlr.current().getView()._cStyle.old.toggle();
                }
            )
            icsb.appendChild(this._cStyle.new.getRootElement());
            this._cStyle.old = events.createToggle(
                fy(`set.style.old`),
                async(e) => {
                    set.save("card_style", e.getToggleState() ? 1 : 2);
                    cntlr.current().getView()._cStyle.new.toggle();
                }
            )
            icsb.appendChild(this._cStyle.old.getRootElement());

            (info.set.card_style == 1 ? this._cStyle.old : this._cStyle.new).toggle(1);

            ics.appendChild(icsb);
            i.appendChild(ics);

            for (let n in info.setfield) {
                let l = document.createElement("div");
                l.classList.add("sort-filter-container");
                let lt = document.createElement("h4");
                lt.textContent = fy(`set.${n}.title`);
                l.appendChild(lt);
                let lb = document.createElement("div");
                lb.classList.add("fsu-setbox");
                this[`_${n}`] = {};
                for (let i of info.setfield[n]) {
                    this[`_${n}`][i] = set.addToggle(n,i);
                    lb.appendChild(this[`_${n}`][i].getRootElement())
                }
                l.appendChild(lb);
                i.appendChild(l);
            }


            this.__content.appendChild(i);
            let b = document.createElement("div");
            b.classList.add("button-container");
            this._fsuinfo = events.createButton(
                new UTStandardButtonControl(),
                fy("set.getdoc"),
                () => {
                    GM_openInTab(`https://mfrasi851i.feishu.cn/wiki/OLNswCYQciVKw8k9iaAcmOY1nmf`, { active: true, insert: true, setParent :true });
                },
                "call-to-action"
            )
            b.appendChild(this._fsuinfo.__root);
            this.__content.appendChild(b);
            e.appendChild(this.__content);
            w.appendChild(e);
            this.__root = w;
            this._generated = !0;
        }
    }
    set.addToggle = function(na,nb){
        let e = events.createToggle(
            fy(`set.${na}.${nb}`),
            async(e) => {
                set.save(`${na}_${nb}` , e.getToggleState() ? true : false);
            }
        )
        e._sName = `${na}_${nb}`;
        if(info.set[`${na}_${nb}`]){
            e.toggle(1);
        }
        return e;
    }
    const fsuSC = function (t) {
        UTViewController.call(this);
    };
    JSUtils.inherits(fsuSC, UTViewController);
    fsuSC.prototype._getViewInstanceFromData = function () {
        return new fsuSV();
    };
    fsuSC.prototype.viewDidAppear = function () {
        this.getNavigationController().setNavigationVisibility(true, true);
    };
    fsuSC.prototype.getNavigationTitle = function () {
        return fy("set.title");
    };
    
    set.init = function(){
        let a = JSON.parse(GM_getValue("set","{}")),b = {};
        if(a && typeof a === 'object'){
            b = a;
        }
        if(!b.hasOwnProperty("card_style")){
            b["card_style"] = 2;
        }
        for (let n in info.setfield) {
            for (let i of info.setfield[n]) {
                let c = `${n}_${i}`;
                if(!b.hasOwnProperty(c)){
                    b[c] = true;
                }
            }
        }
        console.log(b)
        info.set = b;
    }
    set.save = function(s,r){
        info.set[s] = r;
        GM_setValue("set",JSON.stringify(info.set));
        console.log(info.set);
    };
    //拍卖查询价格
    events.getAuction = async function(e){
        e.setInteractionState(0);
        e.__root.querySelector("span.btn-subtext").textContent = fy("quicklist.getpriceload");
        let id = e.__root.getAttribute("data-id"),p = e.__root.getAttribute("data-p").replace(/,/g, ""),p_result,p_arr = [],p_cm = {},p_cmarr = [],s = Number(p);
        p_result = await getAuctionPrice(id,p);
        p_arr = p_result.map(i => i.buyNowPrice) || [];
        if (p_result.length == 0) {
            for (let i = 0; i < 5; i++) {
                s = UTCurrencyInputControl.getIncrementAboveVal(s);
                console.log(`第${i}次循环,当前查询价格${s}`)
                let p_r =  await getAuctionPrice(id,s);
                p_r.map(i => {
                    p_arr.push(i.buyNowPrice);
                });
                if(p_r.length > 0){
                    break;
                }
            }
        } else if (p_result.length == 21) {
            for (let i = 0; i < 5; i++) {
                s = UTCurrencyInputControl.getIncrementBelowVal(s);
                console.log(`第${i}次循环,当前查询价格${s}`)
                let p_r =  await getAuctionPrice(id,s);
                p_r.map(i => {
                    p_arr.push(i.buyNowPrice);
                });
                if(p_r.length < 21){
                    break;
                }
            }
        }
        for (let i of p_arr) {
            p_cm[i] = p_cm[i] ? p_cm[i] + 1 : 1;
        }
        p_cm = Object.fromEntries(Object.entries(p_cm).slice(0, 3));
        if(Object.keys(p_cm).length){
            pdb[id] = Object.entries(p_cm)[0][0].toLocaleString('en-US', { style: 'decimal' });
            let p_e = document.querySelector(`button.fsuGP[data-id='${id}']`)
            if(p_e){
                p_e.querySelector("span.btn-subtext").textContent = pdb[id].toLocaleString();
                p_e.querySelector("span.btn-subtext").classList.add("currency-coins");
                let n = 0;
                for (let i in p_cm) {
                    n++;
                    let l_e = events.createButton(
                        new UTGroupButtonControl(),
                        `${fy("quicklist.getpricelt")} ${n}`,
                        () => {},
                        "accordian fsuGPL"
                    )
                    l_e.__subtext.textContent = i.toLocaleString();
                    l_e.displayCurrencyIcon(!0);
                    let l_es = document.createElement("span");
                    l_es.textContent = ` ×${p_cm[i]}`;
                    l_e.__subtext.appendChild(l_es);
                    l_e.setInteractionState(0);
                    p_e.parentNode.appendChild(l_e.__root)
                }
            }
        }
    }
    function getAuctionPrice(i,p){
        return new Promise(res => {
            GM_xmlhttpRequest({
                method:"GET",
                url:`https://utas.mob.v1.fut.ea.com/ut/game/fifa${info.base.year}/transfermarket?num=21&start=0&type=player&maskedDefId=${i}&maxb=${p}`,
                headers: {
                    "Content-type": "application/json",
                    "X-UT-SID": info.base.sId
                },
                onload:function(response){
                    if(response.status == 404 || response.status == 401){
                        info.base.sId = services.Authentication.sessionUtas.id;
                        events.notice("notice.loaderror",2);
                    }else{
                        res(JSON.parse(response.response).auctionInfo)
                    }
                },
                onerror:function(){
                    events.notice("notice.loaderror",2);
                }
            })
        })
    };
    UTSBCSquadDetailPanelView.prototype.render = function(e, t, i, o) {
        call.panel.sbc.call(this,e, t, i, o)
        if(!this._fsuSquad && info.set.sbc_template){
            let b = events.createButton(
                new UTStandardButtonControl(),
                fy("sbc.squadfill"),
                (e) => {events.getTemplate(e);},
                ""
            )
            b.__root.setAttribute("data-id",e.id);
            this._fsuSquad = b;
            this._btnSquadBuilder.__root.after(this._fsuSquad.__root);
        }
    }
    //阵容智能填充
    events.getTemplate = async function(e){
        e.setInteractionState(0);
        events.showLoader();
        events.changeLoadingText("loadingclose.template1");
        info.base.template = true;
        events.notice("notice.templateload",1);
        let id = e.__root.getAttribute("data-id"),pi_r,pi_d = [],pi_a = [],pi_c = -1,pi_f,pi_s,pi_n = 0;
        let c =  isPhone() ? cntlr.current()._challenge : cntlr.current()._overviewController._challenge;
        let c_b = c.squad.getAllBrickIndices(),c_p = c.squad._formation.generalPositions,c_i = c.squad._formation.id;
        pi_r = await getFutbinSBC(id,0);
        pi_d = pi_r.slice(0, 5).map(item => item.id);
        if(!pi_d.length){
            events.hideLoader();
            events.notice("notice.squaderror",2);
            return;
        }
        for (let n of pi_d) {
            pi_n++;
            events.changeLoadingText(["loadingclose.template2",`${pi_n}`,`${pi_d.length - pi_n}`]);
            if(!info.base.template){return};
            let z = await getFutbinSBC(n,1),pdj = {},pda = [],pdp = 0,pdpj = {},pdn = 0,pdna = [],pds = [],pdc = JSON.parse(JSON.stringify(c_p));;
            for (let sn in z) {
                if(sn.match(/cardlid\d+/)){
                    let sni = z[sn].Player_Resource,snp = z[sn].price,snpi = Number(sn.match(/\d+/)[0]) - 1,snps = info.formation[c_i][snpi],snpid = pdc.lastIndexOf(snps);
                    if(snpid == -1){
                        events.hideLoader()
                        console.log("计算位置出错了!!!")
                        return;
                    }
                    pdc[snpid] = "";
                    pdj[snpid] = sni;
                    pdpj[sni] = snp;
                    pdp += snp;
                    pda.push(sni);
                }
            }
            let y = await getTemplatePlayer(pda.join(","));
            for (let i = 0; i < 11; i++) {
                let lpd = pdj[i];
                if(!lpd){
                    pds.push(null);
                    continue;
                }
                let lpde = new UTItemEntity();
                lpde.id = pdj[i];
                lpde.definitionId = pdj[i];
                lpde.concept = true;
                lpde.stackCount = 1;
                pds.push(lpde);
            }
            for (let sn of y) {
                let sni = sn.resourceId;
                if(pda.includes(sni) && !sn.hasOwnProperty("loans")){
                    pdn++;
                    pdna.push(sni);
                    pdp -= pdpj[sni];
                    for (let k in pds) {
                        if(pds[k]){
                            if(pds[k].id == sni){
                                pds[k].id = sn.id;
                                pds[k].concept = false;
                            }
                        }
                    }
                }
            }
            if(pi_c == -1 || pdp < pi_c){
                pi_a = pda;
                pi_c = pdp;
                pi_f = n;
                pi_s = pds;
            }
            await events.wait(0.5,1);
        }
        console.log("最终结果:",pi_a,pi_c,pi_f,pi_s)
        if(!info.base.template){return};
        c.squad.removeAllItems();
        c.squad.setPlayers(pi_s, true);
        services.SBC.saveChallenge(c).observe(
            this,
            async function (s, d) {
                if (!d.success) {
                    events.notice("notice.templateerror",2);
                    c.squad.removeAllItems();
                    events.hideLoader();
                }
                services.SBC.loadChallengeData(c).observe(
                    this,
                    async function (s, {response:{squad}}) {
                        events.hideLoader();
                        const players = squad._players.map((player) => player._item);
                        c.squad.setPlayers(players, true);
                        c.onDataChange.notify({squad});
                        if(isPhone()){
                            getAppMain().getRootViewController().getPresentedViewController().getCurrentViewController()._backButton._tapDetected(this);
                        }
                        events.notice("notice.templatesuccess",0);
                        events.loadPlayerPrice(pi_a);
                    }
                );
            }
        );
    }
    UTSBCService.prototype.loadChallengeData = function (r) {
        var s = this,
            a = new EAObservable();
        return (
            this.sbcDAO
            .loadChallenge(r.id, r.isInProgress())
            .observe(this, function (t, e) {
                t.unobserve(s);
                a.notify(e);
            }),
            a
        );
    };
    function getFutbinSBC(i,t){
        let p = info.base.platform == "pc" ? "PC" : "PS";
        let u = t == 0 ? `https://www.futbin.org/futbin/api/getChallengeTopSquads?chal_id=${i}&platform=${p}` : `https://www.futbin.org/futbin/api/getSquadByID?squadId=${i}`;
        return new Promise(res => {
            GM_xmlhttpRequest({
                method:"GET",
                url:u,
                headers: {
                    "Content-type": "application/json"
                },
                onload:function(response){
                    if(response.status == 404 || response.status == 401){
                        events.notice("notice.loaderror",2);
                        events.hideLoader();
                    }else{
                        res(JSON.parse(response.response)[t == 0 ? "data" : "squad_data"])
                    }
                },
                onerror:function(){
                    events.notice("notice.loaderror",2);
                    events.hideLoader();
                }
            })
        })
    };
    function getTemplatePlayer(id){
        return new Promise(res => {
            let postData = {"count": 99,"sort": "desc","sortBy": "ovr","start": 0,"type": "player","defId": id};
            GM_xmlhttpRequest({
                method:"POST",
                url:`https://utas.mob.v1.fut.ea.com/ut/game/fifa${info.base.year}/club`,
                headers: {
                    "Content-type": "application/json",
                    "X-UT-SID": info.base.sId
                },
                data:JSON.stringify(postData),
                onload:function(response){
                    if(response.status == 404 || response.status == 401){
                        info.base.sId = services.Authentication.sessionUtas.id;
                        events.notice("notice.loaderror",2);
                        events.hideLoader();
                    }else{
                        res(JSON.parse(response.response).itemData)
                    }
                },
                onerror:function(){
                    events.notice("notice.loaderror",2);
                    events.hideLoader();
                }
            })
        })
    };

    UTAppSettingsView.prototype._generate = function (...args) {
        if (!this._generated) {
            call.view.setting.call(this,...args)
            let g = document.createElement("div");
            g.classList.add("ut-button-group");
            this._fsuSet = events.createButton(
                new UTGroupButtonControl(),
                `FSU ${services.Localization.localize("button.settings")}`,
                async(e) => {
                    var n = cntlr.current().getNavigationController();
                    if(n){
                        var t = new fsuSC();
                        n.pushViewController(t);
                    }
                },
                "more"
            )
            g.appendChild(this._fsuSet.getRootElement());
            this.__topGroup.after(g);
        }
    }
    
    events.playerToAuction = async (d,p) =>{
        let i = services.Item.itemDao.itemRepo.transfer.get(d) || services.Item.itemDao.itemRepo.unassigned.get(d) || services.Item.itemDao.itemRepo.club.items.get(d);
        let t = services.Item.itemDao.itemRepo.transfer._collection.hasOwnProperty(d);
        if(i){
            if((repositories.Item.getPileSize(ItemPile.TRANSFER) - repositories.Item.numItemsInCache(ItemPile.TRANSFER) > 0 || t) && p){
                await events.playerGetLimits(i);
                if(i.hasPriceLimits()){
                    if(p < i._itemPriceLimits.minimum || p > i._itemPriceLimits.maximum){
                        events.notice(["notice.auctionlimits",i._staticData
                        .name],2)
                        return;
                    }
                }
                let lp = UTCurrencyInputControl.getIncrementBelowVal(p);
                services.Item.list(i,lp,p,3600);
                events.notice(["notice.auctionsuccess",i._staticData
                .name,p],0)
            }else{
                events.notice("notice.auctionmax",2)
                return false;
            }
        }else{
            events.notice(["notice.auctionnoplayer",d],2)
        }
    }
    events.playerGetLimits = async(i) => {
        return new Promise((resolve) => {
            if (i.hasPriceLimits()) {
                resolve();
              return;
            }
            services.Item.requestMarketData(i).observe(
                this,
                async function (sender, response) {
                    resolve();
                }
            );
        });
    }
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址