Launcher.js 49.8 KB

                (function() {
                    var nodeEnv = typeof require !== 'undefined' && typeof process !== 'undefined';
                    var __module = nodeEnv ? module : {exports:{}};
                    var __filename = 'preview-scripts/assets/script/game/Launcher.js';
                    var __require = nodeEnv ? function (request) {
                        return cc.require(request);
                    } : function (request) {
                        return __quick_compile_project__.require(request, __filename);
                    };
                    function __define (exports, require, module) {
                        if (!nodeEnv) {__quick_compile_project__.registerModule(__filename, module);}"use strict";
cc._RF.push(module, 'f191b3NyXtCubDaTGld/tHG', 'Launcher');
// script/game/Launcher.ts

"use strict";
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
const simba_sdk_1 = require("simba-sdk");
const AVG_1 = require("../avg/AVG");
const CCDummyObjects_1 = require("../common/CCDummyObjects");
const simba_cc_audio_manager_1 = require("simba-cc-audio-manager");
const UIManager_1 = require("../common/gameplay/managers/UIManager");
const AnimationUtils_1 = require("../common/utils/AnimationUtils");
const GameConfig_1 = require("../GameConfig");
const Enums_1 = require("./Enums");
const GameDotMgr_1 = require("./GameDotMgr");
const GameModelManager_1 = require("./model/GameModelManager");
const AlertDialogViewPresenter_1 = require("./ui/presenter/AlertDialogViewPresenter");
const MainViewPresenter_1 = require("./ui/presenter/MainViewPresenter");
const simba_cc_resutils_1 = require("simba-cc-resutils");
const CCGameCenterComponent_1 = require("../cooperation/script/CCGameCenterComponent");
const CCGameCenterNodeFactory_1 = require("../cooperation/script/CCGameCenterNodeFactory");
const CustomerServiceDataCenter_1 = require("../customerService/script/CustomerServiceDataCenter");
const EventCenter_1 = require("../cooperation/event/EventCenter");
const EventKit_1 = require("../cooperation/event/EventKit");
const UnlockSpecialPlotEventManager_1 = require("./model/UnlockSpecialPlotEventManager");
const simba_sdk_exchangecode_1 = require("simba-sdk-exchangecode");
const { ccclass, property } = cc._decorator;
let Launcher = /** @class */ (() => {
    let Launcher = class Launcher extends cc.Component {
        constructor() {
            super(...arguments);
            this.progressBar = CCDummyObjects_1.DummyProgressBar;
            this.progressLabel = CCDummyObjects_1.DummyLabel;
            this.uiRootNode = CCDummyObjects_1.DummyNode;
            this.toastParentNode = CCDummyObjects_1.DummyNode;
            this.loadingNode = CCDummyObjects_1.DummyNode;
            this.loadingRoleNode = CCDummyObjects_1.DummyNode;
            this.VerbRoot = CCDummyObjects_1.DummyNode;
            this.isLoadGameCenter = false;
            this.userIdLabel = CCDummyObjects_1.DummyLabel;
            this.hotUpdateNode = CCDummyObjects_1.DummyNode;
            this.bgSpr = CCDummyObjects_1.DummySprite;
            this.loginCount = 0;
            this._gameCenterViewNode = CCDummyObjects_1.DummyNode;
            this._disposable = new EventKit_1.CompositeDisposable;
            /**控制游戏列表是否展示 */
            this.onShowGameCenterListView = (isShow) => {
                if (!this._gameCenterViewNode) {
                    return;
                }
                this._gameCenterViewNode.active = isShow;
            };
            this.onGameStart = () => {
                this.initializeGame();
            };
            this.lateInit = async () => {
                let mainViewPromise = UIManager_1.UIManager.pushPresenter(MainViewPresenter_1.default, undefined);
                AnimationUtils_1.AnimationUtils.animateProgress(this.progressBar, 0.6, 1, this.progressLabel);
                if (CC_DEV) {
                    globalThis['PlotManager'] = AVG_1.PlotManager;
                    globalThis['GameRecord'] = AVG_1.GameRecord;
                    let ConfigManager = require('simba-config-manager');
                    globalThis['ConfigManager'] = ConfigManager;
                }
                await AVG_1.initAVG();
                //解决清档
                await this.dealEmptyRecord();
                if (GameConfig_1.GameConfig.EMPTY_RECORD_WHEN_LOGIN) {
                    AVG_1.PlotManager.stop();
                    await AVG_1.GameRecord.emptyRecords();
                }
                AnimationUtils_1.AnimationUtils.animateProgress(this.progressBar, 0.8, 1, this.progressLabel);
                await AVG_1.PlotManager.start(0, false);
                AnimationUtils_1.AnimationUtils.animateProgress(this.progressBar, 0.9, 1, this.progressLabel);
                await simba_sdk_exchangecode_1.initExchangeCode();
                // init game data
                await GameModelManager_1.GameModelManager.init((value) => {
                    AnimationUtils_1.AnimationUtils.animateProgress(this.progressBar, value, 1, this.progressLabel);
                });
                GameDotMgr_1.default.getInstance().dotLoading(Enums_1.LoadingState.LoadingStart);
                AnimationUtils_1.AnimationUtils.animateProgress(this.progressBar, 0.95, 1, this.progressLabel);
                GameDotMgr_1.default.getInstance().dotLoading(Enums_1.LoadingState.LoadingEnd);
                (await mainViewPromise).start();
                AnimationUtils_1.AnimationUtils.animateProgress(this.progressBar, 1.0, 1, this.progressLabel);
                // GameDotMgr.getInstance().dotLoading(LoadingState.EnterLobby);
                this.loadingNode.active = false;
                //检查是否解锁手表次留番外
                UnlockSpecialPlotEventManager_1.default.getInstance().nextDayUnlockedSpecialPlot(4);
            };
            this.loginGame = async () => {
                return new Promise(async (resolve, reject) => {
                    this.loginCount++;
                    try {
                        let ret = await simba_sdk_1.SDK.login();
                        if (ret) {
                            this.userIdLabel.string = ret.playerId;
                            await this.lateInit();
                            resolve();
                        }
                    }
                    catch (error) {
                        if (this.loginCount > 3) {
                            this.showLoginFailed();
                            reject(new Error("登录失败"));
                        }
                        else if (error == "timeout") {
                            this.loginGame();
                        }
                    }
                });
            };
        }
        async onLoad() {
            this.screenAdapter();
            if (cc.sys.isNative) {
                this._disposable.add(EventCenter_1.EventCenter.GameStart.on(this.onGameStart));
                let hotNode = await simba_cc_resutils_1.ResUtils.createWithPrefab('prefab/HotUpdate');
                hotNode.parent = this.hotUpdateNode;
            }
            this.scheduleOnce(() => {
                this.preloadView();
                this.preloadDir();
            });
            //关闭fps展示
            cc.debug.setDisplayStats(GameConfig_1.GameConfig.showFPS);
            /**关闭多点触摸 特效层将不能使用 */
            cc.macro.ENABLE_MULTI_TOUCH = false;
            this.fixScreenSize();
            this.scheduleOnce(async () => {
                try {
                    let node = await simba_cc_resutils_1.ResUtils.createWithPrefab('prefab/ui/VerbView');
                    node.parent = this.VerbRoot;
                }
                catch (error) {
                    console.error(error);
                }
                if (!this.isLoadGameCenter)
                    return;
                //加载矩阵导量UI
                try {
                    this._disposable.add(EventCenter_1.EventCenter.SHOW_GAME_CENTER_LIST_VIEW.on(this.onShowGameCenterListView));
                    let gameCenterMomentItem = await simba_cc_resutils_1.ResUtils.loadRes('prefab/cooperation/GameCenterMomentItem', cc.Prefab);
                    CCGameCenterNodeFactory_1.default.getInstance().registerMomentPrefab(gameCenterMomentItem);
                    let gameCenterBtn = await simba_cc_resutils_1.ResUtils.loadRes('prefab/cooperation/GameCenterBtn', cc.Prefab);
                    let gameCenterView = await simba_cc_resutils_1.ResUtils.loadRes('prefab/cooperation/GameCenterView', cc.Prefab);
                    let cooperationItem = await simba_cc_resutils_1.ResUtils.loadRes('prefab/cooperation/CooperationItem', cc.Prefab);
                    let cCGameCenterComponent = this.node.addComponent(CCGameCenterComponent_1.default);
                    cCGameCenterComponent.gameCenterBtnPrefab = gameCenterBtn;
                    cCGameCenterComponent.gameCenterViewPrefab = gameCenterView;
                    cCGameCenterComponent.gameCenterItemPrefab = cooperationItem;
                    cCGameCenterComponent.gameCenterMomentPrefab = gameCenterMomentItem;
                    cCGameCenterComponent.gameCenterParentNode = this.node;
                    cCGameCenterComponent.appID = "wx7a067b995e670485";
                    cCGameCenterComponent.gameID = "yybs";
                    cCGameCenterComponent.gameChannel = "wechat";
                    cCGameCenterComponent.isRelease = !GameConfig_1.GameConfig.debug;
                    cCGameCenterComponent.init();
                }
                catch (error) {
                    console.error(error);
                }
            });
            CustomerServiceDataCenter_1.default.getInstance().init();
            simba_cc_resutils_1.ResUtils.loadRes("audio/bgm/bayinhe", cc.AudioClip);
            simba_cc_resutils_1.ResUtils.loadRes("audio/bgm/wanshengj", cc.AudioClip);
        }
        /**创建prefab对应的节点 */
        createNode(gameCenterViewPrefab) {
            if (!gameCenterViewPrefab) {
                cc.error("gameCenterViewPrefab is not set , please check it over");
            }
            else {
                this._gameCenterViewNode = cc.instantiate(gameCenterViewPrefab);
            }
            let parentNode = cc.director.getScene();
            this._gameCenterViewNode.parent = parentNode;
            this._gameCenterViewNode.position = cc.v3(cc.winSize.width / 2, cc.winSize.height / 2, 0);
        }
        fixScreenSize() {
            // let comp = this.loadingRoleNode.getComponent(PortraitFixComponent);
            // if (comp) {
            //     comp.fixScreenSize(false);
            // }
            let sf = this.bgSpr.spriteFrame;
            this.node.getComponent(cc.Widget).updateAlignment();
            let sizeSF = sf.getOriginalSize();
            let nodeSize = cc.size(this.node.width, this.node.height);
            let scaleTemp = 1;
            let scaleX = nodeSize.width / sizeSF.width;
            let scaleY = nodeSize.height / sizeSF.height;
            scaleTemp = Math.max(scaleX, scaleY);
            this.bgSpr.node.scale = scaleTemp;
        }
        preloadView() {
            // let viewList: string[] = [
            //     'prefab/ui/MainView',
            //     'prefab/ui/MessageView',
            //     'prefab/ui/message/MessageEntryItem',
            //     'prefab/ui/BedroomView',
            //     'prefab/ui/discover/SettingView'
            // ]
            let viewList = [
                'prefab/ui/MainView',
                'prefab/ui/MessageView',
                'prefab/ui/message/MessageEntryItem'
            ];
            cc.resources.preload(viewList, (error, items) => {
            });
        }
        preloadDir() {
            cc.resources.preloadDir('plots'); //剧情数据
            cc.resources.preloadDir('userdata/language'); //语言配置
            cc.resources.preloadDir('config'); //剧情配置
            // cc.resources.preloadDir('textures/items');
        }
        screenAdapter() {
            let winSize = cc.winSize;
            if (winSize.width / winSize.height > 720 / 1280) {
                let canvas = this.node.getComponent(cc.Canvas);
                canvas.fitWidth = true;
                canvas.fitHeight = true;
            }
        }
        start() {
            if (!cc.sys.isNative)
                this.initializeGame();
        }
        async initializeGame() {
            simba_cc_audio_manager_1.AudioManager.init("audio/bgm/", "audio/effect/", "audio/voice/");
            while (true) {
                try {
                    await UIManager_1.UIManager.init(this.uiRootNode, this.toastParentNode);
                    break;
                }
                catch (e) {
                    console.error(e);
                }
            }
            AnimationUtils_1.AnimationUtils.animateProgress(this.progressBar, 0.2);
            let ret = false;
            let tryCount = 0;
            while (!ret && tryCount < 3) {
                tryCount++;
                ret = await simba_sdk_1.SDK.init();
                // initExchangeCode();
            }
            if (!ret) {
                UIManager_1.UIManager.showToast("SDK init failed. sdk初始化失败");
                return;
            }
            AnimationUtils_1.AnimationUtils.animateProgress(this.progressBar, 0.4, 1, this.progressLabel);
            await this.loginGame();
        }
        showLoginFailed() {
            let temp = {
                dataptr: {},
                titlecontent: "网络错误",
                content: "是否重新连接?",
                ishasad: false,
                istwobtn: true,
                adconfig: "",
                hasBanner: false,
                callback: (type, ret) => {
                    if (ret) {
                        this.loginCount = 0;
                        this.loginGame();
                    }
                    else {
                        cc.director.end();
                    }
                }
            };
            UIManager_1.UIManager.pushPresenter(AlertDialogViewPresenter_1.default, temp);
        }
        async dealEmptyRecord() {
            /**此次执行清档操作的版本号 */
            let optionV = "1.0.2";
            /**需要清档的玩家注册版本号列表 */
            let needEmptyRegVersionArr = ["1.0.0", "1.0.1"];
            let emptyVersionRecordKey = "empty_record_versions";
            let needEmpty = this.checkIsNeedEmptyRecord(optionV, emptyVersionRecordKey, needEmptyRegVersionArr);
            console.log("是否需要清档操作:", needEmpty);
            if (needEmpty) {
                await AVG_1.GameRecord.emptyRecords();
                AVG_1.GameRecord.globalVariables[emptyVersionRecordKey] = optionV;
                AVG_1.GameRecord.saveRecord();
            }
        }
        checkIsNeedEmptyRecord(optionV, emptyVersionRecordKey, needEmptyRegVersionArr) {
            let empty = false;
            let regV = AVG_1.GameRecord.globalVariables["register_version"];
            //不存在或者当前注册版本不在需要清档的版本内容中,则直接返回不需要清档
            if (!regV || needEmptyRegVersionArr.findIndex((v) => v == regV) === (-1)) {
                return false;
            }
            let emptyRecordVersionString = AVG_1.GameRecord.globalVariables[emptyVersionRecordKey];
            if (!emptyRecordVersionString || "" === emptyRecordVersionString.trim()) {
                return true;
            }
            empty = emptyRecordVersionString != optionV;
            return empty;
        }
    };
    __decorate([
        property({ type: cc.ProgressBar, displayName: "进度条" })
    ], Launcher.prototype, "progressBar", void 0);
    __decorate([
        property({ type: cc.Label, displayName: "进度展示文本" })
    ], Launcher.prototype, "progressLabel", void 0);
    __decorate([
        property({ type: cc.Node, displayName: "UI根结点" })
    ], Launcher.prototype, "uiRootNode", void 0);
    __decorate([
        property({ type: cc.Node, displayName: "场景最上层弱提示根结点" })
    ], Launcher.prototype, "toastParentNode", void 0);
    __decorate([
        property({ type: cc.Node, displayName: "加载界面节点" })
    ], Launcher.prototype, "loadingNode", void 0);
    __decorate([
        property({ type: cc.Node, displayName: "加载界面人物图" })
    ], Launcher.prototype, "loadingRoleNode", void 0);
    __decorate([
        property({ type: cc.Node })
    ], Launcher.prototype, "VerbRoot", void 0);
    __decorate([
        property({ tooltip: "是否加载导量UI" })
    ], Launcher.prototype, "isLoadGameCenter", void 0);
    __decorate([
        property({ type: cc.Label, displayName: "玩家ID文本" })
    ], Launcher.prototype, "userIdLabel", void 0);
    __decorate([
        property({ type: cc.Node, displayName: "热更节点" })
    ], Launcher.prototype, "hotUpdateNode", void 0);
    __decorate([
        property(cc.Sprite)
    ], Launcher.prototype, "bgSpr", void 0);
    Launcher = __decorate([
        ccclass
    ], Launcher);
    return Launcher;
})();
exports.default = Launcher;

cc._RF.pop();
                    }
                    if (nodeEnv) {
                        __define(__module.exports, __require, __module);
                    }
                    else {
                        __quick_compile_project__.registerModuleFunc(__filename, function () {
                            __define(__module.exports, __require, __module);
                        });
                    }
                })();
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFzc2V0cy9zY3JpcHQvZ2FtZS9MYXVuY2hlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLHlDQUFnQztBQ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KCdjb25maWcnKTsvL+WJp+aDhemFjee9rlxuICAgICAgICAvLyBjYy5yZXNvdXJjZXMucHJlbG9hZERpcigndGV4dHVyZXMvaXRlbXMnKTtcbiAgICB9XG5cbiAgICBzY3JlZW5BZGFwdGVyKCkge1xuICAgICAgICBsZXQgd2luU2l6ZSA9IGNjLndpblNpemU7XG4gICAgICAgIGlmICh3aW5TaXplLndpZHRoIC8gd2luU2l6ZS5oZWlnaHQgPiA3MjAgLyAxMjgwKSB7XG4gICAgICAgICAgICBsZXQgY2FudmFzID0gdGhpcy5ub2RlLmdldENvbXBvbmVudChjYy5DYW52YXMpO1xuICAgICAgICAgICAgY2FudmFzLmZpdFdpZHRoID0gdHJ1ZTtcbiAgICAgICAgICAgIGNhbnZhcy5maXRIZWlnaHQgPSB0cnVlO1xuICAgICAgICB9XG4gICAgfVxuXG4gICAgc3RhcnQoKSB7XG4gICAgICAgIGlmICghY2Muc3lzLmlzTmF0aXZlKVxuICAgICAgICAgICAgdGhpcy5pbml0aWFsaXplR2FtZSgpO1xuICAgIH1cblxuICAgIG9uR2FtZVN0YXJ0ID0gKCkgPT4ge1xuICAgICAgICB0aGlzLmluaXRpYWxpemVHYW1lKCk7XG4gICAgfVxuXG4gICAgYXN5bmMgaW5pdGlhbGl6ZUdhbWUoKSB7XG4gICAgICAgIEF1ZGlvTWFuYWdlci5pbml0KFwiYXVkaW8vYmdtL1wiLCBcImF1ZGlvL2VmZmVjdC9cIiwgXCJhdWRpby92b2ljZS9cIik7XG4gICAgICAgIHdoaWxlICh0cnVlKSB7XG4gICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgIGF3YWl0IFVJTWFuYWdlci5pbml0KHRoaXMudWlSb290Tm9kZSEsIHRoaXMudG9hc3RQYXJlbnROb2RlISk7XG4gICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICB9IGNhdGNoIChlKSB7XG4gICAgICAgICAgICAgICAgY29uc29sZS5lcnJvcihlKTtcbiAgICAgICAgIC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3YWl0IFNESy5sb2dpbigpO1xuICAgICAgICAgICAgICAgIGlmIChyZXQpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy51c2VySWRMYWJlbC5zdHJpbmcgPSByZXQucGxheWVySWQ7XG4gICAgICAgICAgICAgICAgICAgIGF3YWl0IHRoaXMubGF0ZUluaXQoKTtcbiAgICAgICAgICAgICAgICAgICAgcmVzb2x2ZSgpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH0gY2F0Y2ggKGVycm9yKSB7XG4gICAgICAgICAgICAgICAgaWYgKHRoaXMubG9naW5Db3VudCA+IDMpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5zaG93TG9naW5GYWlsZWQoKTtcbiAgICAgICAgICAgICAgICAgICAgcmVqZWN0KG5ldyBFcnJvcihcIueZu+W9leWksei0pVwiKSk7XG4gICAgICAgICAgICAgICAgfSBlbHNlIGlmIChlcnJvciA9PSBcInRpbWVvdXRcIikge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmxvZ2luR2FtZSgpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfSk7XG4gICAgfVxuXG4gICAgc2hvd0xvZ2luRmFpbGVkKCkge1xuICAgICAgICBsZXQgdGVtcDogQWxlcnREaWFsb2dWaWV3UHJvcHMgPVxuICAgICAgICB7XG4gICAgICAgICAgICBkYXRhcHRyOiB7fSxcbiAgICAgICAgICAgIHRpdGxlY29udGVudDogXCLnvZHnu5zplJnor69cIixcbiAgICAgICAgICAgIGNvbnRlbnQ6IFwi5piv5ZCm6YeN5paw6L+e5o6lP1wiLFxuICAgICAgICAgICAgaXNoYXNhZDogZmFsc2UsXG4gICAgICAgICAgICBpc3R3b2J0bjogdHJ1ZSxcbiAgICAgICAgICAgIGFkY29uZmlnOiBcIlwiLFxuICAgICAgICAgICAgaGFzQmFubmVyOiBmYWxzZSxcbiAgICAgICAgICAgIGNhbGxiYWNrOiAodHlwZSwgcmV0KSA9PiB7XG4gICAgICAgICAgICAgICAgaWYgKHJldCkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmxvZ2luQ291bnQgPSAwO1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmxvZ2luR2FtZSgpO1xuICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIGNjLmRpcmVjdG9yLmVuZCgpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfTtcbiAgICAgICAgVUlNYW5hZ2VyLnB1c2hQcmVzZW50ZXIoQWxlcnREaWFsb2dWaWV3UHJlc2VudGVyLCB0ZW1wKTtcbiAgICB9XG5cbiAgICBhc3luYyBkZWFsRW1wdHlSZWNvcmQoKSB7XG4gICAgICAgIC8qKuatpOasoeaJp+ihjOa4heaho+aTjeS9nOeahOeJiOacrOWPtyAqL1xuICAgICAgICBsZXQgb3B0aW9uViA9IFwiMS4wLjJcIjtcbiAgICAgICAgLyoq6ZyA6KaB5riF5qGj55qE546p5a625rOo5YaM54mI5pys5Y+35YiX6KGoICovXG4gICAgICAgIGxldCBuZWVkRW1wdHlSZWdWZXJzaW9uQXJyOiBzdHJpbmdbXSA9IFtcIjEuMC4wXCIsIFwiMS4wLjFcIl07XG4gICAgICAgIGxldCBlbXB0eVZlcnNpb25SZWNvcmRLZXkgPSBcImVtcHR5X3JlY29yZF92ZXJzaW9uc1wiO1xuICAgICAgICBsZXQgbmVlZEVtcHR5OiBib29sZWFuID0gdGhpcy5jaGVja0lzTmVlZEVtcHR5UmVjb3JkKG9wdGlvblYsIGVtcHR5VmVyc2lvblJlY29yZEtleSwgbmVlZEVtcHR5UmVnVmVyc2lvbkFycik7XG4gICAgICAgIGNvbnNvbGUubG9nKFwi5piv5ZCm6ZyA6KaB5riF5qGj5pON5L2c77yaXCIsIG5lZWRFbXB0eSk7XG4gICAgICAgIGlmIChuZWVkRW1wdHkpIHtcbiAgICAgICAgICAgIGF3YWl0IEdhbWV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