/*! Thunder 11 BY LUOCHENZHIMU */
/*! Last updated on 2020/08/22 */
/*! https://www.luochenzhimu.com */
module.exports = function (e) {
    var t = {};

    function i(n) {
        if (t[n]) return t[n].exports;
        var a = t[n] = {i: n, l: !1, exports: {}};
        return e[n].call(a.exports, a, a.exports, i), a.l = !0, a.exports
    }

    return i.m = e, i.c = t, i.d = function (e, t, n) {
        i.o(e, t) || Object.defineProperty(e, t, {enumerable: !0, get: n})
    }, i.r = function (e) {
        "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, {value: "Module"}), Object.defineProperty(e, "__esModule", {value: !0})
    }, i.t = function (e, t) {
        if (1 & t && (e = i(e)), 8 & t) return e;
        if (4 & t && "object" == typeof e && e && e.__esModule) return e;
        var n = Object.create(null);
        if (i.r(n), Object.defineProperty(n, "default", {
            enumerable: !0,
            value: e
        }), 2 & t && "string" != typeof e) for (var a in e) i.d(n, a, function (t) {
            return e[t]
        }.bind(null, a));
        return n
    }, i.n = function (e) {
        var t = e && e.__esModule ? function () {
            return e.default
        } : function () {
            return e
        };
        return i.d(t, "a", t), t
    }, i.o = function (e, t) {
        return Object.prototype.hasOwnProperty.call(e, t)
    }, i.p = "", i(i.s = 463)
}([function (e, t, i) {
    e.exports = i(56)(131)
}, function (e, t, i) {
    "use strict";

    function n(e, t, i, n, a, o, r, s) {
        var l, d = "function" == typeof e ? e.options : e;
        if (t && (d.render = t, d.staticRenderFns = i, d._compiled = !0), n && (d.functional = !0), o && (d._scopeId = "data-v-" + o), r ? (l = function (e) {
            (e = e || this.$vnode && this.$vnode.ssrContext || this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) || "undefined" == typeof __VUE_SSR_CONTEXT__ || (e = __VUE_SSR_CONTEXT__), a && a.call(this, e), e && e._registeredComponents && e._registeredComponents.add(r)
        }, d._ssrRegister = l) : a && (l = s ? function () {
            a.call(this, this.$root.$options.shadowRoot)
        } : a), l) if (d.functional) {
            d._injectStyles = l;
            var u = d.render;
            d.render = function (e, t) {
                return l.call(t), u(e, t)
            }
        } else {
            var c = d.beforeCreate;
            d.beforeCreate = c ? [].concat(c, l) : [l]
        }
        return {exports: e, options: d}
    }

    i.d(t, "a", function () {
        return n
    })
}, function (e, t) {
    e.exports = require("path")
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        let t, i, n, a, o, r, s, l, d, u, c, h, f, g, p, v, m, y, k, T;
        !function (e) {
            e[e.Unkown = 0] = "Unkown", e[e.Create = 1] = "Create", e[e.InvaldParam = 2] = "InvaldParam", e[e.InvaldLink = 3] = "InvaldLink", e[e.InvaldConfig = 4] = "InvaldConfig", e[e.Timeout = 5] = "Timeout", e[e.VerifyData = 6] = "VerifyData", e[e.Forbidden = 7] = "Forbidden", e[e.RangeDispatch = 8] = "RangeDispatch", e[e.FilePathOverRanging = 9] = "FilePathOverRanging", e[e.FileCreate = 201] = "FileCreate", e[e.FileWrite = 202] = "FileWrite", e[e.FileRead = 203] = "FileRead", e[e.FileRename = 204] = "FileRename", e[e.FileFull = 205] = "FileFull", e[e.FileOccupied = 211] = "FileOccupied", e[e.FileAccessDenied = 212] = "FileAccessDenied", e[e.BtUploadExist = 601] = "BtUploadExist", e[e.ForbinddenResource = 701] = "ForbinddenResource", e[e.ForbinddenAccount = 702] = "ForbinddenAccount", e[e.ForbinddenArea = 703] = "ForbinddenArea", e[e.ForbinddenCopyright = 704] = "ForbinddenCopyright", e[e.ForbinddenReaction = 705] = "ForbinddenReaction", e[e.ForbinddenPorn = 706] = "ForbinddenPorn", e[e.DownloadSDKCrash = 10001] = "DownloadSDKCrash", e[e.torrentFileNotExist = 10002] = "torrentFileNotExist"
        }(t = e.TaskError || (e.TaskError = {})), function (e) {
            e[e.Unkown = -1] = "Unkown", e[e.Success = 0] = "Success", e[e.QueryFailed = 1] = "QueryFailed", e[e.ServerError = 2] = "ServerError", e[e.ResourceNotFound = 3] = "ResourceNotFound", e[e.AuthorizingFailed = 4] = "AuthorizingFailed", e[e.ForbidByCopyright = 5] = "ForbidByCopyright", e[e.ForbidByPorNoGraphy = 6] = "ForbidByPorNoGraphy", e[e.ForbidByReactionary = 7] = "ForbidByReactionary", e[e.ForbidByOtherFilter = 8] = "ForbidByOtherFilter"
        }(i = e.DcdnStatusCode || (e.DcdnStatusCode = {})), function (e) {
            e[e.Begin = -1] = "Begin", e[e.Unkown = 0] = "Unkown", e[e.StandBy = 1] = "StandBy", e[e.PreDownloading = 2] = "PreDownloading", e[e.StartWaiting = 3] = "StartWaiting", e[e.StartPending = 4] = "StartPending", e[e.Started = 5] = "Started", e[e.StopPending = 6] = "StopPending", e[e.Stopped = 7] = "Stopped", e[e.Succeeded = 8] = "Succeeded", e[e.Failed = 9] = "Failed", e[e.Seeding = 10] = "Seeding", e[e.DestroyPending = 11] = "DestroyPending", e[e.End = 12] = "End"
        }(n = e.TaskStatus || (e.TaskStatus = {})), function (e) {
            e[e.Begin = -1] = "Begin", e[e.StandBy = 0] = "StandBy", e[e.Stopped = 1] = "Stopped", e[e.Started = 2] = "Started", e[e.Complete = 3] = "Complete", e[e.Forbidden = 4] = "Forbidden", e[e.Error = 5] = "Error", e[e.End = 6] = "End"
        }(a = e.BtFileStatus || (e.BtFileStatus = {})), function (e) {
            e[e.DispatchStrategyNone = 0] = "DispatchStrategyNone", e[e.DispatchStrategyOrigin = 1] = "DispatchStrategyOrigin", e[e.DispatchStrategyP2s = 2] = "DispatchStrategyP2s", e[e.DispatchStrategyP2p = 4] = "DispatchStrategyP2p", e[e.DispatchStrategyAll = -1] = "DispatchStrategyAll"
        }(o = e.DispatchStrategy || (e.DispatchStrategy = {})), function (e) {
            e[e.Unkown = 0] = "Unkown", e[e.P2sp = 1] = "P2sp", e[e.Bt = 2] = "Bt", e[e.Emule = 3] = "Emule", e[e.Group = 4] = "Group", e[e.Magnet = 5] = "Magnet"
        }(r = e.TaskType || (e.TaskType = {})), function (e) {
            e.Unkown = "Unkown", e.Downloading = "Downloading", e.Completed = "Completed", e.Recycle = "Recycle"
        }(s = e.CategroyViewID || (e.CategroyViewID = {})), function (e) {
            e[e.Unknow = 0] = "Unknow", e[e.TaskCreated = 1] = "TaskCreated", e[e.InsertToCategoryView = 2] = "InsertToCategoryView", e[e.RemoveFromCategoryView = 3] = "RemoveFromCategoryView", e[e.StatusChanged = 4] = "StatusChanged", e[e.DetailChanged = 5] = "DetailChanged", e[e.ChannelInfoChanged = 6] = "ChannelInfoChanged", e[e.DcdnStatusChanged = 7] = "DcdnStatusChanged", e[e.TaskDescriptionChanged = 8] = "TaskDescriptionChanged", e[e.TaskUserRead = 9] = "TaskUserRead", e[e.TaskRenamed = 10] = "TaskRenamed", e[e.TaskMovedEnd = 11] = "TaskMovedEnd", e[e.TaskMovingStateChange = 12] = "TaskMovingStateChange", e[e.BtSubFileDetailChanged = 13] = "BtSubFileDetailChanged", e[e.BtSubFileLoaded = 14] = "BtSubFileLoaded", e[e.BtSubFileForbidden = 15] = "BtSubFileForbidden", e[e.BtSubFileDcdnStatusChanged = 16] = "BtSubFileDcdnStatusChanged", e[e.TaskCategoryMovedEnd = 17] = "TaskCategoryMovedEnd", e[e.GroupTaskSubFileDetailChanged = 18] = "GroupTaskSubFileDetailChanged", e[e.TaskDestroying = 19] = "TaskDestroying", e[e.TaskDestroyed = 20] = "TaskDestroyed"
        }(l = e.TaskEventType || (e.TaskEventType = {})), function (e) {
            e[e.NumberStrart = 0] = "NumberStrart", e[e.TaskId = 1] = "TaskId", e[e.VirtualId = 2] = "VirtualId", e[e.SrcTotal = 3] = "SrcTotal", e[e.SrcUsing = 4] = "SrcUsing", e[e.FileSize = 5] = "FileSize", e[e.ReceivedSize = 6] = "ReceivedSize", e[e.DownloadSize = 7] = "DownloadSize", e[e.TotalDownloadSize = 8] = "TotalDownloadSize", e[e.CreateTime = 9] = "CreateTime", e[e.CompletionTime = 10] = "CompletionTime", e[e.DownloadingPeriod = 11] = "DownloadingPeriod", e[e.Progress = 12] = "Progress", e[e.RecycleTime = 13] = "RecycleTime", e[e.FileCreated = 14] = "FileCreated", e[e.Forbidden = 15] = "Forbidden", e[e.CategoryId = 16] = "CategoryId", e[e.UserRead = 17] = "UserRead", e[e.OpenOnComplete = 18] = "OpenOnComplete", e[e.GroupTaskId = 19] = "GroupTaskId", e[e.DownloadSubTask = 20] = "DownloadSubTask", e[e.NameType = 21] = "NameType", e[e.OwnerProduct = 22] = "OwnerProduct", e[e.FileIndex = 23] = "FileIndex", e[e.NameFixed = 24] = "NameFixed", e[e.ValidDownloadSize = 25] = "ValidDownloadSize", e[e.RealDownloadSize = 26] = "RealDownloadSize", e[e.ResourceLegal = 27] = "ResourceLegal", e[e.TaskType = 28] = "TaskType", e[e.ErrorCode = 29] = "ErrorCode", e[e.PlayPosition = 30] = "PlayPosition", e[e.Duration = 31] = "Duration", e[e.NumberEnd = 32] = "NumberEnd", e[e.BooleanStart = 4096] = "BooleanStart", e[e.Destroyed = 4097] = "Destroyed", e[e.Background = 4098] = "Background", e[e.Moving = 4099] = "Moving", e[e.BooleanEnd = 4100] = "BooleanEnd", e[e.StringStart = 8192] = "StringStart", e[e.TaskName = 8193] = "TaskName", e[e.SavePath = 8194] = "SavePath", e[e.RelativePath = 8195] = "RelativePath", e[e.TaskUrl = 8196] = "TaskUrl", e[e.RefUrl = 8197] = "RefUrl", e[e.Cid = 8198] = "Cid", e[e.Gcid = 8199] = "Gcid", e[e.Cookie = 8200] = "Cookie", e[e.ProductInfo = 8201] = "ProductInfo", e[e.Origin = 8202] = "Origin", e[e.Description = 8203] = "Description", e[e.UserData = 8204] = "UserData", e[e.OriginName = 8205] = "OriginName", e[e.HTTPContentType = 8206] = "HTTPContentType", e[e.CategoryViewId = 8207] = "CategoryViewId", e[e.YunTaskId = 8208] = "YunTaskId", e[e.StringEnd = 8209] = "StringEnd", e[e.ObjectStart = 12288] = "ObjectStart", e[e.ObjectEnd = 12289] = "ObjectEnd"
        }(d = e.TaskAttribute || (e.TaskAttribute = {})), function (e) {
            e[e.UnKnown = 0] = "UnKnown", e[e.SrcTotal = 1] = "SrcTotal", e[e.SrcUsing = 2] = "SrcUsing", e[e.FileSize = 4] = "FileSize", e[e.ReceivedSize = 8] = "ReceivedSize", e[e.DownloadSize = 16] = "DownloadSize", e[e.CompletionTime = 32] = "CompletionTime", e[e.DownloadingPeriod = 64] = "DownloadingPeriod", e[e.Progress = 128] = "Progress", e[e.RecycleTime = 256] = "RecycleTime", e[e.FileCreated = 512] = "FileCreated", e[e.Forbidden = 1024] = "Forbidden", e[e.UserRead = 2048] = "UserRead", e[e.OpenOnComplete = 4096] = "OpenOnComplete", e[e.DownloadSubTask = 8192] = "DownloadSubTask", e[e.TaskName = 16384] = "TaskName", e[e.SavePath = 32768] = "SavePath", e[e.Cid = 65536] = "Cid", e[e.Gcid = 131072] = "Gcid", e[e.UserData = 262144] = "UserData", e[e.CategoryViewId = 524288] = "CategoryViewId", e[e.ErrorCode = 1048576] = "ErrorCode", e[e.TaskSpeed = 2097152] = "TaskSpeed", e[e.ChannelInfo = 4194304] = "ChannelInfo", e[e.ValidDownloadSize = 8388608] = "ValidDownloadSize", e[e.OriginName = 16777216] = "OriginName", e[e.HTTPContentType = 33554432] = "HTTPContentType", e[e.PlayPosition = 67108864] = "PlayPosition", e[e.Duration = 134217728] = "Duration", e[e.YunTaskId = 268435456] = "YunTaskId"
        }(u = e.TaskDetailChangedFlags || (e.TaskDetailChangedFlags = {})), function (e) {
            e[e.UnKnown = 0] = "UnKnown"
        }(c = e.BtSubFileDetailChangedFlags || (e.BtSubFileDetailChangedFlags = {})), function (e) {
            e[e.UnKnown = 0] = "UnKnown"
        }(h = e.GroupTaskSubFileDetailChangedFlags || (e.GroupTaskSubFileDetailChangedFlags = {})), function (e) {
            e[e.NumberStrart = 0] = "NumberStrart", e[e.TaskId = 1] = "TaskId", e[e.FileStatus = 2] = "FileStatus", e[e.DownloadSize = 3] = "DownloadSize", e[e.FileSize = 4] = "FileSize", e[e.EnableDcdn = 5] = "EnableDcdn", e[e.ErrorCode = 6] = "ErrorCode", e[e.DcdnStatus = 7] = "DcdnStatus", e[e.RealIndex = 8] = "RealIndex", e[e.FileOffset = 9] = "FileOffset", e[e.Visible = 10] = "Visible", e[e.Download = 11] = "Download", e[e.NumberEnd = 12] = "NumberEnd", e[e.StringStart = 4096] = "StringStart", e[e.FinalName = 4097] = "FinalName", e[e.RelativePath = 4098] = "RelativePath", e[e.FileName = 4099] = "FileName", e[e.FilePath = 4100] = "FilePath", e[e.Cid = 4101] = "Cid", e[e.Gcid = 4102] = "Gcid", e[e.UserRead = 4103] = "UserRead", e[e.PlayPosition = 4104] = "PlayPosition", e[e.Duration = 4105] = "Duration", e[e.StringEnd = 4106] = "StringEnd"
        }(f = e.BtFileAttribute || (e.BtFileAttribute = {})), function (e) {
            e[e.P2spUrl = 0] = "P2spUrl", e[e.BtInfoId = 1] = "BtInfoId", e[e.EmuleFileHash = 2] = "EmuleFileHash", e[e.MagnetUrl = 3] = "MagnetUrl", e[e.GroupTaskName = 4] = "GroupTaskName"
        }(g = e.KeyType || (e.KeyType = {})), function (e) {
            e[e.NameInclude = 1] = "NameInclude", e[e.BtDisplayNameInclude = 2] = "BtDisplayNameInclude"
        }(p = e.SearchKeyType || (e.SearchKeyType = {})), function (e) {
            e[e.ExtEqual = 1] = "ExtEqual", e[e.NameLikeAndExtEqual = 2] = "NameLikeAndExtEqual", e[e.TaskTypeEqual = 4] = "TaskTypeEqual"
        }(v = e.FilterKeyType || (e.FilterKeyType = {})), function (e) {
            e[e.All = 0] = "All", e[e.CommonForeground = 1] = "CommonForeground", e[e.CommonBackground = 2] = "CommonBackground", e[e.Temporary = 3] = "Temporary", e[e.PreDownload = 4] = "PreDownload", e[e.PrivateForeground = 5] = "PrivateForeground"
        }(m = e.KeyFilter || (e.KeyFilter = {})), function (e) {
            e[e.Unknown = -1] = "Unknown", e[e.LoadTaskBasic = 0] = "LoadTaskBasic", e[e.Create = 1] = "Create", e[e.Recycle = 2] = "Recycle", e[e.Recover = 3] = "Recover", e[e.ReDownload = 4] = "ReDownload", e[e.MoveThoughCategory = 5] = "MoveThoughCategory"
        }(y = e.TaskInsertReason || (e.TaskInsertReason = {})), function (e) {
            e[e.Unknown = -1] = "Unknown", e[e.Manual = 0] = "Manual", e[e.PauseAll = 1] = "PauseAll", e[e.DeleteTask = 2] = "DeleteTask", e[e.TaskJammed = 3] = "TaskJammed", e[e.LowSpeed = 4] = "LowSpeed", e[e.MaxDownloadReduce = 5] = "MaxDownloadReduce", e[e.MoveTask = 6] = "MoveTask", e[e.SelectDownloadLists = 7] = "SelectDownloadLists", e[e.PrivateLoginOut = 8] = "PrivateLoginOut", e[e.FreeDownload = 9] = "FreeDownload", e[e.Exit = 10] = "Exit"
        }(k = e.TaskStopReason || (e.TaskStopReason = {})), function (e) {
            e[e.RESOURCE_FROM_MEMBER = 1] = "RESOURCE_FROM_MEMBER", e[e.RESOURCE_FROM_OFFLINE = 2] = "RESOURCE_FROM_OFFLINE", e[e.RESOURCE_FROM_CRYSTAL_LARGE = 4] = "RESOURCE_FROM_CRYSTAL_LARGE", e[e.RESOURCE_FROM_CRYSTAL_SMALL = 8] = "RESOURCE_FROM_CRYSTAL_SMALL", e[e.RESOURCE_FROM_DCDN = 16] = "RESOURCE_FROM_DCDN", e[e.RESOURCE_FROM_FREEDCDN = 32] = "RESOURCE_FROM_FREEDCDN"
        }(T = e.XLResourceFrom || (e.XLResourceFrom = {}))
    }(t.DownloadKernel || (t.DownloadKernel = {}))
}, function (e, t) {
    e.exports = require("util")
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(53), o = i(2), r = i(4).promisify, s = i(0).default.getLogger("Thunder.base.fs-utilities");
    !function (e) {
        function t(e) {
            return n(this, void 0, void 0, function* () {
                let t = !1;
                if (void 0 !== e) {
                    const i = r(a.access);
                    try {
                        yield i(e), t = !0
                    } catch (e) {
                        s.information(e)
                    }
                }
                return t
            })
        }

        function l(e) {
            return n(this, void 0, void 0, function* () {
                let t = !1;
                if (void 0 !== e) {
                    const i = r(a.mkdir);
                    try {
                        yield i(e), t = !0
                    } catch (e) {
                        s.warning(e)
                    }
                }
                return t
            })
        }

        function d(e) {
            return n(this, void 0, void 0, function* () {
                let t = !1;
                if (void 0 !== e) {
                    const i = r(a.rmdir);
                    try {
                        yield i(e), t = !0
                    } catch (e) {
                        s.warning(e)
                    }
                }
                return t
            })
        }

        function u(e) {
            return n(this, void 0, void 0, function* () {
                let t = !1;
                if (void 0 !== e) {
                    const i = r(a.unlink);
                    try {
                        yield i(e), t = !0
                    } catch (e) {
                        s.warning(e)
                    }
                }
                return t
            })
        }

        function c(e) {
            return n(this, void 0, void 0, function* () {
                let t = null;
                if (void 0 !== e) {
                    const i = r(a.readdir);
                    try {
                        t = yield i(e)
                    } catch (e) {
                        s.warning(e)
                    }
                }
                return t
            })
        }

        function h(e) {
            return n(this, void 0, void 0, function* () {
                let t = null;
                if (void 0 !== e) {
                    const i = r(a.lstat);
                    try {
                        t = yield i(e)
                    } catch (e) {
                        s.warning(e)
                    }
                }
                return t
            })
        }

        function f(e, t) {
            return n(this, void 0, void 0, function* () {
                let i = !1;
                if (void 0 !== e && void 0 !== t) {
                    let n = o.join(e, t), a = yield h(n);
                    i = null !== a && a.isDirectory() ? yield g(n) : yield u(n)
                }
                return i
            })
        }

        function g(e) {
            return n(this, void 0, void 0, function* () {
                let i = !1;
                if (void 0 !== e) {
                    if (yield t(e)) {
                        i = !0;
                        let t = (yield c(e)) || [];
                        for (let n = 0; n < t.length; n++) i = (yield f(e, t[n])) && i;
                        (i || 0 === t.length) && (i = (yield d(e)) && i)
                    }
                }
                return i
            })
        }

        function p(e) {
            return n(this, void 0, void 0, function* () {
                let i = !1;
                return s.information("mkdirsAW", e), void 0 !== e && ((yield t(e)) ? i = !0 : o.dirname(e) === e ? i = !1 : (yield p(o.dirname(e))) && (i = yield l(e))), i
            })
        }

        function v(e, i) {
            return n(this, void 0, void 0, function* () {
                let n;
                if (e.toLowerCase() !== i.toLowerCase() && (yield t(e))) {
                    let t = a.createReadStream(e), o = a.createWriteStream(i);
                    n = new Promise(e => {
                        t.pipe(o).on("finish", () => {
                            e(!0)
                        })
                    })
                } else n = new Promise(e => {
                    e(!1)
                });
                return n
            })
        }

        e.readFileAW = function (e) {
            return n(this, void 0, void 0, function* () {
                let t = null;
                if (void 0 !== e) {
                    const i = r(a.readFile);
                    try {
                        t = yield i(e)
                    } catch (e) {
                        s.warning(e)
                    }
                }
                return t
            })
        }, e.writeFileAW = function (e, t) {
            return n(this, void 0, void 0, function* () {
                let i = !1;
                if (void 0 !== e && null !== t) {
                    const n = r(a.writeFile);
                    try {
                        yield n(e, t), i = !0
                    } catch (e) {
                        s.warning(e)
                    }
                }
                return i
            })
        }, e.existsAW = t, e.dirExistsAW = function (e) {
            return n(this, void 0, void 0, function* () {
                let i = !1;
                do {
                    if (!(i = yield t(e))) break;
                    let n = yield h(e);
                    if (!n) break;
                    i = n.isDirectory()
                } while (0);
                return i
            })
        }, e.mkdirAW = l, e.rmdirAW = d, e.unlinkAW = u, e.readdirAW = c, e.lstatAW = h, e.rmdirsAW = g, e.mkdirsAW = p, e.renameAW = function (e, t) {
            return n(this, void 0, void 0, function* () {
                if (void 0 !== e && void 0 !== t) {
                    const i = r(a.rename);
                    try {
                        yield i(e, t)
                    } catch (e) {
                        s.warning(e)
                    }
                }
            })
        }, e.copyFileAW = v, e.copyDirsAW = function e(i, a) {
            return n(this, void 0, void 0, function* () {
                let n = !1, r = yield h(i);
                if (r.isDirectory()) {
                    n = yield p(a);
                    let s = (yield c(i)) || [];
                    for (let l = 0; l < s.length; l++) {
                        let d = o.join(i, s[l]), u = o.join(a, s[l]);
                        (n = yield t(d)) && (n = (r = yield h(d)).isDirectory() ? yield e(d, u) : yield v(d, u))
                    }
                }
                return n
            })
        }, e.mkdtempAW = function () {
            return n(this, void 0, void 0, function* () {
                let e = !1;
                const t = r(a.mkdtemp), n = (yield Promise.resolve().then(() => i(57))).tmpdir();
                try {
                    e = yield t(`${n}${o.sep}`)
                } catch (e) {
                    s.warning(e)
                }
                return e
            })
        }, e.deleteEmptySubDirs = function (e, i) {
            return n(this, void 0, void 0, function* () {
                let n = !0;
                e = o.normalize(e), i = o.normalize(i), e.length > 3 && "\\" === e[e.length - 1] && (e = e.slice(0, e.length - 1)), i.length > 3 && "\\" === i[i.length - 1] && (i = i.slice(0, i.length - 1));
                do {
                    if (0 !== e.indexOf(i)) {
                        n = !1;
                        break
                    }
                    let a = e;
                    for (; a !== i;) {
                        if ((yield t(a)) && !(yield d(a))) {
                            n = !1;
                            break
                        }
                        a = o.dirname(a)
                    }
                } while (0);
                return n
            })
        }, e.getFileSize = function e(i) {
            return n(this, void 0, void 0, function* () {
                let n = 0;
                do {
                    if (!i) break;
                    if (!(yield t(i))) break;
                    let a = yield h(i);
                    if (a) if (a.isDirectory()) {
                        let t = yield c(i);
                        for (let a = 0; a < t.length; a++) n += (yield e(o.join(i, t[a])))
                    } else n = a.size
                } while (0);
                return n
            })
        }, e.isDirectoryEmptyAW = function (e, i = !0) {
            return n(this, void 0, void 0, function* () {
                let n = !0;
                do {
                    if (!e) {
                        n = !1;
                        break
                    }
                    if (!(yield t(e))) {
                        n = i;
                        break
                    }
                    let a = yield h(e);
                    if (!a) {
                        n = !1;
                        break
                    }
                    if (!a.isDirectory()) {
                        n = !1;
                        break
                    }
                    if ((yield c(e)).length > 0) {
                        n = !1;
                        break
                    }
                } while (0);
                return n
            })
        }
    }(t.FileSystemAWNS || (t.FileSystemAWNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), t.default = function (e) {
        return require(e)
    }
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(19), o = i(468), r = i(85), s = i(105);

    function l(e) {
        s.information("on object freeer"), global.__xdasIPCClienInstance.notifyFreer(e.remoteId, e.callbackId)
    }

    let d = void 0;
    global.__xdasIPCClienInstance || (global.__xdasIPCClienInstance = new class extends a.EventEmitter {
        constructor() {
            super(), this.rid = 0, this.apis = {}, this.singletonMap = {}, this.retCallbackMap = {}, this.eventCallbackMaps = {}, this.contextCallbackMap = {}
        }

        start(e, t, i, n) {
            do {
                if (!i && this.client) break;
                if (t || (t = r.getDefaultPrex()), this.singletonMap.hasOwnProperty(t.toLowerCase())) break;
                if (global.__xdasPluginConfig && global.__xdasPluginConfig.name ? e = {
                    name: global.__xdasPluginConfig.name,
                    version: global.__xdasPluginConfig.version
                } : void 0 !== e && null !== e || (e = this.parseContext()), !e) {
                    if (!this.client || !this.client.getContext()) throw new Error("no suitable context for client, please specify context with start function");
                    e = {name: this.client.getContext().name, version: this.client.getContext().version}
                }
                if (e.name === r.serverContextName) throw new Error("client context must difference from server");
                if (i && !this.client) throw new Error("connect to other product must start self firstly");
                let a = new o.Client({context: e, socketPrex: t});
                this.singletonMap[t.toLowerCase()] = a, i || (this.client = a), a.on("message", e => {
                    if ("fire_event" === e.action) this.fireServerEvent(a, e.name, [e.__context].concat(e.args)); else if ("client_context_freer" === e.action) {
                        s.information("client on object freer", e);
                        do {
                            let t = e.rid;
                            if (t) {
                                if (!this.contextCallbackMap[t]) break;
                                delete this.contextCallbackMap[t]
                            }
                        } while (0)
                    } else if ("call_client_by_id" === e.action) this.callFunctionById(a, e.rid, e.s_rid, e.args); else if ("call_client_api" === e.action) this.callRegisterFunction(a, e); else if ("check_client_function" === e.action) {
                        let t = e.method, i = !0;
                        t && this.apis && this.apis[t] || (i = !1), this.sendAdapter(a, {
                            s_rid: e.s_rid,
                            action: "check_client_function_callback",
                            success: !0,
                            data: i
                        })
                    } else if (void 0 !== e.success && null !== e.success) {
                        let t = e;
                        this.client === a && this.emit("stat_call_function_back", a.getContext(), e);
                        const i = this.retCallbackMap[t.rid].callback;
                        i && (t.success ? i(null, t.data) : i(t.error, t.data)), delete this.retCallbackMap[t.rid]
                    }
                }), a.on("error", e => {
                    n && n("error", e), this.emit("socket-error", e, a.getContext(), i, a.isInprocess()), delete this.singletonMap[t.toLowerCase()]
                }), a.isInprocess() ? (n && n("connect"), this.emit("connect", a.getContext(), i, !0)) : a.on("connect", () => {
                    n && n("connect"), this.emit("connect", a.getContext(), i, !1)
                }), a.on("end", () => {
                    let e = a.isInprocess();
                    s.information("server is ended, and this client emit end", t, i, e), n && n("end", a.getContext(), i, e), this.emit("end", a.getContext(), i, e), delete this.singletonMap[t.toLowerCase()]
                }), this.registry(a)
            } while (0)
        }

        registerFunctions(e) {
            do {
                if (!e) break;
                let t = void 0;
                for (let i in e) if (this.apis.hasOwnProperty(i)) {
                    t = i;
                    break
                }
                if (t) throw new Error(`try to coverd function ${t}`);
                this.apis = Object.assign({}, this.apis, e)
            } while (0)
        }

        checkServerFunction(e) {
            return n(this, void 0, void 0, function* () {
                return this.internalCheckServerFunction(this.client, e)
            })
        }

        callServerFunction(e, ...t) {
            return n(this, void 0, void 0, function* () {
                let i = null, n = yield this.callServerFunctionEx(e, ...t);
                return n && (i = n[0]), i
            })
        }

        callServerFunctionEx(e, ...t) {
            return this.internalCallServerFunctionEx(this.client, e, ...t)
        }

        isRemoteClientExist(e) {
            return this.internalIsRemoteClientExist(this.client, e)
        }

        checkRemoteFunction(e, t) {
            return this.internalCheckRemoteFunction(this.client, e, t)
        }

        callRemoteClientFunction(e, t, ...i) {
            return this.internalCallRemoteClientFunction(this.client, e, t, ...i)
        }

        notifyFreer(e, t) {
            this.sendAdapter(this.client, {action: "client_context_freer", dst: e, rid: t})
        }

        callRemoteContextById(e, t, ...i) {
            this.sendAdapter(this.client, {dst: e, action: "call_remote_context_by_id", rid: t, args: i})
        }

        attachServerEvent(e, t) {
            return this.internalAttachServerEvent(this.client, e, t)
        }

        detachServerEvent(e, t) {
            this.internalDetachServerEvent(this.client, e, t)
        }

        broadcastEvent(e, ...t) {
            this.sendAdapter(this.client, {action: "broadcast", name: e, args: t})
        }

        crossCheckServerFunction(e, t) {
            return n(this, void 0, void 0, function* () {
                {
                    if (!e) throw new Error("An argument for 'productId' was not provided");
                    let i = this.singletonMap[e.toLowerCase()];
                    if (!i) throw new Error("Please call the 'start' interface first");
                    return this.internalCheckServerFunction(i, t)
                }
            })
        }

        crossCallServerFunction(e, t, ...i) {
            return n(this, void 0, void 0, function* () {
                let n = null, a = yield this.crossCallServerFunctionEx(e, t, ...i);
                return a && (n = a[0]), n
            })
        }

        crossCallServerFunctionEx(e, t, ...i) {
            {
                if (!e) throw new Error("An argument for 'productId' was not provided");
                let n = this.singletonMap[e.toLowerCase()];
                if (!n) throw new Error("Please call the 'start' interface first");
                if (!t) throw new Error("An argument for 'funcName' was not provided");
                return this.internalCallServerFunctionEx(n, t, ...i)
            }
        }

        crossIsRemoteClientExist(e, t) {
            return n(this, void 0, void 0, function* () {
                {
                    if (!e) throw new Error("An argument for 'productId' was not provided");
                    let i = this.singletonMap[e.toLowerCase()];
                    if (!i) throw new Error("Please call the 'start' interface first");
                    return this.internalIsRemoteClientExist(i, t)
                }
            })
        }

        crossCheckRemoteFunction(e, t, i) {
            return n(this, void 0, void 0, function* () {
                {
                    if (!e) throw new Error("An argument for 'productId' was not provided");
                    let n = this.singletonMap[e.toLowerCase()];
                    if (!n) throw new Error("Please call the 'start' interface first");
                    if (!t) throw new Error("An argument for 'remoteId' was not provided");
                    if (!i) throw new Error("An argument for 'funcName' was not provided");
                    return this.internalCheckRemoteFunction(n, t, i)
                }
            })
        }

        crossCallRemoteClientFunction(e, t, i, ...n) {
            {
                if (!e) throw new Error("An argument for 'productId' was not provided");
                let a = this.singletonMap[e.toLowerCase()];
                if (!a) throw new Error("Please call the 'start' interface first");
                if (!t) throw new Error("An argument for 'remoteId' was not provided");
                if (!i) throw new Error("An argument for 'funcName' was not provided");
                return this.internalCallRemoteClientFunction(a, t, i, ...n)
            }
        }

        crossAttachServerEvent(e, t, i) {
            let n = void 0;
            {
                if (!e) throw new Error("An argument for 'productId' was not provided");
                let a = this.singletonMap[e.toLowerCase()];
                if (!a) throw new Error("Please call the 'start' interface first");
                if (!t) throw new Error("An argument for 'eventName' was not provided");
                n = this.internalAttachServerEvent(a, t, i)
            }
            return n
        }

        crossDetachServerEvent(e, t, i) {
            {
                if (!e) throw new Error("An argument for 'productId' was not provided");
                let n = this.singletonMap[e.toLowerCase()];
                if (!n) throw new Error("Please call the 'start' interface first");
                if (!t) throw new Error("An argument for 'eventName' was not provided");
                this.internalDetachServerEvent(n, t, i)
            }
        }

        crossBroadcastEvent(e, t, ...i) {
            {
                if (!e) throw new Error("An argument for 'productId' was not provided");
                let n = this.singletonMap[e.toLowerCase()];
                if (!n) throw new Error("Please call the 'start' interface first");
                if (!t) throw new Error("An argument for 'eventName' was not provided");
                this.sendAdapter(n, {
                    action: "broadcast",
                    name: t,
                    args: i,
                    __context: Object.assign({}, this.client.getContext())
                })
            }
        }

        registry(e) {
            let t = this.getFullContextName(this.client);
            return new Promise((i, n) => {
                do {
                    if (!t) {
                        i(!1);
                        break
                    }
                    let n = this.generateId();
                    const a = {alias: t, action: "register", rid: n};
                    let o = (e, n) => {
                        e ? (s.error("register error", e.message), i(n)) : i(t)
                    };
                    this.retCallbackMap[n] = Object.assign({callback: o}, a), this.sendAdapter(e, a)
                } while (0)
            })
        }

        getNow() {
            return Date.now()
        }

        sendAdapter(e, t) {
            do {
                if (!t) break;
                let i = this.getNow();
                if (t.timestamp ? t.timestamp = [...t.timestamp].concat(i) : t.timestamp = [].concat(i), !t.__context) {
                    let i = e.getContext();
                    i && (t = Object.assign({__context: i}, t))
                }
                e.isInprocess() ? (s.information("send to server in process"), global.__xdasIPCServer.emit("message", t, e)) : e.send(t)
            } while (0)
        }

        parseContext() {
            let e = void 0;
            do {
                let t = "";
                for (let e = 0; e < process.argv.length; e++) {
                    let i = process.argv[e];
                    if (0 === i.indexOf("--xdas-plugin-name=", 0)) {
                        t = i.substr("--xdas-plugin-name=".length);
                        break
                    }
                }
                if (!t) break;
                e = {name: t}
            } while (0);
            return e
        }

        generateId() {
            return this.rid++
        }

        getFullContextName(e, t) {
            let i = "";
            do {
                if (t === r.serverContextName) {
                    i = t;
                    break
                }
                if (void 0 === t) {
                    i = `${e.getContext().productId}-${e.getContext().name}`.toLowerCase();
                    break
                }
                i = `${e.getContext().productId}-${t}`.toLowerCase()
            } while (0);
            return i
        }

        internalCheckServerFunction(e, t) {
            return new Promise((i, n) => {
                do {
                    if (!e) {
                        i(!1);
                        break
                    }
                    if (!t) {
                        i(!1);
                        break
                    }
                    let n = this.generateId();
                    const a = {action: "check_server_function_exist", method: t, rid: n};
                    let o = (e, t) => {
                        i(!e && t)
                    };
                    this.retCallbackMap[n] = Object.assign({callback: o}, a), this.sendAdapter(e, a)
                } while (0)
            })
        }

        internalCallServerFunctionEx(e, t, ...i) {
            return new Promise((n, a) => {
                do {
                    if (!e) {
                        n([null, "client doesn't ready"]);
                        break
                    }
                    if (!t) {
                        n([null, "funcName is not specifed"]);
                        break
                    }
                    e === this.client && this.emit("stat_call_function", this.client.getContext(), t);
                    let a = this.generateId();
                    if (i) for (let e = 0; e < i.length; e++) i[e] = this.convertFunction2IdEx(i[e]);
                    const o = {rid: a, method: t, args: i};
                    let r = (t, i) => {
                        t ? (s.error("callServerFunction error", t, e.getContext()), n([null, t])) : n([i, void 0])
                    };
                    this.retCallbackMap[a] = Object.assign({callback: r}, o), this.sendAdapter(e, o)
                } while (0)
            })
        }

        internalIsRemoteClientExist(e, t) {
            return new Promise((i, n) => {
                do {
                    if (!t) {
                        i([!1, "remote client alias is not specifed"]);
                        break
                    }
                    if (e === this.client && t.toLowerCase() === e.getContext().name.toLowerCase()) {
                        i([!0, "self is exist"]);
                        break
                    }
                    let n = this.generateId();
                    const a = {dst: this.getFullContextName(e, t), action: "check_client_exist", rid: n};
                    let o = (e, t) => {
                        i(e ? [!1, e] : [t, "success"])
                    };
                    this.retCallbackMap[n] = Object.assign({callback: o}, a), this.sendAdapter(e, a)
                } while (0)
            })
        }

        internalCheckRemoteFunction(e, t, i) {
            return new Promise((n, a) => {
                do {
                    if (!e) {
                        n(!1);
                        break
                    }
                    if (!t) {
                        n(!1);
                        break
                    }
                    if (!i) {
                        n(!1);
                        break
                    }
                    if (e === this.client && t.toLowerCase() === e.getContext().name.toLowerCase()) {
                        n(!(!this.apis || !this.apis[i]));
                        break
                    }
                    let a = this.generateId();
                    const o = {
                        action: "check_client_function_exist",
                        method: i,
                        rid: a,
                        src: this.getFullContextName(this.client),
                        dst: this.getFullContextName(e, t)
                    };
                    let r = (e, t) => {
                        n(!e && t)
                    };
                    this.retCallbackMap[a] = Object.assign({callback: r}, o), this.sendAdapter(e, o)
                } while (0)
            })
        }

        internalCallRemoteClientFunction(e, t, i, ...n) {
            return new Promise((a, o) => {
                do {
                    if (!e) {
                        a([null, "client doesn't ready"]);
                        break
                    }
                    if (!t) {
                        a([null, "remote client alias is not specifed"]);
                        break
                    }
                    if (!i) {
                        a([null, "funcName is not specifed"]);
                        break
                    }
                    let o = (e, t) => {
                        e ? (s.information("callRemoteClientFunction", e.message), a([null, e])) : a([t, void 0])
                    };
                    if (n) for (let e = 0; e < n.length; e++) n[e] = this.convertFunction2IdEx(n[e]);
                    let r = this.generateId();
                    const l = {
                        src: this.getFullContextName(this.client),
                        dst: this.getFullContextName(e, t),
                        action: "call_remote_client_api",
                        method: i,
                        args: n,
                        rid: r
                    };
                    this.retCallbackMap[r] = Object.assign({callback: o}, l), this.sendAdapter(e, l)
                } while (0)
            })
        }

        internalAttachServerEvent(e, t, i) {
            let n = e.getContext().productId.toLowerCase();
            this.eventCallbackMaps.hasOwnProperty(n) || (this.eventCallbackMaps[n] = {}), this.eventCallbackMaps[n].hasOwnProperty(t) || (this.eventCallbackMaps[n][t] = {}), r.isObjectEmpty(this.eventCallbackMaps[n][t]) && this.sendAdapter(e, {
                action: "attach_event",
                name: t
            });
            let a = this.generateId();
            return this.eventCallbackMaps[n][t][a] = i, a
        }

        internalDetachServerEvent(e, t, i) {
            let n = e.getContext().productId.toLowerCase();
            do {
                if (!this.eventCallbackMaps.hasOwnProperty(n)) break;
                if (!this.eventCallbackMaps[n].hasOwnProperty(t)) break;
                delete this.eventCallbackMaps[n][t][i], r.isObjectEmpty(this.eventCallbackMaps[n][t]) && this.sendAdapter(e, {
                    action: "detach_event",
                    name: t
                })
            } while (0)
        }

        fireServerEvent(e, t, ...i) {
            let n = e.getContext().productId.toLowerCase();
            do {
                if (!this.eventCallbackMaps.hasOwnProperty(n)) break;
                if (!this.eventCallbackMaps[n].hasOwnProperty(t)) break;
                let e = this.eventCallbackMaps[n][t];
                for (let t in e) {
                    let n = e[t];
                    n && n.apply(null, ...i)
                }
            } while (0)
        }

        callFunctionById(e, t, i, ...n) {
            let a = void 0, o = !1;
            do {
                const r = this.contextCallbackMap[t];
                if (!r) break;
                let s = void 0, l = void 0;
                try {
                    s = r.apply(null, ...n)
                } catch (e) {
                    l = e.message;
                    break
                }
                if (void 0 === i || null === i) break;
                if (a = {s_rid: i, action: "call_client_by_id_callback", success: !1}, void 0 !== l) {
                    a.error = l;
                    break
                }
                if (s && s.then) {
                    s.then(t => {
                        a.data = this.convertFunction2Id(t), a.success = !0, this.sendAdapter(e, a)
                    }).catch(t => {
                        a.error = t instanceof Error ? t.message : t, this.sendAdapter(e, a)
                    }), o = !0;
                    break
                }
                a.success = !0, a.data = this.convertFunction2Id(s)
            } while (0);
            !o && a && this.sendAdapter(e, a)
        }

        convertFunction2Id(e) {
            let t = e;
            if ("function" == typeof e) {
                let i = this.generateId();
                this.contextCallbackMap[i] = e, t = i
            } else if (e && "object" == typeof e) for (let t in e) {
                let i = e[t];
                if ("function" == typeof i) {
                    let n = this.generateId();
                    this.contextCallbackMap[n] = i, e[t] = n
                } else i && "object" == typeof i && (e[t] = this.convertFunction2Id(i))
            }
            return t
        }

        convertFunction2IdEx(e) {
            let t = e;
            if ("function" == typeof e) {
                let i = this.generateId();
                this.contextCallbackMap[i] = e, t = {"__nodeipc_callback_id__{A9C9D760-14E8-42CB-A3CB-9C0A0DDFD732}": i}
            } else if (e && "object" == typeof e) for (let t in e) {
                let i = e[t];
                if ("function" == typeof i) {
                    let n = this.generateId();
                    this.contextCallbackMap[n] = i, e[t] = {"__nodeipc_callback_id__{A9C9D760-14E8-42CB-A3CB-9C0A0DDFD732}": n}
                } else i && "object" == typeof i && (e[t] = this.convertFunction2IdEx(i))
            }
            return t
        }

        decodeParameter(e, t) {
            let i = e;
            do {
                if (!e) break;
                if ("object" != typeof e) break;
                let n = e["__nodeipc_callback_id__{A9C9D760-14E8-42CB-A3CB-9C0A0DDFD732}"];
                if (n) {
                    i = ((...e) => {
                        this.callRemoteContextById(t, n, ...e)
                    }), global.__xdasObjectLiftMonitor && global.__xdasObjectLiftMonitor.setObjectFreer(i, {
                        remoteId: t,
                        callbackId: n
                    }, l);
                    break
                }
                for (let i in e) {
                    let n = e[i];
                    e[i] = this.decodeParameter(n, t)
                }
            } while (0);
            return i
        }

        callRegisterFunction(e, t) {
            let i = void 0, n = !1;
            do {
                if (!t) break;
                let a = t.method;
                if (!a) break;
                let o = this.getNow();
                if (i = {
                    s_rid: t.s_rid,
                    action: "remote_client_callback",
                    success: !1,
                    rid: t.rid,
                    method: t.method,
                    src: t.src,
                    timestamp: t.timestamp ? t.timestamp.concat(o) : [].concat(o)
                }, !this.apis || !this.apis[a]) {
                    i.error = `callRegisterFunction ${a} is undefined`;
                    break
                }
                let r = void 0, s = this.decodeParameter(t.args, t.src);
                try {
                    r = this.apis[a].apply(null, [t.src].concat(s))
                } catch (e) {
                    i.error = e.message;
                    break
                }
                if (r && r.then) {
                    r.then(t => {
                        i.data = this.convertFunction2IdEx(t), i.success = !0, this.sendAdapter(e, i)
                    }).catch(t => {
                        i.error = t instanceof Error ? t.message : t, this.sendAdapter(e, i)
                    }), n = !0;
                    break
                }
                i.success = !0, i.data = this.convertFunction2IdEx(r)
            } while (0);
            s.information("callRegisterFunction", i), !n && i && this.sendAdapter(e, i)
        }
    }), d = global.__xdasIPCClienInstance, t.client = d
}, function (e, t, i) {
    e.exports = i(56)(201)
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(6), r = i(0).default.getLogger("XLStat");
    let s = o.default(a.join(__rootDir, "../bin/ThunderHelper.node"));

    function l(e = "") {
        let t;
        if ("string" == typeof e) t = e; else if (d(e) && "object" == typeof e) {
            let i = [];
            for (let t in e) d(e[t]) && i.push(t + "=" + encodeURIComponent(e[t]));
            t = i.join(",")
        }
        return t
    }

    function d(e) {
        return void 0 !== e && null !== e
    }

    !function (e) {
        let t = null;

        function i() {
            return t || (t = s.xlstat4), t
        }

        function a(e, t = "", a = "", o = 0, s = 0, d = 0, u = 0, c = "", h = 0) {
            return n(this, void 0, void 0, function* () {
                let n = 0;
                do {
                    if (void 0 === e) {
                        n = 1;
                        break
                    }
                    let f = l(c);
                    n = "browser" === process.type ? yield new Promise(r => {
                        n = i().asyncTrackEvent(e, t, a, o, s, d, u, f, h, e => {
                            r(e)
                        })
                    }) : i().trackEvent(e, t, a, o, s, d, u, f, h), r.information(e, t, a, o, s, d, u, f, h)
                } while (0);
                return n
            })
        }

        function o(e, t = 0) {
            do {
                if (void 0 === e) break;
                "browser" !== process.type && i().trackClick(e, t)
            } while (0)
        }

        e.asyncTrackEvent = a, e.trackEvent = function (e, t = "", i = "", n = 0, o = 0, r = 0, s = 0, l = "", d = 0) {
            a(e, t, i, n, o, r, s, l, d).catch()
        }, e.trackClick = o, e.trackShow = function (e, t = 0) {
            o(e, t)
        }, e.setUserID = function (e = 0, t = 0) {
            "browser" !== process.type && i().setUserID(e, t)
        }, e.initParam = function (e) {
            return n(this, void 0, void 0, function* () {
                let t = -1;
                return t = "browser" === process.type ? yield new Promise(t => {
                    i().asyncInitParam(e, (e, i) => {
                        t(e ? i : -1)
                    })
                }) : yield new Promise(t => {
                    i().initParamRemote(e, e => {
                        t(e)
                    })
                })
            })
        }, e.asyncUninit = function (e) {
            return n(this, void 0, void 0, function* () {
                "browser" === process.type && (yield new Promise(t => {
                    i().asyncUninit(e, () => {
                        t()
                    })
                }))
            })
        }, e.uninit = function () {
            "browser" === process.type && i().waitFinish()
        }
    }(t.XLStatNS || (t.XLStatNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(53), o = i(0), r = i(39), s = i(5), l = i(13), d = o.default.getLogger("Config");

    class u {
        constructor() {
            this.isInit = !1, this.configData = {}, this.configPath = void 0, this.configBakPath = void 0, this.eventContainer = new r.default, this.changed = !1, this.timer = null, this.eventContainer.setMaxListeners(0)
        }

        init(e) {
            return n(this, void 0, void 0, function* () {
                if (!this.isInit) {
                    this.configPath = e, this.configBakPath = e + ".bak";
                    let t = null, i = yield s.FileSystemAWNS.existsAW(e);
                    if (i) {
                        let i = yield s.FileSystemAWNS.readFileAW(e);
                        if (i && i.length > 0) try {
                            t = JSON.parse(i.toString())
                        } catch (e) {
                            d.warning(e)
                        }
                    }
                    if (!t && (i = yield s.FileSystemAWNS.existsAW(this.configBakPath))) {
                        let e = yield s.FileSystemAWNS.readFileAW(this.configBakPath);
                        if (e && e.length > 0) try {
                            t = JSON.parse(e.toString())
                        } catch (e) {
                            d.warning(e)
                        }
                    }
                    t && this.mergeConfigData(t), this.isInit = !0, this.eventContainer.fireEvent(l.NodeEventMesssageNS.eventConfigInitFinished)
                }
                this.timer || (this.timer = setInterval(() => {
                    this.changed && (this.changed = !1, this.save().catch())
                }, 5e3))
            })
        }

        getValue(e, t, i) {
            let n = i;
            do {
                if (!e || "" === e) break;
                if (!t || "" === t) break;
                let i = this.configData[e];
                if (!i) break;
                t in i && (n = i[t])
            } while (0);
            return n
        }

        setValue(e, t, i) {
            do {
                if (!e || "" === e) break;
                if (!t || "" === t) break;
                let n = void 0, a = this.configData[e];
                if (a) n = a[t], a[t] = i; else {
                    let n = {};
                    n[t] = i, this.configData[e] = n
                }
                n !== i && (this.changed = !0, this.fireValueChangedEvent(e, t, n, i))
            } while (0)
        }

        removeValue(e, t) {
            do {
                if (!e || "" === e) break;
                if (!t || "" === t) break;
                let i = void 0, n = this.configData[e];
                n && (i = n[t], n[t] = void 0), void 0 !== i && this.fireValueChangedEvent(e, t, i, void 0)
            } while (0)
        }

        isInitConfigFinished() {
            return this.isInit
        }

        save() {
            return n(this, void 0, void 0, function* () {
                if (this.isInit) {
                    let e = JSON.stringify(this.configData, void 0, 2);
                    yield s.FileSystemAWNS.writeFileAW(this.configPath, e), yield s.FileSystemAWNS.writeFileAW(this.configBakPath, e)
                }
            })
        }

        saveSync() {
            if (this.isInit) {
                let e = JSON.stringify(this.configData, void 0, 2);
                a.writeFileSync(this.configPath, e), a.writeFileSync(this.configBakPath, e)
            }
        }

        attachListener(e, t) {
            do {
                if (e === l.NodeEventMesssageNS.eventConfigInitFinished) {
                    if (this.isInit) {
                        t(this.isInit);
                        break
                    }
                    this.eventContainer.attachOnceListener(e, t);
                    break
                }
                this.eventContainer.attachListener(e, t)
            } while (0)
        }

        detachListener(e, t) {
            this.eventContainer.detachListener(e, t)
        }

        prependListener(e, t) {
            do {
                if (e === l.NodeEventMesssageNS.eventConfigInitFinished) {
                    if (this.isInit) {
                        t(this.isInit);
                        break
                    }
                    this.eventContainer.prependOnceListener(e, t);
                    break
                }
                this.eventContainer.prependListener(e, t)
            } while (0)
        }

        mergeConfigData(e) {
            if (e) if (null === this.configData) this.configData = e; else for (let t in e) {
                let i = e[t];
                if (!i) break;
                for (let e in i) {
                    let n = i[e], a = this.configData[t];
                    if (a) a[e] = n; else {
                        let i = {};
                        i[e] = n, this.configData[t] = i
                    }
                }
            }
        }

        fireValueChangedEvent(e, t, i, n) {
            this.eventContainer.fireEvent(l.NodeEventMesssageNS.eventConfigValueChanged, e, t, i, n)
        }
    }

    t.Config = u;
    const c = new u;
    !function (e) {
        e.init = function (e) {
            return n(this, void 0, void 0, function* () {
                yield c.init(e)
            })
        }, e.isInitConfigFinished = function () {
            return c.isInitConfigFinished()
        }, e.save = function () {
            return n(this, void 0, void 0, function* () {
                yield c.save()
            })
        }, e.saveSync = function () {
            c.saveSync()
        }, e.getValue = function (e, t, i) {
            return c.getValue(e, t, i)
        }, e.setValue = function (e, t, i) {
            c.setValue(e, t, i)
        }, e.attachListener = function (e, t) {
            c.attachListener(e, t)
        }, e.prependListener = function (e, t) {
            c.prependListener(e, t)
        }, e.detachListener = function (e, t) {
            c.detachListener(e, t)
        }
    }(t.ConfigNS || (t.ConfigNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(17), o = i(2), r = i(0), s = i(6), l = i(39), d = i(5), u = i(13), c = i(42), h = i(3), f = i(31),
        g = i(485), p = i(15), v = i(40), m = i(29), y = i(28), k = i(49), T = i(46), w = i(4), C = i(45), S = i(22),
        b = i(37), I = i(51), _ = i(303), A = p.DownloadKernelEventManager.getEventManager(),
        D = v.DownloadKernelCategoryViewManager.getCategoryViewManager(),
        x = m.DownloadKernelCategoryManager.getCategoryManager(), N = k.ToastNotifyManagerNS.getToastNotifyManger(),
        E = r.default.getLogger("DownloadKernel.TaskManager"),
        P = s.default(o.join(__rootDir, "../bin/ThunderHelper.node"));

    class M {
        constructor() {
            this.isLoadStorageFinish = !1, this.isInitDkFinish = !1, this.isEnableP2pChannel = !0, this.isEnableP2sChannel = !0, this.lastGlobalStat = {
                size: 0,
                recvdBytes: 0,
                sentBytes: 0,
                dhtNodeCount: 0,
                isUPnPReady: 0
            }, this.totalDownloadSpeed = 0, this.totalUploadSpeed = 0, this.eventContainer = new l.default, this.sdkCrash = !1, this.tasks = new Map, this.startTasks = []
        }

        getStartTaskIDs() {
            return this.startTasks
        }

        createTask(e, t) {
            return n(this, void 0, void 0, function* () {
                let i = !0, n = !1, a = new g.Task, r = t.categoryId;
                if (t.privateSpace) {
                    let e = x.getCurrentPrivateCategory();
                    e && (r = e.getId())
                }
                switch (e) {
                    case h.DownloadKernel.TaskType.P2sp: {
                        let i = (yield this.getTaskName(e, t.taskBaseInfo.savePath, t.taskBaseInfo.taskName, 0)).newName;
                        t.taskBaseInfo.taskName = i, a.createP2spTask(t.isBackground, t.taskBaseInfo, t.p2spTaskInfo, r), t.taskBaseInfo.groupTaskId && t.taskBaseInfo.groupTaskId > 0 && (n = !0)
                    }
                        break;
                    case h.DownloadKernel.TaskType.Bt:
                        yield a.createBtTask(t.isBackground, t.taskBaseInfo, t.btTaskInfo, r);
                        break;
                    case h.DownloadKernel.TaskType.Emule: {
                        let i = (yield this.getTaskName(e, t.taskBaseInfo.savePath, t.taskBaseInfo.taskName, 0)).newName;
                        t.taskBaseInfo.taskName = i, a.createEmuleTask(t.isBackground, t.taskBaseInfo, t.emuleTaskInfo, r), t.taskBaseInfo.groupTaskId && t.taskBaseInfo.groupTaskId > 0 && (n = !0)
                    }
                        break;
                    case h.DownloadKernel.TaskType.Group: {
                        let i = o.dirname(t.taskBaseInfo.savePath),
                            n = (yield this.getTaskName(e, i, t.taskBaseInfo.taskName, 0)).newName;
                        if (n !== t.taskBaseInfo.taskName) {
                            t.taskBaseInfo.taskName = n, t.taskBaseInfo.savePath = o.join(i, n);
                            let e = t.taskBaseInfo.savePath;
                            for (let i = 0; i < t.groupTaskInfo.subTaskList.length; ++i) t.groupTaskInfo.subTaskList[i].p2spTaskInfo ? t.groupTaskInfo.subTaskList[i].taskBaseInfo.savePath = e : t.groupTaskInfo.subTaskList[i].emuleTaskInfo && (t.groupTaskInfo.subTaskList[i].taskBaseInfo.savePath = e)
                        }
                        yield this.createGroupTask(a, t.taskBaseInfo, t.groupTaskInfo, r)
                    }
                        break;
                    case h.DownloadKernel.TaskType.Magnet:
                        a.createMagnetTask(t.isBackground, t.taskBaseInfo, t.magnetTaskInfo, r);
                        break;
                    default:
                        i = !1
                }
                return i ? (this.addTask(a, t), t.isBackground || n || this.insertToCategoryView(a, h.DownloadKernel.TaskInsertReason.Create), A.fireTaskEvent(h.DownloadKernel.TaskEventType.TaskCreated, [a])) : a = null, a
            })
        }

        createBatchTask(e, t) {
            return n(this, void 0, void 0, function* () {
                let i = f.ThunderKernel.beginTransaction(), n = void 0, a = void 0;
                if (t) {
                    n = t.getId();
                    let e = t.getTaskAttribute(h.DownloadKernel.TaskAttribute.SavePath);
                    e && (a = e.length + 1)
                }
                let r = new Map, s = void 0, l = [];
                for (let i = 0; i < e.length; ++i) {
                    let d = !0, u = new g.Task, c = e[i];
                    c.taskBaseInfo.groupTaskId = n;
                    let f = c.taskType, p = o.join(c.taskBaseInfo.savePath, c.taskBaseInfo.taskName);
                    this.setGroupTaskRelativePath(u, c.taskBaseInfo.savePath, a);
                    let v = r.get(p);
                    if (w.isNumber(v) || (v = 0), void 0 === s && (s = c.categoryId, c.privateSpace)) {
                        let e = x.getCurrentPrivateCategory();
                        e && (s = e.getId())
                    }
                    let m = yield this.getTaskName(f, c.taskBaseInfo.savePath, c.taskBaseInfo.taskName, v);
                    r.set(p, m.index + 1), c.taskBaseInfo.taskName = m.newName, f === h.DownloadKernel.TaskType.P2sp ? u.createP2spTask(c.isBackground, c.taskBaseInfo, c.p2spTaskInfo, s) : f === h.DownloadKernel.TaskType.Emule ? u.createEmuleTask(c.isBackground, c.taskBaseInfo, c.emuleTaskInfo, s) : d = !1, d ? (t && t.getExtraObject().addSubTask(u), this.addTask(u, c), c.isBackground || l.push(u)) : u = null
                }
                if (f.ThunderKernel.commitTransaction(i), !t) {
                    let e = null;
                    (e = void 0 !== s && s > -1 ? x.getCategoryView(s, h.DownloadKernel.CategroyViewID.Downloading) : D.getCategoryViewFromId(h.DownloadKernel.CategroyViewID.Downloading)) && e.insertTask(l, h.DownloadKernel.TaskInsertReason.Create), A.fireTaskEvent(h.DownloadKernel.TaskEventType.TaskCreated, l)
                }
                return l
            })
        }

        startTask(e, t) {
            let i = this.tasks.get(e), n = !1;
            if (i) {
                if (this.sdkCrash) return i.setStatusAndErrorCode(h.DownloadKernel.TaskStatus.Failed, h.DownloadKernel.TaskError.DownloadSDKCrash), A.fireTaskEvent(h.DownloadKernel.TaskEventType.StatusChanged, [i]), n;
                this.startTasks.push(e), this.isInitDkFinish ? (n = i.start(t)) ? this.taskStatusChanage([i]) : (E.error("task start fail! taskId", e), this.removeStartTask(e)) : (n = i.updateTaskStatus(h.DownloadKernel.TaskStatus.StartPending)) && (this.taskStatusChanage([i]), this.downloadSdkInited().then(() => {
                    (n = i.start(!0)) ? this.taskStatusChanage([i]) : (E.error("task start fail! taskId", e), this.removeStartTask(e))
                }).catch())
            } else E.error("task not exist! taskId", e);
            return n
        }

        startWaitingTask(e) {
            let t = !1, i = this.tasks.get(e);
            return i && i.startWaiting() && (this.taskStatusChanage([i]), t = !0), t
        }

        startWaitingTasks(e) {
            let t = !1, i = f.ThunderKernel.beginTransaction(), n = [];
            for (let i of e) {
                let e = this.tasks.get(i);
                e && e.startWaiting() && (n.push(e), t = !0)
            }
            return f.ThunderKernel.commitTransaction(i), n.length > 0 && A.fireTaskEvent(h.DownloadKernel.TaskEventType.StatusChanged, n), t
        }

        stopTask(e, t) {
            let i = this.tasks.get(e);
            i ? i.stop(t) ? (this.taskStatusChanage([i]), i.getTaskStatus() === h.DownloadKernel.TaskStatus.Stopped && i.setStopReason(h.DownloadKernel.TaskStopReason.Unknown)) : E.error("task stop fail! taskId", e) : E.error("task not exist! taskId", e)
        }

        batchStopTask(e, t) {
            let i = [], n = [];
            for (let t = 0; t < e.length; ++t) {
                let a = this.tasks.get(e[t]);
                if (a) {
                    a.getTaskStatus() === h.DownloadKernel.TaskStatus.StartWaiting ? i.push(a) : n.push(a)
                }
            }
            let a = [];
            for (let e = 0; e < i.length; ++e) {
                let n = i[e];
                n.stop(t) && a.push(n)
            }
            for (let e = 0; e < n.length; ++e) {
                let i = n[e];
                i.stop(t) && a.push(i)
            }
            a.length > 0 && this.taskStatusChanage(a);
            for (let e = 0; e < a.length; ++e) {
                let t = a[e];
                t.getTaskStatus() === h.DownloadKernel.TaskStatus.Stopped && t.setStopReason(h.DownloadKernel.TaskStopReason.Unknown)
            }
        }

        stopTaskAW(e, t) {
            return n(this, void 0, void 0, function* () {
                let i = this.tasks.get(e);
                return i ? i.stop(t) ? (this.taskStatusChanage([i]), i.getTaskStatus() === h.DownloadKernel.TaskStatus.Stopped && i.setStopReason(h.DownloadKernel.TaskStopReason.Unknown)) : E.error("task stop fail! taskId", e) : E.error("task not exist! taskId", e), this.attachTaskStopOnce(e)
            })
        }

        deleteTask(e, t) {
            return n(this, void 0, void 0, function* () {
                let i = this.tasks.get(e);
                if (!i) return !1;
                i.getTaskAttribute(h.DownloadKernel.TaskAttribute.CategoryViewId) === h.DownloadKernel.CategroyViewID.Downloading && (yield this.stopTaskAW(e, h.DownloadKernel.TaskStopReason.DeleteTask)), A.fireTaskEvent(h.DownloadKernel.TaskEventType.TaskDestroying, [i], t), i.updateTaskStatus(h.DownloadKernel.TaskStatus.DestroyPending) && this.taskStatusChanage([i]);
                let n = this.getTaskCategoryView(i), a = [i];
                null !== n && n.removeTask(a), this.removeTask(e);
                let o = f.ThunderKernel.beginTransaction();
                i.deleteStorageTask(), f.ThunderKernel.commitTransaction(o);
                let r = !0;
                return t && (r = (yield i.deleteFile()) && r), A.fireTaskEvent(h.DownloadKernel.TaskEventType.TaskDestroyed, [i], r), r
            })
        }

        deleteBatchTask(e, t) {
            return n(this, void 0, void 0, function* () {
                let i = [], a = [];
                for (let t = 0; t < e.length; ++t) {
                    let n = this.tasks.get(e[t]);
                    if (!n) {
                        E.warning("deleteBatchTask task", n);
                        continue
                    }
                    let o = n.getTaskStatus();
                    o === h.DownloadKernel.TaskStatus.StartPending || o === h.DownloadKernel.TaskStatus.Started ? a.push(n) : i.push(n)
                }
                let o = !0;
                if (i.length > 0) {
                    A.fireTaskEvent(h.DownloadKernel.TaskEventType.TaskDestroying, i, t);
                    let e = [];
                    for (let t = 0; t < i.length; ++t) {
                        let n = i[t];
                        n.updateTaskStatus(h.DownloadKernel.TaskStatus.DestroyPending) && e.push(n)
                    }
                    e.length > 0 && A.fireTaskEvent(h.DownloadKernel.TaskEventType.StatusChanged, e);
                    let n = this.getTaskCategoryView(i[0]);
                    null !== n && n.removeTask(i);
                    let a = f.ThunderKernel.beginTransaction();
                    for (let e = 0; e < i.length; ++e) {
                        let t = i[e];
                        this.removeTask(t.getId()), t.deleteStorageTask()
                    }
                    if (f.ThunderKernel.commitTransaction(a), t) for (let e = 0; e < i.length; ++e) {
                        let t = i[e];
                        o = (yield t.deleteFile()) && o
                    }
                    A.fireTaskEvent(h.DownloadKernel.TaskEventType.TaskDestroyed, i, o)
                }
                return a.length > 0 && (yield new Promise(e => {
                    let i = 0;
                    for (let r = 0; r < a.length; ++r) {
                        let s = a[r], l = s.getId();
                        this.stopTaskAW(l, h.DownloadKernel.TaskStopReason.DeleteTask).then(() => n(this, void 0, void 0, function* () {
                            ++i, A.fireTaskEvent(h.DownloadKernel.TaskEventType.TaskDestroying, [s], t), s.updateTaskStatus(h.DownloadKernel.TaskStatus.DestroyPending) && this.taskStatusChanage([s]);
                            let n = this.getTaskCategoryView(s);
                            null !== n && n.removeTask([s]), this.removeTask(l);
                            let r = f.ThunderKernel.beginTransaction();
                            s.deleteStorageTask(), f.ThunderKernel.commitTransaction(r), t && (o = (yield s.deleteFile()) && o), A.fireTaskEvent(h.DownloadKernel.TaskEventType.TaskDestroyed, [s], o), i === a.length && e()
                        })).catch()
                    }
                })), o
            })
        }

        removeToRecycle(e) {
            return n(this, void 0, void 0, function* () {
                let t = this.tasks.get(e);
                if (t) {
                    let i = t.getTaskAttribute(h.DownloadKernel.TaskAttribute.CategoryViewId);
                    if (i === h.DownloadKernel.CategroyViewID.Completed) {
                        let e = [t];
                        D.getCategoryViewFromId(h.DownloadKernel.CategroyViewID.Completed).removeTask(e)
                    } else if (yield this.stopTaskAW(e, h.DownloadKernel.TaskStopReason.DeleteTask), (i = t.getTaskAttribute(h.DownloadKernel.TaskAttribute.CategoryViewId)) === h.DownloadKernel.CategroyViewID.Completed) {
                        let e = [t];
                        D.getCategoryViewFromId(h.DownloadKernel.CategroyViewID.Completed).removeTask(e)
                    } else {
                        let i = [t];
                        D.getCategoryViewFromId(h.DownloadKernel.CategroyViewID.Downloading).removeTask(i), this.removeStartTask(e)
                    }
                    t.moveToRecycle();
                    let n = D.getCategoryViewFromId(h.DownloadKernel.CategroyViewID.Recycle), a = [];
                    a.push(t), n.insertTask(a, h.DownloadKernel.TaskInsertReason.Recycle)
                }
            })
        }

        batchRemoveToRecycle(e) {
            return n(this, void 0, void 0, function* () {
                let t = [], i = [];
                for (let n = 0; n < e.length; ++n) {
                    let a = this.tasks.get(e[n]), o = a.getTaskStatus();
                    o === h.DownloadKernel.TaskStatus.StartPending || o === h.DownloadKernel.TaskStatus.Started ? i.push(a) : t.push(a)
                }
                if (t.length > 0) {
                    this.getTaskCategoryView(t[0]).removeTask(t);
                    let e = void 0;
                    t.length > 1 && (e = f.ThunderKernel.beginTransaction()), t.forEach(e => {
                        e.moveToRecycle()
                    }), void 0 !== e && f.ThunderKernel.commitTransaction(e), D.getCategoryViewFromId(h.DownloadKernel.CategroyViewID.Recycle).insertTask(t, h.DownloadKernel.TaskInsertReason.Recycle)
                }
                i.length > 0 && i.forEach(e => n(this, void 0, void 0, function* () {
                    let t = e.getId();
                    if (yield this.stopTaskAW(t, h.DownloadKernel.TaskStopReason.DeleteTask), e.getTaskAttribute(h.DownloadKernel.TaskAttribute.CategoryViewId) === h.DownloadKernel.CategroyViewID.Completed) {
                        let t = D.getCategoryViewFromId(h.DownloadKernel.CategroyViewID.Completed), i = [e];
                        t.removeTask(i)
                    } else {
                        D.getCategoryViewFromId(h.DownloadKernel.CategroyViewID.Downloading).removeTask([e]), this.removeStartTask(t)
                    }
                    e.moveToRecycle(), D.getCategoryViewFromId(h.DownloadKernel.CategroyViewID.Recycle).insertTask([e], h.DownloadKernel.TaskInsertReason.Recycle)
                }))
            })
        }

        recoverFromRecycle(e) {
            let t = 0, i = this.tasks.get(e);
            if (i && (t = i.getTaskAttribute(h.DownloadKernel.TaskAttribute.RecycleTime)) > 0) {
                if (i.recover()) {
                    let e = D.getCategoryViewFromId(h.DownloadKernel.CategroyViewID.Recycle), t = [];
                    t.push(i), e.removeTask(t)
                }
                let e = i.getTaskStatus();
                if (e === h.DownloadKernel.TaskStatus.Succeeded || e === h.DownloadKernel.TaskStatus.Seeding) {
                    let e = D.getCategoryViewFromId(h.DownloadKernel.CategroyViewID.Completed), t = [];
                    t.push(i), e.insertTask(t, h.DownloadKernel.TaskInsertReason.Recover)
                } else {
                    let e = D.getCategoryViewFromId(h.DownloadKernel.CategroyViewID.Downloading), t = [];
                    t.push(i), e.insertTask(t, h.DownloadKernel.TaskInsertReason.Recover)
                }
            }
            return t > 0
        }

        batchRecoverFromRecycle(e) {
            let t = [], i = [], n = [], a = f.ThunderKernel.beginTransaction();
            for (let a of e) {
                let e = this.tasks.get(a);
                if (e) {
                    if (e.getTaskAttribute(h.DownloadKernel.TaskAttribute.RecycleTime) > 0) {
                        e.recover() && t.push(e);
                        let a = e.getTaskStatus();
                        a === h.DownloadKernel.TaskStatus.Succeeded || a === h.DownloadKernel.TaskStatus.Seeding ? i.push(e) : n.push(e)
                    }
                }
            }
            if (f.ThunderKernel.commitTransaction(a), t.length > 0) {
                D.getCategoryViewFromId(h.DownloadKernel.CategroyViewID.Recycle).removeTask(t)
            }
            if (i.length > 0) {
                D.getCategoryViewFromId(h.DownloadKernel.CategroyViewID.Completed).insertTask(i, h.DownloadKernel.TaskInsertReason.Recover)
            }
            if (n.length > 0) {
                D.getCategoryViewFromId(h.DownloadKernel.CategroyViewID.Downloading).insertTask(n, h.DownloadKernel.TaskInsertReason.Recover)
            }
        }

        reDownloadTask(e, t) {
            return n(this, void 0, void 0, function* () {
                let i = null;
                do {
                    let n = this.tasks.get(e);
                    if (!n) break;
                    yield this.deleteTask(e, !0);
                    let a = n.getExtraObject().getAllUserData(),
                        o = n.getTaskAttribute(h.DownloadKernel.TaskAttribute.FileSize);
                    switch (o > 0 && (t.taskBaseInfo.fileSize = o), n.getTaskAttribute(h.DownloadKernel.TaskAttribute.TaskType)) {
                        case h.DownloadKernel.TaskType.P2sp:
                            i = yield this.redownloadP2spTask(n, t);
                            break;
                        case h.DownloadKernel.TaskType.Bt:
                            i = yield this.redownloadBtTask(n, t);
                            break;
                        case h.DownloadKernel.TaskType.Emule:
                            i = yield this.redownloadEmuleTask(n, t);
                            break;
                        case h.DownloadKernel.TaskType.Group:
                            i = yield this.redownloadGroupTask(n, t)
                    }
                    if (i) {
                        i.getExtraObject().setAllUserData(a)
                    }
                } while (0);
                return i
            })
        }

        moveTaskToPath(e, t) {
            return n(this, void 0, void 0, function* () {
                let i = !1, n = this.getTaskFromTaskId(e);
                do {
                    if (!n) break;
                    let a = n.getTaskAttribute(h.DownloadKernel.TaskAttribute.SavePath);
                    if (!t || "" === t || t === a) break;
                    let o = n.getTaskStatus();
                    o === h.DownloadKernel.TaskStatus.Started || o === h.DownloadKernel.TaskStatus.StartPending || o === h.DownloadKernel.TaskStatus.StartWaiting ? (i = yield this.stopTaskAW(e, h.DownloadKernel.TaskStopReason.MoveTask), i = (o = n.getTaskStatus()) === h.DownloadKernel.TaskStatus.Succeeded || o === h.DownloadKernel.TaskStatus.Seeding ? yield this.moveTask(e, t) : yield this.moveTask(e, t, !0)) : i = yield this.moveTask(e, t)
                } while (0);
                let a = [];
                return a[0] = i ? n : null, A.fireTaskEvent(h.DownloadKernel.TaskEventType.TaskMovedEnd, a), i
            })
        }

        moveCategoryTask(e, t) {
            let i = !1, n = this.getTaskFromTaskId(e);
            do {
                if (!n) break;
                let e = n.getTaskAttribute(h.DownloadKernel.TaskAttribute.CategoryId);
                if (void 0 === t || e === t) break;
                let a = n.getTaskAttribute(h.DownloadKernel.TaskAttribute.CategoryViewId), o = null;
                if (!(o = -1 === e ? D.getCategoryViewFromId(a) : x.getCategoryView(e, a))) break;
                let r = null;
                if (!(r = -1 === t ? D.getCategoryViewFromId(a) : x.getCategoryView(t, a))) break;
                let s = [];
                if (s.push(n), o.removeTask(s), n.setCategoryId(t), n.getType() === h.DownloadKernel.TaskType.Group) {
                    let e = n.getExtraObject(), i = e.getSubTaskCount();
                    for (let n = 0; n < i; ++n) {
                        let i = e.getSubTaskByIndex(n);
                        i && i.setCategoryId(t)
                    }
                }
                r.insertTask(s, h.DownloadKernel.TaskInsertReason.MoveThoughCategory), i = !0
            } while (0);
            let a = [];
            return a[0] = i ? n : null, A.fireTaskEvent(h.DownloadKernel.TaskEventType.TaskCategoryMovedEnd, a), i
        }

        getTaskCount() {
            return this.tasks.size
        }

        getTaskFromTaskId(e) {
            return this.tasks.get(e)
        }

        batchFindP2spTask(e) {
            return n(this, void 0, void 0, function* () {
                return new Promise(t => {
                    f.ThunderKernel.batchFindP2spTask(e, i => {
                        let n = [];
                        do {
                            if (E.information("batchFindTaskAsync batchFindBtTask urls:", e, ",results:", i), !i || i.length <= 0) break;
                            for (let e = 0; e < i.length; ++e) {
                                let t = i[e], a = this.tasks.get(t.taskId);
                                a && !this.isOtherPrivateSpaceTask(a) && n.push(a)
                            }
                        } while (0);
                        t(n)
                    }) || t(null)
                })
            })
        }

        batchFindEmuleTask(e) {
            return n(this, void 0, void 0, function* () {
                return new Promise(t => {
                    f.ThunderKernel.batchFindEmuleTask(e, i => {
                        let n = [];
                        do {
                            if (E.information("batchFindTaskAsync batchFindEmuleTask fileHashs:", e, ",results:", i), !i || i.length <= 0) break;
                            for (let e = 0; e < i.length; ++e) {
                                let t = i[e], a = this.tasks.get(t.taskId);
                                a && !this.isOtherPrivateSpaceTask(a) && n.push(a)
                            }
                        } while (0);
                        t(n)
                    }) || t(null)
                })
            })
        }

        batchFindBtTask(e) {
            return n(this, void 0, void 0, function* () {
                return new Promise(t => {
                    f.ThunderKernel.batchFindBtTask(e, i => {
                        let n = [];
                        do {
                            if (E.information("batchFindTaskAsync batchFindBtTask infoIds:", e, ",results:", i), !i || i.length <= 0) break;
                            for (let e = 0; e < i.length; ++e) {
                                let t = i[e], a = this.tasks.get(t.taskId);
                                a && !this.isOtherPrivateSpaceTask(a) && n.push(a)
                            }
                        } while (0);
                        t(n)
                    }) || t(null)
                })
            })
        }

        batchFindMagnetTask(e) {
            let t = [];
            do {
                let i = [];
                for (let t = 0; t < e.length; ++t) {
                    let n = e[t];
                    c.Common.isThunderPrivateUrl(n) && (n = c.Common.parseThunderPrivateUrl(n));
                    try {
                        n = decodeURI(n)
                    } catch (e) {
                        E.warning(e)
                    }
                    n && i.push(this.splitLastChar(n).toLowerCase())
                }
                if (i.length <= 0) break;
                for (let e = 0; e < i.length; ++e) {
                    let n = i[e];
                    for (let [, e]of this.tasks) if (!this.isOtherPrivateSpaceTask(e)) {
                        if (e.getTaskAttribute(h.DownloadKernel.TaskAttribute.TaskType) === h.DownloadKernel.TaskType.Magnet) {
                            let i = e.getTaskAttribute(h.DownloadKernel.TaskAttribute.TaskUrl);
                            c.Common.isThunderPrivateUrl(i) && (i = c.Common.parseThunderPrivateUrl(i));
                            try {
                                i = decodeURI(i)
                            } catch (e) {
                                E.warning(e)
                            }
                            if (i && n === this.splitLastChar(i).toLowerCase()) {
                                t.push(e);
                                break
                            }
                        }
                    }
                }
            } while (0);
            return t
        }

        batchFindGroupTask(e) {
            return n(this, void 0, void 0, function* () {
                return new Promise(t => {
                    f.ThunderKernel.batchFindGroupTask(e, i => {
                        let n = [];
                        do {
                            if (E.information("batchFindTaskAsync batchFindGroupTask taskNames:", e, ",results:", i), !i || i.length <= 0) break;
                            for (let e = 0; e < i.length; ++e) {
                                let t = i[e], a = this.tasks.get(t.taskId);
                                a && !this.isOtherPrivateSpaceTask(a) && n.push(a)
                            }
                        } while (0);
                        t(n)
                    }) || t(null)
                })
            })
        }

        batchFindTaskAsync(e) {
            return n(this, void 0, void 0, function* () {
                let t = [], i = [], n = [], a = [], o = [];
                for (let r = 0; r < e.length; ++r) {
                    let s = e[r], l = s.keyValue;
                    void 0 !== l && (s.keyType === h.DownloadKernel.KeyType.P2spUrl ? t.push(l) : s.keyType === h.DownloadKernel.KeyType.EmuleFileHash ? i.push(l) : s.keyType === h.DownloadKernel.KeyType.BtInfoId ? n.push(l) : s.keyType === h.DownloadKernel.KeyType.MagnetUrl ? a.push(l) : s.keyType === h.DownloadKernel.KeyType.GroupTaskName && o.push(l))
                }
                let r = [];
                if (t.length <= 0 && i.length <= 0 && n.length <= 0 && a.length <= 0 && o.length <= 0) return r;
                if (t.length > 0) {
                    let e = yield this.batchFindP2spTask(t);
                    e && e.length > 0 && (r = r.concat(e))
                }
                if (i.length > 0) {
                    let e = yield this.batchFindEmuleTask(i);
                    e && e.length > 0 && (r = r.concat(e))
                }
                if (n.length > 0) {
                    let e = yield this.batchFindBtTask(n);
                    e && e.length > 0 && (r = r.concat(e))
                }
                if (a.length > 0) {
                    let e = this.batchFindMagnetTask(a);
                    e && e.length > 0 && (r = r.concat(e))
                }
                if (o.length > 0) {
                    let e = yield this.batchFindGroupTask(o);
                    e && e.length > 0 && (r = r.concat(e))
                }
                return E.information("batchFindTaskAsync keyInfos:", e, ", ret:", r), r
            })
        }

        isLoadStorageTaskFinish() {
            return this.isLoadStorageFinish
        }

        getTotalDownloadSpeed() {
            return this.totalDownloadSpeed
        }

        getTotalUploadSpeed() {
            return this.totalUploadSpeed
        }

        getTotalDownloadSize() {
            let e = 0;
            return this.lastGlobalStat && this.lastGlobalStat.recvdBytes && (e = this.lastGlobalStat.recvdBytes), e < 0 && (e = 0), e
        }

        getTotalUploadSize() {
            let e = 0;
            return this.lastGlobalStat && this.lastGlobalStat.sentBytes && (e = this.lastGlobalStat.sentBytes), e < 0 && (e = 0), e
        }

        attachListener(e, t) {
            do {
                if (e === u.NodeEventMesssageNS.eventTaskDataBaseLoadEnd) {
                    if (this.isLoadStorageFinish) {
                        t(this.isLoadStorageFinish);
                        break
                    }
                    this.attachOnceListener(e, t);
                    break
                }
                if (e === u.NodeEventMesssageNS.eventDownloadKernelInitEnd) {
                    if (this.isInitDkFinish) {
                        t(this.isInitDkFinish);
                        break
                    }
                    this.attachOnceListener(e, t);
                    break
                }
                this.eventContainer.attachListener(e, t)
            } while (0)
        }

        attachOnceListener(e, t) {
            this.eventContainer.attachOnceListener(e, t)
        }

        detachListener(e, t) {
            this.eventContainer.detachListener(e, t)
        }

        queryTaskInfo() {
            let e = 0, t = this.startTasks.length, i = void 0;
            t > 0 && (i = f.ThunderKernel.beginTransaction());
            for (let n = 0; n < this.startTasks.length; ++n) {
                let a = this.startTasks[n], o = this.tasks.get(a), r = !1;
                o && (r = o.queryTaskInfo(e => {
                    this.taskStatusChanage([e])
                }, (e, t) => {
                    this.taskDetailChanage([e], t)
                }, () => {
                    ++e === t && f.ThunderKernel.commitTransaction(i)
                })), r || ++e === t && f.ThunderKernel.commitTransaction(i)
            }
            f.ThunderKernel.queryGlobalInfo(0, e => {
                if (this.lastGlobalStat && e) {
                    if (void 0 !== this.lastGlobalStat.recvdBytes && void 0 !== e.recvdBytes) {
                        let t = e.recvdBytes - this.lastGlobalStat.recvdBytes;
                        t < 0 && (t = 0), this.totalDownloadSpeed !== t && (this.eventContainer.fireEvent(u.NodeEventMesssageNS.eventGlobalDownloadSpeedChanged, t), this.totalDownloadSpeed = t)
                    } else this.totalDownloadSpeed = 0;
                    if (void 0 !== this.lastGlobalStat.sentBytes && void 0 !== e.sentBytes) {
                        let t = e.sentBytes - this.lastGlobalStat.sentBytes;
                        t < 0 && (t = 0), this.totalUploadSpeed !== t && (this.eventContainer.fireEvent(u.NodeEventMesssageNS.eventGlobalUploadSpeedChanged, t), this.totalUploadSpeed = t)
                    } else this.totalUploadSpeed = 0;
                    e && (this.lastGlobalStat = e)
                }
            })
        }

        loadTaskBase() {
            f.ThunderKernel.loadTaskBase(e => {
                this.loadTaskBaseCallback(e).catch()
            })
        }

        setGlobalExtInfo(e) {
            return n(this, void 0, void 0, function* () {
                const {LoginHelperNS: t} = yield Promise.resolve().then(() => i(24));
                if (yield t.loginHelper.isLoginedAw()) t.loginHelper.getAllUserInfo(t => {
                    let i = "0", n = "", a = 0, o = "";
                    do {
                        if (!t) break;
                        if (o = t.userID, E.information(`stat dk userId ${t.userID}`, t), !t.vipList) break;
                        if (!t.vipList[0]) break;
                        if (E.information(`stat dk isVip ${t.vipList[0].isVip}`), "0" === (i = "1" === String(t.vipList[0].isVip) ? "1" : "0")) break;
                        E.information(`stat dk vasType ${t.vipList[0].vasType}, vipLevel ${t.vipList[0].vipLevel}`);
                        let e = {2: "normal", 3: "platinum", 5: "super"};
                        t.vipList[0].vasType && e.hasOwnProperty(String(t.vipList[0].vasType)) && (n = e[String(t.vipList[0].vasType)]), t.vipList[0].vipLevel && !isNaN(Number(t.vipList[0].vipLevel)) && (a = t.vipList[0].vipLevel)
                    } while (0);
                    f.ThunderKernel.setUserInfo(o, "");
                    let r = `isvip=${i},viptype=${n},viplevel=${a},userchannel=${e}`;
                    E.information("stat dk extinfo", r), f.ThunderKernel.setGlobalExtInfo(r, !1)
                }); else {
                    f.ThunderKernel.setUserInfo("", "");
                    let t = `isvip=0,viptype=,viplevel=0,userchannel=${e}`;
                    E.information("stat dk extinfo", t), f.ThunderKernel.setGlobalExtInfo(t, !1)
                }
            })
        }

        isDkLoaded() {
            return this.isInitDkFinish
        }

        initDownloadKernelEnd(e) {
            this.isInitDkFinish = 0 === e, this.eventContainer.fireEvent(u.NodeEventMesssageNS.eventDownloadKernelInitEnd, e)
        }

        downloadSDKCrashRecover(e) {
            this.eventContainer.fireEvent(u.NodeEventMesssageNS.eventDownloadSDKRecover, e);
            for (let e = 0; e < this.startTasks.length; ++e) {
                let t = this.startTasks[e], i = this.tasks.get(t);
                i && i.createDownloadSdkTask().catch()
            }
        }

        downloadSDKCrash() {
            if (this.sdkCrash = !0, this.startTasks.length > 0) {
                let e = [];
                for (let t = 0; t < this.startTasks.length; ++t) {
                    let i = this.tasks.get(this.startTasks[t]);
                    i && (i.setStatusAndErrorCode(h.DownloadKernel.TaskStatus.Failed, h.DownloadKernel.TaskError.DownloadSDKCrash), e.push(i))
                }
                this.startTasks = [], A.fireTaskEvent(h.DownloadKernel.TaskEventType.StatusChanged, e)
            }
            this.notifySDKCrash()
        }

        enableCommonP2pChannel(e) {
            this.isEnableP2pChannel = e
        }

        enableCommonP2sChannel(e) {
            this.isEnableP2sChannel = e
        }

        getTotalTaskDownloadSpeed(e, t) {
            let i = 0;
            for (let n = 0; n < this.startTasks.length; ++n) {
                let a = this.startTasks[n], o = this.getTaskFromTaskId(a);
                if (!o) continue;
                if (void 0 !== t && null !== t || (t = !0), !t && o.getIsPrivate()) continue;
                if (o.getTaskStatus() !== h.DownloadKernel.TaskStatus.Started) continue;
                let r = o.getDownloadSpeed();
                o.getTaskAttribute(h.DownloadKernel.TaskAttribute.Background) ? e && (i += r) : i += r
            }
            return i
        }

        getTotalTaskVipSpeed(e, t) {
            let i = 0;
            for (let n = 0; n < this.startTasks.length; ++n) {
                let a = this.startTasks[n], o = this.getTaskFromTaskId(a);
                if (!o) continue;
                if (void 0 !== t && null !== t || (t = !0), !t && o.getIsPrivate()) continue;
                if (o.getTaskStatus() !== h.DownloadKernel.TaskStatus.Started) continue;
                let r = o.getVipSpeed();
                o.getTaskAttribute(h.DownloadKernel.TaskAttribute.Background) ? e && (i += r) : i += r
            }
            return i
        }

        attachTaskStopOnce(e) {
            return n(this, void 0, void 0, function* () {
                return new Promise(t => {
                    let i = this.tasks.get(e);
                    if (i) {
                        let n = i.getTaskStatus();
                        if (n === h.DownloadKernel.TaskStatus.Succeeded || n === h.DownloadKernel.TaskStatus.Seeding || n === h.DownloadKernel.TaskStatus.Stopped || n === h.DownloadKernel.TaskStatus.Failed) t(!0); else {
                            let i = 0;
                            i = A.attachTaskEvent(h.DownloadKernel.TaskEventType.StatusChanged, (...n) => {
                                do {
                                    if (!n) break;
                                    if (n[0] !== h.DownloadKernel.TaskEventType.StatusChanged) break;
                                    let a = n[1];
                                    if (!a) break;
                                    for (let n = 0; n < a.length; ++n) {
                                        let o = a[n];
                                        if (!o) continue;
                                        let r = o.getTaskAttribute(h.DownloadKernel.TaskAttribute.TaskId);
                                        if (e !== r) continue;
                                        let s = o.getTaskStatus();
                                        s !== h.DownloadKernel.TaskStatus.Succeeded && s !== h.DownloadKernel.TaskStatus.Seeding && s !== h.DownloadKernel.TaskStatus.Stopped || (A.detachTaskEvent(h.DownloadKernel.TaskEventType.StatusChanged, i), t(!0));
                                        break
                                    }
                                } while (0)
                            })
                        }
                    } else t(!1)
                })
            })
        }

        downloadTaskSelectFiles(e, t) {
            return n(this, void 0, void 0, function* () {
                let i = !1;
                do {
                    if (!t) break;
                    let n = null;
                    try {
                        n = JSON.parse(t)
                    } catch (e) {
                        E.warning(e)
                    }
                    if (null == n) break;
                    let a = this.tasks.get(e);
                    if (!a) break;
                    let o = a.getTaskAttribute(h.DownloadKernel.TaskAttribute.TaskType);
                    if (o !== h.DownloadKernel.TaskType.Bt && o !== h.DownloadKernel.TaskType.Group) break;
                    a.getTaskAttribute(h.DownloadKernel.TaskAttribute.RecycleTime) > 0 && this.recoverFromRecycle(e);
                    let r = a.getTaskStatus();
                    if (r !== h.DownloadKernel.TaskStatus.Started && r !== h.DownloadKernel.TaskStatus.StartPending || (yield this.stopTaskAW(e, h.DownloadKernel.TaskStopReason.SelectDownloadLists), r = a.getTaskStatus()), o === h.DownloadKernel.TaskType.Bt) {
                        a.getExtraObject().setDownloadFile(n)
                    } else if (o === h.DownloadKernel.TaskType.Group) {
                        a.getExtraObject().setDownloadTask(n)
                    }
                    if (r === h.DownloadKernel.TaskStatus.StartWaiting) {
                        if (this.taskStatusChanage([a]), o === h.DownloadKernel.TaskType.Group) {
                            a.getExtraObject().updateTaskDetail()
                        } else if (o === h.DownloadKernel.TaskType.Bt) {
                            let t = a.getExtraObject(), i = t.getFileSize();
                            a.internalSetFileSize(i) && this.taskDetailChanage([a], h.DownloadKernel.TaskDetailChangedFlags.FileSize);
                            let n = [], o = t.getBtFileList();
                            for (let [, e]of o) {
                                let t = e.getBtDownloadFileInfo();
                                n.push(t)
                            }
                            A.fireTaskEvent(h.DownloadKernel.TaskEventType.BtSubFileDetailChanged, e, n)
                        }
                    } else if (r === h.DownloadKernel.TaskStatus.Succeeded || r === h.DownloadKernel.TaskStatus.Seeding) {
                        let e = null, t = a.getTaskAttribute(h.DownloadKernel.TaskAttribute.CategoryId);
                        if (e = void 0 !== t && t > -1 ? x.getCategoryView(t, h.DownloadKernel.CategroyViewID.Completed) : D.getCategoryViewFromId(h.DownloadKernel.CategroyViewID.Completed)) {
                            let t = [];
                            t.push(a), e.removeTask(t)
                        }
                        let i = null;
                        if (i = void 0 !== t && t > -1 ? x.getCategoryView(t, h.DownloadKernel.CategroyViewID.Downloading) : D.getCategoryViewFromId(h.DownloadKernel.CategroyViewID.Downloading)) {
                            if (o === h.DownloadKernel.TaskType.Group) {
                                let e = a.getExtraObject(), t = e.getSubTaskCount();
                                for (let i = 0; i < t; ++i) {
                                    let t = e.getSubTaskByIndex(i);
                                    if (t) {
                                        if (1 !== t.getTaskAttribute(h.DownloadKernel.TaskAttribute.DownloadSubTask)) continue;
                                        t.getTaskStatus() === h.DownloadKernel.TaskStatus.Failed && t.updateTaskStatus(h.DownloadKernel.TaskStatus.Stopped)
                                    }
                                }
                            }
                            let e = [];
                            e.push(a), i.insertTask(e, h.DownloadKernel.TaskInsertReason.ReDownload), a.updateTaskStatus(h.DownloadKernel.TaskStatus.Stopped) && (a.setStopReason(h.DownloadKernel.TaskStopReason.SelectDownloadLists), this.taskStatusChanage([a]), a.setStopReason(h.DownloadKernel.TaskStopReason.Unknown))
                        }
                    }
                    i = !0
                } while (0);
                return i
            })
        }

        batchRelateYunTask(e) {
            let t = f.ThunderKernel.beginTransaction();
            for (let t of e) _.thunderPanTask.insertTask(t.taskId, t.panId, t.user_id, JSON.stringify({
                title: t.path,
                id: t.path_id
            }));
            f.ThunderKernel.commitTransaction(t)
        }

        getTaskCategoryView(e) {
            let t = null, i = e.getTaskAttribute(h.DownloadKernel.TaskAttribute.CategoryId),
                n = e.getTaskAttribute(h.DownloadKernel.TaskAttribute.CategoryViewId);
            return t = -1 === i ? D.getCategoryViewFromId(n) : x.getCategoryView(i, n)
        }

        loadStorageTask(e) {
            return n(this, void 0, void 0, function* () {
                let t = !0, i = new g.Task;
                if (null !== e) switch (e.taskType) {
                    case h.DownloadKernel.TaskType.P2sp:
                        i.loadStorageP2spTask(e);
                        break;
                    case h.DownloadKernel.TaskType.Bt:
                        i.loadStorageBtTask(e);
                        break;
                    case h.DownloadKernel.TaskType.Emule:
                        i.loadStorageEmuleTask(e);
                        break;
                    case h.DownloadKernel.TaskType.Group:
                        i.loadStorageGroupTask(e);
                        break;
                    default:
                        t = !1
                }
                return t && this.addTask(i) || (i = null), i
            })
        }

        getTaskStrategy(e) {
            let t = h.DownloadKernel.DispatchStrategy.DispatchStrategyOrigin, i = this.tasks.get(e);
            if (i) {
                i.getOriginOnlyStrategy() || (this.isEnableP2pChannel && (t += h.DownloadKernel.DispatchStrategy.DispatchStrategyP2p), this.isEnableP2sChannel && (t += h.DownloadKernel.DispatchStrategy.DispatchStrategyP2s))
            }
            return t
        }

        redownloadP2spTask(e, t) {
            return n(this, void 0, void 0, function* () {
                let i = null;
                if (e) {
                    let n = e.getTaskAttribute(h.DownloadKernel.TaskAttribute.TaskName),
                        a = e.getTaskAttribute(h.DownloadKernel.TaskAttribute.SavePath),
                        o = e.getTaskAttribute(h.DownloadKernel.TaskAttribute.TaskUrl),
                        r = e.getTaskAttribute(h.DownloadKernel.TaskAttribute.RefUrl),
                        s = e.getTaskAttribute(h.DownloadKernel.TaskAttribute.Cookie), l = e.getIsPrivate(), d = null;
                    t && t.taskBaseInfo ? ((d = t.taskBaseInfo).taskName && "" !== d.taskName || (d.taskName = n), d.savePath && "" !== d.savePath || (d.savePath = a)) : d = {
                        taskName: n,
                        savePath: a
                    };
                    let u = e.getExtraObject(), c = {
                        url: o,
                        refUrl: r,
                        cookie: s,
                        useOriginResourceOnly: e.getOriginOnlyStrategy() ? 1 : 0,
                        nameFixed: u.getNameFixed()
                    };
                    t && t.p2spTaskInfo && (void 0 !== t.p2spTaskInfo.useOriginResourceOnly ? (E.information("redownload redefine orign", t.p2spTaskInfo.useOriginResourceOnly), c.useOriginResourceOnly = t.p2spTaskInfo.useOriginResourceOnly ? 1 : 0) : E.information("redownload extends origin", c.useOriginResourceOnly)), i = yield this.createTask(h.DownloadKernel.TaskType.P2sp, {
                        taskBaseInfo: d,
                        p2spTaskInfo: c,
                        privateSpace: l
                    })
                }
                return i
            })
        }

        redownloadBtTask(e, t) {
            return n(this, void 0, void 0, function* () {
                let i = null;
                if (e) {
                    let n = e.getTaskAttribute(h.DownloadKernel.TaskAttribute.TaskUrl),
                        a = e.getTaskAttribute(h.DownloadKernel.TaskAttribute.TaskName),
                        o = e.getTaskAttribute(h.DownloadKernel.TaskAttribute.SavePath), r = e.getIsPrivate(),
                        s = e.getExtraObject(), l = s.getSeedFilePath(), d = s.getDisplayName(), u = s.getInfoId(),
                        c = s.getTrackerUrls(), f = s.getDownloadFile(), g = s.getBtFileInfoList(), p = null;
                    t && t.taskBaseInfo ? ((p = t.taskBaseInfo).taskName && "" !== p.taskName || (p.taskName = a), p.savePath && "" !== p.savePath || (p.savePath = o)) : p = {
                        taskName: a,
                        savePath: o
                    };
                    let v = {
                        originUrl: n,
                        seedFile: l,
                        displayName: d,
                        fileRealIndexLists: f,
                        fileLists: g,
                        infoId: u,
                        tracker: c
                    };
                    t && t.btTaskInfo && t.btTaskInfo.fileRealIndexLists && t.btTaskInfo.fileRealIndexLists.length > 0 && (v.fileRealIndexLists = t.btTaskInfo.fileRealIndexLists), i = yield this.createTask(h.DownloadKernel.TaskType.Bt, {
                        taskBaseInfo: p,
                        btTaskInfo: v,
                        privateSpace: r
                    })
                }
                return i
            })
        }

        redownloadEmuleTask(e, t) {
            return n(this, void 0, void 0, function* () {
                let i = null;
                if (e) {
                    let n = e.getTaskAttribute(h.DownloadKernel.TaskAttribute.TaskName),
                        a = e.getTaskAttribute(h.DownloadKernel.TaskAttribute.SavePath),
                        o = e.getTaskAttribute(h.DownloadKernel.TaskAttribute.TaskUrl), r = e.getIsPrivate(), s = null;
                    t && t.taskBaseInfo ? ((s = t.taskBaseInfo).taskName && "" !== s.taskName || (s.taskName = n), s.savePath && "" !== s.savePath || (s.savePath = a)) : s = {
                        taskName: n,
                        savePath: a
                    };
                    let l = null;
                    t && t.emuleTaskInfo ? (l = t.emuleTaskInfo).url = o : l = {url: o}, i = yield this.createTask(h.DownloadKernel.TaskType.Emule, {
                        taskBaseInfo: s,
                        emuleTaskInfo: l,
                        privateSpace: r
                    })
                }
                return i
            })
        }

        redownloadGroupTask(e, t) {
            return n(this, void 0, void 0, function* () {
                let i = null;
                if (e) {
                    let n = e.getTaskAttribute(h.DownloadKernel.TaskAttribute.TaskName),
                        a = e.getTaskAttribute(h.DownloadKernel.TaskAttribute.SavePath), o = e.getIsPrivate(),
                        r = e.getExtraObject(), s = r.getSubTaskCount(), l = [];
                    for (let e = 0; e < s; ++e) {
                        let i = r.getSubTaskByIndex(e);
                        if (i) {
                            let n = i.getTaskAttribute(h.DownloadKernel.TaskAttribute.TaskName),
                                a = i.getTaskAttribute(h.DownloadKernel.TaskAttribute.SavePath),
                                r = i.getTaskAttribute(h.DownloadKernel.TaskAttribute.TaskUrl),
                                s = i.getTaskAttribute(h.DownloadKernel.TaskAttribute.RefUrl),
                                d = i.getTaskAttribute(h.DownloadKernel.TaskAttribute.Cookie),
                                u = i.getTaskAttribute(h.DownloadKernel.TaskAttribute.DownloadSubTask),
                                c = i.getTaskAttribute(h.DownloadKernel.TaskAttribute.TaskType),
                                f = {taskBaseInfo: {taskName: n, savePath: a}, privateSpace: o};
                            if (c === h.DownloadKernel.TaskType.P2sp) {
                                let e = i.getExtraObject();
                                f.taskType = c, f.p2spTaskInfo = {
                                    url: r,
                                    refUrl: s,
                                    cookie: d,
                                    downloadSubTask: u,
                                    nameFixed: e.getNameFixed()
                                }, l.push(f)
                            } else c === h.DownloadKernel.TaskType.Emule && (f.taskType = c, f.emuleTaskInfo = {
                                url: r,
                                downloadSubTask: u
                            }, l.push(f));
                            if (t && t.groupTaskInfo && t.groupTaskInfo.subTaskList && t.groupTaskInfo.subTaskList[e]) {
                                let i = t.groupTaskInfo.subTaskList[e];
                                i.taskBaseInfo && (f.taskBaseInfo = i.taskBaseInfo, f.taskBaseInfo.taskName && "" !== f.taskBaseInfo.taskName || (f.taskBaseInfo.taskName = n), f.taskBaseInfo.savePath && "" !== f.taskBaseInfo.savePath || (f.taskBaseInfo.savePath = a)), c === h.DownloadKernel.TaskType.P2sp ? i.p2spTaskInfo && (f.p2spTaskInfo.useOriginResourceOnly = i.p2spTaskInfo.useOriginResourceOnly ? 1 : 0) : c === h.DownloadKernel.TaskType.Emule && i.emuleTaskInfo && (f.emuleTaskInfo.origin = i.emuleTaskInfo.origin)
                            }
                        }
                    }
                    let d = null;
                    t && t.taskBaseInfo ? ((d = t.taskBaseInfo).taskName && "" !== d.taskName || (d.taskName = n), d.savePath && "" !== d.savePath || (d.savePath = a)) : d = {
                        taskName: n,
                        savePath: a
                    };
                    let u = {subTaskList: l};
                    i = yield this.createTask(h.DownloadKernel.TaskType.Group, {
                        taskBaseInfo: d,
                        groupTaskInfo: u,
                        privateSpace: o
                    })
                }
                return i
            })
        }

        addTask(e, t) {
            let i = !1;
            if (e) {
                let n = e.getTaskAttribute(h.DownloadKernel.TaskAttribute.TaskId);
                this.tasks.set(n, e);
                let a = this.getTaskStrategy(n);
                e.setDispatchStrategy(a);
                let o = null;
                t && t.birdKey && (t.taskType === h.DownloadKernel.TaskType.P2sp ? o = e.getExtraObject() : t.taskType === h.DownloadKernel.TaskType.Bt ? o = e.getExtraObject() : t.taskType === h.DownloadKernel.TaskType.Emule ? o = e.getExtraObject() : t.taskType === h.DownloadKernel.TaskType.Group ? o = e.getExtraObject() : (t.taskType, h.DownloadKernel.TaskType.Magnet), o.setUserData(I.TaskUserDataGUID.guidBirdKey, "birdKey", t.birdKey)), i = !0
            }
            return i
        }

        removeTask(e) {
            let t = this.getTaskFromTaskId(e);
            if (t) {
                if (t.getTaskAttribute(h.DownloadKernel.TaskAttribute.TaskType) === h.DownloadKernel.TaskType.Group) {
                    let e = t.getExtraObject(), i = e.getSubTaskCount();
                    for (let t = 0; t < i; ++t) {
                        let i = e.getSubTaskByIndex(t);
                        if (i) {
                            let e = i.getTaskAttribute(h.DownloadKernel.TaskAttribute.TaskId);
                            this.tasks.delete(e)
                        }
                    }
                }
            }
            this.tasks.delete(e), this.removeStartTask(e)
        }

        insertToCategoryView(e, t = h.DownloadKernel.TaskInsertReason.Unknown) {
            let i = h.DownloadKernel.CategroyViewID.Downloading;
            if (e.getTaskAttribute(h.DownloadKernel.TaskAttribute.RecycleTime) > 0) i = h.DownloadKernel.CategroyViewID.Recycle; else {
                let t = e.getTaskStatus();
                t !== h.DownloadKernel.TaskStatus.Succeeded && t !== h.DownloadKernel.TaskStatus.Seeding || (i = h.DownloadKernel.CategroyViewID.Completed)
            }
            let n = null, a = e.getTaskAttribute(h.DownloadKernel.TaskAttribute.CategoryId);
            if (n = void 0 !== a && a > -1 ? x.getCategoryView(a, i) : D.getCategoryViewFromId(i)) {
                let i = [];
                i.push(e), n.insertTask(i, t)
            }
        }

        taskStatusChanage(e) {
            if (this.isInitDkFinish) for (let t = 0; t < e.length; ++t) {
                let i = e[t];
                if (i.getTaskAttribute(h.DownloadKernel.TaskAttribute.GroupTaskId) > 0) {
                    let e = i, t = i.getTaskStatus();
                    t === h.DownloadKernel.TaskStatus.Succeeded || t === h.DownloadKernel.TaskStatus.Seeding ? e.onFinish() : t === h.DownloadKernel.TaskStatus.Stopped ? e.onStop() : t === h.DownloadKernel.TaskStatus.Failed && e.onFail()
                } else if (i.getType() === h.DownloadKernel.TaskType.Group) do {
                    let e = i.getExtraObject();
                    if (!e) break;
                    let t = e.getTaskStatus();
                    E.information("taskStatusChanage taskExtra.taskStatus:", t), t === h.DownloadKernel.TaskStatus.Succeeded || t === h.DownloadKernel.TaskStatus.Seeding ? this.onTaskFinish(i) : t === h.DownloadKernel.TaskStatus.Stopped ? this.onTaskStop(i) : t === h.DownloadKernel.TaskStatus.Failed && this.onTaskFailed(i)
                } while (0); else {
                    let e = i.getTaskStatus();
                    E.information("taskStatusChanage task.taskStatus:", e), e === h.DownloadKernel.TaskStatus.Succeeded || e === h.DownloadKernel.TaskStatus.Seeding ? this.onTaskFinish(i) : e === h.DownloadKernel.TaskStatus.Stopped ? this.onTaskStop(i) : e === h.DownloadKernel.TaskStatus.Failed && this.onTaskFailed(i)
                }
            }
            A.fireTaskEvent(h.DownloadKernel.TaskEventType.StatusChanged, e)
        }

        taskDetailChanage(e, t) {
            let i = new Map, n = [];
            e.forEach(e => {
                let t = e.getTaskAttribute(h.DownloadKernel.TaskAttribute.GroupTaskId);
                if (t < 1) n.push(e); else {
                    let n = i.get(t);
                    n || (n = [], i.set(t, n)), n.push(e)
                }
            }), n.length > 0 && A.fireTaskEvent(h.DownloadKernel.TaskEventType.DetailChanged, n, t)
        }

        loadTaskBaseCallback(e) {
            return n(this, void 0, void 0, function* () {
                let t = new Map;
                if (e) {
                    let i = [], n = [], a = [], o = new Map, r = new Map;
                    for (let s = 0; s < e.length; ++s) {
                        let l = e[s];
                        if (!l) continue;
                        if (-1 === l.recycleTime) continue;
                        l.taskStatus !== h.DownloadKernel.TaskStatus.Unkown && l.taskStatus !== h.DownloadKernel.TaskStatus.Failed && l.taskStatus !== h.DownloadKernel.TaskStatus.Succeeded && l.taskStatus !== h.DownloadKernel.TaskStatus.Seeding && (l.taskStatus = h.DownloadKernel.TaskStatus.Stopped);
                        let d = l.groupTaskId;
                        if (d > 0) {
                            let e = t.get(d);
                            e || (e = []), e.push(l), t.set(d, e)
                        }
                        let u = yield this.loadStorageTask(l);
                        if (u) {
                            if (u.getTaskAttribute(h.DownloadKernel.TaskAttribute.GroupTaskId) < 1) if (l.categoryId > -1) {
                                let e = u.getTaskStatus();
                                if (e === h.DownloadKernel.TaskStatus.Succeeded || e === h.DownloadKernel.TaskStatus.Seeding) {
                                    let e = r.get(l.categoryId);
                                    e || (e = [], r.set(l.categoryId, e)), e.push(u)
                                } else {
                                    let e = o.get(l.categoryId);
                                    e || (e = [], o.set(l.categoryId, e)), e.push(u)
                                }
                            } else {
                                if (u.getTaskAttribute(h.DownloadKernel.TaskAttribute.RecycleTime) > 0) a.push(u); else {
                                    let e = u.getTaskStatus();
                                    e === h.DownloadKernel.TaskStatus.Succeeded || e === h.DownloadKernel.TaskStatus.Seeding ? n.push(u) : i.push(u)
                                }
                            }
                        }
                    }
                    if (i.length > 0) {
                        let e = D.getCategoryViewFromId(h.DownloadKernel.CategroyViewID.Downloading);
                        e && e.insertTask(i, h.DownloadKernel.TaskInsertReason.LoadTaskBasic)
                    }
                    if (n.length > 0) {
                        let e = D.getCategoryViewFromId(h.DownloadKernel.CategroyViewID.Completed);
                        e && e.insertTask(n, h.DownloadKernel.TaskInsertReason.LoadTaskBasic)
                    }
                    if (a.length > 0) {
                        let e = D.getCategoryViewFromId(h.DownloadKernel.CategroyViewID.Recycle);
                        e && e.insertTask(a, h.DownloadKernel.TaskInsertReason.LoadTaskBasic)
                    }
                    for (let [e, t]of o) {
                        let i = x.getCategoryView(e, h.DownloadKernel.CategroyViewID.Downloading);
                        i ? i.insertTask(t, h.DownloadKernel.TaskInsertReason.LoadTaskBasic) : E.error("getCategoryView failed! categoryId:", e, ", categoryViewId:", h.DownloadKernel.CategroyViewID.Downloading)
                    }
                    for (let [e, t]of r) {
                        let i = x.getCategoryView(e, h.DownloadKernel.CategroyViewID.Completed);
                        i ? i.insertTask(t, h.DownloadKernel.TaskInsertReason.LoadTaskBasic) : E.error("getCategoryView failed! categoryId:", e, ", categoryViewId:", h.DownloadKernel.CategroyViewID.Completed)
                    }
                }
                for (let [e, i]of t) {
                    let t = this.getTaskFromTaskId(e);
                    if (t) {
                        let e = t.getExtraObject();
                        if (e) {
                            let n = void 0, a = t.getTaskAttribute(h.DownloadKernel.TaskAttribute.SavePath);
                            a && (n = a.length + 1);
                            for (let t = 0; t < i.length; ++t) {
                                let a = i[t], o = a.taskId, r = this.getTaskFromTaskId(o);
                                r && (this.setGroupTaskRelativePath(r, a.savePath, n), e.addSubTask(r))
                            }
                        }
                    }
                }
                this.eventContainer.fireEvent(u.NodeEventMesssageNS.eventTaskDataBaseLoadEnd), this.isLoadStorageFinish = !0
            })
        }

        setGroupTaskRelativePath(e, t, i) {
            if (e && t && i) {
                let n = t.substr(i, t.length);
                n ? n.length > 0 && (n += "\\") : n = "", e.updateTaskRelativePath(n)
            }
        }

        onTaskFinish(e) {
            let t = e.onFinish();
            if (!e.getTaskAttribute(h.DownloadKernel.TaskAttribute.Background)) {
                let t = e.getTaskAttribute(h.DownloadKernel.TaskAttribute.CategoryId), i = null;
                if (i = -1 === t ? D.getCategoryViewFromId(h.DownloadKernel.CategroyViewID.Downloading) : x.getCategoryView(t, h.DownloadKernel.CategroyViewID.Downloading)) {
                    let t = [];
                    t.push(e), i.removeTask(t)
                }
                if (0 === e.getTaskAttribute(h.DownloadKernel.TaskAttribute.RecycleTime)) {
                    let i = null;
                    if (i = -1 === t ? D.getCategoryViewFromId(h.DownloadKernel.CategroyViewID.Completed) : x.getCategoryView(t, h.DownloadKernel.CategroyViewID.Completed)) {
                        let t = [];
                        t.push(e), i.insertTask(t, h.DownloadKernel.TaskInsertReason.LoadTaskBasic)
                    }
                }
            }
            let i = e.getTaskAttribute(h.DownloadKernel.TaskAttribute.TaskId);
            return this.removeStartTask(i), t
        }

        onTaskStop(e) {
            let t = e.onStop(), i = e.getTaskAttribute(h.DownloadKernel.TaskAttribute.TaskId);
            return this.removeStartTask(i), t
        }

        onTaskFailed(e) {
            let t = e.onFail(), i = e.getTaskAttribute(h.DownloadKernel.TaskAttribute.TaskId);
            return this.removeStartTask(i), t
        }

        moveTaskFiles(e, t, i, n) {
            return a.ipcRenderer.send(y.ThunderChannelList.channelRMFileMove, e, t, i), new Promise(e => {
                a.ipcRenderer.once(y.ThunderChannelList.channelMRFileMoveResult, (t, n, a, o, r) => {
                    o === i && (n ? r && (n = !1) : 2 !== a && 124 !== a || (n = !0), e(n))
                })
            })
        }

        moveTask(e, t, i) {
            return n(this, void 0, void 0, function* () {
                let n = !1;
                do {
                    let a = this.tasks.get(e);
                    if (!a) break;
                    let r = void 0, s = void 0, l = a.getTaskStatus(),
                        u = a.getTaskAttribute(h.DownloadKernel.TaskAttribute.TaskType),
                        c = a.getTaskAttribute(h.DownloadKernel.TaskAttribute.SavePath);
                    if (yield C.SingleBtTaskNS.isSingleBtTask(a)) {
                        let e = void 0, i = a.getExtraObject(), n = i.getBtFileList();
                        for (let [, t]of n) {
                            e = t.getBtFileAttribute(h.DownloadKernel.BtFileAttribute.FileName);
                            break
                        }
                        let u = o.join(c, e), f = i.getInfoId() + ".torrent", g = o.join(c, f);
                        if (g += "\r\n", l === h.DownloadKernel.TaskStatus.Succeeded || l === h.DownloadKernel.TaskStatus.Seeding) r = (u += "\r\n") + g; else {
                            let e = u + ".bt.xltd";
                            (yield d.FileSystemAWNS.existsAW(e)) || (e = u + ".bt.td"), r = (e += "\r\n") + g
                        }
                        s = t
                    } else {
                        let f = a.getTaskAttribute(h.DownloadKernel.TaskAttribute.TaskName), g = void 0,
                            p = yield C.SingleBtTaskNS.getCorrectSingleBtFolder(a);
                        g = p ? o.join(c, p) : o.join(c, f);
                        let v = o.join(t, f);
                        if (l === h.DownloadKernel.TaskStatus.Succeeded || l === h.DownloadKernel.TaskStatus.Seeding) if (u === h.DownloadKernel.TaskType.P2sp || u === h.DownloadKernel.TaskType.Emule) r = g, s = v; else if (u === h.DownloadKernel.TaskType.Bt) {
                            if (p) {
                                let e = a.getExtraObject().getInfoId() + ".torrent", t = o.join(c, e);
                                r = g + "\r\n" + (t += "\r\n")
                            } else r = g;
                            s = (yield d.FileSystemAWNS.existsAW(v)) ? t : v
                        } else u === h.DownloadKernel.TaskType.Group && (n = yield this.moveGroupTask(e, t, i)); else if (u === h.DownloadKernel.TaskType.P2sp) {
                            r = g + ".xltd\r\n" + (g + ".xltd.cfg\r\n"), s = t
                        } else if (u === h.DownloadKernel.TaskType.Emule) {
                            r = g + ".emule.xltd\r\n" + (g + ".xlemule.cfg\r\n"), s = t
                        } else if (u === h.DownloadKernel.TaskType.Bt) {
                            if (p) {
                                let e = a.getExtraObject().getInfoId() + ".torrent", t = o.join(c, e);
                                r = g + "\r\n" + (t += "\r\n")
                            } else r = g;
                            s = (yield d.FileSystemAWNS.existsAW(v)) ? t : v
                        } else u === h.DownloadKernel.TaskType.Group && (n = yield this.moveGroupTask(e, t, i))
                    }
                    void 0 !== r && void 0 !== s && (a.setTaskMovingState(!0), n = yield this.moveTaskFiles(r, s, e, u), a.setTaskMovingState(!1)), n && u !== h.DownloadKernel.TaskType.Group && (a.setSavePath(t), i && this.startTask(e), N.showNotify(k.ToastNotifyManagerNS.notifyIdTaskOperatorMoveTask, T.ToastNotifyItemType.GreenNotify, "移动成功", 3e3))
                } while (0);
                return n
            })
        }

        moveGroupTask(e, t, a) {
            return n(this, void 0, void 0, function* () {
                let n = !1;
                do {
                    let r = this.tasks.get(e);
                    if (!r) break;
                    let s = r.getTaskAttribute(h.DownloadKernel.TaskAttribute.TaskType);
                    if (s !== h.DownloadKernel.TaskType.Group) break;
                    let l = r.getExtraObject();
                    if (!l) break;
                    if (!l.getSubTaskByIndex(0)) break;
                    let u = r.getTaskAttribute(h.DownloadKernel.TaskAttribute.SavePath),
                        c = r.getTaskAttribute(h.DownloadKernel.TaskAttribute.TaskName), f = o.join(u, "*"),
                        g = o.join(t, c);
                    if (r.setTaskMovingState(!0), n = yield this.moveTaskFiles(f, g, e, s), r.setTaskMovingState(!1), n) {
                        let t = l.getSubTaskCount();
                        for (let e = 0; e < t; ++e) {
                            let t = l.getSubTaskByIndex(e);
                            if (t) {
                                let e = g, i = t.getTaskAttribute(h.DownloadKernel.TaskAttribute.SavePath);
                                if (i === u) ; else if (i.length > u.length && i.substr(0, u.length) === u) {
                                    let t = i.slice(u.length);
                                    "\\" === t[0] && (t = t.slice(1), e = o.join(g, t))
                                }
                                t.setSavePath(e)
                            }
                        }
                        yield d.FileSystemAWNS.rmdirAW(u), r.setSavePath(g), a && this.startTask(e), N.showNotify(k.ToastNotifyManagerNS.notifyIdTaskOperatorMoveTask, T.ToastNotifyItemType.GreenNotify, "移动成功", 3e3);
                        const {TaskUserDataGUID: n} = yield Promise.resolve().then(() => i(51));
                        let s = l.getUserData(n.guidNotSavePath, "notSavePath");
                        if (s && (u = o.normalize(u), s = o.normalize(s), 0 === u.indexOf(s))) {
                            let e = s.indexOf(":\\");
                            if (-1 !== e) {
                                let t = s.substr(0, e + ":\\".length);
                                t && d.FileSystemAWNS.deleteEmptySubDirs(s, t).catch()
                            }
                        }
                    }
                } while (0);
                return n
            })
        }

        splitLastChar(e) {
            let t = e;
            return c.Common.isThunderPrivateUrl(e) && (e.lastIndexOf("==") === e.length - 2 ? t = e.substr(0, e.length - 2) : e.lastIndexOf("=") === e.length - 1 && (t = e.substr(0, e.length - 1))), t
        }

        removeStartTask(e) {
            let t = this.startTasks.indexOf(e);
            t > -1 && this.startTasks.splice(t, 1)
        }

        createGroupTask(e, t, i, a) {
            return n(this, void 0, void 0, function* () {
                let n = !1, o = f.ThunderKernel.beginTransaction();
                do {
                    if (e.createGroupTask(!1, t, i, a), !e.getExtraObject()) break;
                    yield this.createBatchTask(i.subTaskList, e), n = !0
                } while (0);
                return f.ThunderKernel.commitTransaction(o), n
            })
        }

        getTaskName(e, t, i, a) {
            return n(this, void 0, void 0, function* () {
                let n = "";
                for (; ;) {
                    if (e === h.DownloadKernel.TaskType.P2sp || e === h.DownloadKernel.TaskType.Emule) {
                        let e = o.extname(i), t = o.basename(i, e);
                        n = 0 === a ? i : t + "(" + a.toString() + ")" + e
                    } else n = 0 === a ? i : i + "(" + a.toString() + ")";
                    if (!(yield d.FileSystemAWNS.existsAW(o.join(t, n)))) break;
                    ++a
                }
                return {newName: n, index: a}
            })
        }

        isOtherPrivateSpaceTask(e) {
            let t = x.getCurrentPrivateCategory(), i = t ? t.getUserName() : "", n = e.getUserName();
            return !(!n || "" === n || i === n)
        }

        notifySDKCrash() {
            S.MessageBox.confirm({
                title: "迅雷下载引擎发生故障!",
                type: S.MessageBox.ConfirmType.Error,
                content: "迅雷开发者会在最新版本中修复各种故障<br>因此建议您尝试“检查更新”<br>如果您已安装最新版本,请尝试“重启电脑”",
                okText: "检查更新",
                cancelText: "重启电脑"
            }).then(e => {
                e.action === b.MessageBoxNS.Action.OK ? P.startManualUpdateWithUI() : e.action === b.MessageBoxNS.Action.Cancel && P.rebootdMachine()
            }).catch()
        }

        downloadSdkInited() {
            return n(this, void 0, void 0, function* () {
                if (this.isInitDkFinish) return;
                return new Promise(e => n(this, void 0, void 0, function* () {
                    this.eventContainer.attachOnceListener(u.NodeEventMesssageNS.eventDownloadKernelInitEnd, () => {
                        e()
                    })
                }))
            })
        }
    }

    t.TaskManager = M, function (e) {
        const t = new M;
        e.getTaskManager = function () {
            return t
        }
    }(t.DownloadKernelTaskManager || (t.DownloadKernelTaskManager = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(0).default.getLogger("async-remote-call"), o = i(399), r = i(19), s = i(4);
    t.asyncRemoteCall = new class extends r.EventEmitter {
        constructor() {
            super(), this.mapObj = new Map, this.mapObjIniting = new Map, "renderer" !== process.type && a.error('can not import "renderer-process-call" module in non-renderer process', process.type)
        }

        getAppName() {
            return n(this, void 0, void 0, function* () {
                if (void 0 === this.appName) {
                    let e = yield this.getApp();
                    this.appName = yield e.getName()
                }
                return this.appName
            })
        }

        getAppVersion() {
            return n(this, void 0, void 0, function* () {
                if (void 0 === this.appVersion) {
                    let e = yield this.getApp();
                    this.appVersion = yield e.getVersion()
                }
                return this.appVersion
            })
        }

        getProcess() {
            return n(this, void 0, void 0, function* () {
                return o.global.process.__resolve()
            })
        }

        getIpcMain() {
            return n(this, void 0, void 0, function* () {
                return this.getCurrentObject("ipcMain")
            })
        }

        getDialog() {
            return n(this, void 0, void 0, function* () {
                return this.getCurrentObject("dialog")
            })
        }

        getApp() {
            return n(this, void 0, void 0, function* () {
                return this.getCurrentObject("app")
            })
        }

        getShell() {
            return n(this, void 0, void 0, function* () {
                return this.getCurrentObject("shell")
            })
        }

        getMenu() {
            return n(this, void 0, void 0, function* () {
                return this.getCurrentObject("Menu")
            })
        }

        getScreen() {
            return n(this, void 0, void 0, function* () {
                return this.getCurrentObject("screen")
            })
        }

        getBrowserWindow() {
            return n(this, void 0, void 0, function* () {
                return this.getCurrentObject("BrowserWindow")
            })
        }

        getGlobalShortcut() {
            return n(this, void 0, void 0, function* () {
                return this.getCurrentObject("globalShortcut")
            })
        }

        getCurrentWebContents() {
            return n(this, void 0, void 0, function* () {
                let e = this.mapObj.get("currentWebContents");
                return void 0 === e && (this.mapObjIniting.get("currentWebContents") ? e = yield new Promise(e => n(this, void 0, void 0, function* () {
                    this.on("OnInitCurrentWebContents", t => {
                        e(t)
                    })
                })) : (this.mapObjIniting.set("currentWebContents", !0), e = yield o.getCurrentWebContents().__resolve(), this.mapObjIniting.set("currentWebContents", !1), this.emit("OnInitCurrentWebContents", e), this.listeners("OnInitCurrentWebContents").forEach(e => {
                    this.removeListener("OnInitCurrentWebContents", e)
                })), this.mapObj.set("currentWebContents", e)), e
            })
        }

        getCurrentWindow() {
            return n(this, void 0, void 0, function* () {
                let e = this.mapObj.get("currentWindow");
                return void 0 === e && (this.mapObjIniting.get("currentWindow") ? e = yield new Promise(e => n(this, void 0, void 0, function* () {
                    this.on("OnInitCurrentWindow", t => {
                        e(t)
                    })
                })) : (this.mapObjIniting.set("currentWindow", !0), e = yield o.getCurrentWindow().__resolve(), this.mapObjIniting.set("currentWindow", !1), this.emit("OnInitCurrentWindow", e), this.listeners("OnInitCurrentWindow").forEach(e => {
                    this.removeListener("OnInitCurrentWindow", e)
                })), this.mapObj.set("currentWindow", e)), e
            })
        }

        getCurrentObject(e) {
            return n(this, void 0, void 0, function* () {
                let t = this.mapObj.get(e);
                return s.isNullOrUndefined(t) && (this.mapObjIniting.get(e) ? t = yield new Promise(t => n(this, void 0, void 0, function* () {
                    this.on(e, e => {
                        t(e)
                    })
                })) : (this.mapObjIniting.set(e, !0), t = yield o.electron[e].__resolve(), this.mapObjIniting.set(e, !1), this.emit(e, t), this.listeners(e).forEach(t => {
                    this.removeListener(e, t)
                })), this.mapObj.set(e, t)), t
            })
        }
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        e.eventPluginLoderPluginReady = "event_plugin_loader_plugin_ready", e.eventDownloadItemActive = "event_download_item_active", e.eventDownloadItemChosen = "event_download_item_chosen", e.eventDetailSwitch2Index = "event_detail_switch_to_index", e.eventDownloadSwitchCategory = "event_download_switch_category", e.evetDownloadMove2Tail = "event_download_move_to_tail", e.eventBringMainWindowToTop = "event_bring_main_window_to_top", e.eventDownloadContextMenuClick = "event_download_context_menu_click", e.eventOnCommand = "event_on_command", e.eventOnCommandline = "event_on_command_line", e.eventDownloadKernelInitEnd = "event_dk_init_end", e.eventDownloadSDKRecover = "event_sdk_crash_recover", e.eventTaskDataBaseLoadEnd = "event_dk_task_data_base_load_end", e.eventGlobalDownloadSpeedChanged = "event_dk_global_download_speed_changed", e.eventGlobalUploadSpeedChanged = "event_dk_global_upload_speed_changed", e.eventConfigInitFinished = "event_config_init_finished", e.eventConfigValueChanged = "event_config_value_changed", e.eventBHOConfigInitFinished = "event_bho_config_init_finished", e.eventBHOConfigValueChanged = "event_bho_config_value_changed", e.eventMemoryConfigValueChanged = "event_memory_config_value_changed", e.eventShowHomePage = "event_show_home_page", e.eventShowSearchTaskPage = "event_show_searchtask_page", e.eventConfigBrowserInitFinished = "event_config_browser_init_finished", e.eventDownloadContextMenuPopup = "event_download_context_menu_popup", e.eventDownloadContextMenuEnd = "event_download_context_menu_end", e.eventEmbeddedBrowserWndClick = "event_embedded_browser_wnd_click", e.eventLoginWndCreate = "event_login_wnd_create", e.eventLoginWndShow = "event_login_wnd_show", e.eventLoginWndShowResult = "event_login_wnd_show_result", e.eventLoginWndClose = "event_login_wnd_close", e.eventRetryLoginWndCreate = "event_retry_login_wnd_create", e.eventModifierUserinfoWndCreate = "event_modifier-userinfo-wnd-create", e.eventBrowserNumberChange = "event_browser_number_change", e.eventUploadConfigInitFinished = "event_upload_config_init_finished", e.eventUploadConfigValueChanged = "event_upload_config_value_changed"
    }(t.NodeEventMesssageNS || (t.NodeEventMesssageNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(17), o = i(2), r = i(0), s = i(5), l = i(35), d = r.default.getLogger("Thunder.Util"),
        u = "Thunder Network\\Thunder7.9\\";

    function c(e) {
        let t = e;
        return 0 === e.indexOf('"') && e.lastIndexOf('"') === e.length - 1 ? t = e.substring(1, e.length - 1) : 0 === e.indexOf("'") && e.lastIndexOf("'") === e.length - 1 && (t = e.substring(1, e.length - 1)), t
    }

    !function (e) {
        function t() {
            let e = l.ThunderHelper.getSystemTempPath(), t = l.ThunderHelper.getLogicalDriveStrings(), i = 0;
            for (let n = 0; n < t.length; n++) {
                if (l.ThunderHelper.getDriveType(t[n]) === l.ThunderHelper.DriverType.DRIVE_FIXED) {
                    let a = l.ThunderHelper.getDriveInfo(t[n]);
                    i < a.freeBytes && t[n] !== e && (i = a.freeBytes, e = t[n])
                }
            }
            return e.substring(0, 1) + ":\\迅雷下载"
        }

        function r(e) {
            let t = (e.style.webkitTransform || getComputedStyle(e, "").getPropertyValue("-webkit-transform") || e.style.transform || getComputedStyle(e, "").getPropertyValue("transform")).match(/\-?[0-9]+\.?[0-9]*/g);
            return {x: parseInt(t && (t[12] || t[4]) || "0", 10), y: parseInt(t && (t[13] || t[5]) || "0", 10)}
        }

        e.formatSize = function (e, t) {
            0 === t || (t = t || 2);
            let i = "0B";
            if ("number" == typeof e && e > 0) {
                let n = ["B", "KB", "MB", "GB", "TB"], a = 0, o = e;
                for (; o >= 1e3 && !(a >= 4);) o /= 1024, a += 1;
                i = -1 === String(o).indexOf(".") ? o + n[a] : o.toFixed(t) + n[a]
            }
            return i
        }, e.formatSizeCustom = function (e, t = 2, i = 5) {
            let n = "0B";
            if ("number" == typeof e && e > 0) {
                let a = ["B", "KB", "MB", "GB", "TB"], o = 0, r = e;
                for (; r >= 1e3 && !(o >= 4);) r /= 1024, o += 1;
                if (-1 === String(r).indexOf(".")) n = r + a[o]; else {
                    let e = r.toFixed(t);
                    e.length <= i ? n = "KB" !== a[o] && "MB" !== a[o] || 1 === t ? e + a[o] : r.toFixed(1) + a[o] : ("." === (e = e.substr(0, i))[i - 1] && (e = e.substr(0, i - 1)), n = e + a[o])
                }
            }
            return n
        }, e.isDigital = function (e) {
            let t = !1;
            return /^\d+$/.test(e) && (t = !0), t
        }, e.isAlpha = function (e) {
            let t = !1;
            return /[A-Za-z]/.test(e) && (t = !0), t
        }, e.isUpperCase = function (e) {
            let t = !1;
            return /[A-Z]/.test(e) && (t = !0), t
        }, e.isLowerCase = function (e) {
            let t = !1;
            return /[a-z]/.test(e) && (t = !0), t
        }, e.isChinese = function (e) {
            let t = !1;
            return /[\u4E00-\u9FA5]/.test(e) && (t = !0), t
        }, e.replaceNonDigital = function (e) {
            return e.replace(/[^\d]/g, "")
        }, e.replaceNonAlpha = function (e) {
            return e.replace(/[^A-Za-z]/g, "")
        }, e.replaceNonWord = function (e) {
            return e.replace(/[^\W]/g, "")
        }, e.getDefaultDownloadDir = t, e.getMaxFreeDriver = function () {
            return t().substring(0, 1)
        }, e.deepCopy = function (e) {
            let t = JSON.stringify(e), i = null;
            try {
                i = JSON.parse(t)
            } catch (e) {
                d.warning(e)
            }
            return i
        }, e.swap = function (e, t, i) {
            do {
                if (t < 0 || t >= e.length) break;
                if (i < 0 || i >= e.length) break;
                if (t === i) break;
                e[t] = e.splice(i, 1, e[t])[0]
            } while (0);
            return e
        }, e.compareNocase = function (e, t) {
            let i = !1;
            do {
                if (void 0 === e && void 0 === t) {
                    i = !0;
                    break
                }
                if (void 0 === e || void 0 === t) break;
                if ("string" != typeof e || "string" != typeof t) break;
                i = e.toLowerCase() === t.toLowerCase()
            } while (0);
            return i
        }, e.parseCommandLine = function (e) {
            let t = 0, i = "", n = !1, a = [], o = e.length;
            for (let r = 0; r < o; r++) {
                let s = e[r];
                if ('"' !== s && "'" !== s || ("" === i ? (n = !0, i = s) : i === s && (n = !1, i = "")), " " !== s || n || r === o - 1) {
                    if (r === o - 1) {
                        let i = e.substring(t);
                        "" !== i.trim() && a.push(c(i))
                    }
                } else {
                    let i = e.substring(t, r);
                    "" !== i.trim() && a.push(c(i)), t = r + 1
                }
            }
            return a
        }, e.getThunderTempPath = function (e, t) {
            return n(this, void 0, void 0, function* () {
                const n = yield Promise.resolve().then(() => i(57));
                let a = o.join(n.tmpdir(), u);
                return t && (a = o.join(a, t)), void 0 !== e && e && (yield s.FileSystemAWNS.mkdirsAW(a)), a
            })
        }, e.setQueryString = function (e, t) {
            return Object.keys(t).forEach((i, n) => {
                e += 0 === n ? "?" : "&", e += `${i}=${t[i]}`
            }), e
        }, e.getQueryString = function (e, t) {
            return e && t && e.match(new RegExp(`(^${t}|[?|&]${t})=([^&#]+)`)) ? RegExp.$2 : ""
        }, e.isClipboardTextFormatAvailable = function () {
            let e = !1, t = a.clipboard.availableFormats();
            for (let i of t) if ("text/plain" === i) {
                e = !0;
                break
            }
            return e
        }, e.keywordsHighLight = function (e, t, i) {
            if (!e) return "";
            if (!t) return e;
            if (0 === e.length) return e;
            if (0 === t.length) return e;
            let n = /\\/, a = t.split(" ");
            if (0 === (a = a.filter(e => e.trim().length > 0)).length) return e;
            for (let t = 0; t < a.length; t++) if (a[t].search(n) > 0) return e;
            i = void 0 === i || null === i ? "#FF0000" : i;
            let o = "", r = ["\\[", "\\^", "\\*", "\\(", "\\)", "\\|", "\\?", "\\$", "\\.", "\\+"], s = "", l = "|";
            for (let e = 0; e < a.length; e++) {
                for (let t = 0; t < r.length; t++) {
                    let i = new RegExp(r[t], "g");
                    a[e] = a[e].replace(i, r[t])
                }
                e === a.length - 1 && (l = ""), s = s.concat(a[e], l)
            }
            let d = new RegExp(s, "gi");
            return o = e.replace(d, e => '<span style= "color:' + i + '">' + e + "</span>")
        }, e.isDef = function (e) {
            return void 0 !== e && null !== e
        }, e.isUndef = function (e) {
            return void 0 === e || null === e
        }, e.setStyle = function (e, t) {
            Object.entries(t).forEach(([t, i]) => {
                e.style[t] = i
            })
        }, e.setCSSProperties = function (e, t) {
            Object.entries(t).forEach(([t, i]) => {
                e.style.setProperty(t, i)
            })
        }, e.versionCompare = function (e, t) {
            let i = e.split("."), n = t.split("."), a = 0;
            for (let e = 0; e < i.length; e++) {
                if (Number(i[e]) - Number(n[e]) > 0) {
                    a = 1;
                    break
                }
                if (Number(i[e]) - Number(n[e]) < 0) {
                    a = -1;
                    break
                }
            }
            return a
        }, e.throttle = function (e, t) {
            let i, n = 0;
            return (...a) => {
                const o = Date.now();
                clearTimeout(i), o - n > t ? (e(...a), n = o) : i = setTimeout(() => {
                    e(...a), n = o
                }, t)
            }
        }, e.debounce = function (e, t) {
            let i = null;
            return (...n) => {
                i && clearTimeout(i), i = setTimeout(() => {
                    e(...n)
                }, t)
            }
        }, e.getElementFixed = function (e) {
            let t = e.offsetLeft, i = e.offsetTop, n = e.offsetParent;
            for (; null !== n;) {
                let e = r(n);
                t += n.offsetLeft + e.x, i += n.offsetTop + e.y, n = n.offsetParent
            }
            return {x: t, y: i}
        }, e.escapeHTML = function (e) {
            return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&apos;")
        }, e.unescapeHTML = function (e) {
            return e.replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/&amp;/g, "&").replace(/&quot;/g, '"').replace(/&apos;/g, "'")
        }, e.isValidPath = function (e) {
            let t = !1;
            do {
                let i = "", n = "";
                if (/^[a-zA-Z]:\\/.test(e)) i = e.slice(3); else {
                    if (0 !== e.indexOf("\\\\")) break;
                    {
                        let t = e.indexOf("\\", 2);
                        if (-1 === t || t === e.length - 1) break;
                        if ("" === (n = (i = e.slice(2)).substr(0, t - 2))) break
                    }
                }
                if (/[\*\"<>\?:\|]/i.test(i)) break;
                if (e.length > 256) break;
                if ("" === n) {
                    t = !0;
                    break
                }
                let a = n.indexOf(".ipv6-literal.net");
                -1 !== a ? (-1 !== (a = (n = n.substr(0, a)).indexOf("%")) && (n = n.substr(0, a)), n = n.replace(/\-/g, ":"), /^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/.test(n) && (t = !0)) : /(?=(\b|\D))(((\d{1,2})|(1\d{1,2})|(2[0-4]\d)|(25[0-5]))\.){3}((\d{1,2})|(1\d{1,2})|(2[0-4]\d)|(25[0-5]))(?=(\b|\D))/.test(n) && (t = !0)
            } while (0);
            return t
        };
        let h = void 0;

        function f(e, t = "normal 12px sans-serif") {
            h || (h = document.createElement("canvas"));
            let i = h.getContext("2d");
            return i.font = t, i.measureText(e).width
        }

        function g(e, t, i = "normal 12px sans-serif", n = 1) {
            function a(e, t, n, o, r) {
                let s = -1;
                do {
                    if (e > t) {
                        s = t;
                        break
                    }
                    let l = Math.round((e + t) / 2), d = f(`${n.substr(0, l)}...${o}`, i);
                    if (r === d) {
                        s = l;
                        break
                    }
                    if (r > d) {
                        if (Math.round(r) === Math.round(d)) {
                            s = l;
                            break
                        }
                        s = a(l + 1, t, n, o, r)
                    } else if (d > r) {
                        if (Math.round(r) === Math.round(d)) {
                            s = l - 1;
                            break
                        }
                        s = a(e, l - 1, n, o, r)
                    }
                } while (0);
                return s
            }

            let r = e;
            do {
                let s = t.offsetWidth * n;
                if (s > f(e, i)) break;
                let l = o.extname(e);
                "" !== l && (l = l.substring(1));
                let d = e.substr(0, e.length - l.length - 1);
                if (!d) break;
                let u = a(0, d.length, d, l, s);
                if (-1 === u) break;
                r = `${d.substr(0, u - 2 * (n - 1))}...${l}`
            } while (0);
            return r
        }

        e.getTextWidth = f, e.getOmitName = g, e.getOmitNameMultiLine = function (e, t, i) {
            return g(e, t, "normal 12px microsoft yahei", 2)
        }, e.setTimeoutAw = function (e, t) {
            return new Promise((i, n) => {
                setTimeout(() => {
                    t && t(), i()
                }, e)
            })
        }
    }(t.ThunderUtil || (t.ThunderUtil = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});

    class n {
        constructor(e, t, i = !1) {
            this.cookie = null, this.once = !1, this.callback = null, this.ref = 0, this.callback = e, this.cookie = t, this.once = i, this.ref = 1
        }

        fire(e, ...t) {
            return "function" == typeof this.callback && this.callback(e, ...t)
        }

        compare(e) {
            return this.cookie === e
        }

        addRef() {
            this.ref++
        }

        release() {
            return this.ref--, this.ref <= 0
        }
    }

    class a {
        constructor() {
            this.cookie = 0, this.listeners = new Map
        }

        attachTaskEvent(e, t) {
            this.cookie++;
            let i = new n(t, this.cookie, !1), a = this.listeners.get(e);
            return a || (a = []), a.push(i), this.listeners.set(e, a), this.cookie
        }

        attachTaskEventOnce(e, t) {
            this.cookie++;
            let i = new n(t, this.cookie, !0), a = this.listeners.get(e);
            return a || (a = []), a.push(i), this.listeners.set(e, a), this.cookie
        }

        detachTaskEvent(e, t) {
            let i = this.listeners.get(e);
            if (i) for (let e = 0; e < i.length; ++e) {
                let n = i[e];
                if (n.compare(t)) {
                    n.release() && i.splice(e, 1);
                    break
                }
            }
        }

        fireTaskEvent(e, ...t) {
            let i = this.listeners.get(e);
            if (i) {
                let n = [], a = i.length, o = 0;
                for (; o < a;) {
                    let r = i[o];
                    r.addRef();
                    let s = r.fire(e, ...t);
                    r.release() ? (i.splice(o, 1), --a) : (++o, r.once && s && n.push(r))
                }
                for (let t = 0; t < n.length; t++) {
                    let i = n[t];
                    this.detachTaskEvent(e, i.cookie)
                }
            }
        }
    }

    t.EventManager = a, function (e) {
        const t = new a;
        e.getEventManager = function () {
            return t
        }
    }(t.DownloadKernelEventManager || (t.DownloadKernelEventManager = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(4), a = i(103), o = i(104), r = i(64), s = i(298);
    !function (e) {
        let t;
        !function (e) {
            e[e.Unknown = -1] = "Unknown", e[e.Success = 0] = "Success", e[e.FunctionNotExist = 1] = "FunctionNotExist", e[e.ParamaterError = 2] = "ParamaterError", e[e.CallFailed = 3] = "CallFailed"
        }(t = e.NativeCallErrorCode || (e.NativeCallErrorCode = {}));

        class i {
            constructor(e, t, i) {
                this.maxId = e, this.minId = t, this.invalidId = i
            }

            generateId() {
                return this.minId === this.maxId ? this.invalidId : this.minId++
            }

            isInvalidId(e) {
                return e === this.invalidId
            }
        }

        e.IdGenerator = i;
        const l = 0;
        e.idGenerator = new i(1e7, 1, l);

        class d {
            constructor() {
                this.jsCallbacks = new Map, this.jsReturnCallbacks = new Map, this.eventJsCallbakcs = new Map, this.jsRegisterFunctions = new Map, this.targetCommunitorInfo = s.CommonIPCRenderer.rendererCommunicator.getCommunicatorInfoByContext(r.CommonIPCBase.mainRendererContext), this.bindMsgListeners(), this.notifyNativeCallReady()
            }

            CallNativeFunction(t, ...i) {
                do {
                    if (n.isNullOrUndefined(t) || 0 === t.length) {
                        a.error("funcName is empty");
                        break
                    }
                    a.information("funcName = ", t), this.printArgs(i);
                    let r = l;
                    for (let t = 0; t < i.length; ++t) if (n.isFunction(i[t])) {
                        let n = e.idGenerator.generateId(), a = i[t];
                        t === i.length - 1 ? (this.jsReturnCallbacks.set(n, a), r = n, i.pop()) : (this.jsCallbacks.set(n, a), i[t] = n)
                    }
                    s.CommonIPCRenderer.rendererCommunicator.sendMessageToRenderer(this.targetCommunitorInfo.id, {
                        name: o.CommonIPCMessage.msgNCCallNativeFunction,
                        args: [t, r].concat(i)
                    })
                } while (0)
            }

            AttachNativeEvent(t, i) {
                let o = void 0;
                do {
                    if (n.isNullOrUndefined(t) || 0 === t.length) {
                        a.error("eventName is empty");
                        break
                    }
                    if (n.isNullOrUndefined(i)) {
                        a.error("callback is empty");
                        break
                    }
                    let r = e.idGenerator.generateId();
                    if (e.idGenerator.isInvalidId(r)) {
                        a.error("id error");
                        break
                    }
                    if (this.eventJsCallbakcs.has(t)) this.eventJsCallbakcs.get(t).set(r, i); else {
                        let e = new Map;
                        e.set(r, i), this.eventJsCallbakcs.set(t, e)
                    }
                    o = r
                } while (0);
                return o
            }

            DetachNativeEvent(e, t) {
                do {
                    if (n.isNullOrUndefined(e) || 0 === e.length) {
                        a.error("eventName is empty");
                        break
                    }
                    if (n.isNullOrUndefined(t)) {
                        a.error("callback is empty");
                        break
                    }
                    if (!this.eventJsCallbakcs.has(e)) {
                        a.error(`event: ${e} doesnot have listener`);
                        break
                    }
                    if (!this.eventJsCallbakcs.get(e).has(t)) {
                        a.error(`event: ${e} doesnot have the listener of id=${t}`);
                        break
                    }
                    this.eventJsCallbakcs.get(e).delete(t)
                } while (0)
            }

            CheckNativeFunction(t, i) {
                do {
                    if (n.isNullOrUndefined(t) || 0 === t.length) {
                        a.error("funcName is empty");
                        break
                    }
                    if (n.isNullOrUndefined(i)) {
                        a.error("callback is empty");
                        break
                    }
                    a.information("funcName = ", t);
                    let r = e.idGenerator.generateId();
                    this.jsReturnCallbacks.set(r, i), s.CommonIPCRenderer.rendererCommunicator.sendMessageToRenderer(this.targetCommunitorInfo.id, {
                        name: o.CommonIPCMessage.msgNCCheckNativeFunction,
                        args: [t, r]
                    })
                } while (0)
            }

            RegisterJSFunction(e, i) {
                let o = t.ParamaterError;
                do {
                    if (n.isNullOrUndefined(e) || 0 === e.length) {
                        a.error("funcName is empty");
                        break
                    }
                    if (n.isNullOrUndefined(i)) {
                        a.error("jsFunc is empty");
                        break
                    }
                    this.jsRegisterFunctions.set(e, i), o = t.Success
                } while (0);
                return o
            }

            bindMsgListeners() {
                s.CommonIPCRenderer.rendererCommunicator.onMessage(o.CommonIPCMessage.msgNCCallJsFunctionById, e => {
                    this.handleCallJsFunctionById(e.msg.args)
                }), s.CommonIPCRenderer.rendererCommunicator.onMessage(o.CommonIPCMessage.msgNCCallJsFunctionByName, e => {
                    this.handleCallJsFunctionByName(e.msg.args)
                }), s.CommonIPCRenderer.rendererCommunicator.onMessage(o.CommonIPCMessage.msgNCNativeFireEvent, e => {
                    this.handleNativeFireEvent(e.msg.args)
                })
            }

            handleCallJsFunctionById(t) {
                do {
                    let i = t[0];
                    if (!n.isNumber(i)) {
                        a.error(`id error id = ${i}`);
                        break
                    }
                    if (e.idGenerator.isInvalidId(i)) {
                        a.error(`id = ${i} invalid`);
                        break
                    }
                    let o = null, r = 0;
                    if (this.jsCallbacks.has(i) && (r = 1, o = this.jsCallbacks.get(i)), this.jsReturnCallbacks.has(i) && (r = 2, o = this.jsReturnCallbacks.get(i)), 0 === r) {
                        a.error(`callbacks[${i}] is null`);
                        break
                    }
                    t.splice(0, 1), o.apply(null, t), 2 === r && this.jsReturnCallbacks.delete(i)
                } while (0)
            }

            handleCallJsFunctionByName(e) {
                do {
                    let t = e[0];
                    if (!n.isString(t)) {
                        a.error(`funcName error funcName = ${t}`);
                        break
                    }
                    if (!this.jsRegisterFunctions.has(t)) {
                        a.error(`jsRegisterFunctions[${t}] is null`);
                        break
                    }
                    e.splice(0, 1), this.jsRegisterFunctions.get(t).apply(null, e)
                } while (0)
            }

            handleNativeFireEvent(e) {
                do {
                    let t = e[0];
                    if (!n.isString(t)) {
                        a.warning(`eventName error eventName = ${t}`);
                        break
                    }
                    if (!this.eventJsCallbakcs.has(t)) {
                        a.warning(`eventJsCallbakcs[${t}] is null`);
                        break
                    }
                    e.shift(), this.eventJsCallbakcs.get(t).forEach((t, i, o) => {
                        a.information(`value = ${t}, key = ${i}, map = ${o}`), n.isNullOrUndefined(t) || t.apply(null, e)
                    })
                } while (0)
            }

            notifyNativeCallReady() {
                s.CommonIPCRenderer.rendererCommunicator.sendMessageToRenderer(this.targetCommunitorInfo.id, {
                    name: o.CommonIPCMessage.msgNCNativeCallReady,
                    args: [s.CommonIPCRenderer.rendererCommunicator.getCommunicatorInfo()]
                })
            }

            printArgs(e) {
                for (let t in e) a.information(`index ${t} = `, e[t])
            }
        }

        e.NativeCallImpl = d, e.nativeCall = new d
    }(t.NativeCallModule || (t.NativeCallModule = {}))
}, function (e, t) {
    e.exports = require("electron")
}, function (e, t, i) {
    e.exports = i(493)
}, function (e, t) {
    e.exports = require("events")
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(19), o = i(466), r = i(85), s = i(105);

    function l(e) {
        s.information("on object freeer"), global.__xdasIPCServerInstance.notifyFreer(e.client, e.callbackId)
    }

    let d = void 0;
    global.__xdasIPCServerInstance || (global.__xdasIPCServerInstance = new class extends a.EventEmitter {
        constructor() {
            super(), this.rid = 0, this.apis = {}, this.eventMap = {}, this.clientAliasMap = {}, this.retCallbackMap = {}, this.contextCallbackMap = {}, this.singleton = !1
        }

        registerFunctions(e) {
            do {
                if (!e) break;
                let t = void 0;
                for (let i in e) if (this.apis.hasOwnProperty(i)) {
                    t = i;
                    break
                }
                if (t) throw new Error(`try to coverd function ${t}`);
                this.apis = Object.assign({}, this.apis, e)
            } while (0)
        }

        start(e, t) {
            if (this.singleton) throw new Error("try to start server duplicate");
            this.singleton = !0, this.server = new o.Server, global.__xdasIPCServer = this.server, this.server.listen(void 0, t), e && this.registerFunctions(e), this.server.on("connect", e => {
                this.emit("connect", e)
            }), this.server.on("message", (e, t) => {
                do {
                    if ("attach_event" === e.action) {
                        this.attachEvent(e.name, t);
                        break
                    }
                    if ("detach_event" === e.action) {
                        this.detachEvent(e.name, t);
                        break
                    }
                    if ("broadcast" === e.action) {
                        if (e.__context && e.__context.name === r.serverContextName) throw new Error("client context must difference from server");
                        this.forwardEvent(e.name, e.__context, e.timestamp, ...e.args);
                        break
                    }
                    if ("call_remote_client_api" === e.action) {
                        this.callClientFunction(e, t);
                        break
                    }
                    if ("call_remote_context_by_id" === e.action) {
                        if (e.dst && this.clientAliasMap.hasOwnProperty(e.dst)) {
                            let t = this.clientAliasMap[e.dst];
                            t && this.callClientFunctionById(t, e.rid, ...e.args)
                        }
                        break
                    }
                    if ("call_client_by_id_callback" === e.action) {
                        this.fireRetCallback(e);
                        break
                    }
                    if ("check_client_function_callback" === e.action) {
                        this.fireRetCallback(e);
                        break
                    }
                    if ("remote_client_callback" === e.action) {
                        this.reply2Client(e, t);
                        break
                    }
                    if ("check_client_function_exist" === e.action) {
                        this.internalCheckClientFunction(e.dst, e.method).then(i => {
                            let n = this.getNow();
                            this.sendAdapter(t, {
                                success: !0,
                                rid: e.rid,
                                method: e.method,
                                data: i,
                                timestamp: e.timestamp ? e.timestamp.concat(n) : [].concat(n)
                            })
                        });
                        break
                    }
                    let i = this.getNow(), n = {
                        success: !1,
                        rid: e.rid,
                        method: e.method,
                        timestamp: e.timestamp ? e.timestamp.concat(i) : [].concat(i)
                    }, a = e.method;
                    do {
                        if ("register" === e.action) {
                            this.registerAlias(e, t, n), this.sendAdapter(t, n);
                            break
                        }
                        if ("client_context_freer" === e.action) {
                            if (e.dst && this.clientAliasMap.hasOwnProperty(e.dst)) {
                                let t = this.clientAliasMap[e.dst];
                                this.notifyFreer(t, e.rid)
                            }
                            break
                        }
                        if ("check_server_function_exist" === e.action) {
                            n.success = !0, n.data = !(!this.apis || !this.apis[a]), this.sendAdapter(t, n);
                            break
                        }
                        if ("check_client_exist" === e.action) {
                            n.success = !0, n.data = !1, e.dst && this.clientAliasMap.hasOwnProperty(e.dst) && (n.data = !0), this.sendAdapter(t, n);
                            break
                        }
                        if (!a) break;
                        if (!this.apis || !this.apis[a]) {
                            n.error = `${e.__context} try to call method '${a}' which is undefined`, this.sendAdapter(t, n);
                            break
                        }
                        let i = void 0, o = this.decodeParameter(e.args, t);
                        try {
                            i = this.apis[a].apply(null, [t, e.__context].concat(o))
                        } catch (e) {
                            n.error = e.message, this.sendAdapter(t, n);
                            break
                        }
                        if (i && i.then) {
                            i.then(e => {
                                n.data = e, n.success = !0, this.sendAdapter(t, n)
                            }).catch(e => {
                                n.error = e instanceof Error ? e.message : e, this.sendAdapter(t, n)
                            });
                            break
                        }
                        n.success = !0, n.data = i, this.sendAdapter(t, n)
                    } while (0)
                } while (0)
            }), this.server.on("end", e => {
                this.emit("end", e);
                for (let t in this.clientAliasMap) this.clientAliasMap[t] === e && delete this.clientAliasMap[t];
                for (let t in this.eventMap) this.detachEvent(t, e)
            })
        }

        fireClientEvent(e, ...t) {
            this.forwardEvent(e, {name: r.serverContextName}, void 0, ...t)
        }

        callClientFunctionById(e, t, ...i) {
            this.sendAdapter(e, {action: "call_client_by_id", rid: t, args: i})
        }

        callClientFunctionByIdAw(e, t, ...i) {
            return new Promise((n, a) => {
                {
                    let a = this.generateId(), o = (e, t) => {
                        n(e ? [null, e] : [t])
                    }, r = {s_rid: a, action: "call_client_by_id", rid: t, args: i};
                    this.retCallbackMap[a] = Object.assign({callback: o}, r), this.sendAdapter(e, r)
                }
            })
        }

        checkClientFunction(e, t) {
            return "string" == typeof e && (e = this.getFullAlias(e)), this.internalCheckClientFunction(e, t)
        }

        callClientFunctionByName(e, t, ...i) {
            return new Promise((n, a) => {
                do {
                    if (!e) {
                        n([null, null]);
                        break
                    }
                    let a = void 0;
                    if ("string" == typeof e) {
                        if (e = this.getFullAlias(e), !this.clientAliasMap.hasOwnProperty(e)) {
                            n([null, null]);
                            break
                        }
                        a = this.clientAliasMap[e]
                    } else a = e;
                    if (!a) {
                        n([null, null]);
                        break
                    }
                    let o = this.generateId(), s = (e, t, i) => {
                        n(e ? [null, i, e] : [t, i])
                    };
                    if (i) for (let e = 0; e < i.length; e++) i[e] = this.convertFunction2Id(i[e]);
                    let l = {s_rid: o, action: "call_client_api", args: i, src: r.serverContextName, method: t};
                    this.retCallbackMap[o] = Object.assign({callback: s}, l), this.sendAdapter(a, l)
                } while (0)
            })
        }

        isRemoteClientExist(e) {
            let t = !1;
            return this.clientAliasMap.hasOwnProperty(this.getFullAlias(e)) && (t = !0), t
        }

        getRemoteClient(e, t) {
            let i = null;
            do {
                if (!e) break;
                t || (t = this.server.getProductId());
                let n = `${t}-${e}`.toLowerCase();
                i = this.clientAliasMap[n]
            } while (0);
            return i
        }

        internalCheckClientFunction(e, t) {
            return n(this, void 0, void 0, function* () {
                return new Promise((i, n) => {
                    do {
                        if (!e) {
                            i(!1);
                            break
                        }
                        let n = void 0;
                        if ("string" == typeof e) {
                            if (!this.clientAliasMap.hasOwnProperty(e)) {
                                i(!1);
                                break
                            }
                            n = this.clientAliasMap[e]
                        } else n = e;
                        if (!n) {
                            i(!1);
                            break
                        }
                        let a = this.generateId(), o = (e, t) => {
                            i(!e && t)
                        }, r = {s_rid: a, action: "check_client_function", method: t};
                        this.retCallbackMap[a] = Object.assign({callback: o}, r), this.sendAdapter(n, r)
                    } while (0)
                })
            })
        }

        convertFunction2Id(e) {
            let t = e;
            if ("function" == typeof e) {
                let i = this.generateId();
                this.contextCallbackMap[i] = e, t = i
            } else if (e && "object" == typeof e) for (let t in e) {
                let i = e[t];
                if ("function" == typeof i) {
                    let n = this.generateId();
                    this.contextCallbackMap[n] = i, e[t] = n
                } else i && "object" == typeof i && (e[t] = this.convertFunction2Id(i))
            }
            return t
        }

        registerAlias(e, t, i) {
            do {
                if (!e) break;
                if (!e.alias) {
                    i.error = "register alias can not be empty";
                    break
                }
                if (this.clientAliasMap.hasOwnProperty(e.alias)) {
                    if (this.clientAliasMap[e.alias] === t) {
                        i.data = e.alias, i.success = !0;
                        break
                    }
                    i.error = "register failed cause alias is in use";
                    break
                }
                {
                    let n = void 0;
                    for (let e in this.clientAliasMap) if (this.clientAliasMap[e] === t) {
                        n = e;
                        break
                    }
                    if (n) {
                        i.data = n, i.error = `register failed cause already register by another alias ${n}`;
                        break
                    }
                    this.clientAliasMap[e.alias] = t, i.data = e.alias, i.success = !0;
                    break
                }
            } while (0)
        }

        callClientFunction(e, t) {
            do {
                if (!e) break;
                let i = e.dst, n = {rid: e.rid, method: e.method};
                if (!this.clientAliasMap.hasOwnProperty(i)) {
                    let e = `call remote function but dst client is not start or ended ${i}`;
                    s.error(e), n.error = e, n.action = "remote_client_callback", n.success = !1, this.sendAdapter(t, n);
                    break
                }
                let a = this.generateId(), o = this.clientAliasMap[i];
                n = Object.assign({
                    s_rid: a,
                    action: "call_client_api",
                    args: e.args,
                    src: e.src
                }, n), this.retCallbackMap[a] = Object.assign({remote: t}, n), this.sendAdapter(o, n)
            } while (0)
        }

        fireRetCallback(e) {
            do {
                let t = e.s_rid;
                if (void 0 === t || null === t) break;
                let i = this.retCallbackMap[t];
                if (!i) break;
                const n = i.callback;
                if (!n) break;
                e.success ? n(null, e.data) : n(e.error, e.data), delete this.retCallbackMap[t], s.information("free fireRetCallback", t)
            } while (0)
        }

        decodeParameter(e, t) {
            let i = e;
            do {
                if (!e) break;
                if ("object" != typeof e) break;
                let a = e["__nodeipc_callback_id__{A9C9D760-14E8-42CB-A3CB-9C0A0DDFD732}"];
                if (a) {
                    i = ((...e) => n(this, void 0, void 0, function* () {
                        return this.callClientFunctionByIdAw(t, a, ...e)
                    })), global.__xdasObjectLiftMonitor && global.__xdasObjectLiftMonitor.setObjectFreer(i, {
                        client: t,
                        callbackId: a
                    }, l);
                    break
                }
                for (let i in e) {
                    let n = e[i];
                    e[i] = this.decodeParameter(n, t)
                }
            } while (0);
            return i
        }

        notifyFreer(e, t) {
            this.sendAdapter(e, {action: "client_context_freer", rid: t})
        }

        reply2Client(e, t) {
            do {
                let i = e.s_rid;
                if (void 0 === i || null === i) break;
                let n = this.retCallbackMap[i];
                if (!n) break;
                if (e.src === r.serverContextName) {
                    const i = n.callback;
                    if (!i) break;
                    e.success ? i(null, this.decodeParameter(e.data, t), t) : i(e.error, e.data, t)
                } else {
                    let t = n.remote;
                    if (!t) break;
                    this.sendAdapter(t, e)
                }
                delete this.retCallbackMap[i]
            } while (0)
        }

        getNow() {
            return Date.now()
        }

        sendAdapter(e, t) {
            let i = this.getNow();
            t.timestamp = t.timestamp ? t.timestamp.concat(i) : [].concat(i), e.isInprocess() ? (s.information("send to client in process"), e.emit("message", t)) : e.send(t)
        }

        forwardEvent(e, t, i, ...n) {
            do {
                if (!this.eventMap.hasOwnProperty(e)) break;
                let a = this.eventMap[e];
                for (let o of a) this.sendAdapter(o, {
                    action: "fire_event",
                    name: e,
                    args: n,
                    __context: t,
                    timestamp: i
                })
            } while (0)
        }

        attachEvent(e, t) {
            {
                this.eventMap[e] || (this.eventMap[e] = []);
                let i = this.eventMap[e], n = !1;
                for (let a of i) if (a === t) {
                    s.information("server attachEvent attached", e), n = !0;
                    break
                }
                n || (this.eventMap[e].push(t), s.information("server attachEvent ", e))
            }
        }

        detachEvent(e, t) {
            do {
                if (!this.eventMap.hasOwnProperty(e)) break;
                let i = this.eventMap[e];
                for (let n = 0; n < i.length; n++) if (i[n] === t) {
                    this.eventMap[e].splice(n, 1), s.information("server detachEvent current eventMap", this.eventMap);
                    break
                }
            } while (0)
        }

        generateId() {
            return this.rid++
        }

        getFullAlias(e) {
            return `${this.server.getProductId()}-${e}`.toLowerCase()
        }
    }), d = global.__xdasIPCServerInstance, t.server = d
}, function (e, t, i) {
    "use strict";
    var n = i(48), a = i(405), o = i(407), r = i(87), s = i(302), l = i(408).http, d = i(408).https, u = i(44),
        c = i(410), h = i(506), f = i(301), g = i(406);
    e.exports = function (e) {
        return new Promise(function (t, i) {
            var p, v = e.data, m = e.headers;
            if (m["User-Agent"] || m["user-agent"] || (m["User-Agent"] = "axios/" + h.version), v && !n.isStream(v)) {
                if (Buffer.isBuffer(v)) ; else if (n.isArrayBuffer(v)) v = new Buffer(new Uint8Array(v)); else {
                    if (!n.isString(v)) return i(f("Data after transformation must be a string, an ArrayBuffer, a Buffer, or a Stream", e));
                    v = new Buffer(v, "utf-8")
                }
                m["Content-Length"] = v.length
            }
            var y = void 0;
            e.auth && (y = (e.auth.username || "") + ":" + (e.auth.password || ""));
            var k = u.parse(e.url), T = k.protocol || "http:";
            if (!y && k.auth) {
                var w = k.auth.split(":");
                y = (w[0] || "") + ":" + (w[1] || "")
            }
            y && delete m.Authorization;
            var C = "https:" === T, S = C ? e.httpsAgent : e.httpAgent, b = {
                path: o(k.path, e.params, e.paramsSerializer).replace(/^\?/, ""),
                method: e.method,
                headers: m,
                agent: S,
                auth: y
            };
            e.socketPath ? b.socketPath = e.socketPath : (b.hostname = k.hostname, b.port = k.port);
            var I, _ = e.proxy;
            if (!_ && !1 !== _) {
                var A = T.slice(0, -1) + "_proxy", D = process.env[A] || process.env[A.toUpperCase()];
                if (D) {
                    var x = u.parse(D);
                    if (_ = {host: x.hostname, port: x.port}, x.auth) {
                        var N = x.auth.split(":");
                        _.auth = {username: N[0], password: N[1]}
                    }
                }
            }
            if (_ && (b.hostname = _.host, b.host = _.host, b.headers.host = k.hostname + (k.port ? ":" + k.port : ""), b.port = _.port, b.path = T + "//" + k.hostname + (k.port ? ":" + k.port : "") + b.path, _.auth)) {
                var E = new Buffer(_.auth.username + ":" + _.auth.password, "utf8").toString("base64");
                b.headers["Proxy-Authorization"] = "Basic " + E
            }
            e.transport ? I = e.transport : 0 === e.maxRedirects ? I = C ? s : r : (e.maxRedirects && (b.maxRedirects = e.maxRedirects), I = C ? d : l), e.maxContentLength && e.maxContentLength > -1 && (b.maxBodyLength = e.maxContentLength);
            var P = I.request(b, function (n) {
                if (!P.aborted) {
                    clearTimeout(p), p = null;
                    var o = n;
                    switch (n.headers["content-encoding"]) {
                        case"gzip":
                        case"compress":
                        case"deflate":
                            o = o.pipe(c.createUnzip()), delete n.headers["content-encoding"]
                    }
                    var r = n.req || P, s = {
                        status: n.statusCode,
                        statusText: n.statusMessage,
                        headers: n.headers,
                        config: e,
                        request: r
                    };
                    if ("stream" === e.responseType) s.data = o, a(t, i, s); else {
                        var l = [];
                        o.on("data", function (t) {
                            l.push(t), e.maxContentLength > -1 && Buffer.concat(l).length > e.maxContentLength && i(f("maxContentLength size of " + e.maxContentLength + " exceeded", e, null, r))
                        }), o.on("error", function (t) {
                            P.aborted || i(g(t, e, null, r))
                        }), o.on("end", function () {
                            var n = Buffer.concat(l);
                            "arraybuffer" !== e.responseType && (n = n.toString("utf8")), s.data = n, a(t, i, s)
                        })
                    }
                }
            });
            P.on("error", function (t) {
                P.aborted || i(g(t, e, null, P))
            }), e.timeout && !p && (p = setTimeout(function () {
                P.abort(), i(f("timeout of " + e.timeout + "ms exceeded", e, "ECONNABORTED", P))
            }, e.timeout)), e.cancelToken && e.cancelToken.promise.then(function (e) {
                P.aborted || (P.abort(), i(e))
            }), n.isStream(v) ? v.pipe(P) : P.end(v)
        })
    }
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(17), o = i(12);
    !function (e) {
        let t;
        !function (e) {
            e.Info = "info", e.Warning = "warning", e.Error = "error", e.Success = "success"
        }(t = e.ConfirmType || (e.ConfirmType = {})), e.confirm = function (e, t = {}) {
            return n(this, void 0, void 0, function* () {
                let i = String(Math.random()).replace(/\D/, "");
                a.ipcRenderer.send("message-box-confirm-create", {options: e, dialogConf: t, boxId: i});
                let n = yield o.asyncRemoteCall.getIpcMain();
                return n.once(`message-box-init-${i}`, t => {
                    t.sender.send("message-box-init-reply", {popType: "confirm", options: e})
                }), new Promise(e => {
                    n.once(`message-box-resolve-${i}`, (t, i, n) => {
                        e({action: i, checkboxChecked: n})
                    })
                })
            })
        }, e.pop = function (e, t = {}) {
            return n(this, void 0, void 0, function* () {
                let i = String(Math.random()).replace(/\D/, ""), n = e.parentId;
                a.ipcRenderer.send("message-box-pop-create", {dialogConf: t, boxId: i, parentId: n});
                let r = yield o.asyncRemoteCall.getIpcMain();
                return r.once(`message-box-init-${i}`, t => {
                    t.sender.send("message-box-init-reply", {popType: "message-box", options: e})
                }), new Promise(e => {
                    r.once(`message-box-resolve-${i}`, (t, i, n) => {
                        e({action: i, formData: n})
                    })
                })
            })
        }, e.custom = function (e, t = {}, i = {}) {
            return n(this, void 0, void 0, function* () {
                let n = String(Math.random()).replace(/\D/, "");
                a.ipcRenderer.send("message-box-custom-create", {popType: e, dialogConf: i, boxId: n, options: t});
                let r = yield o.asyncRemoteCall.getIpcMain();
                return r.once(`message-box-init-${n}`, n => {
                    n.sender.send("message-box-init-reply", {popType: e, options: t, dialogConf: i})
                }), new Promise(e => {
                    r.once(`message-box-resolve-${n}`, (t, i, n) => {
                        e({action: i, args: n})
                    })
                })
            })
        }, e.customIndividuation = function (e, t = {}, i = {}) {
            return n(this, void 0, void 0, function* () {
                let n = String(Math.random()).replace(/\D/, "");
                return a.ipcRenderer.send("message-box-individuation-create", {
                    popType: e,
                    dialogConf: i,
                    boxId: n,
                    options: t
                }), (yield o.asyncRemoteCall.getIpcMain()).once(`message-box-init-${n}`, n => {
                    n.sender.send("message-box-init-reply", {popType: e, options: t, dialogConf: i})
                }), new Promise(e => {
                    a.ipcRenderer.once(`message-box-resolve-${n}`, (t, i, n) => {
                        e({action: i, args: n})
                    })
                })
            })
        }
    }(t.MessageBox || (t.MessageBox = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        e[e.Success = 0] = "Success", e[e.FunctionUnExist = 1] = "FunctionUnExist", e[e.ParamError = 2] = "ParamError", e[e.CallFailed = 3] = "CallFailed", e[e.NotAllowed = 4] = "NotAllowed"
    }(t.NativeFunctionErrorCode || (t.NativeFunctionErrorCode = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(57), o = i(17), r = i(12), s = i(514), l = i(2), d = i(4), u = i(0), c = i(5), h = i(34), f = i(26),
        g = i(58), p = i(6), v = i(13), m = i(515), y = i(109), k = i(19), T = i(7), w = i(413),
        C = p.default(l.join(__rootDir, "../bin/ThunderHelper.node")), S = u.default.getLogger("login-helper");
    !function (e) {
        let t;
        !function (e) {
            e[e.Success = 0] = "Success", e[e.UnKnown = -1] = "UnKnown", e[e.WrongParam = -2] = "WrongParam"
        }(t = e.CommonResultCodeType || (e.CommonResultCodeType = {}));
        e.loginUIHelper = new class {
            constructor() {
            }

            createLoginWnd(e, t, i, n, a) {
                o.ipcRenderer.send(v.NodeEventMesssageNS.eventLoginWndCreate, e, t, i, n, a)
            }

            closeLoginWnd(e) {
                o.ipcRenderer.send(v.NodeEventMesssageNS.eventLoginWndClose, e)
            }

            updateLoginWnd(e, t, i, n, a) {
                o.ipcRenderer.send(v.NodeEventMesssageNS.eventLoginWndShow, e, t, i, n, a), o.ipcRenderer.once(v.NodeEventMesssageNS.eventLoginWndShowResult, (e, t) => {
                    t && y.LoginOptionNS.loginOption.attachListenerEvent()
                })
            }

            createPersonalInfoWnd(e, t) {
                return n(this, void 0, void 0, function* () {
                    return new Promise(i => n(this, void 0, void 0, function* () {
                        o.ipcRenderer.once("personal-info-window-created", (e, t) => n(this, void 0, void 0, function* () {
                            let e = yield r.asyncRemoteCall.getBrowserWindow();
                            i(yield e.fromId(t))
                        })), o.ipcRenderer.once("personal-info-window-ready-to-show", (e, t) => {
                            T.client.broadcastEvent(w.ThunderEvent.hoverWindowReadyToShow)
                        });
                        let a = yield T.client.callServerFunction("IsLogined");
                        o.ipcRenderer.send("create-personal-info-window", e, t, a)
                    }))
                })
            }

            createRetryLoginWnd(e, t) {
                o.ipcRenderer.send(v.NodeEventMesssageNS.eventRetryLoginWndCreate, e, t)
            }

            createModifierUserInfoWnd(e) {
                o.ipcRenderer.send(v.NodeEventMesssageNS.eventModifierUserinfoWndCreate, e)
            }
        }, e.loginSDKHelper = new class {
            constructor() {
                this.curUserInfo = null, this.key = "XUNLEIACCOUNT123", this.loginInfo = null, this.loginDataDir = l.join(__profilesDir, "xlaccount/"), this.loginDataPath = l.join(__profilesDir, "xlaccount/accountdata.dat"), this.deviceId = "", this.canSaveDataNow = !0, this.dataToSave = null, this.eventEmitter = null, S.information("loginSDKHelper obj create"), this.eventEmitter = new k.EventEmitter, this.eventEmitter.setMaxListeners(0)
            }

            init() {
                return n(this, void 0, void 0, function* () {
                    let e = yield c.FileSystemAWNS.existsAW(`${this.loginDataPath}`);
                    e || (e = yield c.FileSystemAWNS.mkdirsAW(`${this.loginDataDir}`)) && (yield c.FileSystemAWNS.writeFileAW(`${this.loginDataPath}`, "")), yield this.loadLoginDataFromFile(), yield this.getDeviceID(), yield m.activityObj.getActiveConfig()
                })
            }

            getDeviceID() {
                return n(this, void 0, void 0, function* () {
                    let e = "";
                    do {
                        if (null !== this.deviceId && void 0 !== this.deviceId && "" !== this.deviceId) {
                            e = this.deviceId;
                            break
                        }
                        let t = "", i = "", n = "SYSTEM_CONFIG", a = "DEVICEID", o = C.getPublicUserDataPath(),
                            r = l.join(o, "Thunder Network/Thunder"), s = l.join(r, "/xlconfig.ini");
                        if ("" !== o && ((yield c.FileSystemAWNS.mkdirsAW(r)) && (i = C.readINI(s, n, a)), S.information("得到文件保存 peeridMd5Str:", i)), "" === i) {
                            let e = C.getPeerID();
                            i = h.ToolsUtilitiesAWNS.genarateMd5(e), S.information("重新计算 peeridStr:", e, ";peeridMd5Str:", i), (yield c.FileSystemAWNS.mkdirsAW(r)) && C.writeINI(s, n, a, i)
                        }
                        let d = C.getDmideCode(), u = h.ToolsUtilitiesAWNS.genarateMd5(d);
                        S.information("dmideCodeStr:", d, ";dmideCodeMd5Str:", u), t = u + i, e = h.ToolsUtilitiesAWNS.genarateMd5(t), this.deviceId = e
                    } while (0);
                    return S.information("deviceIDMd5Str:", e), e
                })
            }

            getInitData() {
                let e = l.join(__rootDir, "../../Thunder.exe"), t = C.getFileVersion(e),
                    i = m.activityObj.getActivityInfo(), n = i.activityEnable, o = i.activityCssPath;
                return S.information("getInitData:", i), JSON.stringify({
                    appid: "0",
                    package: "com.xunlei.thunderx",
                    appkey: "4af30ad6c6b0c02c4d8df3ded2cb79b8",
                    platform: "pc-xdas",
                    osversion: a.release(),
                    thirdLoginDefault: ["weixin", "qq"],
                    thirdLoginGroup: ["qq", "weixin", "sina", "alipay"],
                    loginTypes: ["account", "mobile"],
                    registerTypes: ["mobile"],
                    uiText: "xlx_new",
                    clientVersion: t,
                    thunderVersion: t,
                    activityEnable: n,
                    activityCssPath: o
                })
            }

            saveDataToFile(e, t) {
                return n(this, void 0, void 0, function* () {
                    let i = !1;
                    return this.canSaveDataNow ? (this.canSaveDataNow = !1, i = yield c.FileSystemAWNS.writeFileAW(e, t), this.canSaveDataNow = !0, this.eventEmitter.emit("OnSaveDataToFileComplete")) : (this.dataToSave = t, this.eventEmitter.removeAllListeners("OnSaveDataToFileComplete"), this.eventEmitter.once("OnSaveDataToFileComplete", () => n(this, void 0, void 0, function* () {
                        i = yield this.saveDataToFile(e, this.dataToSave)
                    }))), i
                })
            }

            saveData(e, t, i) {
                return n(this, void 0, void 0, function* () {
                    S.information("SaveData type:", e, ";key:", t, ";data:", i);
                    let n = !1;
                    do {
                        if (d.isNullOrUndefined(e) || d.isNullOrUndefined(t) || d.isNullOrUndefined(i) || "" === i) break;
                        if ("memory" === e) {
                            d.isNullOrUndefined(this.curUserInfo) && (this.curUserInfo = {});
                            try {
                                this.curUserInfo[t] = JSON.parse(i)
                            } catch (e) {
                                S.information(e)
                            }
                            n = !0
                        } else if ("file" === e) {
                            d.isNullOrUndefined(this.loginInfo) && (this.loginInfo = {});
                            try {
                                this.loginInfo[t] = JSON.parse(i);
                                let e = JSON.stringify(this.loginInfo);
                                S.information("SaveData bufStr:", e);
                                let a = new Buffer(e), o = h.ToolsUtilitiesAWNS.encryptBuffer(a, this.key);
                                n = yield this.saveDataToFile(this.loginDataPath, o)
                            } catch (e) {
                                S.information(e)
                            }
                        } else n = !0
                    } while (0);
                    return f.NativeCallHostModule.nativeCallHost.fireNativeEvent("onChangeLoginData", e, t, i), n
                })
            }

            fireEvent(e, i) {
                return n(this, void 0, void 0, function* () {
                    let n = {code: t.UnKnown};
                    do {
                        if (d.isNullOrUndefined(e)) {
                            n.code = t.WrongParam;
                            break
                        }
                        f.NativeCallHostModule.nativeCallHost.fireNativeEvent("onFireLoginEvent", e, i), n.code = t.Success
                    } while (0);
                    return n
                })
            }

            loadData(e, t) {
                let i = null;
                do {
                    if (d.isNullOrUndefined(e) || d.isNullOrUndefined(t)) break;
                    if ("memory" === e) {
                        if (d.isNullOrUndefined(this.curUserInfo) || d.isNullOrUndefined(this.curUserInfo[t]) || "" === this.curUserInfo[t]) break;
                        i = JSON.stringify(this.curUserInfo[t])
                    } else {
                        if ("file" !== e) break;
                        if (d.isNullOrUndefined(this.loginInfo) || d.isNullOrUndefined(this.loginInfo[t]) || "" === this.loginInfo[t]) break;
                        i = JSON.stringify(this.loginInfo[t])
                    }
                } while (0);
                return S.information("loadData:data = ", i), i
            }

            loadLoginDataFromFile() {
                return n(this, void 0, void 0, function* () {
                    do {
                        let e = yield c.FileSystemAWNS.readFileAW(`${this.loginDataPath}`);
                        if (d.isNullOrUndefined(e) || "" === e.toString()) {
                            S.information("loadLoginDataFromFile no buf data");
                            break
                        }
                        let t = "";
                        try {
                            if (t = h.ToolsUtilitiesAWNS.decryptBuffer(e, this.key).toString(), d.isNullOrUndefined(t) || "" === t) {
                                S.information("loadLoginDataFromFile decryption bufStr is null");
                                break
                            }
                            this.loginInfo = JSON.parse(t), S.information("loadLoginDataFromFile decryption this.loginInfo:", this.loginInfo)
                        } catch (e) {
                            yield c.FileSystemAWNS.unlinkAW(this.loginDataPath);
                            break
                        }
                    } while (0)
                })
            }
        }, e.loginHelper = new class {
            constructor() {
                this.curUserInfo = null, this.curLoginInfo = null, this.dir = l.join(__profilesDir, "Community/UserImages"), S.information("loginHelper obj create")
            }

            getCurInternetState() {
                return C.getCurInternetState()
            }

            getUserHeaderAw(e) {
                return n(this, void 0, void 0, function* () {
                    S.information("enter getUserHeaderAw");
                    let t = "";
                    do {
                        if (null === e || void 0 === e || "" === e) break;
                        let i = e + ".jpg", n = l.join(this.dir, i);
                        (yield c.FileSystemAWNS.existsAW(n)) && (t = `file:///${n}`)
                    } while (0);
                    return S.information("leave getUserHeaderAw:", t, e), t
                })
            }

            getUserHeader(e) {
                S.information("enter getUserHeader");
                let t = "";
                do {
                    if (null === e || void 0 === e || "" === e) break;
                    let i = e + ".jpg", n = l.join(this.dir, i);
                    C.queryFileExists(n) && (t = `file:///${n}`)
                } while (0);
                return S.information("leave getUserHeader:", t, e), t
            }

            updateHeaderAw(e, t) {
                return n(this, void 0, void 0, function* () {
                    let i = "";
                    do {
                        if (S.information("enter updateHeaderAw:", e, t), null === e || void 0 === e || "" === e || null === t || void 0 === t || "" === t) break;
                        let n = t + ".jpg", a = l.join(this.dir, n);
                        (yield g.AxiosNS.downloadFileAW(e, a)) && (i = `file:///${a}?_=${Date.now()}`)
                    } while (0);
                    return S.information("leave updateHeaderAw:", i), i
                })
            }

            getUserInfo(...e) {
                void 0 !== s.xlQuickLogin && s.xlQuickLogin.getUserInfo(...e)
            }

            getSessionIDAw() {
                return n(this, void 0, void 0, function* () {
                    return new Promise(e => {
                        s.xlQuickLogin.getUserInfo("sessionid", t => {
                            e(t)
                        })
                    })
                })
            }

            getUserInfoAw(e) {
                return n(this, void 0, void 0, function* () {
                    return new Promise(t => {
                        e ? s.xlQuickLogin.getUserInfo(e, e => {
                            t(e)
                        }) : s.xlQuickLogin.getUserInfo(e => {
                            t(e)
                        })
                    })
                })
            }

            getUserInfoEx(e, t) {
                s.xlQuickLogin.getAllUserInfo(i => {
                    this.curUserInfo = i, null !== this.curUserInfo && void 0 !== this.curUserInfo && "" !== this.curUserInfo ? s.xlQuickLogin.getUserInfo(i => {
                        this.curLoginInfo = i, S.information(this.curLoginInfo);
                        let n = "";
                        if (null === e || 0 === e || 3 === e) {
                            let e = {}, t = this.getUserInfoStr();
                            e[1] = t;
                            let i = this.getVipInfoStr();
                            e[2] = i, n = JSON.stringify(e)
                        } else if (1 === e) {
                            let e = this.getUserInfoStr();
                            n = JSON.stringify(e)
                        } else if (2 === e) {
                            let e = this.getVipInfoStr();
                            n = JSON.stringify(e)
                        }
                        t(n)
                    }) : t("")
                })
            }

            getAllUserInfo(...e) {
                void 0 !== s.xlQuickLogin && s.xlQuickLogin.getAllUserInfo(...e)
            }

            getAllUserInfoAw() {
                return n(this, void 0, void 0, function* () {
                    return new Promise(e => {
                        s.xlQuickLogin.getAllUserInfo(t => {
                            e(t)
                        })
                    })
                })
            }

            getUserInfoByKeyAw(e, t) {
                return n(this, void 0, void 0, function* () {
                    return new Promise(i => {
                        null !== t && void 0 !== t && "vip_xl" === t ? s.xlQuickLogin.getAllUserInfo(t => {
                            let n = "";
                            do {
                                if (null === t || void 0 === t) break;
                                if (null === t.vipList || void 0 === t.vipList) break;
                                if (null === t.vipList[0] || void 0 === t.vipList[0]) break;
                                n = t.vipList[0][e]
                            } while (0);
                            i(n)
                        }) : s.xlQuickLogin.getAllUserInfo(e, e => {
                            i(e)
                        })
                    })
                })
            }

            isLogined(...e) {
                void 0 !== s.xlQuickLogin && void 0 !== e && s.xlQuickLogin.isLogined(...e)
            }

            isLoginedAw() {
                return n(this, void 0, void 0, function* () {
                    return new Promise(e => {
                        s.xlQuickLogin.isLogined(t => {
                            e(t)
                        })
                    })
                })
            }

            showLoginDlg(e, t, i) {
                S.information(e), null !== t && void 0 !== t || (t = !0), y.LoginOptionNS.loginOption.setOption(i), f.NativeCallHostModule.nativeCallHost.fireNativeEvent("onShowLoginWnd", e, t)
            }

            logout() {
                void 0 !== s.xlQuickLogin && (S.information("调用 logout 接口"), s.xlQuickLogin.logout())
            }

            logIn(e) {
                void 0 !== s.xlQuickLogin && "function" == typeof s.xlQuickLogin.retryLogin && (S.information("enter xlQuickLogin.retryLogin"), s.xlQuickLogin.retryLogin())
            }

            switchAccount(e) {
                void 0 !== s.xlQuickLogin && "function" == typeof s.xlQuickLogin.switchAccount && s.xlQuickLogin.switchAccount()
            }

            isAutologin(...e) {
                void 0 !== s.xlQuickLogin && "function" == typeof s.xlQuickLogin.isAutologin && s.xlQuickLogin.isAutologin(...e)
            }

            channel(e) {
                void 0 !== s.xlQuickLogin && "function" == typeof s.xlQuickLogin.channel && s.xlQuickLogin.channel(e)
            }

            getVipInfo() {
                return this.getVipInfoStr()
            }

            getUserInfoStr() {
                return {
                    username: this.curLoginInfo.userName,
                    usernewno: this.curUserInfo.userNewNo,
                    userid: this.curUserInfo.userID,
                    sessionid: this.curLoginInfo.sessionid,
                    nickName: this.curUserInfo.nickName,
                    account: this.curUserInfo.account,
                    rank: this.curUserInfo.rank,
                    order: this.curUserInfo.order,
                    isSubAccount: this.curUserInfo.isSubAccount,
                    country: this.curUserInfo.country,
                    province: this.curUserInfo.province,
                    city: this.curUserInfo.city,
                    birthday: this.curUserInfo.birthday,
                    sex: this.curUserInfo.sex,
                    mobile: this.curUserInfo.mobile,
                    isSpecialNum: this.curUserInfo.isSpecialNum,
                    role: this.curUserInfo.role,
                    todayScore: this.curUserInfo.todayScore,
                    personalSign: this.curUserInfo.personalSign
                }
            }

            getVipInfoStr() {
                let e = this.curUserInfo.vipList[0];
                if (e.isVip == 0) {
                    e.vipLevel = 10;
                    e.isVip = 1;
                    e.isYear = 1;
                    e.vasType = 5;
                }
                return {
                    vasid: e.vasid,
                    isVip: e.isVip,
                    vipLevel: e.vipLevel,
                    expireDate: e.expireDate,
                    vasType: e.vasType,
                    payId: e.payId,
                    payName: e.payName,
                    vipGrow: e.vipGrow,
                    vipDayGrow: e.vipDayGrow,
                    isAutoDeduct: e.isAutoDeduct,
                    isRemind: e.isRemind,
                    isYear: e.isYear,
                    register: e.register
                }
            }
        }
    }(t.LoginHelperNS || (t.LoginHelperNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(18), o = i(0), r = i(19), s = i(9), l = i(5), d = o.default.getLogger("config-modules"),
        u = `${__profilesDir}/modules.json`;
    const c = new class {
        constructor() {
            this.configModulesJsonData = null, this.eventEmitter = new r.EventEmitter, this.inited = !1
        }

        cache(e) {
            return n(this, void 0, void 0, function* () {
                yield l.FileSystemAWNS.writeFileAW(u, JSON.stringify(e))
            })
        }

        loadLatest() {
            return n(this, void 0, void 0, function* () {
                do {
                    if (!(yield l.FileSystemAWNS.existsAW(u))) break;
                    let e = (yield l.FileSystemAWNS.readFileAW(u)).toString();
                    try {
                        this.configModulesJsonData = JSON.parse(e)
                    } catch (e) {
                    }
                } while (0)
            })
        }

        update() {
            return n(this, void 0, void 0, function* () {
                let e = null, t = !1;
                try {
                    a.default.defaults.adapter = i(21), e = yield a.default.get("http://static-xl.a.88cdn.com/json/modules.json", {timeout: 1e4})
                } catch (e) {
                    d.information(e)
                }
                if (null !== e && void 0 !== e.status && 200 === e.status && void 0 !== e.data && null !== e.data && "" !== e.data && (this.configModulesJsonData = e.data, this.cache(e.data).catch(), t = !0), !t) {
                    let t = null !== e ? e.status : -1;
                    s.XLStatNS.trackEvent("business", "module_json_download_fail", "", 0, 0, 0, 0, `err_code=${t}`)
                }
                return t
            })
        }

        init() {
            return n(this, void 0, void 0, function* () {
                let e = yield this.update();
                e || (d.information("module_json_download_fail load cache"), this.loadLatest().catch()), setInterval(() => n(this, void 0, void 0, function* () {
                    this.update().catch()
                }), 36e5), this.inited = !0, this.eventEmitter.emit("OnConfigModulesLoaded", e)
            })
        }

        getConfigInfo(e, t) {
            let i = null;
            do {
                if (null === this.configModulesJsonData || void 0 === this.configModulesJsonData) break;
                null === e || void 0 === e || "" === e ? i = this.configModulesJsonData : null === t || void 0 === t || "" === t ? null !== this.configModulesJsonData[e] && void 0 !== this.configModulesJsonData[e] && (i = this.configModulesJsonData[e]) : null !== this.configModulesJsonData[e] && void 0 !== this.configModulesJsonData[e] && null !== this.configModulesJsonData[e][t] && void 0 !== this.configModulesJsonData[e][t] && (i = this.configModulesJsonData[e][t])
            } while (0);
            return i
        }

        getEventEmitter() {
            return this.eventEmitter
        }

        isInited() {
            return this.inited
        }

        isInitedAw() {
            return n(this, void 0, void 0, function* () {
                return new Promise(e => {
                    this.inited ? e(!0) : this.eventEmitter.once("OnConfigModulesLoaded", t => {
                        e(!0)
                    })
                })
            })
        }

        getJsonData() {
            return this.configModulesJsonData
        }
    };
    t.default = c
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(4), a = i(103), o = i(104), r = i(298), s = 0, l = "#home-1EAC214F-7644-4163-9EB8-AF4BAA62D144";
    !function (e) {
        class t {
            constructor() {
                this.nativeCallInfoList = [], this.webviewInfoId = -1
            }

            initialize() {
                this.bindMsgListeners()
            }

            addDelegate(e) {
                this.delegate = e
            }

            removeDelegate() {
                this.delegate = null
            }

            callJsFunctionById(e, t, ...i) {
                a.information(`funcId = ${t}`);
                do {
                    if (!n.isNumber(e)) {
                        a.error(`nativeCallId = ${e} error`);
                        break
                    }
                    if (!n.isNumber(t)) {
                        a.error(`funcId = ${t} error`);
                        break
                    }
                    if (this.isInvalidId(t)) {
                        a.error(`funcId = ${t} invalid`);
                        break
                    }
                    let r = o.CommonIPCMessage.msgNCCallJsFunctionById, s = [t].concat(i);
                    this.isWebviewInfo(e) ? this.sendMsgToWebviewNativeCall(r, s) : this.sendMsgToNativeCall(e, r, s)
                } while (0)
            }

            callJsFunctionByName(e, t, ...i) {
                a.information(`funcName = ${t}`);
                do {
                    if (!n.isNumber(e)) {
                        a.error(`nativeCallId = ${e} error`);
                        break
                    }
                    if (n.isNullOrUndefined(t) || 0 === t.length) {
                        a.error(`funcName = ${t} error`);
                        break
                    }
                    let r = o.CommonIPCMessage.msgNCCallJsFunctionByName, s = [t].concat(i);
                    this.isWebviewInfo(e) ? this.sendMsgToWebviewNativeCall(r, s) : this.sendMsgToNativeCall(e, r, s)
                } while (0)
            }

            fireNativeEvent(e, ...t) {
                a.information(`eventName = ${e}`);
                do {
                    if (n.isNullOrUndefined(e) || 0 === e.length) {
                        a.error(`eventName = ${e} error`);
                        break
                    }
                    let i = o.CommonIPCMessage.msgNCNativeFireEvent, r = [e].concat(t);
                    this.sendMsgToWebviewNativeCall(i, r);
                    for (let e of this.nativeCallInfoList) this.sendMsgToNativeCall(e.id, i, r)
                } while (0)
            }

            bindMsgListeners() {
                this.bindWebviewMsgListeners(), this.bindIPCMsgListeners()
            }

            bindWebviewMsgListeners() {
                const e = document.querySelector(l);
                n.isNullOrUndefined(e) ? a.error("webview is null") : e.addEventListener("ipc-message", e => {
                    do {
                        if (e.channel === o.CommonIPCMessage.msgNCCallNativeFunction) {
                            this.handleWebviewCallNativeFunction(e.args[0]);
                            break
                        }
                        if (e.channel === o.CommonIPCMessage.msgNCCheckNativeFunction) {
                            this.handleWebviewCheckNativeFunction(e.args[0]);
                            break
                        }
                    } while (0)
                })
            }

            bindIPCMsgListeners() {
                r.CommonIPCRenderer.rendererCommunicator.onMessage(o.CommonIPCMessage.msgNCCallNativeFunction, e => {
                    this.handleCallNativeFunction(e)
                }), r.CommonIPCRenderer.rendererCommunicator.onMessage(o.CommonIPCMessage.msgNCCheckNativeFunction, e => {
                    this.handleCheckNativeFunction(e)
                }), r.CommonIPCRenderer.rendererCommunicator.onMessage(o.CommonIPCMessage.msgNCNativeCallReady, e => {
                    this.handleNativeCallReady(e.msg.args)
                })
            }

            handleCallNativeFunction(e) {
                do {
                    if (n.isNullOrUndefined(this.delegate)) {
                        a.error("delegate is null");
                        break
                    }
                    if (n.isNullOrUndefined(e)) {
                        a.error("msgInfo is null");
                        break
                    }
                    let t = e.senderInfo;
                    if (n.isNullOrUndefined(t)) {
                        a.error("nativeCallInfo is null");
                        break
                    }
                    let i = e.msg.args;
                    if (n.isNullOrUndefined(i)) {
                        a.error("args is null");
                        break
                    }
                    let o = i[0];
                    if (!n.isString(o) || 0 === o.length) {
                        a.error(`funcName = ${o} error`);
                        break
                    }
                    let r = i[1];
                    if (!n.isNumber(r)) {
                        a.error(`callbackId = ${r} error`);
                        break
                    }
                    i.splice(0, 2), this.appendNativeCallInfoList(t), this.delegate.onJsCallNativeFunction(t.id, o, r, i)
                } while (0)
            }

            handleCheckNativeFunction(e) {
                do {
                    if (n.isNullOrUndefined(this.delegate)) {
                        a.error("delegate is null");
                        break
                    }
                    if (n.isNullOrUndefined(e)) {
                        a.error("msgInfo is null");
                        break
                    }
                    let t = e.senderInfo;
                    if (n.isNullOrUndefined(t)) {
                        a.error("nativeCallInfo is null");
                        break
                    }
                    let i = e.msg.args;
                    if (n.isNullOrUndefined(i)) {
                        a.error("args is null");
                        break
                    }
                    let o = i[0];
                    if (!n.isString(o) || 0 === o.length) {
                        a.error(`funcName = ${o} error`);
                        break
                    }
                    let r = i[1];
                    if (!n.isNumber(r)) {
                        a.error(`callbackId = ${r} error`);
                        break
                    }
                    this.appendNativeCallInfoList(t), i.splice(0, 2), this.delegate.onJsCheckNativeFunction(t.id, o, r)
                } while (0)
            }

            handleNativeCallReady(e) {
                do {
                    if (n.isNullOrUndefined(e)) {
                        a.error("args is null");
                        break
                    }
                    let t = e[0];
                    if (n.isNullOrUndefined(t)) {
                        a.error(`info = ${t} error`);
                        break
                    }
                    this.appendNativeCallInfoList(t)
                } while (0)
            }

            handleWebviewCallNativeFunction(e) {
                do {
                    if (n.isNullOrUndefined(this.delegate)) {
                        a.error("delegate is null");
                        break
                    }
                    if (n.isNullOrUndefined(e)) {
                        a.error("args is null");
                        break
                    }
                    let t = e[0];
                    if (!n.isString(t) || 0 === t.length) {
                        a.error(`funcName = ${t} error`);
                        break
                    }
                    let i = e[1];
                    if (!n.isNumber(i)) {
                        a.error(`callbackId = ${i} error`);
                        break
                    }
                    e.splice(0, 2), this.delegate.onJsCallNativeFunction(this.webviewInfoId, t, i, e)
                } while (0)
            }

            handleWebviewCheckNativeFunction(e) {
                do {
                    if (n.isNullOrUndefined(this.delegate)) {
                        a.error("delegate is null");
                        break
                    }
                    if (n.isNullOrUndefined(e)) {
                        a.error("args is null");
                        break
                    }
                    let t = e[0];
                    if (!n.isString(t) || 0 === t.length) {
                        a.error(`funcName = ${t} error`);
                        break
                    }
                    let i = e[1];
                    if (!n.isNumber(i)) {
                        a.error(`callbackId = ${i} error`);
                        break
                    }
                    e.splice(0, 2), this.delegate.onJsCheckNativeFunction(this.webviewInfoId, t, i)
                } while (0)
            }

            appendNativeCallInfoList(e) {
                let t = !0;
                for (let i of this.nativeCallInfoList) if (i.id === e.id) {
                    t = !1;
                    break
                }
                t && this.nativeCallInfoList.push(e)
            }

            findNativeCallInfo(e) {
                for (let t of this.nativeCallInfoList) if (t.id === e) return t;
                return null
            }

            isWebviewInfo(e) {
                return e === this.webviewInfoId
            }

            sendMsgToWebviewNativeCall(e, t) {
                const i = document.querySelector(l);
                do {
                    if (n.isNullOrUndefined(i)) {
                        a.error("webview is null");
                        break
                    }
                    if (n.isNullOrUndefined(i.send)) {
                        a.error("webview.send is null");
                        break
                    }
                    i.send(e, t)
                } while (0)
            }

            sendMsgToNativeCall(e, t, i) {
                do {
                    let o = this.findNativeCallInfo(e);
                    if (n.isNullOrUndefined(o)) {
                        a.error("nativeCallInfo is null");
                        break
                    }
                    r.CommonIPCRenderer.rendererCommunicator.sendMessageToRenderer(o.id, {name: t, args: i})
                } while (0)
            }

            isInvalidId(e) {
                return e === s
            }
        }

        e.NativeCallHost = t, e.nativeCallHost = new t
    }(t.NativeCallHostModule || (t.NativeCallHostModule = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(17), o = i(12), r = i(2), s = i(0), l = i(39), d = i(3), u = i(15), c = i(30), h = i(13), f = i(28),
        g = i(304), p = i(40), v = i(14), m = i(35), y = i(5), k = s.default.getLogger("DownloadMgr"),
        T = u.DownloadKernelEventManager.getEventManager(),
        w = p.DownloadKernelCategoryViewManager.getCategoryViewManager(), C = [{
            type: "task",
            title: "新建下载任务",
            program: process.execPath,
            args: "-task:newtask -window:bringtotop",
            iconPath: `${__rootDir}/static/icon/jumplist_newtask.ico`,
            iconIndex: 0,
            description: "新建下载任务"
        }, {
            type: "task",
            title: "开始所有任务",
            program: process.execPath,
            args: "-task:startall",
            iconPath: `${__rootDir}/static/icon/jumplist_startalltask.ico`,
            iconIndex: 0,
            description: "开始所有任务"
        }, {
            type: "task",
            program: process.execPath,
            args: "-task:pauseall",
            iconPath: `${__rootDir}/static/icon/jumplist_pausealltask.ico`,
            iconIndex: 0,
            title: "暂停所有任务",
            description: "暂停所有任务"
        }, {
            type: "task",
            program: process.execPath,
            args: "-shell:exit",
            iconPath: `${__rootDir}/static/icon/jumplist_exit.ico`,
            iconIndex: 0,
            title: "退出迅雷",
            description: "退出迅雷"
        }];
    const S = new class extends l.default {
        constructor() {
            super(...arguments), this.completedList = [], this.recentList = [], this.tracked = !1, this.needSelectNext = !1, this.currentCategoryId = -1, this.currentCategoryView = d.DownloadKernel.CategroyViewID.Downloading
        }

        setNeedSelectNext(e) {
            this.needSelectNext = e
        }

        getNeedSelectNext() {
            return this.needSelectNext
        }

        getCurrentCategoryId() {
            return this.currentCategoryId
        }

        setCurrentCategoryId(e) {
            this.currentCategoryId = e
        }

        getCurrentCategoryView() {
            return this.currentCategoryView
        }

        setCurrentCategoryView(e) {
            this.currentCategoryView = e
        }

        trackWin7NewTrait() {
            this.trackTaskComplete().catch(), c.DownloadKernelManager.attachListener(h.NodeEventMesssageNS.eventGlobalDownloadSpeedChanged, (...e) => {
                let t = g.DownloadProgressNS.getDownloadDetails().progress;
                a.ipcRenderer.send(f.ThunderChannelList.channelRMSetProgressBar, t)
            })
        }

        trackTaskComplete() {
            return n(this, void 0, void 0, function* () {
                yield(yield o.asyncRemoteCall.getApp()).getJumpListSettings();
                do {
                    if (this.tracked) break;
                    this.tracked = !0, c.DownloadKernelManager.attachListener(h.NodeEventMesssageNS.eventTaskDataBaseLoadEnd, () => {
                        this.initCompeltedList(), this.getJumplistGroup().catch(), this.updateJumpList().catch(), this.attachCompletedCategoryViewChange()
                    })
                } while (0)
            })
        }

        updateJumpList() {
            return n(this, void 0, void 0, function* () {
                let e = [];
                e.push({type: "tasks", items: C});
                let t = [];
                if (this.recentList.length > 0) {
                    let e = m.ThunderHelper.isWindow7();
                    for (let i of this.recentList) {
                        let n = i.savePath, a = i.taskName;
                        void 0 !== a && a.indexOf(".") === a.length - 1 && (a = a.substring(0, a.length - 1));
                        let o = "", s = o = i.taskType === d.DownloadKernel.TaskType.Group ? n : r.join(n, a);
                        if (i.taskType === d.DownloadKernel.TaskType.Bt) s = `${__rootDir}/static/icon/jumplist_bttask.ico`; else do {
                            if (!e) break;
                            let t = yield v.ThunderUtil.getThunderTempPath(!0, "JumpIcon"), n = i.cid + ".ico";
                            "" === i.cid && (n = a + ".ico");
                            let l = r.join(t, n);
                            if (yield y.FileSystemAWNS.existsAW(l)) {
                                s = l;
                                break
                            }
                            m.ThunderHelper.extractIcon(o, l) && (s = l)
                        } while (0);
                        t.push({type: "task", title: a, iconPath: s, iconIndex: 0, args: "", program: o})
                    }
                } else t.push({type: "task", title: "最近没有完成任务", program: ""});
                t.length > 0 && (k.information("jumpRecentList", t), e.push({
                    name: "最近完成的任务",
                    items: t,
                    type: "custom"
                })), k.information("categories", e);
                let i = yield o.asyncRemoteCall.getApp();
                try {
                    yield i.setJumpList(e)
                } catch (e) {
                    k.warning("setJumpList error ", e)
                }
            })
        }

        sortCompletedList() {
            this.completedList.sort((e, t) => {
                let i = e.completionTime;
                return t.completionTime - i
            })
        }

        getJumplistGroup() {
            return n(this, void 0, void 0, function* () {
                do {
                    this.sortCompletedList();
                    let e = yield(yield o.asyncRemoteCall.getApp()).getJumpListSettings();
                    k.information("getJumpListSettings", e);
                    let t = e.removedItems;
                    if (!t || 0 === t.length) {
                        k.information("update jumplist removedItems null");
                        break
                    }
                    if (0 === this.completedList.length) break;
                    k.information("update jumplist removedItems", t);
                    for (let e of t) for (let t = 0; t < this.completedList.length; t++) {
                        let i = this.completedList[t], n = i.savePath, a = i.taskName;
                        void 0 !== a && a.indexOf(".") === a.length - 1 && (a = a.substring(0, a.length - 1));
                        let o = "";
                        if (o = i.taskType === d.DownloadKernel.TaskType.Group ? n : r.join(n, a), e.iconPath && o.toLowerCase() === e.iconPath.toLowerCase()) {
                            this.completedList.splice(t, 1);
                            break
                        }
                    }
                } while (0);
                let e = this.completedList.length > 4 ? 4 : this.completedList.length;
                this.recentList = this.completedList.slice(0, e), k.information("getJumplistGroup", this.recentList)
            })
        }

        initCompeltedList() {
            let e = w.getCategoryViewFromId(d.DownloadKernel.CategroyViewID.Completed).getTasks();
            for (let [, t]of e) this.completedList.push(t.getTaskBaseInfo())
        }

        attachCompletedCategoryViewChange() {
            T.attachTaskEvent(d.DownloadKernel.TaskEventType.InsertToCategoryView, (...e) => {
                do {
                    if (!e) break;
                    if (e[0] !== d.DownloadKernel.TaskEventType.InsertToCategoryView) break;
                    if (!e[1] || !e[2] || !e[3]) break;
                    if (-1 !== e[1]) break;
                    if (e[2] !== d.DownloadKernel.CategroyViewID.Completed) break;
                    let t = e[3];
                    if (0 === t.length) break;
                    let i = t.map(e => e.getTaskBaseInfo());
                    this.completedList.push(...i), this.getJumplistGroup().catch(), this.updateJumpList().catch()
                } while (0)
            }), T.attachTaskEvent(d.DownloadKernel.TaskEventType.RemoveFromCategoryView, (...e) => {
                do {
                    if (!e) break;
                    if (e[0] !== d.DownloadKernel.TaskEventType.RemoveFromCategoryView) break;
                    if (void 0 === e[1] || !e[2] || !e[3]) break;
                    if (-1 !== e[1]) break;
                    if (e[2] !== d.DownloadKernel.CategroyViewID.Completed) break;
                    let t = e[3];
                    if (0 === t.length) break;
                    let i = this.completedList.map(e => e.taskId);
                    for (let e of t) {
                        let t = i.indexOf(e.getId());
                        -1 !== t && (this.completedList.splice(t, 1), i.splice(t, 1))
                    }
                    this.getJumplistGroup().catch(), this.updateJumpList().catch()
                } while (0)
            })
        }
    };
    t.default = S
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        e.channelRMNewTaskReadyForSetTaskData = "RM_NEWTASK_READYRORSETTASKDATA", e.channelRMNewTaskSetTaskData = "RM_NEWTASK_SETTASKDATA", e.channelRMPreNewTaskSetTaskData = "RM_PRENEWTASK_SETTASKDATA", e.channelRMNewTaskCreateNewTask = "RM_NEWTASK_CREATENEWTASK", e.channelRMNewTaskClose = "RM_NEWTASK_CLOSE", e.channelRMPreNewTaskClose = "RM_PRENEWTASK_CLOSE", e.channelRMNewTaskSetBTInfo = "RM_NEWTASK_SETBTINFO", e.channelRMNewTaskDownloadTorrent = "RM_NEW_TASK_DOWNLOAD_TORRENT", e.channelRMNewTaskCreateBtTask = "RM_NEWTASK_CRATEBTTASK", e.channelRMNewTaskCancleMagnet = "RM_NEWTASK_CANCLE_MAGNET", e.channelRMImportTorrent = "RM_NEWTASK_IMPORT_TORRENT", e.channelRMGetConfigValueResolve = "RM_GET_CONFIG_VALUE_RESOLVE", e.channelRMGetConfigValueReject = "RM_GET_CONFIG_VALUE_REJECT", e.channelRMSetConfigValueReject = "RM_SET_CONFIG_VALUE_REJECT", e.channelMRTrayMenuClick = "MR_TRAY_MENU_CLICK", e.channelMRNewTaskMagnetTaskCreated = "MR_NEW_TASK_MAGNET_TASK_CREATED", e.channelMRNewTaskDownloadTorrentResult = "MR_NEW_TASK_DOWNLOAD_TORRENT_RESULT", e.channelMRNewTaskCreateNewTaskResult = "MR_NEWTASK_CREATENEWTASK_RESULT", e.channelMRNewTaskCreateBtTaskResult = "RM_NEWTASK_CRATEBTTASK_RESULT", e.channelMRGetConfigValue = "MR_GET_CONFIG_VALUE", e.channelMRSetConfigValue = "MR_SET_CONFIG_VALUE", e.channelRMCommitPlanTask = "RM_PLANTASK_COMMIT", e.channelRMPerformePlanTask = "RM_PLANTASK_PERFORME", e.channelRMProcessSend = "RM_RENDER_PROCESS_INFO", e.channelRMGetPrivateSpaceInfo = "RM_RENDER_GET_PRIVATE_SPACE_INFO", e.channelMRGetPrivateSpaceInfoResult = "MR_RENDER_GET_PRIVATE_SPACE_INFO_RESULT", e.channelRMFileCopy = "RM_FILE_COPY", e.channelRMFileMove = "RM_FILE_MOVE", e.channelMRFileCopyResult = "MR_FILE_COPY_RESULT", e.channelMRFileMoveResult = "MR_FILE_MOVE_RESULT", e.channelRMGetSutitleByCid = "RM_RENDER_GET_SUBTITLE_BY_CID", e.channelMRGetSutitleByCidResult = "MR_RENDER_GET_SUBTITLE_BY_CID_RESULT", e.channelRMGetSutitleByName = "RM_RENDER_GET_SUBTITLE_BY_NAME", e.channelMRGetSutitleByNameResult = "MR_RENDER_GET_SUBTITLE_BY_NAME_RESULT", e.channelRMDownloadSutitle = "RM_RENDER_DOWNLOAD_SUBTITLE", e.channelMRDownloadSutitleSuc = "MR_RENDER_DOWNLOAD_SUBTITLE_SUCCESS", e.channelMRDownloadSutitleFail = "MR_RENDER_DOWNLOAD_SUBTITLE_FAIL", e.channelRMGetDisplayName = "RM_RENDER_GET_SUBTITLE_DISPLAYNAME", e.channelMRGetDisplayNameResult = "MR_RENDER_GET_SUBTITLE_DISPLAYNAME_RESULT", e.channelMRBringWindowToTop = "MR_RENDER_BRING_WINDOW_TO_TOP", e.channelRMDownloadXmp = "RM_RENDER_DOWNLOAD_XMP", e.channelRMXmpFixBoxCreated = "RM_RENDER_XMPFIXBOX_CREATED", e.channelMRFixXmpSuc = "MR_RENDER_FIX_XMP_SUC", e.channelMRFixXMPFail = "MR_RENDER_FIX_XMP_FAIL", e.channelRMDownloadXmpEx = "RM_RENDER_DOWNLOAD_XMP_EX", e.channelRMSetPosition = "RM_SET_POSITION", e.channelRMSetFoucs = "RM_SET_FOCUS", e.channelRMCreateAddressDropWnd = "RM_CREATE_ADDRESS_DROPWND", e.channelRMRefreshAddressDropWnd = "RM_REFRESH_ADDRESS_DROPWND", e.channelRMSelectAddressDropItem = "RM_SELECT_ADDRESS_DROPITEM", e.channelRMCreateSearchWindow = "RM_CREATE_SEARCH_WINDOW", e.channelRMShowSearchWindow = "RM_SHOW_SEARCH_WINDOW", e.channelRMAddressKeyDown = "RM_ADDRESS_BAR_KEYDOWN", e.channelMRFWAddressKeyDown = "MR_ADDRESS_FW_BAR_KEYDOWN", e.channelMRFWSelectAddressDropItem = "MR_FW_SELECT_ADDRESS_DROPITEM", e.channelRMAddressDropWndKeyDown = "RM_ADDRESS_DROPWND_KEYDOWN", e.channelRMClickMouse = "RM_CLICK_MOUSE", e.channelMRSearchBarFocusChange = "MR_SEARCHBAR_FOCUS_CHANGE", e.channelMRFWAddressDropWndKeyDown = "MR_FW_ADDRESS_DROPWND_KEYDOWN", e.channelMRClickAddressDropItem = "MR_CLICK_ADDRESS_DROPITEM", e.channelMRMainWndMax = "MR_MAINWINDOW_MAX", e.channelMRMainWndMin = "MR_MAINWINDOW_MIN", e.channelMRMainWndRestore = "MR_MAINWINDOW_RESTORE", e.channelRMGetBrowserStartType = "RM_GET_BROWSER_START_TYPE", e.channelMRGetBrowserStartTypeResult = "MR_GET_BROWSER_START_TYPE_RESULT", e.channelRMExecute = "RM_SHELL_EXECUTE", e.channelMRExecuteResult = "MR_SHELL_EXECUTE_RESULT", e.channelMRAdTipsClick = "MR_AD_TIPS_CLICK", e.channelMRNotificationMsg = "MR_NOTIFICATION_MSG", e.channelRMSetProgressBar = "RM_SET_PROGRESS_BAR", e.channelRMRoundWindow = "RM_ROUND_WINDOW", e.channelMRShowOrHideWindow = "MR_SHOW_OR_HIDE_WINDOW", e.channelMRSuspensionWindowShowOrHide = "MR_SUSPENSION_WINDOW_SHOW_OR_HIDE", e.channelRMConfigInitFinished = "RM_CONFIG_INIT_FINISHED", e.channelRMConfigValueChanged = "RM_CONFIG_VALUE_CHANGED", e.channelRMIndividuationBrowserMsg = "RM_INDIVIDUATION_BROWSER_MSG", e.channelMRIndividuationBrowserMsg = "MR_INDIVIDUATION_BROWSER_MSG", e.channelRMSetEnvironmentVariable = "RM_SET_ENVIRONMENT_VARIABLE", e.channelMREmbedPlayerPos = "MR_EMBED_PLAYER_POSITION", e.channelRMUpdateLogEnviroment = "RM_UPDATE_LOG_ENVIRONMENT", e.channelMRUpdateLogEnviroment = "MR_UPDATE_LOG_ENVIRONMENT"
    }(t.ThunderChannelList || (t.ThunderChannelList = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(0), o = i(4), r = i(492), s = i(31), l = i(75), d = i(402), u = i(19),
        c = a.default.getLogger("DownloadKernel.CategoryManager");

    class h {
        constructor() {
            this.newCategoryId = 0, this.categorys = new Map, this.userId = "", this.accountPassword = "", this.isInit = !1, this.isIniting = !1, this.eventEmitter = new u.EventEmitter
        }

        innerInit() {
            do {
                if (this.isIniting) break;
                this.isIniting = !0, s.ThunderKernel.loadCategory(e => {
                    e.forEach(e => {
                        if (c.information("load category, name:", e.name), e.name === h.privateCategoryName) {
                            let t = r.PrivateCategory.createCategoryFromData(e);
                            t && this.categorys.set(e.categoryId, t)
                        } else if (e.name === h.panCategoryName) {
                            let t = d.CommonCategory.createCategoryFromData(e);
                            t && this.categorys.set(e.categoryId, t)
                        } else c.warning("unkown category name:", e.name);
                        void 0 !== e.categoryId && this.newCategoryId <= e.categoryId && (this.newCategoryId = e.categoryId + 1)
                    }), this.isIniting = !1, this.isInit = !0, this.eventEmitter.emit(h.loadedEvent)
                })
            } while (0)
        }

        init() {
            return n(this, void 0, void 0, function* () {
                if (!this.isInit && (this.innerInit(), this.isIniting)) return new Promise((e, t) => {
                    this.eventEmitter.on(h.loadedEvent, () => {
                        e()
                    })
                })
            })
        }

        getCategorys() {
            return this.categorys
        }

        getCategoryByName(e) {
            let t = new Map;
            for (let i of this.categorys.values()) i.getName() === e && t.set(i.getId(), i);
            return t
        }

        getCategoryCount() {
            return this.categorys.size
        }

        getCategoryFromId(e) {
            return this.categorys.get(e)
        }

        getCategoryView(e, t) {
            let i = null, n = this.getCategoryFromId(e);
            return n && (i = n.getCategoryViewFromId(t)), i
        }

        getCategoryFromUserId(e, t, i) {
            if (!o.isString(e) || !t || "" === t) return null;
            let n = null;
            for (let i of this.categorys.values()) if (i.getName() === e && i.getUserName() === t) {
                n = i;
                break
            }
            return n || (c.information("create new category, id:", this.newCategoryId), (n = new d.CommonCategory(this.newCategoryId)).setName(e), n.setDescription(i || e), n.setUserName(t), n.setAccountPassword(""), this.categorys.set(this.newCategoryId, n), this.newCategoryId++, s.ThunderKernel.createCategory(n.getId(), -1, -1, n.getName(), n.getDescription(), n.getUserName(), n.getAccountPassword())), n
        }

        getPrivateCategoryFromUserId(e) {
            if (!e || "" === e) return null;
            let t = null;
            for (let i of this.categorys.values()) if (i.getUserName() === e) {
                t = i;
                break
            }
            return t || (c.information("create new private category, id:", this.newCategoryId), (t = new r.PrivateCategory(this.newCategoryId)).setName(h.privateCategoryName), t.setDescription("Private Space"), t.setUserName(e), t.setAccountPassword(""), this.categorys.set(this.newCategoryId, t), this.newCategoryId++, s.ThunderKernel.createCategory(t.getId(), -1, -1, t.getName(), t.getDescription(), t.getUserName(), t.getAccountPassword())), t
        }

        getCurrentPrivateCategory() {
            if (!this.userId || "" === this.userId) return null;
            return this.getPrivateCategoryFromUserId(this.userId)
        }

        setUserInfo(e, t) {
            e = e || "", t = t || "";
            let i = !1;
            this.userId !== e && (this.userId = e, i = !0);
            let n = "";
            if ("" === t) n = ""; else {
                let e = l.createHash("md5");
                e.update(this.accountPassword), n = e.digest("hex")
            }
            if (this.accountPassword !== n && (this.accountPassword = n, i = !0), i) {
                let e = null;
                for (let t of this.categorys.values()) if (t.getUserName() === this.userId) {
                    e = t;
                    break
                }
                e && e.setAccountPassword(this.accountPassword)
            }
        }

        isPrivateCategory(e) {
            let t = !1;
            do {
                let i = this.getCategoryFromId(e);
                if (!i) break;
                i.getName() === h.privateCategoryName && (t = !0)
            } while (0);
            return t
        }
    }

    h.privateCategoryName = "Private", h.panCategoryName = "ThunderPanPlugin", h.loadedEvent = "OnCatetoryLoaded", t.CategoryManager = h, function (e) {
        const t = new h;
        e.getCategoryManager = function () {
            return t
        }
    }(t.DownloadKernelCategoryManager || (t.DownloadKernelCategoryManager = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(6), r = i(0), s = i(5), l = i(31), d = i(11), u = i(29), c = i(19), h = i(403), f = i(16),
        g = i(13), p = i(303);
    !function (e) {
        const t = d.DownloadKernelTaskManager.getTaskManager(),
            i = u.DownloadKernelCategoryManager.getCategoryManager(),
            v = o.default(a.join(__rootDir, "../bin/ThunderHelper.node")),
            m = r.default.getLogger("DownloadKernelManager");
        let y = void 0, k = !1, T = new c.EventEmitter;
        T.setMaxListeners(0);
        let w = 0;

        function C(e, t) {
            l.ThunderKernel.initDataBase(e, t)
        }

        function S(e, t, i, n) {
            l.ThunderKernel.initDownloadSdk(e, t, i, n)
        }

        function b(e, i) {
            t.attachListener(e, i)
        }

        e.init = function () {
            return n(this, void 0, void 0, function* () {
                let e = a.join(__rootDir, "../../Thunder.exe"), n = v.getFileVersion(e);
                l.ThunderKernel.registerDownloadSDKCrashCallback(() => {
                    ++w < 4 ? S(a.join(__rootDir, "../bin/SDK"), "xzcGMudGh1bmRlclg7MA^^SDK==edee53fd0b15e8d65dbfe7824f5f^a23", n, e => {
                        t.downloadSDKCrashRecover(e)
                    }) : t.downloadSDKCrash()
                }), b(g.NodeEventMesssageNS.eventTaskDataBaseLoadEnd, () => {
                    S(a.join(__rootDir, "../bin/SDK"), "xzcGMudGh1bmRlclg7MA^^SDK==edee53fd0b15e8d65dbfe7824f5f^a23", n, e => {
                        t.initDownloadKernelEnd(e)
                    })
                }), (yield s.FileSystemAWNS.existsAW(__profilesDir)) || (yield s.FileSystemAWNS.mkdirsAW(__profilesDir)), C(a.join(__profilesDir, "TaskDb.dat"), e => {
                    0 === e && (i.init().catch(), t.loadTaskBase(), p.thunderPanTask.createPanTable(), setInterval(() => {
                        t.queryTaskInfo()
                    }, 1e3), setTimeout(() => {
                        let e = v.getInstallChannel();
                        t.setGlobalExtInfo(e).catch(), f.NativeCallModule.nativeCall.AttachNativeEvent("onLoginStatusChange", (i, n) => {
                            m.information(`stat dk onLoginStatusChange oldStatus ${i}, newState ${n}`), t.setGlobalExtInfo(e).catch()
                        })
                    }, 3e3))
                }), yield h.BTExtraTrackNS.initBtTaskTrackers()
            })
        }, e.getPeerId = function () {
            return n(this, void 0, void 0, function* () {
                let e = void 0;
                return e = y && "" !== y ? y : new Promise(e => {
                    k ? T.once("OnGetGlobalPeerId", t => {
                        e(t)
                    }) : l.ThunderKernel.queryGlobalInfo(1, (t, i) => {
                        m.information("getPeerId queryGlobalInfo glPeerId:", i), k = !1, y = i, e(i), T.emit("OnGetGlobalPeerId", i)
                    }) ? k = !0 : e("")
                })
            })
        }, e.initDataBase = C, e.initDownloadSdk = S, e.uninitialize = function () {
        }, e.startBatchOperationJournal = function () {
        }, e.endBatchOperationJournal = function () {
        }, e.getDownloadSdkVersion = function () {
            let e = a.join(__rootDir, "../bin/SDK/DownloadSDKServer.exe");
            return v.getFileVersion(e)
        }, e.setDownloadSpeedLimit = function (e) {
            return l.ThunderKernel.setDownloadSpeedLimit(e)
        }, e.setUploadSpeedLimit = function (e) {
            return l.ThunderKernel.setUploadSpeedLimit(e)
        }, e.setCacheSize = function (e) {
            return l.ThunderKernel.setCacheSize(e)
        }, e.enableCommonP2pChannel = function (e) {
            t.enableCommonP2pChannel(e)
        }, e.enableCommonP2sChannel = function (e) {
            t.enableCommonP2pChannel(e)
        }, e.getTotalDownloadSpeed = function () {
            return t.getTotalDownloadSpeed()
        }, e.getTotalUploadSpeed = function () {
            return t.getTotalUploadSpeed()
        }, e.getTotalDownloadSize = function () {
            return t.getTotalDownloadSize()
        }, e.getTotalUploadSize = function () {
            return t.getTotalUploadSize()
        }, e.getTotalTaskDownloadSpeed = function (e, i) {
            return t.getTotalTaskDownloadSpeed(e, i)
        }, e.getTotalTaskVipSpeed = function (e, i) {
            return t.getTotalTaskVipSpeed(e, i)
        }, e.attachListener = b, e.attachOnceListener = function (e, i) {
            t.attachOnceListener(e, i)
        }, e.detachListener = function (e, i) {
            t.detachListener(e, i)
        }, e.importUnfinishedTask = function (e, t, i) {
            l.ThunderKernel.importTask(e, t, i)
        }, e.getSumOfRemotePeerBeBenefited = function (e) {
            l.ThunderKernel.getSumOfRemotePeerBeBenefited(e)
        }, e.isFileSizeSetterWorking = function (e) {
            l.ThunderKernel.isFileSizeSetterWorking(e)
        }, e.launchFileAssistant = function (e) {
            l.ThunderKernel.launchFileAssistant(e)
        }
    }(t.DownloadKernelManager || (t.DownloadKernelManager = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(0), a = i(6), o = i(42);
    !function (e) {
        const t = i(2), r = a.default(t.join(__rootDir, "../bin/ThunderKernel.node")),
            s = n.default.getLogger("DownloadKernel.ThunderKernel");
        let l = 0, d = [];
        e.registerDownloadSDKCrashCallback = function (e) {
            return r.registerDownloadSDKCrashCallback(e)
        }, e.initDownloadSdk = function (e, t, i, n) {
            return r.initDownloadSdk(e, t, i, n)
        }, e.createP2spTask = function (e, t, i, n, a) {
            return e && "" !== e || s.error("createP2spTask url:", e), n && "" !== n || s.error("createP2spTask savePath:", n), a && "" !== a || s.error("createP2spTask fileName:", a), e = o.Common.parseThunderPrivateUrl(e), r.createP2spTask(e, void 0 === t ? "" : t, void 0 === i ? "" : i, n, a)
        }, e.createBtTask = function (e, t, i) {
            return e && "" !== e || s.error("createBtTask torrentFilePath:", e), t && "" !== t || s.error("createBtTask savePath:", t), 0 === i.length && s.error("createBtTask fileRealIndexLists:", 0), r.createBtTask(e, t, i)
        }, e.createEmuleTask = function (e, t, i) {
            return e && "" !== e || s.error("createEmuleTask url:", e), t && "" !== t || s.error("createEmuleTask savePath:", t), i && "" !== i || s.error("createEmuleTask fileName:", i), e = o.Common.parseThunderPrivateUrl(e), r.createEmuleTask(e, t, i)
        }, e.createMagnetTask = function (e, t) {
            return e && "" !== e || s.error("createMagnetTask url:", e), t && "" !== t || s.error("createMagnetTask torrentFilePath:", t), e = o.Common.parseThunderPrivateUrl(e), r.createMagnetTask(e, t)
        }, e.startTask = function (e) {
            return s.information("startTask virtualTaskId:", e), r.startTask(e)
        }, e.stopTask = function (e) {
            return s.information("stopTask virtualTaskId:", e), r.stopTask(e)
        }, e.deleteTask = function (e) {
            return s.information("deleteTask virtualTaskId:", e), r.deleteTask(e)
        }, e.renameP2spTaskFile = function (e, t) {
            return r.renameP2spTaskFile(e, t)
        }, e.queryTaskInfo = function (e, t) {
            return 0 === r.queryTaskInfo(e, t)
        }, e.queryBtTaskInfo = function (e, t) {
            return 0 === r.queryBtTaskInfo(e, t)
        }, e.queryPlayInfo = function (e, t, i) {
            return 0 === r.queryPlayInfo(e, t, i)
        }, e.queryGlobalInfo = function (e, t) {
            return 0 === r.queryGlobalInfo(e, t)
        }, e.createTaskId = function () {
            return r.createTaskId()
        }, e.importTask = function (e, t, i) {
            return r.importTask(e, t, i)
        }, e.parserBtFileInfo = function (e, t) {
            return r.parserBtFileInfo(e, t)
        }, e.getFileHashByUrl = function (e) {
            return r.getFileHashByUrl(e)
        }, e.getInfoHashByUrl = function (e) {
            return r.getInfoHashByUrl(e)
        }, e.enableDcdnWithVipCert = function (e, t, i) {
            return r.enableDcdnWithVipCert(e, t, i)
        }, e.updateDcdnWithVipCert = function (e, t, i) {
            return r.updateDcdnWithVipCert(e, t, i)
        }, e.disableDcdnWithVipCert = function (e, t) {
            return r.disableDcdnWithVipCert(e, t)
        }, e.setDownloadSpeedLimit = function (e) {
            return r.setDownloadSpeedLimit(Number(e))
        }, e.setUploadSpeedLimit = function (e) {
            return r.setUploadSpeedLimit(Number(e))
        }, e.getSubNetUploader = function (e) {
            return r.getSubNetUploader(e)
        }, e.setTaskStrategy = function (e, t) {
            return r.setTaskStrategy(e, t)
        }, e.setDownloadStrategy = function (e, t) {
            return r.setDownloadStrategy(e, t)
        }, e.setTaskThreadCount = function (e, t) {
            return r.setTaskThreadCount(e, Number(t))
        }, e.setCacheSize = function (e) {
            return r.setCacheSize(Number(e))
        }, e.setGlobalConnectionLimit = function (e) {
            return r.setGlobalConnectionLimit(e)
        }, e.setUserInfo = function (e, t) {
            return r.setUserInfo(e, t)
        }, e.setBTExtraTrackers = function (e, t) {
            return r.setBTExtraTrackers(e, t)
        }, e.setGlobalExtInfo = function (e, t) {
            return r.setGlobalExtInfo(e, t)
        }, e.setTaskExtInfo = function (e, t) {
            return r.setTaskExtInfo(e, t)
        }, e.setTaskExtStat = function (e, t, i, n) {
            return r.setTaskExtStat(e, t, i, n)
        }, e.addHttpHeaderField = function (e, t, i) {
            return r.addHttpHeaderField(e, t, i)
        }, e.initDataBase = function (e, t) {
            return r.initDataBase(e, t)
        }, e.beginTransaction = function () {
            s.information("beginTransaction transactionId:", l);
            let e = l;
            return r.beginTransaction(e), l >= Number.MAX_SAFE_INTEGER ? l = 0 : l++, d.push(e), e
        }, e.commitTransaction = function (e) {
            let t = -1;
            s.information("commitTransaction transactionId:", e);
            for (let i = 0; i < d.length; ++i) if (d[i] === e) {
                d.splice(i, 1), t = r.commitTransaction(e);
                break
            }
            return t
        }, e.commitAllTransaction = function () {
            for (let e = 0; e < d.length; ++e) r.commitTransaction(d[e]);
            d = []
        }, e.rollbackTransaction = function (e) {
            return s.information("rollbackTransaction transactionId:", e), r.rollbackTransaction(e)
        }, e.execSqlite = function (e, t) {
            return r.execSqlite(e, t)
        }, e.querySqlite = function (e, t) {
            return r.querySqlite(e, t)
        }, e.insertTaskBase = function (e) {
            r.insertTaskBase(e)
        }, e.insertP2spTask = function (e, t, i, n, a, o, s) {
            r.insertP2spTask(e, t, i, n, a, o, s)
        }, e.insertBtTask = function (e, t, i, n, a) {
            r.insertBtTask(e, t, i, n, a)
        }, e.insertBtFile = function (e, t) {
            r.insertBtFile(e, t)
        }, e.insertEmuleTask = function (e, t, i) {
            r.insertEmuleTask(e, t, i)
        }, e.insertGroupTask = function (e, t, i, n) {
            r.insertGroupTask(e, t, i, n)
        }, e.insertMagnetTask = function (e) {
            r.insertMagnetTask(e)
        }, e.deleteStorageTask = function (e, t) {
            r.deleteStorageTask(e, t)
        }, e.loadTaskBase = function (e) {
            r.loadTaskBase(e)
        }, e.loadBtFile = function (e) {
            r.loadBtFile(e)
        }, e.loadStorageTask = function (e, t, i) {
            r.loadStorageTask(e, t, i)
        }, e.saveTaskBaseInfo = function (e, t, i, n) {
            r.saveTaskBaseInfo(e, t, i, n)
        }, e.saveTaskUserData = function (e, t) {
            r.saveTaskUserData(e, t)
        }, e.saveTaskChannelInfo = function (e, t, i, n, a, o) {
            r.saveTaskChannelInfo(e, t, i, n, a, o)
        }, e.setP2spTaskOriginOnly = function (e, t) {
            r.setP2spTaskOriginOnly(e, t)
        }, e.setP2spTaskThreadCount = function (e, t) {
            r.setP2spTaskThreadCount(e, t)
        }, e.saveBtFileInfo = function (e, t, i, n, a) {
            r.saveBtFileInfo(e, t, i, n, a)
        }, e.saveBtTaskSeedFile = function (e, t) {
            r.saveBtTaskSeedFile(e, t)
        }, e.saveBtFileCid = function (e, t, i, n) {
            r.saveBtFileCid(e, t, i, n)
        }, e.saveBtFileUserRead = function (e, t, i) {
            r.saveBtFileUserRead(e, t, i)
        }, e.setCategoryId = function (e, t) {
            r.setCategoryId(e, t)
        }, e.loadCategory = function (e) {
            r.loadCategory(e)
        }, e.createCategory = function (e, t, i, n, a, o, s) {
            r.createCategory(e, t, i, n, a, o, s)
        }, e.setCategoryPassword = function (e, t, i, n) {
            r.setCategoryPassword(e, t, i, n)
        }, e.setCategoryAccountPassword = function (e, t) {
            r.setCategoryAccountPassword(e, t)
        }, e.searchTask = function (e, t, i, n, a) {
            r.searchTask(e, t, i, n, a)
        }, e.filterTask = function (e, t, i, n, a, o, s) {
            r.filterTask(e, t, i, n, a, o, s)
        }, e.setTaskPriorityLevel = function (e, t, i) {
            r.setTaskPriorityLevel(e, t, i)
        }, e.setBtFileFailureErrorCode = function (e, t, i) {
            r.setBtFileFailureErrorCode(e, t, i)
        }, e.setBtFilePlayPosition = function (e, t, i) {
            r.setBtFilePlayPosition(e, t, i)
        }, e.setBtFileDuration = function (e, t, i) {
            r.setBtFileDuration(e, t, i)
        }, e.batchFindP2spTask = function (e, t) {
            return 0 === r.batchFindP2spTask(e, t)
        }, e.batchFindEmuleTask = function (e, t) {
            return 0 === r.batchFindEmuleTask(e, t)
        }, e.batchFindBtTask = function (e, t) {
            return 0 === r.batchFindBtTask(e, t)
        }, e.batchFindGroupTask = function (e, t) {
            return 0 === r.batchFindGroupTask(e, t)
        }, e.verifyProxy = function (e, t, i, n, a, o) {
            return n || (n = ""), i || (i = "", n = ""), t = t ? Number(t) : 0, r.verifyProxy(e, t, i, n, a, o)
        }, e.setProxy = function (e, t, i, n, a) {
            return a || (a = ""), n || (n = "", a = ""), i = i ? Number(i) : 0, r.setProxy(e, t, i, n, a)
        }, e.getSumOfRemotePeerBeBenefited = function (e) {
            return r.getSumOfRemotePeerBeBenefited(e)
        }, e.isFileSizeSetterWorking = function (e) {
            return r.isFileSizeSetterWorking(e)
        }, e.launchFileAssistant = function (e) {
            return r.launchFileAssistant(e)
        }, e.getTaskProfileLog = function (e, t, i) {
            return r.getTaskProfileLog(e, t, i)
        }, e.stopPushStorageCommand = function () {
            return r.stopPushStorageCommand()
        }, e.getStorageWaitingCommandSize = function () {
            return r.getStorageWaitingCommandSize()
        }, e.addServer = function (e, t, i) {
            r.addServer(e, t, i)
        }, e.discardServer = function (e, t, i) {
            r.discardServer(e, t, i)
        }
    }(t.ThunderKernel || (t.ThunderKernel = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(0), a = i(4), o = i(26), r = i(23), s = n.default.getLogger("Thunder.MainRenderer.TabsBrowser");

    class l {
        constructor() {
        }

        registerNativeFunction(e, t) {
            let i = !1;
            do {
                if (a.isNullOrUndefined(e) || "" === e) {
                    s.error(e);
                    break
                }
                if (a.isNullOrUndefined(t)) {
                    s.error(t);
                    break
                }
                if (a.isNullOrUndefined(l.nativeFunctionContainer)) {
                    s.error(t);
                    break
                }
                let n = l.nativeFunctionContainer.filter(t => e === t.functionName);
                if (a.isNullOrUndefined(n)) {
                    let n = {functionName: e, nativeFunc: t};
                    l.nativeFunctionContainer.push(n), i = !0
                }
            } while (0);
            return i
        }

        unregisterNativeFunction(e) {
            let t = !1;
            do {
                if (a.isNullOrUndefined(e) || "" === e) {
                    s.error(e);
                    break
                }
                if (a.isNullOrUndefined(l.nativeFunctionContainer)) {
                    s.error(l.nativeFunctionContainer);
                    break
                }
                for (let i in l.nativeFunctionContainer) if (l.nativeFunctionContainer[Number(i)].functionName === e) {
                    l.nativeFunctionContainer.splice(Number(i), 1), t = !0;
                    break
                }
            } while (0);
            return t
        }

        onJsCallNativeFunction(e, t, i, n) {
            let d = !1;
            do {
                if (a.isNullOrUndefined(e) && s.error(e), a.isNullOrUndefined(t) || "" === t) {
                    s.error(t);
                    break
                }
                if (a.isNullOrUndefined(l.nativeFunctionContainer)) {
                    s.error(l.nativeFunctionContainer);
                    break
                }
                let u = l.nativeFunctionContainer.filter(e => t === e.functionName), c = void 0,
                    h = r.NativeFunctionErrorCode.Success;
                if (a.isNullOrUndefined(u) || 0 === u.length || a.isNullOrUndefined(u[0].nativeFunc)) {
                    if (h = r.NativeFunctionErrorCode.FunctionUnExist, a.isNullOrUndefined(i)) {
                        d = !0;
                        break
                    }
                    if (a.isNullOrUndefined(o.NativeCallHostModule.nativeCallHost)) {
                        s.error(o.NativeCallHostModule.nativeCallHost);
                        break
                    }
                    o.NativeCallHostModule.nativeCallHost.callJsFunctionById.apply(o.NativeCallHostModule.nativeCallHost, [e].concat(i, h, c))
                } else u[0].nativeFunc(this, e, i, n)
            } while (0);
            return d
        }

        onJsCheckNativeFunction(e, t, i) {
            do {
                if (a.isNullOrUndefined(e) && s.error(e), a.isNullOrUndefined(i)) break;
                if (a.isNullOrUndefined(t) || "" === t) {
                    s.error(t);
                    break
                }
                if (a.isNullOrUndefined(l.nativeFunctionContainer)) {
                    s.error(l.nativeFunctionContainer);
                    break
                }
                let n = l.nativeFunctionContainer.filter(e => t === e.functionName),
                    d = r.NativeFunctionErrorCode.Success;
                if ((a.isNullOrUndefined(n) || a.isNullOrUndefined(n[0]) || a.isNullOrUndefined(n[0].nativeFunc)) && (d = r.NativeFunctionErrorCode.FunctionUnExist, s.error(n)), a.isNullOrUndefined(o.NativeCallHostModule.nativeCallHost)) {
                    s.error(o.NativeCallHostModule.nativeCallHost);
                    break
                }
                o.NativeCallHostModule.nativeCallHost.callJsFunctionById(e, i, d)
            } while (0);
            return !1
        }

        callNativeFunctionCallback(e, t, ...i) {
            let n = !1;
            do {
                if (a.isNullOrUndefined(t)) {
                    s.error(t);
                    break
                }
                if (a.isNullOrUndefined(o.NativeCallHostModule.nativeCallHost)) {
                    s.error(o.NativeCallHostModule.nativeCallHost);
                    break
                }
                o.NativeCallHostModule.nativeCallHost.callJsFunctionById.apply(o.NativeCallHostModule.nativeCallHost, [e].concat(t, i)), n = !0
            } while (0);
            return n
        }
    }

    l.nativeFunctionContainer = [], t.NativeCall = l;
    const d = new l;
    !function (e) {
        function t(e, t, i, n) {
            d.onJsCallNativeFunction(e, t, i, n)
        }

        function i(e, t, i) {
            d.onJsCheckNativeFunction(e, t, i)
        }

        e.init = function () {
            o.NativeCallHostModule.nativeCallHost.initialize();
            let e = {onJsCallNativeFunction: t, onJsCheckNativeFunction: i};
            o.NativeCallHostModule.nativeCallHost.addDelegate(e)
        }, e.registerNativeFunction = function (e) {
            let t = !1;
            do {
                if (a.isNullOrUndefined(e)) {
                    s.error("event listeners error");
                    break
                }
                if (0 === e.length) {
                    s.error("event listeners length error");
                    break
                }
                l.nativeFunctionContainer = [...l.nativeFunctionContainer, ...e], t = !0
            } while (0);
            return t
        }, e.unregisterNativeFunction = function (e) {
            for (let t of e) for (let e = 0; e < l.nativeFunctionContainer.length; e++) if (l.nativeFunctionContainer[e].functionName === t) {
                l.nativeFunctionContainer.splice(e, 1);
                break
            }
        }, e.checkNativeFunction = function (e) {
            let t = !1;
            do {
                if (!e) break;
                if (a.isNullOrUndefined(l.nativeFunctionContainer)) break;
                if (0 === l.nativeFunctionContainer.length) break;
                for (let i = 0; i < l.nativeFunctionContainer.length; i++) if (l.nativeFunctionContainer[i].functionName === e) {
                    t = !0;
                    break
                }
            } while (0);
            return t
        }
    }(t.NativeCallNS || (t.NativeCallNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(107), a = i(588), o = i(589), r = i(590), s = i(591), l = i(592), d = i(593), u = i(594), c = i(595),
        h = i(596), f = i(597), g = i(598), p = i(599), v = i(600), m = i(79);
    n.default.use(a.default);
    const y = new a.default.Store({
        modules: {
            Tabs: r.default,
            DownloadListState: l.default,
            ToolbarState: d.default,
            VipSpeedState: u.default,
            WebView: c.default,
            SettingConf: s.default,
            Community: h.default,
            PrivateSpaceState: f.default,
            UpgradeTaskState: g.default,
            BookMarks: p.default,
            Group: v.default,
            Navs: m.default
        }, strict: !1
    });
    t.connector = new o.default(y)
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(75), o = i(53), r = i(5), s = i(0).default.getLogger("Thunder.base.tools-utilities"), l = i(2),
        d = i(6).default(l.join(__rootDir, "../bin/ThunderHelper.node"));
    !function (e) {
        function t(e) {
            return n(this, void 0, void 0, function* () {
                let t;
                return t = e && (yield r.FileSystemAWNS.existsAW(e)) ? new Promise(t => {
                    d.asyncCalcuteFileMD5(e, (e, i) => {
                        e ? (i = i.toUpperCase(), t(i)) : t(void 0)
                    })
                }) : new Promise(e => {
                    e(void 0)
                })
            })
        }

        e.genarateMd5 = function (e) {
            let t = void 0, i = a.createHash("md5");
            return null !== i && (t = i.update(e).digest("hex")), t
        }, e.matchFileMd5 = function (e, i) {
            return n(this, void 0, void 0, function* () {
                let n = !1, a = yield t(e);
                return void 0 !== a && a === i.toUpperCase() && (s.information("check full md5 sucessful"), n = !0), n
            })
        }, e.calculateFileMd5Ex = function (e) {
            return n(this, void 0, void 0, function* () {
                let t;
                if (e && (yield r.FileSystemAWNS.existsAW(e))) {
                    let i = o.createReadStream(e), n = a.createHash("md5");
                    i.on("data", e => {
                        n.update(e)
                    }), t = new Promise(e => {
                        i.on("end", () => {
                            let t = n.digest("hex");
                            t = t.toUpperCase(), e(t)
                        })
                    })
                } else t = new Promise(e => {
                    e(void 0)
                });
                return t
            })
        }, e.calculateFileMd5 = t, e.encryptBuffer = function (e, t) {
            let i = null;
            try {
                let n = a.createCipheriv("aes-128-ecb", t, ""), o = n.update(e), r = n.final();
                i = Buffer.concat([o, r])
            } catch (e) {
                s.error("encryptBuffer", e)
            }
            return i
        }, e.decryptBuffer = function (e, t) {
            let i = null;
            try {
                let n = a.createDecipheriv("aes-128-ecb", t, ""), o = n.update(e), r = n.final();
                i = Buffer.concat([o, r])
            } catch (e) {
                s.error("decryptBuffer", e)
            }
            return i
        }, e.encryptSha1Buffer = function (e) {
            let t = null;
            try {
                t = a.createHash("sha1").update(e).digest("hex")
            } catch (e) {
                s.error("encryptSha1Buffer", e)
            }
            return t
        }, e.encryptHmacBuffer = function (e, t, i, n = "hex") {
            let o = null;
            try {
                o = a.createHmac(e, t).update(i, "utf8").digest(n)
            } catch (e) {
                s.error("encryptSha1Buffer", e)
            }
            return o
        }, e.setForegroundWindow = function (e, t) {
            return n(this, void 0, void 0, function* () {
                if (null !== e && null !== t) {
                    let i = void 0, a = [];
                    "renderer" === process.type ? (i = yield t.getNativeWindowHandle(), a = yield t.getChildWindows()) : (i = t.getNativeWindowHandle(), a = t.getChildWindows());
                    let o = [];
                    for (let e = 0; e < a.length; ++e) {
                        let t = a[e], i = !1;
                        "renderer" === process.type ? (yield t.isDestroyed()) || (i = yield t.isAlwaysOnTop()) : t.isDestroyed() || (i = t.isAlwaysOnTop()), i && o.push(t)
                    }
                    let r = i.readUIntLE(0, 4);
                    e.setForegroundWindow(r) ? s.information("setForegroundWindow sucessful") : s.information("setForegroundWindow failed"), o.forEach(e => n(this, void 0, void 0, function* () {
                        "renderer" === process.type ? (yield e.isDestroyed()) || e.setAlwaysOnTop(!0).catch() : e.isDestroyed() || e.setAlwaysOnTop(!0)
                    }))
                }
            })
        }
    }(t.ToolsUtilitiesAWNS || (t.ToolsUtilitiesAWNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(84), r = i(57), s = i(3), l = i(6).default(a.join(__rootDir, "../bin/ThunderHelper.node"));
    !function (e) {
        let t, i;

        function a(e) {
            let t = e;
            return /^[a-zA-Z]:\\/.test(e) ? t = e.slice(0, 3) : e && "\\" !== e[e.length - 1] && (t = e + "\\"), t
        }

        !function (e) {
            e[e.DRIVE_UNKNOWN = 0] = "DRIVE_UNKNOWN", e[e.DRIVE_NO_ROOT_DIR = 1] = "DRIVE_NO_ROOT_DIR", e[e.DRIVE_REMOVABLE = 2] = "DRIVE_REMOVABLE", e[e.DRIVE_FIXED = 3] = "DRIVE_FIXED", e[e.DRIVE_REMOTE = 4] = "DRIVE_REMOTE", e[e.DRIVE_CDROM = 5] = "DRIVE_CDROM", e[e.DRIVE_RAMDISK = 6] = "DRIVE_RAMDISK"
        }(t = e.DriverType || (e.DriverType = {})), function (e) {
            e[e.Unspecified = 0] = "Unspecified", e[e.HDD = 3] = "HDD", e[e.SSD = 4] = "SSD", e[e.SCM = 5] = "SCM"
        }(i = e.MediaType || (e.MediaType = {})), e.getDriveType = function (e) {
            return e = a(e), l.getDriveType(e)
        }, e.getDriveInfo = function (e) {
            return e = a(e), l.getDriveInfo(e)
        }, e.getFreePartitionSpace = function (e) {
            return e = a(e), l.getFreePartitionSpace(e)
        }, e.getLogicalDriveStrings = function () {
            return l.getLogicalDriveStrings()
        }, e.getPartitionSpace = function (e) {
            return e = a(e), l.getPartitionSpace(e)
        }, e.getSystemTempPath = function () {
            return l.getSystemTempPath()
        }, e.getTaskTypeFromUrl = function (e) {
            let t = l.getTaskTypeFromUrl(e);
            if (t === s.DownloadKernel.TaskType.Unkown && function (e) {
                e = e.toLowerCase();
                let t = !1;
                do {
                    if ("http://" === e.substr(0, "http://".length)) {
                        t = !0;
                        break
                    }
                    if ("https://" === e.substr(0, "https://".length)) {
                        t = !0;
                        break
                    }
                    if ("ftp://" === e.substr(0, "ftp://".length)) {
                        t = !0;
                        break
                    }
                } while (0);
                return t
            }(e)) {
                let i = /:\/\/\[(.+?)\].*/.exec(e);
                i || (i = /^ftp:\/\/.*?\[(.+?)\].*/.exec(e)), i && i[1] && o.isIPv6(i[1]) && (t = s.DownloadKernel.TaskType.P2sp)
            }
            return t
        }, e.extractIcon = function (e, t) {
            return l.extractIcon(e, t)
        }, e.isWindow7 = function () {
            return 1 === l.isWin7()
        }, e.isWindow8OrLater = function () {
            let e = !1;
            do {
                let t = r.release();
                if (!t) break;
                let i = t.indexOf(".", 0);
                if (i < 0) break;
                let n = t.substring(0, i);
                if (!n) break;
                let a = parseInt(n, 10);
                a && a >= 8 && (e = !0)
            } while (0);
            return e
        }, e.isWindows10 = function () {
            let e = !1;
            do {
                let t = r.release();
                if (!t) break;
                if (0 === t.indexOf("10.0.")) {
                    e = !0;
                    break
                }
            } while (0);
            return e
        }, e.compareStr = function (e, t) {
            return l.compareStr(e, t)
        }, e.getTickCount = function () {
            return l.getTickCount()
        }, e.setScreenSaveActive = function (e) {
            return l.setScreenSaveActive(e)
        }, e.isSparseDriver = function (e) {
            return e = a(e), l.isSparseDriver(e)
        }, e.getAppList = function () {
            return n(this, void 0, void 0, function* () {
                return new Promise(e => {
                    l.getAppList(t => {
                        e(t)
                    })
                })
            })
        }, e.isSSD = function () {
            return n(this, void 0, void 0, function* () {
                return new Promise(e => {
                    l.isSSD((t, i) => {
                        e(i)
                    })
                })
            })
        }, e.getMemoryInfo = function () {
            return n(this, void 0, void 0, function* () {
                return new Promise(e => {
                    l.getMemoryInfo((t, i) => {
                        e({totalPhy: t, totalVir: i})
                    })
                })
            })
        }, e.getHardDiskSpaceList = function () {
            return n(this, void 0, void 0, function* () {
                return new Promise(e => {
                    l.getHardDiskSpaceList(t => {
                        e(t)
                    })
                })
            })
        }, e.getCpuList = function () {
            return n(this, void 0, void 0, function* () {
                return new Promise(e => {
                    l.getCpuList(t => {
                        e(t)
                    })
                })
            })
        }, e.getFixedDriveMediaType = function (e) {
            return n(this, void 0, void 0, function* () {
                return new Promise(t => {
                    e.length > 1 && (e = e.slice(0, 1)), l.getDriveMediaType(e.toUpperCase(), (e, i) => {
                        t(i)
                    })
                })
            })
        }
    }(t.ThunderHelper || (t.ThunderHelper = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(17), r = i(0), s = i(6), l = i(5), d = i(3), u = i(30), c = i(11), h = i(40), f = i(29),
        g = i(15), p = i(42), v = i(59), m = i(22), y = i(37), k = i(9), T = i(47), w = i(10), C = i(38), S = i(4),
        b = i(27), I = i(28), _ = i(43), A = i(49), D = i(46), x = i(51), N = i(61), E = i(317), P = i(41), M = i(318),
        O = i(69), F = i(45), L = i(93), B = i(20), U = i(25), R = i(71), K = i(12), W = i(35), V = i(54),
        H = r.default.getLogger("Thunder.TaskOperator"), z = s.default(a.join(__rootDir, "../bin/ThunderHelper.node")),
        j = c.DownloadKernelTaskManager.getTaskManager(),
        G = h.DownloadKernelCategoryViewManager.getCategoryViewManager(),
        $ = f.DownloadKernelCategoryManager.getCategoryManager(), X = g.DownloadKernelEventManager.getEventManager(),
        q = A.ToastNotifyManagerNS.getToastNotifyManger();

    function Y(e) {
        return n(this, void 0, void 0, function* () {
            if (void 0 !== e) {
                let t = e + "\\.";
                yield(yield K.asyncRemoteCall.getShell()).showItemInFolder(t)
            }
        })
    }

    function J(e) {
        return n(this, void 0, void 0, function* () {
            return new Promise(t => n(this, void 0, void 0, function* () {
                e.properties = ["openFile"];
                let i = yield K.asyncRemoteCall.getCurrentWindow();
                (yield K.asyncRemoteCall.getDialog()).showOpenDialog(i, e, e => {
                    t(void 0 !== e ? e[0] : void 0)
                })
            }))
        })
    }

    function Z() {
        m.MessageBox.pop({
            title: "提示",
            size: "small",
            message: "临时文件无法正常载入，导入任务失败!",
            okText: "确定",
            cancelVisible: !1
        }).catch()
    }

    function Q() {
        return n(this, void 0, void 0, function* () {
            return E.DownloadAndPlayNS.getXmpPath()
        })
    }

    function ee(e) {
        return n(this, void 0, void 0, function* () {
            let t = 0;
            return new Promise(i => {
                t = X.attachTaskEvent(d.DownloadKernel.TaskEventType.StatusChanged, (...n) => {
                    do {
                        if (!n) break;
                        if (n[0] !== d.DownloadKernel.TaskEventType.StatusChanged) break;
                        if (!n[1]) break;
                        let a = n[1];
                        for (let n = 0; n < a.length; ++n) {
                            let o = a[n];
                            if (!o) continue;
                            let r = o.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskId);
                            if (e === r) {
                                o.getTaskStatus() === d.DownloadKernel.TaskStatus.Started && (X.detachTaskEvent(d.DownloadKernel.TaskEventType.StatusChanged, t), i(!0));
                                break
                            }
                        }
                    } while (0)
                })
            })
        })
    }

    !function (e) {
        function t(e) {
            return n(this, void 0, void 0, function* () {
                return new Promise(t => {
                    e ? z.asyncShellExecute(0, "open", e, "", "", "SW_SHOW", i => {
                        H.information("async openitem", e, i), t(!(i <= 32))
                    }) : t(!1)
                })
            })
        }

        function i(e, t) {
            let i = p.Common.getTaskTypeFromImportingFile(e);
            i === d.DownloadKernel.TaskType.P2sp ? function (e, t) {
                return n(this, void 0, void 0, function* () {
                    let i = {errcode: 0, errinfo: "success"};
                    do {
                        let n = e + ".cfg";
                        if (!(yield l.FileSystemAWNS.existsAW(n))) {
                            i.errcode = 2, i.errinfo = "缺少.cfg文件,无法导入";
                            break
                        }
                        let a = yield v.TaskUtilitiesAWNS.importUnfinishedTaskAW(e, "");
                        if (null !== a && 0 === a.ret) {
                            let n = {taskType: d.DownloadKernel.TaskType.P2sp, value: a.url},
                                o = yield v.TaskUtilitiesAWNS.batchFindTaskAW([n]);
                            if (o && o.length > 0) {
                                i.errcode = 3, i.extra = o[0], C.ThunderNewTask.repeatTasksMsg([o[0]]);
                                break
                            }
                            let r = {
                                taskBaseInfo: {
                                    taskName: p.Common.getTaskNameFromImportFile(e),
                                    savePath: p.Common.getSavePathFromImportFile(e),
                                    origin: t = void 0 === t ? "Unknown" : t
                                }, p2spTaskInfo: {url: a.url, refUrl: "", cookie: ""}
                            }, s = yield j.createTask(d.DownloadKernel.TaskType.P2sp, r);
                            if (null !== s) {
                                let e = s.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskId);
                                _.DownloadDispatchNS.startTask(e)
                            } else H.warning("createTask failed")
                        } else i.errcode = 2, i.errinfo = "临时文件无法正常载入，导入任务失败", Z()
                    } while (0);
                    return i
                })
            }(e, t).then(e => {
                H.information(e.errcode, e.errinfo)
            }).catch() : i === d.DownloadKernel.TaskType.Emule ? function (e, t) {
                return n(this, void 0, void 0, function* () {
                    let i = {errcode: 0, errinfo: "success"};
                    do {
                        let n = "";
                        if (".PART" === a.extname(e).toUpperCase() && (n = e + ".met", !(yield l.FileSystemAWNS.existsAW(n))) && void 0 === (n = yield J({
                            title: "导入eMule文件时,需要相应的MET文件,请选择MET文件",
                            filters: [{name: "met文件(*.met)", extensions: ["met"]}]
                        }))) break;
                        let o = yield v.TaskUtilitiesAWNS.importUnfinishedTaskAW(e, n);
                        if (null !== o && 0 === o.ret) {
                            let n = p.Common.parseEd2kUrl(o.url);
                            if (null !== n) {
                                let a = {taskType: d.DownloadKernel.TaskType.Emule, value: n.fileHash},
                                    r = yield v.TaskUtilitiesAWNS.batchFindTaskAW([a]);
                                if (r && r.length > 0) {
                                    i.errcode = 3, i.extra = r[0], C.ThunderNewTask.repeatTasksMsg([r[0]]);
                                    break
                                }
                                let s = {
                                    taskBaseInfo: {
                                        taskName: p.Common.getTaskNameFromImportFile(e),
                                        savePath: p.Common.getSavePathFromImportFile(e),
                                        origin: t = void 0 === t ? "Unknown" : t
                                    }, emuleTaskInfo: {url: o.url}
                                }, l = yield j.createTask(d.DownloadKernel.TaskType.Emule, s);
                                if (null !== l) {
                                    let e = l.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskId);
                                    _.DownloadDispatchNS.startTask(e)
                                }
                            }
                        } else i.errcode = 2, i.errinfo = "导入失败,该任务临时文件无法正常载入", Z()
                    } while (0);
                    return i
                })
            }(e, t).then(e => {
                H.information(e.errcode, e.errinfo)
            }).catch() : i === d.DownloadKernel.TaskType.Bt && function (e, t) {
                return n(this, void 0, void 0, function* () {
                    let i = a.dirname(e), n = void 0;
                    if (yield l.FileSystemAWNS.existsAW(i)) {
                        let t = yield l.FileSystemAWNS.readdirAW(i);
                        for (let o = 0; o < t.length; o++) {
                            let r = t[o];
                            if (".torrent" === a.extname(r)) {
                                n = r;
                                let t = a.join(i, r), o = yield v.TaskUtilitiesAWNS.parserBtFileInfoAW(t);
                                if (1 !== o.fileLists.length) break;
                                {
                                    let t = a.basename(e);
                                    if (t = a.basename(t, ".bt.xltd"), o.fileLists[0].fileName === t) break
                                }
                            }
                        }
                    }
                    do {
                        if (void 0 === n || null === n || "" === n) break;
                        let e = a.join(__profilesDir, "Torrents"), o = a.join(e, n);
                        if (yield l.FileSystemAWNS.existsAW(o)) {
                            let e = yield v.TaskUtilitiesAWNS.parserBtFileInfoAW(o),
                                n = {taskType: d.DownloadKernel.TaskType.Bt, value: e.infoId},
                                r = yield v.TaskUtilitiesAWNS.batchFindTaskAW([n]);
                            if (r && r.length > 0) {
                                C.ThunderNewTask.repeatTasksMsg([r[0]]);
                                break
                            }
                            let s = e.title, l = i;
                            e.fileLists.length > 1 && (l = a.dirname(i), s = a.basename(i));
                            let u = [];
                            for (let t = 0; t < e.fileLists.length; ++t) u.push(e.fileLists[t].realIndex);
                            let h = e.trackerUrls.join("\n"), f = {
                                    taskBaseInfo: {
                                        savePath: l,
                                        taskName: s,
                                        productInfo: P.TaskCtrlOperatorNS.constructProductInfo(""),
                                        origin: t = void 0 === t ? "Unknown" : t,
                                        import: !0
                                    },
                                    btTaskInfo: {
                                        seedFile: o,
                                        displayName: e.title,
                                        fileRealIndexLists: u,
                                        fileLists: e.fileLists,
                                        infoId: e.infoId,
                                        tracker: h
                                    }
                                },
                                g = yield c.DownloadKernelTaskManager.getTaskManager().createTask(d.DownloadKernel.TaskType.Bt, f);
                            if (null !== g) {
                                let e = g.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskId);
                                _.DownloadDispatchNS.startTask(e)
                            }
                        }
                    } while (0)
                })
            }(e, t).catch()
        }

        function r(e, t) {
            return n(this, void 0, void 0, function* () {
                let i = [];
                do {
                    if (void 0 === e || null === e) break;
                    let n = j.getTaskFromTaskId(e);
                    if (null === n) break;
                    if (n.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskType) !== d.DownloadKernel.TaskType.Bt) break;
                    let o = n.getExtraObject();
                    if (0 === o.getDownloadFile().length) break;
                    if (yield F.SingleBtTaskNS.isSingleBtTask(n)) {
                        let e = F.SingleBtTaskNS.getSinleBtTaskFilePath(n), a = o.getBtFileList();
                        for (let [, n]of a) {
                            let a = n.getBtFileAttribute(d.DownloadKernel.BtFileAttribute.RealIndex),
                                o = n.getBtFileAttribute(d.DownloadKernel.BtFileAttribute.Download),
                                r = n.getBtFileAttribute(d.DownloadKernel.BtFileAttribute.FileName);
                            if (1 === o) {
                                let o = T.TaskUtilHelper.getTaskFileType(r);
                                if (null !== t && void 0 !== t && -1 !== t) {
                                    if (t === a) {
                                        i.push({fileExtType: o, fullPath: e, btFile: n});
                                        break
                                    }
                                } else i.push({fileExtType: o, fullPath: e, btFile: n})
                            }
                            break
                        }
                    } else {
                        let e = n.getTaskAttribute(d.DownloadKernel.TaskAttribute.SavePath),
                            r = n.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskName), s = o.getBtFileList();
                        for (let [, n]of s) {
                            let o = n.getBtFileAttribute(d.DownloadKernel.BtFileAttribute.RealIndex),
                                s = n.getBtFileAttribute(d.DownloadKernel.BtFileAttribute.Download),
                                l = n.getBtFileAttribute(d.DownloadKernel.BtFileAttribute.FileName),
                                u = n.getBtFileAttribute(d.DownloadKernel.BtFileAttribute.FilePath),
                                c = a.join(e, r, u, l);
                            if (1 === s) {
                                let e = T.TaskUtilHelper.getTaskFileType(l);
                                if (null !== t && void 0 !== t && -1 !== t) {
                                    if (t === o) {
                                        i.push({fileExtType: e, fullPath: c, btFile: n});
                                        break
                                    }
                                } else i.push({fileExtType: e, fullPath: c, btFile: n})
                            }
                        }
                    }
                } while (0);
                return i
            })
        }

        function s(e) {
            let t = !1;
            do {
                let i = 0;
                if (null !== e && (i = e.getTaskAttribute(d.DownloadKernel.TaskAttribute.ErrorCode)), 7 === i) {
                    t = !0;
                    break
                }
                if (i >= 700 && i <= 799) {
                    t = !0;
                    break
                }
            } while (0);
            return t
        }

        function h(e, t) {
            return n(this, void 0, void 0, function* () {
                let i = [];
                do {
                    if (void 0 === e || null === e) break;
                    let n = j.getTaskFromTaskId(e);
                    if (null === n) break;
                    if (n.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskType) !== d.DownloadKernel.TaskType.Bt) break;
                    let o = n.getExtraObject();
                    if (0 === o.getDownloadFile().length) break;
                    if (yield F.SingleBtTaskNS.isSingleBtTask(n)) {
                        let e = F.SingleBtTaskNS.getSinleBtTaskFilePath(n), a = o.getBtFileList();
                        for (let [, n]of a) {
                            let a = n.getBtFileAttribute(d.DownloadKernel.BtFileAttribute.RealIndex),
                                o = n.getBtFileAttribute(d.DownloadKernel.BtFileAttribute.Download),
                                r = n.getBtFileAttribute(d.DownloadKernel.BtFileAttribute.FileName),
                                s = n.getBtFileAttribute(d.DownloadKernel.BtFileAttribute.Cid),
                                l = n.getBtFileAttribute(d.DownloadKernel.BtFileAttribute.Gcid),
                                u = n.getBtFileAttribute(d.DownloadKernel.BtFileAttribute.PlayPosition),
                                c = n.getBtFileAttribute(d.DownloadKernel.BtFileAttribute.Duration);
                            if (1 === o) {
                                if (T.TaskUtilHelper.getTaskFileType(r) === T.TaskUtilHelper.FileExtType.Video) if (null !== t && void 0 !== t && -1 !== t) {
                                    if (a === t) {
                                        i.push({
                                            fileName: r,
                                            fullPath: e,
                                            index: a,
                                            cid: s,
                                            gcid: l,
                                            playPosition: u,
                                            duration: c
                                        });
                                        break
                                    }
                                } else i.push({
                                    fileName: r,
                                    fullPath: e,
                                    index: a,
                                    cid: s,
                                    gcid: l,
                                    playPosition: u,
                                    duration: c
                                })
                            }
                            break
                        }
                    } else {
                        let e = n.getTaskAttribute(d.DownloadKernel.TaskAttribute.SavePath),
                            r = n.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskName), s = o.getBtFileList();
                        for (let [, n]of s) {
                            let o = n.getBtFileAttribute(d.DownloadKernel.BtFileAttribute.RealIndex),
                                s = n.getBtFileAttribute(d.DownloadKernel.BtFileAttribute.Download),
                                l = n.getBtFileAttribute(d.DownloadKernel.BtFileAttribute.FileName),
                                u = n.getBtFileAttribute(d.DownloadKernel.BtFileAttribute.FilePath),
                                c = a.join(e, r, u, l), h = n.getBtFileAttribute(d.DownloadKernel.BtFileAttribute.Cid),
                                f = n.getBtFileAttribute(d.DownloadKernel.BtFileAttribute.Gcid),
                                g = n.getBtFileAttribute(d.DownloadKernel.BtFileAttribute.PlayPosition),
                                p = n.getBtFileAttribute(d.DownloadKernel.BtFileAttribute.Duration);
                            if (1 === s) {
                                if (T.TaskUtilHelper.getTaskFileType(l) === T.TaskUtilHelper.FileExtType.Video) if (null !== t && void 0 !== t && -1 !== t) {
                                    if (o === t) {
                                        i.push({
                                            fileName: l,
                                            fullPath: c,
                                            index: o,
                                            cid: h,
                                            gcid: f,
                                            playPosition: g,
                                            duration: p
                                        });
                                        break
                                    }
                                } else i.push({
                                    fileName: l,
                                    fullPath: c,
                                    index: o,
                                    cid: h,
                                    gcid: f,
                                    playPosition: g,
                                    duration: p
                                })
                            }
                        }
                    }
                } while (0);
                return i
            })
        }

        function g(e, t) {
            return n(this, void 0, void 0, function* () {
                let i = [];
                do {
                    if (void 0 === e || null === e) break;
                    let n = j.getTaskFromTaskId(e);
                    if (null === n) break;
                    if (n.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskType) !== d.DownloadKernel.TaskType.Group) break;
                    let o = n.getExtraObject();
                    if (null === o || void 0 === o) break;
                    let r = o.getSubTaskCount();
                    for (let e = 0; e < r; ++e) {
                        let n = o.getSubTaskByIndex(e), r = e,
                            l = n.getTaskAttribute(d.DownloadKernel.TaskAttribute.DownloadSubTask),
                            u = n.getTaskAttribute(d.DownloadKernel.TaskAttribute.SavePath),
                            c = n.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskName), h = a.join(u, c),
                            f = n.getTaskAttribute(d.DownloadKernel.TaskAttribute.Cid),
                            g = n.getTaskAttribute(d.DownloadKernel.TaskAttribute.Gcid),
                            p = n.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskUrl),
                            v = n.getTaskAttribute(d.DownloadKernel.TaskAttribute.PlayPosition),
                            m = n.getTaskAttribute(d.DownloadKernel.TaskAttribute.Duration), y = s(n);
                        if (1 === l) {
                            if (T.TaskUtilHelper.getTaskFileType(c) === T.TaskUtilHelper.FileExtType.Video) if (null !== t && void 0 !== t && -1 !== t) {
                                if (r === t) {
                                    i.push({
                                        fileName: c,
                                        fullPath: h,
                                        index: r,
                                        cid: f,
                                        gcid: g,
                                        isForbidden: y,
                                        taskId: n.getId(),
                                        taskUrl: p,
                                        playPosition: v,
                                        duration: m
                                    });
                                    break
                                }
                            } else i.push({
                                fileName: c,
                                fullPath: h,
                                index: r,
                                cid: f,
                                gcid: g,
                                isForbidden: y,
                                taskId: n.getId(),
                                taskUrl: p,
                                playPosition: v,
                                duration: m
                            })
                        }
                    }
                } while (0);
                return i
            })
        }

        function E(e, t, i) {
            return n(this, void 0, void 0, function* () {
                let n = !1;
                if (void 0 !== t && "" !== t) {
                    if (!1 !== i) {
                        let e = w.ConfigNS.getValue("MoveToDir", "LatestSavePath", []), i = e.indexOf(t);
                        -1 !== i && e.splice(i, 1), e.splice(0, 0, t), e = e.slice(0, 3), w.ConfigNS.setValue("MoveToDir", "LatestSavePath", e), w.ConfigNS.save().catch()
                    }
                    for (let i of e) n = yield j.moveTaskToPath(i.taskId, t)
                }
                return n
            })
        }

        function X(e) {
            let t = e.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskType),
                i = e.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskUrl);
            if (t === d.DownloadKernel.TaskType.P2sp) {
                let t = e.getExtraObject().getDisplayUrl();
                "" !== t && void 0 !== t && (i = t)
            }
            return i
        }

        function te(e) {
            let t = -1;
            do {
                if (!e) break;
                if (e.getType() !== d.DownloadKernel.TaskType.Bt) break;
                let i = e.getExtraObject().getBtFileList();
                for (let e = 0; e < i.size; ++e) {
                    let n = i.get(e);
                    if (n && n.isSupportPlay()) {
                        t = e;
                        break
                    }
                }
            } while (0);
            return t
        }

        function ie(e, t = !1) {
            return n(this, void 0, void 0, function* () {
                function i(e) {
                    let t = e.getTaskAttribute(d.DownloadKernel.TaskAttribute.DownloadingPeriod),
                        i = e.getTaskAttribute(d.DownloadKernel.TaskAttribute.DownloadSize);
                    return 0 === t && (t = 1), Math.round(i / t)
                }

                let n = {ret: !1, errcode: 0};
                do {
                    let r = yield Q();
                    if (!r || !(yield l.FileSystemAWNS.existsAW(r))) {
                        if (!(yield M.default.installXmp())) break;
                        if (!(r = yield Q()) || !(yield l.FileSystemAWNS.existsAW(r))) break
                    }
                    if (!e.playUrl || "" === e.playUrl) break;
                    let s = j.getTaskFromTaskId(e.taskId), c = "", h = 0, f = "", g = void 0;
                    if (null !== s && void 0 !== s) {
                        if ((g = s.getType()) === d.DownloadKernel.TaskType.Bt) {
                            f = c = s.getExtraObject().getInfoId(), e.taskUrl || (e.taskUrl = "magnet:?xt=urn:btih:" + c)
                        } else if (g === d.DownloadKernel.TaskType.Magnet) {
                            c = s.getExtraObject().getFileHash()
                        } else g !== d.DownloadKernel.TaskType.Emule && g !== d.DownloadKernel.TaskType.P2sp || (c = s.getTaskBaseInfo().gcid);
                        h = i(s)
                    }
                    let p = te(s), v = [], m = '"' + e.playUrl + '"', y = "/sstartfrom xl11",
                        k = "/sopenfrom " + e.openFrom;
                    "dc" === e.playType && (v.push("/stype"), v.push("dc")), v.push(m), v.push(y), v.push(k);
                    let T = '/sname "' + e.fileName + '"';
                    v.push(T);
                    let w = "/scid " + e.cid;
                    v.push(w);
                    let b = "/sgcid " + e.gcid;
                    v.push(b), e.playPosPercent ? v.push("/iplaypercent " + 100 * e.playPosPercent) : S.isNumber(e.startPos) && (W.ThunderHelper.isWindows10() ? v.push("/iplayposition " + e.startPos) : v.push("/#i_laststartpos " + e.startPos));
                    let I = "/svideobtindex " + p;
                    v.push(I);
                    let _, A = U.default.getConfigInfo("XmpLitePlayer", "EmbedMode"),
                        D = o.remote.getCurrentWindow().getNativeWindowHandle().readUInt32LE(0);
                    v.push("-thunderwnd:" + D), H.information("[CrossProduct] embed=", A);
                    let x = V.XmpPlaySoure.PLAY_BY_DOWNLOAD;
                    if (s) {
                        let t = s.getTaskAttribute(d.DownloadKernel.TaskAttribute.GroupTaskId);
                        _ = "number" == typeof t && t > 0 ? t.toString() : e.taskId.toString()
                    } else e.panFileId && (_ = e.panFileId, x = V.XmpPlaySoure.PLAY_BY_PAN);
                    if (R.clientProduct.setPlayTaskId(_, x).catch(), null !== A && 1 !== A || !e.isEmbed || v.push("-embedmode"), t || (yield C.ThunderNewTask.selectTask(Number(_))), s) {
                        let e = s.getTaskAttribute(d.DownloadKernel.TaskAttribute.RefUrl);
                        if (e) {
                            let t = "/srefurl " + e;
                            v.push(t)
                        }
                    }
                    let N = (new Date).getTime();
                    v.push("/sclicktimestamp " + N), "" !== c && v.push("/scommentid " + c), h > 0 && v.push("/thunderdownloadSpeed " + h);
                    let E = "/sfilesize " + e.fileSize;
                    v.push(E);
                    let O = '/sshowurl "' + e.taskUrl + '"';
                    if (v.push(O), g === d.DownloadKernel.TaskType.Bt) {
                        let t = '/shashid "' + f + '"';
                        v.push(t);
                        let i = '/ssubid "' + e.fileIndex + '"';
                        v.push(i)
                    }
                    let F = '/sext "' + a.extname(e.fileName) + '"';
                    v.push(F);
                    let L = "/staskid " + e.taskId;
                    if (v.push(L), void 0 !== e.taskType) {
                        let t = "/stasktype " + e.taskType;
                        v.push(t)
                    }
                    if (null !== e.fileDir && void 0 !== e.fileDir && "" !== e.fileDir) {
                        let t = '/sFilePath "' + e.fileDir + '"';
                        v.push(t)
                    }
                    let K = "/ssdkver " + u.DownloadKernelManager.getDownloadSdkVersion();
                    v.push(K);
                    let G = yield P.TaskCtrlOperatorNS.getUserLoginInfo();
                    if ("" !== G && v.push(G), e.dlnaPlay && v.push("/sshowdlna on"), e.panFileId) {
                        let t = '/spanfileid "' + e.panFileId + '"';
                        v.push(t)
                    }
                    let $ = v.join(" ");
                    H.information("playVideoByXmp strArgs", $);
                    let X = a.dirname(r), q = z.shellExecute(0, "open", r, $, X, "SW_SHOW");
                    q > 32 ? n.ret = !0 : n.errcode = q, B.server.fireClientEvent("OnPlayVideo", q), H.information("shellExecute:result = ", q)
                } while (0);
                return n
            })
        }

        function ne(e, t, i, o, r, s, u, c = !0, p) {
            return n(this, void 0, void 0, function* () {
                let n = !1, v = j.getTaskFromTaskId(e);
                do {
                    if (!v) break;
                    if (!v.isSupportPlay()) break;
                    let m = !1, y = $.getCategoryFromId(r);
                    (!y || y && y.getName() === f.CategoryManager.panCategoryName) && (m = !0);
                    let T = {playUrl: "", fileName: ""}, C = "", S = v.getTaskStatus(), I = null;
                    if (T.taskUrl = v.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskUrl), T.fileSize = v.getTaskAttribute(d.DownloadKernel.TaskAttribute.FileSize), T.taskId = e, T.taskType = v.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskType), T.fileIndex = -1, T.isEmbed = p, T.dlnaPlay = s, T.startPos = void 0, T.playPosPercent = u, T.openFrom = "xunlei11", B.server.fireClientEvent("OnShowDownAndPlayToast", e), S === d.DownloadKernel.TaskStatus.Succeeded || S === d.DownloadKernel.TaskStatus.Seeding) {
                        if (T.taskType === d.DownloadKernel.TaskType.Emule || T.taskType === d.DownloadKernel.TaskType.P2sp) {
                            let e = v.getTaskAttribute(d.DownloadKernel.TaskAttribute.SavePath);
                            if (T.fileName = v.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskName), C = a.resolve(e, T.fileName), !(yield l.FileSystemAWNS.existsAW(C))) break;
                            if (T.cid = v.getTaskAttribute(d.DownloadKernel.TaskAttribute.Cid), T.gcid = v.getTaskAttribute(d.DownloadKernel.TaskAttribute.Gcid), T.playUrl = C, c) {
                                let e = v.getTaskAttribute(d.DownloadKernel.TaskAttribute.Duration),
                                    t = v.getTaskAttribute(d.DownloadKernel.TaskAttribute.PlayPosition);
                                T.startPos = e !== t ? t : 0
                            } else !1 === c && (T.startPos = 0)
                        } else if (T.taskType === d.DownloadKernel.TaskType.Bt || T.taskType === d.DownloadKernel.TaskType.Group) {
                            let i = [];
                            if (0 === (i = T.taskType === d.DownloadKernel.TaskType.Bt ? yield h(e, t) : yield g(e, t)).length) break;
                            if (null !== (I = (i.length, i[0]))) {
                                if (yield l.FileSystemAWNS.existsAW(I.fullPath)) T.playUrl = I.fullPath; else if (T.taskType === d.DownloadKernel.TaskType.Bt) T.playUrl = yield v.getPlayUrl(I.index); else {
                                    let e = v.getExtraObject().getSubTaskByIndex(I.index);
                                    null !== e && void 0 !== e && (T.playUrl = yield e.getPlayUrl(-1))
                                }
                                T.fileName = I.fileName, T.cid = I.cid, T.gcid = I.gcid, T.fileIndex = I.index, c ? I.duration !== I.playPosition ? T.startPos = I.playPosition : T.startPos = 0 : !1 === c && (T.startPos = 0), T.taskType === d.DownloadKernel.TaskType.Group && (T.taskId = I.taskId, T.taskUrl = I.taskUrl)
                            }
                        }
                    } else {
                        if (S === d.DownloadKernel.TaskStatus.StartWaiting) {
                            H.information("down and play waiting");
                            break
                        }
                        if (S === d.DownloadKernel.TaskStatus.Stopped || S === d.DownloadKernel.TaskStatus.Failed) {
                            if (!_.DownloadDispatchNS.startTask(e)) {
                                H.information("down and play start waiting");
                                break
                            }
                            yield ee(e)
                        }
                        v.setDownloadStrategy(1);
                        let i = !0;
                        if (T.taskType === d.DownloadKernel.TaskType.Bt || T.taskType === d.DownloadKernel.TaskType.Group) {
                            let n = [];
                            if (0 === (n = T.taskType === d.DownloadKernel.TaskType.Bt ? yield h(e, t) : yield g(e, t)).length) break;
                            if (null !== (I = (n.length, n[0]))) {
                                if (yield l.FileSystemAWNS.existsAW(I.fullPath)) T.playUrl = I.fullPath, i = !1; else if (T.taskType === d.DownloadKernel.TaskType.Bt) T.playUrl = yield v.getPlayUrl(I.index); else {
                                    let e = v.getExtraObject().getSubTaskByIndex(I.index);
                                    null !== e && void 0 !== e && (T.playUrl = yield e.getPlayUrl(-1))
                                }
                                T.fileDir = a.dirname(I.fullPath), T.fileName = I.fileName, T.cid = I.cid, T.gcid = I.gcid, T.fileIndex = I.index, c ? I.duration !== I.playPosition ? T.startPos = I.playPosition : T.startPos = 0 : !1 === c && (T.startPos = 0), T.taskType === d.DownloadKernel.TaskType.Group && (T.taskId = I.taskId, T.taskUrl = I.taskUrl), H.information("Thunder.DownloadAndPlayIPC playTaskId:", T.taskId, ", taskId:", e)
                            }
                        } else if (T.taskType === d.DownloadKernel.TaskType.Emule || T.taskType === d.DownloadKernel.TaskType.P2sp) if (T.playUrl = yield v.getPlayUrl(-1), T.fileName = v.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskName), T.fileDir = v.getTaskAttribute(d.DownloadKernel.TaskAttribute.SavePath), T.cid = v.getTaskAttribute(d.DownloadKernel.TaskAttribute.Cid), T.gcid = v.getTaskAttribute(d.DownloadKernel.TaskAttribute.Gcid), c) {
                            let e = v.getTaskAttribute(d.DownloadKernel.TaskAttribute.Duration),
                                t = v.getTaskAttribute(d.DownloadKernel.TaskAttribute.PlayPosition);
                            T.startPos = e !== t ? t : 0
                        } else !1 === c && (T.startPos = 0);
                        T.playUrl && T.playUrl
                    }
                    let A = yield ie(T, m);
                    if (n = A.ret) {
                        let e = v.getType();
                        if (e === d.DownloadKernel.TaskType.Bt) {
                            let e = v.getExtraObject().getBtFileByRealIndex(I.index);
                            e.getBtFileAttribute(d.DownloadKernel.BtFileAttribute.FileStatus) === d.DownloadKernel.BtFileStatus.Complete && e.setUserRead(1)
                        } else if (e === d.DownloadKernel.TaskType.Group) {
                            let e = v.getExtraObject().getSubTaskByIndex(I.index);
                            null !== e && void 0 !== e && (e.getTaskStatus() !== d.DownloadKernel.TaskStatus.Succeeded && e.getTaskStatus() !== d.DownloadKernel.TaskStatus.Seeding || e.setUserRead(1))
                        } else v.getTaskStatus() !== d.DownloadKernel.TaskStatus.Succeeded && v.getTaskStatus() !== d.DownloadKernel.TaskStatus.Seeding || v.setUserRead(1)
                    }
                    let D = [];
                    if (void 0 === r && (r = b.default.getCurrentCategoryId()), -1 === r) D.push("panel_type=mypc"); else if ($.isPrivateCategory(r)) D.push("panel_type=private"); else {
                        let e = $.getCategoryFromId(r);
                        e && D.push("panel_type=" + e.getName())
                    }
                    void 0 === o && (o = ""), D.push("panel=" + o), D.push("taskid=" + e), D.push("filename=" + encodeURIComponent(T.fileName)), void 0 === i && (i = "other"), D.push("click_source=" + i), n ? D.push("result=success") : (D.push("result=fail"), D.push("errorcode=" + A.errcode));
                    let x = D.join(",");
                    H.information("trackEvent", "download_leftpanel", "play_panel_show", x), k.XLStatNS.trackEvent("download_leftpanel", "play_panel_show", "", 0, 0, 0, 0, x)
                } while (0);
                return n
            })
        }

        function ae(e) {
            do {
                if (null === e || void 0 === e || void 0 === e.taskId) break;
                let t = j.getTaskFromTaskId(e.taskId);
                if (null === t || void 0 === t) break;
                if (t.getTaskAttribute(d.DownloadKernel.TaskAttribute.CategoryViewId) !== d.DownloadKernel.CategroyViewID.Downloading) break;
                if ("ThunderUnion" !== t.getTaskAttribute(d.DownloadKernel.TaskAttribute.Origin)) break;
                if (t.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskType) !== d.DownloadKernel.TaskType.Group) break;
                if (e.taskStatus === d.DownloadKernel.TaskStatus.Succeeded) break;
                let i = t.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskName),
                    n = `filename=${encodeURIComponent(i)}`;
                H.information("trackEvent js_grouptask_delete_click ", i, n), k.XLStatNS.trackEvent("core_operate", "js_grouptask_delete_click", "", 0, 0, 0, 0, n)
            } while (0)
        }

        e.asyncOpenItem = t, e.importUncompletedFromFile = i, e.importUncompleted = function () {
            return n(this, void 0, void 0, function* () {
                H.information("import un-finished");
                let e = yield K.asyncRemoteCall.getCurrentWindow();
                (yield K.asyncRemoteCall.getDialog()).showOpenDialog(e, {
                    properties: ["openFile"],
                    filters: [{
                        name: "所有支持的文件类型（*.td;*.bt.td;*.emule.td;*.bc!;*.part;*.xltd）",
                        extensions: ["td", "bt.td", "emule.td", "bc!", "part", "xltd"]
                    }, {name: "迅雷专有下载文件（*.td）", extensions: ["td", "xltd"]}, {
                        name: "迅雷BT下载文件（*.bt.td）",
                        extensions: ["bt.td"]
                    }, {name: "迅雷eMule下载文件（*.emule.td）", extensions: ["emule.td"]}, {
                        name: "BitComet下载文件（*.bc!）",
                        extensions: ["bc!"]
                    }, {name: "eMule0.47数据文件（*.part）", extensions: ["part"]}]
                }, e => {
                    void 0 === e ? H.information("import un finished select none") : i(e[0], "TD")
                })
            })
        }, e.removeNonExistingTask = function (e) {
            return n(this, void 0, void 0, function* () {
                let t = 0;
                do {
                    if (void 0 === e || null === e) {
                        let t = G.getCategoryViewFromId(d.DownloadKernel.CategroyViewID.Completed);
                        if (null === t) break;
                        let i = t.getTasks();
                        e = [...i.values()].map(e => e.getTaskBaseInfo())
                    }
                    if (null === e || void 0 === e || 0 === e.length) break;
                    let i = [];
                    for (let n of e) (yield P.TaskCtrlOperatorNS.isExistTaskFile(n)) || (i.push(n.taskId), t += 1);
                    yield j.deleteBatchTask(i, !0)
                } while (0);
                return t
            })
        }, e.markReadStatus = function (e, t) {
            do {
                if (null === e || 0 === e.length) break;
                for (let i of e) {
                    let e = j.getTaskFromTaskId(i.taskId);
                    e && e.setUserRead(t)
                }
            } while (0)
        }, e.moveCategoryTask = function (e, t) {
            do {
                if (null === e || 0 === e.length) break;
                for (let i of e) j.moveCategoryTask(i.taskId, t)
            } while (0)
        }, e.getFileIcon = function (e) {
            return n(this, void 0, void 0, function* () {
                return new Promise(t => n(this, void 0, void 0, function* () {
                    (yield K.asyncRemoteCall.getApp()).getFileIcon(e, (e, i) => {
                        H.information(e), t(null === i || void 0 === i ? null : i.toDataURL())
                    })
                }))
            })
        }, e.executeInstallFile = function (e, t, i) {
            return n(this, void 0, void 0, function* () {
                let n = !1;
                do {
                    let a = "", r = "";
                    if (null !== t && void 0 !== t && "" !== t) a = t, null !== i && void 0 !== i && "" !== i && (r = i); else {
                        if (e.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskType) !== d.DownloadKernel.TaskType.Group) break;
                        let t = e.getExtraObject(),
                            i = t.getUserData(x.TaskUserDataGUID.guidDownloadCompleteInstall, "installFile");
                        if (void 0 === i || null === i || "" === i || "0" === i) break;
                        let n = e.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskId);
                        if (a = P.TaskCtrlOperatorNS.getSavePathByFileName(n, i), !(yield l.FileSystemAWNS.existsAW(a))) break;
                        r = "", null !== (i = t.getUserData(x.TaskUserDataGUID.guidDownloadCompleteRunParams, "runParams")) && void 0 !== i && "" !== i && (r = i)
                    }
                    if (o.ipcRenderer.send("onOpenExecute", a, r), n = !0, "ThunderUnion" === e.getTaskAttribute(d.DownloadKernel.TaskAttribute.Origin)) {
                        let t = e.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskName),
                            i = `filename=${encodeURIComponent(t)}`;
                        H.information("trackEvent js_grouptask_install ", t, i), k.XLStatNS.trackEvent("core_operate", "js_grouptask_install", "", 0, 0, 0, 0, i)
                    }
                } while (0);
                return n
            })
        }, e.openTaskFolder = function (e, t) {
            return n(this, void 0, void 0, function* () {
                let i = e.savePath, n = e.taskName, o = "", r = yield K.asyncRemoteCall.getShell();
                "" === n ? o = i : (void 0 !== n && n.indexOf(".") === n.length - 1 && (n = n.substring(0, n.length - 1)), o = a.join(i, n));
                do {
                    if (e.taskType === d.DownloadKernel.TaskType.Bt) {
                        let n = j.getTaskFromTaskId(e.taskId), s = n.getExtraObject(), u = s.getDownloadFile();
                        if (1 !== u.length) {
                            t ? Y(o).catch() : r.showItemInFolder(o);
                            break
                        }
                        if (yield F.SingleBtTaskNS.isSingleBtTask(n)) o = F.SingleBtTaskNS.getSinleBtTaskFilePath(n); else {
                            let e = s.getBtFileList();
                            for (let [, t]of e) if (t.getBtFileAttribute(d.DownloadKernel.BtFileAttribute.RealIndex) === u[0]) {
                                let e = t.getBtFileAttribute(d.DownloadKernel.BtFileAttribute.FilePath),
                                    n = t.getBtFileAttribute(d.DownloadKernel.BtFileAttribute.FileName),
                                    r = a.join(o, e);
                                if (o = a.join(o, e, n), e && !(yield l.FileSystemAWNS.dirExistsAW(r))) {
                                    let t = a.join(i, e);
                                    (yield l.FileSystemAWNS.dirExistsAW(t)) && (o = a.join(i, e, n))
                                }
                                break
                            }
                        }
                    } else {
                        if (e.taskType === d.DownloadKernel.TaskType.Group) {
                            t ? Y(i).catch() : r.showItemInFolder(i);
                            break
                        }
                        if (e.taskType === d.DownloadKernel.TaskType.Unkown) break;
                        if (e.taskType === d.DownloadKernel.TaskType.Magnet) break
                    }
                    if (e.taskStatus === d.DownloadKernel.TaskStatus.Succeeded || e.taskStatus === d.DownloadKernel.TaskStatus.Seeding) {
                        (yield l.FileSystemAWNS.existsAW(o)) ? r.showItemInFolder(o) : Y(i).catch();
                        break
                    }
                    if (yield l.FileSystemAWNS.existsAW(o)) {
                        r.showItemInFolder(o);
                        break
                    }
                    if (e.taskType === d.DownloadKernel.TaskType.P2sp) {
                        (yield l.FileSystemAWNS.existsAW(o + ".td")) ? r.showItemInFolder(o + ".td") : (yield l.FileSystemAWNS.existsAW(o + ".xltd")) ? r.showItemInFolder(o + ".xltd") : Y(i).catch();
                        break
                    }
                    if (e.taskType === d.DownloadKernel.TaskType.Emule) {
                        (yield l.FileSystemAWNS.existsAW(o + ".emule.td")) ? r.showItemInFolder(o + ".emule.td") : (yield l.FileSystemAWNS.existsAW(o + ".xltd")) ? r.showItemInFolder(o + ".xltd") : (yield l.FileSystemAWNS.existsAW(o + ".emule.xltd")) ? r.showItemInFolder(o + ".emule.xltd") : Y(i).catch();
                        break
                    }
                    if (e.taskType === d.DownloadKernel.TaskType.Bt) {
                        (yield l.FileSystemAWNS.existsAW(o + ".bt.td")) ? r.showItemInFolder(o + ".bt.td") : (yield l.FileSystemAWNS.existsAW(o + ".xltd")) ? r.showItemInFolder(o + ".xltd") : (yield l.FileSystemAWNS.existsAW(o + ".bt.xltd")) ? r.showItemInFolder(o + ".bt.xltd") : Y(i).catch();
                        break
                    }
                    e.taskType === d.DownloadKernel.TaskType.Group && Y(i).catch()
                } while (0)
            })
        }, e.openTaskItem = function (e, i, o, s, u, c) {
            return n(this, void 0, void 0, function* () {
                let n = e.savePath, h = e.taskName, f = "";
                "" === h ? f = n : (void 0 !== h && h.indexOf(".") === h.length - 1 && (h = h.substring(0, h.length - 1)), f = a.join(n, h));
                let g = j.getTaskFromTaskId(e.taskId), p = g.isSupportPlay();
                do {
                    if (e.taskType === d.DownloadKernel.TaskType.P2sp || e.taskType === d.DownloadKernel.TaskType.Emule) {
                        if (e.taskStatus !== d.DownloadKernel.TaskStatus.Succeeded && e.taskStatus !== d.DownloadKernel.TaskStatus.Seeding) break;
                        (yield l.FileSystemAWNS.existsAW(f)) && (p ? yield ne(e.taskId, -1, o, s, u, void 0, void 0, !0, c) : t(f).catch())
                    } else if (e.taskType === d.DownloadKernel.TaskType.Bt) {
                        let h = g.getExtraObject(), v = h.getDownloadFile();
                        if (e.taskStatus === d.DownloadKernel.TaskStatus.Succeeded || e.taskStatus === d.DownloadKernel.TaskStatus.Seeding) if (1 === v.length) {
                            if (yield F.SingleBtTaskNS.isSingleBtTask(g)) f = F.SingleBtTaskNS.getSinleBtTaskFilePath(g); else {
                                let e = h.getBtFileList();
                                for (let [, t]of e) if (t.getBtFileAttribute(d.DownloadKernel.BtFileAttribute.RealIndex) === v[0]) {
                                    let e = t.getBtFileAttribute(d.DownloadKernel.BtFileAttribute.FilePath),
                                        i = t.getBtFileAttribute(d.DownloadKernel.BtFileAttribute.FileName),
                                        o = a.join(f, e);
                                    if (f = a.join(f, e, i), e && !(yield l.FileSystemAWNS.dirExistsAW(o))) {
                                        let t = a.join(n, e);
                                        (yield l.FileSystemAWNS.dirExistsAW(t)) && (f = a.join(n, e, i))
                                    }
                                    break
                                }
                            }
                            p ? yield ne(e.taskId, -1, o, s, u, void 0, void 0, !0, c) : t(f).catch()
                        } else if (null !== i && void 0 !== i && -1 !== i) {
                            let n = yield r(e.taskId, i);
                            null === n || void 0 === n || n.length <= 0 ? Y(f).catch() : n[0].fileExtType === T.TaskUtilHelper.FileExtType.Video ? yield ne(e.taskId, i, o, s, u, void 0, void 0, !0, c) : null !== n[0].fullPath && void 0 !== n[0].fullPath && "" !== n[0].fullPath ? t(n[0].fullPath).catch() : Y(f).catch()
                        } else p ? yield ne(e.taskId, -1, o, s, u, void 0, void 0, !0, c) : Y(f).catch(); else if (null !== i && void 0 !== i && -1 !== i) {
                            let n = yield r(e.taskId, i), a = {playUrl: n[0].fullPath, fileName: ""};
                            null === n || void 0 === n || n.length <= 0 ? Y(f).catch() : n[0].fileExtType === T.TaskUtilHelper.FileExtType.Video ? n[0].fullPath && (yield l.FileSystemAWNS.existsAW(n[0].fullPath)) ? (a.fileIndex = n[0].btFile.getBtFileAttribute(d.DownloadKernel.BtFileAttribute.RealIndex), a.fromweb = c, a.taskId = e.taskId, a.fileSize = 0, yield ie(a)) : yield ne(e.taskId, i, o, s, u, void 0, void 0, !0, c) : null !== n[0].fullPath && void 0 !== n[0].fullPath && "" !== n[0].fullPath ? t(n[0].fullPath).catch() : Y(f).catch()
                        } else Y(f).catch()
                    } else if (e.taskType === d.DownloadKernel.TaskType.Group) if (null !== i && void 0 !== i && -1 !== i) {
                        let e = g.getExtraObject();
                        if (null === e || void 0 === e) break;
                        let n = e.getSubTaskByIndex(i), r = n.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskId),
                            h = n.getTaskAttribute(d.DownloadKernel.TaskAttribute.SavePath),
                            f = n.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskName), p = "";
                        "" === f ? p = h : (void 0 !== f && f.indexOf(".") === f.length - 1 && (f = f.substring(0, f.length - 1)), p = a.join(h, f));
                        let v = n.isSupportPlay();
                        (yield l.FileSystemAWNS.existsAW(p)) && (v ? yield ne(r, -1, o, s, u, void 0, void 0, !0, c) : t(p).catch())
                    } else {
                        let e = g.getExtraObject();
                        e && Y(e.getSubTaskByIndex(0).getTaskAttribute(d.DownloadKernel.TaskAttribute.SavePath)).catch()
                    }
                } while (0)
            })
        }, e.openAsTaskItem = function (e) {
            return n(this, void 0, void 0, function* () {
                let t = e.savePath, i = e.taskName, n = "";
                "" === i ? n = t : (void 0 !== i && i.indexOf(".") === i.length - 1 && (i = i.substring(0, i.length - 1)), n = a.join(t, i));
                let o = j.getTaskFromTaskId(e.taskId);
                do {
                    if (e.taskType === d.DownloadKernel.TaskType.P2sp || e.taskType === d.DownloadKernel.TaskType.Emule) {
                        if (e.taskStatus !== d.DownloadKernel.TaskStatus.Succeeded && e.taskStatus !== d.DownloadKernel.TaskStatus.Seeding) break;
                        L.exec(`rundll32.exe shell32.dll,OpenAs_RunDLL ${n}`, {cwd: process.cwd()})
                    } else if (e.taskType === d.DownloadKernel.TaskType.Bt) {
                        let t = o.getExtraObject(), i = t.getDownloadFile();
                        if ((e.taskStatus === d.DownloadKernel.TaskStatus.Succeeded || e.taskStatus === d.DownloadKernel.TaskStatus.Seeding) && 1 === i.length) if (yield F.SingleBtTaskNS.isSingleBtTask(o)) n = F.SingleBtTaskNS.getSinleBtTaskFilePath(o), L.exec(`rundll32.exe shell32.dll,OpenAs_RunDLL ${n}`, {cwd: process.cwd()}); else {
                            let i = yield F.SingleBtTaskNS.getCorrectSingleBtFolder(o);
                            if (i) {
                                let o = e.savePath, r = void 0, s = t.getBtFileList();
                                for (let [, e]of s) {
                                    r = e.getBtFileAttribute(d.DownloadKernel.BtFileAttribute.FileName);
                                    break
                                }
                                n = a.join(o, i, r), L.exec(`rundll32.exe shell32.dll,OpenAs_RunDLL ${n}`, {cwd: process.cwd()})
                            }
                        }
                    }
                } while (0)
            })
        }, e.startTasks = function (e) {
            let t = e.map(e => e.taskId);
            _.DownloadDispatchNS.startTasks(t)
        }, e.pauseTasks = function (e, t) {
            let i = [];
            for (let t of e) i.push(t.taskId);
            i.length > 0 && j.batchStopTask(i, t)
        }, e.deleteTasks = function (e, t) {
            do {
                if (null === e || void 0 === e || e.length <= 0) break;
                if (void 0 === t && (t = !0), t) {
                    let t = !1;
                    for (let i of e) if (i.taskStatus === d.DownloadKernel.TaskStatus.Started) {
                        t = !0;
                        break
                    }
                    if (t) m.MessageBox.confirm({
                        title: "任务正在下载，您确定删除任务吗？",
                        type: m.MessageBox.ConfirmType.Warning,
                        checkboxEnabled: !1
                    }).then(t => {
                        if (t.action === y.MessageBoxNS.Action.OK) {
                            let t = [];
                            for (let i of e) ae(i), t.push(i.taskId);
                            j.batchRemoveToRecycle(t).catch(), 1 === e.length && b.default.setNeedSelectNext(!0)
                        }
                    }).catch(); else {
                        let t = [];
                        for (let i of e) ae(i), t.push(i.taskId);
                        j.batchRemoveToRecycle(t).catch(), 1 === e.length && b.default.setNeedSelectNext(!0)
                    }
                }
            } while (0)
        }, e.destroyTasks = function (e, t) {
            do {
                if (null === e || void 0 === e || e.length <= 0) break;
                if (void 0 === t && (t = !0), t) {
                    let t = w.ConfigNS.getValue("ConfigMsg", "ConfigMsg_DeleteFile", !0);
                    m.MessageBox.confirm({
                        title: "您确定要删除此任务吗？",
                        type: m.MessageBox.ConfirmType.Warning,
                        checkboxEnabled: !0,
                        checkboxChecked: t,
                        checkboxLabel: "同时删除文件"
                    }, {width: 400, height: 174, center: !0}).then(t => {
                        if (t.action === y.MessageBoxNS.Action.OK) {
                            let i = [];
                            for (let t of e) ae(t), i.push(t.taskId);
                            w.ConfigNS.setValue("ConfigMsg", "ConfigMsg_DeleteFile", t.checkboxChecked), j.deleteBatchTask(i, t.checkboxChecked).then(e => {
                                t.checkboxChecked && !e && q.showNotify(A.ToastNotifyManagerNS.notifyIdTaskOperatorDestroyTask, D.ToastNotifyItemType.RedNotify, "文件在本地磁盘中删除失败", 3e3)
                            }).catch(), 1 === e.length && b.default.setNeedSelectNext(!0)
                        }
                    }).catch()
                } else {
                    let t = [];
                    for (let i of e) ae(i), t.push(i.taskId);
                    j.deleteBatchTask(t, !0).then(e => {
                        e || q.showNotify(A.ToastNotifyManagerNS.notifyIdTaskOperatorDestroyTask, D.ToastNotifyItemType.RedNotify, "文件在本地磁盘中删除失败", 3e3)
                    }).catch(), 1 === e.length && b.default.setNeedSelectNext(!0)
                }
            } while (0)
        }, e.move2Dir = function (e, t, i) {
            return n(this, void 0, void 0, function* () {
                let a = !1;
                if (void 0 === t || "" === t) {
                    let o = yield K.asyncRemoteCall.getCurrentWindow();
                    (yield K.asyncRemoteCall.getDialog()).showOpenDialog(o, {properties: ["openDirectory"]}, o => n(this, void 0, void 0, function* () {
                        void 0 !== o && (t = o[0]), void 0 !== t && "" !== t && (a = yield E(e, t, i))
                    }))
                } else a = yield E(e, t, i);
                return a
            })
        }, e.copy2Dir = function (e, t) {
            return n(this, void 0, void 0, function* () {
                let i = void 0;
                if (void 0 !== t && "" !== t) i = t; else {
                    let e = yield K.asyncRemoteCall.getCurrentWindow(),
                        t = (yield K.asyncRemoteCall.getDialog()).showOpenDialog(e, {properties: ["openDirectory"]});
                    void 0 !== t && (i = t[0])
                }
                if (void 0 !== i && "" !== i) {
                    let t = w.ConfigNS.getValue("CopyToDir", "LatestSavePath", []), n = t.indexOf(i);
                    -1 !== n && t.splice(n, 1), t.splice(0, 0, i), t = t.slice(0, 3), w.ConfigNS.setValue("CopyToDir", "LatestSavePath", t), w.ConfigNS.save().catch();
                    for (let t of e) {
                        let e = t.savePath, n = t.taskName, r = e, s = i;
                        if (t.taskType !== d.DownloadKernel.TaskType.Group) {
                            let i = j.getTaskFromTaskId(t.taskId);
                            if (yield F.SingleBtTaskNS.isSingleBtTask(i)) {
                                let e = i.getExtraObject().getBtFileList();
                                for (let [, t]of e) {
                                    n = t.getBtFileAttribute(d.DownloadKernel.BtFileAttribute.FileName);
                                    break
                                }
                            }
                            r = a.join(e, n)
                        } else r = a.join(r, "*");
                        s = a.join(i, n), r !== i && o.ipcRenderer.send(I.ThunderChannelList.channelRMFileCopy, r, s)
                    }
                }
            })
        }, e.copyLink = function (e, t) {
            let i = [];
            for (let t of e) {
                let e = j.getTaskFromTaskId(t.taskId);
                if (t.taskType !== d.DownloadKernel.TaskType.P2sp) if (t.taskType !== d.DownloadKernel.TaskType.Emule) if (t.taskType !== d.DownloadKernel.TaskType.Group) ; else {
                    let e = j.getTaskFromTaskId(t.taskId).getExtraObject(), n = e.getSubTaskCount();
                    for (let t = 0; t < n; t++) {
                        let n = X(e.getSubTaskByIndex(t));
                        i.push(n)
                    }
                } else i.push(t.url); else {
                    let n = e.getExtraObject().getDisplayUrl();
                    "" === n && (n = t.url), i.push(n)
                }
            }
            o.clipboard.writeText(i.join("\r\n")), q.showNotify(A.ToastNotifyManagerNS.notifyIdTaskOperatorCopyLink, D.ToastNotifyItemType.GreenNotify, "链接已复制", 3e3)
        }, e.copyMagnetLink = function (e, t) {
            do {
                if (void 0 === e) break;
                if (e.taskType !== d.DownloadKernel.TaskType.Bt) break;
                let t = j.getTaskFromTaskId(e.taskId), i = t.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskUrl);
                i && "" !== i || (i = "magnet:?xt=urn:btih:" + t.getExtraObject().getInfoId()), o.clipboard.writeText(i), q.showNotify(A.ToastNotifyManagerNS.notifyIdTaskOperatorCopyMagnetLink, D.ToastNotifyItemType.GreenNotify, "磁力链接已复制", 3e3)
            } while (0)
        }, e.shareLink = function (e, t, i) {
            let n = "", o = e.taskName, r = "", s = j.getTaskFromTaskId(e.taskId);
            if (e.taskType === d.DownloadKernel.TaskType.P2sp) "" === (n = s.getExtraObject().getDisplayUrl()) && (n = e.url), r = a.extname(o).toLowerCase(); else if (e.taskType === d.DownloadKernel.TaskType.Emule) n = e.url, r = a.extname(o).toLowerCase(); else {
                if (e.taskType !== d.DownloadKernel.TaskType.Bt) return;
                (n = s.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskUrl)) && "" !== n || (n = "magnet:?xt=urn:btih:" + s.getExtraObject().getInfoId()), r = ".torrent"
            }
            m.MessageBox.custom("copy-link-share", {
                url: n,
                panel: t,
                taskName: o,
                ext: r,
                taskId: e.taskId,
                shareFrom: i
            }, {width: 442, height: 246, center: !0}).catch()
        }, e.saveAsTorrent = function (e) {
            return n(this, void 0, void 0, function* () {
                let t = !1;
                do {
                    if (void 0 === e) break;
                    if (e.taskType !== d.DownloadKernel.TaskType.Bt) break;
                    let i = j.getTaskFromTaskId(e.taskId).getExtraObject(), o = i.getSeedFilePath();
                    if (!(yield l.FileSystemAWNS.existsAW(o))) break;
                    let r = e.taskName;
                    void 0 !== r && "" !== r || "" === (r = i.getDisplayName()) && (r = a.parse(o).name);
                    let s = r, u = a.parse(r);
                    N.ParseUrlFileNameNS.isUsualFileExtName(u.ext) && (s = u.name + ".torrent");
                    let c = yield K.asyncRemoteCall.getCurrentWindow(),
                        h = {defaultPath: s, filters: [{name: "BT种子文件（*.torrent）", extensions: ["torrent"]}]};
                    (yield K.asyncRemoteCall.getDialog()).showSaveDialog(c, h, e => n(this, void 0, void 0, function* () {
                        void 0 !== e && "" !== e ? (".torrent" !== a.extname(e).toLowerCase() && (e += ".torrent"), (t = yield l.FileSystemAWNS.copyFileAW(o, e)) || q.showNotify(A.ToastNotifyManagerNS.notifyIdTaskOperatorSaveAsTorrent, D.ToastNotifyItemType.RedNotify, "获取此任务种子文件失败", 3e3)) : t = !0
                    }))
                } while (0)
            })
        }, e.renameTask = function (e) {
            H.information("rename", e.taskName, e.taskId);
            let t = e.taskName;
            m.MessageBox.custom("task-rename", {taskBase: e}, {width: 450, height: 194, center: !0}).then(i => {
                if (i.action === y.MessageBoxNS.Action.OK) do {
                    if (S.isNullOrUndefined(i.args)) break;
                    if (void 0 === i.args.fileName || null === i.args.fileName) break;
                    let n = i.args.fileName;
                    if (n === t) break;
                    j.getTaskFromTaskId(e.taskId).reName(n).catch()
                } while (0)
            }).catch()
        }, e.recoverTask = function (e) {
            if (e.length > 1) {
                let t = [];
                for (let i of e) t.push(i.taskId);
                j.batchRecoverFromRecycle(t)
            } else for (let t of e) j.recoverFromRecycle(t.taskId);
            q.showNotify(A.ToastNotifyManagerNS.notifyIdTaskOperatorRecoverTask, D.ToastNotifyItemType.GreenNotify, "已还原任务", 3e3)
        }, e.clearRecycle = function () {
            let e = G.getCategoryViewFromId(d.DownloadKernel.CategroyViewID.Recycle).getTasks();
            e.size > 0 && m.MessageBox.confirm({
                title: "确定清空回收站？",
                type: m.MessageBox.ConfirmType.Warning,
                checkboxEnabled: !0,
                checkboxChecked: !1,
                checkboxLabel: "同时删除文件"
            }, {width: 400, height: 174, center: !0}).then(t => {
                if (t.action === y.MessageBoxNS.Action.OK) {
                    let i = [];
                    e.forEach(e => {
                        i.push(e.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskId))
                    }), j.deleteBatchTask(i, t.checkboxChecked).catch()
                }
            }).catch()
        }, e.startAllPausedTask = function () {
            let e = [], t = G.getCategoryViewFromId(d.DownloadKernel.CategroyViewID.Downloading).getTasks();
            for (let [, i]of t) i.getTaskStatus() === d.DownloadKernel.TaskStatus.Stopped && e.push(i);
            let i = e.map(e => e.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskId));
            _.DownloadDispatchNS.startTasks(i)
        }, e.startAll = function () {
            let e = [], t = G.getCategoryViewFromId(d.DownloadKernel.CategroyViewID.Downloading).getTasks();
            for (let [, i]of t) e.push(i);
            let i = e.map(e => e.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskId));
            _.DownloadDispatchNS.startTasks(i)
        }, e.pauseAll = function (e) {
            let t = [], i = G.getCategoryViewFromId(d.DownloadKernel.CategroyViewID.Downloading).getTasks();
            for (let [, e]of i) null !== e && (e.getTaskAttribute(d.DownloadKernel.TaskAttribute.Background) || t.push(e.getId()));
            t.length > 0 && j.batchStopTask(t, e)
        }, e.hasCategoryStartTask = function (e) {
            let t = !1, i = $.getCategoryView(e, d.DownloadKernel.CategroyViewID.Downloading);
            if (!i) return t;
            let n = i.getTasks();
            for (let [, e]of n) if (null !== e) {
                let i = e.getTaskStatus();
                if (i === d.DownloadKernel.TaskStatus.StartWaiting || i === d.DownloadKernel.TaskStatus.StartPending || i === d.DownloadKernel.TaskStatus.Started) {
                    t = !0;
                    break
                }
            }
            return t
        }, e.startCategoryAllTask = function (e) {
            let t = $.getCategoryView(e, d.DownloadKernel.CategroyViewID.Downloading);
            if (!t) return;
            let i = t.getTasks();
            for (let [, e]of i) null !== e && (e.getTaskAttribute(d.DownloadKernel.TaskAttribute.Background) || j.startTask(e.getId()))
        }, e.pauseCategoryAllTask = function (e, t) {
            let i = $.getCategoryView(e, d.DownloadKernel.CategroyViewID.Downloading);
            if (!i) return;
            let n = [], a = i.getTasks();
            for (let [, e]of a) null !== e && (e.getTaskAttribute(d.DownloadKernel.TaskAttribute.Background) || n.push(e.getId()));
            n.length > 0 && j.batchStopTask(n, t)
        }, e.playVideoByXmp = ie, e.downloadAndPlay = ne, e.statJsSdkDeleteTask = ae, e.createBirdKey = function (e) {
            let t, i, n = j.getTaskFromTaskId(e), a = n.getTaskBaseInfo(), o = n.getType(), r = "";
            if (o === d.DownloadKernel.TaskType.P2sp) r = a.url, i = "p2sp", t = n.getTaskAttribute(d.DownloadKernel.TaskAttribute.Gcid); else if (o === d.DownloadKernel.TaskType.Emule) r = a.url, i = "emule", t = n.getTaskAttribute(d.DownloadKernel.TaskAttribute.Gcid); else if (o === d.DownloadKernel.TaskType.Bt) {
                i = "bt";
                let e = n.getExtraObject();
                t = e.getInfoId(), (r = n.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskUrl)) && "" !== r || (r = "magnet:?xt=urn:btih:" + e.getInfoId())
            } else if (o === d.DownloadKernel.TaskType.Magnet) i = "magnet"; else if (o === d.DownloadKernel.TaskType.Group) {
                i = "group";
                let e = {};
                e.taskGroupName = n.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskName), e.tasks = [];
                let t = n.getExtraObject(), a = t.getUserData(x.TaskUserDataGUID.guidDownloadGroupTask, "excludePath"),
                    o = t.getUserData(x.TaskUserDataGUID.guidDownloadCompleteInstall, "installFile"),
                    s = t.getUserData(x.TaskUserDataGUID.guidDownloadCompleteRunParams, "runParams");
                e.excludePath = a || "", e.installFile = o || "", e.runParams = s || "";
                let l = t.getUserData(x.TaskUserDataGUID.guidCreateShortcut, "createShortcut");
                if (l && l.length > 0) try {
                    l = JSON.parse(l), e.createShortcut = l
                } catch (e) {
                    H.warning(e)
                }
                let u = t.getSubTaskCount(), c = "", h = "";
                for (let i = 0; i < u; ++i) {
                    let n = t.getSubTaskByIndex(i), a = n.getType();
                    a !== d.DownloadKernel.TaskType.P2sp && a !== d.DownloadKernel.TaskType.Emule || (c = n.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskUrl), h = n.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskName), e.tasks.push({
                        name: h,
                        url: c,
                        dir: ""
                    }))
                }
                r = JSON.stringify(e)
            }
            if (r.length > 0) {
                H.information("点击任务详情按钮,生成迅雷口令,taskURL:", r);
                let e = n.getTaskAttribute(d.DownloadKernel.TaskAttribute.CategoryViewId), o = new Map;
                o.set(d.DownloadKernel.CategroyViewID.Downloading, "downloading"), o.set(d.DownloadKernel.CategroyViewID.Completed, "complete"), o.set(d.DownloadKernel.CategroyViewID.Recycle, "trash"), o.set(d.DownloadKernel.CategroyViewID.Unkown, "unknown");
                let s = {
                    pannel: o.get(e),
                    gcid: t,
                    taskid: a.taskId.toString(),
                    filename: a.taskName,
                    pannelType: n.getIsPrivate() ? "private" : "mypc",
                    taskType: i
                };
                O.openBirdKeyEncodeDialog(r, s).catch()
            }
        }, e.getTaskBirdKeyData = function (e) {
            let t = "", i = j.getTaskFromTaskId(e), n = i.getTaskBaseInfo(), a = i.getType();
            if (a === d.DownloadKernel.TaskType.P2sp) t = n.url; else if (a === d.DownloadKernel.TaskType.Emule) t = n.url; else if (a === d.DownloadKernel.TaskType.Bt) (t = i.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskUrl)) && "" !== t || (t = "magnet:?xt=urn:btih:" + i.getExtraObject().getInfoId()); else if (a === d.DownloadKernel.TaskType.Magnet) ; else if (a === d.DownloadKernel.TaskType.Group) {
                let e = {};
                e.taskGroupName = i.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskName), e.tasks = [];
                let n = i.getExtraObject(), a = n.getUserData(x.TaskUserDataGUID.guidDownloadGroupTask, "excludePath"),
                    o = n.getUserData(x.TaskUserDataGUID.guidDownloadCompleteInstall, "installFile"),
                    r = n.getUserData(x.TaskUserDataGUID.guidDownloadCompleteRunParams, "runParams");
                e.excludePath = a || "", e.installFile = o || "", e.runParams = r || "";
                let s = n.getUserData(x.TaskUserDataGUID.guidCreateShortcut, "createShortcut");
                if (s && s.length > 0) try {
                    s = JSON.parse(s), e.createShortcut = s
                } catch (e) {
                    H.warning(e)
                }
                let l = n.getSubTaskCount(), u = "", c = "";
                for (let t = 0; t < l; ++t) {
                    let i = n.getSubTaskByIndex(t), a = i.getType();
                    a !== d.DownloadKernel.TaskType.P2sp && a !== d.DownloadKernel.TaskType.Emule || (u = i.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskUrl), c = i.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskName), e.tasks.push({
                        name: c,
                        url: u,
                        dir: ""
                    }))
                }
                t = JSON.stringify(e)
            }
            return t
        }
    }(t.TaskOperatorNs || (t.TaskOperatorNs = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        let t;
        !function (e) {
            e[e.OK = 0] = "OK", e[e.Cancel = 1] = "Cancel", e[e.Close = 2] = "Close", e[e.Unknow = 3] = "Unknow"
        }(t = e.Action || (e.Action = {}))
    }(t.MessageBoxNS || (t.MessageBoxNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(17), o = i(2), r = i(0), s = i(6), l = i(28), d = i(3), u = i(11), c = i(59), h = i(41), f = i(14),
        g = i(61), p = i(22), v = i(27), m = i(13), y = i(10), k = i(5), T = i(42), w = i(44), C = i(25), S = i(76),
        b = i(51), I = i(43), _ = i(415), A = i(47), D = i(35), x = i(9), N = i(416), E = i(49), P = i(46), M = i(7),
        O = i(89), F = i(111), L = E.ToastNotifyManagerNS.getToastNotifyManger(),
        B = r.default.getLogger("ThunderNewTask"), U = u.DownloadKernelTaskManager.getTaskManager(),
        R = s.default(o.join(__rootDir, "../bin/ThunderNewTask.node")),
        K = s.default(o.join(__rootDir, "../bin/ThunderHelper.node")), W = i(37), V = i(12), H = i(20), z = i(79),
        j = i(70);
    let G = !1, $ = !1;
    !function (e) {
        function t(e, t) {
            return n(this, void 0, void 0, function* () {
                let i = U.getTaskFromTaskId(e);
                do {
                    if (!i) break;
                    let n = i.getTaskAttribute(d.DownloadKernel.TaskAttribute.CategoryId),
                        a = i.getTaskAttribute(d.DownloadKernel.TaskAttribute.CategoryViewId);
                    if (B.information("查看重复任务", a), a === d.DownloadKernel.CategroyViewID.Unkown) break;
                    t = void 0 === t || t, v.default.fireEvent(m.NodeEventMesssageNS.eventDownloadSwitchCategory, n, a, e, t)
                } while (0)
            })
        }

        function i(e, i) {
            B.information("重复下载任务：nlen = ", e.length);
            do {
                if (e.length <= 0) break;
                if (e.length <= 1) {
                    let a = !1, o = e[0], r = e[0].getTaskBaseInfo();
                    if (r.taskType === d.DownloadKernel.TaskType.P2sp || r.taskType === d.DownloadKernel.TaskType.Emule) {
                        let t = e[0].getTaskAttribute(d.DownloadKernel.TaskAttribute.GroupTaskId);
                        if (t > 0) {
                            let e = U.getTaskFromTaskId(t);
                            null !== e && void 0 !== e && (o = e, a = !0)
                        }
                    }
                    p.MessageBox.confirm({
                        title: "该任务已存在，重新下载将会删除已下载的内容",
                        type: p.MessageBox.ConfirmType.Warning,
                        fileName: o.getTaskBaseInfo().taskName,
                        okText: "查看",
                        cancelText: "重新下载",
                        cancelVisible: !a
                    }).then(e => n(this, void 0, void 0, function* () {
                        if (e.action === W.MessageBoxNS.Action.OK) {
                            yield t(o.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskId))
                        } else if (e.action === W.MessageBoxNS.Action.Cancel) if (void 0 === i || null === i || 0 === i.length) h.TaskCtrlOperatorNS.redownloadTask([o.getTaskBaseInfo()], !1).catch(); else {
                            yield U.deleteTask(o.getTaskBaseInfo().taskId, !0), i[0].newTaskInfo.taskBaseInfo.productInfo = h.TaskCtrlOperatorNS.constructProductInfo(""), i[0].newTaskInfo.taskBaseInfo.origin = "re_download";
                            let e = yield U.createTask(i[0].taskType, i[0].newTaskInfo);
                            if (null !== e) {
                                let t = e.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskId);
                                I.DownloadDispatchNS.startTask(t)
                            }
                        }
                    })).catch()
                } else {
                    let t = e.map(e => e.getTaskBaseInfo().url), i = JSON.stringify(t);
                    p.MessageBox.custom("multi-repeat-task", {file: i}).catch()
                }
            } while (0)
        }

        function r(e, t) {
            for (let i of e) {
                let e = t.indexOf(i.index);
                -1 !== e && t.splice(e, 1)
            }
            return t
        }

        function s(e) {
            return n(this, void 0, void 0, function* () {
                do {
                    if (void 0 === e) break;
                    if (null === e) break;
                    for (let t of e) yield k.FileSystemAWNS.unlinkAW(t.fullPath)
                } while (0)
            })
        }

        function X(e, i, a, l, c, f, g, v, m, y, k, T) {
            return n(this, void 0, void 0, function* () {
                let w = f;
                const C = u.DownloadKernelTaskManager.getTaskManager();
                do {
                    if (void 0 === v) break;
                    if ("ignore" === v) {
                        if (void 0 === (w = r(m, f)) || null === w) break;
                        if (0 === w.length) {
                            if (void 0 !== y) yield t(y); else {
                                let t = o.join(e, a.title);
                                p.MessageBox.confirm({
                                    title: "全部文件已存在，位于以下路径：",
                                    type: p.MessageBox.ConfirmType.Warning,
                                    content: t,
                                    okText: "知道了",
                                    cancelText: "打开文件夹"
                                }).then(e => n(this, void 0, void 0, function* () {
                                    if (e.action === W.MessageBoxNS.Action.Cancel) {
                                        (yield V.asyncRemoteCall.getShell()).showItemInFolder(t)
                                    }
                                })).catch()
                            }
                            break
                        }
                        void 0 !== y && (yield C.deleteTask(y, !1))
                    } else if ("delete" === v) yield s(m), void 0 !== y && (yield C.deleteTask(y, !0)); else if ("continue" === v && void 0 !== y) {
                        I.DownloadDispatchNS.startTask(y);
                        break
                    }
                    let u = a.trackerUrls.join("\n"), S = h.TaskCtrlOperatorNS.constructProductInfo(g.browser), b = {
                        taskBaseInfo: {savePath: e, taskName: a.title, productInfo: S, origin: g.source},
                        btTaskInfo: {
                            originUrl: T,
                            seedFile: l,
                            displayName: c,
                            fileLists: a.fileLists,
                            infoId: a.infoId,
                            fileRealIndexLists: w,
                            tracker: u
                        },
                        privateSpace: k
                    };
                    B.information("create task bt productinfo", g);
                    let _ = yield C.createTask(d.DownloadKernel.TaskType.Bt, b);
                    if (null !== _) {
                        if (1 === i) {
                            let e = _.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskId);
                            I.DownloadDispatchNS.startTask(e)
                        }
                    } else B.warning("create bt task null")
                } while (0)
            })
        }

        function q(e, t) {
            return n(this, void 0, void 0, function* () {
                do {
                    if (0 === e.length) break;
                    F.popMutual.setReady(O.PopView.NEW_TASK), a.ipcRenderer.send("create-new-task-window", JSON.stringify(e))
                } while (0)
            })
        }

        function Y(e, t, i, n, o) {
            F.popMutual.setReady(O.PopView.PRE_NEW_TASK), a.ipcRenderer.send("create-pre-new-task-window", e ? JSON.stringify(e) : e, t, i, n, o ? JSON.stringify(o) : o)
        }

        function J(e, t) {
            F.popMutual.setReady(O.PopView.BT_NEW_TASK), a.ipcRenderer.send("create-bt-task-window", e ? JSON.stringify(e) : e, t ? JSON.stringify(t) : t)
        }

        function Z(e) {
            if (void 0 !== e && null !== e && "" !== e) {
                y.ConfigNS.getValue("PathAndCategory", "LastUsedPath", "") !== e && (y.ConfigNS.setValue("PathAndCategory", "LastUsedPath", e), y.ConfigNS.save().catch())
            }
        }

        function Q(e) {
            return n(this, void 0, void 0, function* () {
                let t = !1;
                if (D.ThunderHelper.getDriveType(e) === D.ThunderHelper.DriverType.DRIVE_FIXED) {
                    (yield D.ThunderHelper.getFixedDriveMediaType(e)) === D.ThunderHelper.MediaType.HDD && (t = !0)
                }
                return t
            })
        }

        function ee(e, t) {
            return n(this, void 0, void 0, function* () {
                do {
                    if ($) break;
                    if (e > 1048576e3) {
                        if (!(yield M.client.callServerFunction("IsFileSizeSetterWorking")) && (yield Q(t))) {
                            $ = !0, 0 === (yield M.client.callServerFunction("LaunchFileAssistant")) && x.XLStatNS.trackEvent("core_event", "apply_for_disk_space_fast_succ")
                        }
                    }
                } while (0)
            })
        }

        function te(e) {
            return n(this, void 0, void 0, function* () {
                do {
                    if (e.length > 1) {
                        q(e).catch();
                        break
                    }
                    let t = e[0];
                    if (void 0 === t.browser || t.browser, t.browser, 0 === (yield M.client.callServerFunction("GetConfigValue", "TaskDefaultSettings", "OpenSilenceDownload", 0))) {
                        q(e).catch();
                        break
                    }
                    let n = 0;
                    e.forEach(e => {
                        e.fileSize && (n += e.fileSize)
                    });
                    let a = yield M.client.callServerFunction("GetDownloadDir");
                    yield ee(n, a);
                    let o = D.ThunderHelper.getTaskTypeFromUrl(t.url), r = g.ParseUrlFileNameNS.getNameFromUrl(t.url),
                        s = yield M.client.callServerFunction("GetConfigValue", "TaskDefaultSettings", "NewTaskStartMode", 1),
                        l = [], u = void 0;
                    if (o === d.DownloadKernel.TaskType.P2sp) u = {
                        taskType: d.DownloadKernel.TaskType.P2sp,
                        newTaskInfo: {
                            taskBaseInfo: {taskName: r, savePath: a},
                            p2spTaskInfo: {
                                url: t.url,
                                refUrl: t.referer,
                                cookie: t.cookie,
                                nameFixed: t.nameFixedFlag & N.ThunderNewtaskHelperNS.taskOptFileNameFixed ? 1 : 0
                            }
                        }
                    }, l = yield c.TaskUtilitiesAWNS.batchFindTaskAW([{
                        taskType: d.DownloadKernel.TaskType.P2sp,
                        value: t.url
                    }]); else if (o === d.DownloadKernel.TaskType.Emule) {
                        u = {
                            taskType: d.DownloadKernel.TaskType.Emule,
                            newTaskInfo: {taskBaseInfo: {taskName: r, savePath: a}, emuleTaskInfo: {url: t.url}}
                        };
                        let e = g.ParseUrlFileNameNS.parseEd2kUrl(t.url);
                        l = yield c.TaskUtilitiesAWNS.batchFindTaskAW([{
                            taskType: d.DownloadKernel.TaskType.Emule,
                            value: e.fileHash
                        }])
                    }
                    if (l && l.length > 0) {
                        (yield V.asyncRemoteCall.getCurrentWindow()).show(), i(l, [u]);
                        break
                    }
                    if (void 0 === u) break;
                    let h = yield U.createTask(u.taskType, u.newTaskInfo);
                    if (null !== h && 1 === s) {
                        let e = h.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskId);
                        I.DownloadDispatchNS.startTask(e)
                    }
                } while (0)
            })
        }

        function ie(e, t) {
            let i = "";
            do {
                if (null === e || void 0 === e || "" === e || null === t || void 0 === t || "" === t) break;
                let n = e;
                if (T.Common.isThunderPrivateUrl(e) && (n = T.Common.parseThunderPrivateUrl(e)), null === n || void 0 === n || "" === n) break;
                let a = n.indexOf(t);
                if (a < 0) break;
                let r = n.substring(a + t.length);
                if (null === r || void 0 === r || "" === r) break;
                i = ne(o.dirname(r))
            } while (0);
            return i
        }

        function ne(e) {
            let t = "";
            do {
                if (null === e || void 0 === e || "" === e) break;
                let i = e.split(/\//);
                if (i.length <= 0) break;
                for (let e = 0; e < i.length; ++e) {
                    let n = i[e];
                    if (null !== n && "" !== n) {
                        let e = n.replace(/[*?/:|<>"]/g, "");
                        null !== e && "" !== e && (e = e.trim(), t = "" === t ? e : o.join(t, e))
                    }
                }
            } while (0);
            return t
        }

        function ae(e, t, i) {
            let n = "";
            do {
                if (null === e || void 0 === e || "" === e) break;
                let a = e;
                if (T.Common.isThunderPrivateUrl(e) && (a = T.Common.parseThunderPrivateUrl(e)), null === a || void 0 === a || "" === a) break;
                if (null !== i && void 0 !== i && "" !== i) {
                    i === o.basename(t) && (n = a);
                    break
                }
                o.basename(a) === o.basename(t) && (n = a)
            } while (0);
            return n
        }

        function oe(e) {
            let t = !1;
            do {
                if (null === e || void 0 === e || "" === e) break;
                let i = w.parse(e).hostname;
                if (null === i || void 0 === i || "" === i) break;
                let n = C.default.getConfigInfo("thunderLink", "whiteList");
                if (null === n || void 0 === n || "" === n || n.length <= 0) break;
                for (let e = 0; e < n.length; ++e) if (i.toLowerCase() === n[e].toLowerCase()) {
                    t = !0;
                    break
                }
            } while (0);
            return t
        }

        function re(e) {
            return n(this, void 0, void 0, function* () {
                let t = "您正在使用旧版本迅雷，不支持下载";
                return null !== e && void 0 !== e && "" !== e ? t = t + '"' + e + '"' : t += '"此类文件"', t += "<br>建议您升级到最新版迅雷后，再次进行下载！", new Promise(e => {
                    p.MessageBox.confirm({
                        title: "请使用最新版迅雷",
                        type: p.MessageBox.ConfirmType.Warning,
                        content: t,
                        okText: "升级迅雷",
                        cancelVisible: !1
                    }).then(t => {
                        t.action === W.MessageBoxNS.Action.OK ? e(!0) : e(!1)
                    }).catch()
                })
            })
        }

        function se(e, t = "ThunderUnion", i = !1) {
            return n(this, void 0, void 0, function* () {
                do {
                    if (B.information("createThunderxTask strDataInfo:", e), void 0 === e || null === e || "" === e) break;
                    let n = null, a = null;
                    try {
                        a = JSON.parse(e)
                    } catch (e) {
                    }
                    if (B.information("createThunderxTask strDataInfo:", a), null === a || void 0 === a || a.length <= 0) break;
                    let r = a.json, s = !1;
                    if (null !== r && void 0 !== r && "" !== r) {
                        s = !0, n = yield N.ThunderNewtaskHelperNS.readThunderUnionConfig(r);
                        let e = "url=" + encodeURIComponent(r);
                        if (B.information("createThunderxTask:需要读取配置信息 jsonUrlStr = ", r), null === n || void 0 === n) {
                            e += ",result=fail,errorcode=pick_up_fail", x.XLStatNS.trackEvent("core_operate", "js_grouptask_pick_up_info", "", 0, 0, 0, 0, e);
                            break
                        }
                        if ("" === n || null === n.tasks || void 0 === n.tasks) {
                            e += ",result=fail,errorcode=analysis_fail", x.XLStatNS.trackEvent("core_operate", "js_grouptask_pick_up_info", "", 0, 0, 0, 0, e);
                            break
                        }
                        e += ",result=success", x.XLStatNS.trackEvent("core_operate", "js_grouptask_pick_up_info", "", 0, 0, 0, 0, e)
                    } else n = a;
                    let l = n.tasks;
                    if (null === l || void 0 === l || l.length <= 0) break;
                    let d = n.taskGroupName;
                    B.information("createThunderxTask:jsonData = ", n);
                    let u = n.minVersion;
                    if (null !== u && void 0 !== u && "" !== u || s && (u = "10.1.2.0"), null !== u && void 0 !== u && "" !== u) {
                        let e = o.join(__rootDir, "../../Thunder.exe"), t = K.getFileVersion(e);
                        if (-1 === A.TaskUtilHelper.compareVersion(u, t)) {
                            if (!G) {
                                x.XLStatNS.trackEvent("core_operate", "newthunder_lowversion_popup", "", 0, 0, 0, 0, ""), G = !0;
                                let e = yield re(d);
                                G = !1, e && (x.XLStatNS.trackEvent("core_operate", "newthunder_lowversion_download", "", 0, 0, 0, 0, ""), K.startManualUpdateWithUI())
                            }
                            return
                        }
                    }
                    let c = n.downloadDir, h = n.installFile, g = n.excludePath, p = n.runParams, v = n.userAgent,
                        m = n.createShortcut, y = null;
                    null !== n.threadCount && void 0 !== n.threadCount && "" !== n.threadCount && (y = Number(n.threadCount));
                    let k = [], w = "", C = "";
                    for (let e = 0; e < l.length; ++e) {
                        let i = l[e], n = i.url, a = i.name, o = i.referer || "", r = 0;
                        if (null !== h && void 0 !== h && "" !== h && "" === w) {
                            let e = ae(n, h, a);
                            "" !== e && (w = e)
                        }
                        if (m && m.targetFile && "" === C) {
                            let e = ae(n, m.targetFile, a);
                            "" !== e && (C = e)
                        }
                        null !== i.size && void 0 !== i.size && (r = i.size);
                        let s = "";
                        null !== i.dir && void 0 !== i.dir && "" !== i.dir ? s = ne(i.dir) : null !== g && void 0 !== g && "" !== g && (s = ie(n, g));
                        let d = n;
                        if (T.Common.isThunderPrivateUrl(n) && (d = T.Common.parseThunderPrivateUrl(n)), void 0 !== d && null !== d && "" !== d) {
                            let e = {
                                url: n,
                                referer: o,
                                fileName: a,
                                fileSize: r,
                                subDir: s,
                                statClick: t,
                                nameFixedFlag: N.ThunderNewtaskHelperNS.taskOptFileNameFixed
                            };
                            k.push(e)
                        }
                    }
                    if (k.length >= 1) {
                        let e = {};
                        if (null !== c && void 0 !== c && "" !== c) {
                            let t = f.ThunderUtil.getMaxFreeDriver();
                            null !== t && "" !== t && (t += ":"), c = o.join(t, c), e.isNotSavePath = !0, e.notSavePath = c
                        }
                        if (null !== y && void 0 !== y && (y <= 0 ? y = 1 : y >= 10 && (y = 10), e.threadCount = y), null !== v && void 0 !== v && "" !== v && (e.userAgent = v), null !== g && void 0 !== g && "" !== g && (e.excludePath = g), null !== d && void 0 !== d && "" !== d) {
                            if (null !== h && void 0 !== h && "" !== h && null !== w && void 0 !== w && "" !== w && oe(w)) {
                                let t = h.replace(/[*?:|<>"]/g, "_");
                                e.installFile = t, e.runParams = p
                            }
                            m && m.name && m.targetFile && oe(C) && (e.createShortcut = m)
                        }
                        Y(k, t, c, d, e), i && K.emptyClipBoard()
                    }
                } while (0)
            })
        }

        function le(e) {
            return n(this, void 0, void 0, function* () {
                (yield M.client.callServerFunction("GetCurrentNav")) === z.NavViewID.Download && (x.XLStatNS.trackEvent("download_leftpanel", "sync_to_yunpan_tips_show"), L.showNotifyEx(E.ToastNotifyManagerNS.notifyIdTaskAdd2Cloud, P.ToastNotifyItemType.GreenNotify, `${e}个下载任务已同步到云盘`, 3e3, {
                    viewVisible: !0,
                    onView: () => n(this, void 0, void 0, function* () {
                        x.XLStatNS.trackEvent("download_leftpanel", "sync_to_yunpan_tips_click", "", 0, 0, 0, 0, "clickid=look"), yield M.client.callServerFunction("SelectNav", z.NavViewID.Cloud), yield H.server.callClientFunctionByName("ThunderPanPluginWebview", "IpcShowTransferWindow")
                    }),
                    onClose: () => {
                        x.XLStatNS.trackEvent("download_leftpanel", "sync_to_yunpan_tips_click", "", 0, 0, 0, 0, "clickid=close")
                    }
                }))
            })
        }

        function de(e) {
            return n(this, void 0, void 0, function* () {
                let t = void 0;
                do {
                    if (yield M.client.callServerFunction("IsLogined")) {
                        t = e;
                        break
                    }
                    let i = "";
                    if (!(yield j.default(!1, !0, i))) break;
                    yield f.ThunderUtil.setTimeoutAw(50);
                    let n = yield H.server.callClientFunctionByName("ThunderPanPluginWebview", "IpcDefaultSavePath");
                    if (!n || !n[0]) {
                        B.information("cloud IpcDefaultSavePath error", n[2]);
                        break
                    }
                    "我的资源" === n[0].name && (n[0].name = "我的云盘\\我的资源"), t = n[0]
                } while (0);
                return t
            })
        }

        function ue(e, t, i, a) {
            return n(this, void 0, void 0, function* () {
                if (t = yield de(t)) {
                    let n = 0, o = [], r = e.map(e => ({
                            url: e.data.url,
                            name: e.data.fileName,
                            path: t.name,
                            parentId: t.id,
                            files: []
                        })),
                        s = yield H.server.callClientFunctionByName("ThunderPanPluginWebview", "IpcBatchAddUrlsToDrive", r);
                    if (s && s[0]) {
                        let e = s[0];
                        for (let s = 0; s < e.length; s++) {
                            let l = e[s];
                            if (l && l.task) {
                                if (n++, !i && !a) continue;
                                let e = l.task, d = i || a[r[s].url];
                                d && o.push({panId: e.id, user_id: e.user_id, path_id: t.id, path: t.name, taskId: d})
                            }
                        }
                    } else B.information("cloud IpcBatchAddUrlsToDrive err", s[2]);
                    o.length > 0 && U.batchRelateYunTask(o), n > 0 && (yield le(n))
                }
            })
        }

        function ce(e, t, i) {
            return n(this, void 0, void 0, function* () {
                if (yield de(t)) {
                    let n = yield H.server.callClientFunctionByName("ThunderPanPluginWebview", "IpcBatchAddUrlsToDrive", [{
                        url: e.url,
                        name: e.name,
                        path: t.name,
                        parentId: t.id,
                        files: e.files
                    }]);
                    if (n && n[0]) {
                        let e = n[0][0];
                        if (e) {
                            let n = e.task;
                            n && i && U.batchRelateYunTask([{
                                panId: n.id,
                                user_id: n.user_id,
                                path_id: t.id,
                                path: t.name,
                                taskId: i
                            }]), n && (yield le(1))
                        }
                    }
                }
            })
        }

        e.selectTask = t, e.repeatTasksMsg = i, e.createNewTaskWindow = q, e.createPreNewTaskWindow = Y, e.createBtTaskWindow = J, e.uninit = function () {
            R.uninitNodeBKWindow()
        }, e.saveLastestDownloadPath = Z, e.createTaskByUrl = function (e, t) {
            do {
                if (void 0 === e || null === e || "" === e) break;
                let i = "";
                i = t && "" !== t ? t : g.ParseUrlFileNameNS.getNameFromUrl(e);
                let n = D.ThunderHelper.getTaskTypeFromUrl(e);
                n === d.DownloadKernel.TaskType.Emule || n === d.DownloadKernel.TaskType.P2sp ? te([{
                    url: e,
                    fileName: i,
                    nameFixedFlag: t && "" !== t ? N.ThunderNewtaskHelperNS.taskOptFileNameFixed : 0
                }]).catch() : n === d.DownloadKernel.TaskType.Bt && J({url: e, type: "url"}, {browser: "xlbrowser.exe"})
            } while (0)
        }, e.createUnionTask = function (e) {
            return n(this, void 0, void 0, function* () {
                do {
                    let t = decodeURIComponent(e);
                    B.information("createUnionTask:urlPath = ", t, e);
                    let i = yield k.FileSystemAWNS.readFileAW(t);
                    if (yield k.FileSystemAWNS.unlinkAW(t), null === i || void 0 === i || "" === i.toString()) {
                        B.information("createUnionTask:读取内容 buf为null");
                        break
                    }
                    let n = i.toString(), a = (n += "\r\n").split("\r\n");
                    if (a.length <= 1) {
                        B.information("createUnionTask:lines.length <= 1");
                        break
                    }
                    let r = !1, s = "", l = [], u = [], c = "", h = "", g = "", p = "", v = "", m = "", y = "",
                        w = new Map, C = new Map, S = new Map, b = new Map, I = new Map, _ = null;
                    for (let e = 0; e < a.length; ++e) {
                        let t = a[e].split("=");
                        if (null !== t && 2 === t.length) {
                            let e = t[0].toLowerCase(), i = t[1];
                            if (null !== e && "" !== e) {
                                if (i = i.replace(/\+/g, "%20"), i = decodeURIComponent(i), "json" === e) {
                                    r = !0, s = i;
                                    break
                                }
                                if ("taskgroupname" === e) c = i; else if ("downloaddir" === e) h = i; else if ("installfile" === e) g = i; else if ("excludepath" === e) p = i; else if ("runparams" === e) v = i; else if (0 === e.indexOf("createshortcut")) {
                                    let t = e.match(/createshortcut\[(.+)\]/);
                                    if (t && t[1].length > 0) switch (_ || (_ = {}), t[1]) {
                                        case"name":
                                            _.name = i;
                                            break;
                                        case"targetfile":
                                            _.targetFile = i;
                                            break;
                                        case"runparams":
                                            _.runParams = i
                                    }
                                } else if ("useragent" === e) m = i; else if ("threadcount" === e) y = i; else {
                                    B.information("createUnionTask:", e, i);
                                    let t = e.match(/^tasks\[\d+\]/), n = "";
                                    null !== t && void 0 !== t && (n = t[0]);
                                    let a = /url/;
                                    a.test(e) ? "" !== n ? w.set(n, i) : l.push(i) : (a = /referer/).test(e) ? "" !== n ? C.set(n, i) : u.push(i) : (a = /^tasks\[\d+\]\[name\]/).test(e) ? "" !== n && S.set(n, i) : (a = /^tasks\[\d+\]\[size\]/).test(e) ? "" !== n && b.set(n, i) : (a = /^tasks\[\d+\]\[dir\]/).test(e) && "" !== n && I.set(n, i)
                                }
                            }
                        }
                    }
                    if (r) {
                        B.information("createUnionTask 通过读取配置信息得到数据 jsonUrlStr:", s);
                        let e = {minVersion: "", json: s};
                        yield se(JSON.stringify(e))
                    } else {
                        let e = [], t = [], i = "", n = "";
                        if (null !== w && w.size > 0 && w.forEach((a, o) => {
                            let r = a, s = D.ThunderHelper.getTaskTypeFromUrl(r), l = "", u = 0, c = C.get(o) || "";
                            if (null !== S && S.size > 0 && (l = S.get(o)), null !== g && void 0 !== g && "" !== g && "" === i) {
                                let e = ae(r, g, l);
                                "" !== e && (i = e)
                            }
                            if (_ && "" !== _.targetFile && "" === n) {
                                let e = ae(r, _.targetFile, l);
                                "" !== e && (n = e)
                            }
                            if (null !== b && b.size > 0) {
                                let e = b.get(o);
                                null !== e && "" !== e && (u = Number(e))
                            }
                            let h = "", f = I.get(o);
                            null !== f && void 0 !== f && "" !== f ? h = ne(f) : null !== p && void 0 !== p && "" !== p && (h = ie(r, p));
                            let v = r;
                            if (T.Common.isThunderPrivateUrl(r) && (v = T.Common.parseThunderPrivateUrl(r)), void 0 !== v && null !== v && "" !== v) {
                                let i = {
                                    url: r,
                                    referer: c,
                                    fileName: l,
                                    fileSize: u,
                                    subDir: h,
                                    statClick: "ThunderUnion",
                                    nameFixedFlag: N.ThunderNewtaskHelperNS.taskOptFileNameFixed
                                };
                                s === d.DownloadKernel.TaskType.P2sp || s === d.DownloadKernel.TaskType.Emule ? e.push(i) : s !== d.DownloadKernel.TaskType.Magnet && s !== d.DownloadKernel.TaskType.Bt || t.push(i)
                            }
                        }), e.length >= 1) {
                            let t = {};
                            if (null !== h && "" !== h) {
                                let e = f.ThunderUtil.getMaxFreeDriver();
                                null !== e && "" !== e && (e += ":"), h = o.join(e, h), t.isNotSavePath = !0, t.notSavePath = h
                            }
                            if (null !== y && void 0 !== y && "" !== y) {
                                let e = Number(y);
                                e <= 0 ? e = 1 : e >= 10 && (e = 10), t.threadCount = e
                            }
                            if (null !== m && void 0 !== m && "" !== m && (t.userAgent = m), null !== p && void 0 !== p && "" !== p && (t.excludePath = p), null !== c && void 0 !== c && "" !== c) {
                                if (null !== g && void 0 !== g && "" !== g && null !== i && void 0 !== i && "" !== i && oe(i)) {
                                    let e = g.replace(/[*?:|<>"]/g, "_");
                                    t.installFile = e, t.runParams = v
                                }
                                _ && _.name && _.targetFile && oe(n) && (t.createShortcut = _)
                            }
                            B.information("createUnionTask：新协议拉起新建面板", t), Y(e, "ThunderUnion", h, c, t)
                        }
                        if (t.length > 0) for (let e of t) J({url: e.url, type: "url"}, {
                            source: e.statClick,
                            referer: e.referer
                        });
                        if (l.length >= 1) {
                            B.information("createUnionTask：旧协议拉起新建面板");
                            let e = [];
                            for (let t = 0; t < l.length; ++t) e.push({url: l[t], referer: u[t] || ""});
                            Y(e, "ThunderUnion")
                        }
                    }
                } while (0)
            })
        }, e.sendMessageBox = re, e.createThunderxTask = se, e.addUrls2Cloud = ue, e.addBt2Cloud = ce, e.init = function () {
            return n(this, void 0, void 0, function* () {
                B.information("xxxxx init====="), R.setNewTaskCallback(e => n(this, void 0, void 0, function* () {
                    if (B.information("setNewTaskCallback", e), e.length > 0) {
                        let t = [], i = [];
                        for (let n of e) {
                            let e = n.url, a = D.ThunderHelper.getTaskTypeFromUrl(e);
                            a === d.DownloadKernel.TaskType.P2sp || a === d.DownloadKernel.TaskType.Emule ? t.push(n) : a !== d.DownloadKernel.TaskType.Magnet && a !== d.DownloadKernel.TaskType.Bt || i.push(n)
                        }
                        if (t.length > 0 && te(t).catch(), i.length > 0) for (let e of i) J({
                            url: e.url,
                            type: "url"
                        }, {browser: e.browser, source: e.statClick, referer: e.referer, cookie: e.cookie})
                    }
                })), R.initNodeBKWindow();
                let e = yield V.asyncRemoteCall.getIpcMain();
                e.on(l.ThunderChannelList.channelRMNewTaskCreateNewTask, (e, t, a, r, s, u, f, g, p, v) => n(this, void 0, void 0, function* () {
                    let n = null;
                    try {
                        n = JSON.parse(r)
                    } catch (e) {
                        B.warning(e)
                    }
                    if (null === n) return;
                    let m = [...Object.values(n)];
                    if (B.information("xxx", m, s), s) {
                        let i = yield M.client.callServerFunction("GetUserID");
                        if (S.PrivateSpaceHelperNS.isPrivateSpaceOpen(i)) {
                            let t = yield S.PrivateSpaceHelperNS.openPrivateCategory(i);
                            if (t < 0 && e.sender.send(l.ThunderChannelList.channelMRNewTaskCreateNewTaskResult, !1, "开启私人空间后才能创建任务至私人空间"), 0 !== t) return;
                            let n = yield S.PrivateSpaceHelperNS.accessPrivateCategory(i);
                            if (n < 0 && e.sender.send(l.ThunderChannelList.channelMRNewTaskCreateNewTaskResult, !1, "开启私人空间后才能创建任务至私人空间"), 0 !== n) return
                        } else {
                            s = !1;
                            let e = y.ConfigNS.getValue("PathAndCategory", "LastUsedPath", "");
                            null !== e && void 0 !== e && "" !== e || (e = y.ConfigNS.getValue("TaskDefaultSettings", "DefaultPath", "")), t = e, L.showNotify(E.ToastNotifyManagerNS.notifyIdScheduleTaskDownloadMode, P.ToastNotifyItemType.GreenNotify, "您未开通私人空间，请开通后再移动任务？", 3e3)
                        }
                    }
                    e.sender.send(l.ThunderChannelList.channelMRNewTaskCreateNewTaskResult, !0);
                    let k = 0;
                    void 0 !== typeof m && null !== m && m.length > 0 && m.forEach(e => {
                        e.data.fileSize && (k += e.data.fileSize), 0 === e.data.url.indexOf("ftp://") && e.setting.loginFtp && e.setting && e.setting.ftpInfo && e.setting.ftpInfo.userName && e.setting.ftpInfo.password && (e.data.url = K.makeUrl(e.data.url, e.setting.ftpInfo.userName, e.setting.ftpInfo.password))
                    }), yield ee(k, t), null !== g && void 0 !== g && null !== g.isNotSavePath && void 0 !== g.isNotSavePath && !0 === g.isNotSavePath || s || Z(t), B.information(g), B.verbose(e);
                    let T = [], w = void 0, C = {};
                    if (void 0 !== typeof m && null !== m && m.length > 0) {
                        let e = [], n = t;
                        null !== f && void 0 !== f && "" !== f && (n = o.join(t, f));
                        let r = m.map(e => {
                            let t = "";
                            return e.taskType === d.DownloadKernel.TaskType.P2sp ? t = e.data.url : e.taskType === d.DownloadKernel.TaskType.Emule && (t = e.data.fileHash), {
                                taskType: e.taskType,
                                value: t
                            }
                        }), l = yield c.TaskUtilitiesAWNS.batchFindTaskAW(r);
                        for (let t = 0; t < m.length; t++) {
                            let i = m[t], a = n;
                            void 0 !== i.data.subDir && null !== i.data.subDir && "" !== i.data.subDir && (a = o.join(n, i.data.subDir));
                            let r = h.TaskCtrlOperatorNS.constructProductInfo(i.data.browser),
                                u = {taskName: i.data.fileName, savePath: a, productInfo: r, origin: i.data.statClick};
                            i.data.fileSize && i.data.fileSize > 0 && (u.fileSize = i.data.fileSize), i.data.gcid && "" !== i.data.gcid && (u.gcid = i.data.gcid);
                            let c = {taskBaseInfo: u, privateSpace: s};
                            if (c.birdKey = i.data.birdkeyChars ? i.data.birdkeyChars : void 0, void 0 !== i.setting && null !== i.setting) {
                                let e = i.setting;
                                void 0 !== e.note && null !== e.note && "" !== e.note && (u.description = e.note), e.openAfterDownload && (u.openOnComplete = 1)
                            }
                            if (i.taskType === d.DownloadKernel.TaskType.P2sp) {
                                if (c.taskType = d.DownloadKernel.TaskType.P2sp, c.p2spTaskInfo = {
                                    url: i.data.url,
                                    refUrl: i.data.referer,
                                    cookie: i.data.cookie,
                                    downloadSubTask: 1,
                                    nameFixed: i.data.nameFixedFlag & N.ThunderNewtaskHelperNS.taskOptFileNameFixed ? 1 : 0
                                }, void 0 !== i.setting && null !== i.setting) {
                                    let e = i.setting;
                                    e.onlyOrigin && (c.p2spTaskInfo.useOriginResourceOnly = 1), void 0 !== e.thread && "number" == typeof e.thread && (c.p2spTaskInfo.originResourceThreadCount = e.thread)
                                }
                                let t = !1;
                                if (l && l.length > 0) for (let e of l) if (e.getType() === d.DownloadKernel.TaskType.P2sp && e.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskUrl).toLowerCase() === i.data.url.toLowerCase()) {
                                    t = !0;
                                    break
                                }
                                if (t) {
                                    e.push({taskType: d.DownloadKernel.TaskType.P2sp, newTaskInfo: c});
                                    continue
                                }
                                T.push(c)
                            } else if (i.taskType === d.DownloadKernel.TaskType.Emule) {
                                c.taskType = d.DownloadKernel.TaskType.Emule, c.emuleTaskInfo = {
                                    url: i.data.url,
                                    downloadSubTask: 1
                                };
                                let t = !1;
                                if (l && l.length > 0) for (let e of l) if (e.getType() === d.DownloadKernel.TaskType.Emule && e.getExtraObject().getFileHash().toLowerCase() === i.data.fileHash.toLowerCase()) {
                                    t = !0;
                                    break
                                }
                                if (t) {
                                    e.push({taskType: d.DownloadKernel.TaskType.Emule, newTaskInfo: c});
                                    continue
                                }
                                T.push(c)
                            }
                        }
                        if (null !== f && void 0 !== f && "" !== f && T.length > 0) {
                            let e = {taskName: f, savePath: n, origin: T[0].taskBaseInfo.origin}, i = {subTaskList: T},
                                o = yield U.createTask(d.DownloadKernel.TaskType.Group, {
                                    taskBaseInfo: e,
                                    groupTaskInfo: i,
                                    privateSpace: s
                                });
                            if (null !== o) {
                                let e = o.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskId);
                                w = e, 1 === a && I.DownloadDispatchNS.startTask(e);
                                let i = o.getExtraObject();
                                null !== g && void 0 !== g && (B.information("setUserData:", g), null !== g.installFile && void 0 !== g.installFile && "" !== g.installFile && i.setUserData(b.TaskUserDataGUID.guidDownloadCompleteInstall, "installFile", g.installFile), g.excludePath && "" !== g.excludePath && i.setUserData(b.TaskUserDataGUID.guidDownloadGroupTask, "excludePath", g.excludePath), null !== g.isSelectInstallCheck && void 0 !== g.isSelectInstallCheck && g.isSelectInstallCheck && i.setUserData(b.TaskUserDataGUID.guidDownloadCompleteInstall, "isImmediatelyInstall", "1"), null !== g.runParams && void 0 !== g.runParams && "" !== g.runParams && i.setUserData(b.TaskUserDataGUID.guidDownloadCompleteRunParams, "runParams", g.runParams), g.createShortcut && i.setUserData(b.TaskUserDataGUID.guidCreateShortcut, "createShortcut", JSON.stringify(g.createShortcut))), i.setUserData(b.TaskUserDataGUID.guidDownloadGroupTask, "canRepost", "true"), g && g.notSavePath === t && i.setUserData(b.TaskUserDataGUID.guidNotSavePath, "notSavePath", g.notSavePath)
                            }
                        } else if (T.length > 0) {
                            let e = yield U.createBatchTask(T), t = [];
                            for (let i of e) t.push(i.getId()), C[i.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskUrl)] = i.getId();
                            1 === a && (B.information("download-dispatch createBatchTask", t), I.DownloadDispatchNS.startTasks(t))
                        }
                        l.length > 0 && i(l, e)
                    }
                    if (u && u.length > 0) for (let e of u) J({
                        url: e.url,
                        type: "url",
                        birdkeyChars: e.birdkeyChars
                    }, {source: e.statClick || "newwindow_url", referer: e.referer});
                    if (p && p.length > 0) for (let e of p) setTimeout(() => {
                        se(e.url, "newwindow_url", !1).catch()
                    }, 50);
                    v && (yield ue(m, v, w, w ? void 0 : C))
                })), e.on(l.ThunderChannelList.channelRMNewTaskDownloadTorrent, (e, t, i) => n(this, void 0, void 0, function* () {
                    let a = (t, i, a) => n(this, void 0, void 0, function* () {
                            do {
                                if (!e.sender) break;
                                let n = U.getTaskFromTaskId(t);
                                if (yield e.sender.isDestroyed()) {
                                    B.information("download torrent back isDestroyed");
                                    break
                                }
                                if (i) {
                                    if (!n) {
                                        e.sender.send(l.ThunderChannelList.channelMRNewTaskDownloadTorrentResult, !1), B.information("channelRMNewTaskDownloadTorrent error");
                                        break
                                    }
                                    let t = n.getTaskAttribute(d.DownloadKernel.TaskAttribute.SavePath),
                                        i = n.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskName), a = o.join(t, i),
                                        r = yield c.TaskUtilitiesAWNS.parserBtFileInfoAW(a);
                                    if (!e.sender || (yield e.sender.isDestroyed())) {
                                        B.information("parserBtFileInfoAW back isDestroyed");
                                        break
                                    }
                                    if (null === r) {
                                        let t = {errinfo: "磁力链接解析失败"};
                                        e.sender.send(l.ThunderChannelList.channelMRNewTaskDownloadTorrentResult, !1, JSON.stringify(t));
                                        break
                                    }
                                    let s = JSON.stringify(r);
                                    e.sender.send(l.ThunderChannelList.channelMRNewTaskDownloadTorrentResult, !0, s, a)
                                } else {
                                    let t = void 0;
                                    705 === a && (t = {
                                        errinfo: "包含违规内容 无法下载",
                                        disable: !0
                                    }), e.sender.send(l.ThunderChannelList.channelMRNewTaskDownloadTorrentResult, !1, t ? JSON.stringify(t) : t)
                                }
                            } while (0)
                        }), r = {taskType: d.DownloadKernel.TaskType.Magnet, value: t},
                        s = yield c.TaskUtilitiesAWNS.batchFindTaskAW([r]);
                    if (s && s.length > 0) {
                        B.information("channelRMNewTaskDownloadTorrent repeat magnet task.url:", t);
                        let i = s[0].getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskId);
                        e.sender.send(l.ThunderChannelList.channelMRNewTaskMagnetTaskCreated, i), _.MagnetListenerNS.addRef(i, a)
                    } else {
                        let n = yield f.ThunderUtil.getThunderTempPath(!0),
                            r = g.ParseUrlFileNameNS.parseMagnetUrl(t) + ".torrent", s = o.join(n, r), c = {
                                taskBaseInfo: {
                                    taskName: r,
                                    savePath: n,
                                    productInfo: h.TaskCtrlOperatorNS.constructProductInfo(i.browser),
                                    origin: i.source
                                }, magnetTaskInfo: {url: t, torrentFilePath: s}, isBackground: !0
                            };
                        const p = u.DownloadKernelTaskManager.getTaskManager();
                        B.information("create task magnet productinfo", i);
                        let v = yield p.createTask(d.DownloadKernel.TaskType.Magnet, c);
                        if (null !== v) {
                            let t = v.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskId);
                            e.sender.send(l.ThunderChannelList.channelMRNewTaskMagnetTaskCreated, t), _.MagnetListenerNS.addRef(t, a), I.DownloadDispatchNS.startTask(t, !0)
                        }
                    }
                })), e.on(l.ThunderChannelList.channelRMNewTaskCancleMagnet, (e, t) => {
                    _.MagnetListenerNS.release(t)
                }), e.on(l.ThunderChannelList.channelRMNewTaskCreateBtTask, (e, t, a, r, s, u, f, g, v, m, k, T) => n(this, void 0, void 0, function* () {
                    B.verbose(e);
                    let n = !1, w = f.map(e => String(e)), C = void 0, b = void 0;
                    do {
                        if (void 0 === r || null === r) {
                            e.sender.send(l.ThunderChannelList.channelMRNewTaskCreateBtTaskResult, !1, "开启私人空间后才能创建任务至私人空间");
                            break
                        }
                        let T = null;
                        try {
                            T = JSON.parse(r)
                        } catch (e) {
                            B.warning(e)
                        }
                        if (null === T) break;
                        if (g) {
                            let i = yield M.client.callServerFunction("GetUserID");
                            if (S.PrivateSpaceHelperNS.isPrivateSpaceOpen(i)) {
                                let t = yield S.PrivateSpaceHelperNS.openPrivateCategory(i);
                                if (t < 0 && e.sender && !(yield e.sender.isDestroyed()) && e.sender.send(l.ThunderChannelList.channelMRNewTaskCreateBtTaskResult, !1), 0 !== t) break;
                                let n = yield S.PrivateSpaceHelperNS.accessPrivateCategory(i);
                                if (n < 0 && e.sender && !(yield e.sender.isDestroyed()) && e.sender.send(l.ThunderChannelList.channelMRNewTaskCreateBtTaskResult, !1), 0 !== n) break
                            } else {
                                g = !1;
                                let e = y.ConfigNS.getValue("PathAndCategory", "LastUsedPath", "");
                                null !== e && void 0 !== e && "" !== e || (e = y.ConfigNS.getValue("TaskDefaultSettings", "DefaultPath", "")), t = e, L.showNotify(E.ToastNotifyManagerNS.notifyIdScheduleTaskDownloadMode, P.ToastNotifyItemType.GreenNotify, "您未开通私人空间，请开通后再移动任务？", 3e3)
                            }
                        }
                        if (e.sender && !(yield e.sender.isDestroyed()) && e.sender.send(l.ThunderChannelList.channelMRNewTaskCreateBtTaskResult, !0), g || Z(t), void 0 !== typeof t && null !== t || (t = yield M.client.callServerFunction("GetDownloadDir")), void 0 === typeof T || null === T) break;
                        if (T = Object.assign({}, T), void 0 === typeof s || null === s) break;
                        n = !0, b = T.title;
                        let w = 0, _ = {};
                        f.forEach(e => {
                            _[e] = !0
                        });
                        let A = 0, D = 0;
                        for (let e of T.fileLists) {
                            if (A === T.fileLists.length) break;
                            _[e.realIndex] && (A++, e.fileSize && (D += e.fileSize, w += e.fileSize))
                        }
                        yield ee(w, t);
                        let x = yield h.TaskCtrlOperatorNS.getBtExistFilePathList(t, T, f),
                            N = {taskType: d.DownloadKernel.TaskType.Bt, value: T.infoId},
                            O = yield c.TaskUtilitiesAWNS.batchFindTaskAW([N]), F = T.trackerUrls.join("\n"),
                            R = h.TaskCtrlOperatorNS.constructProductInfo(v.browser),
                            K = {savePath: t, taskName: T.title, productInfo: R, origin: v.source}, V = {
                                originUrl: m,
                                refUrl: v.referer,
                                seedFile: s,
                                displayName: u,
                                fileLists: T.fileLists,
                                infoId: T.infoId,
                                fileRealIndexLists: f,
                                tracker: F
                            }, H = {
                                taskType: d.DownloadKernel.TaskType.Bt,
                                newTaskInfo: {
                                    taskType: d.DownloadKernel.TaskType.Bt,
                                    taskBaseInfo: K,
                                    btTaskInfo: V,
                                    privateSpace: g
                                }
                            };
                        if (H.newTaskInfo.birdKey = k || void 0, 0 !== x.length) {
                            if (O && O.length > 0) {
                                p.MessageBox.custom("bt-repeat-task", {}, {width: 450, height: 240}).then(e => {
                                    if (e.action === W.MessageBoxNS.Action.OK) {
                                        let i = e.args.picked,
                                            n = O[0].getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskId);
                                        "continue" === i ? I.DownloadDispatchNS.startTask(n) : X(t, a, T, s, u, f, v, i, x, n, g).catch()
                                    }
                                }).catch();
                                break
                            }
                            {
                                let e = o.join(t, T.title), i = x.map(e => e.relativePath), n = JSON.stringify(i);
                                p.MessageBox.custom("bt-repeat-file", {saveDir: e, file: n}, {
                                    width: 450,
                                    height: 344
                                }).then(e => {
                                    if (e.action === W.MessageBoxNS.Action.OK) {
                                        let i = e.args.picked;
                                        X(t, a, T, s, u, f, v, i, x, void 0, g, m).catch()
                                    }
                                }).catch();
                                break
                            }
                        }
                        if (O && O.length > 0) {
                            i(O, [H]);
                            break
                        }
                        let z = yield U.createTask(H.taskType, H.newTaskInfo);
                        null !== z ? (C = z.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskId), 1 === a && I.DownloadDispatchNS.startTask(C)) : B.warning("create bt task null")
                    } while (0);
                    n && T && (yield ce({files: w, url: m, name: b}, T, C))
                })), e.on(l.ThunderChannelList.channelRMImportTorrent, (e, t) => n(this, void 0, void 0, function* () {
                    B.verbose(e);
                    let i = yield c.TaskUtilitiesAWNS.parserBtFileInfoAW(t);
                    J(null === i ? {type: "file", seedFile: t} : {
                        data: JSON.stringify(i),
                        type: "file",
                        seedFile: t
                    }, {source: "newwindow_bt"})
                }))
            })
        }
    }(t.ThunderNewTask || (t.ThunderNewTask = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(19);
    t.default = class {
        constructor() {
            this.emitter = null, this.emitter = new n.EventEmitter
        }

        attachOnceListener(e, t) {
            this.emitter.once(e, t)
        }

        attachListener(e, t) {
            this.emitter.addListener(e, t)
        }

        prependListener(e, t) {
            this.emitter.prependListener(e, t)
        }

        prependOnceListener(e, t) {
            this.emitter.prependOnceListener(e, t)
        }

        detachListener(e, t) {
            this.emitter.removeListener(e, t)
        }

        fireEvent(e, ...t) {
            return this.emitter.emit(e, ...t)
        }

        setMaxListeners(e) {
            this.emitter.setMaxListeners(e)
        }
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(3), a = i(299);
    !function (e) {
        const t = new class {
            constructor() {
                this.categoryViews = [];
                let e = new a.CategoryView(-1, n.DownloadKernel.CategroyViewID.Downloading),
                    t = new a.CategoryView(-1, n.DownloadKernel.CategroyViewID.Completed),
                    i = new a.CategoryView(-1, n.DownloadKernel.CategroyViewID.Recycle);
                this.categoryViews.push(e), this.categoryViews.push(t), this.categoryViews.push(i)
            }

            getCategoryViews() {
                return this.categoryViews
            }

            getCategoryViewCount() {
                return this.categoryViews.length
            }

            getCategoryViewFromId(e) {
                let t = null;
                for (let i = 0; i < this.categoryViews.length; ++i) {
                    let n = this.categoryViews[i];
                    if (n && e === n.getCategoryViewId()) {
                        t = n;
                        break
                    }
                }
                return t
            }
        };
        e.getCategoryViewManager = function () {
            return t
        }
    }(t.DownloadKernelCategoryViewManager || (t.DownloadKernelCategoryViewManager = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(0), r = i(6), s = i(5), l = i(3), d = i(11), u = i(22), c = i(37), h = i(9), f = i(4),
        g = i(27), p = i(43), v = i(45), m = i(47), y = i(110), k = i(31), T = i(29), w = i(7),
        C = o.default.getLogger("Thunder.TaskOperator"), S = r.default(a.join(__rootDir, "../bin/ThunderHelper.node")),
        b = d.DownloadKernelTaskManager.getTaskManager(), I = T.DownloadKernelCategoryManager.getCategoryManager();
    !function (e) {
        function t(e) {
            let t = S.getInstallChannel();
            e = void 0 === e ? "" : e;
            let i = a.join(__rootDir, "../../Thunder.exe");
            return `xl_thunder_pc|${S.getFileVersion(i)}|${t}|${e}`
        }

        function i(e) {
            return n(this, void 0, void 0, function* () {
                let t = !1;
                do {
                    if (f.isNullOrUndefined(e)) break;
                    let i = e.savePath, n = e.taskName;
                    void 0 !== n && n.indexOf(".") === n.length - 1 && (n = n.substring(0, n.length - 1));
                    let o = a.join(i, n);
                    if (e.taskType === l.DownloadKernel.TaskType.P2sp || e.taskType === l.DownloadKernel.TaskType.Emule) ; else if (e.taskType === l.DownloadKernel.TaskType.Bt) {
                        let n = b.getTaskFromTaskId(e.taskId), r = n.getExtraObject(), d = r.getDownloadFile();
                        if (1 !== d.length) {
                            t = !(yield s.FileSystemAWNS.isDirectoryEmptyAW(o));
                            break
                        }
                        if (yield v.SingleBtTaskNS.isSingleBtTask(n)) o = v.SingleBtTaskNS.getSinleBtTaskFilePath(n); else {
                            let e = r.getBtFileList();
                            for (let [, t]of e) {
                                if (t.getBtFileAttribute(l.DownloadKernel.BtFileAttribute.RealIndex) === d[0]) {
                                    let e = t.getBtFileAttribute(l.DownloadKernel.BtFileAttribute.FilePath),
                                        n = t.getBtFileAttribute(l.DownloadKernel.BtFileAttribute.FileName),
                                        r = a.join(o, e);
                                    if (o = a.join(o, e, n), e && !(yield s.FileSystemAWNS.dirExistsAW(r))) {
                                        let t = a.join(i, e);
                                        (yield s.FileSystemAWNS.dirExistsAW(t)) && (o = a.join(i, e, n))
                                    }
                                    break
                                }
                            }
                        }
                    } else if (e.taskType === l.DownloadKernel.TaskType.Group) {
                        o = i;
                        let n = b.getTaskFromTaskId(e.taskId).getExtraObject(), r = n.getSubTaskCount();
                        for (let e = 0; e < r; ++e) {
                            let i = n.getSubTaskByIndex(e);
                            if (1 === i.getTaskAttribute(l.DownloadKernel.TaskAttribute.DownloadSubTask)) {
                                let e = i.getTaskAttribute(l.DownloadKernel.TaskAttribute.SavePath),
                                    n = i.getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskName), o = a.join(e, n);
                                if (yield s.FileSystemAWNS.existsAW(o)) {
                                    t = !0;
                                    break
                                }
                            }
                        }
                        break
                    }
                    t = yield s.FileSystemAWNS.existsAW(o)
                } while (0);
                return t
            })
        }

        function o(e) {
            return n(this, void 0, void 0, function* () {
                let t = !1;
                do {
                    let n = e.taskStatus;
                    if (n === l.DownloadKernel.TaskStatus.StartPending || n === l.DownloadKernel.TaskStatus.StopPending || n === l.DownloadKernel.TaskStatus.DestroyPending) break;
                    let o = b.getTaskFromTaskId(e.taskId);
                    if (yield v.SingleBtTaskNS.isSingleBtTask(o)) {
                        let e = v.SingleBtTaskNS.getSinleBtTaskFilePath(o);
                        t = yield s.FileSystemAWNS.existsAW(e)
                    } else {
                        let n = e.savePath, r = e.taskName;
                        void 0 !== r && r.indexOf(".") === r.length - 1 && (r = r.substring(0, r.length - 1));
                        let d = a.join(n, r), u = e.taskType;
                        if (u === l.DownloadKernel.TaskType.Bt) {
                            if ("" === r) {
                                t = yield s.FileSystemAWNS.existsAW(n);
                                break
                            }
                            if (t = yield s.FileSystemAWNS.existsAW(d)) break;
                            {
                                let e = yield v.SingleBtTaskNS.getCorrectSingleBtFolder(o);
                                if (e) {
                                    let i = a.join(n, e);
                                    t = yield s.FileSystemAWNS.dirExistsAW(i)
                                }
                            }
                        } else u === l.DownloadKernel.TaskType.Group ? (t = yield s.FileSystemAWNS.existsAW(n)) && (t = yield i(e)) : t = yield s.FileSystemAWNS.existsAW(d)
                    }
                } while (0);
                return t
            })
        }

        e.getUserLoginInfo = function () {
            return n(this, void 0, void 0, function* () {
                let e = "";
                do {
                    if (!(yield w.client.callServerFunction("IsLogined"))) break;
                    let t = yield w.client.callServerFunction("GetSessionID"),
                        i = yield w.client.callServerFunction("GetUserID");
                    if (!t) break;
                    e = "/ssessionid " + t + " /suserid " + i
                } while (0);
                return e
            })
        }, e.redownloadTask = function (e, i, a) {
            return n(this, void 0, void 0, function* () {
                if (void 0 === i) if (1 === e.length) {
                    let t = e[0].taskStatus;
                    i = t === l.DownloadKernel.TaskStatus.Succeeded || t === l.DownloadKernel.TaskStatus.Seeding ? yield o(e[0]) : t !== l.DownloadKernel.TaskStatus.Failed
                } else i = !0;
                let r = g.default.getCurrentCategoryId(), s = "mypc";
                if (-1 !== r) if (I.isPrivateCategory(r)) s = "private"; else {
                    let e = I.getCategoryFromId(r);
                    e && (s = e.getName())
                }
                if (i) {
                    let i = !1, o = !1;
                    if (1 === e.length && e[0].taskType === l.DownloadKernel.TaskType.P2sp) {
                        i = !0;
                        let t = b.getTaskFromTaskId(e[0].taskId);
                        t && (o = t.getOriginOnlyStrategy())
                    }
                    u.MessageBox.confirm({
                        title: "重新下载会删除本地的文件，确定要重新下载吗？",
                        type: u.MessageBox.ConfirmType.Info,
                        checkboxEnabled: i,
                        checkboxChecked: o,
                        checkboxLabel: "从原始地址重新下载"
                    }).then(o => n(this, void 0, void 0, function* () {
                        if (o.action === c.MessageBoxNS.Action.OK) {
                            if (void 0 !== a) {
                                let e = "";
                                e = void 0 !== o.checkboxChecked && o.checkboxChecked ? `panel_type=${s},button=origin` : `panel_type=${s},button=reload`, h.XLStatNS.trackEvent("download_leftpanel", a, "", 0, 0, 0, 0, e)
                            }
                            for (let n of e) {
                                let e = {
                                    taskBaseInfo: {
                                        savePath: void 0,
                                        taskName: void 0,
                                        productInfo: t(""),
                                        origin: "re_download"
                                    },
                                    p2spTaskInfo: {
                                        url: void 0,
                                        useOriginResourceOnly: i ? o.checkboxChecked ? 1 : 0 : void 0
                                    }
                                }, a = yield b.reDownloadTask(n.taskId, e);
                                if (null !== a) {
                                    let e = a.getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskId);
                                    p.DownloadDispatchNS.startTask(e)
                                }
                            }
                        } else if (void 0 !== a) {
                            let e = "";
                            e = o.action === c.MessageBoxNS.Action.Cancel ? `panel_type=${s},button=cancel` : `panel_type=${s},button=close`, h.XLStatNS.trackEvent("download_leftpanel", a, "", 0, 0, 0, 0, e)
                        }
                    })).catch()
                } else for (let i of e) {
                    if (void 0 !== a) {
                        let e = `panel_type=${s}`;
                        h.XLStatNS.trackEvent("download_leftpanel", a, "", 0, 0, 0, 0, e)
                    }
                    let e = {
                        taskBaseInfo: {
                            savePath: void 0,
                            taskName: void 0,
                            productInfo: t(""),
                            origin: "re_download"
                        }, p2spTaskInfo: {url: void 0, useOriginResourceOnly: void 0}
                    }, n = yield b.reDownloadTask(i.taskId, e);
                    if (null !== n) {
                        let e = n.getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskId);
                        p.DownloadDispatchNS.startTask(e)
                    }
                }
            })
        }, e.constructProductInfo = t, e.isExistTaskFile = i, e.canOpenSelectedTaskFolder = function (e) {
            return n(this, void 0, void 0, function* () {
                let t = !1;
                do {
                    let i = e.taskStatus;
                    if (i === l.DownloadKernel.TaskStatus.StartPending || i === l.DownloadKernel.TaskStatus.StopPending || i === l.DownloadKernel.TaskStatus.DestroyPending) break;
                    let n = b.getTaskFromTaskId(e.taskId);
                    if (yield v.SingleBtTaskNS.isSingleBtTask(n)) t = yield s.FileSystemAWNS.existsAW(e.savePath); else {
                        let i = e.savePath, o = e.taskName, r = e.taskType, d = a.join(i, o);
                        if (r === l.DownloadKernel.TaskType.Bt) {
                            if ("" === o) {
                                t = yield s.FileSystemAWNS.existsAW(i);
                                break
                            }
                            if (t = yield s.FileSystemAWNS.existsAW(d)) break;
                            {
                                let e = yield v.SingleBtTaskNS.getCorrectSingleBtFolder(n);
                                if (e) {
                                    let n = a.join(i, e);
                                    t = yield s.FileSystemAWNS.dirExistsAW(n)
                                }
                            }
                        } else l.DownloadKernel.TaskType.Group, t = yield s.FileSystemAWNS.existsAW(i)
                    }
                } while (0);
                return t
            })
        }, e.canOpenSelectedTaskFile = o, e.canOpenAsSelectedTaskFile = function (e) {
            return n(this, void 0, void 0, function* () {
                let t = !1;
                do {
                    let i = e.taskStatus;
                    if (i === l.DownloadKernel.TaskStatus.StartPending || i === l.DownloadKernel.TaskStatus.StopPending || i === l.DownloadKernel.TaskStatus.DestroyPending) break;
                    let n = b.getTaskFromTaskId(e.taskId), o = e.taskType;
                    if (o === l.DownloadKernel.TaskType.Bt) if (yield v.SingleBtTaskNS.isSingleBtTask(n)) {
                        let e = v.SingleBtTaskNS.getSinleBtTaskFilePath(n);
                        m.TaskUtilHelper.isExecutableExt(e) || (t = yield s.FileSystemAWNS.existsAW(e))
                    } else {
                        let i = yield v.SingleBtTaskNS.getCorrectSingleBtFolder(n);
                        if (i) {
                            let n = e.savePath, o = a.join(n, i);
                            t = yield s.FileSystemAWNS.dirExistsAW(o)
                        }
                    } else if (o !== l.DownloadKernel.TaskType.Group) {
                        let i = e.savePath, n = e.taskName;
                        void 0 !== n && n.indexOf(".") === n.length - 1 && (n = n.substring(0, n.length - 1));
                        let o = a.join(i, n);
                        if (m.TaskUtilHelper.isExecutableExt(o)) break;
                        t = yield s.FileSystemAWNS.existsAW(o)
                    }
                } while (0);
                return t
            })
        }, e.getBtExistFilePathList = function (e, t, i) {
            return n(this, void 0, void 0, function* () {
                let n = [];
                do {
                    let o = a.join(e, t.title);
                    if (!(yield s.FileSystemAWNS.existsAW(o))) break;
                    let r = t.fileLists;
                    for (let e = 0; e < r.length; e++) {
                        let t = r[e];
                        if (-1 !== i.indexOf(t.realIndex)) {
                            let e = a.join(t.filePath, t.fileName), i = a.join(o, e);
                            (yield s.FileSystemAWNS.existsAW(i)) && n.push({
                                fullPath: i,
                                index: t.realIndex,
                                relativePath: e
                            })
                        }
                    }
                } while (0);
                return n
            })
        }, e.getSavePathByFileName = function (e, t) {
            let i = "";
            do {
                if (void 0 === e || null === e) break;
                let n = b.getTaskFromTaskId(e);
                n.getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskType) === l.DownloadKernel.TaskType.Group && (i = n.getTaskAttribute(l.DownloadKernel.TaskAttribute.SavePath), i = a.join(i, t), C.information("getSavePathByFileName:", i, t))
            } while (0);
            return i
        }, e.shouleiFileTransfer = function (e) {
            return n(this, void 0, void 0, function* () {
                k.ThunderKernel.getSubNetUploader((t, i) => n(this, void 0, void 0, function* () {
                    if (C.information("getSubNetUploader result", t, i), 0 === t) {
                        let t = {
                            singleton: !0,
                            shareLink: yield y.getShouleiFileTransferDlj(e.taskId, i, "pic", "leftlist_rk_phone"),
                            taskBase: e
                        };
                        if (e.taskType === l.DownloadKernel.TaskType.Bt) {
                            let i = [];
                            b.getTaskFromTaskId(e.taskId).getExtraObject().getBtFileList().forEach(e => {
                                i.push({
                                    index: e.getBtFileAttribute(l.DownloadKernel.BtFileAttribute.RealIndex),
                                    fileName: e.getBtFileAttribute(l.DownloadKernel.BtFileAttribute.FileName)
                                })
                            }), t.subFileList = i
                        }
                        u.MessageBox.custom("ShouleiFileTransfer", t, {modal: !1}).catch()
                    }
                }))
            })
        }
    }(t.TaskCtrlOperatorNS || (t.TaskCtrlOperatorNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(2), a = i(3), o = i(6), r = i(10), s = Math.pow(2, 38),
        l = o.default(n.join(__rootDir, "../bin/ThunderHelper.node"));
    !function (e) {
        function t(e) {
            return l.isThunderPrivateUrl(e)
        }

        function i(e) {
            let t = !0;
            for (let i = 0; i < e.length; i++) if (e.charCodeAt(i) > 127) {
                t = !1;
                break
            }
            return t
        }

        e.formatSize = function (e) {
            let t = 0, i = e, n = ["B", "KB", "MB", "GB", "TB", "PB"];
            for (; i >= 1024 && !(t > n.length - 1);) i /= 1024, t++;
            let a = n[t];
            return i.toFixed(2) + a
        }, e.getSavePathFromImportFile = function (e) {
            let t = "";
            return e && "" !== e && (t = n.dirname(e)), t
        }, e.getTaskNameFromImportFile = function (e) {
            let t = "";
            do {
                if (!e || "" === e) break;
                let i = n.basename(e), a = n.extname(e);
                if (!i || "" === i || !a || "" === a) break;
                let o = n.parse(i).name;
                if (!o || "" === o) break;
                let r = n.extname(o);
                if (!r || "" === r) break;
                ".td" === a || ".xltd" === a ? t = ".bt" === r || ".emule" === r ? n.parse(o).name : o : ".cfg" === a && (".td" === r || ".xltd" === r ? t = n.parse(o).name : ".emule" !== r && ".xlemule" !== r && ".bt" !== r && ".xlbt" !== r || (o = n.parse(o).name, t = n.parse(o).name))
            } while (0);
            return t
        }, e.getTaskTypeFromImportingFile = function (e) {
            let t = a.DownloadKernel.TaskType.Unkown;
            do {
                if (!e || "" === e) break;
                let i = n.basename(e), o = n.extname(e);
                if (!i || "" === i || !o || "" === o) break;
                let r = n.parse(i).name;
                if (!r || "" === r) break;
                let s = n.extname(r).toLowerCase();
                if (!s || "" === s) break;
                ".td" === o || ".xltd" === o ? t = ".bt" === s ? a.DownloadKernel.TaskType.Bt : ".emule" === s ? a.DownloadKernel.TaskType.Emule : a.DownloadKernel.TaskType.P2sp : ".cfg" === o && (".td" === s || ".xltd" === s ? t = a.DownloadKernel.TaskType.P2sp : ".emule" === s || ".xlemule" === s || ".part" === s ? t = a.DownloadKernel.TaskType.Emule : ".bt" !== s && ".xlbt" !== s || (t = a.DownloadKernel.TaskType.Bt))
            } while (0);
            return t
        }, e.isThunderPrivateUrl = t, e.parseThunderPrivateUrl = function (e) {
            let i = e;
            if (t(e)) {
                let t = l.parseThunderPrivateUrl(e);
                i = null !== t && void 0 !== t ? t.url : void 0
            }
            return i
        }, e.isAllAsciiChar = i, e.parseEd2kUrl = function (e) {
            let t = null;
            do {
                -1 === e.indexOf("|") && (e = e.replace("%7C", "|"));
                let n = [];
                if ((n = e.split("|")).length < 5) break;
                let a = "ed2k://";
                if (n[0].length < a.length || 0 !== n[0].indexOf(a)) break;
                let o = "file";
                if (n[1].length < o.length || 0 !== n[1].indexOf(o)) break;
                let r = n[2], l = parseInt(n[3], 10);
                if (l <= 0 || l > s) break;
                if (32 !== n[4].length) break;
                let d = n[4];
                if (-1 !== r.indexOf("%") && i(r)) try {
                    r = decodeURI(r)
                } catch (e) {
                }
                t = {
                    fileName: r = (r = (r = (r = (r = (r = (r = (r = (r = r.replace("<", "_")).replace(">", "_")).replace(":", "_")).replace('"', "_")).replace("/", "_")).replace("\\", "_")).replace("|", "_")).replace("?", "_")).replace("*", "_"),
                    fileHash: d,
                    fileSize: l
                }
            } while (0);
            return t
        };
        let o = void 0;

        function d(e) {
            let t = 0, i = -1;
            for (let n = 0; n < e.length; ++n) t += (i = e.charCodeAt(n)) >= 0 && i <= 128 ? 1 : 2;
            return t
        }

        function u(e, t) {
            let i = "", n = 0, a = new String;
            for (let o = 0; o < e.length; o++) {
                let r = e.charAt(o);
                if (n++, escape(r).length > 4 && n++, a = a.concat(r), n >= t) {
                    i = a.toString();
                    break
                }
            }
            return n < t && (i = e), i
        }

        e.getXmpPath = function () {
            if (!o) {
                let e = "HKEY_LOCAL_MACHINE", t = "SOFTWARE\\Thunder Network\\Xmp", i = "Path";
                o = l.readRegString(e, t, i)
            }
            return o
        }, e.getLastAssociateExts = function () {
            return r.ConfigNS.getValue("DownloadAndPlay", "AssociateExts", ".asf;.avi;.wm;.wmp;.wmv;.ram;.rm;.rmvb;.rp;.rpm;.rt;.smil;.scm;.dat;.m1v;.m2v;.m2p;.m2ts;.mp2v;.mpe;.mpeg;.mpeg1;.mpeg2;.mpg;.mpv2;.pss;.pva;.tp;.tpr;.ts;.m4b;.m4r;.m4p;.m4v;.mp4;.mpeg4;.3g2;.3gp;.3gp2;.3gpp;.mov;.qt;.flv;.f4v;.swf;.hlv;.ifo;.vob;.amv;.csf;.divx;.evo;.mkv;.mod;.pmp;.vp6;.bik;.mts;.xlmv;.ogm;.ogv;.ogx;.dvd;.srt;.ass;.ssa;.smi;.idx;.sub;.sup;.psb;.usf;.ssf")
        }, e.getStringLength = d, e.cutString = u, e.getMaxFilePath = function (e) {
            let t = "", i = d(e);
            if (i < 260) t = e; else {
                let a = n.dirname(e), o = n.basename(e), r = n.extname(e), s = 260 - (i = d(a) + 2) - r.length - 2;
                s > 0 && (o = u(o, s), o += r, t = n.join(a, o))
            }
            return t
        }
    }(t.Common || (t.Common = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(0), o = i(3), r = i(13), s = i(46), l = i(49), d = i(88), u = i(27), c = i(15), h = i(30), f = i(11),
        g = i(40), p = i(305), v = i(35), m = a.default.getLogger("download-dispatch"),
        y = f.DownloadKernelTaskManager.getTaskManager(), k = c.DownloadKernelEventManager.getEventManager(),
        T = l.ToastNotifyManagerNS.getToastNotifyManger(),
        w = g.DownloadKernelCategoryViewManager.getCategoryViewManager(), C = 50, S = 51200;
    const b = new class {
        constructor() {
            this.maxStartCount = 5, this.tasks = [], this.downloadingTasks = [], this.freeDownloadingTasks = [], this.waitingTasks = [], this.lowSpeedCache = {}, this.isFreeOpened = !1, this.noLimitSize = 30, this.autoAddTimerId = void 0, this.autoTailTimerId = void 0, this.taskDetailCookie = void 0, this.autoAddRate = void 0, this.speedArray = [], this.taskSpeedMap = {}, this.autoAddAvailable = !1
        }

        init() {
            this.attachTaskEvent(), setInterval(() => {
                let e = 0 === y.getStartTaskIDs().length;
                v.ThunderHelper.setScreenSaveActive(e)
            }, 3e4)
        }

        setAutoAddTask(e, t) {
            e ? this.startAutoAddTask(t) : (this.autoAddRate = void 0, this.stopAutoAddTask())
        }

        setAutoTail(e) {
            m.information("setAutoTail", e), this.autoTailAvailbale = e, e ? (this.taskSpeedMap = {}, this.syncTaskSpeedMap(void 0, this.downloadingTasks), this.trySwitchAutoTail()) : this.stopAutoTail()
        }

        setFreeFromScheduleOpen(e, t) {
            if (this.isFreeOpened = e, this.noLimitSize = t, m.information("setFreeFromScheduleOpen", this.isFreeOpened, this.noLimitSize, this.tasks.length), e) {
                for (let e of this.tasks) {
                    let i = y.getTaskFromTaskId(e), n = i.getTaskAttribute(o.DownloadKernel.TaskAttribute.FileSize);
                    m.information("setFreeFromSchedule", n, t), n <= 1024 * t * 1024 && n > 0 ? i.setFreeFromSchedule(!0) : i.setFreeFromSchedule(!1)
                }
                for (let e of this.waitingTasks) y.getTaskFromTaskId(e).isFreeFromSchedule() && this.startNoWaiting(e, !0)
            } else for (let e of this.tasks) y.getTaskFromTaskId(e).setFreeFromSchedule(!1)
        }

        setAutoAddTaskAvailable(e) {
            m.information("auto add available", e), this.autoAddAvailable = e, e ? this.switchAutoAddTask() : this.stopAutoAddTask()
        }

        updateTasks(e) {
            this.tasks = [...e]
        }

        startTask(e, t, i) {
            let n = !0;
            do {
                if (this.downloadingTasks.includes(e) || this.freeDownloadingTasks.includes(e)) {
                    m.information("startTask is downloading", e);
                    break
                }
                let a = y.getTaskFromTaskId(e);
                if (null === a) break;
                if (a.getTaskAttribute(o.DownloadKernel.TaskAttribute.Background)) {
                    m.information("startTask is background", e), y.startTask(e, i);
                    break
                }
                let r = a.getTaskAttribute(o.DownloadKernel.TaskAttribute.CategoryId);
                if (-1 !== r) {
                    m.information("startTask is private", e, r), y.startTask(e, i);
                    break
                }
                let s = a.isFreeFromSchedule();
                if (s) {
                    m.information("startTask isFreeFromSchedule"), this.startNoWaiting(e, !0, i), this.showSmallFileAdvancedNotify();
                    break
                }
                if (void 0 === s && this.isFreeOpened && !isNaN(this.noLimitSize) && this.noLimitSize > 0) {
                    let t = a.getTaskAttribute(o.DownloadKernel.TaskAttribute.FileSize);
                    if (t <= 1024 * this.noLimitSize * 1024 && t > 0) {
                        a.setFreeFromSchedule(!0), m.information("startTask isFreeFromSchedule"), this.startNoWaiting(e, !0, i), this.showSmallFileAdvancedNotify();
                        break
                    }
                    a.setFreeFromSchedule(!1)
                }
                if (t) {
                    m.information("startTask force no waiting", e), this.startNoWaiting(e, !1, i);
                    break
                }
                if (this.downloadingTasks.length < this.maxStartCount) {
                    m.information("startTask no waiting", e), this.startNoWaiting(e, !1, i);
                    break
                }
                m.information("startTask waiting", e), this.startWaiting(e), n = !1
            } while (0);
            return n
        }

        startTasks(e) {
            do {
                if (null === e || void 0 === e || 0 === e.length) break;
                let t = y.getTaskFromTaskId(e[0]).getTaskAttribute(o.DownloadKernel.TaskAttribute.CategoryId);
                if (void 0 !== t && -1 !== t) {
                    for (let t = 0; t < e.length; ++t) y.startTask(e[t]);
                    break
                }
                0 === this.tasks.length && (m.information("try to start multi task but tasks not inited"), this.initTasksOrderFromConfig());
                let i = [];
                for (let t of e) {
                    let e = this.tasks.indexOf(t);
                    -1 !== e && i.push(e)
                }
                if (i.length !== e.length) {
                    this.batchStartTasks(e);
                    break
                }
                i.sort((e, t) => e - t);
                let n = [];
                for (let e of i) {
                    let t = this.tasks[e];
                    n.push(t)
                }
                this.batchStartTasks(n)
            } while (0)
        }

        setMaxStartTaskCount(e) {
            return n(this, void 0, void 0, function* () {
                if (this.maxStartCount !== e && e > 0) {
                    this.maxStartCount = e;
                    let t = this.downloadingTasks.length;
                    if (this.isFreeOpened || (t = this.downloadingTasks.length + this.freeDownloadingTasks.length), t > this.maxStartCount) {
                        let e = 0;
                        for (let t = 0; t < this.tasks.length; t++) {
                            let i = this.tasks[t], n = y.getTaskFromTaskId(i), a = n.getTaskStatus(),
                                r = n.isFreeFromSchedule();
                            a !== o.DownloadKernel.TaskStatus.StartPending && a !== o.DownloadKernel.TaskStatus.Started || r || (e += 1) > this.maxStartCount && (m.information("to stop", i), this.stopAndWaiting(i, o.DownloadKernel.TaskStopReason.MaxDownloadReduce).catch())
                        }
                    } else if (this.waitingTasks.length > 0 && this.downloadingTasks.length < this.maxStartCount) {
                        m.information("setMaxStartTaskCount to add start task", this.waitingTasks.length, this.downloadingTasks.length, this.maxStartCount);
                        for (let e = 0; e < this.tasks.length; e++) {
                            let t = this.tasks[e];
                            if (y.getTaskFromTaskId(t).getTaskStatus() === o.DownloadKernel.TaskStatus.StartWaiting && (this.startNoWaiting(t), m.information("setMaxStartTaskCount add start task", t, this.waitingTasks.length, this.downloadingTasks.length), 0 === this.waitingTasks.length || this.downloadingTasks.length === this.maxStartCount)) break
                        }
                    }
                }
            })
        }

        showSmallFileAdvancedNotify() {
            this.downloadingTasks.length >= this.maxStartCount ? T.showNotify(l.ToastNotifyManagerNS.notifyIdTaskDispatchSmallFileAdvanced, s.ToastNotifyItemType.GreenNotify, `正在优先下载小于${this.noLimitSize}MB的任务`, 3e3) : m.information("showSmallFileAdvancedNotify no waiting ")
        }

        batchStartTasks(e) {
            let t = [];
            for (let i = 0; i < e.length; i++) {
                let n = e[i];
                if (!this.startTask(n)) {
                    if (!this.isFreeOpened) {
                        i + 1 < e.length && (t = e.slice(i + 1));
                        break
                    }
                    t.push(n)
                }
            }
            t.length > 0 && this.startBatchWaiting(t)
        }

        initTasksOrderFromConfig() {
            let e = [], t = w.getCategoryViewFromId(o.DownloadKernel.CategroyViewID.Downloading).getTasks();
            for (let [, i]of t) e.push(i.getTaskBaseInfo());
            e.sort(p.SortNS.getSortFuncByConfig(o.DownloadKernel.CategroyViewID.Downloading, -1)), this.tasks = e.map(e => e.taskId)
        }

        startNoWaiting(e, t = !1, i) {
            if (y.startTask(e, i)) {
                t ? this.freeDownloadingTasks.includes(e) || this.freeDownloadingTasks.push(e) : this.downloadingTasks.includes(e) || (this.downloadingTasks.push(e), this.syncTaskSpeedMap(void 0, [e]));
                let i = this.waitingTasks.indexOf(e);
                -1 !== i && (this.waitingTasks.splice(i, 1), this.switchAutoAddTask(), this.trySwitchAutoTail())
            }
        }

        startWaiting(e) {
            if (y.startWaitingTask(e)) {
                this.waitingTasks.includes(e) || (this.waitingTasks.push(e), this.switchAutoAddTask(), this.trySwitchAutoTail());
                let t = this.downloadingTasks.indexOf(e);
                -1 !== t && (this.downloadingTasks.splice(t, 1), this.syncTaskSpeedMap([e]))
            }
        }

        startBatchWaiting(e) {
            for (let t of e) {
                let e = y.getTaskFromTaskId(t).getTaskStatus();
                if (e === o.DownloadKernel.TaskStatus.Stopped || e === o.DownloadKernel.TaskStatus.Failed || e === o.DownloadKernel.TaskStatus.Unkown) {
                    this.waitingTasks.includes(t) || (this.waitingTasks.push(t), this.switchAutoAddTask(), this.trySwitchAutoTail());
                    let e = this.downloadingTasks.indexOf(t);
                    -1 !== e && (this.downloadingTasks.splice(e, 1), this.syncTaskSpeedMap([t]))
                }
            }
            y.startWaitingTasks(e)
        }

        convertWaiting2Start() {
            for (let e = 0; e < this.tasks.length; e++) {
                let t = this.tasks[e];
                if (this.waitingTasks.includes(t) && y.getTaskFromTaskId(t).getTaskStatus() === o.DownloadKernel.TaskStatus.StartWaiting) {
                    m.information("convertWaiting2Start", t), this.startNoWaiting(t);
                    break
                }
            }
        }

        getAverageSpeed(e, t = 10) {
            let i = -1;
            do {
                if (isNaN(t)) break;
                if (t < 0) break;
                if (0 === e.length) break;
                let n = v.ThunderHelper.getTickCount(), a = e.filter(e => e.tickCount + 1e3 * t >= n);
                if (0 === a.length) break;
                let o = a.map(e => e.speed);
                i = o.reduce((e, t) => e + t, 0) / o.length
            } while (0);
            return m.information("getAverageSpeed", i), i
        }

        onGlobalDownloadSpeedChanged() {
            do {
                if (void 0 === this.autoAddTimerId) break;
                let e = h.DownloadKernelManager.getTotalTaskDownloadSpeed(!1, !1);
                this.speedArray.length >= 10 && this.speedArray.shift();
                let t = {speed: e, tickCount: v.ThunderHelper.getTickCount()};
                this.speedArray.push(t)
            } while (0)
        }

        startAutoAddTask(e) {
            do {
                if (isNaN(e)) {
                    this.stopAutoAddTask();
                    break
                }
                if (this.autoAddRate = e, !this.autoAddAvailable) break;
                if (0 === this.waitingTasks.length) break;
                void 0 === this.autoAddTimerId && (h.DownloadKernelManager.attachListener(r.NodeEventMesssageNS.eventGlobalDownloadSpeedChanged, this.onGlobalDownloadSpeedChanged.bind(this)), m.information("start auto add timer"), this.autoAddTimerId = setInterval(() => {
                    do {
                        if (this.downloadingTasks.length + this.freeDownloadingTasks.length >= C) {
                            m.information("auto add task upper limit");
                            break
                        }
                        if (0 === this.waitingTasks.length) break;
                        this.isAutoAddTask() && this.convertWaiting2Start()
                    } while (0)
                }, 3e4))
            } while (0)
        }

        stopAutoAddTask() {
            m.information("stopAutoAddTask"), void 0 !== this.autoAddTimerId && (clearInterval(this.autoAddTimerId), this.autoAddTimerId = void 0, this.speedArray = [], m.information("detachListener"), h.DownloadKernelManager.detachListener(r.NodeEventMesssageNS.eventGlobalDownloadSpeedChanged, this.onGlobalDownloadSpeedChanged.bind(this)))
        }

        isAutoAddTask() {
            let e = !1, t = this.getAverageSpeed(this.speedArray);
            return t < 1024 * this.autoAddRate && (e = !0), m.information("isAutoAddTask", t, 1024 * this.autoAddRate, e), e
        }

        switchAutoAddTask() {
            do {
                if (!this.autoAddAvailable) break;
                if (void 0 === this.autoAddRate) break;
                this.waitingTasks.length > 0 ? this.startAutoAddTask(this.autoAddRate) : (m.information("no waiting task to stopAutoAdd"), this.stopAutoAddTask())
            } while (0)
        }

        isLowSpeed(e, t) {
            let i = !1;
            do {
                if (0 === this.waitingTasks.length) {
                    m.information("isLowSpeed task no waiting now");
                    break
                }
                if (!t) break;
                if (0 === t.length) break;
                if (this.lowSpeedCache.hasOwnProperty(String(e))) {
                    m.information("task already move to tail once");
                    break
                }
                let n = y.getTaskFromTaskId(e);
                if (!n) break;
                let a = n.getTaskAttribute(o.DownloadKernel.TaskAttribute.FileSize),
                    r = n.getTaskAttribute(o.DownloadKernel.TaskAttribute.DownloadSize);
                if (a > 0 && 100 * r / a >= 99.9) {
                    m.information("isLowSpeed percent more then 99.9");
                    break
                }
                if (v.ThunderHelper.getTickCount() - t[0].tickCount < 1e4) {
                    m.information("isLowSpeed task start less then 10s", t);
                    break
                }
                this.getAverageSpeed(t.slice(1)) < S && (i = !0)
            } while (0);
            return i
        }

        syncTaskSpeedMap(e, t) {
            do {
                if (!this.autoTailAvailbale) break;
                if (e) for (let t of e) this.taskSpeedMap.hasOwnProperty(String(t)) && delete this.taskSpeedMap[t];
                if (t) for (let e of t) {
                    let t = v.ThunderHelper.getTickCount();
                    m.information("init first speed item", t, e), this.taskSpeedMap[e] = [{speed: 0, tickCount: t}]
                }
            } while (0)
        }

        trySwitchAutoTail() {
            m.information("trySwitchAutoTail", this.autoTailAvailbale, this.waitingTasks.length);
            do {
                if (!this.autoTailAvailbale) break;
                if (0 === this.waitingTasks.length) {
                    this.stopAutoTail();
                    break
                }
                if (void 0 !== this.autoTailTimerId) break;
                this.taskDetailCookie = k.attachTaskEvent(o.DownloadKernel.TaskEventType.DetailChanged, (...e) => {
                    do {
                        if (!e) break;
                        if (e[0] !== o.DownloadKernel.TaskEventType.DetailChanged) break;
                        if (!e[1]) break;
                        let t = e[1];
                        for (let e of t) {
                            let t = e.getId();
                            if (this.taskSpeedMap.hasOwnProperty(String(t))) {
                                let i = e.getDownloadSpeed();
                                this.taskSpeedMap[t].length >= 11 && this.taskSpeedMap[t].shift(), this.taskSpeedMap[t].push({
                                    speed: i,
                                    tickCount: v.ThunderHelper.getTickCount()
                                })
                            }
                        }
                    } while (0)
                }), m.information("start auto tail timer"), this.autoTailTimerId = setInterval(() => n(this, void 0, void 0, function* () {
                    let e = this.taskSpeedMap,
                        t = this.downloadingTasks.length < this.waitingTasks.length ? this.downloadingTasks.length : this.waitingTasks.length,
                        i = 0, n = this.tasks.slice(0);
                    for (let a = 0; a < n.length; a++) {
                        let o = n[a];
                        if (e.hasOwnProperty(String(o)) && this.isLowSpeed(o, e[o]) && (m.information("isLowSpeed data is", o, e[o]), i++, this.convertWaiting2Start(), yield this.moveTask2Tail(Number(o)), this.lowSpeedCache[o] = !0, i === t)) {
                            m.information("isLowSpeed current waitingtask all convert start");
                            break
                        }
                    }
                }), 3e4)
            } while (0)
        }

        stopAutoTail() {
            m.information("stopAutoTail"), void 0 !== this.autoTailTimerId && (clearInterval(this.autoTailTimerId), this.autoTailTimerId = void 0), this.taskDetailCookie && (k.detachTaskEvent(o.DownloadKernel.TaskEventType.DetailChanged, this.taskDetailCookie), this.taskDetailCookie = void 0)
        }

        stopAndWaiting(e, t) {
            return n(this, void 0, void 0, function* () {
                return new Promise((i, n) => {
                    y.stopTaskAW(e, t).then(t => {
                        t ? (m.information("stoptask and startwaiting", e), this.startWaiting(e)) : m.information("stopTaskAW fail", e), i()
                    }).catch()
                })
            })
        }

        moveTask2Tail(e) {
            return n(this, void 0, void 0, function* () {
                do {
                    if (this.tasks.indexOf(e) === this.tasks.length - 1) {
                        m.information("moveTask2Tail already at the end"), yield this.stopAndWaiting(e, o.DownloadKernel.TaskStopReason.LowSpeed);
                        break
                    }
                    return new Promise((t, i) => {
                        u.default.fireEvent(r.NodeEventMesssageNS.evetDownloadMove2Tail, e, () => n(this, void 0, void 0, function* () {
                            yield this.stopAndWaiting(e, o.DownloadKernel.TaskStopReason.LowSpeed), t()
                        }))
                    })
                } while (0)
            })
        }

        attachTaskEvent() {
            k.attachTaskEvent(o.DownloadKernel.TaskEventType.StatusChanged, (...e) => {
                do {
                    if (!e) break;
                    if (e[0] !== o.DownloadKernel.TaskEventType.StatusChanged) break;
                    let t = e[1];
                    if (!t) break;
                    for (let e = 0; e < t.length; ++e) {
                        let i = t[e];
                        if (!i) continue;
                        if (i.getTaskAttribute(o.DownloadKernel.TaskAttribute.Background)) continue;
                        let n = i.getTaskStatus(), a = i.getTaskAttribute(o.DownloadKernel.TaskAttribute.TaskId);
                        if (i.getTaskAttribute(o.DownloadKernel.TaskAttribute.GroupTaskId) > 0) continue;
                        if (-1 !== i.getTaskAttribute(o.DownloadKernel.TaskAttribute.CategoryId)) continue;
                        if (n === o.DownloadKernel.TaskStatus.StartPending || n === o.DownloadKernel.TaskStatus.Started) continue;
                        if ((n === o.DownloadKernel.TaskStatus.StopPending || n === o.DownloadKernel.TaskStatus.Stopped) && d.DownloadJammedNS.isStopPending(a)) {
                            m.information("ignore status change download jammed stop", n);
                            continue
                        }
                        let r = this.downloadingTasks.indexOf(a);
                        if (-1 !== r) this.downloadingTasks.splice(r, 1), this.syncTaskSpeedMap([a]); else {
                            let e = this.freeDownloadingTasks.indexOf(a);
                            -1 !== e && this.freeDownloadingTasks.splice(e, 1)
                        }
                        if (n === o.DownloadKernel.TaskStatus.StartWaiting) continue;
                        let s = this.waitingTasks.indexOf(a);
                        -1 !== s && (this.waitingTasks.splice(s, 1), this.switchAutoAddTask(), this.trySwitchAutoTail()), n !== o.DownloadKernel.TaskStatus.Succeeded && n !== o.DownloadKernel.TaskStatus.Failed && n !== o.DownloadKernel.TaskStatus.StopPending && n !== o.DownloadKernel.TaskStatus.Stopped || this.waitingTasks.length > 0 && this.downloadingTasks.length < this.maxStartCount && this.convertWaiting2Start()
                    }
                } while (0)
            }), k.attachTaskEvent(o.DownloadKernel.TaskEventType.RemoveFromCategoryView, (...e) => {
                do {
                    if (!e) break;
                    if (e[0] !== o.DownloadKernel.TaskEventType.RemoveFromCategoryView) break;
                    if (void 0 === e[1] || !e[2] || !e[3]) break;
                    if (-1 !== e[1]) break;
                    if (e[2] !== o.DownloadKernel.CategroyViewID.Downloading) break;
                    let t = e[3];
                    for (let e of t) {
                        let t = e.getTaskAttribute(o.DownloadKernel.TaskAttribute.TaskId),
                            i = this.downloadingTasks.indexOf(t);
                        if (-1 !== i) this.downloadingTasks.splice(i, 1), this.syncTaskSpeedMap([t]); else {
                            let e = this.freeDownloadingTasks.indexOf(t);
                            -1 !== e && this.freeDownloadingTasks.splice(e, 1)
                        }
                        let n = this.waitingTasks.indexOf(t);
                        -1 !== n && (this.waitingTasks.splice(n, 1), this.switchAutoAddTask(), this.trySwitchAutoTail())
                    }
                } while (0)
            })
        }
    };
    !function (e) {
        e.init = function () {
            b.init()
        }, e.updateTasksOrder = function (e) {
            b.updateTasks(e)
        }, e.startTask = function (e, t, i) {
            let n = y.getTaskFromTaskId(e).getTaskStatus();
            return n !== o.DownloadKernel.TaskStatus.Succeeded && n !== o.DownloadKernel.TaskStatus.Seeding && b.startTask(e, t, i)
        }, e.startTasks = function (e) {
            b.startTasks(e)
        }, e.setStartTaskCount = function (e) {
            do {
                if ("number" != typeof e && (e = Number(e)), isNaN(e)) break;
                if (e <= 0) break;
                b.setMaxStartTaskCount(e).catch()
            } while (0)
        }, e.setFreeFromScheduleOpen = function (e, t) {
            b.setFreeFromScheduleOpen(e, t)
        }, e.setAutoAddTaskAvailable = function (e) {
            b.setAutoAddTaskAvailable(e)
        }, e.setAutoAddTask = function (e, t) {
            b.setAutoAddTask(e, t)
        }, e.setAutoTail = function (e) {
            b.setAutoTail(e)
        }
    }(t.DownloadDispatchNS || (t.DownloadDispatchNS = {}))
}, function (e, t) {
    e.exports = require("url")
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(5), r = i(3);
    !function (e) {
        e.isSingleBtTask = function (e) {
            return n(this, void 0, void 0, function* () {
                let t = !1, i = void 0;
                do {
                    if (!e) break;
                    if (e.getType() !== r.DownloadKernel.TaskType.Bt) break;
                    let n = e.getExtraObject();
                    if (!n) break;
                    if (1 !== n.getFileCount()) break;
                    let s = e.getTaskAttribute(r.DownloadKernel.TaskAttribute.SavePath),
                        l = e.getTaskAttribute(r.DownloadKernel.TaskAttribute.TaskName), d = a.join(s, l);
                    if (yield o.FileSystemAWNS.existsAW(d)) {
                        let e = yield o.FileSystemAWNS.lstatAW(d);
                        if (e && e.isDirectory()) {
                            let e = void 0, i = n.getBtFileList();
                            for (let [, t]of i) {
                                e = t.getBtFileAttribute(r.DownloadKernel.BtFileAttribute.FileName);
                                break
                            }
                            if (!e) break;
                            let s = a.join(d, e);
                            if (yield o.FileSystemAWNS.existsAW(s)) {
                                let e = yield o.FileSystemAWNS.lstatAW(s);
                                e && e.isDirectory() && (t = !0);
                                break
                            }
                            let l = e + ".bt.xltd";
                            if (s = a.join(d, l), yield o.FileSystemAWNS.existsAW(s)) {
                                let e = yield o.FileSystemAWNS.lstatAW(s);
                                e && e.isDirectory() && (t = !0);
                                break
                            }
                            if (l = e + ".bt.td", s = a.join(d, l), yield o.FileSystemAWNS.existsAW(s)) {
                                let e = yield o.FileSystemAWNS.lstatAW(s);
                                e && e.isDirectory() && (t = !0);
                                break
                            }
                            break
                        }
                    }
                    let u = n.getBtFileList();
                    for (let [, e]of u) {
                        i = e.getBtFileAttribute(r.DownloadKernel.BtFileAttribute.FilePath);
                        break
                    }
                    if (i) {
                        t = !1;
                        break
                    }
                    t = !0
                } while (0);
                return t
            })
        }, e.getCorrectSingleBtFolder = function (e) {
            return n(this, void 0, void 0, function* () {
                let t = void 0;
                do {
                    if (!e) break;
                    if (e.getType() !== r.DownloadKernel.TaskType.Bt) break;
                    let i = e.getExtraObject();
                    if (!i) break;
                    if (1 !== i.getFileCount()) break;
                    let n = e.getTaskAttribute(r.DownloadKernel.TaskAttribute.SavePath),
                        s = e.getTaskAttribute(r.DownloadKernel.TaskAttribute.TaskName), l = a.join(n, s),
                        d = yield o.FileSystemAWNS.dirExistsAW(l);
                    if (d) break;
                    let u = void 0, c = void 0, h = i.getBtFileList();
                    for (let [, e]of h) {
                        u = e.getBtFileAttribute(r.DownloadKernel.BtFileAttribute.FileName), c = e.getBtFileAttribute(r.DownloadKernel.BtFileAttribute.FilePath);
                        break
                    }
                    if (!u || !c) break;
                    if (l = a.join(n, c), d = yield o.FileSystemAWNS.dirExistsAW(l)) {
                        t = c;
                        break
                    }
                } while (0);
                return t
            })
        }, e.getSinleBtTaskFilePath = function (e) {
            let t = void 0;
            {
                let i = void 0, n = void 0, o = e.getExtraObject().getBtFileList();
                for (let [, e]of o) {
                    n = e.getBtFileAttribute(r.DownloadKernel.BtFileAttribute.FilePath), i = e.getBtFileAttribute(r.DownloadKernel.BtFileAttribute.FileName), n && (i = a.join(n, i));
                    break
                }
                let s = e.getTaskAttribute(r.DownloadKernel.TaskAttribute.SavePath);
                t = a.join(s, i)
            }
            return t
        }
    }(t.SingleBtTaskNS || (t.SingleBtTaskNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(39);
    var a;
    !function (e) {
        e[e.GreenNotify = 0] = "GreenNotify", e[e.RedNotify = 1] = "RedNotify", e[e.RedCancelNotify = 2] = "RedCancelNotify", e[e.Custom = 3] = "Custom"
    }(a = t.ToastNotifyItemType || (t.ToastNotifyItemType = {}));

    class o extends n.default {
        constructor(e, t, i, n) {
            super(), this.id = "", this.message = "", this.duration = 0, this.viewOptions = null, this.id = e, this.message = t, this.duration = i, this.viewOptions = n
        }

        setMessage(e) {
            this.message = e
        }

        getMessage() {
            return this.message
        }

        setDuration(e) {
            this.duration = e
        }

        getDuration() {
            return this.duration
        }

        getId() {
            return this.id
        }

        getType() {
            return a.GreenNotify
        }

        getCancel() {
            return !(!this.viewOptions || !this.viewOptions.viewVisible)
        }

        getCancelText() {
            do {
                if (!this.viewOptions) break;
                if (this.viewOptions.viewVisible) return this.viewOptions.viewText ? this.viewOptions.viewText : "查看"
            } while (0);
            return ""
        }

        cancel() {
            this.viewOptions && this.viewOptions.onView ? this.viewOptions.onView() : this.fireEvent("OnCancel")
        }

        close() {
            this.viewOptions && this.viewOptions.onClose && this.viewOptions.onClose()
        }
    }

    t.ToastNotifyItem = o;
    t.RedToastNotifyItem = class extends o {
        constructor(e, t, i, n) {
            super(e, t, i, n)
        }

        getType() {
            return a.RedNotify
        }
    };

    class r extends o {
        constructor(e, t, i, n) {
            super(e, t, i, n)
        }

        getCancel() {
            return !0
        }

        getCancelText() {
            return "取消"
        }

        onCancel(e) {
            this.attachOnceListener("OnCancel", e)
        }
    }

    t.CancelToastNotifyItem = r;
    t.RedCancelToastNotifyItem = class extends r {
        constructor(e, t, i, n) {
            super(e, t, i, n)
        }

        getType() {
            return a.RedCancelNotify
        }
    };
    t.CustomToastNotifyItem = class extends r {
        constructor(e, t, i, n) {
            super(e, t, i), this.component = "", this.component = n
        }

        getType() {
            return a.Custom
        }

        getComponentId() {
            return this.component
        }
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(2), a = i(3);
    let o = ["apk", "pic", "video", "mp4", "rmvb", "wmv", "mpg", "mkv", "mov", "rm", "avi", "flv", "doc", "link", "ppt", "word", "magnetic", "music", "pdf", "rar", "xls", "txt", "unknow", "gif", "ipa", "ipsw", "dll", "chm", "text", "install", "iso"];
    const r = ".xv;.xlmv;.3gp;.3gp2;.3gpp;.3gpp2;.3mm;.3p2;.60d;.787;.aaf;.aep;.aepx;.aet;.aetx;.ajp;.ale;.amv;.amx;.arf;\n  .asf;.asx;.avb;.avd;.avi;.avp;.avs;.avs;.axm;.bdm;.bdmv;.bik;.bix;.bmk;.bnp;.box;.bs4;.bsf;.byu;.camproj;.camrec;.clpi;.cmmp;\n  .cmmtpl;.cmproj;.cmrec;.cpi;.cst;.cvc;.d2v;.d3v;.dat;.dav;.dce;.dck;.ddat;.dif;.dir;.divx;.dlx; .dmb;.dmsm;.dmsm3d;.dmss;.dnc;.dpg;\n  .dream;.dsy;.dv;.dv-avi;.dv4;.dvdmedia;.dvr-ms;.dvx;.dxr;.dzm;.dzp;.dzt;.edl;.evo;.eye;.f4p;.f4v;.fbr;.fbr;.fbz;.fcp;.flc;.flh;\n  .fli;.flv;.flx;.gfp;.gl;.grasp;.gts;.gvi;.gvp;.hdmov;.hkm;.ifo;.imovieproj;.imovieproject;.iva;.ivf;.ivr;.ivs;.izz;.izzy;.jts;.jtv;\n  .k3g;.lrec;.lsf;.lsx;.m15;.m1pg;.m1v;.m21;.m21;.m2a;.m2p;.m2t;.m2ts;.m2v;.m4e;.m4u;.m4v;.m75;.meta;.mgv;.mj2;.mjp;.mjpg;.mkv;.mmv;\n  .mnv;.mod;.modd;.moff;.moi;.moov;.mov;.movie;.mp21;.mp2v;.mp4;.mp4v;.mpe;.mpeg;.mpeg4;.mpf;.mpg;.mpg2;.mpgindex;.mpl;.mpls;\n  .mpsub;.mpv;.mpv2;.mqv;.msdvd;.msh;.mswmm;.mts;.mtv;.mvb;.mvc;.mvd;.mve;.mvp;.mvy;.mxf;.mys;.ncor;.nsv;.nuv;.nvc;.ogm;.ogv;.ogx;.osp;\n  .par;.pds;.pgi;.piv;.pjs;.pmf;.pns;.ppj;.prel;.pro;.prproj;.prtl;.psh;.pssd;.pva;.pvr;.pxv;.qt;.qtch;.qtl;.qtm;.qtz;\n  .r3d;.rcproject;.rdb;.rec;.rm;.rmd;.rmp;.rms;.rmvb;.roq;.rp;.rts;.rts;.rum;.rv;.sbk;.sbt;.scc;.scm;.scn;.screenflow;.sec;.seq;.sfd;\n  .sfvidcap;.smk;.sml;.smv;.spl;.ssm;.stl;.str;.stx;.svi;.swf;.swi;.swt;.tda3mt;.tivo;.tix;.tod;.tp;.tp0;.tpd;\n  .tpr;.trp;.ts;.tts;.tvs;.vc1;.vcpf;.vcr;.vcv;.vdo;.vdr;.veg;.vem;.vf;.vfw;.vfz;.vgz;.vid;.viewlet;.viv;.vivo;.vlab;.vob;.vp3;.vp6;.vp7;\n  .vro;.vs4;.vse;.vsp;.w32;.wcp;.webm;.wlmp;.wm;.wmd;.wmmp;.wmv;.wmx;.wp3;.wpl;.wtv;.wvx;.xfl;.xvid;.yuv;.zm1;.zm2;.zm3;.zmv;",
        s = ".exe;.com;.bat;.msi;.apk;.ipa;.iso;.mds;.bin;.img;.ipsw;",
        l = ".txt;.html;.htm;.shtml;.xhtml;.chm;.hlp;.inf;.rtf;.tex;.ltx;.doc;.docx;.wps;.ppt;.pptx;.odf;.pdf;.xls;.xlsx;.docm;.\n  dot;.dotm;.dotx;.email;.rp;.pps;.et;.ett;.xlt;.dbf;.prn;.csv;.mht;.mhtml;.xml;.wpt;.dps;.dpt;.pot;.ppsx;.epub;.mobi;.lit;.wdl;.ceb;.abm;\n  .pdg;.umb;.ibooks;",
        d = ".aiff;.cue;.m3u;.au;.cdda;.raw;.wav;.flac;.tak;.mp3;.aac;.wma;.m4a;.mid;.mka;.mp2;.mpa;.mpc;.ape;.ofr;\n  .ogg;.ra;.wv;.tta;.ac3;.dts;.nsf;.mod;.s3m;.xm;.it;.vst;",
        u = ".psd;.tga;.gif;.jpeg;.jpg;.jp2;.bmp;.ico;.pcx;.png;.pbm;.pgm;.ppm;.pnm;.pgf;.arw;.cr2;.crw;.dcr;.dng;.erf;.kdc;.mef;\n  .mos;.mrw;.nef;.nrw;.orf;.pef;.ptx;.r3d;.raf;.raw;.rw2;.srf;.srw;.x3f;.ras;.tiff;.tif;.wbmp;.ilbm;.lbm;.iff;.ico;",
        c = ".zip;.zipx;.rar;.7z;.isz;.cab;.arj;.ace;.alz;.uue;.tar;.gz; .gzip;.tgz;.tpz;.bzip2;.bz2;.bz;.tbz;.tbz2;.xz;.txz;\n  .lzh;.lha;.zt;.az; .xpi;.jar;.wim;.swm;.rpm;.xar;.deb;.dmg;.hfs;.cpio;.lzma;.lzma86;.split;",
        h = ".torrent;", f = ".idx;.smi;.sub;.psb;.ssa;.ass;.usf;.ssf;.srt;.sup",
        g = ".3gp;.asf;.avi;.divx;.f4v;.flv;.mkv;.mov;.movie;.mp4;.mpeg;.mpeg4;.mpg;.mpg2;.rm;.rmvb;.rp;.swf;.tp;.tp0;.ts;.wmv",
        p = ".exe;.com;.bat;.msi", v = ".wav;.flac;.mp3;.aac;.wma;.m4a;.mid;.ape;.ogg;.ra;.mod",
        m = ".psd;.tga;.gif;.jpeg;.jpg;.jp2;.bmp;.ico;.pcx;.pdf;.png;.pbm;.pgm;.ppm;.pnm;.pgf;.arw;.cr2;.crw;.dcr;.dng;.erf;.kdc;\n  .mef;.mos;.mrw;.nef;.nrw;.orf;.pef;.ptx;.r3d;.raf;.raw;.rw2;.srf;.srw;.x3f;.ras;.tiff;.tif;.wbmp;.ilbm;.lbm;.iff;.ico",
        y = ".txt;.html;.htm;.shtml;.xhtml;.chm;.hlp;.inf;.rtf;.tex;.ltx;.doc;.docx;.wps;.ppt;.pptx;.odf;.pdf;.xls;.xlsx;.docm;.dot;.dotm;.dotx;.email;.rp;.pps",
        k = ".rar;.tar;.zip;.gzip;.cab;.uue;.arj;.bz2;.lzh;.jar;.ace;.iso;.7-zip;.7z",
        T = ".asf;.mpg;.rmvb;.rm;.wmv;.avi;.mp4;.mpeg;.mkv;.mov;.ts;.flv;.3gp;",
        w = ".exe;.com;.bat;.scr;.lnk;.pif;.wsh;", C = ".iso;";
    !function (e) {
        let t;

        function i(e) {
            let i = t.Unkown, a = n.extname(e);
            return null !== a && void 0 !== a && a.length >= 2 && (a = a.toLowerCase()), void 0 === a || "" === a || a.length < 2 ? i = t.Unkown : g.indexOf(a) > -1 ? i = t.Video : p.indexOf(a) > -1 ? i = t.Software : y.indexOf(a) > -1 ? i = t.Doc : v.indexOf(a) > -1 ? i = t.Music : m.indexOf(a) > -1 ? i = t.Pic : k.indexOf(a) > -1 && (i = t.Zip), a.length > 1 && ".z" === a.slice(0, 2) && /[0-9]+/.test(a.substring(2)) && (i = t.Zip), i
        }

        e.getTaskIcon = function (e, t, i) {
            i = i || "xly-type-";
            let g = "";
            do {
                if (t === a.DownloadKernel.TaskType.Bt) {
                    g = "bt-file";
                    break
                }
                if (t === a.DownloadKernel.TaskType.Group) {
                    g = "group";
                    break
                }
                g = "unknown";
                let i = n.extname(e);
                if ("" === i || i.length < 2) break;
                let p = (i = i.toLowerCase()).substring(1);
                if (o.indexOf(p) > -1) {
                    g = "doc" === i ? "word" : p;
                    break
                }
                if (i += ";", r.indexOf(i) > -1) {
                    g = "video";
                    break
                }
                if (s.indexOf(i) > -1) {
                    g = "install", [".mds", ".bin", ".img"].indexOf(i) > -1 && (g = "iso");
                    break
                }
                if (l.indexOf(i) > -1) {
                    if (g = "doc", [".htm", ".html", ".mht"].indexOf(i) > -1) {
                        g = "link";
                        break
                    }
                    if ("docx" === i) {
                        g = "word";
                        break
                    }
                    if ("xlsx" === i) {
                        g = "xls";
                        break
                    }
                    if ("pptx" === i) {
                        g = "ppt";
                        break
                    }
                    break
                }
                if (d.indexOf(i) > -1) {
                    g = "music";
                    break
                }
                if (u.indexOf(i) > -1) {
                    g = "pic";
                    break
                }
                if (c.indexOf(i) > -1) {
                    g = "rar";
                    break
                }
                if (h.indexOf(i) > -1) {
                    g = "bt-link";
                    break
                }
                if (f.indexOf(i) > -1) {
                    g = "text";
                    break
                }
            } while (0);
            return `${i}${g}`
        }, function (e) {
            e[e.Unkown = 0] = "Unkown", e[e.Video = 1] = "Video", e[e.Software = 2] = "Software", e[e.Doc = 3] = "Doc", e[e.Music = 4] = "Music", e[e.Pic = 5] = "Pic", e[e.Zip = 6] = "Zip", e[e.Bt = 7] = "Bt"
        }(t = e.FileExtType || (e.FileExtType = {})), e.getTaskFileType = function (e, i) {
            let a = t.Unkown;
            return void 0 === i && void 0 !== e && (i = n.extname(e)), null !== i && void 0 !== i && i.length >= 2 && (i = i.toLowerCase(), i += ";"), void 0 === i || "" === i || i.length < 3 ? a = t.Unkown : r.indexOf(i) > -1 ? a = t.Video : s.indexOf(i) > -1 ? a = t.Software : l.indexOf(i) > -1 ? a = t.Doc : d.indexOf(i) > -1 ? a = t.Music : u.indexOf(i) > -1 ? a = t.Pic : c.indexOf(i) > -1 ? a = t.Zip : h.indexOf(i) > -1 && (a = t.Bt), i.length > 1 && ".z" === i.slice(0, 2) && /[0-9]+/.test(i.substring(2)) && (a = t.Zip), a
        }, e.isVideoFileExt = function (e) {
            let t = !1;
            do {
                if (null === e || void 0 === e || "" === e) break;
                let i = n.extname(e);
                if (!(null !== i && void 0 !== i && i.length >= 2)) break;
                i = i.toLowerCase(), i += ";", T.indexOf(i) > -1 && (t = !0)
            } while (0);
            return t
        }, e.isSubtitleExt = function (e) {
            let t = !1;
            do {
                if (null === e || void 0 === e || "" === e) break;
                let i = n.extname(e);
                if (!(null !== i && void 0 !== i && i.length >= 2)) break;
                i = i.toLowerCase(), i += ";", f.indexOf(i) > -1 && (t = !0)
            } while (0);
            return t
        }, e.isExecutableExt = function (e) {
            let t = !1;
            do {
                if (null === e || void 0 === e || "" === e) break;
                let i = n.extname(e);
                if (!(null !== i && void 0 !== i && i.length >= 2)) break;
                i = i.toLowerCase(), i += ";", w.indexOf(i) > -1 && (t = !0)
            } while (0);
            return t
        }, e.isIsoExt = function (e) {
            let t = !1;
            do {
                if (null === e || void 0 === e || "" === e) break;
                let i = n.extname(e);
                if (!(null !== i && void 0 !== i && i.length >= 2)) break;
                i = i.toLowerCase(), i += ";", C.indexOf(i) > -1 && (t = !0)
            } while (0);
            return t
        }, e.getGroupFileType = i, e.getDefaultGroupPrefix = function (e) {
            let n = "任务组";
            do {
                if (void 0 === e || null === e || 0 === e.length) break;
                let a = [];
                for (let e = 0; e < 7; e++) a[e] = 0;
                for (let t of e) {
                    let e = i(t);
                    a[e] = a[e] + 1
                }
                let o = t.Unkown;
                for (let e = 1; e < a.length; e++) a[e] > a[o] && (o = e);
                o === t.Video ? n = "视频任务组" : o === t.Software ? n = "程序任务组" : o === t.Music ? n = "音乐任务组" : o === t.Pic ? n = "图片任务组" : o === t.Doc ? n = "文档任务组" : o === t.Zip && (n = "压缩包任务组")
            } while (0);
            return n
        }, e.compareVersion = function (e, t) {
            let i = -2;
            do {
                if (null === e || void 0 === e || "" === e || null === t || void 0 === t || "" === t) break;
                let n = 0, a = 0, o = 0, r = 0, s = 0, l = 0, d = 0, u = 0, c = e.split(/\./);
                if (null === c || void 0 === c || c.length < 3) break;
                if (n = Number(c[0]), a = Number(c[1]), o = Number(c[2]), null !== c[3] && void 0 !== c[3] && "" !== c[3] && (r = Number(c[3])), null === (c = t.split(/\./)) || void 0 === c || c.length < 3) break;
                if (s = Number(c[0]), l = Number(c[1]), d = Number(c[2]), null !== c[3] && void 0 !== c[3] && "" !== c[3] && (u = Number(c[3])), s > n) {
                    i = 1;
                    break
                }
                if (s < n) {
                    i = -1;
                    break
                }
                if (l > a) {
                    i = 1;
                    break
                }
                if (l < a) {
                    i = -1;
                    break
                }
                if (d > o) {
                    i = 1;
                    break
                }
                if (d < o) {
                    i = -1;
                    break
                }
                if (0 !== r) {
                    if (u > r) {
                        i = 1;
                        break
                    }
                    if (u < r) {
                        i = -1;
                        break
                    }
                }
                i = 0
            } while (0);
            return i
        }
    }(t.TaskUtilHelper || (t.TaskUtilHelper = {}))
}, function (e, t, i) {
    "use strict";
    var n = i(404), a = i(494), o = Object.prototype.toString;

    function r(e) {
        return "[object Array]" === o.call(e)
    }

    function s(e) {
        return null !== e && "object" == typeof e
    }

    function l(e) {
        return "[object Function]" === o.call(e)
    }

    function d(e, t) {
        if (null !== e && void 0 !== e) if ("object" != typeof e && (e = [e]), r(e)) for (var i = 0, n = e.length; i < n; i++) t.call(null, e[i], i, e); else for (var a in e) Object.prototype.hasOwnProperty.call(e, a) && t.call(null, e[a], a, e)
    }

    e.exports = {
        isArray: r, isArrayBuffer: function (e) {
            return "[object ArrayBuffer]" === o.call(e)
        }, isBuffer: a, isFormData: function (e) {
            return "undefined" != typeof FormData && e instanceof FormData
        }, isArrayBufferView: function (e) {
            return "undefined" != typeof ArrayBuffer && ArrayBuffer.isView ? ArrayBuffer.isView(e) : e && e.buffer && e.buffer instanceof ArrayBuffer
        }, isString: function (e) {
            return "string" == typeof e
        }, isNumber: function (e) {
            return "number" == typeof e
        }, isObject: s, isUndefined: function (e) {
            return void 0 === e
        }, isDate: function (e) {
            return "[object Date]" === o.call(e)
        }, isFile: function (e) {
            return "[object File]" === o.call(e)
        }, isBlob: function (e) {
            return "[object Blob]" === o.call(e)
        }, isFunction: l, isStream: function (e) {
            return s(e) && l(e.pipe)
        }, isURLSearchParams: function (e) {
            return "undefined" != typeof URLSearchParams && e instanceof URLSearchParams
        }, isStandardBrowserEnv: function () {
            return ("undefined" == typeof navigator || "ReactNative" !== navigator.product) && "undefined" != typeof window && "undefined" != typeof document
        }, forEach: d, merge: function e() {
            var t = {};

            function i(i, n) {
                "object" == typeof t[n] && "object" == typeof i ? t[n] = e(t[n], i) : t[n] = i
            }

            for (var n = 0, a = arguments.length; n < a; n++) d(arguments[n], i);
            return t
        }, extend: function (e, t, i) {
            return d(t, function (t, a) {
                e[a] = i && "function" == typeof t ? n(t, i) : t
            }), e
        }, trim: function (e) {
            return e.replace(/^\s*/, "").replace(/\s*$/, "")
        }
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(0), a = i(39), o = i(46), r = n.default.getLogger("ToastNotifyManager");
    !function (e) {
        e.notifyIdAutoDeleteNonExistTasks = "auto_delete_nonexsit_tasks", e.notifyIdScheduleTaskComplete = "schedule_task_complete", e.notifyIdTaskOperatorDestroyTask = "task_operator_destroy_task", e.notifyIdTaskOperatorCopyLink = "task_operator_copy_link", e.notifyIdTaskOperatorCopyMagnetLink = "task_operator_copy_magnet_link", e.notifyIdTaskOperatorSaveAsTorrent = "task_operator_save_as_torrent", e.notifyIdTaskOperatorRecoverTask = "task_operator_recover_task", e.notifyIdScheduleTaskDownloadMode = "schedule_task_download_mode", e.notifyIdTaskOperatorMoveTask = "task_operator_move_task", e.notifyIdTaskDispatchSmallFileAdvanced = "task_dispatch_small_file_advanced", e.notifyIdGetCoinPrize = "get_coin_prize", e.notifyIdTaskAdd2Cloud = "task_add_to_cloud_notify";

        class t extends a.default {
            constructor() {
                super(...arguments), this.notifyList = []
            }

            getTopNotify() {
                return this.notifyList.length < 1 ? null : this.notifyList[this.notifyList.length - 1]
            }

            closeNotify(e) {
                r.information("closeNotify notifyId:", e);
                for (let t = 0; t < this.notifyList.length; t++) if (this.notifyList[t].getId() === e) {
                    let i = this.notifyList[t];
                    this.notifyList.splice(t, 1), this.fireEvent("OnCloseNotify", e, i);
                    break
                }
            }

            updateNotify(e, t, i) {
                r.information("updateNotify notifyId:", e, ", msg:", t, ", duration:", i);
                for (let n = 0; n < this.notifyList.length; n++) {
                    let a = this.notifyList[n];
                    if (a.getId() === e) return a.setMessage(t), a.setDuration(i), this.fireEvent("OnUpdateNotify", e, a), !0
                }
                return !1
            }

            showNotify(e, t, i, n, a) {
                r.information("showNotify notifyId:", e, ", notifyType:", t, ", message:", i, ", duration:", n, ", component:", a);
                let s = null;
                switch (t) {
                    case o.ToastNotifyItemType.GreenNotify:
                        s = new o.ToastNotifyItem(e, i, n);
                        break;
                    case o.ToastNotifyItemType.RedCancelNotify:
                        s = new o.RedCancelToastNotifyItem(e, i, n);
                        break;
                    case o.ToastNotifyItemType.RedNotify:
                        s = new o.RedToastNotifyItem(e, i, n);
                        break;
                    case o.ToastNotifyItemType.Custom:
                        s = new o.CustomToastNotifyItem(e, i, n, a)
                }
                return s ? (this.notifyList.push(s), this.fireEvent("OnShowNotify", e, s), s) : s
            }

            showNotifyEx(e, t, i, n, a, r) {
                let s = null;
                switch (t) {
                    case o.ToastNotifyItemType.GreenNotify:
                        s = new o.ToastNotifyItem(e, i, n, a);
                        break;
                    case o.ToastNotifyItemType.RedCancelNotify:
                        s = new o.RedCancelToastNotifyItem(e, i, n, a);
                        break;
                    case o.ToastNotifyItemType.RedNotify:
                        s = new o.RedToastNotifyItem(e, i, n, a);
                        break;
                    case o.ToastNotifyItemType.Custom:
                        s = new o.CustomToastNotifyItem(e, i, n, r)
                }
                return s ? (this.notifyList.push(s), this.fireEvent("OnShowNotify", e, s), s) : s
            }
        }

        e.ToastNotifyManager = t;
        const i = new t;
        e.getToastNotifyManger = function () {
            return i
        }
    }(t.ToastNotifyManagerNS || (t.ToastNotifyManagerNS = {}))
}, function (e, t, i) {
    (function () {
        var t, n, a, o, r, s, l, d, u, c, h, f, g = {}.hasOwnProperty;
        f = i(66), h = f.isObject, c = f.isFunction, u = f.isEmpty, r = null, t = null, n = null, a = null, o = null, l = null, d = null, s = null, e.exports = function () {
            function e(e) {
                this.parent = e, this.parent && (this.options = this.parent.options, this.stringify = this.parent.stringify), this.children = [], r || (r = i(112), t = i(113), n = i(114), a = i(115), o = i(116), l = i(121), d = i(122), s = i(123))
            }

            return e.prototype.element = function (e, t, i) {
                var n, a, o, r, s, l, d, f, p, v;
                if (l = null, null == t && (t = {}), t = t.valueOf(), h(t) || (i = (p = [t, i])[0], t = p[1]), null != e && (e = e.valueOf()), Array.isArray(e)) for (o = 0, d = e.length; o < d; o++) a = e[o], l = this.element(a); else if (c(e)) l = this.element(e.apply()); else if (h(e)) {
                    for (s in e) if (g.call(e, s)) if (v = e[s], c(v) && (v = v.apply()), h(v) && u(v) && (v = null), !this.options.ignoreDecorators && this.stringify.convertAttKey && 0 === s.indexOf(this.stringify.convertAttKey)) l = this.attribute(s.substr(this.stringify.convertAttKey.length), v); else if (!this.options.separateArrayItems && Array.isArray(v)) for (r = 0, f = v.length; r < f; r++) a = v[r], (n = {})[s] = a, l = this.element(n); else h(v) ? (l = this.element(s)).element(v) : l = this.element(s, v)
                } else l = !this.options.ignoreDecorators && this.stringify.convertTextKey && 0 === e.indexOf(this.stringify.convertTextKey) ? this.text(i) : !this.options.ignoreDecorators && this.stringify.convertCDataKey && 0 === e.indexOf(this.stringify.convertCDataKey) ? this.cdata(i) : !this.options.ignoreDecorators && this.stringify.convertCommentKey && 0 === e.indexOf(this.stringify.convertCommentKey) ? this.comment(i) : !this.options.ignoreDecorators && this.stringify.convertRawKey && 0 === e.indexOf(this.stringify.convertRawKey) ? this.raw(i) : !this.options.ignoreDecorators && this.stringify.convertPIKey && 0 === e.indexOf(this.stringify.convertPIKey) ? this.instruction(e.substr(this.stringify.convertPIKey.length), i) : this.node(e, t, i);
                if (null == l) throw new Error("Could not create any elements with: " + e);
                return l
            }, e.prototype.insertBefore = function (e, t, i) {
                var n, a, o;
                if (this.isRoot) throw new Error("Cannot insert elements at root level");
                return a = this.parent.children.indexOf(this), o = this.parent.children.splice(a), n = this.parent.element(e, t, i), Array.prototype.push.apply(this.parent.children, o), n
            }, e.prototype.insertAfter = function (e, t, i) {
                var n, a, o;
                if (this.isRoot) throw new Error("Cannot insert elements at root level");
                return a = this.parent.children.indexOf(this), o = this.parent.children.splice(a + 1), n = this.parent.element(e, t, i), Array.prototype.push.apply(this.parent.children, o), n
            }, e.prototype.remove = function () {
                var e;
                if (this.isRoot) throw new Error("Cannot remove the root element");
                return e = this.parent.children.indexOf(this), [].splice.apply(this.parent.children, [e, e - e + 1].concat([])), this.parent
            }, e.prototype.node = function (e, t, i) {
                var n, a;
                return null != e && (e = e.valueOf()), t || (t = {}), t = t.valueOf(), h(t) || (i = (a = [t, i])[0], t = a[1]), n = new r(this, e, t), null != i && n.text(i), this.children.push(n), n
            }, e.prototype.text = function (e) {
                var t;
                return t = new d(this, e), this.children.push(t), this
            }, e.prototype.cdata = function (e) {
                var i;
                return i = new t(this, e), this.children.push(i), this
            }, e.prototype.comment = function (e) {
                var t;
                return t = new n(this, e), this.children.push(t), this
            }, e.prototype.commentBefore = function (e) {
                var t, i;
                return t = this.parent.children.indexOf(this), i = this.parent.children.splice(t), this.parent.comment(e), Array.prototype.push.apply(this.parent.children, i), this
            }, e.prototype.commentAfter = function (e) {
                var t, i;
                return t = this.parent.children.indexOf(this), i = this.parent.children.splice(t + 1), this.parent.comment(e), Array.prototype.push.apply(this.parent.children, i), this
            }, e.prototype.raw = function (e) {
                var t;
                return t = new l(this, e), this.children.push(t), this
            }, e.prototype.instruction = function (e, t) {
                var i, n, a, o, r;
                if (null != e && (e = e.valueOf()), null != t && (t = t.valueOf()), Array.isArray(e)) for (o = 0, r = e.length; o < r; o++) i = e[o], this.instruction(i); else if (h(e)) for (i in e) g.call(e, i) && (n = e[i], this.instruction(i, n)); else c(t) && (t = t.apply()), a = new s(this, e, t), this.children.push(a);
                return this
            }, e.prototype.instructionBefore = function (e, t) {
                var i, n;
                return i = this.parent.children.indexOf(this), n = this.parent.children.splice(i), this.parent.instruction(e, t), Array.prototype.push.apply(this.parent.children, n), this
            }, e.prototype.instructionAfter = function (e, t) {
                var i, n;
                return i = this.parent.children.indexOf(this), n = this.parent.children.splice(i + 1), this.parent.instruction(e, t), Array.prototype.push.apply(this.parent.children, n), this
            }, e.prototype.declaration = function (e, t, i) {
                var n, o;
                return n = this.document(), o = new a(n, e, t, i), n.children[0] instanceof a ? n.children[0] = o : n.children.unshift(o), n.root() || n
            }, e.prototype.doctype = function (e, t) {
                var i, n, a, r, s, l, d, u, c;
                for (i = this.document(), n = new o(i, e, t), a = r = 0, l = (u = i.children).length; r < l; a = ++r) if (u[a] instanceof o) return i.children[a] = n, n;
                for (a = s = 0, d = (c = i.children).length; s < d; a = ++s) if (c[a].isRoot) return i.children.splice(a, 0, n), n;
                return i.children.push(n), n
            }, e.prototype.up = function () {
                if (this.isRoot) throw new Error("The root node has no parent. Use doc() if you need to get the document object.");
                return this.parent
            }, e.prototype.root = function () {
                var e;
                for (e = this; e;) {
                    if (e.isDocument) return e.rootObject;
                    if (e.isRoot) return e;
                    e = e.parent
                }
            }, e.prototype.document = function () {
                var e;
                for (e = this; e;) {
                    if (e.isDocument) return e;
                    e = e.parent
                }
            }, e.prototype.end = function (e) {
                return this.document().end(e)
            }, e.prototype.prev = function () {
                var e;
                if ((e = this.parent.children.indexOf(this)) < 1) throw new Error("Already at the first node");
                return this.parent.children[e - 1]
            }, e.prototype.next = function () {
                var e;
                if (-1 === (e = this.parent.children.indexOf(this)) || e === this.parent.children.length - 1) throw new Error("Already at the last node");
                return this.parent.children[e + 1]
            }, e.prototype.importDocument = function (e) {
                var t;
                return (t = e.root().clone()).parent = this, t.isRoot = !1, this.children.push(t), this
            }, e.prototype.ele = function (e, t, i) {
                return this.element(e, t, i)
            }, e.prototype.nod = function (e, t, i) {
                return this.node(e, t, i)
            }, e.prototype.txt = function (e) {
                return this.text(e)
            }, e.prototype.dat = function (e) {
                return this.cdata(e)
            }, e.prototype.com = function (e) {
                return this.comment(e)
            }, e.prototype.ins = function (e, t) {
                return this.instruction(e, t)
            }, e.prototype.doc = function () {
                return this.document()
            }, e.prototype.dec = function (e, t, i) {
                return this.declaration(e, t, i)
            }, e.prototype.dtd = function (e, t) {
                return this.doctype(e, t)
            }, e.prototype.e = function (e, t, i) {
                return this.element(e, t, i)
            }, e.prototype.n = function (e, t, i) {
                return this.node(e, t, i)
            }, e.prototype.t = function (e) {
                return this.text(e)
            }, e.prototype.d = function (e) {
                return this.cdata(e)
            }, e.prototype.c = function (e) {
                return this.comment(e)
            }, e.prototype.r = function (e) {
                return this.raw(e)
            }, e.prototype.i = function (e, t) {
                return this.instruction(e, t)
            }, e.prototype.u = function () {
                return this.up()
            }, e.prototype.importXMLBuilder = function (e) {
                return this.importDocument(e)
            }, e
        }()
    }).call(this)
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        e.guidDownloadAndPlay = "{6B0A52BF-FDC5-4dfd-A20E-597CCD50CB8F}", e.guidTaskRequest = "{D30770E1-0A7F-4879-A103-AC738CB477C6}", e.guidUnzip = "{C60B84A8-6D18-475d-989D-965ADBECF135}", e.guidDownloadCompleteInstall = "{66F815D6-ADE3-4c85-A6B2-E48D50C096A7}", e.guidDownloadCompleteRunParams = "{D30770E1-0A7F-4879-A103-AC738CB477C6}", e.guidDownloadGroupTask = "{66F815D6-ADE3-4c85-A6B2-E48D50C096A7}", e.guidNotSavePath = "{57D3CEED-8FE8-465e-B7B0-4A80BF7AED3D}", e.guidCreateShortcut = "{FF6109C2-2C71-4A9F-8C52-8BF2548D1A6F}", e.guidBirdKey = "{DC5A04D4-3FCF-43E4-A8F6-10809C8E5A8B}", e.guidHttpHeaderField = "{76E33F22-C09A-4A21-A31E-62CE63F1A2FE}", e.guidThunderYunDownloadUserData = "{56F48D3C-5453-4E16-B3A5-35EC5CC2C69E}"
    }(t.TaskUserDataGUID || (t.TaskUserDataGUID = {}))
}, function (e, t, i) {
    e.exports = i(56)(24)
}, function (e, t) {
    e.exports = require("fs")
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        e[e.HWND_NOTOPMOST = -2] = "HWND_NOTOPMOST", e[e.HWND_TOPMOST = -1] = "HWND_TOPMOST", e[e.HWND_TOP = 0] = "HWND_TOP", e[e.HWND_BOTTOM = 1] = "HWND_BOTTOM"
    }(t.OptionOfHWNDInAfter || (t.OptionOfHWNDInAfter = {})), function (e) {
        e[e.SWP_ASYNCWINDOWPOS = 16384] = "SWP_ASYNCWINDOWPOS", e[e.SWP_DEFERERASE = 8192] = "SWP_DEFERERASE", e[e.SWP_DRAWFRAME = 32] = "SWP_DRAWFRAME", e[e.SWP_FRAMECHANGED = 32] = "SWP_FRAMECHANGED", e[e.SWP_HIDEWINDOW = 128] = "SWP_HIDEWINDOW", e[e.SWP_NOACTIVATE = 16] = "SWP_NOACTIVATE", e[e.SWP_NOCOPYBITS = 256] = "SWP_NOCOPYBITS", e[e.SWP_NOMOVE = 2] = "SWP_NOMOVE", e[e.SWP_NOOWNERZORDER = 512] = "SWP_NOOWNERZORDER", e[e.SWP_NOREDRAW = 8] = "SWP_NOREDRAW", e[e.SWP_NOREPOSITION = 512] = "SWP_NOREPOSITION", e[e.SWP_NOSENDCHANGING = 1024] = "SWP_NOSENDCHANGING", e[e.SWP_NOSIZE = 1] = "SWP_NOSIZE", e[e.SWP_NOZORDER = 4] = "SWP_NOZORDER", e[e.SWP_SHOWWINDOW = 64] = "SWP_SHOWWINDOW"
    }(t.Uflag || (t.Uflag = {})), function (e) {
        e[e.SW_FORCEMINIMIZE = 11] = "SW_FORCEMINIMIZE", e[e.SW_HIDE = 0] = "SW_HIDE", e[e.SW_MAXIMIZE = 3] = "SW_MAXIMIZE", e[e.SW_MINIMIZE = 6] = "SW_MINIMIZE", e[e.SW_RESTORE = 9] = "SW_RESTORE", e[e.SW_SHOW = 5] = "SW_SHOW", e[e.SW_SHOWDEFAULT = 10] = "SW_SHOWDEFAULT", e[e.SW_SHOWMAXIMIZED = 3] = "SW_SHOWMAXIMIZED", e[e.SW_SHOWMINIMIZED = 2] = "SW_SHOWMINIMIZED", e[e.SW_SHOWMINNOACTIVE = 7] = "SW_SHOWMINNOACTIVE", e[e.SW_SHOWNA = 8] = "SW_SHOWNA", e[e.SW_SHOWNOACTIVATE = 4] = "SW_SHOWNOACTIVATE", e[e.SW_SHOWNORMAL = 1] = "SW_SHOWNORMAL"
    }(t.CmdShow || (t.CmdShow = {})), function (e) {
        e[e.WS_BORDER = 8388608] = "WS_BORDER", e[e.WS_CAPTION = 12582912] = "WS_CAPTION", e[e.WS_CHILD = 1073741824] = "WS_CHILD", e[e.WS_CHILDWINDOW = 1073741824] = "WS_CHILDWINDOW", e[e.WS_CLIPCHILDREN = 33554432] = "WS_CLIPCHILDREN", e[e.WS_CLIPSIBLINGS = 67108864] = "WS_CLIPSIBLINGS", e[e.WS_POPUP = 2147483648] = "WS_POPUP", e[e.WS_THICKFRAME = 262144] = "WS_THICKFRAME"
    }(t.WindowStyle || (t.WindowStyle = {})), function (e) {
        e[e.WS_EX_TOOLWINDOW = 128] = "WS_EX_TOOLWINDOW", e[e.WS_EX_APPWINDOW = 262144] = "WS_EX_APPWINDOW", e[e.WS_EX_TOPMOST = 8] = "WS_EX_TOPMOST", e[e.WS_EX_WINDOWEDGE = 256] = "WS_EX_WINDOWEDGE", e[e.WS_EX_NOACTIVATE = 134217728] = "WS_EX_NOACTIVATE"
    }(t.WindowStyleEx || (t.WindowStyleEx = {})), function (e) {
        e[e.GWL_EXSTYLE = -20] = "GWL_EXSTYLE", e[e.GWL_HINSTANCE = -6] = "GWL_HINSTANCE", e[e.GWL_ID = -12] = "GWL_ID", e[e.GWL_STYLE = -16] = "GWL_STYLE", e[e.GWL_USERDATA = -21] = "GWL_USERDATA", e[e.GWL_WNDPROC = -4] = "GWL_WNDPROC"
    }(t.SetWindowType || (t.SetWindowType = {})), function (e) {
        e[e.WM_CREATE = 1] = "WM_CREATE", e[e.WM_DESTROY = 2] = "WM_DESTROY", e[e.WM_MOVE = 3] = "WM_MOVE", e[e.WM_SIZE = 5] = "WM_SIZE", e[e.WM_ACTIVATE = 6] = "WM_ACTIVATE", e[e.WM_SETFOCUS = 7] = "WM_SETFOCUS", e[e.WM_KILLFOCUS = 8] = "WM_KILLFOCUS", e[e.WM_ENABLE = 10] = "WM_ENABLE", e[e.WM_KEYDOWN = 256] = "WM_KEYDOWN", e[e.WM_KEYUP = 257] = "WM_KEYUP", e[e.WM_SYSKEYDOWN = 260] = "WM_SYSKEYDOWN", e[e.WM_MOUSEMOVE = 512] = "WM_MOUSEMOVE", e[e.WM_SETCURSOR = 32] = "WM_SETCURSOR", e[e.WM_LBUTTONDOWN = 513] = "WM_LBUTTONDOWN", e[e.WM_LBUTTONUP = 514] = "WM_LBUTTONUP", e[e.WM_LBUTTONDBLCLK = 515] = "WM_LBUTTONDBLCLK", e[e.WM_RBUTTONUP = 517] = "WM_RBUTTONUP", e[e.WM_MOUSEWHEEL = 522] = "WM_MOUSEWHEEL", e[e.WM_MOUSELEAVE = 675] = "WM_MOUSELEAVE", e[e.WM_DPICHANGED = 736] = "WM_DPICHANGED", e[e.WM_GETMINMAXINFO = 36] = "WM_GETMINMAXINFO", e[e.WM_NCHITTEST = 132] = "WM_NCHITTEST", e[e.WM_NCMOUSEMOVE = 160] = "WM_NCMOUSEMOVE", e[e.WM_NCLBUTTONDOWN = 161] = "WM_NCLBUTTONDOWN", e[e.WM_NCLBUTTONUP = 162] = "WM_NCLBUTTONUP", e[e.WM_NCLBUTTONDBLCLK = 163] = "WM_NCLBUTTONDBLCLK", e[e.WM_NCRBUTTONDOWN = 164] = "WM_NCRBUTTONDOWN", e[e.WM_NCRBUTTONUP = 165] = "WM_NCRBUTTONUP", e[e.WM_NCRBUTTONDBLCLK = 166] = "WM_NCRBUTTONDBLCLK", e[e.WM_NCMBUTTONDOWN = 167] = "WM_NCMBUTTONDOWN", e[e.WM_NCMBUTTONUP = 168] = "WM_NCMBUTTONUP", e[e.WM_NCMBUTTONDBLCLK = 169] = "WM_NCMBUTTONDBLCLK", e[e.WM_WINDOWPOSCHANGED = 71] = "WM_WINDOWPOSCHANGED", e[e.WM_WINDOWPOSCHANGING = 70] = "WM_WINDOWPOSCHANGING", e[e.WM_ACTIVATEAPP = 28] = "WM_ACTIVATEAPP", e[e.WM_DWMCOMPOSITIONCHANGED = 798] = "WM_DWMCOMPOSITIONCHANGED", e[e.WM_QUERYENDSESSION = 17] = "WM_QUERYENDSESSION"
    }(t.WindowMessage || (t.WindowMessage = {})), function (e) {
        e[e.GW_HWNDFIRST = 0] = "GW_HWNDFIRST", e[e.GW_HWNDLAST = 1] = "GW_HWNDLAST", e[e.GW_HWNDNEXT = 2] = "GW_HWNDNEXT", e[e.GW_HWNDPREV = 3] = "GW_HWNDPREV", e[e.GW_OWNER = 4] = "GW_OWNER", e[e.GW_CHILD = 5] = "GW_CHILD", e[e.GW_ENABLEDPOPUP = 6] = "GW_ENABLEDPOPUP"
    }(t.GWCmd || (t.GWCmd = {})), function (e) {
        e[e.HTERROR = -2] = "HTERROR", e[e.HTTRANSPARENT = -1] = "HTTRANSPARENT", e[e.HTNOWHERE = 0] = "HTNOWHERE", e[e.HTCLIENT = 1] = "HTCLIENT", e[e.HTCAPTION = 2] = "HTCAPTION", e[e.HTSYSMENU = 3] = "HTSYSMENU", e[e.HTGROWBOX = 4] = "HTGROWBOX", e[e.HTSIZE = 4] = "HTSIZE", e[e.HTMENU = 5] = "HTMENU", e[e.HTHSCROLL = 6] = "HTHSCROLL", e[e.HTVSCROLL = 7] = "HTVSCROLL", e[e.HTMINBUTTON = 8] = "HTMINBUTTON", e[e.HTMAXBUTTON = 9] = "HTMAXBUTTON", e[e.HTLEFT = 10] = "HTLEFT", e[e.HTRIGHT = 11] = "HTRIGHT", e[e.HTTOP = 12] = "HTTOP", e[e.HTTOPLEFT = 13] = "HTTOPLEFT", e[e.HTTOPRIGHT = 14] = "HTTOPRIGHT", e[e.HTBOTTOM = 15] = "HTBOTTOM", e[e.HTBOTTOMLEFT = 16] = "HTBOTTOMLEFT", e[e.HTBOTTOMRIGHT = 17] = "HTBOTTOMRIGHT", e[e.HTBORDER = 18] = "HTBORDER", e[e.HTREDUCE = 8] = "HTREDUCE", e[e.HTZOOM = 9] = "HTZOOM", e[e.HTSIZEFIRST = 10] = "HTSIZEFIRST", e[e.HTSIZELAST = 17] = "HTSIZELAST", e[e.HTOBJECT = 19] = "HTOBJECT", e[e.HTCLOSE = 20] = "HTCLOSE", e[e.HTHELP = 21] = "HTHELP"
    }(t.HitTestPositionCode || (t.HitTestPositionCode = {})), function (e) {
        e[e.VK_LBUTTON = 1] = "VK_LBUTTON", e[e.VK_RBUTTON = 2] = "VK_RBUTTON", e[e.VK_MBUTTON = 4] = "VK_MBUTTON", e[e.VK_BACK = 8] = "VK_BACK", e[e.VK_TAB = 9] = "VK_TAB", e[e.VK_RETURN = 13] = "VK_RETURN", e[e.VK_SHIFT = 16] = "VK_SHIFT", e[e.VK_CONTROL = 17] = "VK_CONTROL", e[e.VK_MENU = 18] = "VK_MENU", e[e.VK_ESCAPE = 27] = "VK_ESCAPE", e[e.VK_SPACE = 32] = "VK_SPACE", e[e.VK_PRIOR = 33] = "VK_PRIOR", e[e.VK_NEXT = 34] = "VK_NEXT", e[e.VK_END = 35] = "VK_END", e[e.VK_LEFT = 37] = "VK_LEFT", e[e.VK_UP = 38] = "VK_UP", e[e.VK_RIGHT = 39] = "VK_RIGHT", e[e.VK_DOWN = 40] = "VK_DOWN", e[e.VK_DELETE = 46] = "VK_DELETE", e[e.VK_F1 = 112] = "VK_F1", e[e.VK_F2 = 113] = "VK_F2", e[e.VK_F3 = 114] = "VK_F3", e[e.VK_F4 = 115] = "VK_F4", e[e.VK_F5 = 116] = "VK_F5", e[e.VK_F6 = 117] = "VK_F6", e[e.VK_F7 = 118] = "VK_F7", e[e.VK_F8 = 119] = "VK_F8", e[e.VK_F9 = 120] = "VK_F9", e[e.VK_F10 = 121] = "VK_F10", e[e.VK_F11 = 122] = "VK_F11", e[e.VK_F12 = 123] = "VK_F12", e[e.VK_OEM_1 = 186] = "VK_OEM_1", e[e.VK_OEM_PLUS = 187] = "VK_OEM_PLUS", e[e.VK_OEM_COMMA = 188] = "VK_OEM_COMMA", e[e.VK_OEM_MINUS = 189] = "VK_OEM_MINUS", e[e.VK_OEM_PERIOD = 190] = "VK_OEM_PERIOD", e[e.VK_OEM_2 = 191] = "VK_OEM_2", e[e.VK_OEM_3 = 192] = "VK_OEM_3", e[e.VK_OEM_4 = 219] = "VK_OEM_4", e[e.VK_OEM_5 = 220] = "VK_OEM_5", e[e.VK_OEM_6 = 221] = "VK_OEM_6", e[e.VK_OEM_7 = 222] = "VK_OEM_7", e[e.VK_PROCESSKEY = 229] = "VK_PROCESSKEY"
    }(t.VirtualKeyCode || (t.VirtualKeyCode = {})), function (e) {
        e[e.SW_HIDE = 0] = "SW_HIDE", e[e.SW_SHOWMAXIMIZED = 3] = "SW_SHOWMAXIMIZED", e[e.SW_SHOW = 5] = "SW_SHOW"
    }(t.ShowWindowCmd || (t.ShowWindowCmd = {})), function (e) {
        e[e.MIN_WINDOW_WIDTH = 520] = "MIN_WINDOW_WIDTH", e[e.MIN_WINDOW_HEIGHT = 335] = "MIN_WINDOW_HEIGHT", e[e.MIN_WINDOW_WIDTH_TAB = 910] = "MIN_WINDOW_WIDTH_TAB", e[e.MIN_WINDOW_HEIGHT_TAB = 600] = "MIN_WINDOW_HEIGHT_TAB", e[e.TOP_WINDOW_HEIGHT = 68] = "TOP_WINDOW_HEIGHT", e[e.TOP_WINDOW_HEIGHT_NORMAL = 68] = "TOP_WINDOW_HEIGHT_NORMAL", e[e.PLAYCTRL_HEIGHT = 82] = "PLAYCTRL_HEIGHT", e[e.PLAYLIST_WIDTH = 240] = "PLAYLIST_WIDTH", e[e.FRAME_BORDER = 0] = "FRAME_BORDER", e[e.FRAME_RESIZE_BORDER = 0] = "FRAME_RESIZE_BORDER", e[e.BROWSERWINDOW_SHADOW = 8] = "BROWSERWINDOW_SHADOW", e[e.SIDE_BAR_WIDTH = 25] = "SIDE_BAR_WIDTH", e[e.SIDE_BAR_HEIGHT = 100] = "SIDE_BAR_HEIGHT", e[e.SHOWHIDE_DELAY_TIME = 2e3] = "SHOWHIDE_DELAY_TIME", e[e.TIME_TIP_WINDOW_WIDTH = 111] = "TIME_TIP_WINDOW_WIDTH", e[e.TIME_TIP_WINDOW_HEIGHT = 30] = "TIME_TIP_WINDOW_HEIGHT", e[e.TIME_IMG_TIP_WINDOW_HEIGHT = 75] = "TIME_IMG_TIP_WINDOW_HEIGHT"
    }(t.WindowParams || (t.WindowParams = {})), function (e) {
        e[e.UNKNOWN_MODE = -1] = "UNKNOWN_MODE", e[e.TRANSPARENT_MODE = 0] = "TRANSPARENT_MODE", e[e.NORMAL_MODE = 1] = "NORMAL_MODE", e[e.MINI_MODE = 2] = "MINI_MODE", e[e.EMBED_CHILD_MODE = 3] = "EMBED_CHILD_MODE"
    }(t.XMPShowMode || (t.XMPShowMode = {})), function (e) {
        e[e.NO_TOPMOST_MODE = 0] = "NO_TOPMOST_MODE", e[e.PLAYING_TOPMOST_MODE = 1] = "PLAYING_TOPMOST_MODE", e[e.ALWAYLS_TOPMOST_MODE = 2] = "ALWAYLS_TOPMOST_MODE"
    }(t.WindowTopMode || (t.WindowTopMode = {})), function (e) {
        e[e.PLAY_UNKNOWN = 0] = "PLAY_UNKNOWN", e[e.PLAY_BY_DOWNLOAD = 1] = "PLAY_BY_DOWNLOAD", e[e.PLAY_BY_PAN = 2] = "PLAY_BY_PAN"
    }(t.XmpPlaySoure || (t.XmpPlaySoure = {})), function (e) {
        e.onOpenSucceeded = "OnOpenSucceeded", e.onOpenFailed = "OnOpenFailed", e.onPlayFailed = "OnPlayFailed", e.onPlaying = "OnPlaying", e.onPreOpen = "OnPreOpen", e.onPaused = "OnPaused", e.onPlayCompleted = "OnPlayCompleted", e.onPreStop = "OnPreStop", e.onStop = "OnStop", e.onXmpQuit = "OnXmpQuit", e.onXmpStartFailed = "OnXmpStartFailed"
    }(t.XmpEvent || (t.XmpEvent = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(17), o = i(533), r = i(0), s = i(12), l = r.default.getLogger("quit-promises");
    t.quitPromises = new class {
        constructor() {
            this.promiseFuncArray = [], this.promiseBeforeFuncArray = [], this.promiseAfterFuncArray = [], a.ipcRenderer.once("OnQueryEndSession", () => n(this, void 0, void 0, function* () {
                a.ipcRenderer.send("closeMainWindow", "exit"), o.HistoryDataNS.setExitType("normal"), yield this.runAllPromises()
            }))
        }

        add(e) {
            this.promiseFuncArray.push(e)
        }

        addBefore(e) {
            this.promiseBeforeFuncArray.push(e)
        }

        addAfter(e) {
            this.promiseAfterFuncArray.push(e)
        }

        runPromises(e) {
            return n(this, void 0, void 0, function* () {
                let t = [];
                for (let i of e) "function" == typeof i && t.push(i());
                return new Promise(e => {
                    Promise.all(t).then(() => {
                        l.information("runPromises finish."), e()
                    }).catch(t => {
                        l.warning("runPromises exception.", t), e()
                    })
                })
            })
        }

        runAllPromises() {
            return n(this, void 0, void 0, function* () {
                l.information("runPromises before"), yield this.runPromises(this.promiseBeforeFuncArray), l.information("runPromises"), yield this.runPromises(this.promiseFuncArray), l.information("runPromises after"), yield this.runPromises(this.promiseAfterFuncArray)
            })
        }

        run() {
            return n(this, void 0, void 0, function* () {
                a.ipcRenderer.send("closeMainWindow", "exit"), o.HistoryDataNS.setExitType("normal"), yield this.runAllPromises(), l.information("app.quit before"), yield(yield s.asyncRemoteCall.getApp()).quit(), l.information("app.quit end")
            })
        }
    }
}, function (e, t) {
    e.exports = vendor_e17de3ecacc329e8b720
}, function (e, t) {
    e.exports = require("os")
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(44), o = i(18), r = i(2), s = i(5), l = i(0).default.getLogger("Axios.Helper");
    !function (e) {
        e.getFileSizeWithUrlAW = function (e) {
            return n(this, void 0, void 0, function* () {
                let t = 0;
                do {
                    let i = a.parse(e);
                    if ("https:" !== i.protocol && "http:" !== i.protocol) break;
                    let n = null;
                    try {
                        n = yield o.default.get(e, {responseType: "arraybuffer"})
                    } catch (e) {
                        l.warning(e)
                    }
                    if (null !== n && void 0 !== n.status && 200 === n.status) {
                        let e = n.headers["content-length"];
                        void 0 !== e && (t = parseInt(e, 10))
                    }
                } while (0);
                return t
            })
        }, e.downloadFileAW = function (e, t, i) {
            return n(this, void 0, void 0, function* () {
                let n = !1;
                do {
                    let a = null;
                    try {
                        a = yield o.default.get(e, {responseType: "arraybuffer", headers: i})
                    } catch (e) {
                        l.information(e);
                        break
                    }
                    if (null !== a && void 0 !== a.status && 200 === a.status && void 0 !== a.data && null !== a.data && "" !== a.data) {
                        let e = r.dirname(t), i = yield s.FileSystemAWNS.mkdirsAW(e);
                        i && (i = yield s.FileSystemAWNS.writeFileAW(t, a.data)) && (n = !0)
                    }
                } while (0);
                return n
            })
        }
    }(t.AxiosNS || (t.AxiosNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(3), o = i(30), r = i(11), s = i(31), l = i(5), d = r.DownloadKernelTaskManager.getTaskManager();
    !function (e) {
        e.batchFindTaskAW = function (e) {
            return n(this, void 0, void 0, function* () {
                let t = [];
                for (let i = 0; i < e.length; ++i) {
                    let n = e[i], o = null;
                    n.taskType === a.DownloadKernel.TaskType.P2sp ? o = {
                        keyType: a.DownloadKernel.KeyType.P2spUrl,
                        keyValue: n.value,
                        keyFilter: a.DownloadKernel.KeyFilter.All
                    } : n.taskType === a.DownloadKernel.TaskType.Emule ? o = {
                        keyType: a.DownloadKernel.KeyType.EmuleFileHash,
                        keyValue: n.value,
                        keyFilter: a.DownloadKernel.KeyFilter.All
                    } : n.taskType === a.DownloadKernel.TaskType.Bt ? o = {
                        keyType: a.DownloadKernel.KeyType.BtInfoId,
                        keyValue: n.value,
                        keyFilter: a.DownloadKernel.KeyFilter.All
                    } : n.taskType === a.DownloadKernel.TaskType.Magnet && (o = {
                        keyType: a.DownloadKernel.KeyType.MagnetUrl,
                        keyValue: n.value,
                        keyFilter: a.DownloadKernel.KeyFilter.All
                    }), o && t.push(o)
                }
                return d.batchFindTaskAsync(t)
            })
        }, e.importUnfinishedTaskAW = function (e, t) {
            return n(this, void 0, void 0, function* () {
                return new Promise(i => {
                    o.DownloadKernelManager.importUnfinishedTask(e, t, (e, t, n) => {
                        i({ret: e, url: t, torrentPath: n})
                    })
                })
            })
        }, e.parserBtFileInfoAW = function (e) {
            return n(this, void 0, void 0, function* () {
                return new Promise(t => n(this, void 0, void 0, function* () {
                    (yield l.FileSystemAWNS.existsAW(e)) ? s.ThunderKernel.parserBtFileInfo(e, (e, i) => {
                        t(0 === e && i ? i : null)
                    }) : t(null)
                }))
            })
        }
    }(t.TaskUtilitiesAWNS || (t.TaskUtilitiesAWNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(3), a = i(306), o = i(88);
    !function (e) {
        let t, i, r;

        function s(e) {
            let a = null, o = e.receiveSize, s = e.srcUsing;
            do {
                if (e.taskType === n.DownloadKernel.TaskType.P2sp) {
                    if (o > 0) {
                        a = t.Stared;
                        break
                    }
                    if (e.taskStatus === n.DownloadKernel.TaskStatus.StartPending) {
                        a = t.Starting;
                        break
                    }
                    if (e.taskStatus === n.DownloadKernel.TaskStatus.Started && 0 === o) {
                        a = t.Connect;
                        break
                    }
                } else if (e.taskType === n.DownloadKernel.TaskType.Bt) {
                    if (o > 0) {
                        a = i.Stared;
                        break
                    }
                    if (e.taskStatus === n.DownloadKernel.TaskStatus.StartPending) {
                        a = i.Analy;
                        break
                    }
                    if (e.taskStatus === n.DownloadKernel.TaskStatus.Started) {
                        a = s > 0 ? i.Connect : i.Search;
                        break
                    }
                } else if (e.taskType === n.DownloadKernel.TaskType.Emule) {
                    if (o > 0) {
                        a = r.Stared;
                        break
                    }
                    if (e.taskStatus === n.DownloadKernel.TaskStatus.StartPending) {
                        a = r.Starting;
                        break
                    }
                    if (e.taskStatus === n.DownloadKernel.TaskStatus.Started) {
                        a = s > 0 ? r.Connect : r.Search;
                        break
                    }
                }
            } while (0);
            return a
        }

        function l(e) {
            let t = "未知错误，无法继续下载";
            e > 704 && e <= 799 && (e = 701);
            let i = a.default.getMessage(a.ErrorType.Download, e);
            if (i) t = i; else switch (e) {
                case 1:
                    t = "任务创建失败，无法继续下载";
                    break;
                case 2:
                    t = "任务参数错误，无法继续下载";
                    break;
                case 3:
                    t = "链接失效，无法继续下载";
                    break;
                case 4:
                    t = "任务配置文件错误，无法继续下载";
                    break;
                case 5:
                    t = "任务连接超时，无法继续下载";
                    break;
                case 6:
                    t = "文件校验失败，无法继续下载";
                    break;
                case 7:
                    t = "任务包含违规内容，无法继续下载";
                    break;
                case 8:
                    t = "下载引擎加速出错，无法继续下载";
                    break;
                case 9:
                    t = "文件路径超出系统限制，无法继续下载";
                    break;
                case 201:
                    t = "文件创建失败，无法继续下载";
                    break;
                case 202:
                    t = "文件写入失败，无法继续下载";
                    break;
                case 203:
                    t = "文件读取失败，无法继续下载";
                    break;
                case 204:
                    t = "文件重命名失败，无法继续下载";
                    break;
                case 205:
                    t = "磁盘空间不足，无法继续下载";
                    break;
                case 211:
                case 212:
                    t = "当前下载目录无法写入数据，请尝试下载到其它目录";
                    break;
                case 601:
                    t = "BT任务已存在，无法继续下载";
                    break;
                case 701:
                    t = "任务包含违规内容，无法继续下载";
                    break;
                case 702:
                    t = "帐号存在异常，无法继续下载";
                    break;
                case 703:
                    t = "根据当地法律法规，文件无法下载";
                    break;
                case 704:
                    t = "应版权方要求，文件无法下载";
                    break;
                case 10001:
                    t = "下载引擎未启动，无法继续下载";
                    break;
                case 10002:
                    t = "种子文件不存在，无法继续下载"
            }
            return t
        }

        e.canStartSelectedTask = function (e, t) {
            let i = !1;
            if (e === n.DownloadKernel.CategroyViewID.Downloading) for (let e of t) {
                if (e.isMoving) {
                    i = !1;
                    break
                }
                let t = e.taskStatus;
                t !== n.DownloadKernel.TaskStatus.StandBy && t !== n.DownloadKernel.TaskStatus.Stopped && t !== n.DownloadKernel.TaskStatus.Failed && t !== n.DownloadKernel.TaskStatus.Unkown || (i = !0)
            }
            return i
        }, e.canMoveSelectedTask = function (e, t) {
            let i = !0;
            for (let e of t) if (e.isMoving) {
                i = !1;
                break
            }
            return i
        }, e.canStopSelectedTask = function (e, t) {
            let i = !1;
            if (e === n.DownloadKernel.CategroyViewID.Downloading) for (let e of t) {
                let t = e.taskStatus;
                if (t === n.DownloadKernel.TaskStatus.Started || t === n.DownloadKernel.TaskStatus.StartWaiting) {
                    i = !0;
                    break
                }
            }
            return i
        }, e.canDeleteSelectedTask = function (e, t) {
            let i = !1;
            if (t.length > 0) for (let e of t) {
                if (e.isMoving) {
                    i = !1;
                    break
                }
                let t = e.taskStatus;
                t === n.DownloadKernel.TaskStatus.StartPending || t === n.DownloadKernel.TaskStatus.StopPending || t === n.DownloadKernel.TaskStatus.DestroyPending || (i = !0)
            }
            return i
        }, e.canMarkAsOpened = function (e) {
            let t = !1;
            do {
                if (null === e || 0 === e.length) break;
                for (let i of e) if (0 === i.userRead) {
                    t = !0;
                    break
                }
            } while (0);
            return t
        }, e.canCopySelectTaskLink = function (e) {
            let t = !1;
            do {
                if (void 0 === e) break;
                if (0 === e.length) break;
                for (let i of e) if (i.taskType === n.DownloadKernel.TaskType.P2sp || i.taskType === n.DownloadKernel.TaskType.Emule || i.taskType === n.DownloadKernel.TaskType.Group) {
                    t = !0;
                    break
                }
            } while (0);
            return t
        }, e.canMergeSelectedTaskIntoGroup = function (e) {
            let t = !0;
            do {
                if (void 0 === e || null === e) {
                    t = !1;
                    break
                }
                if (e.length <= 1) {
                    t = !1;
                    break
                }
                for (let i of e) if (i.taskType === n.DownloadKernel.TaskType.Bt || i.taskType === n.DownloadKernel.TaskType.Group) {
                    t = !1;
                    break
                }
            } while (0);
            return t
        }, function (e) {
            e[e.Unkown = 0] = "Unkown", e[e.Starting = 1] = "Starting", e[e.Connect = 2] = "Connect", e[e.Stared = 3] = "Stared"
        }(t = e.P2spStartStatus || (e.P2spStartStatus = {})), function (e) {
            e[e.Unkown = 0] = "Unkown", e[e.Analy = 1] = "Analy", e[e.Search = 2] = "Search", e[e.Connect = 3] = "Connect", e[e.Stared = 4] = "Stared"
        }(i = e.BtStartStatus || (e.BtStartStatus = {})), function (e) {
            e[e.Unkown = 0] = "Unkown", e[e.Starting = 1] = "Starting", e[e.Search = 2] = "Search", e[e.Connect = 3] = "Connect", e[e.Stared = 4] = "Stared"
        }(r = e.EmuleStartStatus || (e.EmuleStartStatus = {})), e.getTaskStartStatus = s, e.getTaskStartStatusPrompt = function (e) {
            let a = void 0;
            do {
                if (null === e) break;
                if (e.taskStatus === n.DownloadKernel.TaskStatus.StartPending || e.taskStatus === n.DownloadKernel.TaskStatus.Started) {
                    if (e.taskType === n.DownloadKernel.TaskType.P2sp) {
                        let i = s(e);
                        if (null === i) break;
                        i === t.Connect && (a = "连接资源");
                        break
                    }
                    if (e.taskType === n.DownloadKernel.TaskType.Bt) {
                        let t = s(e);
                        if (null === t) break;
                        t === i.Analy ? a = "解析种子" : t === i.Search ? a = "寻找资源" : t === i.Connect && (a = "连接资源");
                        break
                    }
                    if (e.taskType === n.DownloadKernel.TaskType.Emule) {
                        let t = s(e);
                        if (null === t) break;
                        t === r.Search ? a = "寻找资源" : t === r.Connect && (a = "连接资源")
                    }
                }
            } while (0);
            return a
        }, e.getTaskStatusPrompt = function (e) {
            let t = void 0;
            do {
                if (null === e) break;
                let i = e.taskStatus;
                if (i === n.DownloadKernel.TaskStatus.Unkown) {
                    t = "未知错误";
                    break
                }
                if (i !== n.DownloadKernel.TaskStatus.Started) {
                    if (o.DownloadJammedNS.isStopPending(e.taskId)) {
                        t = "0B/s";
                        break
                    }
                } else if (o.DownloadJammedNS.isValidatingFileData(e.taskId)) {
                    t = "正在校验数据";
                    break
                }
                if (i === n.DownloadKernel.TaskStatus.StandBy) {
                    t = "准备开始";
                    break
                }
                if (i === n.DownloadKernel.TaskStatus.PreDownloading) {
                    t = "等待中";
                    break
                }
                if (i === n.DownloadKernel.TaskStatus.StartWaiting) {
                    t = "排队等待";
                    break
                }
                if (i === n.DownloadKernel.TaskStatus.StartPending) {
                    t = "正在开始";
                    break
                }
                if (i === n.DownloadKernel.TaskStatus.StopPending) {
                    t = "正在停止";
                    break
                }
                if (i === n.DownloadKernel.TaskStatus.Stopped) {
                    t = "暂停", e.isMoving && (t = "移动文件中");
                    break
                }
                if (i === n.DownloadKernel.TaskStatus.Failed) {
                    t = "任务出错", t = l(e.errorCode);
                    break
                }
                if (i === n.DownloadKernel.TaskStatus.Succeeded || i === n.DownloadKernel.TaskStatus.Seeding) {
                    t = "完成";
                    break
                }
            } while (0);
            return t
        }, e.getValueForSort = function (e) {
            let t = 0, i = e.taskStatus;
            if (i === n.DownloadKernel.TaskStatus.PreDownloading ? t = 11 : i === n.DownloadKernel.TaskStatus.Started ? t = 10 : i === n.DownloadKernel.TaskStatus.StartPending ? t = 9 : i === n.DownloadKernel.TaskStatus.StartWaiting ? t = 8 : i === n.DownloadKernel.TaskStatus.StopPending ? t = 7 : i === n.DownloadKernel.TaskStatus.DestroyPending ? t = 6 : i === n.DownloadKernel.TaskStatus.Unkown ? t = 5 : i === n.DownloadKernel.TaskStatus.StandBy ? t = 4 : i === n.DownloadKernel.TaskStatus.Stopped ? t = 3 : i === n.DownloadKernel.TaskStatus.Failed ? t = 2 : i === n.DownloadKernel.TaskStatus.Seeding ? t = 1 : i === n.DownloadKernel.TaskStatus.Succeeded && (t = 0), i === n.DownloadKernel.TaskStatus.Started) {
                let i = s(e);
                t = null === i || 4 === i ? t + .9 - 1 / (e.downloadSpeed + 1.2) : t + i / 10 - .4
            }
            return i === n.DownloadKernel.TaskStatus.StartPending && e.taskType === n.DownloadKernel.TaskType.Bt && (t += .1), t
        }, e.getTaskErrorInfoByCode = l
    }(t.TaskStatusHelper || (t.TaskStatusHelper = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(2), a = i(0), o = i(3), r = i(47), s = i(35), l = i(6), d = a.default.getLogger("ThunderNewTask"),
        u = l.default(n.join(__rootDir, "../bin/ThunderHelper.node")),
        c = ".asf;.avi;.exe;.iso;.mp3;.mpeg;.mpg;.mpga;.ra;.rar;.rm;.rmvb;.tar;.wma;.wmp;.wmv;\n  .mov;.zip;.3gp;.chm;.mdf;.torrent;.jar;.msi;.arj;.bin;.dll;.psd;.hqx;.sit;.lzh;.gz;.tgz;.xlsx;.xls;.doc;.docx;.ppt;\n  .pptx;.flv;.swf;.mkv;.tp;.ts;.flac;.ape;.wav;.aac;.txt;.dat;.7z;.ttf;.bat;.xv;.xvx;.pdf;.mp4;.apk;.ipa;.epub;.mobi;\n  .deb;.sisx;.cab;.pxl;.dmg;.msu;",
        h = ".a;.a3m;.a3w;.a4m;.a4p;.a4w;.a5w;.aam;.aas;.abf;.abk;.abs;.ace;.acm;.acp;.act;.ad;\n  .ada;.adb;.adf;.adi;.adm;.adp;.adr;.ads;.af2;.af3;.afm;.ai;.aif;.aifc;.aiff;.aim;.ais;.akw;.alb;.all;.ams;.anc;.ani;\n  .ans;.ant;.api;.aps;.ari;.arj;.art;.asa;.asc;.asd;.ase;.asf;.asm;.aso;.asp;.asv;.asx;.atw;.au;.avb;.avi;.avr;.avs;\n  .awd;.awr;.axx;.bak;.bas;.bat;.bdf;.bgl;.bi;.bif;.biff;.bin;.bk;.bk$;.bks;.bmk;.bmp;.book;.brx;.bsp;.btm;.bud;.bun;\n  .bw;.bwv;.c;.cab;.cad;.cal;.cap;.cas;.cb;.cc;.ccb;.cch;.cco;.cct;.cda;.cdf;.cdi;.cdm;.cdr;.cdt;.cdx;.cfg;.cgi;.cgm;\n  .chk;.chm;.chr;.cif;.cil;.class;.cll;.clp;.cls;.cmf;.cmv;.cmx;.cnf;.cnm;.cnt;.cod;.com;.cpl;.cpo;.cpp;.cpr;.cpt;.cpx;\n  .crd;.crp;.crt;.csc;.csp;.cst;.csv;.ctl;.cur;.cv;.cxx;.dat;.db;.dbc;.dbf;.dbx;.dcm;.dcs;.dct;.dcu;.dcx;.dem;.der;.dewf;\n  .dib;.dic;.dif;.dig;.dir;.diz;.dlg;.dll;.dls;.dmd;.dmf;.doc;.dot;.draw;.drv;.drw;.dsf;.dsg;.dsm;.dsp;.dsq;.dsw;.dtd;\n  .dun;.dv;.dxf;.dxr;.eda;.edd;.emd;.emf;.eml;.ephtml;.eps;.exe;.fav;.fax;.fcd;.fdf;.ffa;.ffk;.ffl;.ffo;.fif;.fla;.flc;\n  .fm;.fml;.fng;.fnk;.fon;.fot;.frt;.frx;.ftg;.fts;.gal;.gdb;.gdm;.gem;.gen;.getright;.gfi;.gfx;.gho;.gif;.gim;.gix;.gkh;\n  .gks;.gl;.gna;.gnt;.gnx;.gra;.grf;.grp;.hcom;.hgl;.hlp;.hpj;.hpp;.hst;.ht;.htm;.html;.htt;.htx;.icb;.icc;.icl;.icm;.ico;\n  .idd;.idf;.idq;.idx;.iff;.iges;.igf;.ilbm;.ima;.inf;.ini;.inrs;.ins;.int;.iqy;.iso;.ist;.isu;.iwc;.j62;.jar;.java;.jbf;\n  .jff;.jfif;.jif;.jmp;.jpe;.jpeg;.jpg;.js;.jsp;.jtf;.k25;.kar;.kdc;.key;.kfx;.kiz;.kkw;.kmp;.kqp;.lab;.lbm;.lbt;.lbx;.ldb;\n  .ldl;.leg;.lft;.lgo;.lha;.lib;.lin;.lis;.llx;.lnk;.log;.lst;.lu;.lyr;.lzh;.lzs;.m1v;.m3u;.mad;.maf;.mam;.map;.maq;.mar;.mat;\n  .mb1;.mbx;.mcr;.mdb;.mde;.mdl;.mdn;.mdw;.mdz;.mic;.mid;.mim;.mime;.mli;.mme;.mng;.mnu;.mod;.mov;.mp2;.mp3;.mpa;.mpe;.mpeg;\n  .mpg;.mpp;.mpr;.msg;.msi;.msn;.msp;.mst;.mtm;.nan;.nap;.ncb;.ncd;.ncf;.nff;.nft;.nil;.nist;.nls;.nlu;.ntx;.nwc;.nws;.obj;\n  .ocx;.ods;.ofn;.oft;.olb;.ole;.oogl;.opo;.p65;.pab;.part;.pas;.pbd;.pbl;.pbm;.pbr;.pcd;.pcl;.pcm;.pdd;.pdf;.pfm;.pgl;.pgm;\n  .ph;.php;.php3;.phtml;.pic;.pjt;.pjx;.pkg;.pli;.png;.pot;.ppa;.ppf;.ppm;.pps;.ppt;.prf;.prg;.prj;.prn;.prt;.psd;.psp;.pst;\n  .pwz;.qic;.qif;.qlb;.qry;.qtp;.qtx;.qw;.ra;.ram;.rar;.rdf;.reg;.rep;.res;.rft;.rgb;.rm;.rmd;.rpt;.rtf;.rul;.rvp;.s;.sav;.sbl;\n  .scc;.scf;.scp;.scr;.sct;.scx;.sdt;.sdv;.sdx;.sep;.sfd;.sfi;.sfr;.sfx;.sgi;.sgml;.shg;.shtml;.shw;.sig;.ska;.skl;.sl;.spl;\n  .sqc;.sqr;.str;.swa;.swf;.sys;.syw;.taz;.tga;.theme;.thn;.tif;.tiff;.tig;.tlb;.tmp;.tol;.tpl;.trm;.trn;.ttf;.txt;.txw;.udf;\n  .ult;.url;.use;.uwf;.vbp;.vbp;.vbw;.vbw;.vbx;.vbx;.vct;.vcx;.vda;.vda;.vir;.vir;.viv;.vqf;.vsd;.vsd;.vsl;.vsl;.vss;.vss;.vst;\n  .vst;.vsw;.vsw;.vxd;.vxd;.w3l;.wab;.wad;.wav;.wbk;.wcm;.wdb;.wfm;.wfn;.wil;.wiz;.wll;.wmf;.wow;.wp;.wpd;.wpf;.wpg;.wps;.wpt;.wr1;\n  .wrk;.wrl;.wrz;.x;.x16;.x32;.xar;.xbm;.xi;.xla;.xlb;.xlc;.xld;.xlk;.xll;.xlm;.xls;.xlt;.xlv;.xlw;.xnk;.xpm;.xwd;.xwf;.yal;.z;.zap;.zip;";
    !function (e) {
        function t(e) {
            let t = !1;
            do {
                if (void 0 === e || null === e) break;
                if ("" === e || "." === e) break;
                if (c.indexOf(e) > -1) {
                    t = !0;
                    break
                }
            } while (0);
            return t
        }

        function i(e) {
            let t = !1;
            do {
                if (void 0 === e || null === e) break;
                if ("" === e) break;
                if (e.match(/[\/\\"<>\?\*|]/)) break;
                t = !0
            } while (0);
            return t
        }

        function a(e) {
            let i = !1;
            do {
                if (void 0 === e || null === e) break;
                if ("" === e || "." === e) break;
                let n = r.TaskUtilHelper.getTaskFileType(void 0, e);
                if (n === r.TaskUtilHelper.FileExtType.Video || n === r.TaskUtilHelper.FileExtType.Music || n === r.TaskUtilHelper.FileExtType.Pic) {
                    i = !0;
                    break
                }
                i = t(e)
            } while (0);
            return i
        }

        function l(e) {
            let t = !1, o = n.parse(e);
            return t = i(o.name) && a(o.ext)
        }

        function f(e) {
            let t = {};
            do {
                if (void 0 === e || null === e) break;
                d.information("parseDynamicUrlArgs");
                let i = /([^&=?]+)=([^&]*)/g;
                for (; i.exec(e);) t[RegExp.$1] = RegExp.$2;
                d.information("parseDynamicUrlArgs ret ", t)
            } while (0);
            return t
        }

        function g(e) {
            let t = {pageFileName: void 0, args: void 0};
            do {
                if (void 0 === e || null === e) break;
                d.information("parseDynamicUrlPath"), e.match(/[\/]?([^?]*)\?([^\s]*)/) && (t.pageFileName = RegExp.$1, t.args = RegExp.$2), d.information("parseDynamicUrlPath ret", t)
            } while (0);
            return t
        }

        function p(e) {
            let t = "";
            do {
                if (void 0 === e || null === e) break;
                let i = g(e);
                if (void 0 !== i.args) {
                    let e = f(i.args);
                    for (let i in e) {
                        let n = e[i];
                        if (l(n)) {
                            t = n;
                            break
                        }
                    }
                }
                void 0 !== i.pageFileName && l(i.pageFileName) && (t = i.pageFileName)
            } while (0);
            return t
        }

        function v(e) {
            let t = [];
            do {
                if (void 0 === e || null === e) break;
                let i = p(e);
                if ("" !== i && !t.includes(i)) {
                    let e = m(i);
                    t.push(e)
                }
                let n = m(e);
                t.includes(n) || t.push(n)
            } while (0);
            return t
        }

        function m(e) {
            return u.parseFileNameFromP2spUrlPath(e)
        }

        function y(e) {
            return u.isThunderPrivateUrl(e)
        }

        function k(e) {
            return u.parseEd2kUrl(e)
        }

        function T(e) {
            return u.parseUrl(e)
        }

        e.isDownloadFileExtName = t, e.isIllegalFileName = i, e.isGoodFileExtName = a, e.isUsualFileExtName = function (e) {
            let t = !1;
            do {
                if (void 0 === e || null === e) break;
                if ("" === e || "." === e) break;
                if (a(e)) {
                    t = !0;
                    break
                }
                if (h.indexOf(e) > -1) {
                    t = !0;
                    break
                }
            } while (0);
            return t
        }, e.isGoodFileName = l, e.parseDynamicUrlArgs = f, e.parseDynamicUrlPath = g, e.parseFileNameFromDynamicUrlPath = p, e.getFileNameListFromUrlPath = v, e.getNameFromUrl = function (e) {
            let t = "index.html", i = s.ThunderHelper.getTaskTypeFromUrl(e);
            if (i === o.DownloadKernel.TaskType.P2sp) {
                let i = T(e);
                if (i) {
                    let e = v(i.fullPath);
                    e.length > 0 && (t = e[0])
                } else {
                    let i = /:\/\/.*?\[.+?\].*(\/.+)/.exec(e);
                    if (i && i[1]) {
                        let e = v(i[1]);
                        e.length > 0 && (t = e[0])
                    }
                }
            } else i === o.DownloadKernel.TaskType.Emule && (t = k(e).fileName);
            return t.replace(/[*?/\\:|<>\"]/g, "_")
        }, e.parseFileNameFromP2spUrlPath = m, e.isThunderPrivateUrl = y, e.parseThunderPrivateUrl = function (e) {
            let t = {url: e, codePage: -1};
            return y(e) && (t = u.parseThunderPrivateUrl(e)), t
        }, e.parseEd2kUrl = k, e.parseUrl = T, e.parseMagnetUrl = function (e) {
            return u.parseMagnetUrl(e)
        }, e.makeUrl = function (e) {
            return u.makeUrl(e)
        }
    }(t.ParseUrlFileNameNS || (t.ParseUrlFileNameNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        e.formatDate = function (e, t) {
            /(y+)/.test(t) && (t = t.replace(RegExp.$1, (e.getFullYear() + "").substr(4 - RegExp.$1.length)));
            let i = {
                "M+": e.getMonth() + 1,
                "d+": e.getDate(),
                "h+": e.getHours(),
                "m+": e.getMinutes(),
                "s+": e.getSeconds()
            };
            for (let e in i) {
                let n = i[e] + "";
                new RegExp(`(${e})`).test(t) && (t = t.replace(RegExp.$1, 1 === RegExp.$1.length ? n : ("00" + (n = n)).substr(n.length)))
            }
            var n;
            if (/(f+)/.test(t)) {
                let i = e.getMilliseconds() + "";
                t = t.replace(RegExp.$1, ("000" + i).substr(i.length))
            }
            return t
        }, e.formatSeconds = function (e) {
            let t = "";
            do {
                if (e <= 0) {
                    t = "00:00:00";
                    break
                }
                let i = Math.floor(e / 3600), n = Math.floor(e / 60) % 60, a = Math.floor(e % 60);
                t = i < 10 ? "0" + i + ":" : i + ":", t += n < 10 ? "0" + n + ":" : n + ":", t += a < 10 ? "0" + a : "" + a
            } while (0);
            return t
        }, e.formatSecondsCustom = function (e) {
            let t = "";
            do {
                if (e <= 0) {
                    t = "00:00:00";
                    break
                }
                let i = Math.floor(e / 3600), n = Math.floor(e / 60) % 60, a = Math.floor(e % 60);
                if (i <= 99) t = i < 10 ? "0" + i + ":" : i + ":", t += n < 10 ? "0" + n + ":" : n + ":", t += a < 10 ? "0" + a : "" + a; else {
                    let i = Math.floor(e / 86400);
                    t = `剩${i = i > 999 ? 999 : i}天`
                }
            } while (0);
            return t
        }, e.convertTimeToMinutes = function (e, t, i) {
            return 3600 * e + 60 * t + i
        }, e.convertMinuteToTime = function (e) {
            return [Math.floor(e / 3600), Math.floor(e / 60 % 60), Math.floor(e % 60)]
        }
    }(t.TimeHelperNS || (t.TimeHelperNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(18), o = i(2), r = i(34), s = i(5), l = i(6), d = i(10), u = i(13), c = i(100), h = i(0), f = i(7),
        g = i(24), p = i(38), v = i(25), m = h.default.getLogger("AdHelperNS"),
        y = l.default(o.join(__rootDir, "../bin/ThunderHelper.node"));
    a.default.defaults.headers["Content-Type"] = "application/x-www-form-urlencoded";
    const k = "1.0", T = "14", w = "1b301990901c336d84fbdd8bc8dda35c";
    !function (e) {
        let t;

        function i(e) {
            let t = "";
            do {
                if (null === e || void 0 === e) break;
                Object.keys(e).forEach(i => {
                    let n = e[i];
                    t = `${t}${i}=${n}`
                }), t = `${t}${w}`, t = r.ToolsUtilitiesAWNS.genarateMd5(t)
            } while (0);
            return t
        }

        function l() {
            return n(this, void 0, void 0, function* () {
                let e = t.unLogin;
                if (yield g.LoginHelperNS.loginHelper.isLoginedAw()) {
                    let i = yield g.LoginHelperNS.loginHelper.getAllUserInfoAw();
                    if (null === i || void 0 === i || null === i.vipList || void 0 === i.vipList || i.vipList.length <= 0) e = t.noVip; else {
                        let n = i.vipList[0], a = Number(n.isVip), o = Number(n.vasType), r = Number(n.isYear);
                        0 === a ? e = t.noVip : 3 === o ? e = 0 !== r ? t.bjN : t.bjVip : 5 === o && (e = 0 !== r ? t.cjN : t.cjVip)
                    }
                }
                return e
            })
        }

        function h(e) {
            return n(this, void 0, void 0, function* () {
                let t = "", n = {appId: T, callId: Date.now()};
                return Object.assign(n, e), n.sig = i(n), Object.keys(n).forEach(e => {
                    let i = n[e];
                    t = "" === t ? `${e}=${encodeURIComponent(i)}` : `${t}&${e}=${encodeURIComponent(i)}`
                }), t
            })
        }

        function C() {
            let e = "http://adsp.xunlei.com", t = v.default.getConfigInfo("ad", "url");
            return null !== t && void 0 !== t && "" !== t && ("/" === t.slice(t.length - 1) && (t = t.slice(0, t.length - 1)), e = t), 1 === d.ConfigNS.getValue("Ad", "AdServer", 0) && (e = "http://test.api-shoulei-ssl.xunlei.com"), e
        }

        !function (e) {
            e.unLogin = "1", e.noVip = "2", e.bjVip = "21", e.cjVip = "22", e.bjN = "23", e.cjN = "24", e.knVip = "41", e.knN = "42"
        }(t || (t = {})), e.getAdDataAw = function (e, t, i) {
            return n(this, void 0, void 0, function* () {
                let n = null;
                do {
                    let o = v.default.getConfigInfo("ad", "enable");
                    if (0 === o) {
                        m.information("获取到的配置中信息，不显示广告 enable = ", o);
                        break
                    }
                    if (null === e || void 0 === e) break;
                    let r = `${C()}/api/adp/get`, s = null, d = "";
                    d = void 0 === i || null === i || !1 === i ? "" : yield l();
                    let u = yield h({
                        devicId: y.getPeerID(),
                        identity: d,
                        isAll: 1,
                        positionId: e,
                        shownOrderId: t,
                        v: k
                    });
                    m.information("getAdDataAw:", r, u);
                    try {
                        null !== (s = yield a.default({
                            method: "post",
                            url: r,
                            data: u
                        })) && void 0 !== s && 200 === s.status && void 0 !== s.data && null !== s.data && "" !== s.data && (n = s.data)
                    } catch (e) {
                        m.information(e)
                    }
                } while (0);
                return n
            })
        }, e.getHotWordsAw = function (e = 1, t = !0) {
            return n(this, void 0, void 0, function* () {
                let t = null;
                do {
                    yield v.default.isInitedAw();
                    let i = v.default.getConfigInfo("ad", "hotwordsEnable");
                    if (0 === i) {
                        m.information("获取到的配置中信息，不显示热词 enable = ", i);
                        break
                    }
                    let n = `${C()}/api/adp/hotword`, o = null, r = yield h({count: e});
                    m.information("getHotWordsAw:", n, r);
                    try {
                        null !== (o = yield a.default({
                            method: "get",
                            url: n + "?" + r
                        })) && void 0 !== o && 200 === o.status && void 0 !== o.data && null !== o.data && "" !== o.data && (t = o.data)
                    } catch (e) {
                        m.information(e)
                    }
                } while (0);
                return t
            })
        }, e.statServer = function (e, t, o) {
            return n(this, void 0, void 0, function* () {
                do {
                    if (null === e || void 0 === e || null === t || void 0 === t || null === o || void 0 === o) break;
                    let n = {positionId: e, orderId: t, statType: o, statValue: 1}, r = [];
                    r.push(n);
                    let s = {
                        appId: T,
                        callId: Date.now(),
                        guid: y.getPeerID(),
                        identity: "",
                        items: JSON.stringify(r),
                        positionId: e,
                        v: k
                    };
                    s.sig = i(s);
                    let l = "";
                    Object.keys(s).forEach(e => {
                        let t = s[e];
                        l = "" === l ? `${e}=${encodeURIComponent(t)}` : `${l}&${e}=${encodeURIComponent(t)}`
                    });
                    let d = `${C()}/api/adp/addStat`, u = null;
                    m.information("statServer:", d, l);
                    try {
                        null !== (u = yield a.default({
                            method: "post",
                            url: d,
                            data: l
                        })) && void 0 !== u && 200 === u.status && void 0 !== u.data && null !== u.data && "" !== u.data && m.information(u.data)
                    } catch (e) {
                        m.information(e)
                    }
                } while (0)
            })
        }, e.getCurDate = function () {
            let e = "", t = new Date;
            return e = `${t.getFullYear()}${t.getMonth() + 1}${t.getDate()}`
        }, e.onConfigInitAw = function () {
            return n(this, void 0, void 0, function* () {
                return new Promise(e => {
                    d.ConfigNS.attachListener(u.NodeEventMesssageNS.eventConfigInitFinished, () => {
                        e(!0)
                    })
                })
            })
        }, e.loadScene = function (e) {
            return n(this, void 0, void 0, function* () {
                m.information("loadScene enter");
                let t = null, i = o.join(e, "index.js");
                return (yield s.FileSystemAWNS.existsAW(i)) && (t = require(i)), m.information("loadScene leave ", t), t
            })
        }, e.execute = function (e, t, i) {
            let n = 0;
            do {
                let a = t;
                if (null !== a && void 0 !== a && "" !== a || (a = i), null === a || void 0 === a || "" === a) break;
                if (e === c.AdCommonNS.OpenType.tab) {
                    f.client.callServerFunction("OpenNewTab", a).catch();
                    break
                }
                if (e === c.AdCommonNS.OpenType.app) {
                    let t = "file://";
                    if (a.indexOf(t) < 0) null !== i && void 0 !== i && "" !== i && f.client.callServerFunction("OpenNewTab", i).catch(); else {
                        let r = a.substring(t.length);
                        r = o.join(__rootDir, `../../../${r}`), n = y.shellExecute(0, "open", r, "", "", "SW_SHOW"), m.information("execute:", e, r, n), n <= 32 && null !== i && void 0 !== i && "" !== i && f.client.callServerFunction("OpenNewTab", i).catch()
                    }
                    break
                }
                if (e === c.AdCommonNS.OpenType.download) {
                    let e = [];
                    e.push(a), p.ThunderNewTask.createPreNewTaskWindow(e);
                    break
                }
                e === c.AdCommonNS.OpenType.defaultBrowser ? n = y.openURLByDefault(a) : e === c.AdCommonNS.OpenType.ieBrowser && (n = y.openURLByIEorDefault(a))
            } while (0);
            return n
        }
    }(t.AdHelperNS || (t.AdHelperNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(17), a = i(4), o = i(103), r = i(104);
    !function (e) {
        e.mainProcessContext = "main-process", e.mainRendererContext = "main-renderer", e.mainPageWebviewRendererContext = "main-page-webview-renderer", e.newTaskRendererContext = "new-task-renderer", e.preNewTaskRendererContext = "pre-new-task-renderer", e.loginRendererContext = "login-renderer";

        class t {
            constructor() {
                this.isConnected = !1, this.isOnIPCEvent = !1, this.rendererInfos = [], this.listeners = new Map, t.intervalIPCModuleMsgs = [r.CommonIPCMessage.msgIPCRendererConnect, r.CommonIPCMessage.msgIPCRendererDisconnect]
            }

            onMessage(e, t) {
                do {
                    if (!a.isString(e) || 0 === e.length) {
                        o.error("msgName is null");
                        break
                    }
                    if (a.isNullOrUndefined(t)) {
                        o.error("listener is null");
                        break
                    }
                    this.listeners.has(e) ? this.listeners.get(e).push(t) : this.listeners.set(e, [t])
                } while (0)
            }

            getCommunicatorInfo() {
                return this.currInfo
            }

            getAllRenderer() {
                return this.rendererInfos
            }

            getCommunicatorInfoById(e) {
                for (let t of this.rendererInfos) if (t.id === e) return t;
                return null
            }

            getCommunicatorInfoByContext(e) {
                for (let t of this.rendererInfos) if (t.context === e) return t;
                return null
            }

            startListenIPCMessage(e) {
                this.isOnIPCEvent || (this.isOnIPCEvent = !0, e && this.ListenSendToMainMsg(), this.ListenSendToRendererMsg(e))
            }

            ListenSendToMainMsg() {
                n.ipcMain.on(r.CommonIPCMessage.msgIPCSendToMain, (e, t) => {
                    let i = void 0;
                    do {
                        if (a.isNullOrUndefined(t)) {
                            o.error("msgInfo is empty");
                            break
                        }
                        if (!this.isConnected) {
                            o.warning("hasnot been connected yet");
                            break
                        }
                        let n = t.msg.name;
                        if (this.isIPCModuleIntervalMsg(n)) {
                            o.information(`IPC module interval msg : ${n}`);
                            let a = this.handleIPCModuleIntervalMsg(e.sender, t);
                            if (i = a[1], !a[0]) break;
                            o.information("need to dispatch msg:" + n)
                        }
                        a.isNullOrUndefined(i) ? i = this.NotifyListener(t) : this.NotifyListener(t)
                    } while (0);
                    a.isNullOrUndefined(i) || (e.returnValue = i), t = null
                })
            }

            ListenSendToRendererMsg(e) {
                (e ? n.ipcMain : n.ipcRenderer).on(r.CommonIPCMessage.msgIPCSendToRenderer, (t, i) => {
                    let n = void 0;
                    do {
                        if (a.isNullOrUndefined(i)) {
                            o.error("msgInfo is empty");
                            break
                        }
                        if (!this.isConnected) {
                            o.warning("hasnot been connected yet");
                            break
                        }
                        let r = i.msg.name;
                        if (this.isIPCModuleIntervalMsg(r)) {
                            o.information(`IPC module interval msg : ${r}`);
                            let e = this.handleIPCModuleIntervalMsg(t.sender, i);
                            if (n = e[1], !e[0]) break;
                            o.information("need to dispatch msg:" + r)
                        }
                        e ? (o.information("is main, handle forward msg"), this.handleForwardRendererToRendererMsg(i)) : (o.information("is renderer, handle business msg"), a.isNullOrUndefined(n) ? n = this.NotifyListener(i) : this.NotifyListener(i))
                    } while (0);
                    a.isNullOrUndefined(n) || (t.returnValue = n), i = null
                })
            }

            isIPCModuleIntervalMsg(e) {
                for (let i of t.intervalIPCModuleMsgs) if (e === i) return !0;
                return !1
            }

            handleIPCModuleIntervalMsg(e, t) {
                let i = [!1, void 0];
                do {
                    let n = t.msg.name;
                    if (n === r.CommonIPCMessage.msgIPCRendererConnect) {
                        i = [!0, this.handleRendererConnectMsg(e, t)];
                        break
                    }
                    if (n === r.CommonIPCMessage.msgIPCRendererDisconnect) {
                        i = [!0, this.handleRendererDisconnectMsg(e, t)];
                        break
                    }
                } while (0);
                return i
            }

            handleRendererConnectMsg(e, t) {
                o.verbose(e), o.verbose(t)
            }

            handleRendererDisconnectMsg(e, t) {
                o.verbose(e), o.verbose(t)
            }

            handleForwardRendererToRendererMsg(e) {
                this.sendForwardRendererToRendererMsg(e)
            }

            sendForwardRendererToRendererMsg(e) {
                o.verbose(e)
            }

            NotifyListener(e) {
                let t = void 0, i = e.msg.name;
                if (this.listeners.has(i)) {
                    let n = this.listeners.get(i), a = !0;
                    for (let i of n) a ? (a = !1, t = i(e)) : i(e)
                }
                return t
            }
        }

        e.Communicator = t
    }(t.CommonIPCBase || (t.CommonIPCBase = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(7), o = i(0), r = i(34), s = i(4), l = o.default.getLogger("FetchRes"), d = {
        mock: "http://easy-mock.com/mock/59f0652c1bd72e7a888988ab/sl",
        test: "http://test.api-shoulei-ssl.xunlei.com",
        prod: "http://api-shoulei-ssl.xunlei.com"
    };

    function u(e) {
        return (e = (e = encodeURIComponent(e)).replace(/\(/g, "%29")).replace(/\)/g, "%28")
    }

    function c({url: e, data: t, method: o = "get"}, d = "prod") {
        return n(this, arguments, void 0, function* () {
            l.information("fetchFromApiProxy", arguments);
            try {
                const n = yield Promise.all([a.client.callServerFunction("GetUserID"), a.client.callServerFunction("GetSessionID"), a.client.callServerFunction("GetPeerID")]), [c, h, f] = n;
                l.information(n);
                let g = {
                    _h: Object.assign({
                        "Account-Id": c,
                        "Peer-Id": f,
                        "User-Id": c,
                        "Session-Id": h,
                        "App-Type": "pc_xunlei"
                    }, t && t._h || {})
                };
                t && t._h && delete t._h;
                let p = {
                    accesskey: "pc.xunlei",
                    nonce: Math.floor(99999999 * Math.random()).toString(),
                    timestamp: Math.floor((new Date).getTime() / 1e3).toString()
                }, v = {};
                "get" === o && t && (v = t, t = null);
                for (let e in v) s.isObject(v[e]) || (p[e] = v[e]);
                let m = [];
                for (let e in p) m.push(u(e) + "%3D" + u(p[e]));
                m.sort();
                let y = u(e), k = o.toUpperCase() + "&" + y + "&", T = "";
                for (let e = 0; e < m.length - 1; ++e) T += m[e] + "%26";
                let w, C = k + (T += m[m.length - 1]);
                !t || "post" !== o && "put" !== o || (C += "%26" + JSON.stringify(t)), l.information("message: ", C), w = "test" === d ? "c9879c94a55474304cca0abafb867653" : "89917368930f3fea5bafebe704d6b623";
                let S = r.ToolsUtilitiesAWNS.encryptHmacBuffer("sha1", w, C, "base64");
                S = (S = S.replace(/\+/g, "-")).replace(/\//g, "_");
                let b = e + "?";
                for (let e in p) b += u(e) + "=" + u(p[e]) + "&";
                b += "sig=" + S, l.information("fetchFromApiProxy method", o, ", uri", b, ", data", t, ", headers", g._h);
                const I = yield i(18);
                return I.defaults.adapter = i(21), I.defaults.headers["Content-Type"] = "post" === o ? "application/json" : "application/x-www-form-urlencoded", I.request({
                    method: o,
                    url: b,
                    data: t,
                    headers: g._h
                }).then(e => (l.information("fetchFromApiProxy success", e), e)).catch(e => (l.information("fetchFromApiProxy failed", e), {error: e}))
            } catch (e) {
                return {error: e}
            }
        })
    }

    function h({url: e, data: t, method: i = "get"}, o = "prod") {
        return n(this, void 0, void 0, function* () {
            let n = d[o], r = yield a.client.callServerFunction("GetValue", "ConfigFetchInterface", "TestServer", 0);
            return 1 === r && (n = d[o = "test"]), l.information("当前fetchSlRes 是否测试服:", r, " 远程地址:", n), c({
                url: `${n}${e}`,
                data: t,
                method: i
            }, o)
        })
    }

    t.fetchFromApiProxy = c, t.fetchSlRes = h, t.fetchPCRes = function ({url: e, data: t, method: i = "get"}, a = "prod") {
        return n(this, void 0, void 0, function* () {
            return h({url: e, data: t, method: i}, a)
        })
    }, t.fetchPCRequest = function ({url: e, data: t, method: o = "get"}, r = "prod") {
        return n(this, void 0, void 0, function* () {
            let n = d[r], s = yield a.client.callServerFunction("GetValue", "ConfigFetchInterface", "TestServer", 0);
            1 === s && (n = d[r = "test"]), l.information("当前fetchPCRequest 是否测试服:", s, " 远程地址:", n);
            let u = {_h: Object.assign({}, t && t._h || {})};
            t && t._h && delete t._h;
            const c = yield i(18);
            c.defaults.adapter = i(21), c.defaults.headers["Content-Type"] = "post" === o ? "application/json" : "application/x-www-form-urlencoded";
            try {
                return c.request({
                    method: o,
                    url: `${n}${e}`,
                    params: "get" === o && t ? t : {},
                    data: "post" === o && t ? t : {},
                    headers: u._h
                }).then(e => (l.information("fetchRequest success", e), e)).catch(e => (l.information("fetchRequest fail", e), {error: e}))
            } catch (e) {
                return {error: e}
            }
        })
    }, t.fetchRequest = function ({url: e, data: t, method: a = "get"}) {
        return n(this, arguments, void 0, function* () {
            l.information("fetchRequest", arguments);
            try {
                const n = yield i(18);
                return n.defaults.adapter = i(21), n.defaults.headers["Content-Type"] = "post" === a ? "application/json" : "application/x-www-form-urlencoded", n.request({
                    method: a,
                    url: e,
                    params: "get" === a && t ? t : {},
                    data: "post" === a && t ? t : {}
                }).then(e => (l.information("fetchRequest success", e), e)).catch(e => (l.information("fetchRequest fail", e), {error: e}))
            } catch (e) {
                return {error: e}
            }
        })
    }
}, function (e, t) {
    (function () {
        var t, i, n, a, o, r, s = [].slice, l = {}.hasOwnProperty;
        t = function () {
            var e, t, i, n, o, r;
            if (r = arguments[0], o = 2 <= arguments.length ? s.call(arguments, 1) : [], a(Object.assign)) Object.assign.apply(null, arguments); else for (e = 0, i = o.length; e < i; e++) if (null != (n = o[e])) for (t in n) l.call(n, t) && (r[t] = n[t]);
            return r
        }, a = function (e) {
            return !!e && "[object Function]" === Object.prototype.toString.call(e)
        }, o = function (e) {
            var t;
            return !!e && ("function" == (t = typeof e) || "object" === t)
        }, i = function (e) {
            return a(Array.isArray) ? Array.isArray(e) : "[object Array]" === Object.prototype.toString.call(e)
        }, n = function (e) {
            var t;
            if (i(e)) return !e.length;
            for (t in e) if (l.call(e, t)) return !1;
            return !0
        }, r = function (e) {
            var t, i;
            return o(e) && (i = Object.getPrototypeOf(e)) && (t = i.constructor) && "function" == typeof t && t instanceof t && Function.prototype.toString.call(t) === Function.prototype.toString.call(Object)
        }, e.exports.assign = t, e.exports.isFunction = a, e.exports.isObject = o, e.exports.isArray = i, e.exports.isEmpty = n, e.exports.isPlainObject = r
    }).call(this)
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(92), r = i(125), s = i(311), l = i(0), d = i(4), u = i(26), c = i(32), h = i(23), f = i(12),
        g = i(25), p = i(9), v = i(44), m = i(6), y = l.default.getLogger("Thunder.MainRenderer.TabsBrowser"),
        k = m.default(a.join(__rootDir, "../bin/ThunderHelper.node"));
    let T = [".xunlei.com", "h5-pccloud.onethingpcs.com"];
    var w;
    !function (e) {
        e[e.XDAS = 0] = "XDAS", e[e.Chromium = 1] = "Chromium", e[e.IE = 2] = "IE", e[e.Other = 3] = "Other"
    }(w = t.TabType || (t.TabType = {}));

    class C extends c.NativeCall {
        constructor() {
            super(), this.canGoForward = !1, this.canGoBack = !1, this.url = "", this.curUrl = "", this.iconUrl = "", this.originalUrl = "", this.isErrorPage = !1, this.isLoadingPage = !0, this.hideUI = !1, this.state = "loading", this.pinned = !1, y.information("tab construct"), this.beforeCloseExtra = null, y.information("init beforeClose null", this.beforeCloseExtra)
        }

        initTab(e, t, i) {
            return n(this, void 0, void 0, function* () {
                let n = !1;
                do {
                    if (d.isNullOrUndefined(e)) {
                        y.error(e);
                        break
                    }
                    this.type = e, this.originalUrl = t.url, this.curUrl = t.url || "", this.name = t.name, this.index = t.index, this.showUrl = !("showUrl" in t) || t.showUrl, this.hideUI = "hideUI" in t && t.hideUI, this.hideUI && (this.showUrl = !1), void 0 !== t.pinned && "boolean" == typeof t.pinned && (this.pinned = t.pinned), e === w.XDAS ? n = this.xdasTabInit(t) : e === w.Chromium ? n = yield this.chromiumTabInit(t, i) : e === w.IE && (n = this.ieTabInit(t))
                } while (0);
                return n
            })
        }

        navigate(e) {
            let t = !1;
            do {
                if (this.type !== w.Chromium) {
                    y.error(this.type);
                    break
                }
                if (d.isNullOrUndefined(this.browser)) {
                    y.error(this.browser);
                    break
                }
                this.browser.navigate(e, "", "", !1), this.isDefaultTab() || this.setShowUrl(!0), t = !0
            } while (0);
            return t
        }

        refresh(e) {
            do {
                if (this.type !== w.Chromium) {
                    y.error(this.type);
                    break
                }
                if (d.isNullOrUndefined(this.browser)) {
                    y.error(this.browser);
                    break
                }
                if (d.isNullOrUndefined(e)) {
                    y.error(e);
                    break
                }
                this.state = "loading", this.browser.refresh()
            } while (0);
            return !1
        }

        stop() {
            do {
                if (this.type !== w.Chromium) {
                    y.error(this.type);
                    break
                }
                if (d.isNullOrUndefined(this.browser)) {
                    y.error(this.browser);
                    break
                }
                this.browser.stop()
            } while (0);
            return !1
        }

        goForward() {
            do {
                if (this.type !== w.Chromium) {
                    y.error(this.type);
                    break
                }
                if (d.isNullOrUndefined(this.browser)) {
                    y.error(this.browser);
                    break
                }
                this.browser.goForward()
            } while (0);
            return !1
        }

        goBack() {
            do {
                if (this.type !== w.Chromium) {
                    y.error(this.type);
                    break
                }
                if (d.isNullOrUndefined(this.browser)) {
                    y.error(this.browser);
                    break
                }
                this.browser.goBack()
            } while (0);
            return !1
        }

        showDevTool(e) {
            do {
                if (this.type !== w.Chromium) {
                    y.error(this.type);
                    break
                }
                if (d.isNullOrUndefined(this.browser)) {
                    y.error(this.browser);
                    break
                }
                if (d.isNullOrUndefined(e)) {
                    y.error(e);
                    break
                }
                this.browser.showDevTool(e)
            } while (0);
            return !1
        }

        destroyBrowser(e) {
            do {
                if (this.type !== w.Chromium) {
                    y.error(this.type);
                    break
                }
                if (d.isNullOrUndefined(this.browser)) {
                    y.error(this.browser);
                    break
                }
                if (d.isNullOrUndefined(e)) {
                    y.error(e);
                    break
                }
                this.browser.destroy(e), this.browser.removeAllListeners()
            } while (0);
            return !1
        }

        viewSource() {
            do {
                if (this.type !== w.Chromium) break;
                if (d.isNullOrUndefined(this.browser)) {
                    y.error(this.browser);
                    break
                }
                this.browser.viewSource()
            } while (0);
            return !1
        }

        attachListener(e) {
            do {
                if (this.type !== w.Chromium) break;
                if (d.isNullOrUndefined(this.browser)) {
                    y.error(this.browser);
                    break
                }
                if (d.isNullOrUndefined(e) || d.isNullOrUndefined(e.eventName) || d.isNullOrUndefined(e.listener)) {
                    y.error(e);
                    break
                }
                let t = [{eventName: e.eventName, listener: e.listener}];
                this.attachBrowserEvents(this.browser, t)
            } while (0);
            return 0
        }

        detachListener(e) {
            let t = !1;
            do {
                if (d.isNullOrUndefined(e)) {
                    y.error(e);
                    break
                }
                if (d.isNullOrUndefined(e.eventName) || "" === e.eventName) {
                    y.error(e.eventName);
                    break
                }
                if (d.isNullOrUndefined(this.browser)) {
                    y.error(this.browser);
                    break
                }
                if (this.type !== w.Chromium) break;
                this.browser.removeListener(e.eventName, e.listener), t = !0
            } while (0);
            return t
        }

        getTabType() {
            return this.type
        }

        getTitle() {
            return this.title
        }

        getOriginalUrl() {
            return this.originalUrl
        }

        getPinned() {
            return this.pinned
        }

        getBeforeCloseExtra() {
            return this.beforeCloseExtra
        }

        setBeforeCloseExtra(e) {
            this.beforeCloseExtra = e
        }

        getCurUrl() {
            return this.curUrl
        }

        setTitle(e) {
            return !d.isNullOrUndefined(e) && (this.title = e, !0)
        }

        setIconUrl(e) {
            return !d.isNullOrUndefined(e) && (this.iconUrl = e, !0)
        }

        setCurUrl(e) {
            return !d.isNullOrUndefined(e) && (this.curUrl = e, !0)
        }

        getBrowser() {
            return this.browser
        }

        attachListeners(e) {
            do {
                if (d.isNullOrUndefined(this.browser)) {
                    y.error(this.browser);
                    break
                }
                this.type === w.Chromium && this.attachBrowserEvents(this.browser, e)
            } while (0)
        }

        callNativeFunctionCallback(e, t, ...i) {
            let n = !1;
            do {
                if (d.isNullOrUndefined(t)) {
                    y.error(t);
                    break
                }
                if (i && [1, 2, 3, 4].includes(i[0])) {
                    let e = null === g.default.getJsonData() ? 1 : 0;
                    p.XLStatNS.trackEvent("business", "native_Interface_invoke_fail", "", 0, 0, 0, 0, `err_code=${i[0]},config_empty=${e}`)
                }
                if (this.type === w.XDAS) {
                    if (d.isNullOrUndefined(u.NativeCallHostModule.nativeCallHost)) {
                        y.error(u.NativeCallHostModule.nativeCallHost);
                        break
                    }
                    u.NativeCallHostModule.nativeCallHost.callJsFunctionById.apply(u.NativeCallHostModule.nativeCallHost, [e].concat(t, i)), n = !0
                } else if (this.type === w.Chromium) {
                    if (d.isNullOrUndefined(this.browser)) {
                        y.error(this.browser);
                        break
                    }
                    this.browser.callJsFunctionById(t, ...i), n = !0
                }
            } while (0);
            return n
        }

        callJSFunction(e, t, ...i) {
            let n = !1;
            do {
                if (d.isNullOrUndefined(t) || "" === t) {
                    y.error(t);
                    break
                }
                if (this.type === w.XDAS) {
                    if (d.isNullOrUndefined(u.NativeCallHostModule.nativeCallHost)) {
                        y.error(u.NativeCallHostModule.nativeCallHost);
                        break
                    }
                    u.NativeCallHostModule.nativeCallHost.callJsFunctionByName(e, t, i), n = !0
                } else if (this.type === w.Chromium) {
                    if (d.isNullOrUndefined(this.browser)) {
                        y.error(this.browser);
                        break
                    }
                    this.browser.callJsFunctionByName(t, ...i), n = !0
                }
            } while (0);
            return n
        }

        fireEvent(e, ...t) {
            let i = !1;
            do {
                if (d.isNullOrUndefined(e) || "" === e) {
                    y.error(e);
                    break
                }
                if (this.type === w.XDAS) {
                    if (d.isNullOrUndefined(u.NativeCallHostModule.nativeCallHost)) {
                        y.error(u.NativeCallHostModule.nativeCallHost);
                        break
                    }
                    u.NativeCallHostModule.nativeCallHost.fireNativeEvent.apply(u.NativeCallHostModule.nativeCallHost, [e].concat(t)), i = !0
                } else if (this.type === w.Chromium) {
                    if (d.isNullOrUndefined(this.browser)) {
                        y.error(this.browser);
                        break
                    }
                    this.browser.fireEvent(e, t), i = !0
                }
            } while (0);
            return i
        }

        onJsCallNativeFunction(e, t, i, n) {
            let a = !1;
            do {
                if (d.isNullOrUndefined(e) && y.error(e), d.isNullOrUndefined(t) || "" === t) {
                    y.error(t);
                    break
                }
                if (d.isNullOrUndefined(c.NativeCall.nativeFunctionContainer)) {
                    y.error(c.NativeCall.nativeFunctionContainer);
                    break
                }
                let o = c.NativeCall.nativeFunctionContainer.filter(e => t === e.functionName), r = void 0,
                    s = h.NativeFunctionErrorCode.Success, l = this.browser && n && n.length > 0 ? n[0] : void 0;
                y.information("frameurl", l, t, ...n), this.browser && (n = n && n.length > 0 ? n.slice(1) : n), y.information("curUrl:", this.curUrl);
                let f = g.default.getConfigInfo("nativeFunc", "domains") || T,
                    p = this.isUrlInDomains(this.curUrl, f, l);
                if (!p) {
                    let e = g.default.getConfigInfo("nativeFunc", "limitDomains");
                    if (e) for (let i = 0; i < e.length; ++i) {
                        let n = e[i];
                        if (n && n.domains && n.funcs && n.funcs.includes(t) && (p = this.isUrlInDomains(this.curUrl, n.domains, l))) break
                    }
                }
                if (!p && !d.isNullOrUndefined(this.browser) && this.type === w.Chromium) {
                    s = h.NativeFunctionErrorCode.NotAllowed, this.browser.callJsFunctionById(i, s);
                    break
                }
                if (d.isNullOrUndefined(o) || 0 === o.length || d.isNullOrUndefined(o[0].nativeFunc)) {
                    if (s = h.NativeFunctionErrorCode.FunctionUnExist, d.isNullOrUndefined(i)) {
                        a = !0;
                        break
                    }
                    if (this.type === w.XDAS) {
                        if (d.isNullOrUndefined(u.NativeCallHostModule.nativeCallHost)) {
                            y.error(u.NativeCallHostModule.nativeCallHost);
                            break
                        }
                        u.NativeCallHostModule.nativeCallHost.callJsFunctionById.apply(u.NativeCallHostModule.nativeCallHost, [e].concat(i, s, r))
                    } else if (this.type === w.Chromium) {
                        if (d.isNullOrUndefined(this.browser)) {
                            y.error(this.browser);
                            break
                        }
                        this.browser.callJsFunctionById(i, s)
                    }
                } else o[0].nativeFunc(this, e, i, n)
            } while (0);
            return a
        }

        onJsCheckNativeFunction(e, t, i) {
            do {
                if (d.isNullOrUndefined(e) && y.error(e), d.isNullOrUndefined(i)) break;
                if (d.isNullOrUndefined(t) || "" === t) {
                    y.error(t);
                    break
                }
                if (d.isNullOrUndefined(c.NativeCall.nativeFunctionContainer)) {
                    y.error(c.NativeCall.nativeFunctionContainer);
                    break
                }
                let n = c.NativeCall.nativeFunctionContainer.filter(e => t === e.functionName),
                    a = h.NativeFunctionErrorCode.Success;
                if ((d.isNullOrUndefined(n) || d.isNullOrUndefined(n[0]) || d.isNullOrUndefined(n[0].nativeFunc)) && (a = h.NativeFunctionErrorCode.FunctionUnExist, y.error(n)), this.type === w.XDAS) {
                    if (d.isNullOrUndefined(u.NativeCallHostModule.nativeCallHost)) {
                        y.error(u.NativeCallHostModule.nativeCallHost);
                        break
                    }
                    u.NativeCallHostModule.nativeCallHost.callJsFunctionById(e, i, a)
                } else if (this.type === w.Chromium) {
                    if (d.isNullOrUndefined(this.browser)) {
                        y.error(this.browser);
                        break
                    }
                    this.browser.callJsFunctionById(i, a)
                }
            } while (0);
            return !1
        }

        isDefaultTab() {
            return this.url.split("#")[0] === C.defaultBrowserUrl
        }

        setShowUrl(e) {
            this.showUrl = e
        }

        xdasTabInit(e) {
            return d.isNullOrUndefined(e) && (e = {}), void 0 === e.title ? this.title = C.defaultXDASTitle : this.title = e.title, this.state = "loaded", this.isLoadingPage = !1, !0
        }

        trackBrowserEvent(e, t, i = "") {
            do {
                if (!t || "" === t) break;
                let n = v.parse(t);
                if (n.host && n.host.indexOf(".xunlei.com") < 0) break;
                i = i + (i.length > 0 ? "," : "") + "url=" + encodeURIComponent(t), p.XLStatNS.trackEvent("new_tab", e, "", 0, 0, 0, 0, i)
            } while (0)
        }

        chromiumTabInit(e, t) {
            return n(this, void 0, void 0, function* () {
                let i = !1;
                if (this.browser) return !0;
                d.isNullOrUndefined(e) && (e = {});
                do {
                    d.isNullOrUndefined(e.url) && (e.url = C.defaultBrowserUrl, this.curUrl = e.url), r.BrowserSupportNS.browserIsInitFinish() || (this.trackBrowserEvent("browser_load_init", e.url), yield r.BrowserSupportNS.initTBC()), void 0 === e.title ? this.title = C.defaultBrowserTitle : this.title = e.title, void 0 === e.isFromPopup && (e.isFromPopup = !1), void 0 === e.eventListeners ? e.eventListeners = C.defaultEventList : e.eventListeners = e.eventListeners.concat(C.defaultEventList);
                    let n = yield f.asyncRemoteCall.getCurrentWindow();
                    if (void 0 === e.parentHwnd) if (e.isFromPopup) e.parentHwnd = t.target.getParentWindowHandle(); else {
                        let t = (yield n.getNativeWindowHandle()).readUIntLE(0, 4);
                        e.parentHwnd = t
                    }
                    void 0 === e.rect && (e.rect = yield s.BrowserWindowNS.getBrowserWindowPosition(k, n)), y.information("stroe chromiumTabInit param", e), this.trackBrowserEvent("browser_load_create", e.url);
                    let a = new o.Browser;
                    if (a.init({
                        rect: e.rect,
                        parent_window: e.parentHwnd,
                        is_popup: e.isFromPopup,
                        url: e.url,
                        visible: !(!1 === e.visible)
                    }), d.isNullOrUndefined(a)) {
                        y.error(a);
                        break
                    }
                    e.isFromPopup && t && (t.returnValue = a), this.browser = a, a.addCustomProtocol("ed2k://"), a.addCustomProtocol("thunder://"), a.addCustomProtocol("magnet:?"), a.registerHotKey(116, 4), a.registerHotKey(116, 0), a.registerHotKey(84, 4), a.registerHotKey(82, 4), a.registerHotKey(87, 4), this.attachBrowserEvents(a, e.eventListeners), i = !0
                } while (0);
                return i
            })
        }

        attachBrowserEvents(e, t) {
            do {
                if (d.isNullOrUndefined(e)) {
                    y.error(e);
                    break
                }
                if (this.type === w.Chromium) for (let i of t) if (!(d.isNullOrUndefined(i) || d.isNullOrUndefined(i.eventName) || d.isNullOrUndefined(i.listener))) switch (i.eventName) {
                    case"init-done":
                        e.on("init-done", i.listener);
                        break;
                    case"before-nav":
                        e.on("before-nav", i.listener);
                        break;
                    case"title-change":
                        e.on("title-change", i.listener);
                        break;
                    case"favicon-url-change":
                        e.on("favicon-url-change", i.listener);
                        break;
                    case"address-change":
                        e.on("address-change", i.listener);
                        break;
                    case"new-browser-popup":
                        e.on("new-browser-popup", i.listener);
                        break;
                    case"open-url-from-tab":
                        e.on("open-url-from-tab", i.listener);
                        break;
                    case"close":
                        e.on("close", i.listener);
                        break;
                    case"loading-state-change":
                        e.on("loading-state-change", i.listener);
                        break;
                    case"load-start":
                        e.on("load-start", i.listener);
                        break;
                    case"load-end":
                        e.on("load-end", i.listener);
                        break;
                    case"load-error":
                        e.on("load-error", i.listener);
                        break;
                    case"destroyed":
                        e.on("destroyed", i.listener);
                        break;
                    case"custom-protocol-execution":
                        e.on("custom-protocol-execution", i.listener);
                        break;
                    case"before-download":
                        e.on("before-download", i.listener);
                        break;
                    case"before-context-menu":
                        e.on("before-context-menu", i.listener);
                        break;
                    case"context-menu-command":
                        e.on("context-menu-command", i.listener);
                        break;
                    case"got-focus":
                        e.on("got-focus", i.listener);
                        break;
                    case"hotkey":
                        e.on("hotkey", i.listener);
                        break;
                    case"call-native-func":
                        e.on("call-native-func", i.listener);
                        break;
                    case"check-native-func":
                        e.on("check-native-func", i.listener)
                }
            } while (0)
        }

        ieTabInit(e) {
            return void 0 === e.title ? this.title = C.defaultBrowserTitle : this.title = e.title, !0
        }

        isUrlInDomains(e, t, i) {
            let n = !1;
            for (let a = 0; a < t.length; ++a) if (e.includes(t[a]) || i && i.includes(t[a])) {
                n = !0;
                break
            }
            return n
        }
    }

    C.defaultXDASTitle = "下载", C.defaultBrowserTitle = "正在加载...", C.defaultBrowserUrl = "http://misc.xl9.xunlei.com/chrome/client/view/dist/1.0/new_tab.html", C.defaultEventList = [], C.tempBrowser = null, t.Tab = C
}, function (e, t, i) {
    e.exports = i(56)(25)
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(65), o = i(22), r = i(7), s = i(70), l = i(0).default.getLogger("ThunderBirdKey");
    var d;
    !function (e) {
        e[e.ShowUI_Decoding = 0] = "ShowUI_Decoding", e[e.ShowUI_Creating = 1] = "ShowUI_Creating", e[e.ShowUI_DecodeFailed = 2] = "ShowUI_DecodeFailed", e[e.ShowUI_CreateFailed = 3] = "ShowUI_CreateFailed", e[e.ShowUI_CreateSucc = 4] = "ShowUI_CreateSucc", e[e.ShowUI_CreateSuccDis = 5] = "ShowUI_CreateSuccDis"
    }(d = t.ShowType || (t.ShowType = {}));

    class u {
        constructor() {
            this.lastBirdKey = []
        }

        static GetInstance() {
            return u.instance || (u.instance = new u), u.instance
        }

        setLastBirdKey(e) {
            if (e && 0 !== e.length) {
                this.lastBirdKey = [];
                for (let t = 0; t < e.length; t++) this.lastBirdKey.push(e[t])
            }
        }

        getLastBirdKey() {
            return this.lastBirdKey
        }

        isSameBirdKey(e) {
            if (!this.lastBirdKey) return !1;
            if (e.length !== this.lastBirdKey.length) return !1;
            let t = 0;
            for (let i = 0; i < e.length; i++) e[i] === this.lastBirdKey[i] && t++;
            return t === e.length
        }
    }

    function c(e, t, i, n) {
        let o = {url: "/dlj_create", data: {url: e, "Chat-Version": 2, type: i}, method: "post"};
        return "string" == typeof i && (o.data.type = i), t && (o.data.uid = t), "string" == typeof n && (o.data.passwd = n), a.fetchSlRes(o)
    }

    function h(e, t) {
        return c(e, t)
    }

    u.instance = null, t.encodeBirdKey = c, t.setBirdKeyPriority = function (e, t, i = !1) {
        return a.fetchSlRes({url: "/dlj/option", data: {url: e, priority: i, "Chat-Version": 2}, method: "put"})
    }, t.queryBirdKeyInfo = h, t.getUserNameByID = function (e) {
        return a.fetchSlRes({url: "/user_info/pc_info", data: {uid: e}})
    }, t.decodeBirdKey = function (e) {
        return n(this, void 0, void 0, function* () {
            let t = yield r.client.callServerFunction("GetThunderVersion");
            return a.fetchSlRes({
                url: "/dlj/bird_key",
                data: {_h: {"Chat-Version": 2, "Version-Name": t}, key: e.toLowerCase()},
                method: "get"
            })
        })
    }, t.openBirdKeyEncodeDialog = function (e, t) {
        return n(this, void 0, void 0, function* () {
            let i = function (e, t) {
                l.information("弹出生成迅雷口令面板,begin,url=", e), o.MessageBox.custom("BirdKeyShow", {
                    showType: d.ShowUI_Creating,
                    url: e,
                    statData: t
                }, {modal: !1}).catch(e => {
                    l.information("弹出生成迅雷口令面板,error=", e)
                }), l.information("弹出生成迅雷口令面板,end")
            };
            l.information("调用promise IsLogined 函数 Begin");
            let a = yield r.client.callServerFunction("IsLogined");
            l.information("调用promise IsLogined 函数 End, isLogined=", a), a ? i(e, t) : h(e).then(a => n(this, void 0, void 0, function* () {
                if ("object" != typeof a) return Promise.resolve();
                if (!a.data) return Promise.resolve();
                if ("encrypted" === a.data.type) {
                    let n = yield s.default(!1, !0, "birdkey");
                    if (!n || "" === n) return;
                    i(e, t)
                } else i(e, t);
                return Promise.resolve()
            })).catch(e => {
                l.information("调用queryBirdKeyInfo 接口异常 error=", e)
            })
        })
    }, t.openBirdKeyDecodeDialog = function (e, t, i) {
        o.MessageBox.custom("BirdKeyShow", {
            showType: d.ShowUI_Decoding,
            birdkeyChars: e,
            statData: t,
            helperobj: i
        }, {modal: !1}).catch()
    }, t.saveVestUrlToConfig = function (e, t) {
        let i = t ? "vestURL" : "commonUrl";
        r.client.callServerFunction("GetValue", "BirdKeyVest", i, []).then(t => {
            let n = t || [];
            "" !== e && -1 === n.join().indexOf(e) && (n.push(e), r.client.callServerFunction("SetValue", "BirdKeyVest", i, n).catch())
        }).catch()
    }, t.isVestUrl = function (e, t) {
        return n(this, void 0, void 0, function* () {
            let i = yield r.client.callServerFunction("GetValue", "BirdKeyVest", t, []);
            return "" !== e && -1 !== (i || []).join().indexOf(e)
        })
    }, t.getBirdKeyMgr = function () {
        return u.GetInstance()
    }
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(0), o = i(7), r = i(16), s = a.default.getLogger("Thunder.ShouldLogin");
    t.default = function (e = !1, t = !1, i) {
        return n(this, void 0, void 0, function* () {
            let n, a = null;
            try {
                let l = yield o.client.callServerFunction("IsLogined"),
                    d = yield o.client.callServerFunction("GetUserID");
                l ? (s.information("is logined"), n = Promise.resolve(d)) : (n = new Promise((i, n) => {
                    let o = -1;
                    if (o = r.NativeCallModule.nativeCall.AttachNativeEvent("OnUserLogin", e => {
                        let t = Date.now();
                        s.information("On UserLogin", e, t, a), a && Math.floor(t - a) > 3e5 ? i("") : i(e), -1 !== o && (r.NativeCallModule.nativeCall.DetachNativeEvent("OnUserLogin", o), o = -1)
                    }), !e) {
                        let e = r.NativeCallModule.nativeCall.AttachNativeEvent("OnLoginWndClose", n => {
                            do {
                                if ("close" === n) {
                                    if (i(""), !t && -1 !== o) {
                                        r.NativeCallModule.nativeCall.DetachNativeEvent("OnUserLogin", o), o = -1;
                                        break
                                    }
                                } else if ("suc" === n && -1 !== o) break;
                                t && -1 !== o && (r.NativeCallModule.nativeCall.DetachNativeEvent("OnUserLogin", o), o = -1)
                            } while (0);
                            r.NativeCallModule.nativeCall.DetachNativeEvent("OnLoginWndClose", e)
                        })
                    }
                }), e || (a = Date.now(), o.client.callServerFunction("ShowLoginDlg", i).catch(e => {
                    s.warning(e)
                })))
            } catch (e) {
                s.warning(e), n = Promise.resolve("")
            }
            return n
        })
    }
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(20), r = i(17), s = i(64), l = i(0), d = i(6), u = i(26), c = i(38), h = i(11), f = i(10),
        g = i(54), p = i(7), v = i(79), m = i(12), y = h.DownloadKernelTaskManager.getTaskManager(),
        k = l.default.getLogger("ThunderMain[clientProcess] [CrossProduct] "),
        T = d.default(a.join(__rootDir, "../bin/ThunderHelper.node"));
    t.clientProduct = new class {
        constructor() {
            this.mainhwnd = 0, this.keepPosition = !1, this.autoMini = !0, this.xmpMode = g.XMPShowMode.UNKNOWN_MODE, this.playSoure = g.XmpPlaySoure.PLAY_UNKNOWN, this.currentPanel = "download-panel"
        }

        init() {
            o.server.registerFunctions({
                setChildPosition: this.setChildPosition.bind(this),
                getXmpPosByEmbedMode: this.getXmpPosByEmbedMode.bind(this),
                setBindChildWindow: this.setBindChildWindow.bind(this),
                setKeepPosition: this.setKeepPosition.bind(this),
                setXmpShowMode: this.setXmpShowMode.bind(this),
                addXmpVideoTipPos: this.addXmpVideoTipPos.bind(this),
                removeXmpVideoTipPos: this.removeXmpVideoTipPos.bind(this),
                setThunderConfig: this.setThunderConfig.bind(this),
                setChildFloatHwnd: this.setChildFloatHwnd.bind(this),
                setChildCtrlHwnd: this.setChildCtrlHwnd.bind(this),
                setChildTopHwnd: this.setChildTopHwnd.bind(this),
                setShadowHwnd: this.setShadowHwnd.bind(this),
                getThunderHwnd: this.getThunderHwnd.bind(this),
                getPlayTaskDetailShow: this.getPlayTaskDetailShow.bind(this),
                xmpPositionChange: this.xmpPositionChange.bind(this),
                getTaskExistFromTaskId: this.getTaskExistFromTaskId.bind(this),
                getRationInfos: this.getRationInfos.bind(this),
                curTaskChange: this.curTaskChange.bind(this),
                openSucceeded: this.openSucceeded.bind(this),
                updatePosition: this.updatePosition.bind(this),
                updateXmpState: this.updateXmpState.bind(this),
                getCanShowWindow: this.getCanShowWindow.bind(this)
            });
            let e = r.remote.getCurrentWindow().getNativeWindowHandle();
            this.mainhwnd = e.readUInt32LE(0), p.client.attachServerEvent("OnCurNavChange", (e, t, i) => {
                this.currentPanel = t, o.server.fireClientEvent("OnNavSelectChange", t, this.curTaskId, this.playTaskId, this.playSoure)
            }), p.client.attachServerEvent("OnLogout", () => n(this, void 0, void 0, function* () {
                k.information("OnLogout"), this.playTaskId && this.playSoure === g.XmpPlaySoure.PLAY_BY_PAN && (yield p.client.callServerFunction("NotifyXmpQuit"))
            })), p.client.attachServerEvent("OnXmpDisConnected", () => n(this, void 0, void 0, function* () {
                yield this.updateXmpStateEx(g.XmpEvent.onXmpQuit)
            })), p.client.attachServerEvent("OnHomeTabChange", (e, t, i) => {
                this.currentActiveKey = t
            }), window.addEventListener("resize", () => {
                this.fireRectUpdate()
            })
        }

        curTaskChange(e, t, ...i) {
            return n(this, void 0, void 0, function* () {
                yield this.onCurTaskChange(i[0])
            })
        }

        openSucceeded(e, t, ...i) {
            return n(this, void 0, void 0, function* () {
                let e = i[0], t = i[1];
                k.information("openSucceeded taskId", e, "panFileId", t), o.server.fireClientEvent("OnXmpOpenSucceeded", e, t)
            })
        }

        onCurTaskChange(e) {
            return n(this, void 0, void 0, function* () {
                this.curTaskId = e, k.information("cqm 当前任务变化了,taskId=", e);
                let t = f.ConfigNS.getValue("PopBox", "AutoPop", !0), i = !0;
                if (this.playSoure === g.XmpPlaySoure.PLAY_BY_DOWNLOAD && (i = "download-panel" === this.currentPanel), this.playSoure === g.XmpPlaySoure.PLAY_BY_PAN && (i = "download-panel" !== this.currentPanel), !(this.xmpMode < g.XMPShowMode.MINI_MODE)) if (this.curTaskId === this.playTaskId) if (this.xmpMode === g.XMPShowMode.MINI_MODE && this.autoMini) {
                    k.information("cqm thunder OnCurTaskChange call backUpToEmbed");
                    let e = yield this.callXMPLiteFunction("backUpToEmbed");
                    k.information("callXMPLiteFunction backUpToEmbed ret:", e)
                } else {
                    yield o.server.callClientFunctionByName(s.CommonIPCBase.mainProcessContext, "showPlayerWindow", g.CmdShow.SW_SHOW);
                    let e = yield this.callXMPLiteFunction("showFloat", !0);
                    k.information("callXMPLiteFunction showFloat ret:", e), yield o.server.callClientFunctionByName(s.CommonIPCBase.mainProcessContext, "setZorder")
                } else t && i ? (yield this.updateXmpMode(g.XMPShowMode.MINI_MODE), yield this.callXMPLiteFunction("switchToMini")) : this.xmpMode === g.XMPShowMode.MINI_MODE || (yield o.server.callClientFunctionByName(s.CommonIPCBase.mainProcessContext, "hideVideoTipWindow", g.CmdShow.SW_HIDE), yield o.server.callClientFunctionByName(s.CommonIPCBase.mainProcessContext, "showPlayerWindow", g.CmdShow.SW_HIDE))
            })
        }

        setPlayTaskId(e, t) {
            return n(this, void 0, void 0, function* () {
                k.information("cqm setPlayTaskId", e), this.playTaskId = e, this.curTaskId = e, this.playSoure = t, o.server.fireClientEvent("OnSetPlayTaskId", this.playTaskId, this.curTaskId, this.playSoure)
            })
        }

        getDpiFactor() {
            let e = 1;
            return e = T.getDPIAwareSupport() ? T.getMonitorDPIFactor(this.mainhwnd) : T.getSysDPIFactor()
        }

        isPlayTaskDetailShow() {
            return this.playTaskId && this.playTaskId === this.curTaskId
        }

        getShowMode() {
            return n(this, void 0, void 0, function* () {
                let e = yield this.getXmpShowMode(), t = g.XMPShowMode.UNKNOWN_MODE;
                return e && (t = e[0]), t
            })
        }

        updateDownloadEmbedRect(e) {
            this.downloadEmbedRect = e, o.server.callClientFunctionByName(s.CommonIPCBase.mainProcessContext, "updateDownloadEmbedRect", e).catch()
        }

        updateMiniRect(e) {
            this.miniRect = e, o.server.callClientFunctionByName(s.CommonIPCBase.mainProcessContext, "updateMiniRect", e).catch()
        }

        updatePanEmbedRect(e) {
            this.panEmbedRect = e, o.server.callClientFunctionByName(s.CommonIPCBase.mainProcessContext, "updatePanEmbedRect", e).catch()
        }

        getMiniPosition() {
            return this.miniRect
        }

        updatePlayTaskId(e) {
            return n(this, void 0, void 0, function* () {
                k.information("updatePlayTaskId", e), this.playTaskId = e.toString()
            })
        }

        onBackUpPan() {
            return n(this, void 0, void 0, function* () {
                yield p.client.callServerFunction("SelectNav", v.NavViewID.Cloud), o.server.callClientFunctionByName("ThunderPanPluginWebview", "ShowFileDetail", {
                    fileId: this.playTaskId,
                    isPlayInstantly: !1,
                    clearPickedItems: !1,
                    changeRect: !0
                }).catch()
            })
        }

        callXMPLiteFunction(e, ...t) {
            return n(this, void 0, void 0, function* () {
                let i = o.server.getRemoteClient(s.CommonIPCBase.mainRendererContext, "xmplite");
                if ("backUpToEmbed" === e) {
                    yield p.client.callServerFunction("BringMainWndToTop");
                    let e = yield m.asyncRemoteCall.getCurrentWindow();
                    (yield e.isVisible()) || (yield e.restore()), this.playSoure === g.XmpPlaySoure.PLAY_BY_PAN && (yield this.onBackUpPan()), this.playSoure === g.XmpPlaySoure.PLAY_BY_DOWNLOAD && (yield p.client.callServerFunction("SelectNav", v.NavViewID.Download))
                }
                return i ? o.server.callClientFunctionByName(i, e, ...t) : null
            })
        }

        setPositionMode(e, t) {
            return n(this, void 0, void 0, function* () {
                k.information("setPositionMode mini=", e);
                let i = yield this.callXMPLiteFunction(e ? "switchToMini" : "backUpToEmbed");
                k.information("callXMPLiteFunction ", e, i), t && "click" === t ? this.autoMini = !1 : (yield this.getShowMode()) === g.XMPShowMode.EMBED_CHILD_MODE && (this.autoMini = !0)
            })
        }

        fireRectUpdate() {
            this.eventFireTimer || (this.eventFireTimer = setTimeout(() => {
                this.eventFireTimer = void 0, o.server.fireClientEvent("onMainWindowSize")
            }, 50))
        }

        setChildPosition(e, t, ...i) {
            return n(this, void 0, void 0, function* () {
                return k.information(" [TestCall] setChildPosition enter", i), this.xmpMode === g.XMPShowMode.EMBED_CHILD_MODE && (k.information("[TestCall] setChildPosition curTaskId=", this.curTaskId, ", playTaskId=", this.playTaskId), this.curTaskId !== this.playTaskId && (yield c.ThunderNewTask.selectTask(Number(this.playTaskId))), u.NativeCallHostModule.nativeCallHost.fireNativeEvent("onBackToTop")), yield this.updateXmpPosition(), !0
            })
        }

        updatePosition(e, t, ...i) {
            return n(this, void 0, void 0, function* () {
                yield this.updateXmpPosition()
            })
        }

        updateXmpState(e, t, ...i) {
            return n(this, void 0, void 0, function* () {
                if (!i || !i[0]) return;
                let e = i[0], t = i[1], n = i[2];
                yield this.updateXmpStateEx(e, t.toString(), n)
            })
        }

        getCanShowWindow(e, t, ...i) {
            return this.getCanShowWindowEx()
        }

        getCanShowWindowEx() {
            let e = !1;
            do {
                if (this.playSoure === g.XmpPlaySoure.PLAY_BY_DOWNLOAD && "Preview" !== this.currentActiveKey) break;
                if (k.information(" curTaskId", this.curTaskId, "playTaskId", this.playTaskId), this.curTaskId !== this.playTaskId) break;
                if (this.playSoure === g.XmpPlaySoure.PLAY_BY_DOWNLOAD && "download-panel" !== this.currentPanel) break;
                if (this.playSoure === g.XmpPlaySoure.PLAY_BY_PAN && "download-panel" === this.currentPanel) break;
                e = !0
            } while (0);
            return e
        }

        updateXmpStateEx(e, t, i) {
            return n(this, void 0, void 0, function* () {
                k.information("updateXmpStateEx", e, t, i);
                let a = this.getCanShowWindowEx();
                setTimeout(() => n(this, void 0, void 0, function* () {
                    e === g.XmpEvent.onOpenSucceeded && (a ? (yield this.updateXmpPosition(), yield o.server.callClientFunctionByName(s.CommonIPCBase.mainProcessContext, "showPlayerWindow", g.CmdShow.SW_SHOW)) : this.xmpMode !== g.XMPShowMode.MINI_MODE && this.xmpMode !== g.XMPShowMode.EMBED_CHILD_MODE || (yield o.server.callClientFunctionByName(s.CommonIPCBase.mainProcessContext, "showPlayerWindow", g.CmdShow.SW_HIDE)))
                }), 800), o.server.fireClientEvent("OnXmpState", e, t, i)
            })
        }

        updateXmpPosition() {
            return n(this, void 0, void 0, function* () {
                yield o.server.callClientFunctionByName(s.CommonIPCBase.mainProcessContext, "updateXmpPostion")
            })
        }

        getXmpPosByEmbedMode(e, t, ...i) {
            return n(this, void 0, void 0, function* () {
                let e = this.getDpiFactor(), t = this.downloadEmbedRect;
                return i[0] === g.XmpPlaySoure.PLAY_BY_PAN && (t = this.panEmbedRect), t = {
                    x: t.x * e,
                    y: t.y * e,
                    width: t.width * e,
                    height: t.height * e
                }, k.information("cqm getXmpPosByEmbedMode miniRect=", this.miniRect, " dpi=", e), t
            })
        }

        getThunderHwnd(e, t, ...i) {
            return n(this, void 0, void 0, function* () {
                return this.mainhwnd
            })
        }

        getPlayTaskDetailShow(e, t, ...i) {
            return n(this, void 0, void 0, function* () {
                return this.isPlayTaskDetailShow()
            })
        }

        updateXmpMode(e, t) {
            return n(this, void 0, void 0, function* () {
                if (this.xmpMode = e, "click_backup" === t && this.xmpMode === g.XMPShowMode.EMBED_CHILD_MODE) {
                    yield p.client.callServerFunction("BringMainWndToTop");
                    let e = yield m.asyncRemoteCall.getCurrentWindow();
                    (yield e.isVisible()) || (yield e.restore()), this.playSoure === g.XmpPlaySoure.PLAY_BY_PAN && (yield this.onBackUpPan()), this.playSoure === g.XmpPlaySoure.PLAY_BY_DOWNLOAD && (yield p.client.callServerFunction("SelectNav", v.NavViewID.Download))
                }
                yield o.server.callClientFunctionByName(s.CommonIPCBase.mainProcessContext, "setXmpShowMode", e)
            })
        }

        setXmpShowMode(e, t, ...i) {
            return n(this, void 0, void 0, function* () {
                yield this.updateXmpMode(i[0], i[1])
            })
        }

        xmpPositionChange(e, t, ...i) {
            return n(this, void 0, void 0, function* () {
                yield o.server.callClientFunctionByName(s.CommonIPCBase.mainProcessContext, "onXmpPositionChange")
            })
        }

        getTaskExistFromTaskId(e, t, ...i) {
            return n(this, void 0, void 0, function* () {
                let e = !0;
                return y.getTaskFromTaskId(i[0]) || (e = !1), e
            })
        }

        getRationInfos(e, t, ...i) {
            return n(this, void 0, void 0, function* () {
                return p.client.callServerFunction("GetPanRationInfos", i[0])
            })
        }

        getXmpShowMode() {
            return n(this, void 0, void 0, function* () {
                return o.server.callClientFunctionByName(s.CommonIPCBase.mainProcessContext, "getXmpShowMode")
            })
        }

        setBindChildWindow(e, t, ...i) {
            return n(this, void 0, void 0, function* () {
                this.hwndChild = i[0], yield o.server.callClientFunctionByName(s.CommonIPCBase.mainProcessContext, "setBindChildHwnd", i[0])
            })
        }

        setChildFloatHwnd(e, t, ...i) {
            return n(this, void 0, void 0, function* () {
                yield o.server.callClientFunctionByName(s.CommonIPCBase.mainProcessContext, "setFloatChildHwnd", i[0])
            })
        }

        setChildCtrlHwnd(e, t, ...i) {
            return n(this, void 0, void 0, function* () {
                yield o.server.callClientFunctionByName(s.CommonIPCBase.mainProcessContext, "setCtrlChildHwnd", i[0])
            })
        }

        setChildTopHwnd(e, t, ...i) {
            return n(this, void 0, void 0, function* () {
                yield o.server.callClientFunctionByName(s.CommonIPCBase.mainProcessContext, "setTopChildHwnd", i[0])
            })
        }

        setShadowHwnd(e, t, ...i) {
            return n(this, void 0, void 0, function* () {
                yield o.server.callClientFunctionByName(s.CommonIPCBase.mainProcessContext, "setShadowHwnd", i[0])
            })
        }

        setKeepPosition(e, t, ...i) {
            return n(this, void 0, void 0, function* () {
                this.keepPosition = i[0], yield o.server.callClientFunctionByName(s.CommonIPCBase.mainProcessContext, "setKeepPosition", this.keepPosition)
            })
        }

        addXmpVideoTipPos(e, t, ...i) {
            return n(this, void 0, void 0, function* () {
                yield o.server.callClientFunctionByName(s.CommonIPCBase.mainProcessContext, "addXmpVideoTipPos", i[0], i[1])
            })
        }

        removeXmpVideoTipPos(e, t, ...i) {
            return n(this, void 0, void 0, function* () {
                yield o.server.callClientFunctionByName(s.CommonIPCBase.mainProcessContext, "removeXmpVideoTipPos", i[0])
            })
        }

        setThunderConfig(e, t, ...i) {
            return n(this, void 0, void 0, function* () {
                i && f.ConfigNS.setValue(i[0], i[1], i[2])
            })
        }
    }
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(3), r = i(35);
    let s = null;
    const l = i(0).default.getLogger("url.helper");
    !function (e) {
        function t(e) {
            let t = !0;
            if ("string" == typeof e) if (40 === e.length || 32 === e.length) {
                for (let i = 0; i < e.length; i++) if (e.charCodeAt(i) > 127) {
                    t = !1;
                    break
                }
            } else t = !1; else t = !1;
            return t
        }

        function d(e, i = !0) {
            i = void 0 === i || i;
            let n = !1;
            do {
                if ("string" != typeof e || "" === e) break;
                let a = e.trim();
                if ("" === a) break;
                if (r.ThunderHelper.getTaskTypeFromUrl(a) === o.DownloadKernel.TaskType.Unkown) {
                    if (!i) break;
                    t(a) && (n = !0)
                } else n = !0;
                n || a.match(/^file:\/\/\//) && (n = !0)
            } while (0);
            return n
        }

        e.isMagnetCode = t, e.fixMagnetUrl = function (e) {
            let i = "";
            do {
                if ("string" != typeof e || "" === e) break;
                if ("" === (i = e.trim())) break;
                r.ThunderHelper.getTaskTypeFromUrl(i) === o.DownloadKernel.TaskType.Unkown && t(i) && (i = "magnet:?xt=urn:btih:" + i)
            } while (0);
            return i
        }, e.isUrlValid = d, e.isBirdKey = function (e) {
            return e ? e.match(/#[Xx]([0-9a-zA-Z])+#/g) : null
        }, e.isCustomProtocol = function (e) {
            return n(this, void 0, void 0, function* () {
                let t = !1;
                null === s && (s = yield Promise.resolve().then(() => i(44)));
                let n = s.parse(e);
                do {
                    if (null === n || void 0 === n) break;
                    let e = n.protocol;
                    if ("magnet:" === e) {
                        t = !0;
                        break
                    }
                    if ("thunder:" === e) {
                        t = !0;
                        break
                    }
                    if ("ed2k:" === e) {
                        t = !0;
                        break
                    }
                } while (0);
                return t
            })
        }, e.isP2spOrEmuleUrl = function (e) {
            let t = !1;
            do {
                if (null === e || void 0 === e || "" === e) break;
                let i = e.trim();
                if ("" === i) break;
                let n = r.ThunderHelper.getTaskTypeFromUrl(i);
                if (n === o.DownloadKernel.TaskType.P2sp || n === o.DownloadKernel.TaskType.Emule) {
                    t = !0;
                    break
                }
            } while (0);
            return t
        }, e.isSupportUrl = function (e) {
            e = e.toLowerCase();
            let t = !1;
            do {
                if ("http://" === e.substr(0, "http://".length)) {
                    t = !0;
                    break
                }
                if ("https://" === e.substr(0, "https://".length)) {
                    t = !0;
                    break
                }
                if ("ftp://" === e.substr(0, "ftp://".length)) {
                    t = !0;
                    break
                }
                if ("ed2k://" === e.substr(0, "ed2k://".length)) {
                    t = !0;
                    break
                }
                if ("thunder://" === e.substr(0, "thunder://".length)) {
                    t = !0;
                    break
                }
                if ("magnet:?" === e.substr(0, "magnet:?".length)) {
                    t = !0;
                    break
                }
            } while (0);
            return t
        };
        let u = ".edu;.gov;.mil;.hk;.tw;.com.tw;.com.tw;.aero;.biz;.coop;.info;.museum;.name;.pro;";
        u += ".com;.cn;.xin;.net;.top;.xyz;.wang;.shop;.site;.club;.cc;.fun;.online;.biz;.red;.link;.ltd;.mobi;.info;.org;", u += ".com.cn;.net.cn;.org.cn;.gov.cn;.name;.vip;.work;.tv;.co;.kim;.group;.tech;.store;.ren;.ink;.pub;.live;.wiki;.design;";
        const c = (u += ".me").split(";");

        function h(e) {
            let t = !1;
            do {
                if (void 0 === e || null === e || "" === e) break;
                if (-1 !== c.indexOf(e)) {
                    t = !0;
                    break
                }
            } while (0);
            return t
        }

        function f(e) {
            let t = null;
            do {
                if (void 0 === e || null === e) break;
                if ("" === (e = e.trim())) break;
                let i = /^(?:([A-Za-z]+):)?(\/{0,3})([0-9.\-A-Za-z]+)(?::(\d+))?(?:\/([^?#]*))?(?:\?([^#]*))?(?:#(.*))?$/.exec(e);
                if (null === i) break;
                l.information("url parse result ", i), t = {};
                let n = ["url", "scheme", "slash", "host", "port", "path", "query", "hash"];
                for (let e = 0; e < n.length; e++) t[n[e]] = i[e];
                l.information("url parse", t)
            } while (0);
            return t
        }

        e.isUsualDomainSuffix = h, e.urlParse = f, e.isUrl = function (e) {
            let t = !1, i = e;
            do {
                if (void 0 === e || null === e) break;
                if (d(e, !1)) {
                    t = !0;
                    break
                }
                if (e.trim().match(/^file:\/\/\//)) {
                    t = !0;
                    break
                }
                let n = f(e);
                if (null === n) {
                    l.information("url parse failed");
                    break
                }
                if (void 0 === n.host || null === n.host) break;
                if (void 0 !== n.scheme) {
                    t = !0;
                    break
                }
                let o = n.host.match(/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/);
                if (o) {
                    if (l.information("url parse is ip", o), Number(o[1]) <= 0 || Number(o[1]) > 255) {
                        t = !1;
                        break
                    }
                    if (Number(o[2]) < 0 || Number(o[2]) > 255) {
                        t = !1;
                        break
                    }
                    if (Number(o[4]) < 0 || Number(o[4]) > 255) {
                        t = !1;
                        break
                    }
                    if (Number(o[4]) < 0 || Number(o[4]) > 255) {
                        t = !1;
                        break
                    }
                    t = !0, void 0 === n.scheme && void 0 !== n.port && (i = `http://${e}`);
                    break
                }
                if (n.host.match(/\.{2,}/)) {
                    l.information("url parse has multi dot"), t = !1;
                    break
                }
                let r = a.extname(n.host);
                if ("" === r) break;
                if (h(r)) {
                    t = !0;
                    break
                }
            } while (0);
            return l.information("url parse isUrl", t), {ret: t, suggest: i}
        }, e.isFileNameValid = function (e) {
            let t = !1;
            do {
                if (void 0 === e) break;
                if (null === e) break;
                if ("" === (e = e.trim())) break;
                if ("." === e[0]) break;
                if (e.match(/[\/\\"<>\?\*|]/)) break;
                t = !0
            } while (0);
            return t
        }, e.isSuffixNeedDownload = function (e) {
            let t = !0;
            do {
                if (void 0 === e) break;
                if ("" === e || "." === e) break;
                if (e = e.toLowerCase(), -1 !== ["txt", "url", "html", "htm", "mht", "nfo"].indexOf(e)) {
                    t = !1;
                    break
                }
            } while (0);
            return t
        }
    }(t.URLHelperNS || (t.URLHelperNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(12), o = i(0), r = i(14), s = i(433), l = o.default.getLogger("MenuSkinNS");
    !function (e) {
        function t(e, t) {
            return n(this, void 0, void 0, function* () {
                if (l.information("setStyle", e, t), null !== e) {
                    const {WindowPreferenceNS: n} = yield Promise.resolve().then(() => i(435));
                    let a = {windowPreference: n.getWindowPreference()};
                    l.information("skinOpts", a), yield e.setStyle(s(a, t))
                }
            })
        }

        e.setStyle = t, e.popEditableDefaultContextMenu = function (e, i, o) {
            return n(this, void 0, void 0, function* () {
                let o = yield a.asyncRemoteCall.getCurrentWebContents();
                o.once("context-menu", (s, d) => n(this, void 0, void 0, function* () {
                    if (l.verbose(s), d.isEditable) {
                        let n = [{
                            label: "撤销", enabled: d.editFlags.canUndo, click: () => {
                                o.undo()
                            }
                        }, {type: "separator"}, {
                            label: "剪切", enabled: d.editFlags.canCut, click: () => {
                                o.cut()
                            }
                        }, {
                            label: "复制", enabled: d.editFlags.canCopy, click: () => {
                                o.copy()
                            }
                        }, {
                            label: "粘贴",
                            enabled: d.editFlags.canPaste && r.ThunderUtil.isClipboardTextFormatAvailable(),
                            click: () => {
                                o.paste()
                            }
                        }, {
                            label: "删除", enabled: d.editFlags.canDelete, click: () => {
                                o.delete()
                            }
                        }, {type: "separator"}, {
                            label: "全选", enabled: d.editFlags.canSelectAll, click: () => {
                                o.selectAll()
                            }
                        }];
                        if (void 0 !== e && "function" == typeof e) {
                            let t = e(d);
                            void 0 !== t && t.length > 0 && (void 0 === i ? i = n.length : (i < 0 && (i = n.length + 1 + i) < 0 && (i = 0), i > n.length && (i = n.length)), n.splice(i, 0, ...t))
                        }
                        let s = yield(yield a.asyncRemoteCall.getMenu()).buildFromTemplate(n);
                        yield t(s, {});
                        let l = yield a.asyncRemoteCall.getCurrentWindow();
                        yield s.popup({window: l})
                    }
                }))
            })
        }
    }(t.MenuSkinNS || (t.MenuSkinNS = {}))
}, function (e, t, i) {
    e.exports = i(56)(73)
}, function (e, t) {
    e.exports = require("crypto")
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(12), r = i(16), s = i(3), l = i(29), d = i(10), u = i(5), c = i(14), h = i(7), f = i(0),
        g = i(22), p = i(15), v = i(27), m = i(28), y = i(6), k = i(19), T = i(37), w = i(45), C = i(24), S = i(49),
        b = i(46), I = y.default(a.join(__rootDir, "../bin/ThunderHelper.node")),
        _ = p.DownloadKernelEventManager.getEventManager(), A = l.DownloadKernelCategoryManager.getCategoryManager(),
        D = f.default.getLogger("Thunder.PrivateSpaceHelper"), x = S.ToastNotifyManagerNS.getToastNotifyManger();
    !function (e) {
        let t = void 0, i = void 0, l = "", f = !0, p = void 0, y = void 0;
        const N = new k.EventEmitter;
        let E;

        function P(e, t, i) {
            D.information("onInsertToCategoryView categoryId:", e, ", categoryViewId:", t);
            for (let e = 0; e < i.length; e++) {
                let t = i[e];
                if (t.getTaskAttribute(s.DownloadKernel.TaskAttribute.Background)) return;
                let n = t.getTaskStatus();
                D.information("onInsertToCategoryView taskStatus:", n), n !== s.DownloadKernel.TaskStatus.Succeeded && n !== s.DownloadKernel.TaskStatus.Seeding || O(t, t.getIsPrivate()).then().catch()
            }
        }

        function M(e) {
            for (let t = 0; t < e.length; t++) {
                let i = e[t];
                if (i.getTaskAttribute(s.DownloadKernel.TaskAttribute.Background)) continue;
                let n = i.getTaskStatus();
                n !== s.DownloadKernel.TaskStatus.Succeeded && n !== s.DownloadKernel.TaskStatus.Seeding || i.getIsPrivate() && O(i, !0).then().catch()
            }
        }

        function O(e, t) {
            return n(this, void 0, void 0, function* () {
                let i = e.getTaskStatus(), o = e.getTaskBaseInfo().taskType;
                if (D.information("moveTaskFileToPrivateSpace taskType:", o, ", taskStatus:", i, ", moveIn:", t), i === s.DownloadKernel.TaskStatus.Succeeded || i === s.DownloadKernel.TaskStatus.Seeding) {
                    if (e.getTaskAttribute(s.DownloadKernel.TaskAttribute.GroupTaskId) > 0) return;
                    let i = "";
                    if (t ? (i = yield L(l), i = a.join(i, l)) : i = yield h.client.callServerFunction("GetDownloadDir"), D.information("moveTaskFileToPrivateSpace newSrcPath:", i), o === s.DownloadKernel.TaskType.Group) return function (e, t, i) {
                        return n(this, void 0, void 0, function* () {
                            let n = e.getSavePath(), o = e.getTaskName();
                            if (!(yield u.FileSystemAWNS.existsAW(n))) return;
                            let r = a.join(n, o);
                            if (D.information("destPath:", r), n !== r) {
                                yield u.FileSystemAWNS.mkdirsAW(i);
                                let a = yield F(n, r);
                                if (a) {
                                    e.setSavePath(i), U(e, !!t && B());
                                    let n = e.getExtraObject(), a = n.getSubTaskCount();
                                    if (a && a > 0) for (let e = 0; e < a; e++) {
                                        let t = n.getSubTaskByIndex(e);
                                        t && t.setSavePath(r)
                                    }
                                    _.fireTaskEvent(s.DownloadKernel.TaskEventType.TaskMovedEnd, [e])
                                }
                            } else U(e, !!t && B())
                        })
                    }(e, t, i);
                    if (o === s.DownloadKernel.TaskType.Bt) return function (e, t, i) {
                        return n(this, void 0, void 0, function* () {
                            let n = e.getExtraObject(), o = n.getDownloadFile();
                            if (1 !== o.length) return;
                            let r = n.getBtFileList(), l = r.get(o[0]);
                            if (!l) return;
                            let d = void 0, c = e.getSavePath(),
                                h = l.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.FileName),
                                f = l.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.FilePath),
                                g = yield w.SingleBtTaskNS.isSingleBtTask(e);
                            if (g) d = w.SingleBtTaskNS.getSinleBtTaskFilePath(e); else {
                                if (!h || "" === h) return;
                                c = a.join(c, f), d = a.join(c, h)
                            }
                            if (yield u.FileSystemAWNS.existsAW(d)) if (c !== i) {
                                yield u.FileSystemAWNS.mkdirsAW(i);
                                let n = a.join(i, h), o = yield F(d, n);
                                o && (e.setSavePath(i), _.fireTaskEvent(s.DownloadKernel.TaskEventType.TaskMovedEnd, [e]), U(e, !!t && B()))
                            } else U(e, !!t && B())
                        })
                    }(e, t, i);
                    if (o === s.DownloadKernel.TaskType.P2sp || o === s.DownloadKernel.TaskType.Emule) return function (e, t, i) {
                        return n(this, void 0, void 0, function* () {
                            let n = e.getSavePath(), o = e.getTaskName(), r = a.join(n, o);
                            if (yield u.FileSystemAWNS.existsAW(r)) if (n !== i) {
                                yield u.FileSystemAWNS.mkdirsAW(i);
                                let n = a.join(i, o), l = yield F(r, n);
                                l && (e.setSavePath(i), _.fireTaskEvent(s.DownloadKernel.TaskEventType.TaskMovedEnd, [e]), U(e, !!t && B()))
                            } else U(e, !!t && B())
                        })
                    }(e, t, i)
                }
            })
        }

        function F(e, t) {
            return n(this, void 0, void 0, function* () {
                return D.information("moveFile srcParh:", e, ", destPath:", t), new Promise(i => n(this, void 0, void 0, function* () {
                    if (e[0] === t[0]) {
                        yield u.FileSystemAWNS.renameAW(e, t);
                        let n = yield u.FileSystemAWNS.existsAW(t);
                        D.information("moveFile existsAW success:", n), i(n)
                    } else {
                        let n = !1;
                        (yield u.FileSystemAWNS.lstatAW(e)).isDirectory() ? (n = yield u.FileSystemAWNS.copyDirsAW(e, t), D.information("moveFile copyDirsAW success:", n), n && (n = yield u.FileSystemAWNS.rmdirsAW(e), D.information("moveFile rmdirsAW success:", n))) : (n = yield u.FileSystemAWNS.copyFileAW(e, t), D.information("moveFile copyFileAW success:", n), n && (n = yield u.FileSystemAWNS.unlinkAW(e), D.information("moveFile unlinkAW success:", n))), i(n)
                    }
                }))
            })
        }

        function L(e) {
            return n(this, void 0, void 0, function* () {
                let t = d.ConfigNS.getValue("PrivateSpaceDefaultPath", e, "");
                if (t && "" !== t) {
                    let i = a.join(t, e);
                    if (yield u.FileSystemAWNS.existsAW(i)) return t;
                    if (yield u.FileSystemAWNS.mkdirAW(i)) return t
                }
                let i = d.ConfigNS.getValue("TaskDefaultSettings", "DefaultPath", "");
                return void 0 !== i && "" !== i || (i = c.ThunderUtil.getDefaultDownloadDir()), void 0 !== i && "" !== i ? (d.ConfigNS.setValue("PrivateSpaceDefaultPath", e, i), i) : ""
            })
        }

        function B(e) {
            return e && "" === e || (e = l), 1 === d.ConfigNS.getValue("PrivateSpaceLockUserTask", e, 1)
        }

        function U(e, t) {
            let i = e.getSavePath(), n = e.getTaskName();
            D.information("setTaskHidden path:", i, ", name:", n, ", hidden:", t), t && !function (e) {
                if (!e || "" === e) return !1;
                let t = l;
                "" !== l && "0" !== l || (t = "私人空间");
                if (D.information("userId:", t), D.information("filePath:", e), new RegExp(t).test(e)) return !0;
                return !1
            }(i) || (R(i, t), R(a.join(i, n), t))
        }

        function R(e, t) {
            let i = t ? 2 : 128, n = I.setFileAttributes(e, i);
            D.information("setPathHidden ret:", n, ", path:", e, ", hidden:", t)
        }

        function K(e, t) {
            e && "" === e || (e = l), d.ConfigNS.setValue("PrivateSpacePasswordErrorCount", e, t)
        }

        function W(e, t) {
            return n(this, void 0, void 0, function* () {
                if (!t || "" === t) return;
                if (t = a.join(t, e), !(yield u.FileSystemAWNS.existsAW(t))) {
                    yield u.FileSystemAWNS.mkdirAW(t)
                }
                let i = d.ConfigNS.getValue("PrivateSpaceLockUserTask", e, 1);
                D.information("setPrivateSavePath", i, t), R(t, 1 === i)
            })
        }

        function V(e, t) {
            D.information("setAllTaskFileHidden", e, t);
            let i = A.getPrivateCategoryFromUserId(e);
            if (!i) return;
            let n = i.getCategoryViews();
            if (n && !(n.length <= 0)) for (let e = 0; e < n.length; e++) {
                let i = n[e].getTasks();
                for (let e of i.values()) {
                    if (e.getTaskAttribute(s.DownloadKernel.TaskAttribute.Background)) continue;
                    let i = e.getTaskStatus();
                    i !== s.DownloadKernel.TaskStatus.Succeeded && i !== s.DownloadKernel.TaskStatus.Seeding || e.getIsPrivate() && U(e, t)
                }
            }
        }

        function H(e, t, i) {
            return n(this, void 0, void 0, function* () {
                return new Promise((a, o) => n(this, void 0, void 0, function* () {
                    let n = null;
                    if (n = e && "" !== e ? A.getPrivateCategoryFromUserId(e) : A.getCurrentPrivateCategory()) {
                        let e = yield C.LoginHelperNS.loginHelper.getUserInfoByKeyAw("mobile");
                        null === e || void 0 === e || "" === e ? (!1 !== i && (yield h.client.callServerFunction("OpenNewTab", "https://i.xunlei.com/xluser/validate/enter/bindphone_enter.html")), a(1)) : function (e, t) {
                            return g.MessageBox.custom("private-space-phone-verify", {
                                mobile: e,
                                methodType: t
                            }, {webPreferences: {webSecurity: !1}})
                        }(e, t).then(e => {
                            e.action === T.MessageBoxNS.Action.OK ? a(0) : a(-1)
                        }).catch()
                    } else a(-1)
                }))
            })
        }

        function z(e, t) {
            return n(this, void 0, void 0, function* () {
                let i = B(e);
                return new Promise((a, o) => {
                    (function (e, t) {
                        return g.MessageBox.custom("private-space-set-password", {isSetHide: e, showType: t})
                    })(i, t).then(t => {
                        if (t.action === T.MessageBoxNS.Action.OK) {
                            if (null !== t.args.isSetHide && void 0 !== t.args.isSetHide && "boolean" == typeof t.args.isSetHide && t.args.isSetHide !== i) {
                                let i = t.args.isSetHide ? 1 : 0;
                                d.ConfigNS.setValue("PrivateSpaceLockUserTask", e, i), V(e, t.args.isSetHide)
                            }
                            let o = A.getCurrentPrivateCategory();
                            o && o.setPassword(t.args.password, "", !0, (t, i) => n(this, void 0, void 0, function* () {
                                t && (G(!1), N.emit(E.SetPassword, !0), x.showNotify(S.ToastNotifyManagerNS.notifyIdScheduleTaskDownloadMode, b.ToastNotifyItemType.GreenNotify, "私人空间密码设置成功", 3e3), K(e, 0), a(0));
                                let i = yield L(e);
                                i && "" !== i && W(e, i).then().catch()
                            }))
                        } else a(-1)
                    }).catch()
                })
            })
        }

        function j(e) {
            return n(this, void 0, void 0, function* () {
                return new Promise((t, i) => {
                    let n = null;
                    (n = e && "" !== e ? A.getPrivateCategoryFromUserId(e) : A.getCurrentPrivateCategory()) ? z(e, "change").then(e => {
                        t(e)
                    }).catch() : t(-1)
                })
            })
        }

        function G(e) {
            f = e
        }

        function $() {
            return f
        }

        !function (e) {
            e.Unknow = "Unknow", e.SetPassword = "SetPassword"
        }(E = e.EventType || (e.EventType = {})), e.getEventEmitter = function () {
            return N
        }, e.getPrivateSavePath = L, e.isPrivateSpaceOpen = function (e) {
            let t = !1, i = A.getPrivateCategoryFromUserId(e);
            if (i) {
                let e = i.getPassword();
                e && "" !== e && (t = !0)
            }
            return t
        }, e.setPrivateSavePath = W, e.setAllTaskFileHidden = V, e.phoneVerifyPrivateCategory = H, e.changePrivateSpacePassword = j, e.openPrivateCategory = function (e) {
            return n(this, void 0, void 0, function* () {
                return new Promise((t, i) => {
                    let n = null;
                    if (n = e && "" !== e ? A.getPrivateCategoryFromUserId(e) : A.getCurrentPrivateCategory()) {
                        let i = n.getPassword();
                        i && "" !== i ? t(0) : z(e, "open").then(e => {
                            t(e)
                        }).catch()
                    } else t(-1)
                })
            })
        }, e.accessPrivateCategory = function (e) {
            return n(this, void 0, void 0, function* () {
                var t, i;
                return new Promise((t, i) => {
                    let a = null;
                    if (a = e && "" !== e ? A.getPrivateCategoryFromUserId(e) : A.getCurrentPrivateCategory()) if ($()) {
                        let i = a.getPassword();
                        if (i && "" !== i) {
                            let a = function (e) {
                                return e && "" === e || (e = l), d.ConfigNS.getValue("PrivateSpacePasswordErrorCount", e, 0)
                            }(e);
                            a >= 5 ? H(e, "more").then(i => n(this, void 0, void 0, function* () {
                                0 === i ? (i = yield j(e), t(0 === i ? 0 : -1)) : t(-1)
                            })).catch(() => {
                                t(-1)
                            }) : (i = i, a = a, g.MessageBox.custom("private-space-verify-password", {
                                password: i,
                                errorCount: a
                            })).then(i => n(this, void 0, void 0, function* () {
                                if (i.action === T.MessageBoxNS.Action.OK) i.args && i.args.success && (G(!1), K(e, 0), t(0)); else if (i.action === T.MessageBoxNS.Action.Close && i.args) {
                                    a = i.args.errorCount, K(e, a);
                                    let n = i.args.from;
                                    if ("forget" === n || "more" === n) {
                                        let i = yield H(e, n);
                                        0 === i && 0 === (i = yield j(e)) && t(0)
                                    }
                                }
                            })).catch(() => {
                                t(-1)
                            })
                        } else t(0)
                    } else t(0); else t(-1)
                })
            })
        }, e.setNeedPassword = G, e.getNeedPassword = $, e.init = function () {
            return n(this, void 0, void 0, function* () {
                (function () {
                    return n(this, void 0, void 0, function* () {
                        t = r.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", e => n(this, void 0, void 0, function* () {
                            D.information("OnUserLogin userId:", e), l = e, A.setUserInfo(e, "")
                        })), i = r.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", () => {
                            D.information("OnUserLogout currentUserId:", l), l = "", f = !0, A.setUserInfo("", "")
                        })
                    })
                })().then().catch(), p = _.attachTaskEvent(s.DownloadKernel.TaskEventType.StatusChanged, (...e) => {
                    do {
                        if (!e) break;
                        if (e[0] !== s.DownloadKernel.TaskEventType.StatusChanged) break;
                        if (!e[1]) break;
                        let t = e[1];
                        t.length > 0 && M(t)
                    } while (0)
                }), y = _.attachTaskEvent(s.DownloadKernel.TaskEventType.InsertToCategoryView, (...e) => {
                    do {
                        if (!e) break;
                        if (e[0] !== s.DownloadKernel.TaskEventType.InsertToCategoryView) break;
                        if (void 0 === e[1] || !e[2] || !e[3]) break;
                        let t = e[1], i = e[2];
                        D.information("insertTaskCallback categoryId:", t, ", categoryViewId:", i);
                        let n = e[3], a = e[4];
                        n.length > 0 && a === s.DownloadKernel.TaskInsertReason.MoveThoughCategory && P(t, i, n)
                    } while (0)
                }), (yield o.asyncRemoteCall.getIpcMain()).on(m.ThunderChannelList.channelRMGetPrivateSpaceInfo, e => n(this, void 0, void 0, function* () {
                    do {
                        if (!e) break;
                        if (yield e.sender.isDestroyed()) break;
                        let t = !0, i = A.getCurrentPrivateCategory();
                        if (i) {
                            let e = i.getPassword();
                            e && "" !== e && (t = !0)
                        }
                        let n = v.default.getCurrentCategoryId();
                        e.sender.send(m.ThunderChannelList.channelMRGetPrivateSpaceInfoResult, t, n)
                    } while (0)
                }))
            })
        }, e.uninit = function () {
            r.NativeCallModule.nativeCall.DetachNativeEvent("onLoginSuc", t), r.NativeCallModule.nativeCall.DetachNativeEvent("onLogout", i), _.detachTaskEvent(s.DownloadKernel.TaskEventType.StatusChanged, p), _.detachTaskEvent(s.DownloadKernel.TaskEventType.InsertToCategoryView, y)
        }
    }(t.PrivateSpaceHelperNS || (t.PrivateSpaceHelperNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(5), r = i(6), s = i(417), l = i(39), d = i(4), u = i(13), c = i(10), h = i(78),
        f = d.promisify, g = r.default(a.join(__rootDir, "../bin/ThunderHelper.node")),
        p = i(0).default.getLogger("SettingConfigHelper");
    !function (e) {
        e.configBrowserHelper = new class {
            constructor() {
                this.browserconfig = null, this.installWatchBrowsers = [], this.configShowBrowsers = [], this.eventContainer = new l.default, this.isInit = !1
            }

            init() {
                return n(this, void 0, void 0, function* () {
                    p.information("ConfigBrowserHelper enter init ");
                    let e = yield this.onConfigInit(), t = yield this.onBhoConfigInit();
                    p.information("ConfigBrowserHelper init isConfigInit:", e, ";isBhoConfigInit:", t), e && t && (yield this.readBrowserConfigXml(), yield this.writeNewBrowserToConfigINI(), this.isInit = !0, p.information("ConfigBrowserHelper init Finished"), this.eventContainer.fireEvent(u.NodeEventMesssageNS.eventConfigBrowserInitFinished))
                })
            }

            attachListener(e, t) {
                do {
                    if (e === u.NodeEventMesssageNS.eventConfigBrowserInitFinished) {
                        if (this.isInit) {
                            t(this.isInit);
                            break
                        }
                        this.eventContainer.attachOnceListener(e, t);
                        break
                    }
                    this.eventContainer.attachListener(e, t)
                } while (0)
            }

            detachListener(e, t) {
                this.eventContainer.detachListener(e, t)
            }

            getConfigShowBrowsers() {
                let e = [];
                do {
                    if (null === this.configShowBrowsers || void 0 === this.configShowBrowsers || this.configShowBrowsers.length <= 0) break;
                    for (let t = 0; t < this.configShowBrowsers.length; ++t) {
                        let i = this.configShowBrowsers[t], n = i.browserName, a = "Motitor" + n, o = !1;
                        0 !== c.ConfigNS.getValue("Motitor", a, 2) && (o = !0);
                        let r = {content: n, name: i.name, key: a, isSelect: o};
                        e.push(r)
                    }
                } while (0);
                return p.information("getConfigShowBrowsers:", e), e
            }

            getWriteIniConfigShowBrowsers() {
                let e = "||";
                do {
                    let t = this.getConfigShowBrowsers();
                    if (null === t || void 0 === t || t.length <= 0) break;
                    for (let i = 0; i < t.length; ++i) {
                        let n = t[i], a = n.name;
                        "IE浏览器" !== n.content && n.isSelect && (void 0 !== e && null !== e && "" !== e ? "edge" === a || "edgecp" === a ? e += "edge||edgecp||" : e = e + a + "||" : e = "edge" === a || "edgecp" === a ? "edge||edgecp||" : a + "||")
                    }
                } while (0);
                return e
            }

            getWatchBrowerByName(e) {
                let t = null;
                do {
                    if (null === this.installWatchBrowsers || void 0 === this.installWatchBrowsers || this.installWatchBrowsers.length <= 0) break;
                    for (let i = 0; i < this.installWatchBrowsers.length; ++i) {
                        let n = this.installWatchBrowsers[i];
                        if (n.browserName.toLowerCase() === e.toLowerCase()) {
                            t = n;
                            break
                        }
                    }
                } while (0);
                return t
            }

            savaMotiorBrowserToConfig() {
                do {
                    let e = this.getConfigShowBrowsers();
                    if (null === e || void 0 === e || e.length <= 0) break;
                    let t = !1;
                    for (let i = 0; i < e.length; ++i) {
                        let n = e[i];
                        n.isSelect && (t = !0), "IE浏览器" === n.content && (n.isSelect ? (h.BHOConfigNS.setValue("Monitor", "ConfigWatch_Browser", 1), h.BHOConfigNS.setValue("Monitor", "MonitorIE", 1)) : (h.BHOConfigNS.setValue("Monitor", "ConfigWatch_Browser", 0), h.BHOConfigNS.setValue("Monitor", "MonitorIE", 0)))
                    }
                    t || h.BHOConfigNS.setValue("Monitor", "ConfigWatch_Browser", 0)
                } while (0)
            }

            onConfigInit() {
                return n(this, void 0, void 0, function* () {
                    return new Promise(e => {
                        c.ConfigNS.attachListener(u.NodeEventMesssageNS.eventConfigInitFinished, () => {
                            e(!0)
                        })
                    })
                })
            }

            onBhoConfigInit() {
                return n(this, void 0, void 0, function* () {
                    return new Promise(e => {
                        h.BHOConfigNS.attachListener(u.NodeEventMesssageNS.eventBHOConfigInitFinished, () => {
                            e(!0)
                        })
                    })
                })
            }

            readBrowserConfigXml() {
                return n(this, void 0, void 0, function* () {
                    p.information("enter readBrowserConfigXml");
                    do {
                        if (null !== this.browserconfig && void 0 !== this.browserconfig) break;
                        let e = this.getShortThunderVersion();
                        if (null === e || void 0 === e || "" === e) break;
                        let t = g.getCommonFilesPath(),
                            i = "XLWFPDOWNLOAD-SSID-{DB09E578-4ECF-486e-90A5-505A33219F71}_" + e + ".xml",
                            n = a.join(t, "Thunder Network\\ServicePlatform\\"), r = a.join(n, i);
                        if (!(yield o.FileSystemAWNS.existsAW(r))) break;
                        let l = yield o.FileSystemAWNS.readFileAW(r);
                        if (!l || "" === l.toString()) break;
                        try {
                            let e = {explicitArray: !1}, t = yield f(s.parseString)(l, e);
                            null !== t && void 0 !== t && (this.browserconfig = t.browserconfig, yield this.setInstallWatchBrowserList())
                        } catch (e) {
                            p.information(e)
                        }
                    } while (0);
                    this.setConfigShowBrowsers(), p.information("leave readBrowserConfigXml")
                })
            }

            writeNewBrowserToConfigINI() {
                return n(this, void 0, void 0, function* () {
                    p.information("enter writeNewBrowserToConfigINI");
                    let e = "||";
                    for (let t = 0; t < this.configShowBrowsers.length; ++t) {
                        let i = this.configShowBrowsers[t], n = "Motitor" + i.browserName,
                            a = c.ConfigNS.getValue("Motitor", n, 2);
                        2 === a && c.ConfigNS.setValue("Motitor", n, 1);
                        let o = i.name;
                        void 0 !== o && null !== o && "" !== o && 0 !== a && (void 0 !== e && null !== e && "" !== e ? "edge" === o || "edgecp" === o ? e += "edge||edgecp||" : e = e + o + "||" : e = "edge" === o || "edgecp" === o ? "edge||edgecp||" : o + "||")
                    }
                    h.BHOConfigNS.setValue("Monitor", "ConfigBrowsers", e), p.information("leave writeNewBrowserToConfigINI", e)
                })
            }

            getShortThunderVersion() {
                let e = "";
                do {
                    let t = a.join(__rootDir, "../../Thunder.exe"), i = g.getFileVersion(t);
                    if (null === i || void 0 === i || "" === i) break;
                    let n = i.split(/\./);
                    null !== n && void 0 !== n && n.length >= 3 && (e = n[0] + "." + n[1] + "." + n[2])
                } while (0);
                return e
            }

            setInstallWatchBrowserList() {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (null === this.browserconfig || void 0 === this.browserconfig) break;
                        if (null === this.browserconfig.browsers || void 0 === this.browserconfig.browsers) break;
                        let e = this.browserconfig.browsers;
                        if (null === e || void 0 === e || e.browser.length <= 0) break;
                        for (let t = 0; t < e.browser.length; ++t) {
                            let i = e.browser[t], n = !1;
                            "appReg" === i.type ? n = yield this.checkInstallByappReg(i) : "appPath" === i.type && (n = this.checkInstallByappPath(i)), n && this.installWatchBrowsers.push(i)
                        }
                        p.information("配置初始化时,安装的浏览器:", this.installWatchBrowsers)
                    } while (0)
                })
            }

            checkInstallByappReg(e) {
                return n(this, void 0, void 0, function* () {
                    let t = !1;
                    do {
                        if (null === e || void 0 === e) break;
                        if (null === e.reg || void 0 === e.reg) break;
                        let i = e.reg.regRoot;
                        if (null === i || void 0 === i || "" === i) break;
                        let n = e.reg.regKey;
                        if (null === n || void 0 === n || "" === n) break;
                        let r = e.reg.regName, s = g.queryRegValue(i, n, r);
                        if (p.information("checkInstallByappReg:", s, i, n, r), null === s || void 0 === s || "" === s) break;
                        s = this.getPathFromRegString(s);
                        let l = g.getLongPathName(s);
                        null !== l && void 0 !== l && "" !== l && (s = l);
                        let d = e.proName, u = d.toLowerCase();
                        if (s.toLowerCase().search(u) < 0) {
                            let e = a.extname(s);
                            if (void 0 === e || null === e || "" === e) s = a.join(s, d); else {
                                let e = a.dirname(s);
                                s = a.join(e, d)
                            }
                            if (!(t = yield o.FileSystemAWNS.existsAW(s))) {
                                let e = a.dirname(s);
                                s = this.getFilePathByDir(e, d)
                            }
                        }
                        t || (t = yield o.FileSystemAWNS.existsAW(s))
                    } while (0);
                    return t
                })
            }

            getPathFromRegString(e) {
                let t = e, i = t.search(/\,/);
                return i >= 0 && (t = t.substring(0, i)), t = t.replace(/\"/g, "")
            }

            getFilePathByDir(e, t) {
                return p.information("getFilePathByDir:", e, t), ""
            }

            checkInstallByappPath(e) {
                let t = !1;
                do {
                    if (null === e || void 0 === e) break;
                    if (null === e.filePath || void 0 === e.filePath || "" === e.filePath) break;
                    let i = g.getSystemTempPath();
                    if (null === i || void 0 === i || "" === i) break;
                    let n = i.substring(0, 1);
                    if (null === n || void 0 === n || "" === n) break;
                    n += ":\\";
                    let o = a.join(n, e.filePath);
                    t = g.queryFileExists(o)
                } while (0);
                return t
            }

            setConfigShowBrowsers() {
                do {
                    let e = {browserName: "IE浏览器", icoUrl: ""};
                    if (this.configShowBrowsers.push(e), void 0 === this.installWatchBrowsers || null === this.installWatchBrowsers || this.installWatchBrowsers.length <= 0) break;
                    for (let e = 0; e < this.installWatchBrowsers.length; ++e) {
                        let t = this.installWatchBrowsers[e], i = !1;
                        for (let e = 0; e < this.configShowBrowsers.length; ++e) {
                            let n = this.configShowBrowsers[e];
                            if (n.browserName.toLowerCase() === t.browserName.toLowerCase()) {
                                null !== n.icoUrl && void 0 !== n.icoUrl && "" !== n.icoUrl || (this.configShowBrowsers[e].icoUrl = t.icoUrl), i = !0;
                                break
                            }
                        }
                        i || this.configShowBrowsers.push(t)
                    }
                } while (0)
            }
        }
    }(t.SettingConfigHelperNS || (t.SettingConfigHelperNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(53), o = i(2), r = i(0), s = i(6), l = i(5), d = i(13), u = i(10), c = i(525),
        h = r.default.getLogger("BHOConfig"), f = s.default(o.join(__rootDir, "../bin/ThunderHelper.node"));

    class g extends u.Config {
        init(e) {
            return n(this, void 0, void 0, function* () {
                if (!this.isInit) {
                    if (this.configPath = e, yield l.FileSystemAWNS.existsAW(e)) {
                        let t = yield l.FileSystemAWNS.readFileAW(e);
                        if (t) {
                            let e = null;
                            try {
                                e = c.IniNS.parse(t.toString())
                            } catch (e) {
                                h.warning(e)
                            }
                            this.isInit = !0, this.mergeConfigData(e), this.eventContainer.fireEvent(d.NodeEventMesssageNS.eventBHOConfigInitFinished)
                        }
                    } else {
                        let t = o.dirname(e);
                        yield l.FileSystemAWNS.mkdirsAW(t), this.isInit = !0, this.eventContainer.fireEvent(d.NodeEventMesssageNS.eventBHOConfigInitFinished)
                    }
                }
            })
        }

        save() {
            return n(this, void 0, void 0, function* () {
                if (null !== this.configPath && void 0 !== this.configPath && "" !== this.configPath && this.isInit) {
                    let e = c.IniNS.stringify(this.configData);
                    yield l.FileSystemAWNS.writeFileAW(this.configPath, e)
                }
            })
        }

        saveSync() {
            let e = c.IniNS.stringify(this.configData);
            null !== this.configPath && void 0 !== this.configPath && "" !== this.configPath && this.isInit && a.writeFileSync(this.configPath, e)
        }

        fireValueChangedEvent(e, t, i, n) {
            this.eventContainer.fireEvent(d.NodeEventMesssageNS.eventBHOConfigValueChanged, e, t, i, n)
        }

        attachListener(e, t) {
            do {
                if (e === d.NodeEventMesssageNS.eventBHOConfigInitFinished) {
                    if (this.isInit) {
                        t(this.isInit);
                        break
                    }
                    this.eventContainer.attachOnceListener(e, t);
                    break
                }
                this.eventContainer.attachListener(e, t)
            } while (0)
        }
    }

    t.BHOConfig = g;
    const p = new g;
    !function (e) {
        e.init = function () {
            return n(this, void 0, void 0, function* () {
                let e = f.getAppDataLocalLowPath();
                if (null !== e && void 0 !== e && "" !== e) {
                    let t = o.join(e, "Thunder Network\\Thunder\\BHO\\config.ini");
                    yield p.init(t)
                }
            })
        }, e.getDefaultExtendNames = function () {
            return ".asf;.avi;.exe;.iso;.mp3;.mpeg;.mpg;.mpga;.ra;.rar;.rm;.rmvb;.tar;.wma;.wmp;.wmv;.mov;.zip;.3gp;.chm;.mdf;.torrent;.jar;.msi;.arj;.bin;.dll;.psd;.hqx;.sit;.lzh;.gz;.tgz;.xlsx;.xls;.doc;.docx;.ppt;.pptx;.flv;.swf;.mkv;.tp;.ts;.flac;.ape;.wav;.aac;.txt;.dat;.7z;.ttf;.bat;.xv;.xvx;.pdf;.mp4;.apk;.ipa;.epub;.mobi;.deb;.sisx;.cab;.pxl;.xlb;.dmg;.msu;.bz2;"
        }, e.getDefaultFilterSitesForUI = function () {
            return "*.mail.live.com\n*.mail.yahoo.com\n*.mail.qq.com\n*.mail.sohu.com\n*.mail.google.com\n*.sinamail.sina.com.cn\n*.mail.sina.com.cn\n*.mail.163.com\n*.mail.10086.cn\n*.webmail30.189.cn\n*.www.126.com\n*.passport.alipay.com\n*.login.live.com\n*.mail.sogou.com\n*.web.mail.tom.com\n*.www.2980.com\n*.mail.21cn.com\n*.www.188.com\n*.yeah.net\n*.mail.wo.com.cn\n*.263.net\n*.ecitic.com\n*.pos.baidu.com"
        }, e.save = function () {
            return n(this, void 0, void 0, function* () {
                yield p.save()
            })
        }, e.saveSync = function () {
            p.saveSync()
        }, e.getValue = function (e, t, i) {
            return p.getValue(e, t, i)
        }, e.setValue = function (e, t, i) {
            p.setValue(e, t, i)
        }, e.attachListener = function (e, t) {
            p.attachListener(e, t)
        }, e.detachListener = function (e, t) {
            p.detachListener(e, t)
        }
    }(t.BHOConfigNS || (t.BHOConfigNS = {}))
}, function (e, t, i) {
    "use strict";
    var n;
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        e.Download = "download-panel", e.Cloud = "pan-plugin-view", e.Browser = "find-page"
    }(n = t.NavViewID || (t.NavViewID = {}));
    const a = {
        currentNav: n.Download,
        navs: [{content: "下载", icon: "xly-icon-nav-down", key: n.Download}, {
            content: "云盘",
            icon: "xly-icon-nav-cloud",
            key: n.Cloud
        }]
    }, o = {
        SELECT_NAV(e, t) {
            e.navs.some(e => e.key === t) && (e.currentNav = t, "find-page" === t ? this.commit("SHOW_OR_HIDE_BROWSER", !0, {root: !0}) : this.commit("SHOW_OR_HIDE_BROWSER", !1, {root: !0}))
        }
    };
    t.default = {state: a, mutations: o, getters: {currentNav: e => e.currentNav, navList: e => e.navs}}
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(67), o = i(4), r = i(0), s = i(19), l = r.default.getLogger("Thunder.MainRenderer.Tabs");
    t.createXDASTab = function (e) {
        let t = new a.Tab;
        return t.initTab(a.TabType.XDAS, e).catch(), t
    }, t.createNewTab = function (e, t, i) {
        return n(this, void 0, void 0, function* () {
            let n = new a.Tab;
            return !1 === (yield n.initTab(e, t, i)) && (n = null, l.error("init tab error")), n
        })
    }, t.createChromiumTab = function (e) {
        return n(this, void 0, void 0, function* () {
            let t = new a.Tab, i = {url: e};
            return !1 === (yield t.initTab(a.TabType.Chromium, i)) && (t = null, l.error("init tab error")), t
        })
    }, t.setDefaultListeners = function (e) {
        let t = !1;
        do {
            if (o.isNullOrUndefined(e)) {
                l.error("event listeners error");
                break
            }
            if (0 === e.length) {
                l.error("event listeners length error");
                break
            }
            a.Tab.defaultEventList = e, t = !0
        } while (0);
        return t
    }, function (e) {
        let t;
        !function (e) {
            e.Unknow = "Unknow", e.GotFocus = "GoFocus", e.RemoveTab = "RemoveTab", e.AddTab = "AddTab", e.ChangeTab = "ChangeTab", e.VisibleChange = "VisibleChange", e.CreateNewTab = "CreateNewTab", e.SelectTab = "SelectTab"
        }(t = e.EventType || (e.EventType = {}));
        let i = new s.EventEmitter;
        e.getEventEmitter = function () {
            return i
        }
    }(t.TabEventManagerNS || (t.TabEventManagerNS = {}));
    let d = 0;
    t.setCurrentTabID = function (e) {
        d = e
    }, t.getCurrentTabID = function () {
        return d
    }
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(18), o = i(0), r = i(19), s = i(2), l = i(24), d = i(6), u = i(16), c = i(10), h = i(13),
        f = d.default(s.join(__rootDir, "../bin/ThunderHelper.node")), g = o.default.getLogger("config-remote-global");
    const p = new class {
        constructor() {
            this.configJsonData = null, this.eventEmitter = new r.EventEmitter, this.inited = !1, this.token = 0
        }

        getBaseConfigUrl() {
            return n(this, void 0, void 0, function* () {
                return new Promise(e => {
                    c.ConfigNS.attachListener(h.NodeEventMesssageNS.eventConfigInitFinished, () => {
                        let t = c.ConfigNS.getValue("ConfigRemoteGlobal", "TestServer", !1);
                        e(t ? "http://47.107.16.212:3001/external/e095b1fb-6807-11e9-80e6-0242ac160003?" : "https://conf-m-ssl.xunlei.com/external/e095b1fb-6807-11e9-80e6-0242ac160003?")
                    })
                })
            })
        }

        getConfigUrl() {
            return n(this, void 0, void 0, function* () {
                let e = yield this.getBaseConfigUrl(), t = yield l.LoginHelperNS.loginHelper.getUserInfoAw("userid"),
                    i = {};
                t && "" !== t && (i["user-id"] = t);
                let n = this.getThunderVersion();
                if (n && "" !== n) {
                    i["version-name"] = n;
                    let e = n.split(".");
                    e && 4 === e.length && (i["version-code"] = e[3])
                }
                let a = f.getPeerID();
                a && "" !== a && (i["device-id"] = a, i["peer-id"] = a);
                let o = f.getChannelID();
                o && "" !== o && (i.channel = o), i["app-type"] = "pc";
                let r = (new Date).getTimezoneOffset();
                i["time-zome"] = (r / 60).toString(), i.language = window.navigator.language;
                let s = f.getOSVersion();
                i.os = s;
                let d = !0;
                for (let t in i) d ? d = !1 : e += "&", e += t + "=" + i[t];
                return g.information("getConfigUrl url:", e), e
            })
        }

        getThunderVersion() {
            let e = s.join(__rootDir, "../../Thunder.exe");
            return f.getFileVersion(e)
        }

        requestConfig() {
            return n(this, void 0, void 0, function* () {
                let e = null, t = null;
                try {
                    a.default.defaults.adapter = i(21);
                    let e = yield this.getConfigUrl();
                    t = yield a.default.get(e), g.information("url: ", e, ", response:", t)
                } catch (e) {
                    g.warning(e)
                }
                return t && 200 === t.status && t.data && "" !== t.data && "ok" === t.data.result && t.data.values && (e = t.data.values), e
            })
        }

        updateConfig() {
            return n(this, void 0, void 0, function* () {
                let e = ++this.token, t = yield this.requestConfig();
                e === this.token && (this.configJsonData = t, this.inited ? this.eventEmitter.emit("OnRemoteGlobalConfigUpdated", null !== this.configJsonData && void 0 !== this.configJsonData) : (this.inited = !0, this.eventEmitter.emit("OnRemoteGlobalConfigLoaded", null !== this.configJsonData && void 0 !== this.configJsonData)))
            })
        }

        init() {
            return n(this, void 0, void 0, function* () {
                u.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", this.updateConfig.bind(this)), u.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", this.updateConfig.bind(this));
                let e = this.token, t = yield this.requestConfig();
                e !== this.token || this.inited || (this.configJsonData = t, this.inited = !0, this.eventEmitter.emit("OnRemoteGlobalConfigLoaded", null !== this.configJsonData && void 0 !== this.configJsonData))
            })
        }

        isConfigExists(e, t) {
            let i = !1;
            do {
                if (null === this.configJsonData || void 0 === this.configJsonData) break;
                null === t || void 0 === t || "" === t ? null !== this.configJsonData[e] && void 0 !== this.configJsonData[e] && (i = !0) : null !== this.configJsonData[e] && void 0 !== this.configJsonData[e] && null !== this.configJsonData[e][t] && void 0 !== this.configJsonData[e][t] && (i = !0)
            } while (0);
            return i
        }

        getConfigValue(e, t, i) {
            let n = i;
            do {
                if (null === this.configJsonData || void 0 === this.configJsonData) break;
                null === t || void 0 === t || "" === t ? null !== this.configJsonData[e] && void 0 !== this.configJsonData[e] && (n = this.configJsonData[e]) : null !== this.configJsonData[e] && void 0 !== this.configJsonData[e] && null !== this.configJsonData[e][t] && void 0 !== this.configJsonData[e][t] && (n = this.configJsonData[e][t])
            } while (0);
            return n
        }

        attachListener(e, t) {
            this.eventEmitter.addListener(e, t)
        }

        detachListener(e, t) {
            this.eventEmitter.removeListener(e, t)
        }

        isInited() {
            return this.inited
        }

        isInitedAW() {
            return n(this, void 0, void 0, function* () {
                return new Promise(e => {
                    this.inited ? e(!0) : this.eventEmitter.once("OnRemoteGlobalConfigLoaded", t => {
                        e(!0)
                    })
                })
            })
        }
    };
    t.default = p
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(368), a = i(274);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    i(684);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\common\\generator-view\\conf-component\\conf-select.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(6), r = i(5), s = o.default(a.join(__rootDir, "../bin/ThunderHelper.node"));
    !function (e) {
        function t() {
            return n(this, void 0, void 0, function* () {
                let e = !0;
                do {
                    0;
                    let t = a.resolve(__rootDir, "../../log.ini");
                    if (!(yield r.FileSystemAWNS.existsAW(t))) {
                        e = !1;
                        break
                    }
                    e = "1" === s.readINI(t, "Log", "enable")
                } while (0);
                return e
            })
        }

        e.isDevToolsEnable = function () {
            return n(this, void 0, void 0, function* () {
                return t()
            })
        }, e.isLogEnable = t, e.getLogOutput = function () {
            return n(this, void 0, void 0, function* () {
                let e = process.env.TL_OUTPUT;
                do {
                    if (e && "" !== e) break;
                    let t = a.resolve(__rootDir, "../../log.ini");
                    if (!(yield r.FileSystemAWNS.existsAW(t))) break;
                    e = s.readINI(t, "Log", "output")
                } while (0);
                return e
            })
        }
    }(t.DevEnvHelperNS || (t.DevEnvHelperNS = {}))
}, function (e, t) {
    e.exports = require("net")
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(57), a = i(2);
    t.getDefaultPrex = function () {
        return a.basename(process.execPath, ".exe")
    }, t.getSockPath = function (e) {
        const t = n.tmpdir();
        let i = e;
        e || (i = a.basename(process.execPath, ".exe"));
        let o = a.join(t, `${i}-xunlei-node-net-ipc-{FD196984-2591-4588-AA6F-5C8AC1266290}.sock`);
        return "win32" === process.platform && (o = "\\\\.\\pipe\\" + (o = (o = o.replace(/^\//, "")).replace(/\//g, "-"))), o
    }, t.serverContextName = "xunlei-node-net-ipc-server-{46105371-DE78-4442-B59F-FDA1D6D7D430}", t.isObjectEmpty = function (e) {
        let t = !0;
        do {
            if (!e) break;
            if (0 === Object.keys(e).length) break;
            t = !1
        } while (0);
        return t
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        e[e.ValueNull = 0] = "ValueNull", e[e.ValueInt = 1] = "ValueInt", e[e.ValueBigint = 2] = "ValueBigint", e[e.ValueDouble = 3] = "ValueDouble", e[e.ValueString = 4] = "ValueString", e[e.ValueBlob = 5] = "ValueBlob"
    }(t.ValueType || (t.ValueType = {})), function (e) {
        e[e.StatementBengin = -1] = "StatementBengin", e[e.CreateTaskBase = 0] = "CreateTaskBase", e[e.CreateP2spTask = 1] = "CreateP2spTask", e[e.CreateBtTask = 2] = "CreateBtTask", e[e.CreateBtFile = 3] = "CreateBtFile", e[e.CreateEmuleTask = 4] = "CreateEmuleTask", e[e.CreateGroupTask = 5] = "CreateGroupTask", e[e.CreateMagnetTask = 6] = "CreateMagnetTask", e[e.DestroyTaskBase = 7] = "DestroyTaskBase", e[e.DestroyP2spTask = 8] = "DestroyP2spTask", e[e.DestroyBtTask = 9] = "DestroyBtTask", e[e.DestroyBtFile = 10] = "DestroyBtFile", e[e.DestroyEmuleTask = 11] = "DestroyEmuleTask", e[e.DestroyGroupTask = 12] = "DestroyGroupTask", e[e.DestroyMagnetTask = 13] = "DestroyMagnetTask", e[e.LoadTaskBase = 14] = "LoadTaskBase", e[e.LoadP2spTask = 15] = "LoadP2spTask", e[e.LoadBtTask = 16] = "LoadBtTask", e[e.LoadBtFile = 17] = "LoadBtFile", e[e.LoadEmuleTask = 18] = "LoadEmuleTask", e[e.LoadGroupTask = 19] = "LoadGroupTask", e[e.SetTaskSavePath = 20] = "SetTaskSavePath", e[e.SetTaskName = 21] = "SetTaskName", e[e.SetTaskNamingType = 22] = "SetTaskNamingType", e[e.SetTaskDescription = 23] = "SetTaskDescription", e[e.SetTaskCid = 24] = "SetTaskCid", e[e.SetTaskGcid = 25] = "SetTaskGcid", e[e.SetTaskStatus = 26] = "SetTaskStatus", e[e.SetTaskFileCreated = 27] = "SetTaskFileCreated", e[e.SetTaskFileSize = 28] = "SetTaskFileSize", e[e.SetTaskReceiveSize = 29] = "SetTaskReceiveSize", e[e.SetTaskDownloadSize = 30] = "SetTaskDownloadSize", e[e.SetTaskCompletionTime = 31] = "SetTaskCompletionTime", e[e.SetTaskDownloadingPeriod = 32] = "SetTaskDownloadingPeriod", e[e.SetTaskRemovingToRecycleTime = 33] = "SetTaskRemovingToRecycleTime", e[e.SetTaskFailureErrorCode = 34] = "SetTaskFailureErrorCode", e[e.SetTaskUserRead = 35] = "SetTaskUserRead", e[e.SetTaskOpenOnCompelete = 36] = "SetTaskOpenOnCompelete", e[e.SetTaskForbidden = 37] = "SetTaskForbidden", e[e.SetTaskUserData = 38] = "SetTaskUserData", e[e.SetTaskDownload = 39] = "SetTaskDownload", e[e.SetTaskOrigin = 40] = "SetTaskOrigin", e[e.SetTaskChannelInfo = 41] = "SetTaskChannelInfo", e[e.SetP2spTaskUseOriginOnly = 42] = "SetP2spTaskUseOriginOnly", e[e.SetP2spTaskThreadCount = 43] = "SetP2spTaskThreadCount", e[e.SetBtTaskSeedFile = 44] = "SetBtTaskSeedFile", e[e.SetBtFileInfo = 45] = "SetBtFileInfo", e[e.SetBtFileCid = 46] = "SetBtFileCid", e[e.SetBtFileUserRead = 47] = "SetBtFileUserRead", e[e.SetCategoryId = 48] = "SetCategoryId", e[e.LoadCategory = 49] = "LoadCategory", e[e.CreateCategory = 50] = "CreateCategory", e[e.SetCategoryPassword = 51] = "SetCategoryPassword", e[e.SetCategoryAccountPassword = 52] = "SetCategoryAccountPassword", e[e.SearchTaskByName = 53] = "SearchTaskByName", e[e.SearchTaskByBtDisplayName = 54] = "SearchTaskByBtDisplayName", e[e.SetBtFileFailureErrorCode = 55] = "SetBtFileFailureErrorCode", e[e.BatchFindP2spTask = 56] = "BatchFindP2spTask", e[e.BatchFindEmuleTask = 57] = "BatchFindEmuleTask", e[e.BatchFindBtTask = 58] = "BatchFindBtTask", e[e.BatchFindGroupTask = 59] = "BatchFindGroupTask", e[e.BatchLoadBtFile = 60] = "BatchLoadBtFile", e[e.SetTaskPlayPosition = 61] = "SetTaskPlayPosition", e[e.SetTaskDuration = 62] = "SetTaskDuration", e[e.SetBtFilePlayPosition = 63] = "SetBtFilePlayPosition", e[e.SetBtFileDuration = 64] = "SetBtFileDuration", e[e.SetYunTaskId = 65] = "SetYunTaskId", e[e.StatementEnd = 66] = "StatementEnd"
    }(t.StatementType || (t.StatementType = {}))
}, function (e, t) {
    e.exports = require("http")
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(0), a = i(9), o = i(3), r = i(3), s = i(414), l = i(11), d = i(15),
        u = n.default.getLogger("download-jammed"), c = l.DownloadKernelTaskManager.getTaskManager(),
        h = d.DownloadKernelEventManager.getEventManager(), f = 3, g = 10;
    const p = new class {
        constructor() {
            this.taskListInfo = {}, this.removeTaskIdList = {}, this.recordTaskRestartList = {}, this.stopPendingTaskList = {}, this.refreshInfoTimerId = void 0
        }

        isStopPending(e) {
            let t = !1;
            return this.stopPendingTaskList.hasOwnProperty(String(e)) && (t = this.stopPendingTaskList[e]), t
        }

        isJammedOnce(e) {
            let t = !1;
            return this.recordTaskRestartList.hasOwnProperty(String(e)) && (t = !0), t
        }

        attach() {
            this.startRefreshTaskListInfoTimer(), this.attachTaskEvent()
        }

        isJammed(e) {
            let t = !1;
            do {
                let i = e.taskTotalSize;
                if (i <= 0) break;
                let n = e.receiveValidDataSize;
                if (n <= 0) break;
                let a = 100 * n / i;
                if (a >= 99.9 && a < 100) {
                    t = !0;
                    break
                }
            } while (0);
            return t
        }

        constructJammedTaskInfo(e) {
            let t = null;
            do {
                let i = c.getTaskFromTaskId(e);
                if (!i) break;
                if (i.getTaskStatus() !== o.DownloadKernel.TaskStatus.Started) break;
                let n = i.getTaskAttribute(o.DownloadKernel.TaskAttribute.FileSize),
                    a = i.getTaskAttribute(o.DownloadKernel.TaskAttribute.DownloadSize);
                t = {
                    taskId: e,
                    taskTotalSize: n,
                    receiveDataSize: i.getTaskAttribute(o.DownloadKernel.TaskAttribute.ReceivedSize),
                    receiveValidDataSize: a,
                    addReceiveDataSize: 0,
                    time: 0,
                    peering: i.getTaskAttribute(o.DownloadKernel.TaskAttribute.SrcUsing)
                }
            } while (0);
            return t
        }

        getExistJammedTaskInfo(e) {
            let t = null;
            do {
                if (!e) break;
                let i = e.getId();
                this.taskListInfo.hasOwnProperty(String(i)) && (t = this.taskListInfo[i])
            } while (0);
            return t
        }

        getNewJammedTaskInfo(e) {
            let t = null;
            do {
                if (!e) break;
                let i = e.taskId, n = this.constructJammedTaskInfo(i);
                if (!n) break;
                let a = e.time;
                if (n.receiveValidDataSize > e.receiveValidDataSize) {
                    t = n;
                    break
                }
                let o = n.receiveDataSize - e.receiveDataSize;
                o > e.addReceiveDataSize ? a = 0 : 0 === n.peering ? a = 0 : a += 1, t = {
                    taskId: i,
                    taskTotalSize: n.taskTotalSize,
                    peering: n.peering,
                    time: a,
                    receiveValidDataSize: e.receiveValidDataSize,
                    receiveDataSize: e.receiveDataSize,
                    addReceiveDataSize: o
                }
            } while (0);
            return t
        }

        handleTaskByNewInfo(e) {
            let t = !1;
            do {
                if (!e) break;
                if (!this.isJammed(e)) {
                    u.information("jammed false", e.taskId, e.taskTotalSize);
                    break
                }
                if (e.time === g && e.receiveValidDataSize >= e.taskTotalSize) {
                    u.information("already 10 seconds but still no speed", e.taskId, e.taskTotalSize), this.restartTask(e.taskId);
                    break
                }
                let i = .05 * e.taskTotalSize;
                if (e.addReceiveDataSize > i) {
                    u.information("addReceiveDataSize over %5", e.addReceiveDataSize, e.taskTotalSize), this.restartTask(e.taskId);
                    break
                }
                t = !0
            } while (0);
            return t
        }

        addJammedTaskInfo(e, t) {
            this.taskListInfo[e] = t
        }

        removeTaskListInfoById(e) {
            this.taskListInfo.hasOwnProperty(String(e)) && (delete this.taskListInfo[e], this.setIsRemoveTaskId(e))
        }

        removeTaskListInfoByTask(e) {
            let t = e.getId();
            this.taskListInfo.hasOwnProperty(String(t)) && delete this.taskListInfo[t]
        }

        setIsRemoveTaskId(e) {
            this.removeTaskIdList.hasOwnProperty(String(e)) || (this.removeTaskIdList[e] = 0)
        }

        getIsRemoveTaskId(e) {
            let t = 0;
            return this.removeTaskIdList.hasOwnProperty(String(e)) && (t = this.removeTaskIdList[e], this.removeTaskIdList[e] = t + 1), t
        }

        getRestartCountById(e) {
            let t = 0;
            return this.recordTaskRestartList.hasOwnProperty(String(e)) && (t = this.recordTaskRestartList[e]), t
        }

        addRestartCountById(e) {
            this.recordTaskRestartList.hasOwnProperty(String(e)) || (this.recordTaskRestartList[e] = 0), this.recordTaskRestartList[e] = this.recordTaskRestartList[e] + 1
        }

        restartTask(e) {
            do {
                if (this.getRestartCountById(e) >= f) {
                    u.information("restart break beacause reach max restart");
                    break
                }
                this.addRestartCountById(e), this.addStopPending(e);
                let t = c.getTaskFromTaskId(e);
                s.statCoreEvent(t, "download_jammed").catch(), c.stopTaskAW(e, o.DownloadKernel.TaskStopReason.TaskJammed).then(t => {
                    t && c.startTask(e)
                }).catch()
            } while (0)
        }

        addStopPending(e) {
            this.stopPendingTaskList[e] = !0
        }

        removeStopPending(e) {
            this.isStopPending(e) && delete this.stopPendingTaskList[e]
        }

        startRefreshTaskListInfoTimer() {
            void 0 !== this.refreshInfoTimerId && (clearInterval(this.refreshInfoTimerId), this.refreshInfoTimerId = void 0), this.refreshInfoTimerId = setInterval(() => {
                do {
                    if (!this.taskListInfo) break;
                    if (0 === Object.keys(this.taskListInfo).length) break;
                    let e = [];
                    for (let t in this.taskListInfo) {
                        let i = this.taskListInfo[t];
                        if (!i) continue;
                        let n = this.getNewJammedTaskInfo(i);
                        this.handleTaskByNewInfo(n) ? this.addJammedTaskInfo(i.taskId, n) : e.push(i.taskId)
                    }
                    for (let t of e) this.removeTaskListInfoById(t)
                } while (0)
            }, 1e3)
        }

        attachTaskEvent() {
            h.attachTaskEvent(o.DownloadKernel.TaskEventType.StatusChanged, (...e) => {
                do {
                    if (!e) break;
                    if (e[0] !== o.DownloadKernel.TaskEventType.StatusChanged) break;
                    let t = e[1];
                    if (!t) break;
                    if (0 === t.length) break;
                    for (let e = 0; e < t.length; ++e) {
                        let i = t[e];
                        if (!i) continue;
                        if (i.getTaskAttribute(o.DownloadKernel.TaskAttribute.Background)) continue;
                        let n = i.getTaskStatus();
                        n !== o.DownloadKernel.TaskStatus.StopPending && n !== o.DownloadKernel.TaskStatus.Stopped || this.removeTaskListInfoByTask(i), n === o.DownloadKernel.TaskStatus.Started && this.removeStopPending(i.getId())
                    }
                } while (0)
            }), h.attachTaskEvent(o.DownloadKernel.TaskEventType.DetailChanged, (...e) => {
                do {
                    if (!e) break;
                    if (e[0] !== o.DownloadKernel.TaskEventType.DetailChanged) break;
                    if (!e[1]) break;
                    let t = e[1];
                    if (!t) break;
                    for (let e of t) {
                        let t = e.getId(), i = this.constructJammedTaskInfo(t);
                        if (!i) continue;
                        if (!this.isJammed(i)) continue;
                        if (this.getExistJammedTaskInfo(e)) continue;
                        let n = this.getIsRemoveTaskId(t);
                        n && (n > 15 || n % 5 != 0) || (u.information("detailchange to add"), this.addJammedTaskInfo(t, i))
                    }
                } while (0)
            })
        }
    };
    const v = new class {
        constructor() {
            this.map = {}, this.validationSizeList = [], h.attachTaskEvent(r.DownloadKernel.TaskEventType.StatusChanged, this.onTaskStatusChanged.bind(this)), h.attachTaskEvent(r.DownloadKernel.TaskEventType.DetailChanged, this.onTaskDetailChanged.bind(this))
        }

        isValidatingFileData(e) {
            let t = this.map[e];
            return !!t && !!t.isValidating
        }

        getValidationDuration(e) {
            let t = this.map[e], i = null;
            return t && t.isValidating && (i = {remainSeconds: t.validation.remainSeconds}), i
        }

        isCorrectingPieces(e) {
            let t = this.map[e];
            return !!t && !!t.isCorrecting
        }

        onTaskStatusChanged(e, t) {
            for (let e of t) {
                if (e.getTaskAttribute(o.DownloadKernel.TaskAttribute.Background)) continue;
                let t = e.getId(), i = e.getTaskStatus();
                if (i === r.DownloadKernel.TaskStatus.StopPending || i === r.DownloadKernel.TaskStatus.Stopped) delete this.map[t]; else if (i === r.DownloadKernel.TaskStatus.Succeeded || i === r.DownloadKernel.TaskStatus.Failed) {
                    if (this.isValidatingFileData(t) && i === r.DownloadKernel.TaskStatus.Succeeded) {
                        let e = this.map[t], i = Date.now() - e.validation.startTime;
                        a.XLStatNS.trackEvent("download_leftpanel", "check_data_end", "", 0, 0, 0, 0, "dur=" + i)
                    }
                    delete this.map[t]
                }
            }
        }

        calcValidatingSpeed(e) {
            return this.validationSizeList.length > 6 && this.validationSizeList.splice(0, 1), this.validationSizeList.push(e), this.validationSizeList.reduce((e, t) => e + t) / this.validationSizeList.length
        }

        updateValidationInfo(e) {
            let t = e.taskId;
            e.isValidating = !1, e.dlSize >= e.fileSize && e.validSize < e.fileSize && (e.isValidating = !0);
            let i = this.map[t];
            if (i && i.isValidating) {
                let t = e.validSize - i.validSize, n = this.calcValidatingSpeed(t), a = e.fileSize - e.validSize,
                    o = n > 0 ? Math.round(a / n) : 1 / 0;
                e.validation.remainSize = a, e.validation.speed = n, e.validation.remainSeconds = o
            }
            e.isValidating && (i && i.isValidating || (e.validation.startTime = Date.now(), a.XLStatNS.trackEvent("download_leftpanel", "checking_data", "", 0, 0, 0, 0, ""))), window.__validating && (e.isValidating = !0)
        }

        updateCorrectionInfo(e) {
            let t = e.taskId, i = this.map[t];
            i && (i.isCorrecting ? e.realSize >= e.dlSize ? (e.isCorrecting = !1, u.error("DownloadKernel. correcting down")) : e.isCorrecting = !0 : e.isCorrecting = i.realSize > e.realSize, e.isCorrecting && (i && i.isCorrecting || (a.XLStatNS.trackEvent("download_leftpanel", "data_error_correction", "", 0, 0, 0, 0, ""), e.dlSize < e.fileSize && a.XLStatNS.trackEvent("download_leftpanel", "data_error_correction_icon_show", "", 0, 0, 0, 0, ""))), window.__correcting && (e.isCorrecting = !0), i.isCorrecting !== e.isCorrecting && u.error("DownloadKernel. correction state changed. from ", i.isCorrecting, " ==> ", e.isCorrecting))
        }

        onTaskDetailChanged(e, t, i) {
            for (let e of t) {
                if (e.getTaskAttribute(o.DownloadKernel.TaskAttribute.Background)) continue;
                if (e.getTaskStatus() !== r.DownloadKernel.TaskStatus.Started) continue;
                let t = e.getId(), i = e.getTaskAttribute(o.DownloadKernel.TaskAttribute.DownloadSize),
                    n = e.getTaskAttribute(o.DownloadKernel.TaskAttribute.RealDownloadSize),
                    a = e.getTaskAttribute(o.DownloadKernel.TaskAttribute.ValidDownloadSize),
                    s = e.getTaskAttribute(o.DownloadKernel.TaskAttribute.FileSize), l = {
                        taskId: t,
                        dlSize: i,
                        realSize: n,
                        validSize: a,
                        fileSize: s,
                        validation: {remainSize: s - a, speed: 0, remainSeconds: 1 / 0},
                        isCorrecting: !1,
                        isValidating: !1
                    };
                this.updateValidationInfo(l), this.updateCorrectionInfo(l), this.map[t] ? Object.assign(this.map[t], l) : this.map[t] = l
            }
        }
    };
    !function (e) {
        e.init = function () {
            p.attach()
        }, e.isStopPending = function (e) {
            return p.isStopPending(e)
        }, e.isJammedOnce = function (e) {
            return p.isJammedOnce(e)
        }, e.isValidatingFileData = function (e) {
            return v.isValidatingFileData(e)
        }, e.getValidationDuration = function (e) {
            return v.getValidationDuration(e)
        }, e.isCorrectingData = function (e) {
            return v.isCorrectingPieces(e)
        }
    }(t.DownloadJammedNS || (t.DownloadJammedNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        e.PRE_NEW_TASK = "pre-newtask-dlg", e.BT_NEW_TASK = "bt-newtask-dlg", e.NEW_TASK = "newtask-dlg", e.LOGIN = "login-dlg", e.BROWSER_GUIDE = "browser-guide-dlg", e.SIGN = "sign-dlg"
    }(t.PopView || (t.PopView = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(77), o = i(10), r = i(0), s = i(22), l = i(12), d = i(9), u = i(89), c = i(7),
        h = r.default.getLogger("Bt-task-renderer");

    class f {
        constructor() {
            this.isPopWndExist = !1, this.isManualPopUp = !1
        }

        whetherShowEntry() {
            return this.getBrowserInfos().length > 0
        }

        whetherPopUp() {
            let e, t = this.getBrowserInfos(), i = "";
            if (t && t.length > 0) for (let n = 0; n < t.length; n++) if (t[n].browserName) {
                if (!(i = t[n].browserName.startsWith("360") ? t[n].browserName : "other")) continue;
                if (e = o.ConfigNS.getValue("ThunderFirstInstall", `IsFirstInstall${i}`, 1), h.information(`是否是第一次安装${i}: `, e), 1 === e) break
            }
            return 1 === e
        }

        popUpBrowserGuide(e) {
            return n(this, void 0, void 0, function* () {
                if (this.isPopWndExist) return;
                this.isManualPopUp = e;
                const t = yield l.asyncRemoteCall.getCurrentWindow();
                t && !(yield t.isVisible()) ? t.once("show", () => {
                    setTimeout(() => {
                        this.interalShow().catch()
                    }, 1e3)
                }) : this.interalShow().catch()
            })
        }

        interalShow() {
            return n(this, void 0, void 0, function* () {
                this.isPopWndExist = !0, !0 !== this.isManualPopUp && d.XLStatNS.trackEvent("setting_center", "use_xl_download_show", "", 0, 0, 0, 0), yield s.MessageBox.custom("BrowserConfigGuide", {isManual: this.isManualPopUp}, {modal: !1}), c.client.callServerFunction("ClosePopMutual", u.PopView.BROWSER_GUIDE).catch(), this.isPopWndExist = !1
            })
        }

        getBrowserInfos() {
            let e = [], t = a.SettingConfigHelperNS.configBrowserHelper.getWatchBrowerByName("360安全浏览器");
            t && e.push(t);
            let i = a.SettingConfigHelperNS.configBrowserHelper.getWatchBrowerByName("搜狗浏览器");
            i && e.push(i);
            let n = a.SettingConfigHelperNS.configBrowserHelper.getWatchBrowerByName("QQ浏览器");
            return n && e.push(n), h.information("已安装的浏览器:", e), e
        }
    }

    t.default = function () {
        return f.instance || (f.instance = new f), f.instance
    }
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(17), o = i(310), r = i(12), s = i(2), l = i(16), d = i(312), u = i(423), c = i(0), h = i(4), f = i(34),
        g = i(20), p = i(7), v = i(54), m = i(6), y = c.default.getLogger("Thunder.Main.Renderer.Embedded.Browser"),
        k = m.default(s.join(__rootDir, "../bin/ThunderHelper.node"));
    t.EmbeddedBrowser = class {
        constructor() {
            this.isAlreadyClose = !1, this.width = 460, this.height = 500, this.browserCtr = null, this.wnd = null, this.leftMargin = 5, this.rigthMargin = 5, this.topMargin = 58, this.bottomMargin = 2, this.callBackShow = null, this.callBackClose = null, this.callBackClosed = null, this.browserEventHandler = null, this.isAutoShow = !0, this.autoCloseAtError = !0, this.isTopLevel = !1, this.isToolWindow = !1, this.attachListener().catch()
        }

        createWnd(e, t, i, s, l, c, f, m, y, T, w, C, S, b, I, _, A, D) {
            return n(this, void 0, void 0, function* () {
                do {
                    if (yield this.isWindow()) {
                        if (!h.isNullOrUndefined(this.browserCtr)) {
                            let e = this.browserCtr.getBrowser();
                            if (!h.isNullOrUndefined(e)) {
                                e.refresh(), this.isAutoShow && this.showWnd().catch();
                                break
                            }
                            yield this.closeWnd()
                        }
                        yield this.closeWnd()
                    }
                    this.isAlreadyClose = !1, this.width = l, this.height = c, this.leftMargin = f, this.rigthMargin = m, this.topMargin = y, this.bottomMargin = T, this.callBackShow = C, this.callBackClose = S, this.callBackClosed = b;
                    let x = "development" === process.env.RUN_ENV ? "http://localhost:9080/embedded-browser-renderer/" : `file:///${__dirname}/../embedded-browser-renderer/index.html`;
                    x += `?browserType=${s}&title=${t}&minimizable=${_ ? 1 : 0}`;
                    let N = yield r.asyncRemoteCall.getCurrentWindow(), E = this.isTopLevel ? null : N,
                        P = yield r.asyncRemoteCall.getBrowserWindow();
                    this.wnd = yield new P({
                        width: this.width,
                        height: this.height,
                        resizable: !1,
                        frame: !1,
                        parent: E,
                        center: !this.startX || !this.startY,
                        show: !1,
                        modal: i,
                        alwaysOnTop: I,
                        minimizable: !!_,
                        webPreferences: {
                            webSecurity: "development" !== process.env.RUN_ENV,
                            preload: `file:///${__rootDir}/out/plugin-boot.js`
                        }
                    }), a.ipcRenderer.send("embedded-browser-create", this.wnd.id, this.isTopLevel), this.isTopLevel || d.ThunderWindowNS.fitWindowPosInParent(this.wnd, N).catch(), this.browserCtr = new o.BrowserCtrl, this.wnd.once("show", () => {
                        if (A && A.length > 0) {
                            let e = `EmbeddedBrowserRendererContext${s}`;
                            g.server.isRemoteClientExist(e) && p.client.callRemoteClientFunction(e, "AddMenu", A).catch()
                        }
                    }), this.wnd.once("ready-to-show", () => n(this, void 0, void 0, function* () {
                        if (!(yield this.isWindow())) return;
                        this.isAutoShow && this.showWnd().catch();
                        let t = (yield this.wnd.getNativeWindowHandle()).readUIntLE(0, 4),
                            i = u.CommonFunctionNs.getBrowserWindowRect(t, this.width, this.height, this.leftMargin, this.rigthMargin, this.topMargin, this.bottomMargin);
                        this.browserCtr.createChromiumBrowser(t, e, !1, i, this.getDefaultEvents()).catch(), this.browserCtr.setNativeOptions(D), this.registerNativeFunctions(w), k.setWindowLong(t, v.SetWindowType.GWL_STYLE, v.WindowStyle.WS_CLIPCHILDREN), this.isToolWindow && k.setWindowLong(t, v.SetWindowType.GWL_EXSTYLE, v.WindowStyleEx.WS_EX_TOOLWINDOW)
                    })), this.wnd.on("resize", () => {
                        this.browserCtr.getBrowser() && u.CommonFunctionNs.resizeBrowserWindow(this.browserCtr.getBrowser().getWindowHandle(), this.width, this.height, this.leftMargin, this.rigthMargin, this.topMargin, this.bottomMargin)
                    }), this.wnd.on("move", () => {
                        this.browserCtr && this.browserCtr.getBrowser() && u.CommonFunctionNs.resizeBrowserWindow(this.browserCtr.getBrowser().getWindowHandle(), this.width, this.height, this.leftMargin, this.rigthMargin, this.topMargin, this.bottomMargin)
                    }), this.wnd.once("show", () => {
                        this.wnd.setSize(this.width, this.height)
                    }), this.wnd.once("close", () => {
                        null !== this.callBackClose && void 0 !== this.callBackClose && "function" == typeof this.callBackClose && this.callBackClose().catch(), this.browserCtr && this.browserCtr.destroyBrowser(!1)
                    }), this.wnd.once("closed", () => {
                        null !== this.callBackClosed && void 0 !== this.callBackClosed && "function" == typeof this.callBackClosed && this.callBackClosed(), this.isAlreadyClose = !1, this.wnd = null, this.browserCtr = null
                    }), yield this.wnd.loadURL(x)
                } while (0)
            })
        }

        setToolWindow(e) {
            this.isToolWindow = e
        }

        setBrowserEventHandler(e) {
            this.browserEventHandler = e
        }

        setWindowTopLevel(e) {
            this.isTopLevel = e
        }

        setStartPosition(e, t) {
            this.startX = e, this.startY = t
        }

        getWnd() {
            return this.wnd
        }

        bringToTop() {
            let e = this.getWnd();
            h.isNullOrUndefined(e) || f.ToolsUtilitiesAWNS.setForegroundWindow(k, e).catch()
        }

        closeWnd() {
            return n(this, void 0, void 0, function* () {
                (yield this.isWindow()) && !1 === this.isAlreadyClose && (this.isAlreadyClose = !0, yield this.wnd.close())
            })
        }

        minimizeWnd() {
            return n(this, void 0, void 0, function* () {
                (yield this.isWindow()) && (yield this.wnd.minimize())
            })
        }

        setWndSize(e, t) {
            return n(this, void 0, void 0, function* () {
                (yield this.isWindow()) && (this.width = e, this.height = t, yield this.wnd.setSize(e, t))
            })
        }

        getWndPosition() {
            return n(this, void 0, void 0, function* () {
                return (yield this.isWindow()) ? this.wnd.getPosition() : [0, 0]
            })
        }

        setWndPosition(e, t) {
            return n(this, void 0, void 0, function* () {
                if (yield this.isWindow()) return this.wnd.setPosition(e, t)
            })
        }

        centerWnd() {
            return n(this, void 0, void 0, function* () {
                (yield this.isWindow()) && (yield this.wnd.center())
            })
        }

        hideWnd() {
            return n(this, void 0, void 0, function* () {
                (yield this.isWindow()) && (yield this.wnd.hide())
            })
        }

        showWnd(e) {
            return n(this, void 0, void 0, function* () {
                (yield this.isWindow()) && (null !== this.callBackShow && void 0 !== this.callBackShow && "function" == typeof this.callBackShow ? (yield this.callBackShow()) ? e ? yield this.wnd.showInactive() : yield this.wnd.show() : yield this.closeWnd() : e ? yield this.wnd.showInactive() : yield this.wnd.show())
            })
        }

        setAutoShow(e) {
            this.isAutoShow = e
        }

        setAutoCloseAtError(e) {
            this.autoCloseAtError = e
        }

        setMinimizable(e) {
            return n(this, void 0, void 0, function* () {
                (yield this.isWindow()) && (yield this.wnd.setMinimizable(e))
            })
        }

        setMaximizable(e) {
            return n(this, void 0, void 0, function* () {
                (yield this.isWindow()) && (yield this.wnd.setMaximizable(e))
            })
        }

        registerNativeFunction(e, t) {
            do {
                if (null === this.browserCtr || void 0 === this.browserCtr) break;
                if (null === e || void 0 === e || "" === e) break;
                if (null === t || void 0 === t) break;
                this.browserCtr.registerNativeFunction(e, t, !0)
            } while (0)
        }

        getBrowserObj() {
            return this.browserCtr
        }

        onLoadError(e, t, i, a, o, r) {
            return n(this, void 0, void 0, function* () {
                if (y.information("OnLoadError isMainFrame, errorCode, isAlreadyClose, url: ", t, a, this.isAlreadyClose, i), (yield this.isWindow()) && t) if (-3 === a) {
                    let t = e.target.getWindowHandle();
                    k.showWindow(t, v.CmdShow.SW_SHOW)
                } else !1 === this.isAlreadyClose && this.autoCloseAtError && (yield this.closeWnd());
                this.browserEventHandler && t && this.browserEventHandler("OnLoadError", t, i, a, o, r)
            })
        }

        onLoadEnd(e, t, i, a, o) {
            return n(this, void 0, void 0, function* () {
                if (y.information("OnLoadEnd isMainframe", t, i), (yield this.isWindow()) && t) {
                    let t = e.target.getWindowHandle();
                    k.showWindow(t, v.CmdShow.SW_SHOW)
                }
                this.browserEventHandler && t && this.browserEventHandler("OnLoadEnd", t, i, a, o)
            })
        }

        onBeforeNavigate(e, t, i, a) {
            return n(this, void 0, void 0, function* () {
                if (y.information("OnBeforeNavigate isMainframe", t, i), (yield this.isWindow()) && t) {
                    let t = e.target.getWindowHandle();
                    k.showWindow(t, v.CmdShow.SW_HIDE)
                }
                this.browserEventHandler && this.browserEventHandler("OnBeforeNavigate", t, i, a)
            })
        }

        onNewBrowserPopup(e, t, i, n, a, o) {
            y.information("onNewBrowserPopup url", i);
            let r = !1;
            this.browserEventHandler && (r = this.browserEventHandler("OnNewBrowserPopup", i)), r || p.client.callServerFunction("openNewTab", i).catch()
        }

        getDefaultEvents() {
            return [{eventName: "before-nav", listener: this.onBeforeNavigate.bind(this)}, {
                eventName: "load-error",
                listener: this.onLoadError.bind(this)
            }, {eventName: "load-end", listener: this.onLoadEnd.bind(this)}, {
                eventName: "new-browser-popup",
                listener: this.onNewBrowserPopup.bind(this)
            }]
        }

        attachListener() {
            return n(this, void 0, void 0, function* () {
                l.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", e => {
                    null !== this.browserCtr && void 0 !== this.browserCtr && this.browserCtr.fireEvent("OnUserLogin", e)
                }), l.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", e => {
                    null !== this.browserCtr && void 0 !== this.browserCtr && this.browserCtr.fireEvent("OnUserLogout", e)
                }), (yield r.asyncRemoteCall.getIpcMain()).on("eventShowDevTool", (e, t) => n(this, void 0, void 0, function* () {
                    "browser" === t ? null !== this.browserCtr && void 0 !== this.browserCtr && this.browserCtr.showDevTool(!0) : "wnd" === t && (yield this.isWindow()) && (yield function (e) {
                        return n(this, void 0, void 0, function* () {
                            null !== e && ((yield e.webContents.isDevToolsOpened()) ? e.webContents.closeDevTools() : e.webContents.openDevTools({mode: "undocked"}))
                        })
                    }(this.wnd))
                }))
            })
        }

        isWindow() {
            return n(this, void 0, void 0, function* () {
                let e = !1;
                return this.wnd && !(yield this.wnd.isDestroyed()) && (e = !0), e
            })
        }

        registerNativeFunctions(e) {
            do {
                if (null === this.browserCtr || void 0 === this.browserCtr) break;
                if (null === e || void 0 === e || e.length <= 0) break;
                for (let t = 0; t < e.length; ++t) this.browserCtr.registerNativeFunction(e[t].functionName, e[t].nativeFunc, !0)
            } while (0)
        }
    }
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(19), o = i(2), r = i(53), s = i(0), l = i(12), d = s.default.getLogger("Browser"),
        u = require || i(526);

    function c() {
        return n(this, void 0, void 0, function* () {
            let e = yield(yield l.asyncRemoteCall.getApp()).getAppPath();
            return window.__rootDir ? window.__rootDir : e
        })
    }

    function h(e) {
        let t = process.env.PATH.split(";");
        -1 === t.indexOf(e) && (t.splice(0, 0, e), process.env.PATH = t.join(";"))
    }

    function f(e) {
        let t = process.env.PATH.split(";"), i = t.indexOf(e);
        -1 !== i && (t.splice(i, 1), process.env.PATH = t.join(";"))
    }

    let g = null;
    const p = new Proxy(function () {
    }, {
        getPrototypeOf: e => g ? Reflect.getPrototypeOf(g.Browser) : null,
        setPrototypeOf: (e, t) => g ? Reflect.setPrototypeOf(g.Browser, t) : null,
        isExtensible: e => !!g && Reflect.isExtensible(g.Browser),
        preventExtensions: e => !!g && Reflect.preventExtensions(g.Browser),
        getOwnPropertyDescriptor: (e, t) => g ? Reflect.getOwnPropertyDescriptor(g.Browser, t) : null,
        has: (e, t) => !!g && Reflect.has(g.Browser, t),
        deleteProperty: (e, t) => !!g && Reflect.deleteProperty(g.Browser, t),
        defineProperty: (e, t, i) => !!g && Reflect.defineProperty(e.Browser, t, i),
        get: (e, t, i) => {
            let n = g ? Reflect.get(g.Browser, t, i) : null;
            return "function" == typeof n ? n.bind(g.Browser) : n
        },
        set: (e, t, i, n) => !!g && Reflect.set(g.Browser, t, n),
        ownKeys: e => g ? Reflect.ownKeys(g.Browser) : [],
        apply: (e, t, i) => {
            throw new Error("only allow calling Browser as constructor ")
        },
        construct: (e, t, i) => g ? Reflect.construct(g.Browser, t, i) : null
    });
    Object.defineProperty(e.exports, "Browser", {value: p}), t.context = new class extends a.EventEmitter {
        constructor() {
            super(...arguments), this.ctx = null, this.dead = !1
        }

        init(e) {
            return n(this, void 0, void 0, function* () {
                let t = !1;
                do {
                    if (d.information("[tbc] init", e, g), null === g) {
                        let i = yield c(), n = e.tbc_dir ? e.tbc_dir : o.join(i, "../bin/TBC"),
                            r = o.join(n, "libCef.dll");
                        if (!(t = yield this.fileExists(r))) break;
                        let s = e.node_module_path ? e.node_module_path : o.join(i, "../bin/TBC/xlbrowsernode.node");
                        if (!(t = yield this.fileExists(s))) break;
                        if (d.information("[tbc] myRequire", s), h(n), g = u(s), f(n), d.information("[tbc] myRequire tbcModule", g), !g) {
                            t = !1;
                            break
                        }
                        global.tbcModule = g, Object.setPrototypeOf(g.Context.prototype, a.EventEmitter.prototype), Object.setPrototypeOf(g.Browser.prototype, a.EventEmitter.prototype), this.ctx = new g.Context, this.ctx.on("init-done", (...e) => {
                            this.emit("init-done", ...e)
                        }), this.ctx.on("will-uninit", (...e) => {
                            this.emit("will-uninit", ...e)
                        }), this.ctx.on("uninit", (...e) => {
                            this.emit("uninit", ...e)
                        }), this.ctx.on("browser-created", (...e) => {
                            this.emit("browser-created", ...e)
                        }), this.ctx.on("browser-destroyed", (...e) => {
                            this.emit("browser-destroyed", ...e)
                        }), d.information("[tbc] innerInit"), t = yield this.innerInit(e), d.information("[tbc] innerInit", t)
                    }
                } while (0);
                return t
            })
        }

        uninit() {
            this.ctx && !this.dead && (this.dead = !0, this.ctx.uninit())
        }

        getUserAgent() {
            return this.ctx ? this.ctx.getUserAgent() : ""
        }

        innerInit(e) {
            return n(this, void 0, void 0, function* () {
                return new Promise((t, i) => {
                    d.information("[tbc] this.ctx.init"), this.ctx.init(e, e => {
                        d.information("[tbc] this.ctx.init", e), t(e)
                    })
                })
            })
        }

        fileExists(e) {
            return n(this, void 0, void 0, function* () {
                return new Promise((t, i) => {
                    r.exists(e, e => {
                        t(e)
                    })
                })
            })
        }
    }, function (e) {
        for (var i in e) t.hasOwnProperty(i) || (t[i] = e[i])
    }(i(527))
}, function (e, t) {
    e.exports = require("child_process")
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(6).default(a.join(__rootDir, "../bin/ThunderHelper.node"));
    !function (e) {
        e.uncompressZipFile = function (e, t) {
            return n(this, void 0, void 0, function* () {
                return new Promise(i => {
                    o.asyncUnZipFile(t, e, e => {
                        i(e)
                    })
                })
            })
        }
    }(t.UnzipUtilitiesAWNS || (t.UnzipUtilitiesAWNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(10), o = i(30), r = i(22), s = i(37), l = i(0).default.getLogger("DownloadMode");
    !function (e) {
        let t = void 0, i = void 0;

        function d() {
            void 0 !== t && (clearTimeout(t), t = void 0), void 0 !== i && (clearTimeout(i), i = void 0)
        }

        function u(e, t) {
            l.information("setSpeedLimit Enter maxDownloadSpeed = ", e, "maxUploadSpeed = ", t), o.DownloadKernelManager.setDownloadSpeedLimit(e), o.DownloadKernelManager.setUploadSpeedLimit(t)
        }

        function c() {
            return a.ConfigNS.getValue("ConfigNet", "ConfigNet_Type", "1")
        }

        function h(e) {
            l.information("setCustomDownloadMode Enter"), a.ConfigNS.setValue("ConfigNet", "ConfigNet_Custom_DownloadSpeedChk", e.maxDownloadSpeedEnabled.value), a.ConfigNS.setValue("ConfigNet", "ConfigNet_Custom_UploadSpeedChk", e.maxUploadSpeedEnabled.value);
            let t = 51200, i = 2048;
            if (t = Number(e.maxDownloadSpeed.value) || 1024, a.ConfigNS.setValue("ConfigNet", "ConfigNet_Custom_MaxDownloadSpeedTmp", t), i = Number(e.maxUploadSpeed.value) || 1024, a.ConfigNS.setValue("ConfigNet", "ConfigNet_Custom_MaxUploadSpeedTmp", i), e.maxDownloadSpeedEnabled.value ? a.ConfigNS.setValue("ConfigNet", "ConfigNet_Custom_MaxDownloadSpeed", t) : a.ConfigNS.setValue("ConfigNet", "ConfigNet_Custom_MaxDownloadSpeed", -1), e.maxUploadSpeedEnabled.value ? a.ConfigNS.setValue("ConfigNet", "ConfigNet_Custom_MaxUploadSpeed", i) : a.ConfigNS.setValue("ConfigNet", "ConfigNet_Custom_MaxUploadSpeed", -1), a.ConfigNS.setValue("ConfigNet", "ConfigNet_Custom_Time_Switch", e.limitTimeEnabled.value), e.limitTimeEnabled.value) {
                let t = e.limitTime[0].value, i = e.limitTime[1].value, n = e.limitTime[2].value,
                    o = e.limitTime[3].value;
                a.ConfigNS.setValue("ConfigNet", "ConfigNet_Custom_Time_Begin_Hour", t), a.ConfigNS.setValue("ConfigNet", "ConfigNet_Custom_Time_Begin_Minute", i), a.ConfigNS.setValue("ConfigNet", "ConfigNet_Custom_Time_End_Hour", n), a.ConfigNS.setValue("ConfigNet", "ConfigNet_Custom_Time_End_Minute", o)
            }
            a.ConfigNS.setValue("ConfigNet", "ConfigNet_Type", "0")
        }

        e.handleCustomDownloadMode = function e() {
            if ("1" === c()) return;
            d();
            let n = a.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_MaxDownloadSpeed", 1024),
                o = a.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_MaxUploadSpeed", 1024),
                r = a.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_Time_Switch", !1);
            if (l.information("handleCustomDownloadMode Enter maxDownloadSpeed = ", n, ", maxUploadSpeed = ", o, ", timeSwitch = ", r), r) {
                let r = Number(a.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_Time_Begin_Hour", 0)),
                    s = Number(a.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_Time_Begin_Minute", 0)),
                    l = Number(a.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_Time_End_Hour", 23)),
                    d = Number(a.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_Time_End_Minute", 59)), c = new Date,
                    h = c.getHours(), f = c.getMinutes(), g = c.getSeconds();
                (r > l || r === l && s > d) && (l += 24), (h > l || h === l && f > d) && (r += 24, l += 24);
                let p = 60 * h + f, v = 60 * r + s, m = 60 * l + d;
                if (v <= p && p < m) u(n, o), i = setTimeout(() => {
                    u(-1, -1), clearTimeout(i), i = void 0, e()
                }, 6e4 * (m - p)); else {
                    u(-1, -1), t = setTimeout(() => {
                        u(n, o), clearTimeout(t), t = void 0
                    }, 6e4 * (v - p));
                    let a = m - p;
                    a = a ? 6e4 * a : 1e3 * (60 - g), i = setTimeout(() => {
                        u(-1, -1), clearTimeout(i), i = void 0, e()
                    }, a)
                }
            } else u(n, o)
        }, e.getFreeDownLoad = function () {
            return a.ConfigNS.getValue("ConfigNet", "ConfigNet_IdleDownload", !1)
        }, e.getCurrentDownloadMode = c, e.getCustomModeDownloadSpeed = function () {
            return a.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_MaxDownloadSpeed", 1024)
        }, e.getCustomModeUploadSpeed = function () {
            return a.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_MaxUploadSpeed", 1024)
        }, e.setFullDownloadMode = function () {
            l.information("setFullDownloadMode Enter"), a.ConfigNS.setValue("ConfigNet", "ConfigNet_Type", "1"), o.DownloadKernelManager.setDownloadSpeedLimit(-1), o.DownloadKernelManager.setUploadSpeedLimit(-1), d()
        }, e.setFreeDownLoadConfig = function (e) {
            a.ConfigNS.setValue("ConfigNet", "ConfigNet_IdleDownload", e)
        }, e.setCustomDownloadMode = h, e.showCustomDownloadModeDlg = function () {
            return n(this, void 0, void 0, function* () {
                let e = a.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_MaxDownloadSpeedTmp", 1024),
                    t = a.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_MaxUploadSpeedTmp", 1024),
                    i = yield r.MessageBox.custom("CustomDownloadMode", {
                        title: "限制我的下载速度",
                        formData: {
                            maxDownloadSpeedEnabled: {value: a.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_DownloadSpeedChk", !0)},
                            maxDownloadSpeed: {value: e},
                            maxUploadSpeedEnabled: {value: a.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_UploadSpeedChk", !0)},
                            maxUploadSpeed: {value: t},
                            limitTimeEnabled: {value: a.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_Time_Switch", !1)},
                            limitTime: [{value: a.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_Time_Begin_Hour", 0)}, {value: a.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_Time_Begin_Minute", 0)}, {value: a.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_Time_End_Hour", 23)}, {value: a.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_Time_End_Minute", 59)}]
                        }
                    });
                return i.action === s.MessageBoxNS.Action.OK && (h(i.args), !0)
            })
        }
    }(t.DownloadModeNS || (t.DownloadModeNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(19), o = i(0), r = i(20), s = i(64), l = i(131), d = i(49), u = i(46), c = i(97),
        h = o.default.getLogger("plugin-ui"), f = l.PluginWebviewMgrNS.getWebViewMgr();
    !function (e) {
        const t = new class extends a.EventEmitter {
            constructor() {
                super(), this.isRegister = !1, this.isRegister = !1, this.buttonCreated = {}, this.index = 0
            }

            registerPluginFunction() {
                if (!this.isRegister) {
                    this.isRegister = !0;
                    let e = {
                        CreateButton: this.createButton.bind(this),
                        UpdateButton: this.updateButton.bind(this),
                        RemoveButton: this.removeButton.bind(this),
                        CreateWebview: this.createWebview.bind(this),
                        RegisterMenuEvent: this.registerMenuEvent.bind(this),
                        UnRegisterMenuEvent: this.unRegisterMenuEvent.bind(this),
                        SetDefaultVipSpeedStatus: this.setDefaultVipSpeedStatus.bind(this),
                        UpdateVipSpeedStatus: this.updateVipSpeedStatus.bind(this),
                        GetDownloadingActiveTaskId: this.getDownloadingActiveTaskId.bind(this),
                        ShowToast: this.showToast.bind(this),
                        CloseToast: this.closeToast.bind(this),
                        CreateBrowserWindow: this.createBrowserWindow,
                        RoundRectWindow: this.roundRectWindow,
                        OpenCommunityGroup: this.openCommunityGroup.bind(this)
                    };
                    r.server.registerFunctions(e), r.server.on("end", e => {
                        c.downloadContextMenu.unRegisterMenuEvent(void 0, e)
                    })
                }
            }

            constructButtonInfo(e, t, i, n) {
                let a = `${i}`;
                if (n.id && (a = `${i}|${n.id}`), this.buttonCreated.hasOwnProperty(a)) throw new Error(`${a} try to add toolbar button repeatedly`);
                this.buttonCreated[a] = e, t && "toolbar-vip-button" === t.name && (n.position || (n.position = -2))
            }

            createButton(e, t, ...i) {
                h.information("createButton in");
                do {
                    if (!e) break;
                    if (!i || !i[0] || !i[1]) break;
                    let n = i[0], a = i[1];
                    switch (n) {
                        case"toolbar_button":
                            if (!a.id) break;
                            this.constructButtonInfo(e, t, n, a), this.emit("add_toolbar_button", a);
                            break;
                        case"vip_renew_button":
                            if (!a.imgSrc) break;
                            this.constructButtonInfo(e, t, n, a), this.emit("add_vip_renew_button", a);
                            break;
                        case"onething_miner":
                            this.constructButtonInfo(e, t, n, a), this.emit("add_pc_node_button", a, e);
                            break;
                        case"kuainiao_plugin":
                            this.constructButtonInfo(e, t, n, a), this.emit("add_kuainiao_button", a, e)
                    }
                } while (0)
            }

            updateButtonInfo(e, t, i, n) {
                let a = `${i}`;
                if (n.id && (a = `${i}|${n.id}`), this.buttonCreated[a] !== e) throw this.buttonCreated[a] ? new Error(`${a} update failed cause button is created by others`) : new Error(`${a} update failed, please make sure that button is created`)
            }

            removeButtonInfo(e, t, i, n) {
                let a = `${i}`;
                if (n && n.id && (a = `${i}|${n.id}`), this.buttonCreated[a] !== e) throw this.buttonCreated[a] ? new Error(`${a} remove failed cause button is created by others`) : new Error(`${a} remove failed, please make sure that button is created`);
                delete this.buttonCreated[a]
            }

            updateButton(e, t, ...i) {
                h.information("updateButton in");
                do {
                    if (!e) break;
                    if (!i || !i[0] || !i[1]) break;
                    let n = i[0], a = i[1];
                    switch (n) {
                        case"toolbar_button":
                            this.updateButtonInfo(e, t, n, a), this.emit("update_toolbar_button", a);
                            break;
                        case"vip_renew_button":
                            this.updateButtonInfo(e, t, n, a), this.emit("update_vip_renew_button", a);
                            break;
                        case"onething_miner":
                            this.updateButtonInfo(e, t, n, a), this.emit("update_pc_node_button", a, e);
                            break;
                        case"kuainiao_plugin":
                            this.updateButtonInfo(e, t, n, a), this.emit("update_kuainiao_button", a, e)
                    }
                } while (0)
            }

            removeButton(e, t, ...i) {
                do {
                    if (!e) break;
                    if (!i || !i[0]) break;
                    let n = i[0], a = i[1];
                    switch (n) {
                        case"kuainiao_plugin":
                            this.removeButtonInfo(e, t, n, a), this.emit("remove_kuainiao_button", a, e)
                    }
                } while (0)
            }

            createWebview(e, t, ...i) {
                let n = !1;
                do {
                    if (!e) break;
                    if (!i && !i[0] || !i[1]) break;
                    let a = i[0], o = i[1];
                    if (!o.src) break;
                    n = f.create(t, a, o)[0]
                } while (0);
                return n
            }

            registerMenuEvent(e, t, ...i) {
                do {
                    if (!e) break;
                    if (!t && !t.name) throw Error("registerMenuEvent but no context name");
                    if (!i && !i[0]) break;
                    let n = i[0];
                    if (n <= c.DownloadMenuType.Unknown || n >= c.DownloadMenuType.Upper) break;
                    c.downloadContextMenu.registerMenuEvent(n, e)
                } while (0)
            }

            unRegisterMenuEvent(e, t, ...i) {
                do {
                    if (!e) break;
                    let t = void 0;
                    if (i && i[0] && ((t = i[0]) <= c.DownloadMenuType.Unknown || t >= c.DownloadMenuType.Upper)) break;
                    c.downloadContextMenu.unRegisterMenuEvent(t, e)
                } while (0)
            }

            setDefaultVipSpeedStatus(e, t, ...i) {
                do {
                    if (!e) break;
                    if (!i || !i[0]) break;
                    let t = i[0];
                    this.emit("init_vip_task_status", t)
                } while (0)
            }

            updateVipSpeedStatus(e, t, ...i) {
                do {
                    if (!e) break;
                    if (!i || !i[0]) break;
                    let t = i[0];
                    this.emit("update_vip_task_status", t)
                } while (0)
            }

            getDownloadingActiveTaskId(e, t, ...i) {
                return f.getActiveTaskId()
            }

            showToast(e, t, ...i) {
                let n = void 0;
                do {
                    if (!e || !t) break;
                    if (!i || !i[0]) break;
                    let a = i[0];
                    if (a.type < u.ToastNotifyItemType.GreenNotify || a.type > u.ToastNotifyItemType.RedCancelNotify) break;
                    a.id || (a.id = `${t.name || ""}_totast_${this.index++}`), n = a.id;
                    let o = d.ToastNotifyManagerNS.getToastNotifyManger().showNotify(a.id, a.type, a.message, a.duration);
                    o && a.type === u.ToastNotifyItemType.RedCancelNotify && o.onCancel(() => {
                        a.onCancle && a.onCancle()
                    })
                } while (0);
                return n
            }

            closeToast(e, t, ...i) {
                do {
                    if (!e) break;
                    if (!i || !i[0]) break;
                    let t = i[0];
                    d.ToastNotifyManagerNS.getToastNotifyManger().closeNotify(t)
                } while (0)
            }

            createBrowserWindow(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    return (yield r.server.callClientFunctionByName(s.CommonIPCBase.mainProcessContext, "CreateBrowserWindow", ...i))[0]
                })
            }

            roundRectWindow(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    return (yield r.server.callClientFunctionByName(s.CommonIPCBase.mainProcessContext, "RoundRectWindow", ...i))[0]
                })
            }

            openCommunityGroup(e, t, ...i) {
                do {
                    let e = null;
                    if (!i[0]) break;
                    if ("object" == typeof i[0]) e = i[0]; else if ("string" == typeof i[0]) try {
                        e = JSON.parse(i[0])
                    } catch (e) {
                    }
                    if (!e) break;
                    this.emit("openComunityGroup", e)
                } while (0)
            }
        };
        e.registerPluginFunction = function () {
            t.registerPluginFunction()
        }, e.on = function (e, i) {
            t.on(e, i)
        }, e.removeListener = function (e, i) {
            t.removeListener(e, i)
        }
    }(t.PluginFunctionUINS || (t.PluginFunctionUINS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(12), o = i(19), r = i(0), s = i(3), l = i(60), d = i(11), u = i(553), c = i(41), h = i(36), f = i(13),
        g = i(9), p = i(45), v = i(67), m = i(10), y = i(22), k = i(305), T = i(324), w = i(29), C = i(76), S = i(70),
        b = i(438), I = i(38), _ = i(27), A = i(4), D = i(2), x = i(129), N = i(37), E = i(73), P = i(25), M = i(20),
        O = i(110), F = i(7), L = r.default.getLogger("Thunder.ContextMenu"),
        B = w.DownloadKernelCategoryManager.getCategoryManager(), U = d.DownloadKernelTaskManager.getTaskManager(),
        R = b.GroupAccelerateWebManagerNS.getManager(), K = x.SubtitleManagerNS.getSubtitleManger();
    var W;
    !function (e) {
        e[e.Unknown = 0] = "Unknown", e[e.DownloadingCategory = 1] = "DownloadingCategory", e[e.DownloadingBlank = 2] = "DownloadingBlank", e[e.DownloadingItem = 3] = "DownloadingItem", e[e.CompletedCategory = 4] = "CompletedCategory", e[e.CompletedItem = 5] = "CompletedItem", e[e.RecycleCategory = 6] = "RecycleCategory", e[e.RecycleBlank = 7] = "RecycleBlank", e[e.RecycleItem = 8] = "RecycleItem", e[e.ToolbarMore = 9] = "ToolbarMore", e[e.ChangeCategory = 10] = "ChangeCategory", e[e.PrivateSpaceHome = 11] = "PrivateSpaceHome", e[e.SearchMultiSel = 12] = "SearchMultiSel", e[e.Upper = 13] = "Upper"
    }(W = t.DownloadMenuType || (t.DownloadMenuType = {}));
    t.downloadContextMenu = new class {
        constructor() {
            this.contextInfo = null, this.count = 0, this.categoryId = -1, this.emitter = null, this.searchMode = !1, this.shouleiDownloadEnable = !0, this.emitter = new o.EventEmitter, this.menuEventClients = {}
        }

        registerMenuEvent(e, t) {
            this.menuEventClients.hasOwnProperty(String(e)) ? this.menuEventClients[e].push(t) : this.menuEventClients[e] = [].concat(t)
        }

        unRegisterMenuEvent(e, t) {
            if (void 0 === e) for (let e in this.menuEventClients) {
                let i = this.menuEventClients[e];
                for (let n = 0; n < i.length; n++) if (i[n] === t) {
                    this.menuEventClients[e].splice(n, 1);
                    break
                }
            } else {
                let i = this.menuEventClients[e];
                for (let n = 0; n < i.length; n++) if (i[n] === t) {
                    this.menuEventClients[e].splice(n, 1);
                    break
                }
            }
        }

        setContextInfo(e, t, i, n) {
            this.contextInfo = e, A.isNullOrUndefined(i) || (this.count = i), A.isNullOrUndefined(t) || (this.categoryId = t), A.isNullOrUndefined(n) ? this.searchMode = !1 : this.searchMode = n
        }

        canShare() {
            let e = !0;
            do {
                let t = this.getSelectdTaskInfos();
                if (!t) {
                    e = !1;
                    break
                }
                if (t.length > 1) {
                    e = !1;
                    break
                }
                let i = t[0];
                if (i.taskStatus === s.DownloadKernel.TaskStatus.Failed || i.taskStatus === s.DownloadKernel.TaskStatus.Unkown) {
                    e = !1;
                    break
                }
                if (i.taskType === s.DownloadKernel.TaskType.Group) {
                    e = !1;
                    break
                }
            } while (0);
            return e
        }

        canDownloadByShoulei() {
            let e = !0;
            do {
                if (0 === P.default.getConfigInfo("shouleiDownload", "enable") && (this.shouleiDownloadEnable = !1), !this.shouleiDownloadEnable) {
                    e = !1;
                    break
                }
                if (null === this.contextInfo) {
                    e = !1;
                    break
                }
                let t = this.getSelectdTaskInfos();
                if (!t) {
                    e = !1;
                    break
                }
                if (t.length > 1) {
                    e = !1;
                    break
                }
                let i = t[0];
                if (!i || i.taskType === s.DownloadKernel.TaskType.Group) {
                    e = !1;
                    break
                }
            } while (0);
            return e
        }

        handleDownloadByShoulei() {
            return n(this, void 0, void 0, function* () {
                let e = "https://mobile.xunlei.com/m/channel.html?from=xunlei10daoliang";
                if (this.canDownloadByShoulei()) {
                    let t = this.getSelectdTaskInfos()[0];
                    e = yield O.getShouleiShareLinkDlj(t.taskId, "pic", "leftlist_rk_phone")
                }
                y.MessageBox.custom("ShouleiQRCode", {data: e}).catch()
            })
        }

        handleShouleiFileTransfer() {
            return n(this, void 0, void 0, function* () {
                let e = this.getSelectdTaskInfos()[0];
                c.TaskCtrlOperatorNS.shouleiFileTransfer(e).catch()
            })
        }

        attachListener(e, t) {
            this.emitter.addListener(e, t)
        }

        detachListener(e, t) {
            this.emitter.removeListener(e, t)
        }

        popMenu(e, t) {
            return n(this, void 0, void 0, function* () {
                let i = [];
                switch (e) {
                    case W.DownloadingCategory: {
                        let e = this.contextInfo.canStartAll;
                        i = [{
                            type: "submenu",
                            label: "排序",
                            submenu: this.getSortSubMenuOptions(this.contextInfo)
                        }, {
                            type: "normal",
                            label: "全选(&A)",
                            id: u.ContextMenuIdsNS.contextMenuDownloadSelectAll,
                            statId: "dl_downloading_more_btn_click",
                            extData: "clickid=all_select"
                        }, {
                            type: "normal",
                            label: "全部开始",
                            enabled: e,
                            id: u.ContextMenuIdsNS.contextMenuDownloadStartAll,
                            statId: "dl_downloading_more_btn_click",
                            extData: "clickid=all_start"
                        }, {
                            type: "normal",
                            label: "全部暂停",
                            id: u.ContextMenuIdsNS.contextMenuDownloadPauseAll,
                            statId: "dl_downloading_more_btn_click",
                            extData: "clickid=all_pause"
                        }];
                        let t = this.contextInfo.currentCategoryId;
                        B.isPrivateCategory(t) && i.push({
                            type: "normal",
                            label: "私人空间下载设置",
                            id: u.ContextMenuIdsNS.contextMenuToolbarPrivateSpaceDownloadSetting
                        }, {
                            type: "normal",
                            label: "修改私人空间密码",
                            id: u.ContextMenuIdsNS.contextMenuToolbarPrivateSpacePasswwordChange
                        })
                    }
                        break;
                    case W.CompletedCategory: {
                        let e = this.contextInfo.currentCategoryId,
                            t = l.TaskStatusHelper.canMarkAsOpened(this.contextInfo.completedTaskBaseList);
                        i = [{
                            type: "submenu",
                            label: "排序",
                            submenu: this.getSortSubMenuOptions(this.contextInfo)
                        }, {
                            type: "normal",
                            label: "全选(&A)",
                            id: u.ContextMenuIdsNS.contextMenuDownloadSelectAll,
                            statId: "dl_finish_more_btn_click",
                            extData: "clickid=all_select"
                        }, {
                            type: "normal",
                            label: "删除不存在任务",
                            id: u.ContextMenuIdsNS.contextMenuDownloadDeleteNonexisting,
                            statId: "dl_finish_more_btn_click",
                            extData: "clickid=delete_invalid"
                        }, {
                            type: "normal",
                            label: "全部标记为已打开",
                            id: u.ContextMenuIdsNS.contextMenuDownloadAsReadedAll,
                            enabled: t,
                            statId: "dl_finish_more_btn_click",
                            extData: "clickid=all_mark_open"
                        }, {
                            type: "submenu",
                            label: "筛选任务",
                            submenu: yield T.CompletedFilterNS.getMenuOptions(e, this.contextInfo.onFilterMenuClick)
                        }], -1 !== e && (i = [{
                            type: "normal",
                            label: "全部标记为已打开",
                            id: u.ContextMenuIdsNS.contextMenuDownloadAsReadedAll,
                            enabled: t,
                            statId: "dl_finish_more_btn_click",
                            extData: "clickid=all_mark_open"
                        }])
                    }
                        break;
                    case W.RecycleCategory: {
                        let e = !0;
                        null === this.contextInfo ? e = !1 : 0 === this.contextInfo.recycleTaskBaseList.length && (e = !1), i = [{
                            type: "submenu",
                            label: "排序",
                            submenu: this.getSortSubMenuOptions(this.contextInfo)
                        }, {
                            type: "normal",
                            label: "全选(&A)",
                            id: u.ContextMenuIdsNS.contextMenuDownloadSelectAll,
                            statId: "dl_rubbish_more_btn_click",
                            extData: "clickid=all_select"
                        }, {
                            type: "normal",
                            label: "清空回收站",
                            id: u.ContextMenuIdsNS.contextMenuDownloadClear,
                            enabled: e,
                            statId: "dl_rubbish_more_btn_click",
                            extData: "clickid=clear_empty"
                        }]
                    }
                        break;
                    case W.DownloadingBlank:
                        i = [{
                            type: "normal",
                            label: "导入未完成任务(&I)",
                            id: u.ContextMenuIdsNS.contextMenuDownloadImportUncomplete
                        }];
                        break;
                    case W.DownloadingItem: {
                        let e = this.getSelectdTaskInfos();
                        if (null !== e && e.length > 0) {
                            let t = [], n = l.TaskStatusHelper.canMoveSelectedTask(void 0, e);
                            -1 === this.categoryId ? ((t = yield this.getLastestSavePathsOptions(n, "MoveToDir", "LatestSavePath")).push({
                                type: "normal",
                                label: "私人空间",
                                enabled: n,
                                id: u.ContextMenuIdsNS.contextMenuDownloadMoveFilePrivateSpace,
                                statId: "downloading_rk_move_click",
                                extData: "button=private"
                            }), t.push({
                                type: "normal",
                                label: "其他目录",
                                enabled: n,
                                id: u.ContextMenuIdsNS.contextMenuDownloadMoveFileOther,
                                statId: "downloading_rk_move_click",
                                extData: "button=other"
                            })) : t.push({
                                type: "normal",
                                label: "移出私人空间",
                                enabled: n,
                                id: u.ContextMenuIdsNS.contextMenuDownloadMoveFileOutPrivateSpace,
                                statId: "downloading_rk_move_click",
                                extData: "button=private"
                            });
                            let a = l.TaskStatusHelper.canDeleteSelectedTask(void 0, e);
                            if (i = [], this.canShare() && i.push({
                                type: "normal",
                                label: "分享",
                                id: u.ContextMenuIdsNS.contextMenuDownloadShare,
                                statId: "downloading_rk_share_click",
                                userData: this.searchMode,
                                categoryView: s.DownloadKernel.CategroyViewID.Downloading
                            }), -1 === this.categoryId ? i.push({
                                type: "normal",
                                label: "删除(&D)",
                                enabled: a,
                                icon: `${__rootDir}/static/icon/deletetask.png`,
                                id: u.ContextMenuIdsNS.contextMenuDownloadDelete,
                                statId: "downloading_rk_delete_click",
                                userData: this.searchMode,
                                categoryView: s.DownloadKernel.CategroyViewID.Downloading
                            }, {
                                type: "normal",
                                label: "彻底删除(&Q)",
                                enabled: a,
                                icon: `${__rootDir}/static/icon/destroytask.png`,
                                id: u.ContextMenuIdsNS.contextMenuDownloadDestroy,
                                statId: "downloading_rk_completedelete_click",
                                userData: this.searchMode,
                                categoryView: s.DownloadKernel.CategroyViewID.Downloading
                            }, {type: "submenu", label: "移动文件到", submenu: t}) : i.push({
                                type: "normal",
                                label: "彻底删除(&D)",
                                enabled: a,
                                icon: `${__rootDir}/static/icon/destroytask.png`,
                                id: u.ContextMenuIdsNS.contextMenuDownloadDestroy,
                                statId: "downloading_rk_completedelete_click",
                                userData: this.searchMode,
                                categoryView: s.DownloadKernel.CategroyViewID.Downloading
                            }, {
                                type: "submenu",
                                label: "移动文件到",
                                submenu: t
                            }), !this.searchMode && this.count > 3 && e.length !== this.count && i.splice(4, 0, {type: "separator"}, {
                                type: "normal",
                                label: "上移到顶部",
                                id: u.ContextMenuIdsNS.contextMenuDownloadMoveTop
                            }, {
                                type: "normal",
                                label: "下移到底部",
                                id: u.ContextMenuIdsNS.contextMenuDownloadMoveBottom
                            }, {type: "separator"}), 1 === e.length) {
                                if (l.TaskStatusHelper.canStopSelectedTask(s.DownloadKernel.CategroyViewID.Downloading, e)) i.unshift({
                                    type: "normal",
                                    label: "暂停(&P)",
                                    icon: `${__rootDir}/static/icon/stoptask.png`,
                                    id: u.ContextMenuIdsNS.contextMenuDownloadPause,
                                    statId: "downloading_rk_pause_click"
                                }); else {
                                    let t = l.TaskStatusHelper.canStartSelectedTask(s.DownloadKernel.CategroyViewID.Downloading, e);
                                    i.unshift({
                                        type: "normal",
                                        label: "开始(&S)",
                                        enabled: t,
                                        icon: `${__rootDir}/static/icon/startalltask.png`,
                                        id: u.ContextMenuIdsNS.contextMenuDownloadStart,
                                        statId: "downloading_rk_start_click"
                                    })
                                }
                                let t = yield c.TaskCtrlOperatorNS.canOpenSelectedTaskFolder(e[0]),
                                    n = U.getTaskFromTaskId(e[0].taskId).isSupportPlay(), a = 1;
                                n && (i.unshift({
                                    type: "normal",
                                    label: "播放(&O)",
                                    icon: `${__rootDir}/static/icon/play.png`,
                                    id: u.ContextMenuIdsNS.contextMenuPlayFile,
                                    statId: "downloading_rk_playfiles_click",
                                    visible: t,
                                    userData: this.searchMode,
                                    categoryView: s.DownloadKernel.CategroyViewID.Downloading
                                }), ++a), i.splice(a, 0, {
                                    type: "normal",
                                    label: "打开文件夹(&F)",
                                    icon: `${__rootDir}/static/icon/openfolder.png`,
                                    id: u.ContextMenuIdsNS.contextMenuDownloadFolder,
                                    statId: "downloading_rk_openfolders_click",
                                    visible: t,
                                    userData: this.searchMode,
                                    categoryView: s.DownloadKernel.CategroyViewID.Downloading
                                }), ++a, this.searchMode && (i.splice(3, 0, {
                                    type: "normal",
                                    label: "打开任务位置(&G)",
                                    id: u.ContextMenuIdsNS.contextMenuOpenTaskPosition,
                                    statId: "openfile_position_click",
                                    userData: this.searchMode,
                                    categoryView: s.DownloadKernel.CategroyViewID.Downloading
                                }), ++a), n ? i.splice(a, 0, {
                                    type: "normal",
                                    label: "字幕搜索",
                                    icon: `${__rootDir}/static/icon/sunbtitle.png`,
                                    id: u.ContextMenuIdsNS.contxtMenuSubtitleSearch,
                                    statId: "downloading_rk_subtitlesearch_click"
                                }, {type: "separator"}) : i.splice(a, 0, {type: "separator"}), e[0].taskType === s.DownloadKernel.TaskType.Bt ? i.push({
                                    type: "normal",
                                    label: "种子文件另存为(&C)",
                                    id: u.ContextMenuIdsNS.contextMenuDownloadTorrentSaveAs,
                                    statId: "downloading_rk_torrentsave_click"
                                }, {
                                    type: "normal",
                                    label: "复制下载链接",
                                    id: u.ContextMenuIdsNS.contextMenuDownloadCopyMagnet,
                                    statId: "downloading_rk_copymagnet_click",
                                    userData: this.searchMode,
                                    categoryView: s.DownloadKernel.CategroyViewID.Downloading
                                }) : i.push({
                                    type: "normal",
                                    label: "复制下载链接(&C)",
                                    id: u.ContextMenuIdsNS.contextMenuDownloadCopyLink,
                                    userData: this.searchMode,
                                    categoryView: s.DownloadKernel.CategroyViewID.Downloading
                                })
                            } else {
                                let t = l.TaskStatusHelper.canStopSelectedTask(s.DownloadKernel.CategroyViewID.Downloading, e),
                                    n = l.TaskStatusHelper.canStartSelectedTask(s.DownloadKernel.CategroyViewID.Downloading, e);
                                t && i.unshift({
                                    type: "normal",
                                    label: "暂停(&P)",
                                    icon: `${__rootDir}/static/icon/stoptask.png`,
                                    id: u.ContextMenuIdsNS.contextMenuDownloadPause
                                }), n && i.unshift({
                                    type: "normal",
                                    label: "开始(&S)",
                                    icon: `${__rootDir}/static/icon/startalltask.png`,
                                    id: u.ContextMenuIdsNS.contextMenuDownloadStart
                                });
                                let a = l.TaskStatusHelper.canCopySelectTaskLink(e);
                                i.push({
                                    type: "normal",
                                    label: "复制下载链接(&C)",
                                    id: u.ContextMenuIdsNS.contextMenuDownloadCopyLink,
                                    enabled: a,
                                    userData: this.searchMode,
                                    categoryView: s.DownloadKernel.CategroyViewID.Downloading
                                })
                            }
                        }
                    }
                        break;
                    case W.CompletedItem: {
                        let e = this.getSelectdTaskInfos();
                        if (null !== e && e.length > 0) {
                            i = [];
                            let t = l.TaskStatusHelper.canDeleteSelectedTask(void 0, e),
                                n = l.TaskStatusHelper.canMoveSelectedTask(void 0, e);
                            if (-1 === this.categoryId ? i.push({
                                type: "normal",
                                label: "删除(&D)",
                                enabled: t,
                                icon: `${__rootDir}/static/icon/deletetask.png`,
                                id: u.ContextMenuIdsNS.contextMenuDownloadDelete,
                                statId: "finished_rk_delete_click",
                                userData: this.searchMode,
                                categoryView: s.DownloadKernel.CategroyViewID.Completed
                            }, {
                                type: "normal",
                                label: "彻底删除(&Q)",
                                enabled: t,
                                icon: `${__rootDir}/static/icon/destroytask.png`,
                                id: u.ContextMenuIdsNS.contextMenuDownloadDestroy,
                                statId: "finished_rk_completedelete_click",
                                userData: this.searchMode,
                                categoryView: s.DownloadKernel.CategroyViewID.Completed
                            }) : i.push({
                                type: "normal",
                                label: "彻底删除(&D)",
                                enabled: t,
                                icon: `${__rootDir}/static/icon/destroytask.png`,
                                id: u.ContextMenuIdsNS.contextMenuDownloadDestroy,
                                statId: "downloading_rk_completedelete_click",
                                userData: this.searchMode,
                                categoryView: s.DownloadKernel.CategroyViewID.Completed
                            }), i.push({
                                type: "normal",
                                label: "重新下载(&T)",
                                icon: `${__rootDir}/static/icon/redownload.png`,
                                id: u.ContextMenuIdsNS.contextMenuDownloadRedownload,
                                categoryView: s.DownloadKernel.CategroyViewID.Completed
                            }), -1 === this.categoryId) {
                                let e = yield this.getLastestSavePathsOptions(!0, "CopyToDir", "LatestSavePath", !0);
                                e.push({
                                    type: "normal",
                                    label: "其他目录",
                                    id: u.ContextMenuIdsNS.contextMenuDownloadCopyFileOther,
                                    statId: "finished_rk_copyfiles_click",
                                    extData: "button=other"
                                }), i.splice(2, 0, {type: "submenu", label: "复制文件到", submenu: e})
                            }
                            let a = [];
                            if (-1 === this.categoryId ? ((a = yield this.getLastestSavePathsOptions(n, "MoveToDir", "LatestSavePath")).push({
                                type: "normal",
                                label: "私人空间",
                                enabled: n,
                                id: u.ContextMenuIdsNS.contextMenuDownloadMoveFilePrivateSpace,
                                statId: "downloading_rk_move_click",
                                extData: "button=private"
                            }), a.push({
                                type: "normal",
                                label: "其他目录",
                                enabled: n,
                                id: u.ContextMenuIdsNS.contextMenuDownloadMoveFileOther,
                                statId: "finished_rk_move_click",
                                extData: "button=other"
                            })) : a.push({
                                type: "normal",
                                label: "移出私人空间",
                                enabled: n,
                                id: u.ContextMenuIdsNS.contextMenuDownloadMoveFileOutPrivateSpace,
                                statId: "downloading_rk_move_click",
                                extData: "button=private"
                            }), i.splice(2, 0, {type: "separator"}, {
                                type: "submenu",
                                label: "移动文件到",
                                submenu: a
                            }), 1 === e.length) {
                                i.splice(2, 0, {
                                    type: "normal",
                                    label: "重命名(&R)",
                                    enabled: !e[0].isMoving,
                                    id: u.ContextMenuIdsNS.contextMenuDownloadRename,
                                    statId: "finished_rk_rename_click"
                                });
                                let t = yield c.TaskCtrlOperatorNS.canOpenSelectedTaskFolder(e[0]),
                                    n = yield c.TaskCtrlOperatorNS.canOpenSelectedTaskFile(e[0]),
                                    a = yield c.TaskCtrlOperatorNS.canOpenAsSelectedTaskFile(e[0]);
                                i.splice(0, 0, {
                                    type: "normal",
                                    label: "打开方式",
                                    icon: `${__rootDir}/static/icon/openas.png`,
                                    id: u.ContextMenuIdsNS.contextMenuDownloadOpenAs,
                                    categoryView: s.DownloadKernel.CategroyViewID.Completed,
                                    statId: "finished_rk_openas_click",
                                    visible: a,
                                    userData: this.searchMode
                                }, {
                                    type: "normal",
                                    label: "打开文件夹(&F)",
                                    icon: `${__rootDir}/static/icon/openfolder.png`,
                                    id: u.ContextMenuIdsNS.contextMenuDownloadFolder,
                                    statId: "finished_rk_openfolders_click",
                                    categoryView: s.DownloadKernel.CategroyViewID.Completed,
                                    visible: t,
                                    userData: this.searchMode
                                });
                                let o = U.getTaskFromTaskId(e[0].taskId).isSupportPlay();
                                o ? i.splice(0, 0, {
                                    type: "normal",
                                    label: "播放(&O)",
                                    icon: `${__rootDir}/static/icon/play.png`,
                                    id: u.ContextMenuIdsNS.contextMenuPlayFile,
                                    statId: "finished_rk_playfiles_click",
                                    categoryView: s.DownloadKernel.CategroyViewID.Completed,
                                    visible: n,
                                    userData: this.searchMode
                                }) : i.splice(0, 0, {
                                    type: "normal",
                                    label: "打开文件(&O)",
                                    icon: `${__rootDir}/static/icon/open.png`,
                                    id: u.ContextMenuIdsNS.contextMenuDownloadFile,
                                    statId: "finished_rk_openfiles_click",
                                    categoryView: s.DownloadKernel.CategroyViewID.Completed,
                                    visible: n,
                                    userData: this.searchMode
                                });
                                let r = 3;
                                this.searchMode && i.splice(r, 0, {
                                    type: "normal",
                                    label: "打开任务位置(&G)",
                                    id: u.ContextMenuIdsNS.contextMenuOpenTaskPosition,
                                    statId: "openfile_position_click",
                                    userData: this.searchMode,
                                    categoryView: s.DownloadKernel.CategroyViewID.Completed
                                }), o ? i.splice(r, 0, {
                                    type: "normal",
                                    label: "字幕搜索",
                                    icon: `${__rootDir}/static/icon/sunbtitle.png`,
                                    id: u.ContextMenuIdsNS.contxtMenuSubtitleSearch,
                                    statId: "finished_rk_subtitlesearch_click"
                                }, {type: "separator"}) : i.splice(r, 0, {type: "separator"}), e[0].taskType === s.DownloadKernel.TaskType.Bt ? i.push({
                                    type: "normal",
                                    label: "种子文件另存为(&C)",
                                    id: u.ContextMenuIdsNS.contextMenuDownloadTorrentSaveAs,
                                    statId: "finished_rk_torrent_click"
                                }, {
                                    type: "normal",
                                    label: "复制下载链接",
                                    id: u.ContextMenuIdsNS.contextMenuDownloadCopyMagnet,
                                    statId: "finished_rk_copymagnet_click",
                                    userData: this.searchMode,
                                    categoryView: s.DownloadKernel.CategroyViewID.Completed
                                }) : i.push({
                                    type: "normal",
                                    label: "复制下载链接(&C)",
                                    id: u.ContextMenuIdsNS.contextMenuDownloadCopyLink,
                                    statId: "finished_rk_copyurl_click",
                                    userData: this.searchMode,
                                    categoryView: s.DownloadKernel.CategroyViewID.Completed
                                })
                            } else {
                                let t = l.TaskStatusHelper.canCopySelectTaskLink(e);
                                i.push({
                                    type: "normal",
                                    label: "复制下载链接(&C)",
                                    id: u.ContextMenuIdsNS.contextMenuDownloadCopyLink,
                                    statId: "finished_rk_copyurl_click",
                                    enabled: t,
                                    userData: this.searchMode,
                                    categoryView: s.DownloadKernel.CategroyViewID.Completed
                                })
                            }
                            let o = i.findIndex(e => e.id === u.ContextMenuIdsNS.contextMenuDownloadDelete);
                            -1 === o && (o = i.findIndex(e => e.id === u.ContextMenuIdsNS.contextMenuDownloadDestroy)), this.canShare() && i.splice(o++, 0, {
                                type: "normal",
                                label: "分享",
                                id: u.ContextMenuIdsNS.contextMenuDownloadShare,
                                statId: "finished_rk_share_click",
                                userData: this.searchMode,
                                categoryView: s.DownloadKernel.CategroyViewID.Completed
                            })
                        }
                    }
                        break;
                    case W.RecycleBlank: {
                        let e = !0;
                        this.contextInfo && this.contextInfo.recycleTaskBaseList && 0 === this.contextInfo.recycleTaskBaseList.length && (e = !1), i = [{
                            type: "normal",
                            label: "清空(&B)",
                            enabled: e,
                            id: u.ContextMenuIdsNS.contextMenuDownloadClear
                        }]
                    }
                        break;
                    case W.RecycleItem: {
                        let e = this.getSelectdTaskInfos();
                        if (null !== e && e.length > 0) if (i = [{
                            type: "normal",
                            label: "打开任务位置(&G)",
                            id: u.ContextMenuIdsNS.contextMenuOpenTaskPosition,
                            statId: "openfile_position_click",
                            userData: this.searchMode,
                            categoryView: s.DownloadKernel.CategroyViewID.Recycle
                        }, {
                            type: "normal",
                            label: "还原(&R)",
                            id: u.ContextMenuIdsNS.contextMenuDownloadRecover,
                            statId: "dustbin_rk_undo_click"
                        }, {
                            type: "normal",
                            label: "清空(&B)",
                            id: u.ContextMenuIdsNS.contextMenuDownloadClear,
                            statId: "dustbin_rk_clear_click"
                        }, {
                            type: "normal",
                            label: "彻底删除(&Q)",
                            icon: `${__rootDir}/static/icon/destroytask.png`,
                            id: u.ContextMenuIdsNS.contextMenuDownloadDestroy,
                            statId: "dustbin_rk_completedelete_click",
                            userData: this.searchMode,
                            categoryView: s.DownloadKernel.CategroyViewID.Recycle
                        }, {type: "separator"}, {
                            type: "normal",
                            label: "重新下载(&T)",
                            icon: `${__rootDir}/static/icon/redownload.png`,
                            categoryView: s.DownloadKernel.CategroyViewID.Recycle,
                            id: u.ContextMenuIdsNS.contextMenuDownloadRedownload
                        }], this.searchMode || i.shift(), 1 === e.length) {
                            let t = yield c.TaskCtrlOperatorNS.canOpenSelectedTaskFolder(e[0]), n = e[0].taskStatus;
                            if (n === s.DownloadKernel.TaskStatus.Succeeded || n === s.DownloadKernel.TaskStatus.Seeding) {
                                let n = yield c.TaskCtrlOperatorNS.canOpenSelectedTaskFile(e[0]),
                                    a = yield c.TaskCtrlOperatorNS.canOpenAsSelectedTaskFile(e[0]);
                                i.splice(2, 0, {type: "separator"}, {
                                    type: "normal",
                                    label: "打开文件(&O)",
                                    icon: `${__rootDir}/static/icon/open.png`,
                                    id: u.ContextMenuIdsNS.contextMenuDownloadFile,
                                    categoryView: s.DownloadKernel.CategroyViewID.Recycle,
                                    statId: "dustbin_rk_openfiles_click",
                                    visible: n,
                                    userData: this.searchMode
                                }, {
                                    type: "normal",
                                    label: "打开方式",
                                    icon: `${__rootDir}/static/icon/openas.png`,
                                    id: u.ContextMenuIdsNS.contextMenuDownloadOpenAs,
                                    categoryView: s.DownloadKernel.CategroyViewID.Recycle,
                                    statId: "dustbin_rk_openas_click",
                                    visible: a,
                                    userData: this.searchMode
                                }, {
                                    type: "normal",
                                    label: "打开文件夹(&F)",
                                    icon: `${__rootDir}/static/icon/openfolder.png`,
                                    id: u.ContextMenuIdsNS.contextMenuDownloadFolder,
                                    statId: "dustbin_rk_openfolders_click",
                                    visible: t,
                                    userData: this.searchMode,
                                    categoryView: s.DownloadKernel.CategroyViewID.Recycle
                                })
                            } else i.splice(2, 0, {type: "separator"}, {
                                type: "normal",
                                label: "打开文件夹(&F)",
                                icon: `${__rootDir}/static/icon/openfolder.png`,
                                id: u.ContextMenuIdsNS.contextMenuDownloadFolder,
                                statId: "dustbin_rk_openfolders_click",
                                visible: t,
                                userData: this.searchMode,
                                categoryView: s.DownloadKernel.CategroyViewID.Recycle
                            });
                            e[0].taskType === s.DownloadKernel.TaskType.Bt ? i.push({
                                type: "normal",
                                label: "种子文件另存为(&C)",
                                id: u.ContextMenuIdsNS.contextMenuDownloadTorrentSaveAs
                            }, {
                                type: "normal",
                                label: "复制下载链接",
                                id: u.ContextMenuIdsNS.contextMenuDownloadCopyMagnet,
                                userData: this.searchMode,
                                categoryView: s.DownloadKernel.CategroyViewID.Recycle
                            }) : i.push({
                                type: "normal",
                                label: "复制下载链接(&C)",
                                id: u.ContextMenuIdsNS.contextMenuDownloadCopyLink,
                                statId: "dustbin_rk_copyurl_click",
                                userData: this.searchMode,
                                categoryView: s.DownloadKernel.CategroyViewID.Recycle
                            });
                            let a = [];
                            this.canShare() && a.push({
                                type: "normal",
                                label: "分享",
                                id: u.ContextMenuIdsNS.contextMenuDownloadShare,
                                statId: "dustbin_rk_share_click",
                                userData: this.searchMode,
                                categoryView: s.DownloadKernel.CategroyViewID.Recycle
                            }), a.length > 0 && (a.splice(0, 0, {type: "separator"}), i.splice(2, 0, ...a))
                        } else {
                            i.splice(1, 0, {type: "separator"});
                            let t = l.TaskStatusHelper.canCopySelectTaskLink(e);
                            i.push({
                                type: "normal",
                                label: "复制下载链接(&C)",
                                id: u.ContextMenuIdsNS.contextMenuDownloadCopyLink,
                                statId: "dustbin_rk_copyurl_click",
                                enabled: t,
                                userData: this.searchMode,
                                categoryView: s.DownloadKernel.CategroyViewID.Recycle
                            })
                        }
                    }
                        break;
                    case W.ToolbarMore:
                        if (null !== this.contextInfo) {
                            let e = this.getSelectdTaskInfos(), t = l.TaskStatusHelper.canDeleteSelectedTask(void 0, e);
                            i = [{
                                type: "normal",
                                label: "彻底删除任务",
                                id: u.ContextMenuIdsNS.contextMenuToolbarMoreDestroy,
                                icon: `${__rootDir}/static/icon/destroytask.png`,
                                enabled: t,
                                statId: "top_morelist_click",
                                extData: "button=completedelete"
                            }, {
                                type: "submenu",
                                label: "排序",
                                submenu: this.getSortSubMenuOptions(this.contextInfo)
                            }, {
                                type: "normal",
                                label: "下载帮助",
                                icon: `${__rootDir}/static/icon/help.png`,
                                id: u.ContextMenuIdsNS.contextMenuToolbarMoreOpenHelp,
                                statId: "top_help_click",
                                extData: "button=dl_panel"
                            }, {
                                type: "normal",
                                label: "设置中心",
                                icon: `${__rootDir}/static/icon/config.png`,
                                id: u.ContextMenuIdsNS.contextMenuToolbarMoreConfig,
                                statId: "top_morelist_click",
                                extData: "button=setting"
                            }, {
                                type: "normal",
                                label: "搜索下载记录",
                                id: u.ContextMenuIdsNS.contextMenuToolbarMoreOpenSearch,
                                statId: "top_morelist_click",
                                extData: "button=searchtask"
                            }], g.XLStatNS.trackEvent("download_detail", "help_tips_entry_show", "", 0, 0, 0, 0, "position=dl_page")
                        }
                        break;
                    case W.ChangeCategory: {
                        let e = this.contextInfo.currentCategoryId;
                        i = [{
                            type: "checkbox",
                            label: "我的电脑",
                            id: u.ContextMenuIdsNS.contextMenuTabChangeCategoryMyComputer,
                            checked: -1 === e,
                            statId: "top_dropdownlist_click",
                            extData: "button=computer"
                        }, {
                            type: "checkbox",
                            label: "私人空间",
                            id: u.ContextMenuIdsNS.contextMenuTabChangeCategoryPrivateSpace,
                            checked: -1 !== e,
                            statId: "top_dropdownlist_click",
                            extData: "button=private"
                        }]
                    }
                        break;
                    case W.PrivateSpaceHome:
                        i = [{
                            type: "normal",
                            label: "全选",
                            id: u.ContextMenuIdsNS.contextMenuToolbarPrivateSpaceSelectAll
                        }, {
                            type: "submenu",
                            label: "排序",
                            submenu: this.getSortSubMenuOptions(this.contextInfo)
                        }, {type: "separator"}, {
                            type: "normal",
                            label: "私人空间下载设置",
                            id: u.ContextMenuIdsNS.contextMenuToolbarPrivateSpaceDownloadSetting
                        }, {
                            type: "normal",
                            label: "修改私人空间密码",
                            id: u.ContextMenuIdsNS.contextMenuToolbarPrivateSpacePasswwordChange
                        }];
                        break;
                    case W.SearchMultiSel: {
                        let e = this.contextInfo.currentSelSearchTaskInfos,
                            t = l.TaskStatusHelper.canCopySelectTaskLink(e);
                        i = [{
                            type: "normal",
                            label: "删除(&D)",
                            icon: `${__rootDir}/static/icon/deletetask.png`,
                            id: u.ContextMenuIdsNS.contextMenuDownloadDelete,
                            userData: this.searchMode
                        }, {
                            type: "normal",
                            label: "彻底删除(&Q)",
                            icon: `${__rootDir}/static/icon/destroytask.png`,
                            id: u.ContextMenuIdsNS.contextMenuDownloadDestroy,
                            userData: this.searchMode
                        }, {
                            type: "normal",
                            label: "复制下载链接(&C)",
                            id: u.ContextMenuIdsNS.contextMenuDownloadCopyLink,
                            enabled: t,
                            userData: this.searchMode
                        }]
                    }
                }
                this.popMenuInternal(i, e, t).catch()
            })
        }

        getSortConfig(e) {
            let t = {sortBy: k.SortNS.SortType.Default, asce: !0};
            do {
                if (null === e || void 0 === e) break;
                let i = e.currentCategoryViewId;
                if (null === i || void 0 === i) break;
                let n = e.currentCategoryId;
                t = k.SortNS.getSortConfig(i, n)
            } while (0);
            return t
        }

        getSortSubMenuOptions(e) {
            let t = [];
            do {
                if (null === e || void 0 === e) break;
                let i = e.currentCategoryViewId;
                if (null === i || void 0 === i) break;
                let n = this.getSortConfig(e);
                L.information("sort_by", n);
                let a = n.sortBy === k.SortNS.SortType.ByTime_Remain || n.sortBy === k.SortNS.SortType.ByTime_Creation || n.sortBy === k.SortNS.SortType.ByTime_Completion,
                    o = "按时间", r = "";
                i === s.DownloadKernel.CategroyViewID.Downloading ? (o = "按创建时间", r = "downloading_rk_rank_click") : i === s.DownloadKernel.CategroyViewID.Completed ? (o = "按完成时间", r = "finished_rk_rank_click") : i === s.DownloadKernel.CategroyViewID.Recycle && (o = "按删除时间", r = "dustbin_rk_rank_click"), t = [{
                    type: "checkbox",
                    label: "默认",
                    id: u.ContextMenuIdsNS.contextMenuToolbarMoreSortByDefault,
                    statId: r,
                    extData: "rank_type=default",
                    checked: n.sortBy === k.SortNS.SortType.Default
                }, {
                    type: "checkbox",
                    label: o,
                    id: u.ContextMenuIdsNS.contextMenuToolbarMoreSortByTime,
                    checked: a,
                    statId: r,
                    extData: "rank_type=create_time",
                    userData: a ? n.asce : void 0
                }, {
                    type: "checkbox",
                    label: "按文件名 A-Z",
                    id: u.ContextMenuIdsNS.contextMenuToolbarMoreSortByName,
                    checked: n.sortBy === k.SortNS.SortType.ByName,
                    statId: r,
                    extData: "rank_type=file_name",
                    userData: n.sortBy === k.SortNS.SortType.ByName ? n.asce : void 0
                }, {
                    type: "checkbox",
                    label: "按文件大小",
                    id: u.ContextMenuIdsNS.contextMenuToolbarMoreSortBySize,
                    checked: n.sortBy === k.SortNS.SortType.BySize,
                    statId: r,
                    extData: "rank_type=file_size",
                    userData: n.sortBy === k.SortNS.SortType.BySize ? n.asce : void 0
                }], i === s.DownloadKernel.CategroyViewID.Downloading && t.splice(2, 0, {
                    type: "checkbox",
                    label: "按当前进度",
                    id: u.ContextMenuIdsNS.contextMenuToolbarMoreSortByProgress,
                    checked: n.sortBy === k.SortNS.SortType.ByProgress,
                    statId: r,
                    extData: "rank_type=progress_speed",
                    userData: n.sortBy === k.SortNS.SortType.ByProgress ? n.asce : void 0
                })
            } while (0);
            return t
        }

        getLastestSavePathsOptions(e, t, i, a) {
            return n(this, void 0, void 0, function* () {
                let n = m.ConfigNS.getValue(t, i, []), o = [],
                    r = u.ContextMenuIdsNS.contextMenuDownloadMoveFileLastest;
                a && (r = u.ContextMenuIdsNS.contextMenuDownloadCopyFileLastest);
                for (let t of n) {
                    let i = /&/gi;
                    t = t.replace(i, "&&"), o.push({type: "normal", label: t, enabled: e, id: r})
                }
                return o
            })
        }

        handleMenuClick(e) {
            let t = e.id, i = e.label, a = e.categoryView;
            switch (t) {
                case u.ContextMenuIdsNS.contextMenuDownloadSelectAll:
                    this.emitter.emit(f.NodeEventMesssageNS.eventDownloadContextMenuClick, "select_all");
                    break;
                case u.ContextMenuIdsNS.contextMenuDownloadDeleteNonexisting:
                    do {
                        if (void 0 === this.contextInfo || null === this.contextInfo) break;
                        let e = this.contextInfo.completedTaskBaseList;
                        if (void 0 === e || null === e) break;
                        if (0 === e.length) break;
                        h.TaskOperatorNs.removeNonExistingTask(e).catch(e => {
                            L.warning(e)
                        })
                    } while (0);
                    break;
                case u.ContextMenuIdsNS.contextMenuDownloadAsReadedAll:
                    do {
                        if (void 0 === this.contextInfo || null === this.contextInfo) break;
                        let e = this.contextInfo.completedTaskBaseList;
                        if (void 0 === e || null === e) break;
                        if (0 === e.length) break;
                        h.TaskOperatorNs.markReadStatus(e, 1)
                    } while (0);
                    break;
                case u.ContextMenuIdsNS.contextMenuDownloadImportUncomplete:
                    h.TaskOperatorNs.importUncompleted().catch();
                    break;
                case u.ContextMenuIdsNS.contextMenuDownloadFolder: {
                    !0 === e.userData && g.XLStatNS.trackEvent("download_leftpanel", "search_rk_openfolders_click", "", 0, 0, 0, 0, this.getStatExtData(a));
                    let t = this.getSelectdTaskInfos();
                    t.length > 0 && (h.TaskOperatorNs.openTaskFolder(t[0]).catch(e => {
                        L.warning(e)
                    }), void 0 !== a && a === s.DownloadKernel.CategroyViewID.Completed && h.TaskOperatorNs.markReadStatus(t, 1))
                }
                    break;
                case u.ContextMenuIdsNS.contextMenuGroupAccelerate: {
                    let e = this.getSelectdTaskInfos();
                    a === s.DownloadKernel.CategroyViewID.Downloading ? R.openGroupAccelerateTabByTaskId(e[0].taskId, "menu", "downloading", void 0).catch() : R.openGroupAccelerateTabByTaskId(e[0].taskId, "menu", "complete", void 0).catch()
                }
                    break;
                case u.ContextMenuIdsNS.contxtMenuSubtitleSearch: {
                    let e = this.getSelectdTaskInfos()[0].taskId, t = U.getTaskFromTaskId(e), i = t.getTaskName(),
                        n = t.getType(), a = "";
                    t && (a = t.getSavePath()), n === s.DownloadKernel.TaskType.Bt && t.getExtraObject().getDownloadFile().length > 1 && (a = D.join(a, i));
                    let o = t.getTaskAttribute(s.DownloadKernel.TaskAttribute.CategoryViewId), r = K.getDisaplayName(e),
                        l = 0;
                    (l = r.length) > 1 ? y.MessageBox.custom("SubtitleTaskFilelist", {
                        size: "large",
                        taskId: e,
                        taskName: i,
                        taskType: n,
                        fileList: r,
                        saveDir: a,
                        categoryViewId: o
                    }, {
                        center: !0,
                        width: 500,
                        height: 329
                    }).catch() : y.MessageBox.custom("SubtitleSearch", {
                        taskId: e,
                        taskName: r[0].fileName,
                        cid: r[0].cid,
                        saveDir: a,
                        from: "taskList",
                        categoryViewId: o
                    }, {center: !0, width: 500, height: 323}).catch()
                }
                    break;
                case u.ContextMenuIdsNS.contextMenuDownloadStartAll:
                    do {
                        if (void 0 === this.contextInfo || null === this.contextInfo) break;
                        let e = this.contextInfo.downloadingTaskBaseList;
                        if (void 0 === e || null === e) break;
                        if (0 === e.length) break;
                        -1 === this.categoryId ? h.TaskOperatorNs.startAll() : h.TaskOperatorNs.startCategoryAllTask(this.categoryId)
                    } while (0);
                    break;
                case u.ContextMenuIdsNS.contextMenuDownloadStart: {
                    let e = this.getSelectdTaskInfos();
                    e.length > 0 && h.TaskOperatorNs.startTasks(e)
                }
                    break;
                case u.ContextMenuIdsNS.contextMenuDownloadPauseAll:
                    do {
                        if (void 0 === this.contextInfo || null === this.contextInfo) break;
                        let e = this.contextInfo.downloadingTaskBaseList;
                        if (void 0 === e || null === e) break;
                        if (0 === e.length) break;
                        h.TaskOperatorNs.pauseTasks(e, s.DownloadKernel.TaskStopReason.PauseAll)
                    } while (0);
                    break;
                case u.ContextMenuIdsNS.contextMenuDownloadPause: {
                    let e = this.getSelectdTaskInfos();
                    e.length > 0 && h.TaskOperatorNs.pauseTasks(e, s.DownloadKernel.TaskStopReason.Manual)
                }
                    break;
                case u.ContextMenuIdsNS.contextMenuDownloadDelete: {
                    !0 === e.userData && g.XLStatNS.trackEvent("download_leftpanel", "search_rk_delete_click", "", 0, 0, 0, 0, this.getStatExtData(a));
                    let t = this.getSelectdTaskInfos();
                    t.length > 0 && h.TaskOperatorNs.deleteTasks(t)
                }
                    break;
                case u.ContextMenuIdsNS.contextMenuDownloadDestroy: {
                    !0 === e.userData && g.XLStatNS.trackEvent("download_leftpanel", "search_rk_completedelete_click", "", 0, 0, 0, 0, this.getStatExtData(a));
                    let t = this.getSelectdTaskInfos();
                    t.length > 0 && h.TaskOperatorNs.destroyTasks(t)
                }
                    break;
                case u.ContextMenuIdsNS.contextMenuDownloadMoveFilePrivateSpace: {
                    let e = this.getSelectdTaskInfos();
                    e.length > 0 && S.default(!1, !0, "privatespace").then(t => n(this, void 0, void 0, function* () {
                        if (t && "" !== t) {
                            let i = 0;
                            if (!1 === C.PrivateSpaceHelperNS.isPrivateSpaceOpen(t) && 0 !== (i = yield C.PrivateSpaceHelperNS.phoneVerifyPrivateCategory(t))) return;
                            if (0 === (i = yield C.PrivateSpaceHelperNS.openPrivateCategory(t)) && 0 === (i = yield C.PrivateSpaceHelperNS.accessPrivateCategory(t))) {
                                let i = yield C.PrivateSpaceHelperNS.getPrivateSavePath(t);
                                if (i = D.join(i, t), yield h.TaskOperatorNs.move2Dir(e, i, !1)) {
                                    let i = B.getPrivateCategoryFromUserId(t);
                                    i && h.TaskOperatorNs.moveCategoryTask(e, i.getId())
                                }
                            }
                        }
                    })).catch()
                }
                    break;
                case u.ContextMenuIdsNS.contextMenuDownloadMoveFileOutPrivateSpace: {
                    let e = this.getSelectdTaskInfos();
                    if (e.length > 0) {
                        let t = m.ConfigNS.getValue("PathAndCategory", "LastUsedPath", "");
                        null !== t && void 0 !== t && "" !== t || (t = m.ConfigNS.getValue("TaskDefaultSettings", "DefaultPath", "")), h.TaskOperatorNs.move2Dir(e, t, !1).then(t => {
                            t && B.getCurrentPrivateCategory() && h.TaskOperatorNs.moveCategoryTask(e, -1)
                        }).catch()
                    }
                }
                    break;
                case u.ContextMenuIdsNS.contextMenuDownloadMoveFileOther: {
                    let e = this.getSelectdTaskInfos();
                    e.length > 0 && h.TaskOperatorNs.move2Dir(e).catch(e => {
                        L.warning(e)
                    })
                }
                    break;
                case u.ContextMenuIdsNS.contextMenuDownloadMoveFileLastest: {
                    let e = this.getSelectdTaskInfos();
                    if (e.length > 0) {
                        let t = /&&/gi, n = i.replace(t, "&");
                        h.TaskOperatorNs.move2Dir(e, n).catch(e => {
                            L.warning(e)
                        })
                    }
                }
                    break;
                case u.ContextMenuIdsNS.contextMenuDownloadMoveTop:
                    this.emitter.emit(f.NodeEventMesssageNS.eventDownloadContextMenuClick, "move_up");
                    break;
                case u.ContextMenuIdsNS.contextMenuDownloadMoveBottom:
                    this.emitter.emit(f.NodeEventMesssageNS.eventDownloadContextMenuClick, "move_down");
                    break;
                case u.ContextMenuIdsNS.contextMenuDownloadMerge:
                    break;
                case u.ContextMenuIdsNS.contextMenuDownloadCopyLink: {
                    !0 === e.userData && g.XLStatNS.trackEvent("download_leftpanel", "search_rk_copyurl_click", "", 0, 0, 0, 0, this.getStatExtData(a));
                    let t = this.getSelectdTaskInfos();
                    t.length > 0 && h.TaskOperatorNs.copyLink(t, this.getPanel(a))
                }
                    break;
                case u.ContextMenuIdsNS.contextMenuDownloadCopyMagnet: {
                    !0 === e.userData && g.XLStatNS.trackEvent("download_leftpanel", "search_rk_copyurl_click", "", 0, 0, 0, 0, this.getStatExtData(a));
                    let t = this.getSelectdTaskInfos();
                    t.length > 0 && h.TaskOperatorNs.copyMagnetLink(t[0], this.getPanel(a))
                }
                    break;
                case u.ContextMenuIdsNS.contextMenuDownloadTorrentSaveAs: {
                    let e = this.getSelectdTaskInfos();
                    e.length > 0 && h.TaskOperatorNs.saveAsTorrent(e[0]).catch()
                }
                    break;
                case u.ContextMenuIdsNS.contextMenuPlayFile: {
                    !0 === e.userData && g.XLStatNS.trackEvent("download_leftpanel", "search_rk_playfiles_click", "", 0, 0, 0, 0, this.getStatExtData(a));
                    let t = this.getSelectdTaskInfos();
                    t.length > 0 && (F.client.callServerFunction("OperateTask", t[0].taskId, "play").catch(), h.TaskOperatorNs.markReadStatus(t, 1))
                }
                    break;
                case u.ContextMenuIdsNS.contextMenuDownloadFile: {
                    !0 === e.userData && g.XLStatNS.trackEvent("download_leftpanel", "search_rk_openfiles_click", "", 0, 0, 0, 0, this.getStatExtData(a));
                    let t = "";
                    e.categoryView === s.DownloadKernel.CategroyViewID.Completed ? t = "finished" : e.categoryView === s.DownloadKernel.CategroyViewID.Recycle && (t = "dustbin");
                    let i = this.getSelectdTaskInfos();
                    if (i.length > 0) {
                        let e = i[0];
                        if (e.taskType === s.DownloadKernel.TaskType.Bt) {
                            let t = U.getTaskFromTaskId(e.taskId);
                            p.SingleBtTaskNS.isSingleBtTask(t).then(t => {
                                t ? h.TaskOperatorNs.openTaskItem(e).catch() : h.TaskOperatorNs.openTaskFolder(e, !0).catch()
                            }).catch()
                        } else if (e.taskType === s.DownloadKernel.TaskType.Group) {
                            let t = U.getTaskFromTaskId(e.taskId);
                            h.TaskOperatorNs.executeInstallFile(t).then(t => {
                                t || h.TaskOperatorNs.openTaskFolder(e, !0).catch()
                            }).catch()
                        } else h.TaskOperatorNs.openTaskItem(e, void 0, void 0, t, this.categoryId).catch(e => {
                            L.warning(e)
                        });
                        void 0 !== a && a === s.DownloadKernel.CategroyViewID.Completed && h.TaskOperatorNs.markReadStatus(i, 1)
                    }
                }
                    break;
                case u.ContextMenuIdsNS.contextMenuDownloadOpenAs:
                    let o = this.getSelectdTaskInfos();
                    if (o.length > 0) {
                        let e = o[0];
                        if (e.taskType === s.DownloadKernel.TaskType.Bt) {
                            let t = U.getTaskFromTaskId(e.taskId);
                            p.SingleBtTaskNS.isSingleBtTask(t).then(t => {
                                t && h.TaskOperatorNs.openAsTaskItem(e).catch()
                            }).catch()
                        } else e.taskType !== s.DownloadKernel.TaskType.Group && h.TaskOperatorNs.openAsTaskItem(e).catch()
                    }
                    break;
                case u.ContextMenuIdsNS.contextMenuDownloadRename: {
                    let e = this.getSelectdTaskInfos();
                    e.length > 0 && h.TaskOperatorNs.renameTask(e[0])
                }
                    break;
                case u.ContextMenuIdsNS.contextMenuDownloadCopyFileOther: {
                    let e = this.getSelectdTaskInfos();
                    e.length > 0 && h.TaskOperatorNs.copy2Dir(e).catch(e => {
                        L.warning(e)
                    })
                }
                    break;
                case u.ContextMenuIdsNS.contextMenuDownloadCopyFileLastest: {
                    let e = this.getSelectdTaskInfos();
                    if (e.length > 0) {
                        let t = /&&/gi, n = i.replace(t, "&");
                        h.TaskOperatorNs.copy2Dir(e, n).catch(e => {
                            L.warning(e)
                        })
                    }
                }
                    break;
                case u.ContextMenuIdsNS.contextMenuDownloadRedownload: {
                    let e = this.getSelectdTaskInfos();
                    if (e.length > 0) {
                        let t = "";
                        void 0 !== a && a === s.DownloadKernel.CategroyViewID.Completed ? t = "finished_rk_reload_click" : a === s.DownloadKernel.CategroyViewID.Recycle && (t = "dustbin_rk_reload_click"), c.TaskCtrlOperatorNS.redownloadTask(e, void 0, t).catch()
                    }
                }
                    break;
                case u.ContextMenuIdsNS.contextMenuDownloadRecover: {
                    let e = this.getSelectdTaskInfos();
                    e.length > 0 && h.TaskOperatorNs.recoverTask(e)
                }
                    break;
                case u.ContextMenuIdsNS.contextMenuDownloadClear:
                    h.TaskOperatorNs.clearRecycle();
                    break;
                case u.ContextMenuIdsNS.contextMenuToolbarMoreConfig:
                    if (null !== this.contextInfo) {
                        let e = {tabType: v.TabType.XDAS, tabParam: {title: "设置中心", name: "conf-setting"}};
                        g.XLStatNS.trackEvent("setting_center", "setting_panel_show", "", 0, 0, 0, 0, "entry=download_panel"), this.contextInfo.CREATE_NEW_TAB(e)
                    }
                    break;
                case u.ContextMenuIdsNS.contextMenuToolbarMoreOpenHelp:
                    if (null !== this.contextInfo) {
                        let e = {
                            tabType: v.TabType.Chromium,
                            tabParam: {
                                title: "下载帮助",
                                url: "http://pc.xunlei.com/pages/#/help",
                                name: "下载帮助",
                                showUrl: !0
                            }
                        };
                        g.XLStatNS.trackEvent("download_detai", "help_tips_entry_show", "", 0, 0, 0, 0, "position=dl_panel"), this.contextInfo.CREATE_NEW_TAB(e)
                    }
                    break;
                case u.ContextMenuIdsNS.contextMenuToolbarMoreOpenSearch:
                    _.default.fireEvent(f.NodeEventMesssageNS.eventShowSearchTaskPage, !0);
                    break;
                case u.ContextMenuIdsNS.contextMenuToolbarMoreSortByDefault:
                    k.SortNS.handleSortMenuClick(this.contextInfo.SORT_CATEGORY_BY_FUNCTION, k.SortNS.SortType.Default, e.userData, this.contextInfo.currentCategoryViewId, this.contextInfo.currentCategoryId);
                    break;
                case u.ContextMenuIdsNS.contextMenuToolbarMoreSortByTime:
                    k.SortNS.handleSortMenuClick(this.contextInfo.SORT_CATEGORY_BY_FUNCTION, k.SortNS.SortType.ByTime, e.userData, this.contextInfo.currentCategoryViewId, this.contextInfo.currentCategoryId);
                    break;
                case u.ContextMenuIdsNS.contextMenuToolbarMoreSortByType:
                    k.SortNS.handleSortMenuClick(this.contextInfo.SORT_CATEGORY_BY_FUNCTION, k.SortNS.SortType.ByType, e.userData, this.contextInfo.currentCategoryViewId, this.contextInfo.currentCategoryId);
                    break;
                case u.ContextMenuIdsNS.contextMenuToolbarMoreSortByName:
                    k.SortNS.handleSortMenuClick(this.contextInfo.SORT_CATEGORY_BY_FUNCTION, k.SortNS.SortType.ByName, e.userData, this.contextInfo.currentCategoryViewId, this.contextInfo.currentCategoryId);
                    break;
                case u.ContextMenuIdsNS.contextMenuToolbarMoreSortBySize:
                    k.SortNS.handleSortMenuClick(this.contextInfo.SORT_CATEGORY_BY_FUNCTION, k.SortNS.SortType.BySize, e.userData, this.contextInfo.currentCategoryViewId, this.contextInfo.currentCategoryId);
                    break;
                case u.ContextMenuIdsNS.contextMenuToolbarMoreSortByStatus:
                    break;
                case u.ContextMenuIdsNS.contextMenuToolbarMoreSortByProgress:
                    k.SortNS.handleSortMenuClick(this.contextInfo.SORT_CATEGORY_BY_FUNCTION, k.SortNS.SortType.ByProgress, e.userData, this.contextInfo.currentCategoryViewId, this.contextInfo.currentCategoryId);
                    break;
                case u.ContextMenuIdsNS.contextMenuToolbarMoreDestroy:
                    if (null !== this.contextInfo) {
                        let e = this.getSelectdTaskInfos();
                        null !== e && void 0 !== e && e.length > 0 && h.TaskOperatorNs.destroyTasks(e)
                    }
                    break;
                case u.ContextMenuIdsNS.contextMenuTabChangeCategoryMyComputer:
                    this.emitter.emit(f.NodeEventMesssageNS.eventDownloadContextMenuClick, "my_computer");
                    break;
                case u.ContextMenuIdsNS.contextMenuTabChangeCategoryPrivateSpace:
                    this.emitter.emit(f.NodeEventMesssageNS.eventDownloadContextMenuClick, "private_space");
                    break;
                case u.ContextMenuIdsNS.contextMenuToolbarPrivateSpaceSelectAll:
                    this.emitter.emit(f.NodeEventMesssageNS.eventDownloadContextMenuClick, "select_all");
                    break;
                case u.ContextMenuIdsNS.contextMenuToolbarPrivateSpaceDownloadSetting:
                    F.client.callServerFunction("GetUserID").then(e => n(this, void 0, void 0, function* () {
                        if (e && "" !== e) {
                            let t = yield C.PrivateSpaceHelperNS.getPrivateSavePath(e),
                                i = m.ConfigNS.getValue("PrivateSpaceLockUserTask", e, 1);
                            y.MessageBox.custom("private-space-download-setting", {
                                savePath: t,
                                hideLocalDir: 1 === i
                            }).then(t => n(this, void 0, void 0, function* () {
                                t.action === N.MessageBoxNS.Action.OK && (m.ConfigNS.setValue("PrivateSpaceDefaultPath", e, t.args.savePath), m.ConfigNS.setValue("PrivateSpaceLockUserTask", e, t.args.hideLocalDir), C.PrivateSpaceHelperNS.setPrivateSavePath(e, t.args.savePath).then().catch(), C.PrivateSpaceHelperNS.setAllTaskFileHidden(e, 1 === t.args.hideLocalDir))
                            })).catch()
                        }
                    })).catch();
                    break;
                case u.ContextMenuIdsNS.contextMenuToolbarPrivateSpacePasswwordChange:
                    F.client.callServerFunction("GetUserID").then(e => n(this, void 0, void 0, function* () {
                        e && "" !== e && 0 === (yield C.PrivateSpaceHelperNS.phoneVerifyPrivateCategory(e)) && C.PrivateSpaceHelperNS.changePrivateSpacePassword(e).catch()
                    })).catch();
                    break;
                case u.ContextMenuIdsNS.contextMenuToolbarPrivateSpaceTaskManager:
                    y.MessageBox.custom("private-space-task-manager", {}).catch();
                    break;
                case u.ContextMenuIdsNS.contextMenuShouleiFileTransfer:
                    this.handleShouleiFileTransfer().catch();
                    break;
                case u.ContextMenuIdsNS.contextMenuOpenTaskPosition: {
                    !0 === e.userData && g.XLStatNS.trackEvent("download_leftpanel", "search_rk_openlocation_click", "", 0, 0, 0, 0, this.getStatExtData(a)), _.default.fireEvent(f.NodeEventMesssageNS.eventShowSearchTaskPage, !1);
                    let t = this.getSelectdTaskInfos()[0];
                    I.ThunderNewTask.selectTask(t.taskId).catch()
                }
                    break;
                case u.ContextMenuIdsNS.contextMenuDownloadByShoulei:
                    this.handleDownloadByShoulei().catch();
                    break;
                case u.ContextMenuIdsNS.contextMenuDownloadShare: {
                    let e = this.getSelectdTaskInfos();
                    1 === e.length && h.TaskOperatorNs.shareLink(e[0], this.getPanel(a), "leftlist_rk_share")
                }
            }
        }

        getStatExtData(e) {
            let t = "mypc";
            return -1 !== _.default.getCurrentCategoryId() && (t = "private"), "panel_type=" + t + ",panel=" + this.getPanel(e)
        }

        getPanel(e) {
            let t = "unknown";
            switch (e) {
                case s.DownloadKernel.CategroyViewID.Completed:
                    t = "finished";
                    break;
                case s.DownloadKernel.CategroyViewID.Downloading:
                    t = "downloading";
                    break;
                case s.DownloadKernel.CategroyViewID.Recycle:
                    t = "dustbin"
            }
            return t
        }

        getSelectdTaskInfos() {
            let e = this.contextInfo.currentSelectdTaskInfos;
            return "search" === this.contextInfo.searchType && (e = this.contextInfo.currentSelSearchTaskInfos), e
        }

        popMenuInternal(e, t, i) {
            return n(this, void 0, void 0, function* () {
                let n = this.buildMenuTemplate(e);
                if (n.length > 0) {
                    let e = [];
                    if (this.menuEventClients.hasOwnProperty(t)) {
                        let i = this.menuEventClients[t];
                        for (let t of i) {
                            let i = yield M.server.callClientFunctionByName(t, "GetContextMenuExtra", this.contextInfo.currentCategoryId, this.contextInfo.currentCategoryViewId, this.getSelectdTaskInfos());
                            i && i[0] && i[0].length > 0 && e.push(...this.buildMenuTemplateFromRemote(t, i[0]))
                        }
                    }
                    e.length > 0 && n.push(...e);
                    const o = yield a.asyncRemoteCall.getCurrentWindow();
                    this.emitter.emit(f.NodeEventMesssageNS.eventDownloadContextMenuPopup, n);
                    const r = yield(yield a.asyncRemoteCall.getMenu()).buildFromTemplate(n);
                    yield E.MenuSkinNS.setStyle(r, {}), i ? r.popup({
                        window: o,
                        x: i.clientX,
                        y: i.clientY,
                        async: !1
                    }) : r.popup({
                        window: o,
                        async: !1
                    }), this.emitter.emit(f.NodeEventMesssageNS.eventDownloadContextMenuEnd)
                }
            })
        }

        statExtData(e) {
            let t = "panel_type=mypc";
            return -1 !== this.categoryId && (t = "panel_type=private"), void 0 !== e && "" !== e && (t = t + "," + e), t
        }

        buildMenuTemplateFromRemote(e, t) {
            let i = [];
            for (let e = 0; e < t.length; e++) {
                let n = null, a = t[e];
                if ("submenu" === a.type) {
                    let e = this.buildMenuTemplate(a.submenu);
                    n = {type: a.type, label: a.label, submenu: e}
                } else if ("separator" === a.type) n = {type: a.type}; else {
                    let e = Object.assign({}, a), t = a.click;
                    void 0 !== t && null !== t && (a.click = (() => {
                        if (void 0 !== a.statId && "" !== a.statId) {
                            void 0 === a.extData && (a.extData = "");
                            let e = this.statExtData(a.extData);
                            L.information("trackEvent", "download_leftpanel", a.statId, e), g.XLStatNS.trackEvent("download_leftpanel", a.statId, "", 0, 0, 0, 0, e)
                        }
                        a.statId = void 0, t(e)
                    })), n = {
                        type: a.type,
                        label: a.label,
                        enabled: a.enabled,
                        icon: a.icon,
                        id: a.id,
                        checked: a.checked,
                        click: a.click
                    }
                }
                null !== n && i.push(n)
            }
            return i
        }

        buildMenuTemplate(e) {
            let t = [];
            for (let i = 0; i < e.length; i++) {
                let n = null, a = e[i];
                if (!A.isBoolean(a.visible) || a.visible) {
                    if ("submenu" === a.type) {
                        let e = this.buildMenuTemplate(a.submenu);
                        n = {type: a.type, label: a.label, submenu: e}
                    } else n = "separator" === a.type ? {type: a.type} : {
                        type: a.type,
                        label: a.label,
                        enabled: a.enabled,
                        icon: a.icon,
                        id: a.id,
                        checked: a.checked,
                        click: (...e) => {
                            if ("function" != typeof a.click) {
                                if (void 0 !== a.statId && "" !== a.statId) {
                                    void 0 === a.extData && (a.extData = "");
                                    let e = this.statExtData(a.extData);
                                    L.information("trackEvent", "download_leftpanel", a.statId, e), g.XLStatNS.trackEvent("download_leftpanel", a.statId, "", 0, 0, 0, 0, e)
                                }
                                this.handleMenuClick(a)
                            } else a.click(...e)
                        }
                    };
                    null !== n && t.push(n)
                }
            }
            return t
        }
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(0).default.getLogger("msg-queue");
    !function (e) {
        let t;
        !function (e) {
            e[e.Community = 0] = "Community", e[e.AdvertisementMarket = 1] = "AdvertisementMarket", e[e.AdvertisementFunctional = 2] = "AdvertisementFunctional", e[e.Download = 3] = "Download"
        }(t = e.MsgPriority || (e.MsgPriority = {}));
        e.Queue = class {
            constructor() {
                this.queue = [], this.priority = 0
            }

            enQueue(e) {
                let t = !1;
                n.information("消息队列增加消息", this.queue);
                for (let i = 0; i < this.queue.length; i++) if (this.queue[i].priority >= e.priority) {
                    t = !0, this.queue.splice(i, 0, e);
                    break
                }
                t || this.queue.push(e)
            }

            deQueue() {
                if (0 !== this.queue.length) {
                    let e = this.queue.pop();
                    this.priority = e.priority, void 0 !== e.callback && "function" == typeof e.callback && (n.information("消息队列弹出消息", this.queue), e.callback())
                }
            }

            clearQueuesByName(e) {
                let t = [];
                for (let i = 0; i < this.queue.length; i++) this.queue[i].name !== e && t.push(this.queue[i]);
                this.queue = t
            }

            isEmpty() {
                return 0 === this.queue.length
            }

            getCurrentProperty() {
                return this.priority
            }
        }
    }(t.MsgQueueNS || (t.MsgQueueNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(19), r = i(332), s = i(3), l = i(11), d = i(15), u = i(40), c = i(43), h = i(0), f = i(7),
        g = i(65), p = i(41), v = i(59), m = i(14), y = i(35), k = i(61), T = i(25), w = i(16), C = i(415), S = i(5),
        b = l.DownloadKernelTaskManager.getTaskManager(), I = d.DownloadKernelEventManager.getEventManager(),
        _ = u.DownloadKernelCategoryViewManager.getCategoryViewManager(), A = h.default.getLogger("ShouleiSync"),
        D = 1e4, x = 12e4 / D;
    !function (e) {
        class t {
            constructor(e) {
                this.action = void 0, this.action = e
            }

            getAction() {
                return this.action
            }
        }

        class i extends t {
            constructor() {
                super("sync")
            }

            execute() {
                return n(this, void 0, void 0, function* () {
                    return this.report(yield this.getSyncTaskDatas()), !0
                })
            }

            report(e) {
                g.fetchSlRes({url: "/xlppc.downloadlist.sync/api/list", data: e, method: "post"}).catch()
            }

            getTaskStatus(e) {
                let t = "pause";
                switch (e) {
                    case s.DownloadKernel.TaskStatus.StartWaiting:
                        t = "waiting";
                        break;
                    case s.DownloadKernel.TaskStatus.Started:
                        t = "downloading";
                        break;
                    case s.DownloadKernel.TaskStatus.Failed:
                        t = "fail";
                        break;
                    case s.DownloadKernel.TaskStatus.StopPending:
                    case s.DownloadKernel.TaskStatus.Stopped:
                        t = "pause";
                        break;
                    case s.DownloadKernel.TaskStatus.Succeeded:
                    case s.DownloadKernel.TaskStatus.Seeding:
                        t = "complete"
                }
                return t
            }

            getTaskCategory(e) {
                let t;
                switch (e) {
                    case s.DownloadKernel.CategroyViewID.Downloading:
                        t = "downloading";
                        break;
                    case s.DownloadKernel.CategroyViewID.Completed:
                        t = "complete"
                }
                return t
            }

            getSyncTaskDatas() {
                return n(this, void 0, void 0, function* () {
                    let e = [], t = _.getCategoryViewFromId(s.DownloadKernel.CategroyViewID.Downloading),
                        n = _.getCategoryViewFromId(s.DownloadKernel.CategroyViewID.Completed), a = t.getTasks(),
                        o = n.getTasks(), r = [...a.values(), ...o.values()];
                    r.sort((e, t) => t.getTaskAttribute(s.DownloadKernel.TaskAttribute.CreateTime) - e.getTaskAttribute(s.DownloadKernel.TaskAttribute.CreateTime)), r = r.filter(e => {
                        let t = e.getType();
                        return t !== s.DownloadKernel.TaskType.Group && t !== s.DownloadKernel.TaskType.Unkown
                    });
                    let l = 0;
                    for (let t = 0; t < r.length && l < i.maxSyncCount; ++t) {
                        let i, n, a, o = r[t], d = o.getTaskBaseInfo(),
                            u = o.getTaskAttribute(s.DownloadKernel.TaskAttribute.CategoryViewId);
                        if (u !== s.DownloadKernel.CategroyViewID.Completed || (yield p.TaskCtrlOperatorNS.isExistTaskFile(d))) {
                            if (d.taskType === s.DownloadKernel.TaskType.Bt) {
                                i = "bt";
                                let e = o.getExtraObject();
                                a = e.getInfoId();
                                let t = e.getFileCount();
                                n = "";
                                for (let i = 0; i < t; ++i) {
                                    let t = e.getBtFileByRealIndex(i);
                                    t && 1 === t.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.Download) ? n += "1" : n += "0"
                                }
                            } else i = "url", a = d.url;
                            e.push({
                                task_id: String(d.taskId),
                                task_type: i,
                                name: d.taskName,
                                link: a,
                                source: d.origin,
                                source_url: d.url,
                                index: n,
                                status: this.getTaskStatus(d.taskStatus),
                                error_code: d.errorCode,
                                category: this.getTaskCategory(u),
                                speed: d.downloadSpeed,
                                total_size: o.getTaskAttribute(s.DownloadKernel.TaskAttribute.FileSize),
                                download_size: o.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSize)
                            }), ++l
                        }
                    }
                    return A.information("taskInfos", e), JSON.stringify(e)
                })
            }
        }

        i.maxSyncCount = 100;

        class l extends t {
            constructor(e) {
                super("add"), this.taskList = null, this.magnetTaskIdMap = null, this.taskList = e, this.magnetTaskIdMap = new Map
            }

            execute() {
                return n(this, void 0, void 0, function* () {
                    return yield this.batchCreateTask(), !0
                })
            }

            doRepeatTasks(e, t) {
                return n(this, void 0, void 0, function* () {
                    for (let i = 0; i < e.length; ++i) {
                        let n = e[i], a = n.getType(), o = null;
                        for (let e = t.length - 1; e >= 0; --e) {
                            let i = t[e];
                            if (i.dk_task_type === a) if (a === s.DownloadKernel.TaskType.Bt) {
                                let a = n.getExtraObject();
                                if (i.link.toLocaleLowerCase() === a.getInfoId().toLocaleLowerCase()) {
                                    o = i, t.splice(e, 1);
                                    continue
                                }
                            } else if (a === s.DownloadKernel.TaskType.Emule) {
                                let a = n.getExtraObject();
                                if (i.ed2k_hash.toLocaleLowerCase() === a.getFileHash().toLocaleLowerCase()) {
                                    o = i, t.splice(e, 1);
                                    continue
                                }
                            } else if (a === s.DownloadKernel.TaskType.P2sp && i.link.toLocaleLowerCase() === n.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskUrl).toLocaleLowerCase()) {
                                o = i, t.splice(e, 1);
                                continue
                            }
                        }
                        if (o && -1 === n.getTaskAttribute(s.DownloadKernel.TaskAttribute.CategoryId)) {
                            if (a === s.DownloadKernel.TaskType.Bt) {
                                let e = n.getExtraObject(), t = e.getFileCount(), i = "";
                                for (let n = 0; n < t; ++n) {
                                    let t = e.getBtFileByRealIndex(n);
                                    t && 1 === t.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.Download) ? i += "1" : i += "0", t && s.DownloadKernel.BtFileStatus.Complete === t.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.FileStatus) && "1" !== o.index[n] && (o.index = o.index.substr(0, n) + "1" + o.index.substr(n + 1))
                                }
                                if (i !== o.index) {
                                    let t = [];
                                    for (let i = 0; i < o.index.length; ++i) if ("1" === o.index[i]) t.push(i); else {
                                        let n = e.getBtFileByRealIndex(i);
                                        s.DownloadKernel.BtFileStatus.Complete === n.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.FileStatus) && t.push(i)
                                    }
                                    let i = n.getId();
                                    (yield b.downloadTaskSelectFiles(i, JSON.stringify(t))) && c.DownloadDispatchNS.startTask(i);
                                    continue
                                }
                            }
                            let e = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.CategoryViewId);
                            e === s.DownloadKernel.CategroyViewID.Downloading ? c.DownloadDispatchNS.startTask(n.getId()) : e === s.DownloadKernel.CategroyViewID.Completed ? (yield p.TaskCtrlOperatorNS.isExistTaskFile(n.getTaskBaseInfo())) || (yield this.reDownloadTask(n, o)) : e === s.DownloadKernel.CategroyViewID.Recycle && (yield this.reDownloadTask(n, o))
                        }
                    }
                })
            }

            reDownloadTask(e, t) {
                return n(this, void 0, void 0, function* () {
                    let i = {
                        taskBaseInfo: {savePath: void 0, taskName: void 0, origin: t.source},
                        p2spTaskInfo: {url: void 0}
                    }, n = yield b.reDownloadTask(e.getId(), i);
                    if (null !== n) {
                        let e = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskId);
                        c.DownloadDispatchNS.startTask(e)
                    }
                })
            }

            btRepeatDeleteExist(e) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (void 0 === e) break;
                        if (null === e) break;
                        for (let t of e) yield S.FileSystemAWNS.unlinkAW(t.fullPath)
                    } while (0)
                })
            }

            batchCreateTask() {
                return n(this, void 0, void 0, function* () {
                    let e = [];
                    for (let t = 0; t < this.taskList.length; t++) {
                        let i = this.taskList[t];
                        if (!i || !i.task_type || !i.link) {
                            A.warning("invalid taskData!", i), this.taskList.splice(t, 1);
                            continue
                        }
                        if ("bt" === i.task_type && !i.index) {
                            A.warning("invalid bt task, no index!", i), this.taskList.splice(t, 1);
                            continue
                        }
                        let n, a = s.DownloadKernel.TaskType.Unkown;
                        if ((a = "bt" === i.task_type ? s.DownloadKernel.TaskType.Bt : y.ThunderHelper.getTaskTypeFromUrl(i.link)) !== s.DownloadKernel.TaskType.Unkown) {
                            if (a === s.DownloadKernel.TaskType.Emule) {
                                let e = k.ParseUrlFileNameNS.parseEd2kUrl(i.link);
                                i.ed2k_hash = e.fileHash, n = e.fileHash
                            } else a !== s.DownloadKernel.TaskType.P2sp && a !== s.DownloadKernel.TaskType.Bt || (n = i.link);
                            !n || n.length <= 0 ? (A.warning("findInfo unknown value!", i, a), this.taskList.splice(t, 1)) : (i.dk_task_type = a, e.push({
                                taskType: a,
                                value: n
                            }), ++t)
                        } else A.warning("unknown task type!", i.link), this.taskList.splice(t, 1)
                    }
                    let t = [...this.taskList], i = yield v.TaskUtilitiesAWNS.batchFindTaskAW(e);
                    if (A.information("repeatTasks", i), i.length > 0 && (yield this.doRepeatTasks(i, t)), A.information("newTaskDatas", t), t.length > 0) {
                        let e = [], i = m.ThunderUtil.getDefaultDownloadDir(), o = [];
                        for (let n = 0; n < t.length; ++n) {
                            let a = t[n];
                            if (a.dk_task_type === s.DownloadKernel.TaskType.Bt) e.push(a); else {
                                let e = p.TaskCtrlOperatorNS.constructProductInfo(""), t = {
                                    taskName: k.ParseUrlFileNameNS.getNameFromUrl(a.link),
                                    savePath: i,
                                    productInfo: e,
                                    origin: a.source
                                }, n = {taskType: a.dk_task_type, taskBaseInfo: t};
                                a.dk_task_type === s.DownloadKernel.TaskType.P2sp ? (n.p2spTaskInfo = {
                                    url: a.link,
                                    cookie: a.cookie
                                }, o.push(n)) : a.dk_task_type === s.DownloadKernel.TaskType.Emule && (n.taskType = s.DownloadKernel.TaskType.Emule, n.emuleTaskInfo = {url: a.link}, o.push(n))
                            }
                        }
                        if (o.length > 0) {
                            A.information("createBatchTask newTaskInfos", o);
                            let e = yield b.createBatchTask(o);
                            if (A.information("createBatchTask tasks", e), e.length > 0) {
                                let t = [];
                                e.forEach(e => {
                                    t.push(e.getId())
                                }), A.information("startTasks taskIds", t), c.DownloadDispatchNS.startTasks(t)
                            }
                        }
                        e.length > 0 && (A.information("btNewTasks", e), e.forEach(e => n(this, void 0, void 0, function* () {
                            let t = (e, t, o) => n(this, void 0, void 0, function* () {
                                    do {
                                        if (t) {
                                            let t = b.getTaskFromTaskId(e);
                                            if (!t) {
                                                A.warning("getTaskFromTaskId failed!", e);
                                                break
                                            }
                                            let n = t.getTaskAttribute(s.DownloadKernel.TaskAttribute.SavePath),
                                                o = t.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskName),
                                                r = a.join(n, o), l = yield v.TaskUtilitiesAWNS.parserBtFileInfoAW(r);
                                            if (null === l) {
                                                A.warning("parserBtFileInfoAW!", r);
                                                break
                                            }
                                            let d = this.magnetTaskIdMap.get(e);
                                            if (d) {
                                                let e = p.TaskCtrlOperatorNS.constructProductInfo(""),
                                                    t = {savePath: i, taskName: l.title, productInfo: e, origin: d.source},
                                                    a = [];
                                                for (let e = 0; e < l.fileLists.length; ++e) "1" === d.index[e] && a.push(l.fileLists[e].realIndex);
                                                let o = yield p.TaskCtrlOperatorNS.getBtExistFilePathList(n, l, a);
                                                o.length > 0 && (yield this.btRepeatDeleteExist(o));
                                                let u = "magnet:?xt=urn:btih:" + d.link, h = {
                                                    originUrl: d.source_url || u,
                                                    seedFile: r,
                                                    displayName: l.title,
                                                    fileLists: l.fileLists,
                                                    infoId: l.infoId,
                                                    fileRealIndexLists: a,
                                                    tracker: l.trackerUrls.join("\n")
                                                }, f = {
                                                    taskType: s.DownloadKernel.TaskType.Bt,
                                                    taskBaseInfo: t,
                                                    btTaskInfo: h
                                                }, g = yield b.createTask(s.DownloadKernel.TaskType.Bt, f);
                                                if (A.information("create task magnet productinfo", e), null !== g) {
                                                    let e = g.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskId);
                                                    c.DownloadDispatchNS.startTask(e)
                                                }
                                            }
                                        } else A.warning("onTaskFinish download magnet fialed!", e, o)
                                    } while (0);
                                    this.magnetTaskIdMap.delete(e)
                                }), o = yield m.ThunderUtil.getThunderTempPath(!0), r = "magnet:?xt=urn:btih:" + e.link,
                                l = k.ParseUrlFileNameNS.parseMagnetUrl(r) + ".torrent", d = a.join(o, l), u = {
                                    taskName: l,
                                    savePath: o,
                                    productInfo: p.TaskCtrlOperatorNS.constructProductInfo(""),
                                    origin: e.source
                                }, h = {url: r, torrentFilePath: d}, f = {
                                    taskType: s.DownloadKernel.TaskType.Magnet,
                                    taskBaseInfo: u,
                                    magnetTaskInfo: h,
                                    isBackground: !0
                                };
                            A.information("create task magnet", f);
                            let g = yield b.createTask(s.DownloadKernel.TaskType.Magnet, f);
                            if (null !== g) {
                                let i = g.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskId);
                                C.MagnetListenerNS.addRef(i, t.bind(this)), this.magnetTaskIdMap.set(i, e), c.DownloadDispatchNS.startTask(i, !0)
                            }
                        })))
                    }
                })
            }
        }

        class d extends t {
            constructor(e, t) {
                super(e), this.taskIds = null, this.taskIds = [], t.forEach(e => {
                    this.taskIds.push(parseInt(e, 10))
                })
            }
        }

        class u extends d {
            constructor(e) {
                super("delete", e)
            }

            execute() {
                return n(this, void 0, void 0, function* () {
                    let e = !1;
                    do {
                        if (!this.taskIds || this.taskIds.length <= 0) break;
                        yield b.batchRemoveToRecycle(this.taskIds).catch(), e = !0
                    } while (0);
                    return e
                })
            }
        }

        class h extends d {
            constructor(e) {
                super("pause", e)
            }

            execute() {
                return n(this, void 0, void 0, function* () {
                    let e = !1;
                    do {
                        if (!this.taskIds || this.taskIds.length <= 0) break;
                        b.batchStopTask(this.taskIds, s.DownloadKernel.TaskStopReason.Manual), e = !0
                    } while (0);
                    return e
                })
            }
        }

        class N extends d {
            constructor(e) {
                super("continue", e)
            }

            execute() {
                return n(this, void 0, void 0, function* () {
                    let e = !1;
                    do {
                        if (!this.taskIds || this.taskIds.length <= 0) break;
                        c.DownloadDispatchNS.startTasks(this.taskIds), e = !0
                    } while (0);
                    return e
                })
            }
        }

        class E {
            static createCommand(e) {
                let t = null;
                switch (e.action) {
                    case"add":
                        "object" == typeof e.task_list && e.task_list.length > 0 && (t = new l(e.task_list));
                        break;
                    case"delete":
                        "object" == typeof e.task_ids && e.task_ids.length > 0 && (t = new u(e.task_ids));
                        break;
                    case"pause":
                        "object" == typeof e.task_ids && e.task_ids.length > 0 && (t = new h(e.task_ids));
                        break;
                    case"continue":
                        "object" == typeof e.task_ids && e.task_ids.length > 0 && (t = new N(e.task_ids));
                        break;
                    case"sync":
                        t = new i
                }
                return A.information("createCommand", t), t
            }
        }

        class P {
            constructor(e) {
                this.timer = null, this.heartBeatTimes = 0, this.delegate = null, this.delegate = e
            }

            start() {
                this.timer || (this.timer = setInterval(() => {
                    ++this.heartBeatTimes, this.delegate && (this.delegate.onHeartBeat(this.heartBeatTimes) || this.stop())
                }, D))
            }

            stop() {
                this.timer && (clearInterval(this.timer), this.timer = null), this.heartBeatTimes = 0
            }

            reset() {
                this.heartBeatTimes = 0, this.start()
            }
        }

        class M extends o.EventEmitter {
            constructor() {
                super(), this.syncStateEventCookie = void 0, this.logoutCookie = void 0, this.syncMessageCookie = void 0, this.taskStatusChangedCookie = void 0, this.removeCategoryCookie = void 0, this.insertToCategoryCookie = void 0, this.syncState = "offline", this.topic = "/user/me/downloadlist", this.heartBeat = null, this.delayReportTimer = null, this.heartBeat = new P(this)
            }

            enable() {
                return n(this, void 0, void 0, function* () {
                    return yield T.default.isInitedAw(), 1 === T.default.getConfigInfo("shouleiDownload", "enableSync2")
                })
            }

            init() {
                return n(this, void 0, void 0, function* () {
                    if (yield this.enable()) {
                        this.syncStateEventCookie = r.SyncMsgHelperNS.attachSyncMsgStateChangeEvent(this.onSyncMsgStateChangeEvent.bind(this));
                        let e = r.SyncMsgHelperNS.getSyncMsgState();
                        A.information("SyncMsgState", e), e === r.SyncMsgHelperNS.SyncMsgState.Connected && this.registerTopic().catch(), this.logoutCookie = w.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", this.onUserLogout.bind(this))
                    }
                })
            }

            uninit() {
                this.syncStateEventCookie && (r.SyncMsgHelperNS.detachSyncMsgStateChangeEvent(this.syncStateEventCookie), this.syncStateEventCookie = void 0), this.syncMessageCookie && (f.client.detachServerEvent("SyncMessage", this.syncMessageCookie), this.syncMessageCookie = void 0), this.delayReportTimer && (clearTimeout(this.delayReportTimer), this.delayReportTimer = null), this.detachTaskEvents(), this.logoutCookie && (w.NativeCallModule.nativeCall.DetachNativeEvent("onLogout", this.logoutCookie), this.logoutCookie = void 0)
            }

            getState() {
                return this.syncState
            }

            onHeartBeat(e) {
                if (e >= x) return "online" === this.syncState && (this.syncState = "offline", this.detachTaskEvents(), this.fireEvent("OnConnectStateChanged", this.syncState)), !1;
                return (new i).execute().then(e => {
                    A.information("onHeartBeat, sync command ret:", e)
                }).catch(), !0
            }

            attachEvent(e, t) {
                return this.on(e, t), t
            }

            attachEventOnce(e, t) {
                return this.once(e, t), t
            }

            detachEvent(e, t) {
                this.detachEvent(e, t)
            }

            fireEvent(e, ...t) {
                A.information("fireEvent", e, ...t), this.emit(e, ...t)
            }

            onSyncMsgStateChangeEvent(e, t) {
                return n(this, void 0, void 0, function* () {
                    A.information("onSyncMsgStateChangeEvent", e, t), e === r.SyncMsgHelperNS.SyncMsgState.Connected && this.registerTopic().catch()
                })
            }

            onUserLogout() {
                "online" === this.syncState && (this.syncState = "offline", this.heartBeat.stop(), this.detachTaskEvents(), this.fireEvent("OnConnectStateChanged", this.syncState))
            }

            registerTopic() {
                return n(this, void 0, void 0, function* () {
                    let e = yield f.client.callRemoteClientFunction("User", "SyncStartReceiver", this.topic);
                    A.information("receving from topics: ", e), void 0 !== e[1] ? A.information("error = ", e[1]) : (A.information("receving from topics: ", e[0]), this.syncMessageCookie || (this.syncMessageCookie = f.client.attachServerEvent("SyncMessage", this.onSyncMessage.bind(this))))
                })
            }

            onSyncMessage(e, t) {
                return n(this, void 0, void 0, function* () {
                    A.information("onSyncMessage: ", t);
                    let e = null;
                    try {
                        e = JSON.parse(t)
                    } catch (e) {
                        A.warning(e)
                    }
                    if (e && e.subject === this.topic) {
                        let t = e.data;
                        if (t) {
                            let e = null;
                            if ("sync" === t.action ? "online" === this.syncState ? this.heartBeat.reset() : (this.heartBeat.start(), this.attachTaskEvents(), this.syncState = "online", this.fireEvent("OnConnectStateChanged", this.syncState), e = E.createCommand(t)) : e = E.createCommand(t), e) {
                                let i = yield e.execute();
                                A.information("command execute ret", i, t)
                            }
                        }
                    }
                })
            }

            attachTaskEvents() {
                this.taskStatusChangedCookie || (this.taskStatusChangedCookie = I.attachTaskEvent(s.DownloadKernel.TaskEventType.StatusChanged, this.onTaskStatusChanged.bind(this))), this.insertToCategoryCookie || (this.insertToCategoryCookie = I.attachTaskEvent(s.DownloadKernel.TaskEventType.InsertToCategoryView, this.onInsertToCategoryView.bind(this))), this.removeCategoryCookie || (this.removeCategoryCookie = I.attachTaskEvent(s.DownloadKernel.TaskEventType.RemoveFromCategoryView, this.onRemoveFromCategoryView.bind(this)))
            }

            detachTaskEvents() {
                this.taskStatusChangedCookie && (I.detachTaskEvent(s.DownloadKernel.TaskEventType.StatusChanged, this.taskStatusChangedCookie), this.taskStatusChangedCookie = void 0), this.insertToCategoryCookie && (I.detachTaskEvent(s.DownloadKernel.TaskEventType.InsertToCategoryView, this.insertToCategoryCookie), this.insertToCategoryCookie = void 0), this.removeCategoryCookie && (I.detachTaskEvent(s.DownloadKernel.TaskEventType.RemoveFromCategoryView, this.removeCategoryCookie), this.removeCategoryCookie = void 0)
            }

            onTaskStatusChanged(e, t) {
                do {
                    if (e !== s.DownloadKernel.TaskEventType.StatusChanged || !t || t.length <= 0) break;
                    for (let e = 0; e < t.length; ++e) {
                        let i = t[e];
                        if (i && !(i.getTaskAttribute(s.DownloadKernel.TaskAttribute.Background) || -1 !== i.getTaskAttribute(s.DownloadKernel.TaskAttribute.CategoryId) || i.getType() === s.DownloadKernel.TaskType.Group || i.getTaskAttribute(s.DownloadKernel.TaskAttribute.GroupTaskId) > 0)) {
                            this.reportDownloadList(!0);
                            break
                        }
                    }
                } while (0)
            }

            onInsertToCategoryView(e, t, i, n) {
                do {
                    if (e !== s.DownloadKernel.TaskEventType.InsertToCategoryView) break;
                    if (void 0 === t || !i || !n || n.length <= 0) break;
                    if (i !== s.DownloadKernel.CategroyViewID.Downloading && i !== s.DownloadKernel.CategroyViewID.Completed) break;
                    this.reportDownloadList(!0)
                } while (0)
            }

            onRemoveFromCategoryView(e, t, i, n) {
                do {
                    if (e !== s.DownloadKernel.TaskEventType.RemoveFromCategoryView) break;
                    if (void 0 === t || !i || !n || n.length <= 0) break;
                    if (i !== s.DownloadKernel.CategroyViewID.Downloading && i !== s.DownloadKernel.CategroyViewID.Completed) break;
                    this.reportDownloadList(!0)
                } while (0)
            }

            reportDownloadList(e = !1) {
                if (e) {
                    this.delayReportTimer && (clearTimeout(this.delayReportTimer), this.delayReportTimer = null), (new i).execute().then(e => {
                        A.information("reportDownloadList", e)
                    }).catch()
                } else this.delayReportTimer || (this.delayReportTimer = setTimeout(() => {
                    this.delayReportTimer = null, (new i).execute().then(e => {
                        A.information("reportDownloadList", e)
                    }).catch()
                }, 1e3))
            }
        }

        e.ShouleiListSyncManager = M;
        let O = null;
        e.getMananger = function () {
            return O || (O = new M), O
        }
    }(t.ShouleiListSyncNS || (t.ShouleiListSyncNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        let t, i;
        !function (e) {
            e[e.tab = 1] = "tab", e[e.app = 2] = "app", e[e.download = 3] = "download", e[e.defaultBrowser = 5] = "defaultBrowser", e[e.ieBrowser = 6] = "ieBrowser"
        }(t = e.OpenType || (e.OpenType = {})), function (e) {
            e.AdPlatform = "AdPlatform", e.AdLeftBottomVip = "AdLeftBottomVip"
        }(i = e.AdName || (e.AdName = {})), e.eventAdShow = "event_ad_show"
    }(t.AdCommonNS || (t.AdCommonNS = {}))
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(382), a = i(268);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\common\\generator-view\\conf-component\\conf-tip.vue", t.default = s.exports
}, function (e, t, i) {
    (function (e) {
        var i;
        !function () {
            var n = "object" == typeof self && self.self === self && self || "object" == typeof global && global.global === global && global || this || {},
                a = n._, o = Array.prototype, r = Object.prototype,
                s = "undefined" != typeof Symbol ? Symbol.prototype : null, l = o.push, d = o.slice, u = r.toString,
                c = r.hasOwnProperty, h = Array.isArray, f = Object.keys, g = Object.create, p = function () {
                }, v = function (e) {
                    return e instanceof v ? e : this instanceof v ? void (this._wrapped = e) : new v(e)
                };
            void 0 === t || t.nodeType ? n._ = v : (void 0 !== e && !e.nodeType && e.exports && (t = e.exports = v), t._ = v), v.VERSION = "1.9.1";
            var m, y = function (e, t, i) {
                if (void 0 === t) return e;
                switch (null == i ? 3 : i) {
                    case 1:
                        return function (i) {
                            return e.call(t, i)
                        };
                    case 3:
                        return function (i, n, a) {
                            return e.call(t, i, n, a)
                        };
                    case 4:
                        return function (i, n, a, o) {
                            return e.call(t, i, n, a, o)
                        }
                }
                return function () {
                    return e.apply(t, arguments)
                }
            }, k = function (e, t, i) {
                return v.iteratee !== m ? v.iteratee(e, t) : null == e ? v.identity : v.isFunction(e) ? y(e, t, i) : v.isObject(e) && !v.isArray(e) ? v.matcher(e) : v.property(e)
            };
            v.iteratee = m = function (e, t) {
                return k(e, t, 1 / 0)
            };
            var T = function (e, t) {
                return t = null == t ? e.length - 1 : +t, function () {
                    for (var i = Math.max(arguments.length - t, 0), n = Array(i), a = 0; a < i; a++) n[a] = arguments[a + t];
                    switch (t) {
                        case 0:
                            return e.call(this, n);
                        case 1:
                            return e.call(this, arguments[0], n);
                        case 2:
                            return e.call(this, arguments[0], arguments[1], n)
                    }
                    var o = Array(t + 1);
                    for (a = 0; a < t; a++) o[a] = arguments[a];
                    return o[t] = n, e.apply(this, o)
                }
            }, w = function (e) {
                if (!v.isObject(e)) return {};
                if (g) return g(e);
                p.prototype = e;
                var t = new p;
                return p.prototype = null, t
            }, C = function (e) {
                return function (t) {
                    return null == t ? void 0 : t[e]
                }
            }, S = function (e, t) {
                return null != e && c.call(e, t)
            }, b = function (e, t) {
                for (var i = t.length, n = 0; n < i; n++) {
                    if (null == e) return;
                    e = e[t[n]]
                }
                return i ? e : void 0
            }, I = Math.pow(2, 53) - 1, _ = C("length"), A = function (e) {
                var t = _(e);
                return "number" == typeof t && t >= 0 && t <= I
            };
            v.each = v.forEach = function (e, t, i) {
                var n, a;
                if (t = y(t, i), A(e)) for (n = 0, a = e.length; n < a; n++) t(e[n], n, e); else {
                    var o = v.keys(e);
                    for (n = 0, a = o.length; n < a; n++) t(e[o[n]], o[n], e)
                }
                return e
            }, v.map = v.collect = function (e, t, i) {
                t = k(t, i);
                for (var n = !A(e) && v.keys(e), a = (n || e).length, o = Array(a), r = 0; r < a; r++) {
                    var s = n ? n[r] : r;
                    o[r] = t(e[s], s, e)
                }
                return o
            };
            var D = function (e) {
                return function (t, i, n, a) {
                    var o = arguments.length >= 3;
                    return function (t, i, n, a) {
                        var o = !A(t) && v.keys(t), r = (o || t).length, s = e > 0 ? 0 : r - 1;
                        for (a || (n = t[o ? o[s] : s], s += e); s >= 0 && s < r; s += e) {
                            var l = o ? o[s] : s;
                            n = i(n, t[l], l, t)
                        }
                        return n
                    }(t, y(i, a, 4), n, o)
                }
            };
            v.reduce = v.foldl = v.inject = D(1), v.reduceRight = v.foldr = D(-1), v.find = v.detect = function (e, t, i) {
                var n = (A(e) ? v.findIndex : v.findKey)(e, t, i);
                if (void 0 !== n && -1 !== n) return e[n]
            }, v.filter = v.select = function (e, t, i) {
                var n = [];
                return t = k(t, i), v.each(e, function (e, i, a) {
                    t(e, i, a) && n.push(e)
                }), n
            }, v.reject = function (e, t, i) {
                return v.filter(e, v.negate(k(t)), i)
            }, v.every = v.all = function (e, t, i) {
                t = k(t, i);
                for (var n = !A(e) && v.keys(e), a = (n || e).length, o = 0; o < a; o++) {
                    var r = n ? n[o] : o;
                    if (!t(e[r], r, e)) return !1
                }
                return !0
            }, v.some = v.any = function (e, t, i) {
                t = k(t, i);
                for (var n = !A(e) && v.keys(e), a = (n || e).length, o = 0; o < a; o++) {
                    var r = n ? n[o] : o;
                    if (t(e[r], r, e)) return !0
                }
                return !1
            }, v.contains = v.includes = v.include = function (e, t, i, n) {
                return A(e) || (e = v.values(e)), ("number" != typeof i || n) && (i = 0), v.indexOf(e, t, i) >= 0
            }, v.invoke = T(function (e, t, i) {
                var n, a;
                return v.isFunction(t) ? a = t : v.isArray(t) && (n = t.slice(0, -1), t = t[t.length - 1]), v.map(e, function (e) {
                    var o = a;
                    if (!o) {
                        if (n && n.length && (e = b(e, n)), null == e) return;
                        o = e[t]
                    }
                    return null == o ? o : o.apply(e, i)
                })
            }), v.pluck = function (e, t) {
                return v.map(e, v.property(t))
            }, v.where = function (e, t) {
                return v.filter(e, v.matcher(t))
            }, v.findWhere = function (e, t) {
                return v.find(e, v.matcher(t))
            }, v.max = function (e, t, i) {
                var n, a, o = -1 / 0, r = -1 / 0;
                if (null == t || "number" == typeof t && "object" != typeof e[0] && null != e) for (var s = 0, l = (e = A(e) ? e : v.values(e)).length; s < l; s++) null != (n = e[s]) && n > o && (o = n); else t = k(t, i), v.each(e, function (e, i, n) {
                    ((a = t(e, i, n)) > r || a === -1 / 0 && o === -1 / 0) && (o = e, r = a)
                });
                return o
            }, v.min = function (e, t, i) {
                var n, a, o = 1 / 0, r = 1 / 0;
                if (null == t || "number" == typeof t && "object" != typeof e[0] && null != e) for (var s = 0, l = (e = A(e) ? e : v.values(e)).length; s < l; s++) null != (n = e[s]) && n < o && (o = n); else t = k(t, i), v.each(e, function (e, i, n) {
                    ((a = t(e, i, n)) < r || a === 1 / 0 && o === 1 / 0) && (o = e, r = a)
                });
                return o
            }, v.shuffle = function (e) {
                return v.sample(e, 1 / 0)
            }, v.sample = function (e, t, i) {
                if (null == t || i) return A(e) || (e = v.values(e)), e[v.random(e.length - 1)];
                var n = A(e) ? v.clone(e) : v.values(e), a = _(n);
                t = Math.max(Math.min(t, a), 0);
                for (var o = a - 1, r = 0; r < t; r++) {
                    var s = v.random(r, o), l = n[r];
                    n[r] = n[s], n[s] = l
                }
                return n.slice(0, t)
            }, v.sortBy = function (e, t, i) {
                var n = 0;
                return t = k(t, i), v.pluck(v.map(e, function (e, i, a) {
                    return {value: e, index: n++, criteria: t(e, i, a)}
                }).sort(function (e, t) {
                    var i = e.criteria, n = t.criteria;
                    if (i !== n) {
                        if (i > n || void 0 === i) return 1;
                        if (i < n || void 0 === n) return -1
                    }
                    return e.index - t.index
                }), "value")
            };
            var x = function (e, t) {
                return function (i, n, a) {
                    var o = t ? [[], []] : {};
                    return n = k(n, a), v.each(i, function (t, a) {
                        var r = n(t, a, i);
                        e(o, t, r)
                    }), o
                }
            };
            v.groupBy = x(function (e, t, i) {
                S(e, i) ? e[i].push(t) : e[i] = [t]
            }), v.indexBy = x(function (e, t, i) {
                e[i] = t
            }), v.countBy = x(function (e, t, i) {
                S(e, i) ? e[i]++ : e[i] = 1
            });
            var N = /[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;
            v.toArray = function (e) {
                return e ? v.isArray(e) ? d.call(e) : v.isString(e) ? e.match(N) : A(e) ? v.map(e, v.identity) : v.values(e) : []
            }, v.size = function (e) {
                return null == e ? 0 : A(e) ? e.length : v.keys(e).length
            }, v.partition = x(function (e, t, i) {
                e[i ? 0 : 1].push(t)
            }, !0), v.first = v.head = v.take = function (e, t, i) {
                return null == e || e.length < 1 ? null == t ? void 0 : [] : null == t || i ? e[0] : v.initial(e, e.length - t)
            }, v.initial = function (e, t, i) {
                return d.call(e, 0, Math.max(0, e.length - (null == t || i ? 1 : t)))
            }, v.last = function (e, t, i) {
                return null == e || e.length < 1 ? null == t ? void 0 : [] : null == t || i ? e[e.length - 1] : v.rest(e, Math.max(0, e.length - t))
            }, v.rest = v.tail = v.drop = function (e, t, i) {
                return d.call(e, null == t || i ? 1 : t)
            }, v.compact = function (e) {
                return v.filter(e, Boolean)
            };
            var E = function (e, t, i, n) {
                for (var a = (n = n || []).length, o = 0, r = _(e); o < r; o++) {
                    var s = e[o];
                    if (A(s) && (v.isArray(s) || v.isArguments(s))) if (t) for (var l = 0, d = s.length; l < d;) n[a++] = s[l++]; else E(s, t, i, n), a = n.length; else i || (n[a++] = s)
                }
                return n
            };
            v.flatten = function (e, t) {
                return E(e, t, !1)
            }, v.without = T(function (e, t) {
                return v.difference(e, t)
            }), v.uniq = v.unique = function (e, t, i, n) {
                v.isBoolean(t) || (n = i, i = t, t = !1), null != i && (i = k(i, n));
                for (var a = [], o = [], r = 0, s = _(e); r < s; r++) {
                    var l = e[r], d = i ? i(l, r, e) : l;
                    t && !i ? (r && o === d || a.push(l), o = d) : i ? v.contains(o, d) || (o.push(d), a.push(l)) : v.contains(a, l) || a.push(l)
                }
                return a
            }, v.union = T(function (e) {
                return v.uniq(E(e, !0, !0))
            }), v.intersection = function (e) {
                for (var t = [], i = arguments.length, n = 0, a = _(e); n < a; n++) {
                    var o = e[n];
                    if (!v.contains(t, o)) {
                        var r;
                        for (r = 1; r < i && v.contains(arguments[r], o); r++) ;
                        r === i && t.push(o)
                    }
                }
                return t
            }, v.difference = T(function (e, t) {
                return t = E(t, !0, !0), v.filter(e, function (e) {
                    return !v.contains(t, e)
                })
            }), v.unzip = function (e) {
                for (var t = e && v.max(e, _).length || 0, i = Array(t), n = 0; n < t; n++) i[n] = v.pluck(e, n);
                return i
            }, v.zip = T(v.unzip), v.object = function (e, t) {
                for (var i = {}, n = 0, a = _(e); n < a; n++) t ? i[e[n]] = t[n] : i[e[n][0]] = e[n][1];
                return i
            };
            var P = function (e) {
                return function (t, i, n) {
                    i = k(i, n);
                    for (var a = _(t), o = e > 0 ? 0 : a - 1; o >= 0 && o < a; o += e) if (i(t[o], o, t)) return o;
                    return -1
                }
            };
            v.findIndex = P(1), v.findLastIndex = P(-1), v.sortedIndex = function (e, t, i, n) {
                for (var a = (i = k(i, n, 1))(t), o = 0, r = _(e); o < r;) {
                    var s = Math.floor((o + r) / 2);
                    i(e[s]) < a ? o = s + 1 : r = s
                }
                return o
            };
            var M = function (e, t, i) {
                return function (n, a, o) {
                    var r = 0, s = _(n);
                    if ("number" == typeof o) e > 0 ? r = o >= 0 ? o : Math.max(o + s, r) : s = o >= 0 ? Math.min(o + 1, s) : o + s + 1; else if (i && o && s) return n[o = i(n, a)] === a ? o : -1;
                    if (a != a) return (o = t(d.call(n, r, s), v.isNaN)) >= 0 ? o + r : -1;
                    for (o = e > 0 ? r : s - 1; o >= 0 && o < s; o += e) if (n[o] === a) return o;
                    return -1
                }
            };
            v.indexOf = M(1, v.findIndex, v.sortedIndex), v.lastIndexOf = M(-1, v.findLastIndex), v.range = function (e, t, i) {
                null == t && (t = e || 0, e = 0), i || (i = t < e ? -1 : 1);
                for (var n = Math.max(Math.ceil((t - e) / i), 0), a = Array(n), o = 0; o < n; o++, e += i) a[o] = e;
                return a
            }, v.chunk = function (e, t) {
                if (null == t || t < 1) return [];
                for (var i = [], n = 0, a = e.length; n < a;) i.push(d.call(e, n, n += t));
                return i
            };
            var O = function (e, t, i, n, a) {
                if (!(n instanceof t)) return e.apply(i, a);
                var o = w(e.prototype), r = e.apply(o, a);
                return v.isObject(r) ? r : o
            };
            v.bind = T(function (e, t, i) {
                if (!v.isFunction(e)) throw new TypeError("Bind must be called on a function");
                var n = T(function (a) {
                    return O(e, n, t, this, i.concat(a))
                });
                return n
            }), v.partial = T(function (e, t) {
                var i = v.partial.placeholder, n = function () {
                    for (var a = 0, o = t.length, r = Array(o), s = 0; s < o; s++) r[s] = t[s] === i ? arguments[a++] : t[s];
                    for (; a < arguments.length;) r.push(arguments[a++]);
                    return O(e, n, this, this, r)
                };
                return n
            }), v.partial.placeholder = v, v.bindAll = T(function (e, t) {
                var i = (t = E(t, !1, !1)).length;
                if (i < 1) throw new Error("bindAll must be passed function names");
                for (; i--;) {
                    var n = t[i];
                    e[n] = v.bind(e[n], e)
                }
            }), v.memoize = function (e, t) {
                var i = function (n) {
                    var a = i.cache, o = "" + (t ? t.apply(this, arguments) : n);
                    return S(a, o) || (a[o] = e.apply(this, arguments)), a[o]
                };
                return i.cache = {}, i
            }, v.delay = T(function (e, t, i) {
                return setTimeout(function () {
                    return e.apply(null, i)
                }, t)
            }), v.defer = v.partial(v.delay, v, 1), v.throttle = function (e, t, i) {
                var n, a, o, r, s = 0;
                i || (i = {});
                var l = function () {
                    s = !1 === i.leading ? 0 : v.now(), n = null, r = e.apply(a, o), n || (a = o = null)
                }, d = function () {
                    var d = v.now();
                    s || !1 !== i.leading || (s = d);
                    var u = t - (d - s);
                    return a = this, o = arguments, u <= 0 || u > t ? (n && (clearTimeout(n), n = null), s = d, r = e.apply(a, o), n || (a = o = null)) : n || !1 === i.trailing || (n = setTimeout(l, u)), r
                };
                return d.cancel = function () {
                    clearTimeout(n), s = 0, n = a = o = null
                }, d
            }, v.debounce = function (e, t, i) {
                var n, a, o = function (t, i) {
                    n = null, i && (a = e.apply(t, i))
                }, r = T(function (r) {
                    if (n && clearTimeout(n), i) {
                        var s = !n;
                        n = setTimeout(o, t), s && (a = e.apply(this, r))
                    } else n = v.delay(o, t, this, r);
                    return a
                });
                return r.cancel = function () {
                    clearTimeout(n), n = null
                }, r
            }, v.wrap = function (e, t) {
                return v.partial(t, e)
            }, v.negate = function (e) {
                return function () {
                    return !e.apply(this, arguments)
                }
            }, v.compose = function () {
                var e = arguments, t = e.length - 1;
                return function () {
                    for (var i = t, n = e[t].apply(this, arguments); i--;) n = e[i].call(this, n);
                    return n
                }
            }, v.after = function (e, t) {
                return function () {
                    if (--e < 1) return t.apply(this, arguments)
                }
            }, v.before = function (e, t) {
                var i;
                return function () {
                    return --e > 0 && (i = t.apply(this, arguments)), e <= 1 && (t = null), i
                }
            }, v.once = v.partial(v.before, 2), v.restArguments = T;
            var F = !{toString: null}.propertyIsEnumerable("toString"),
                L = ["valueOf", "isPrototypeOf", "toString", "propertyIsEnumerable", "hasOwnProperty", "toLocaleString"],
                B = function (e, t) {
                    var i = L.length, n = e.constructor, a = v.isFunction(n) && n.prototype || r, o = "constructor";
                    for (S(e, o) && !v.contains(t, o) && t.push(o); i--;) (o = L[i]) in e && e[o] !== a[o] && !v.contains(t, o) && t.push(o)
                };
            v.keys = function (e) {
                if (!v.isObject(e)) return [];
                if (f) return f(e);
                var t = [];
                for (var i in e) S(e, i) && t.push(i);
                return F && B(e, t), t
            }, v.allKeys = function (e) {
                if (!v.isObject(e)) return [];
                var t = [];
                for (var i in e) t.push(i);
                return F && B(e, t), t
            }, v.values = function (e) {
                for (var t = v.keys(e), i = t.length, n = Array(i), a = 0; a < i; a++) n[a] = e[t[a]];
                return n
            }, v.mapObject = function (e, t, i) {
                t = k(t, i);
                for (var n = v.keys(e), a = n.length, o = {}, r = 0; r < a; r++) {
                    var s = n[r];
                    o[s] = t(e[s], s, e)
                }
                return o
            }, v.pairs = function (e) {
                for (var t = v.keys(e), i = t.length, n = Array(i), a = 0; a < i; a++) n[a] = [t[a], e[t[a]]];
                return n
            }, v.invert = function (e) {
                for (var t = {}, i = v.keys(e), n = 0, a = i.length; n < a; n++) t[e[i[n]]] = i[n];
                return t
            }, v.functions = v.methods = function (e) {
                var t = [];
                for (var i in e) v.isFunction(e[i]) && t.push(i);
                return t.sort()
            };
            var U = function (e, t) {
                return function (i) {
                    var n = arguments.length;
                    if (t && (i = Object(i)), n < 2 || null == i) return i;
                    for (var a = 1; a < n; a++) for (var o = arguments[a], r = e(o), s = r.length, l = 0; l < s; l++) {
                        var d = r[l];
                        t && void 0 !== i[d] || (i[d] = o[d])
                    }
                    return i
                }
            };
            v.extend = U(v.allKeys), v.extendOwn = v.assign = U(v.keys), v.findKey = function (e, t, i) {
                t = k(t, i);
                for (var n, a = v.keys(e), o = 0, r = a.length; o < r; o++) if (t(e[n = a[o]], n, e)) return n
            };
            var R, K, W = function (e, t, i) {
                return t in i
            };
            v.pick = T(function (e, t) {
                var i = {}, n = t[0];
                if (null == e) return i;
                v.isFunction(n) ? (t.length > 1 && (n = y(n, t[1])), t = v.allKeys(e)) : (n = W, t = E(t, !1, !1), e = Object(e));
                for (var a = 0, o = t.length; a < o; a++) {
                    var r = t[a], s = e[r];
                    n(s, r, e) && (i[r] = s)
                }
                return i
            }), v.omit = T(function (e, t) {
                var i, n = t[0];
                return v.isFunction(n) ? (n = v.negate(n), t.length > 1 && (i = t[1])) : (t = v.map(E(t, !1, !1), String), n = function (e, i) {
                    return !v.contains(t, i)
                }), v.pick(e, n, i)
            }), v.defaults = U(v.allKeys, !0), v.create = function (e, t) {
                var i = w(e);
                return t && v.extendOwn(i, t), i
            }, v.clone = function (e) {
                return v.isObject(e) ? v.isArray(e) ? e.slice() : v.extend({}, e) : e
            }, v.tap = function (e, t) {
                return t(e), e
            }, v.isMatch = function (e, t) {
                var i = v.keys(t), n = i.length;
                if (null == e) return !n;
                for (var a = Object(e), o = 0; o < n; o++) {
                    var r = i[o];
                    if (t[r] !== a[r] || !(r in a)) return !1
                }
                return !0
            }, R = function (e, t, i, n) {
                if (e === t) return 0 !== e || 1 / e == 1 / t;
                if (null == e || null == t) return !1;
                if (e != e) return t != t;
                var a = typeof e;
                return ("function" === a || "object" === a || "object" == typeof t) && K(e, t, i, n)
            }, K = function (e, t, i, n) {
                e instanceof v && (e = e._wrapped), t instanceof v && (t = t._wrapped);
                var a = u.call(e);
                if (a !== u.call(t)) return !1;
                switch (a) {
                    case"[object RegExp]":
                    case"[object String]":
                        return "" + e == "" + t;
                    case"[object Number]":
                        return +e != +e ? +t != +t : 0 == +e ? 1 / +e == 1 / t : +e == +t;
                    case"[object Date]":
                    case"[object Boolean]":
                        return +e == +t;
                    case"[object Symbol]":
                        return s.valueOf.call(e) === s.valueOf.call(t)
                }
                var o = "[object Array]" === a;
                if (!o) {
                    if ("object" != typeof e || "object" != typeof t) return !1;
                    var r = e.constructor, l = t.constructor;
                    if (r !== l && !(v.isFunction(r) && r instanceof r && v.isFunction(l) && l instanceof l) && "constructor" in e && "constructor" in t) return !1
                }
                i = i || [], n = n || [];
                for (var d = i.length; d--;) if (i[d] === e) return n[d] === t;
                if (i.push(e), n.push(t), o) {
                    if ((d = e.length) !== t.length) return !1;
                    for (; d--;) if (!R(e[d], t[d], i, n)) return !1
                } else {
                    var c, h = v.keys(e);
                    if (d = h.length, v.keys(t).length !== d) return !1;
                    for (; d--;) if (c = h[d], !S(t, c) || !R(e[c], t[c], i, n)) return !1
                }
                return i.pop(), n.pop(), !0
            }, v.isEqual = function (e, t) {
                return R(e, t)
            }, v.isEmpty = function (e) {
                return null == e || (A(e) && (v.isArray(e) || v.isString(e) || v.isArguments(e)) ? 0 === e.length : 0 === v.keys(e).length)
            }, v.isElement = function (e) {
                return !(!e || 1 !== e.nodeType)
            }, v.isArray = h || function (e) {
                return "[object Array]" === u.call(e)
            }, v.isObject = function (e) {
                var t = typeof e;
                return "function" === t || "object" === t && !!e
            }, v.each(["Arguments", "Function", "String", "Number", "Date", "RegExp", "Error", "Symbol", "Map", "WeakMap", "Set", "WeakSet"], function (e) {
                v["is" + e] = function (t) {
                    return u.call(t) === "[object " + e + "]"
                }
            }), v.isArguments(arguments) || (v.isArguments = function (e) {
                return S(e, "callee")
            });
            var V = n.document && n.document.childNodes;
            "function" != typeof /./ && "object" != typeof Int8Array && "function" != typeof V && (v.isFunction = function (e) {
                return "function" == typeof e || !1
            }), v.isFinite = function (e) {
                return !v.isSymbol(e) && isFinite(e) && !isNaN(parseFloat(e))
            }, v.isNaN = function (e) {
                return v.isNumber(e) && isNaN(e)
            }, v.isBoolean = function (e) {
                return !0 === e || !1 === e || "[object Boolean]" === u.call(e)
            }, v.isNull = function (e) {
                return null === e
            }, v.isUndefined = function (e) {
                return void 0 === e
            }, v.has = function (e, t) {
                if (!v.isArray(t)) return S(e, t);
                for (var i = t.length, n = 0; n < i; n++) {
                    var a = t[n];
                    if (null == e || !c.call(e, a)) return !1;
                    e = e[a]
                }
                return !!i
            }, v.noConflict = function () {
                return n._ = a, this
            }, v.identity = function (e) {
                return e
            }, v.constant = function (e) {
                return function () {
                    return e
                }
            }, v.noop = function () {
            }, v.property = function (e) {
                return v.isArray(e) ? function (t) {
                    return b(t, e)
                } : C(e)
            }, v.propertyOf = function (e) {
                return null == e ? function () {
                } : function (t) {
                    return v.isArray(t) ? b(e, t) : e[t]
                }
            }, v.matcher = v.matches = function (e) {
                return e = v.extendOwn({}, e), function (t) {
                    return v.isMatch(t, e)
                }
            }, v.times = function (e, t, i) {
                var n = Array(Math.max(0, e));
                t = y(t, i, 1);
                for (var a = 0; a < e; a++) n[a] = t(a);
                return n
            }, v.random = function (e, t) {
                return null == t && (t = e, e = 0), e + Math.floor(Math.random() * (t - e + 1))
            }, v.now = Date.now || function () {
                return (new Date).getTime()
            };
            var H = {"&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#x27;", "`": "&#x60;"},
                z = v.invert(H), j = function (e) {
                    var t = function (t) {
                        return e[t]
                    }, i = "(?:" + v.keys(e).join("|") + ")", n = RegExp(i), a = RegExp(i, "g");
                    return function (e) {
                        return e = null == e ? "" : "" + e, n.test(e) ? e.replace(a, t) : e
                    }
                };
            v.escape = j(H), v.unescape = j(z), v.result = function (e, t, i) {
                v.isArray(t) || (t = [t]);
                var n = t.length;
                if (!n) return v.isFunction(i) ? i.call(e) : i;
                for (var a = 0; a < n; a++) {
                    var o = null == e ? void 0 : e[t[a]];
                    void 0 === o && (o = i, a = n), e = v.isFunction(o) ? o.call(e) : o
                }
                return e
            };
            var G = 0;
            v.uniqueId = function (e) {
                var t = ++G + "";
                return e ? e + t : t
            }, v.templateSettings = {
                evaluate: /<%([\s\S]+?)%>/g,
                interpolate: /<%=([\s\S]+?)%>/g,
                escape: /<%-([\s\S]+?)%>/g
            };
            var $ = /(.)^/, X = {"'": "'", "\\": "\\", "\r": "r", "\n": "n", "\u2028": "u2028", "\u2029": "u2029"},
                q = /\\|'|\r|\n|\u2028|\u2029/g, Y = function (e) {
                    return "\\" + X[e]
                };
            v.template = function (e, t, i) {
                !t && i && (t = i), t = v.defaults({}, t, v.templateSettings);
                var n,
                    a = RegExp([(t.escape || $).source, (t.interpolate || $).source, (t.evaluate || $).source].join("|") + "|$", "g"),
                    o = 0, r = "__p+='";
                e.replace(a, function (t, i, n, a, s) {
                    return r += e.slice(o, s).replace(q, Y), o = s + t.length, i ? r += "'+\n((__t=(" + i + "))==null?'':_.escape(__t))+\n'" : n ? r += "'+\n((__t=(" + n + "))==null?'':__t)+\n'" : a && (r += "';\n" + a + "\n__p+='"), t
                }), r += "';\n", t.variable || (r = "with(obj||{}){\n" + r + "}\n"), r = "var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n" + r + "return __p;\n";
                try {
                    n = new Function(t.variable || "obj", "_", r)
                } catch (e) {
                    throw e.source = r, e
                }
                var s = function (e) {
                    return n.call(this, e, v)
                }, l = t.variable || "obj";
                return s.source = "function(" + l + "){\n" + r + "}", s
            }, v.chain = function (e) {
                var t = v(e);
                return t._chain = !0, t
            };
            var J = function (e, t) {
                return e._chain ? v(t).chain() : t
            };
            v.mixin = function (e) {
                return v.each(v.functions(e), function (t) {
                    var i = v[t] = e[t];
                    v.prototype[t] = function () {
                        var e = [this._wrapped];
                        return l.apply(e, arguments), J(this, i.apply(v, e))
                    }
                }), v
            }, v.mixin(v), v.each(["pop", "push", "reverse", "shift", "sort", "splice", "unshift"], function (e) {
                var t = o[e];
                v.prototype[e] = function () {
                    var i = this._wrapped;
                    return t.apply(i, arguments), "shift" !== e && "splice" !== e || 0 !== i.length || delete i[0], J(this, i)
                }
            }), v.each(["concat", "join", "slice"], function (e) {
                var t = o[e];
                v.prototype[e] = function () {
                    return J(this, t.apply(this._wrapped, arguments))
                }
            }), v.prototype.value = function () {
                return this._wrapped
            }, v.prototype.valueOf = v.prototype.toJSON = v.prototype.value, v.prototype.toString = function () {
                return String(this._wrapped)
            }, void 0 === (i = function () {
                return v
            }.apply(t, [])) || (e.exports = i)
        }()
    }).call(this, i(434)(e))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), t.information = function (...e) {
    }, t.error = function (...e) {
    }, t.warning = function (...e) {
    }, t.critical = function (...e) {
    }, t.verbose = function (...e) {
    }, "development" === process.env.LOGGER_ENV && (t.information = function (...e) {
        console.log("information", e)
    }, t.error = function (...e) {
        console.log("error", e)
    }, t.warning = function (...e) {
        console.log("warning", e)
    }, t.critical = function (...e) {
        console.log("critical", e)
    }, t.verbose = function (...e) {
        console.log("verbose", e)
    })
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        e.msgIPCCommunicatorForward = "ipc_communicator_forward", e.msgIPCSendToMain = "ipc_send_to_main", e.msgIPCSendToRenderer = "ipc_send_to_renderer", e.msgIPCRendererConnect = "ipc_renderer_connect", e.msgIPCRendererDisconnect = "ipc_renderer_disconnect", e.msgNCCallNativeFunction = "nc_call_native_function", e.msgNCCheckNativeFunction = "nc_check_native_function", e.msgNCCallJsFunctionById = "nc_call_js_function_by_id", e.msgNCCallJsFunctionByName = "nc_call_js_function_by_name", e.msgNCNativeFireEvent = "nc_native_fire_event", e.msgNCNativeCallReady = "nc_native_call_ready"
    }(t.CommonIPCMessage || (t.CommonIPCMessage = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), t.information = ((...e) => {
    }), t.error = ((...e) => {
    }), t.warning = ((...e) => {
    }), t.critical = ((...e) => {
    }), t.verbose = ((...e) => {
    })
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(2);
    let a, o = console;

    function r(e = 5) {
        let t = /at\s+(.*)\s+\((.*):(\d*):(\d*)\)/i, i = /at\s+()(.*):(\d*):(\d*)/i,
            a = (new Error).stack.split("\n").slice(e + 1);
        a.shift();
        let o = [];
        return a.forEach((e, a) => {
            let r = t.exec(e) || i.exec(e), s = {};
            r && 5 === r.length && (s.method = r[1], s.path = r[2], s.line = r[3], s.pos = r[4], s.file = n.basename(s.path), o.push(s))
        }), o
    }

    if (a = "renderer" === process.type ? "[Renderer] [async-remote]:" : "browser" === process.type ? "[Browser] [async-remote]:" : `[${process.type}] [async-remote]`, t.traceback = function (e = 5) {
        return r(e).map(e => e.method + "@(" + e.file + ")").join(" <= ")
    }, t.time = function (...e) {
        o.time(...e)
    }, t.timeEnd = function (...e) {
        o.timeEnd(...e)
    }, t.trace = function (...e) {
        let t = r(), i = "";
        t[0] && t[0].method && (i = i), o.trace(a, ...e)
    }, t.info = function (...e) {
        let t = r(), i = "anonymous";
        t[0] && t[0].method && (i = i), o.info(a, "[" + i + "]", e.join(","))
    }, t.warn = function (...e) {
        let t = r(), i = "";
        t[0] && t[0].method && (i = i), o.warn("<WARN>" + a, "[" + i + "]", e.join(","))
    }, t.error = function (...e) {
        let t = r(), i = "";
        t[0] && t[0].method && (i = i), o.error("<ERROR>" + a, "[" + i + "]", e.join(","))
    }, t.log = function (...e) {
        o.log(a, ...e)
    }, !process.env.DEBUG_ASYNC_REMOTE) {
        let e = function () {
        };
        t.traceback = e, t.time = e, t.timeEnd = e, t.trace = e, t.info = e, t.warn = e, t.error = e, t.log = e
    }
}, function (e, t, i) {
    e.exports = i(56)(41)
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(0), a = i(487), o = i(4), r = i(31), s = n.default.getLogger("DownloadKernel.TaskUserData");
    t.TaskUserData = class {
        constructor(e, t) {
            this.userData = new a.BencodeMap.BencodeMap, s.information("new TaskUserData userData:", t), this.task = e, this.userData.decode(t)
        }

        getTask() {
            return this.task
        }

        setTaskPriorityLevel(e, t) {
            r.ThunderKernel.setTaskPriorityLevel(this.task.getId(), e, t)
        }

        setUserData(e, t, i) {
            let n = !1;
            if (!e || 38 !== e.length) return s.warning("setUserData invalid userGuid:", e), n;
            let a = this.userData.addMapItem("UserData").addMapItem(e);
            if (o.isNumber(i) ? (n = a.addItem(t, i), s.information("addItem number key:", t, ", value:", i)) : o.isString(i) ? (n = a.addItem(t, i), s.information("addItem string key:", t, ", value:", i)) : o.isObject(i) ? (n = a.addItem(t, i), s.information("addItem map key:", t, ", value:", i)) : s.information("addItem not support value type. key:", t, ", value:", i), n) {
                let e = "";
                e = this.userData.encode(e), s.information("bencodingUserData:", e), r.ThunderKernel.saveTaskUserData(this.task.getTaskBaseInfo().taskId, e)
            }
            return n
        }

        getUserData(e, t) {
            if (!e || 38 !== e.length) return void s.warning("getUserData invalid userGuid:", e);
            let i = this.userData.getItem("UserData");
            if (!i) return;
            let n = i.getItem(e);
            if (!n) return;
            if (!t) return n.getValue();
            let o = n.getItem(t);
            if (o) switch (o.getType()) {
                case a.BencodeMap.BencodeDataType.Integer:
                case a.BencodeMap.BencodeDataType.String:
                case a.BencodeMap.BencodeDataType.List:
                case a.BencodeMap.BencodeDataType.Map:
                    return o.getValue()
            }
        }

        getAllUserData() {
            return this.userData.encode("")
        }

        setAllUserData(e) {
            this.userData.decode(e);
            let t = "";
            t = this.userData.encode(t), r.ThunderKernel.saveTaskUserData(this.task.getTaskBaseInfo().taskId, t)
        }
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(16), a = i(7), o = i(14), r = i(9), s = i(0);
    let {isDef: l, isUndef: d} = o.ThunderUtil;
    const u = s.default.getLogger("login-option");
    !function (e) {
        let t;
        !function (e) {
            e[e.Low = 0] = "Low", e[e.High = 1] = "High"
        }(t = e.Priority || (e.Priority = {}));
        e.loginOption = new class {
            constructor() {
                this.eventListener = !1, this.onLoginSucCookie = 0, this.onLoginFailedCookie = 0, this.option = null
            }

            setOption(e) {
                u.information("option", e);
                do {
                    if (d(e)) break;
                    if (e.priority = e.priority || t.Low, l(this.option) && e.priority <= this.option.priority) break;
                    this.option = e
                } while (0)
            }

            getOption() {
                return this.option
            }

            attachListenerEvent() {
                do {
                    if (d(this.option)) break;
                    if (!1 === this.eventListener) {
                        this.eventListener = !0;
                        let e = "logtype=client";
                        l(this.option.stat) && l(this.option.stat.logfrom) && (e = e + ",logfrom=" + this.option.stat.logfrom), r.XLStatNS.trackEvent("user_info", "loginpanel_show", "", 0, 0, 0, 0, e), this.onLoginSucCookie = n.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", () => {
                            this.eventListener = !1, this.detachListenerEvent(), l(this.option.tabUrl) && "" !== this.option.tabUrl && a.client.callServerFunction("OpenNewTab", this.option.tabUrl).catch()
                        }), this.onLoginFailedCookie = n.NativeCallModule.nativeCall.AttachNativeEvent("onLoginFailed", (t, i) => {
                            "close" === i && (this.option.perpetual || (this.option = null), r.XLStatNS.trackEvent("user_info", "loginpanel_close", "", 0, 0, 0, 0, e)), this.eventListener = !1, this.detachListenerEvent()
                        })
                    }
                } while (0)
            }

            detachListenerEvent() {
                n.NativeCallModule.nativeCall.DetachNativeEvent("onLoginSuc", this.onLoginSucCookie), n.NativeCallModule.nativeCall.DetachNativeEvent("onLoginFailed", this.onLoginFailedCookie)
            }
        }
    }(t.LoginOptionNS || (t.LoginOptionNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(0), o = i(65), r = i(307), s = i(25), l = i(3), d = i(11).DownloadKernelTaskManager.getTaskManager(),
        u = a.default.getLogger("ShouleiShareLink");

    function c(e) {
        let t = "";
        do {
            t = e.getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskUrl);
            let i = e.getType();
            if (i === l.DownloadKernel.TaskType.Emule || i === l.DownloadKernel.TaskType.P2sp) break;
            if (i === l.DownloadKernel.TaskType.Bt) {
                if (!t || "" === t) {
                    t = "magnet:?xt=urn:btih:" + e.getExtraObject().getInfoId()
                }
                break
            }
        } while (0);
        return t
    }

    function h(e) {
        let t = -1;
        do {
            if (e.getType() !== l.DownloadKernel.TaskType.Bt) break;
            let i = e.getExtraObject().getBtFileList();
            for (let e = 0; e < i.size; ++e) {
                let n = i.get(e);
                if (n && n.isSupportPlay()) {
                    t = e;
                    break
                }
            }
        } while (0);
        return t
    }

    function f(e) {
        let t = "";
        {
            let i = e.getType();
            if (i === l.DownloadKernel.TaskType.Emule || i === l.DownloadKernel.TaskType.P2sp) t = e.getTaskAttribute(l.DownloadKernel.TaskAttribute.Gcid); else if (i === l.DownloadKernel.TaskType.Bt) {
                t = e.getExtraObject().getInfoId()
            }
        }
        return t
    }

    function g(e, t, i = "download", a = null) {
        return n(this, void 0, void 0, function* () {
            let n = "";
            do {
                let r = c(e);
                if (!r || "" === r) break;
                let s = e.getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskName),
                    d = e.getTaskAttribute(l.DownloadKernel.TaskAttribute.RefUrl),
                    g = e.getTaskAttribute(l.DownloadKernel.TaskAttribute.FileSize), p = h(e), v = f(e);
                try {
                    let e = {
                        url: r,
                        title: s,
                        refUrl: d,
                        fileSize: g,
                        type: i,
                        gcid: v,
                        videobtindex: p,
                        share_from: t
                    };
                    a && (e.peerID = a.peerId, e.hostIPv4 = a.hostIp, e.tcpPort = a.tcpPort, e.udpPort = a.udpPort, e.peerCapability = a.peerCapability);
                    let l = yield o.fetchSlRes({url: "/remotestorage/wechart_set", data: e, method: "post"});
                    if (u.warning("fetchSlRes response", l), null !== l && void 0 !== l && 200 === l.status && null !== l.data && void 0 !== l.data) {
                        let e = l.data;
                        "ok" === e.result && "" !== e.storid && (n = e.storid)
                    }
                } catch (e) {
                    u.warning("fetchSlRes failed!", e)
                }
            } while (0);
            return n
        })
    }

    function p(e, t, i, a, r, s, l, d = "download", c = null) {
        return n(this, void 0, void 0, function* () {
            let n = "";
            do {
                if (!e || "" === e) break;
                try {
                    let h = {
                        url: e,
                        title: t,
                        refUrl: i,
                        fileSize: a,
                        type: d,
                        gcid: r,
                        videobtindex: s,
                        share_from: l
                    };
                    c && (h.peerID = c.peerId, h.hostIPv4 = c.hostIp, h.tcpPort = c.tcpPort, h.udpPort = c.udpPort, h.peerCapability = c.peerCapability);
                    let f = yield o.fetchSlRes({url: "/remotestorage/wechart_set", data: h, method: "post"});
                    if (u.information("fetchSlRes data", h, "response", f), null !== f && void 0 !== f && 200 === f.status && null !== f.data && void 0 !== f.data) {
                        let e = f.data;
                        "ok" === e.result && "" !== e.storid && (n = e.storid)
                    }
                } catch (e) {
                    u.warning("fetchSlRes failed!", e)
                }
            } while (0);
            return n
        })
    }

    function v(e, t = "pic", i = "") {
        return n(this, void 0, void 0, function* () {
            let n = "";
            do {
                let a = d.getTaskFromTaskId(e);
                if (!a) break;
                let o = yield g(a, i);
                if (o && "" !== o) {
                    yield s.default.isInitedAw();
                    let e = s.default.getConfigInfo("shouleiDownload", "shareLink");
                    e && "" !== e || (e = "https://sl-m-ssl.xunlei.com/h5/page/download-share/index.html");
                    let r = h(a);
                    n = `${e}?entry=${t}&appType=PC&videobtindex=${r}&storid=${o}&share_from=${i}`, u.information("shareLink", n)
                }
            } while (0);
            return n
        })
    }

    function m(e, t, i, a, o, r, l = "pic", d = "") {
        return n(this, void 0, void 0, function* () {
            let n = "";
            {
                let c = yield p(e, t, i, a, o, r, d);
                if (c && "" !== c) {
                    yield s.default.isInitedAw();
                    let e = s.default.getConfigInfo("shouleiDownload", "shareLink");
                    e && "" !== e || (e = "https://sl-m-ssl.xunlei.com/h5/page/download-share/index.html"), n = `${e}?entry=${l}&appType=PC&videobtindex=${r}&storid=${c}&share_from=${d}`, u.information("shareLink", n)
                }
            }
            return n
        })
    }

    function y(e, t, i = "pic", a = "") {
        return n(this, void 0, void 0, function* () {
            let n = "";
            do {
                let o = d.getTaskFromTaskId(e);
                if (!o) break;
                let r = yield g(o, a, "file_transfer", t);
                if (r && "" !== r) {
                    yield s.default.isInitedAw();
                    let e = s.default.getConfigInfo("shouleiDownload", "fileTransferLink");
                    e && "" !== e || (e = "https://sl-m-ssl.xunlei.com/h5/page/download-share/index.html");
                    let t = h(o);
                    n = `${e}?entry=${i}&appType=PC&videobtindex=${t}&storid=${r}&share_from=${a}&pcfiletransfer=1`, u.information("shareLink", n)
                }
            } while (0);
            return n
        })
    }

    function k(e, t, i, a, o, r, l, d = "pic", c = "") {
        return n(this, void 0, void 0, function* () {
            let n = "";
            {
                let h = yield p(e, t, i, a, o, r, c, "file_transfer", l);
                if (h && "" !== h) {
                    yield s.default.isInitedAw();
                    let e = s.default.getConfigInfo("shouleiDownload", "fileTransferLink");
                    e && "" !== e || (e = "https://sl-m-ssl.xunlei.com/h5/page/download-share/index.html"), n = `${e}?entry=${d}&appType=PC&videobtindex=${r}&storid=${h}&share_from=${c}&pcfiletransfer=1`, u.information("shareLink", n)
                }
            }
            return n
        })
    }

    t.getShouleiShareLink = v, t.getShouleiShareLink2 = m, t.getShouleiShareLinkDlj = function (e, t = "pic", i = "") {
        return n(this, void 0, void 0, function* () {
            let n = "", a = yield v(e, t, i);
            return a && "" !== a && (n = yield r.getBaiduDWZ(a), u.information("GetBaiduDWZ", n)), n
        })
    }, t.getShouleiShareLinkDlj2 = function (e, t, i, a, o, s, l = "pic", d = "") {
        return n(this, void 0, void 0, function* () {
            let n = "", c = yield m(e, t, i, a, o, s, l, d);
            return c && "" !== c && (n = yield r.getBaiduDWZ(c), u.information("GetBaiduDWZ", n)), n
        })
    }, t.getShouleiFileTransferLink = y, t.getShouleiFileTransferDlj = function (e, t, i = "pic", a = "") {
        return n(this, void 0, void 0, function* () {
            let n = "", o = yield y(e, t, i, a);
            return o && "" !== o && (n = yield r.getBaiduDWZ(o), u.information("GetBaiduDWZ", n)), n
        })
    }, t.getShouleiFileTransferLink2 = k, t.getShouleiFileTransferDlj2 = function (e, t, i, a, o, s, l, d = "pic", c = "") {
        return n(this, void 0, void 0, function* () {
            let n = "", h = yield k(e, t, i, a, o, s, l, d, c);
            return h && "" !== h && (n = yield r.getBaiduDWZ(h), u.information("GetBaiduDWZ", n)), n
        })
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(0), a = i(89), o = i(24), r = i(90), s = i(124), l = n.default.getLogger("pop-mutual"), d = 3e3, u = {
        [a.PopView.PRE_NEW_TASK]: 0,
        [a.PopView.BT_NEW_TASK]: 0,
        [a.PopView.NEW_TASK]: 0,
        [a.PopView.LOGIN]: 1,
        [a.PopView.BROWSER_GUIDE]: 2,
        [a.PopView.SIGN]: 3
    };
    const c = new class {
        constructor() {
            this.showQueue = [], this.willPopQueue = {}
        }

        setReady(e, ...t) {
            l.information("setReady in", e, ...t);
            do {
                if (e === a.PopView.LOGIN) {
                    let i = t && t[2] || "";
                    if (i.toLowerCase() !== "autoLoginFail".toLowerCase() && "auto" !== i.toLowerCase()) {
                        this.popImmediately(e, ...t);
                        break
                    }
                }
                let i = !1, n = u[e];
                if (void 0 === n) break;
                for (let e of this.showQueue) if (u[e] < n) {
                    i = !0;
                    break
                }
                i ? (l.information("setReady wait pop", e), this.willPopQueue[e] = t) : (l.information("setReady popImmediately", e), this.popImmediately(e, ...t))
            } while (0)
        }

        setFinish(e) {
            l.information("setFinish in", e);
            let t = this.showQueue.indexOf(e);
            -1 !== t && this.showQueue.splice(t, 1), 0 === this.showQueue.length ? this.popNext() : l.information(`${e} finished, but still other party show`, this.showQueue)
        }

        popNext() {
            do {
                let e = Object.keys(this.willPopQueue);
                if (0 === e.length) {
                    l.information("popNext no dlg wait");
                    break
                }
                e.sort((e, t) => u[e] - u[t]), l.information("popNext", e);
                let t = e[0];
                if (0 === u[t]) {
                    l.information("popNext but newtask dlg still exist");
                    break
                }
                let i = this.willPopQueue[t];
                delete this.willPopQueue[t], setTimeout(() => {
                    this.popImmediately(t, ...i)
                }, d)
            } while (0)
        }

        popImmediately(e, ...t) {
            switch (this.showQueue.push(e), e) {
                case a.PopView.PRE_NEW_TASK:
                case a.PopView.BT_NEW_TASK:
                case a.PopView.NEW_TASK:
                    break;
                case a.PopView.LOGIN:
                    t = t || [], o.LoginHelperNS.loginUIHelper.createLoginWnd(t[0], t[1], t[2], t[3], t[4]);
                    break;
                case a.PopView.BROWSER_GUIDE:
                    r.default().popUpBrowserGuide().catch();
                    break;
                case a.PopView.SIGN:
                    s.EmbeddedBrowserManagerNs.showWebWnd("sign", ...t)
            }
        }
    };
    t.popMutual = c
}, function (e, t, i) {
    (function () {
        var t, n, a, o, r, s = {}.hasOwnProperty;
        r = i(66), o = r.isObject, a = r.isFunction, n = i(50), t = i(418), e.exports = function (e) {
            function i(e, t, n) {
                if (i.__super__.constructor.call(this, e), null == t) throw new Error("Missing element name");
                this.name = this.stringify.eleName(t), this.attributes = {}, null != n && this.attribute(n), e.isDocument && (this.isRoot = !0, this.documentObject = e, e.rootObject = this)
            }

            return function (e, t) {
                for (var i in t) s.call(t, i) && (e[i] = t[i]);

                function n() {
                    this.constructor = e
                }

                n.prototype = t.prototype, e.prototype = new n, e.__super__ = t.prototype
            }(i, n), i.prototype.clone = function () {
                var e, t, i, n;
                for (t in(i = Object.create(this)).isRoot && (i.documentObject = null), i.attributes = {}, n = this.attributes) s.call(n, t) && (e = n[t], i.attributes[t] = e.clone());
                return i.children = [], this.children.forEach(function (e) {
                    var t;
                    return (t = e.clone()).parent = i, i.children.push(t)
                }), i
            }, i.prototype.attribute = function (e, i) {
                var n, r;
                if (null != e && (e = e.valueOf()), o(e)) for (n in e) s.call(e, n) && (r = e[n], this.attribute(n, r)); else a(i) && (i = i.apply()), this.options.skipNullAttributes && null == i || (this.attributes[e] = new t(this, e, i));
                return this
            }, i.prototype.removeAttribute = function (e) {
                var t, i, n;
                if (null == e) throw new Error("Missing attribute name");
                if (e = e.valueOf(), Array.isArray(e)) for (i = 0, n = e.length; i < n; i++) t = e[i], delete this.attributes[t]; else delete this.attributes[e];
                return this
            }, i.prototype.toString = function (e) {
                return this.options.writer.set(e).element(this)
            }, i.prototype.att = function (e, t) {
                return this.attribute(e, t)
            }, i.prototype.a = function (e, t) {
                return this.attribute(e, t)
            }, i
        }()
    }).call(this)
}, function (e, t, i) {
    (function () {
        var t, n = {}.hasOwnProperty;
        t = i(50), e.exports = function (e) {
            function i(e, t) {
                if (i.__super__.constructor.call(this, e), null == t) throw new Error("Missing CDATA text");
                this.text = this.stringify.cdata(t)
            }

            return function (e, t) {
                for (var i in t) n.call(t, i) && (e[i] = t[i]);

                function a() {
                    this.constructor = e
                }

                a.prototype = t.prototype, e.prototype = new a, e.__super__ = t.prototype
            }(i, t), i.prototype.clone = function () {
                return Object.create(this)
            }, i.prototype.toString = function (e) {
                return this.options.writer.set(e).cdata(this)
            }, i
        }()
    }).call(this)
}, function (e, t, i) {
    (function () {
        var t, n = {}.hasOwnProperty;
        t = i(50), e.exports = function (e) {
            function i(e, t) {
                if (i.__super__.constructor.call(this, e), null == t) throw new Error("Missing comment text");
                this.text = this.stringify.comment(t)
            }

            return function (e, t) {
                for (var i in t) n.call(t, i) && (e[i] = t[i]);

                function a() {
                    this.constructor = e
                }

                a.prototype = t.prototype, e.prototype = new a, e.__super__ = t.prototype
            }(i, t), i.prototype.clone = function () {
                return Object.create(this)
            }, i.prototype.toString = function (e) {
                return this.options.writer.set(e).comment(this)
            }, i
        }()
    }).call(this)
}, function (e, t, i) {
    (function () {
        var t, n, a = {}.hasOwnProperty;
        n = i(66).isObject, t = i(50), e.exports = function (e) {
            function i(e, t, a, o) {
                var r;
                i.__super__.constructor.call(this, e), n(t) && (t = (r = t).version, a = r.encoding, o = r.standalone), t || (t = "1.0"), this.version = this.stringify.xmlVersion(t), null != a && (this.encoding = this.stringify.xmlEncoding(a)), null != o && (this.standalone = this.stringify.xmlStandalone(o))
            }

            return function (e, t) {
                for (var i in t) a.call(t, i) && (e[i] = t[i]);

                function n() {
                    this.constructor = e
                }

                n.prototype = t.prototype, e.prototype = new n, e.__super__ = t.prototype
            }(i, t), i.prototype.toString = function (e) {
                return this.options.writer.set(e).declaration(this)
            }, i
        }()
    }).call(this)
}, function (e, t, i) {
    (function () {
        var t, n, a, o, r, s, l = {}.hasOwnProperty;
        s = i(66).isObject, r = i(50), t = i(117), a = i(118), n = i(119), o = i(120), e.exports = function (e) {
            function i(e, t, n) {
                var a, o;
                i.__super__.constructor.call(this, e), this.documentObject = e, s(t) && (t = (a = t).pubID, n = a.sysID), null == n && (n = (o = [t, n])[0], t = o[1]), null != t && (this.pubID = this.stringify.dtdPubID(t)), null != n && (this.sysID = this.stringify.dtdSysID(n))
            }

            return function (e, t) {
                for (var i in t) l.call(t, i) && (e[i] = t[i]);

                function n() {
                    this.constructor = e
                }

                n.prototype = t.prototype, e.prototype = new n, e.__super__ = t.prototype
            }(i, r), i.prototype.element = function (e, t) {
                var i;
                return i = new n(this, e, t), this.children.push(i), this
            }, i.prototype.attList = function (e, i, n, a, o) {
                var r;
                return r = new t(this, e, i, n, a, o), this.children.push(r), this
            }, i.prototype.entity = function (e, t) {
                var i;
                return i = new a(this, !1, e, t), this.children.push(i), this
            }, i.prototype.pEntity = function (e, t) {
                var i;
                return i = new a(this, !0, e, t), this.children.push(i), this
            }, i.prototype.notation = function (e, t) {
                var i;
                return i = new o(this, e, t), this.children.push(i), this
            }, i.prototype.toString = function (e) {
                return this.options.writer.set(e).docType(this)
            }, i.prototype.ele = function (e, t) {
                return this.element(e, t)
            }, i.prototype.att = function (e, t, i, n, a) {
                return this.attList(e, t, i, n, a)
            }, i.prototype.ent = function (e, t) {
                return this.entity(e, t)
            }, i.prototype.pent = function (e, t) {
                return this.pEntity(e, t)
            }, i.prototype.not = function (e, t) {
                return this.notation(e, t)
            }, i.prototype.up = function () {
                return this.root() || this.documentObject
            }, i
        }()
    }).call(this)
}, function (e, t, i) {
    (function () {
        var t, n = {}.hasOwnProperty;
        t = i(50), e.exports = function (e) {
            function i(e, t, n, a, o, r) {
                if (i.__super__.constructor.call(this, e), null == t) throw new Error("Missing DTD element name");
                if (null == n) throw new Error("Missing DTD attribute name");
                if (!a) throw new Error("Missing DTD attribute type");
                if (!o) throw new Error("Missing DTD attribute default");
                if (0 !== o.indexOf("#") && (o = "#" + o), !o.match(/^(#REQUIRED|#IMPLIED|#FIXED|#DEFAULT)$/)) throw new Error("Invalid default value type; expected: #REQUIRED, #IMPLIED, #FIXED or #DEFAULT");
                if (r && !o.match(/^(#FIXED|#DEFAULT)$/)) throw new Error("Default value only applies to #FIXED or #DEFAULT");
                this.elementName = this.stringify.eleName(t), this.attributeName = this.stringify.attName(n), this.attributeType = this.stringify.dtdAttType(a), this.defaultValue = this.stringify.dtdAttDefault(r), this.defaultValueType = o
            }

            return function (e, t) {
                for (var i in t) n.call(t, i) && (e[i] = t[i]);

                function a() {
                    this.constructor = e
                }

                a.prototype = t.prototype, e.prototype = new a, e.__super__ = t.prototype
            }(i, t), i.prototype.toString = function (e) {
                return this.options.writer.set(e).dtdAttList(this)
            }, i
        }()
    }).call(this)
}, function (e, t, i) {
    (function () {
        var t, n, a = {}.hasOwnProperty;
        n = i(66).isObject, t = i(50), e.exports = function (e) {
            function i(e, t, a, o) {
                if (i.__super__.constructor.call(this, e), null == a) throw new Error("Missing entity name");
                if (null == o) throw new Error("Missing entity value");
                if (this.pe = !!t, this.name = this.stringify.eleName(a), n(o)) {
                    if (!o.pubID && !o.sysID) throw new Error("Public and/or system identifiers are required for an external entity");
                    if (o.pubID && !o.sysID) throw new Error("System identifier is required for a public external entity");
                    if (null != o.pubID && (this.pubID = this.stringify.dtdPubID(o.pubID)), null != o.sysID && (this.sysID = this.stringify.dtdSysID(o.sysID)), null != o.nData && (this.nData = this.stringify.dtdNData(o.nData)), this.pe && this.nData) throw new Error("Notation declaration is not allowed in a parameter entity")
                } else this.value = this.stringify.dtdEntityValue(o)
            }

            return function (e, t) {
                for (var i in t) a.call(t, i) && (e[i] = t[i]);

                function n() {
                    this.constructor = e
                }

                n.prototype = t.prototype, e.prototype = new n, e.__super__ = t.prototype
            }(i, t), i.prototype.toString = function (e) {
                return this.options.writer.set(e).dtdEntity(this)
            }, i
        }()
    }).call(this)
}, function (e, t, i) {
    (function () {
        var t, n = {}.hasOwnProperty;
        t = i(50), e.exports = function (e) {
            function i(e, t, n) {
                if (i.__super__.constructor.call(this, e), null == t) throw new Error("Missing DTD element name");
                n || (n = "(#PCDATA)"), Array.isArray(n) && (n = "(" + n.join(",") + ")"), this.name = this.stringify.eleName(t), this.value = this.stringify.dtdElementValue(n)
            }

            return function (e, t) {
                for (var i in t) n.call(t, i) && (e[i] = t[i]);

                function a() {
                    this.constructor = e
                }

                a.prototype = t.prototype, e.prototype = new a, e.__super__ = t.prototype
            }(i, t), i.prototype.toString = function (e) {
                return this.options.writer.set(e).dtdElement(this)
            }, i
        }()
    }).call(this)
}, function (e, t, i) {
    (function () {
        var t, n = {}.hasOwnProperty;
        t = i(50), e.exports = function (e) {
            function i(e, t, n) {
                if (i.__super__.constructor.call(this, e), null == t) throw new Error("Missing notation name");
                if (!n.pubID && !n.sysID) throw new Error("Public or system identifiers are required for an external entity");
                this.name = this.stringify.eleName(t), null != n.pubID && (this.pubID = this.stringify.dtdPubID(n.pubID)), null != n.sysID && (this.sysID = this.stringify.dtdSysID(n.sysID))
            }

            return function (e, t) {
                for (var i in t) n.call(t, i) && (e[i] = t[i]);

                function a() {
                    this.constructor = e
                }

                a.prototype = t.prototype, e.prototype = new a, e.__super__ = t.prototype
            }(i, t), i.prototype.toString = function (e) {
                return this.options.writer.set(e).dtdNotation(this)
            }, i
        }()
    }).call(this)
}, function (e, t, i) {
    (function () {
        var t, n = {}.hasOwnProperty;
        t = i(50), e.exports = function (e) {
            function i(e, t) {
                if (i.__super__.constructor.call(this, e), null == t) throw new Error("Missing raw text");
                this.value = this.stringify.raw(t)
            }

            return function (e, t) {
                for (var i in t) n.call(t, i) && (e[i] = t[i]);

                function a() {
                    this.constructor = e
                }

                a.prototype = t.prototype, e.prototype = new a, e.__super__ = t.prototype
            }(i, t), i.prototype.clone = function () {
                return Object.create(this)
            }, i.prototype.toString = function (e) {
                return this.options.writer.set(e).raw(this)
            }, i
        }()
    }).call(this)
}, function (e, t, i) {
    (function () {
        var t, n = {}.hasOwnProperty;
        t = i(50), e.exports = function (e) {
            function i(e, t) {
                if (i.__super__.constructor.call(this, e), null == t) throw new Error("Missing element text");
                this.value = this.stringify.eleText(t)
            }

            return function (e, t) {
                for (var i in t) n.call(t, i) && (e[i] = t[i]);

                function a() {
                    this.constructor = e
                }

                a.prototype = t.prototype, e.prototype = new a, e.__super__ = t.prototype
            }(i, t), i.prototype.clone = function () {
                return Object.create(this)
            }, i.prototype.toString = function (e) {
                return this.options.writer.set(e).text(this)
            }, i
        }()
    }).call(this)
}, function (e, t, i) {
    (function () {
        var t, n = {}.hasOwnProperty;
        t = i(50), e.exports = function (e) {
            function i(e, t, n) {
                if (i.__super__.constructor.call(this, e), null == t) throw new Error("Missing instruction target");
                this.target = this.stringify.insTarget(t), n && (this.value = this.stringify.insValue(n))
            }

            return function (e, t) {
                for (var i in t) n.call(t, i) && (e[i] = t[i]);

                function a() {
                    this.constructor = e
                }

                a.prototype = t.prototype, e.prototype = new a, e.__super__ = t.prototype
            }(i, t), i.prototype.clone = function () {
                return Object.create(this)
            }, i.prototype.toString = function (e) {
                return this.options.writer.set(e).processingInstruction(this)
            }, i
        }()
    }).call(this)
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(422), a = i(529), o = i(126), r = i(530), s = i(424), l = i(532), d = i(91), u = i(23), c = i(0),
        h = i(4), f = c.default.getLogger("EmbeddedBrowserManagerNs");
    let g = [];
    !function (e) {
        function t(e, ...t) {
            do {
                if (null === e || void 0 === e || "" === e) {
                    f.information("createWebWnd 参数错误：webType=", e);
                    break
                }
                let i = t[0];
                if (null === i || void 0 === i || "" === i) {
                    f.information("createWebWnd 参数错误：url=", i);
                    break
                }
                let n = t[1];
                null !== n && void 0 !== n || (n = "");
                let a = t[2];
                null !== a && void 0 !== a || (a = !0);
                let o = e, r = t[3];
                if (null === r || void 0 === r || r <= 0) {
                    f.information("createWebWnd 参数错误：wndWidth=", r);
                    break
                }
                let s = t[4];
                if (null === s || void 0 === s || s <= 0) {
                    f.information("createWebWnd 参数错误：wndHeight=", s);
                    break
                }
                let l = t[5];
                if (null === l || void 0 === l) {
                    f.information("createWebWnd 参数错误：browserLeftMargin=", l);
                    break
                }
                let u = t[6];
                if (null === u || void 0 === u) {
                    f.information("createWebWnd 参数错误：browserRightMargin=", u);
                    break
                }
                let c = t[7];
                if (null === c || void 0 === c) {
                    f.information("createWebWnd 参数错误：browserTopMargin=", c);
                    break
                }
                let h = t[8];
                if (null === h || void 0 === h) {
                    f.information("createWebWnd 参数错误：browserBootomMargin=", h);
                    break
                }
                let p = g.filter(t => e === t.moduleName), v = null;
                if (!(null === p || void 0 === p || p.length <= 0)) {
                    v = p[0].embeddedBrowserObj;
                    break
                }
                {
                    v = new d.EmbeddedBrowser;
                    let t = {moduleName: e, embeddedBrowserObj: v};
                    g.push(t)
                }
                let m = t[9], y = t[10], k = t[11], T = t[12];
                T && v.setBrowserEventHandler(T), v.createWnd(i, n, a, o, r, s, l, u, c, h, m, y, k, () => {
                    for (let t in g) if (g[Number(t)].moduleName === e) {
                        g.splice(Number(t), 1);
                        break
                    }
                }).catch()
            } while (0)
        }

        e.enableSignAutoShow = function (e) {
            n.signObject.enableAutoShow(e)
        }, e.showWebWnd = function (e, ...i) {
            if ("sign" === e) {
                let e = "";
                null !== i && void 0 !== i && null !== i[0] && void 0 !== i[0] && (e = i[0]), s.newsPopupObject.close(), n.signObject.createSignDlg(e, a.signNative.getNativeFunctionMap()).catch()
            } else if ("newsPopup" === e) {
                let e = "";
                null !== i && void 0 !== i && null !== i[0] && void 0 !== i[0] && (e = i[0]), h.isNullOrUndefined(n.signObject.getWnd()) && s.newsPopupObject.createNewsPopupDlg(e, l.newsPopupNative.getNativeFunctionMap()).catch()
            } else if ("phoneAuth" === e) {
                let e = "";
                null !== i && void 0 !== i && null !== i[0] && void 0 !== i[0] && (e = i[0]), o.phoneAuthObject.createPhoneAuthDlg(e, r.phoneAuthNative.getNativeFunctionMap()).catch()
            } else t(e, ...i)
        }, e.createWebWnd = t, e.createWebWndEx = function (e) {
            do {
                let t = e.business;
                if (null === t || void 0 === t || "" === t) {
                    f.information("createWebWnd 参数错误：webType=", t);
                    break
                }
                let i = e.url;
                if (null === i || void 0 === i || "" === i) {
                    f.information("createWebWnd 参数错误：url=", i);
                    break
                }
                let n = e.title;
                null !== n && void 0 !== n || (n = "");
                let a = e.isModal;
                null !== a && void 0 !== a || (a = !0);
                let o = t, r = e.width;
                if (null === r || void 0 === r || r <= 0) {
                    f.information("createWebWnd 参数错误：wndWidth=", r);
                    break
                }
                let s = e.height;
                if (null === s || void 0 === s || s <= 0) {
                    f.information("createWebWnd 参数错误：wndHeight=", s);
                    break
                }
                let l = e.leftMargin;
                if (null === l || void 0 === l) {
                    f.information("createWebWnd 参数错误：browserLeftMargin=", l);
                    break
                }
                let u = e.rightMargin;
                if (null === u || void 0 === u) {
                    f.information("createWebWnd 参数错误：browserRightMargin=", u);
                    break
                }
                let c = e.topMargin;
                if (null === c || void 0 === c) {
                    f.information("createWebWnd 参数错误：browserTopMargin=", c);
                    break
                }
                let h = e.bottomMargin;
                if (null === h || void 0 === h) {
                    f.information("createWebWnd 参数错误：browserBootomMargin=", h);
                    break
                }
                let p = g.filter(e => t === e.moduleName), v = null;
                if (!(null === p || void 0 === p || p.length <= 0)) {
                    v = p[0].embeddedBrowserObj;
                    break
                }
                {
                    v = new d.EmbeddedBrowser;
                    let e = {moduleName: t, embeddedBrowserObj: v};
                    g.push(e)
                }
                let m = e.mapNative, y = e.onShowCallback, k = e.onCloseCallback, T = e.onBrowserEvent;
                T && v.setBrowserEventHandler(T), void 0 !== e.autoShow && v.setAutoShow(e.autoShow), void 0 !== e.autoCloseAtError && v.setAutoCloseAtError(e.autoCloseAtError), e.isTopLevel && v.setWindowTopLevel(!0), e.isToolWindow && (v.setToolWindow(!0), e.minimizable && (e.minimizable = !1)), v.createWnd(i, n, a, o, r, s, l, u, c, h, m, y, k, () => {
                    for (let e in g) if (g[Number(e)].moduleName === t) {
                        g.splice(Number(e), 1);
                        break
                    }
                }, e.alwaysOnTop, e.minimizable, e.menuOptions, e.nativeOptions).catch()
            } while (0)
        }, e.closeWebWnd = function (e) {
            do {
                if (null === e || void 0 === e || "" === e) {
                    f.information("closeWebWnd 参数错误：webType=", e);
                    break
                }
                let t = g.filter(t => e === t.moduleName), i = null;
                if (null === t || void 0 === t || t.length <= 0) break;
                (i = t[0].embeddedBrowserObj).closeWnd().catch()
            } while (0)
        }, e.existWebWnd = function (e) {
            let t = !1;
            do {
                if (!e) break;
                let i = g.filter(t => e === t.moduleName);
                if (!i || i.length <= 0) break;
                t = !0
            } while (0);
            return t
        }, e.visibleWebWnd = function (e, t) {
            let i = !1;
            do {
                if (!e) break;
                let n = g.filter(t => e === t.moduleName);
                if (!n || n.length <= 0) break;
                n[0].embeddedBrowserObj.showWnd(t).catch(), i = !0
            } while (0);
            return i
        }, e.bringWebWndToTop = function (e) {
            let t = !1;
            do {
                if (!e) break;
                let i = g.filter(t => e === t.moduleName);
                if (!i || i.length <= 0) break;
                i[0].embeddedBrowserObj.bringToTop(), t = !0
            } while (0);
            return t
        }, e.registerWebFunction = function (e, t, i) {
            let n = g.filter(t => e === t.moduleName);
            null !== n && void 0 !== n && n.length > 0 && n[0].embeddedBrowserObj.registerNativeFunction(t, i)
        }, e.callBackWebFunction = function (e, t, i, n) {
            let a = g.filter(t => e === t.moduleName);
            if (null !== a && void 0 !== a && a.length > 0) {
                let e = a[0].embeddedBrowserObj.getBrowserObj();
                null !== e && void 0 !== e && e.callNativeFunctionCallback(t, i, u.NativeFunctionErrorCode.Success, n)
            }
        }, e.fireEventWebFunction = function (e, ...t) {
            let i = g.filter(t => e === t.moduleName);
            if (null !== i && void 0 !== i && i.length > 0) {
                let e = i[0].embeddedBrowserObj.getBrowserObj();
                if (null !== e && void 0 !== e) {
                    let i = t[0];
                    if (null === i || void 0 === i || "" === i) return;
                    t.splice(0, 1), e.fireEvent(i, ...t)
                }
            }
        }
    }(t.EmbeddedBrowserManagerNs || (t.EmbeddedBrowserManagerNs = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(12), o = i(92), r = i(2), s = i(0), l = i(19), d = i(5), u = i(6), c = i(311), h = i(54),
        f = s.default.getLogger("Browser.Support"), g = u.default(r.join(__rootDir, "../bin/ThunderHelper.node"));
    let p = !1, v = !1;
    !function (e) {
        const t = new l.EventEmitter;
        e.isTabInit = function () {
            return v
        }, e.setTabInit = function (e) {
            v = e
        }, e.isTBCAvailable = function () {
            return n(this, void 0, void 0, function* () {
                let e = !1;
                do {
                    let t = r.join(__rootDir, "../bin/TBC/"), i = r.join(t, "libCef.dll");
                    if (!(e = yield d.FileSystemAWNS.existsAW(i))) break;
                    let n = r.join(__rootDir, "../bin/TBC/xlbrowsernode.node");
                    if (!(e = yield d.FileSystemAWNS.existsAW(n))) break
                } while (0);
                return e
            })
        }, e.initTBC = function () {
            return n(this, void 0, void 0, function* () {
                if (p) return p;
                f.information("[tbc] initTBC"), o.context.on("browser-created", (e, t) => {
                    f.information("new browser-created:", JSON.stringify(t))
                }), o.context.on("browser-destroyed", (e, t) => {
                    f.information("browser destroyed: ", JSON.stringify(t))
                });
                let e = r.join(__rootDir, "../bin/TBC/"), i = g.getPeerID(), n = r.join(__rootDir, "../../Thunder.exe"),
                    a = g.getFileVersion(n);
                return p = yield o.context.init({
                    data_path: r.join(e, "Data"),
                    product_version: a,
                    peer_id: i,
                    user_agent: "Thunder/" + a,
                    tbc_dir: e,
                    node_module_path: r.join(__rootDir, "../bin/TBC/xlbrowsernode.node")
                }), f.information("[tbc] initTBC", p), t.emit("BrowserSupportInit", p), p
            })
        }, e.browserIsInitFinish = function () {
            return p
        }, e.attachInit = function (e) {
            do {
                if (p) {
                    e(p);
                    break
                }
                t.on("BrowserSupportInit", e)
            } while (0)
        }, e.getDpiAwareSupport = function () {
            return g.getDPIAwareSupport()
        }, e.resizeBrowserWindow = function (e) {
            return n(this, void 0, void 0, function* () {
                let t = !1;
                {
                    let i = yield a.asyncRemoteCall.getCurrentWindow(),
                        n = yield c.BrowserWindowNS.getBrowserWindowPosition(g, i);
                    g.setWindowPos(e, h.OptionOfHWNDInAfter.HWND_TOP, n.x, n.y, n.width, n.height, 0), t = !0
                }
                return t
            })
        }
    }(t.BrowserSupportNS || (t.BrowserSupportNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(18), o = i(91), r = i(16), s = i(24), l = i(0).default.getLogger("PhoneAuth");
    t.phoneAuthObject = new class {
        constructor() {
            this.embeddedBrowserObj = null, this.title = "迅雷提示", this.url = "http://misc-xl9-ssl.xunlei.com/bindphone/dist/index.html", this.width = 346, this.height = 468, this.lefttMargin = 8, this.rigthMargin = 8, this.topMargin = 38, this.bootomMargin = 8, this.isType = !1, this.embeddedBrowserObj = new o.EmbeddedBrowser
        }

        createPhoneAuthDlg(e, t) {
            return n(this, void 0, void 0, function* () {
                this.isType = !1, yield this.embeddedBrowserObj.createWnd(this.url, this.title, !0, "phoneAuth", this.width, this.height, this.lefttMargin, this.rigthMargin, this.topMargin, this.bootomMargin, t, null, this.onWndCloseResult.bind(this))
            })
        }

        onWndCloseResult() {
            return n(this, void 0, void 0, function* () {
                this.isType || r.NativeCallModule.nativeCall.CallNativeFunction("FireEventFunction", "OnPhoneAuthResult", 0)
            })
        }

        closeDialog(e, t) {
            this.isType = !0;
            let i = e;
            null !== e && void 0 !== e || (i = 0), r.NativeCallModule.nativeCall.CallNativeFunction("FireEventFunction", "OnPhoneAuthResult", i), this.embeddedBrowserObj.closeWnd().catch()
        }

        isPhoneAuthAw() {
            return n(this, void 0, void 0, function* () {
                let e = !1;
                do {
                    let t = yield s.LoginHelperNS.loginHelper.isLoginedAw();
                    if (!0 !== t) {
                        l.information("isPhoneAuthAw 没有登陆 isLogin：", t);
                        break
                    }
                    let i = yield s.LoginHelperNS.loginHelper.getUserInfoAw();
                    if (null === i || void 0 === i) {
                        l.information("isPhoneAuthAw userInfo有问题 userInfo:", i);
                        break
                    }
                    let n = i.sessionid;
                    if (null === n || void 0 === n || "" === n) {
                        l.information("isPhoneAuthAw sessionid有问题 sessionid:", n);
                        break
                    }
                    let o = i.deviceid, r = i.userid, d = i.usernewno, u = i.usrname, c = i.usernick;
                    try {
                        let t = s.LoginHelperNS.loginSDKHelper.getInitData(), i = JSON.parse(t), h = i.platform,
                            f = i.appid, g = "PC-" + i.package, p = i.thunderVersion,
                            v = `auth.deviceid=${encodeURIComponent(o)}&auth.sessionid=${encodeURIComponent(n)}&auth.userid=${encodeURIComponent(r)}&auth.usernewno=${encodeURIComponent(d)}&auth.usrname=${encodeURIComponent(u)}&auth.usernick=${encodeURIComponent(c)}&auth.platformVersion=${encodeURIComponent(h)}&auth.appid=${encodeURIComponent(f)}&auth.appName=${encodeURIComponent(g)}&auth.clientVersion=${encodeURIComponent(p)}&authType==${encodeURIComponent("phone")}&userid ==${encodeURIComponent("userid")}`,
                            m = null, y = "https://xluser-ssl.xunlei.com/certification/v1/isauth?";
                        if (y = `${y}${v}`, null !== (m = yield a.default.get(y)) && void 0 !== m.status && 200 === m.status && void 0 !== m.data && null !== m.data && "" !== m.data) {
                            let t = m.data;
                            "ISAUTH" === t.result ? e = !0 : l.information("isPhoneAuthAw:data=", t)
                        }
                    } catch (e) {
                        l.information("isPhoneAuthAw:error=", e);
                        break
                    }
                } while (0);
                return e
            })
        }
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(0), a = i(26), o = i(314), r = i(32), s = i(23), l = i(3), d = i(15), u = i(11), c = i(13), h = i(27),
        f = i(7), g = n.default.getLogger("TaskDetail.TaskDetail"), p = o.TaskInfoManagerNS.getTaskInfoManager(),
        v = d.DownloadKernelEventManager.getEventManager(), m = u.DownloadKernelTaskManager.getTaskManager();
    var y;
    !function (e) {
        e.Comments = "comments", e.FileList = "files", e.Attribute = "detail"
    }(y = t.DetailIndex || (t.DetailIndex = {}));
    !function (e) {
        const t = new class {
            constructor() {
                this.isPageReady = !1, this.unFireTaskId = 0, this.unFireTaskData = "", this.unFireIndex = y.Comments, this.curTaskId = 0, this.curPannel = "", this.select = !1
            }

            init() {
                v.attachTaskEvent(l.DownloadKernel.TaskEventType.DetailChanged, (...e) => {
                    this.updateTaskInfo(...e)
                }), v.attachTaskEvent(l.DownloadKernel.TaskEventType.StatusChanged, (...e) => {
                    this.updateTaskInfo(...e)
                }), v.attachTaskEvent(l.DownloadKernel.TaskEventType.ChannelInfoChanged, (...e) => {
                    this.updateTaskInfo(...e)
                }), v.attachTaskEvent(l.DownloadKernel.TaskEventType.TaskDescriptionChanged, (...e) => {
                    this.updateTaskInfo(...e)
                }), v.attachTaskEvent(l.DownloadKernel.TaskEventType.TaskRenamed, (...e) => {
                    this.updateTaskInfo(...e)
                }), v.attachTaskEvent(l.DownloadKernel.TaskEventType.TaskMovingStateChange, (...e) => {
                    this.updateTaskInfo(...e)
                }), v.attachTaskEvent(l.DownloadKernel.TaskEventType.BtSubFileDetailChanged, (...e) => {
                    this.onBtSubFileDetailChanged(...e)
                }), v.attachTaskEvent(l.DownloadKernel.TaskEventType.GroupTaskSubFileDetailChanged, (...e) => {
                    this.onGroupTaskSubFileDetailChanged(...e)
                }), h.default.attachListener(c.NodeEventMesssageNS.eventDownloadItemActive, (e, t, i, n, a, o) => {
                    t ? (this.curTaskId = i, this.select = !0, this.onTaskSelectChanged(e, o)) : (a || i === this.curTaskId) && (this.curTaskId = 0, this.curPannel = "", this.select = !1, setTimeout(() => {
                        this.select || this.onTaskSelectChanged(e)
                    }, 100))
                }), h.default.attachListener(c.NodeEventMesssageNS.eventDetailSwitch2Index, (e, t) => {
                    this.switch2DetailIndex(e, t)
                });
                let e = [{functionName: "GetCurTask", nativeFunc: this.getCurTask.bind(this)}];
                r.NativeCallNS.registerNativeFunction(e)
            }

            pageReady() {
                this.isPageReady = !0, g.information("pageReady"), 0 !== this.unFireTaskId && (this.onCurTaskChange(this.unFireTaskId, this.unFireTaskData, this.unFireIndex), this.unFireTaskId = 0, this.unFireTaskData = "")
            }

            switch2DetailIndex(e, t) {
                this.isPageReady ? a.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnSwitchDetail", e, t) : this.unFireTaskId === e && (this.unFireIndex = t)
            }

            updateTaskInfo(...e) {
                do {
                    if (!e) break;
                    if (!e[1]) break;
                    let t = e[1];
                    for (let e = 0; e < t.length; ++e) {
                        let i = t[e];
                        if (!i) continue;
                        let n = i.getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskId);
                        n === this.curTaskId && (i.getTaskAttribute(l.DownloadKernel.TaskAttribute.GroupTaskId) > 0 || p.getTaskInfoString(n).then(e => {
                            this.onTaskInfoChange(n, e)
                        }).catch())
                    }
                } while (0)
            }

            onBtSubFileDetailChanged(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== l.DownloadKernel.TaskEventType.BtSubFileDetailChanged) break;
                    if (!e[1] || !e[2]) break;
                    let t = e[1];
                    if (t !== this.curTaskId) break;
                    let i = e[2], n = p.getBtSubFileListString(t, i);
                    this.onSubFileInfoChange(t, n)
                } while (0)
            }

            onGroupTaskSubFileDetailChanged(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== l.DownloadKernel.TaskEventType.GroupTaskSubFileDetailChanged) break;
                    if (!e[1]) break;
                    e[1].forEach((e, t) => {
                        if (t === this.curTaskId) {
                            let i = p.getGroupTaskSubFileListString(e);
                            this.onSubFileInfoChange(t, i)
                        }
                    })
                } while (0)
            }

            onTaskSelectChanged(e, t) {
                let i = "";
                switch (e) {
                    case l.DownloadKernel.CategroyViewID.Downloading:
                        i = "downloading";
                        break;
                    case l.DownloadKernel.CategroyViewID.Completed:
                        i = "complete";
                        break;
                    case l.DownloadKernel.CategroyViewID.Recycle:
                        i = "trash"
                }
                this.curPannel = i;
                let n = {};
                n.pannel = i;
                let a = JSON.stringify(n);
                this.onCurTaskChange(this.curTaskId, a, t);
                let o = this.curTaskId;
                do {
                    let e = m.getTaskFromTaskId(this.curTaskId);
                    if (!e) break;
                    if (e.getType() !== l.DownloadKernel.TaskType.Bt) break;
                    let i = e.getExtraObject();
                    if (!i) break;
                    if (i.isBtFileLoadEnd()) break;
                    e.loadStorageBtTaskAW(e.getTaskBaseInfo()).then(() => {
                        o === this.curTaskId && this.onCurTaskChange(this.curTaskId, a, t)
                    }).catch()
                } while (0)
            }

            onCurTaskChange(e, t, i) {
                a.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnCurTaskChange", e, t, i), f.client.callServerFunction("curTaskChange", e.toString()).catch(), this.isPageReady ? g.information("OnCurTaskChange", e, t, i) : (this.unFireTaskId = e, this.unFireTaskData = t, this.unFireIndex = i)
            }

            onTaskInfoChange(e, t) {
                a.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnTaskInfoChange", e, t)
            }

            onSubFileInfoChange(e, t) {
                a.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnSubFileInfoChange", e, t)
            }

            getCurTask(e, t, i) {
                do {
                    if (!e || !t || !i) break;
                    let n = {};
                    n.taskID = this.curTaskId, n.pannel = this.curPannel;
                    let a = JSON.stringify(n);
                    e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success, a)
                } while (0)
            }
        };
        e.init = function () {
            t.init()
        }, e.pageReady = function () {
            t.pageReady()
        }
    }(t.TaskDetailNS || (t.TaskDetailNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(7);
    !function (e) {
        const t = "vip-download-webview";
        let i = void 0;
        e.getVipTaskInfo = function (e) {
            return n(this, void 0, void 0, function* () {
                let i = null;
                try {
                    i = (yield a.client.callRemoteClientFunction(t, "GetVipTaskInfo", e))[0]
                } catch (e) {
                }
                return i
            })
        }, e.getVipSubTaskInfo = function (e, i) {
            return n(this, void 0, void 0, function* () {
                let n = null;
                try {
                    n = (yield a.client.callRemoteClientFunction(t, "GetVipSubTaskInfo", e, i))[0]
                } catch (e) {
                }
                return n
            })
        }, e.getVipSpeedColor = function (e) {
            return n(this, void 0, void 0, function* () {
                let i = void 0;
                try {
                    i = (yield a.client.callRemoteClientFunction(t, "GetVipSpeedColor", e))[0]
                } catch (e) {
                }
                return i
            })
        }, e.clickTryAcclerateBtn = function (e, i) {
            return n(this, void 0, void 0, function* () {
                try {
                    yield a.client.callRemoteClientFunction(t, "ClickTryAcclerateBtn", e, i)
                } catch (e) {
                }
            })
        }, e.getThunderVersionNumber = function () {
            return n(this, void 0, void 0, function* () {
                if (void 0 === i) {
                    const e = yield a.client.callServerFunction("GetThunderVersion");
                    i = 0;
                    let t = e.split(".");
                    if (t && 4 === t.length) {
                        let e = Number(t[0]).valueOf(), n = Number(t[1]).valueOf(), a = Number(t[2]).valueOf();
                        i = 128 * Math.pow(2, 24) + e * Math.pow(2, 16) + n * Math.pow(2, 8) + a
                    }
                }
                return i
            })
        }
    }(t.VipPluginFunctionNS || (t.VipPluginFunctionNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(18), r = i(5), s = i(0), l = i(39), d = i(3), u = i(11), c = i(15), h = i(43), f = i(47),
        g = i(28), p = i(17), v = i(12), m = u.DownloadKernelTaskManager.getTaskManager(),
        y = c.DownloadKernelEventManager.getEventManager(), k = s.default.getLogger("SubtiteManager");
    !function (e) {
        let t;
        !function (e) {
            e.DownloadSuccess = "DownloadSuccess", e.DownloadFail = "DownloadFail"
        }(t = e.SubtitleEvent || (e.SubtitleEvent = {}));
        const i = a.resolve(__profilesDir, "SubTitleDownload/"),
            s = a.resolve(__profilesDir, "SubTitleDownload/subtitledata.json");

        class u extends l.default {
            constructor() {
                super(...arguments), this.subtitleData = {}, this.taskStatusChangedEventTable = []
            }

            init() {
                return n(this, void 0, void 0, function* () {
                    k.information("Init");
                    let e = yield r.FileSystemAWNS.existsAW(s);
                    if (e) {
                        let e = yield r.FileSystemAWNS.readFileAW(s);
                        if (e) {
                            try {
                                this.subtitleData = JSON.parse(e.toString())
                            } catch (e) {
                                k.warning(e), this.subtitleData = {}
                            }
                            k.information("Init, subtitle data", this.subtitleData)
                        }
                    } else (e = yield r.FileSystemAWNS.mkdirsAW(i)) && (yield r.FileSystemAWNS.writeFileAW(s, "{}"));
                    let t = yield v.asyncRemoteCall.getIpcMain();
                    t.on(g.ThunderChannelList.channelRMGetSutitleByCid, (e, t, i) => n(this, void 0, void 0, function* () {
                        k.information("channelRMGetSutitleByCid cid and taskid ", t, i);
                        let n = yield this.querySubtitleByCid(t, i);
                        k.information("send channelMRGetSutitleByCidResult"), (yield e.sender.isDestroyed()) || e.sender.send(g.ThunderChannelList.channelMRGetSutitleByCidResult, n)
                    })), t.on(g.ThunderChannelList.channelRMGetSutitleByName, (e, t, i) => n(this, void 0, void 0, function* () {
                        k.information("channelRMGetSutitleByName name and taskid ", t, i);
                        let n = yield this.querySubtitleByName(t, i);
                        k.information("send channelMRGetSutitleByNameResult"), (yield e.sender.isDestroyed()) || e.sender.send(g.ThunderChannelList.channelMRGetSutitleByNameResult, n)
                    })), t.on(g.ThunderChannelList.channelRMDownloadSutitle, (e, t, i, a) => n(this, void 0, void 0, function* () {
                        k.information("channelRMDownloadSutitle taskid ", i), yield this.downloadSubtitle(t, i, a)
                    })), t.on(g.ThunderChannelList.channelRMGetDisplayName, (e, t) => n(this, void 0, void 0, function* () {
                        k.information("channelRMGetDisplayName taskid ", t);
                        let i = this.getDisaplayName(t);
                        e.sender.send(g.ThunderChannelList.channelMRGetDisplayNameResult, i)
                    }))
                })
            }

            getDisaplayName(e) {
                let t = [], i = m.getTaskFromTaskId(e), n = i.getTaskBaseInfo(), a = i.getType();
                if (a === d.DownloadKernel.TaskType.P2sp || a === d.DownloadKernel.TaskType.Emule) {
                    let e = n.taskName, a = i.getTaskAttribute(d.DownloadKernel.TaskAttribute.Cid);
                    k.information(" fileName: ", e, " cid: ", a);
                    let o = {fileName: e, cid: a};
                    o && t.push(o)
                } else if (a === d.DownloadKernel.TaskType.Bt) {
                    let e = i.getExtraObject();
                    if (0 === e.getDownloadFile().length) return null;
                    let n = e.getBtFileList();
                    for (let [e, i]of n) {
                        let n = i.getBtFileAttribute(d.DownloadKernel.BtFileAttribute.FileName);
                        if (f.TaskUtilHelper.getTaskFileType(n) === f.TaskUtilHelper.FileExtType.Video) {
                            let a = i.getBtFileAttribute(d.DownloadKernel.BtFileAttribute.Cid);
                            k.information("btfile inde: ", e, " fileName: ", n, " cid: ", a);
                            let o = {fileName: n, cid: a};
                            o && t.push(o)
                        }
                    }
                } else if (a === d.DownloadKernel.TaskType.Group) {
                    let e = i.getExtraObject(), n = e.getSubTaskCount();
                    for (let i = 0; i < n; ++i) {
                        let n = e.getSubTaskByIndex(i), a = n.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskName);
                        if (f.TaskUtilHelper.getTaskFileType(a) === f.TaskUtilHelper.FileExtType.Video) {
                            let e = n.getTaskAttribute(d.DownloadKernel.TaskAttribute.Cid);
                            k.information(" fileName: ", a, " cid: ", e);
                            let i = {fileName: a, cid: e};
                            i && t.push(i)
                        }
                    }
                }
                return k.information("getDisaplayName ret ", t), t
            }

            querySubtitleByCid(e, t) {
                return n(this, void 0, void 0, function* () {
                    k.information("querySubtitleByCid");
                    let i = [], n = null;
                    try {
                        n = yield o.default.get(`http://sub.xmp.sandai.net:8000/subxl/${e}.json`), k.information("response: ", n)
                    } catch (e) {
                        k.warning(e)
                    }
                    if (null !== n && void 0 !== n.status && 200 === n.status && void 0 !== n.data && null !== n.data) {
                        k.information("sublist: ", n.data.sublist);
                        let e = n.data.sublist;
                        if (e && e.length > 1) for (let n of e) {
                            let e = {scid: "", surl: "", sname: "", language: "", path: "", rate: 0, status: 0};
                            e.scid = n.scid, e.surl = n.surl, e.sname = n.sname, e.language = n.language, e.rate = n.rate, (yield this.isAlreadyDownload(e.scid, t)) ? e.status = 1 : e.status = 0, e && i.push(e)
                        }
                    }
                    return i
                })
            }

            querySubtitleByName(e, t) {
                return n(this, void 0, void 0, function* () {
                    k.information("querySubtitleByName");
                    let i = [];
                    e = encodeURI(e);
                    let n = null;
                    try {
                        n = yield o.default.get(`http://subtitle.kankan.xunlei.com:8000/search.json/mname=${e}`), k.information("querySubtitleByName response: ", n)
                    } catch (e) {
                        k.warning(e)
                    }
                    if (null !== n && void 0 !== n.status && 200 === n.status && void 0 !== n.data && null !== n.data) {
                        let e = n.data.sublist;
                        if (e && e.length >= 1) for (let n of e) if (n.scid) {
                            let e = {scid: "", surl: "", sname: "", language: "", path: "", rate: 0, status: 0};
                            e.scid = n.scid, e.surl = n.surl, e.sname = n.sname, e.language = n.language;
                            let a = parseInt(n.simility, 10), o = 0;
                            o = (a *= 100) < 15 ? 0 : a < 35 ? 1 : a < 55 ? 2 : a < 85 ? 3 : a < 92 ? 4 : 5, e.rate = o, (yield this.isAlreadyDownload(e.scid, t)) ? e.status = 1 : e.status = 0, e && i.push(e)
                        }
                    }
                    return i
                })
            }

            downloadSubtitle(e, t, i) {
                return n(this, void 0, void 0, function* () {
                    k.information("downloadSubtitle");
                    let n = e.surl, o = n.substring(n.lastIndexOf(".")),
                        r = i.substring(0, i.lastIndexOf(".")) + ".XLSUB" + o, s = this.getSaveDir(t);
                    k.information("downloadSubtitle fileName", r), k.information("downloadSubtitle filePath", s);
                    let l = a.join(s, r);
                    k.information("downloadSubtitle:", s, l);
                    let u = {
                        taskBaseInfo: {savePath: s, taskName: r},
                        p2spTaskInfo: {url: n, nameFixed: 1},
                        isBackground: !0
                    }, c = void 0, f = yield m.createTask(d.DownloadKernel.TaskType.P2sp, u);
                    return null !== f && (c = f.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskId), this.attachTaskStatusChangedEvent(c, e, t), h.DownloadDispatchNS.startTask(c)), c
                })
            }

            save(e) {
                return n(this, void 0, void 0, function* () {
                    k.information("save"), k.information(e);
                    let t = JSON.stringify(e, void 0, 2);
                    k.information("save jsonStr: ", t), yield r.FileSystemAWNS.writeFileAW(s, t)
                })
            }

            attachTaskStatusChangedEvent(e, i, o) {
                k.information("Sunbtitle taskId: ", e), k.information("item: ", i), void 0 !== this.taskStatusChangedEventTable[e] && null !== this.taskStatusChangedEventTable[e] || (this.taskStatusChangedEventTable[e] = y.attachTaskEvent(d.DownloadKernel.TaskEventType.StatusChanged, (...r) => n(this, void 0, void 0, function* () {
                    let n = !1;
                    do {
                        if (!r) {
                            k.information("args is null");
                            break
                        }
                        if (r[0] !== d.DownloadKernel.TaskEventType.StatusChanged) {
                            k.information("args[0] is not StatusChanged");
                            break
                        }
                        let s = r[1];
                        if (!s) {
                            k.information("taskList is null");
                            break
                        }
                        for (let r = 0; r < s.length; ++r) {
                            let l = s[r];
                            if (!l) continue;
                            if (l.getId() !== e) continue;
                            let u = l.getTaskStatus();
                            if (k.information("get status ", u), u === d.DownloadKernel.TaskStatus.Succeeded) {
                                k.information("send: channelMRDownloadSutitleSuc"), p.ipcRenderer.send(g.ThunderChannelList.channelMRDownloadSutitleSuc), this.fireEvent(t.DownloadSuccess, e, o, i);
                                let n = [];
                                k.information("subtitleData: ", this.subtitleData), k.information("befor has sutitleTaskId "), this.subtitleData[o] && (k.information("has sutitleTaskId ", e), n = this.subtitleData[o]), k.information("after has sutitleTaskId ");
                                let r = {scid: "", surl: "", sname: "", language: "", path: "", rate: 0, status: 0};
                                r.scid = i.scid, r.surl = i.surl, r.sname = l.getTaskName().replace(".XLSUB", ""), r.language = i.language, r.rate = i.rate, r.status = 1;
                                let s = this.getSaveDir(e), u = l.getTaskName();
                                r.path = a.join(s, u), n.push(r), this.subtitleData[o] = n, yield this.save(this.subtitleData), null !== this.taskStatusChangedEventTable[e] && void 0 !== this.taskStatusChangedEventTable[e] && (k.information("取消监听 ", this.taskStatusChangedEventTable[e]), y.detachTaskEvent(d.DownloadKernel.TaskEventType.StatusChanged, this.taskStatusChangedEventTable[e]), this.taskStatusChangedEventTable[e] = null)
                            } else u === d.DownloadKernel.TaskStatus.Failed && (k.information("send: channelMRDownloadSutitleFail"), p.ipcRenderer.send(g.ThunderChannelList.channelMRDownloadSutitleFail), this.fireEvent(t.DownloadFail, e, o, i), null !== this.taskStatusChangedEventTable[e] && void 0 !== this.taskStatusChangedEventTable[e] && (k.information("取消监听 ", this.taskStatusChangedEventTable[e]), y.detachTaskEvent(d.DownloadKernel.TaskEventType.StatusChanged, this.taskStatusChangedEventTable[e]), this.taskStatusChangedEventTable[e] = null));
                            n = !0
                        }
                    } while (0);
                    return n
                })))
            }

            getSaveDir(e) {
                k.information("getSaveDir");
                let t = "", i = m.getTaskFromTaskId(e), n = i.getTaskName(), o = i.getType();
                if (i && (t = i.getSavePath()), o === d.DownloadKernel.TaskType.Bt) {
                    i.getExtraObject().getFileCount() > 1 && (t = a.join(t, n))
                }
                return k.information("name and save dir: ", n, t), t
            }

            isAlreadyDownload(e, t) {
                return n(this, void 0, void 0, function* () {
                    k.information("isAlreadyDownload cid ", e);
                    let i = !1, n = this.subtitleData[t];
                    if (k.information("isAlreadyDownload subtitleList ", n), n && n.length >= 1) for (let t of n) if (t.scid === e) {
                        let e = t.path;
                        k.information("isAlreadyDownload fielPath ", e), (yield r.FileSystemAWNS.existsAW(e)) && (i = !0)
                    }
                    return k.information("isAlreadyDownload ret ", i), i
                })
            }
        }

        e.SubtitleManager = u;
        const c = new u;
        e.getSubtitleManger = function () {
            return c
        }, e.init = function () {
            return n(this, void 0, void 0, function* () {
                yield c.init()
            })
        }, e.attachListener = function (e, t) {
            c.attachListener(e, t)
        }, e.detachListener = function (e, t) {
            c.detachListener(e, t)
        }
    }(t.SubtitleManagerNS || (t.SubtitleManagerNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(12), o = i(2), r = i(6), s = i(72), l = i(14), d = i(13), u = i(5), c = i(38), h = i(3), f = i(59),
        g = i(36), p = i(30), v = i(55), m = i(9), y = i(0), k = i(535), T = i(34), w = i(11), C = i(20), S = i(319),
        b = y.default.getLogger("command_line"), I = w.DownloadKernelTaskManager.getTaskManager(),
        _ = r.default(o.join(__rootDir, "../bin/ThunderNewTask.node")),
        A = r.default(o.join(__rootDir, "../bin/ThunderHelper.node"));
    const D = new class {
        constructor() {
            this.readyToShow = !0, this.startArgs = ""
        }

        init() {
            return n(this, void 0, void 0, function* () {
                yield this.getReadyToShow(), _.setCommandLineCallback(e => {
                    if (b.information("on command ", e), this.readyToShow && this.needBringToTop(e) && this.bringMainWindowToTop().catch(), void 0 !== e && "" !== e.trim()) {
                        let t = l.ThunderUtil.parseCommandLine(e);
                        t.length > 0 && this.executeCmdLine(t).catch()
                    }
                })
            })
        }

        setStartArgs(e) {
            this.startArgs = e
        }

        getStartArgs() {
            return this.startArgs
        }

        onCommand(e, t, a) {
            return n(this, void 0, void 0, function* () {
                if (b.information(e, t), "path" === e) {
                    let e = o.extname(t);
                    ".torrent" === (e = e.toLowerCase()) ? (this.readyToShow && (yield this.bringMainWindowToTop()), a = "command" === a ? "Torrent" : a, this.ensureDkLoaded(e => n(this, void 0, void 0, function* () {
                        if (e) {
                            let e = yield f.TaskUtilitiesAWNS.parserBtFileInfoAW(t);
                            if (null === e) c.ThunderNewTask.createBtTaskWindow({
                                type: "file",
                                seedFile: t
                            }, {source: a}); else {
                                let i = JSON.stringify(e);
                                c.ThunderNewTask.createBtTaskWindow({data: i, type: "file", seedFile: t}, {source: a})
                            }
                        }
                    }))) : ".td" !== e && ".bc!" !== e && ".part" !== e && ".xltd" !== e || (a = "command" === a ? "TD" : a, this.ensureDkLoaded(e => {
                        e && g.TaskOperatorNs.importUncompletedFromFile(t, a)
                    }))
                } else if ("task" === e) {
                    if ("newtask" === t) {
                        let e = "button=create";
                        m.XLStatNS.trackEvent("client_quick", "taskbar_rk_click", "", 0, 0, 0, 0, e), m.XLStatNS.trackEvent("core_event", "create_task_click", "", 0, 0, 0, 0, "click_source=taskbar"), b.information("trackEvent", "core_event", "create_task_click", "click_source=taskbar"), c.ThunderNewTask.createPreNewTaskWindow(null)
                    } else if ("startall" === t) {
                        let e = "button=start";
                        m.XLStatNS.trackEvent("client_quick", "taskbar_rk_click", "", 0, 0, 0, 0, e), p.DownloadKernelManager.attachListener(d.NodeEventMesssageNS.eventDownloadKernelInitEnd, () => {
                            g.TaskOperatorNs.startAll()
                        })
                    } else if ("pauseall" === t) {
                        let e = "button=pause";
                        m.XLStatNS.trackEvent("client_quick", "taskbar_rk_click", "", 0, 0, 0, 0, e), g.TaskOperatorNs.pauseAll(h.DownloadKernel.TaskStopReason.PauseAll)
                    }
                } else if ("shell" === e) {
                    if ("exit" === t) {
                        let e = "button=exit";
                        m.XLStatNS.trackEvent("client_quick", "taskbar_rk_click", "", 0, 0, 0, 0, e), yield v.quitPromises.run()
                    }
                } else if ("speedMode" === e) ; else if ("unionfile" === e) {
                    let e = t;
                    c.ThunderNewTask.createUnionTask(e).catch()
                } else if ("-autotestinjectfile" === e && (yield u.FileSystemAWNS.existsAW(t))) {
                    let e = require(t);
                    const {DownloadKernelTestNS: n} = yield Promise.resolve().then(() => i(536));
                    e.init(n)
                }
            })
        }

        bringMainWindowToTop() {
            return n(this, void 0, void 0, function* () {
                if (this.readyToShow) {
                    let e = yield a.asyncRemoteCall.getCurrentWindow();
                    null !== e && ((yield e.isMinimized()) && e.restore(), yield T.ToolsUtilitiesAWNS.setForegroundWindow(A, e), (yield e.isVisible()) ? e.focus() : e.show())
                }
            })
        }

        getReadyToShow() {
            return n(this, void 0, void 0, function* () {
                let e = yield a.asyncRemoteCall.getCurrentWindow();
                e.once("show", () => {
                    this.readyToShow = !0
                }), e.on("ready-to-show", () => {
                    this.readyToShow = !0
                }), (yield e.isVisible()) && (this.readyToShow = !0)
            })
        }

        ensureDkLoaded(e) {
            I.isDkLoaded() ? e(!0) : p.DownloadKernelManager.attachListener(d.NodeEventMesssageNS.eventDownloadKernelInitEnd, t => {
                e(0 === t)
            })
        }

        needBringToTop(e) {
            let t = !1;
            do {
                if (void 0 === e || null === e) break;
                if (-1 !== e.indexOf("-window:bringtotop")) {
                    t = !0;
                    break
                }
            } while (0);
            return t
        }

        executeCmdLine(e) {
            return n(this, void 0, void 0, function* () {
                let t = !1, i = void 0;
                for (let n = 0; n < e.length; ++n) e[n] && (e[n].indexOf("play:true") > -1 ? t = !0 : e[n].indexOf("unionfile") > -1 && (i = e[n]));
                if (t && i) return void (yield S.DownloadAndPlayUnionNS.createUnionPlayTasks(i, t));
                let n = {};
                for (let t of e) {
                    if ("" === t) continue;
                    let i = "", a = "";
                    if (yield u.FileSystemAWNS.existsAW(t)) i = "path", a = t; else if (s.URLHelperNS.isSupportUrl(t)) i = "url", a = t; else {
                        let e = t.indexOf(":");
                        -1 === e ? i = t : e > 1 && (i = t.substring(1, e), e !== t.length - 1 && (a = t.substring(e + 1)))
                    }
                    this.onCommand(i, a, "command").catch(), k.default.fireEvent(d.NodeEventMesssageNS.eventOnCommand, e), n[i] = a
                }
                C.server.fireClientEvent(d.NodeEventMesssageNS.eventOnCommandline, n)
            })
        }
    };
    t.default = D
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(17), o = i(19), r = i(7), s = i(0), l = i(326), d = i(3), u = i(13), c = i(27), h = i(83), f = i(28),
        g = "vip-download", p = "ThunderPanPlugin", v = [g, p], m = s.default.getLogger("plugin-ui-webview");

    class y extends o.EventEmitter {
        constructor() {
            super(), this.vipPluginEnable = !1, this.activeTasks = [], this.activeContainerMap = {}, this.webviewCreatedMap = {}, this.isSorting = !1
        }

        isVipPluginEnable() {
            return this.vipPluginEnable
        }

        setSorting(e) {
            this.isSorting = e
        }

        getActiveTaskId() {
            let e = void 0;
            do {
                let t = this.activeTasks.length;
                if (0 === t) break;
                if (e = this.activeTasks[t - 1], !this.activeContainerMap[e]) {
                    e = void 0;
                    break
                }
            } while (0);
            return e
        }

        showTaskAdWebview(e, t) {
            do {
                if (!this.vipPluginEnable) break;
                this.activeContainerMap[e] ? (m.information("webview alreay in map", e, this.activeTasks, this.activeContainerMap), this.show()) : (this.activeTasks.push(e), this.activeContainerMap[e] = t, this.show())
            } while (0)
        }

        show() {
            do {
                if (this.isSorting) break;
                let e = this.activeTasks.length;
                if (0 === e) break;
                let t = this.activeTasks[e - 1], i = this.activeContainerMap[t];
                if (!i) break;
                if (!i.isShowExpand) break;
                this.updateTaskAdWebview(), document.querySelector(`#webview_${g}`).parentElement.style.opacity = "1"
            } while (0)
        }

        updateTaskAdWebview() {
            do {
                if (this.isSorting) break;
                let e = this.activeTasks.length;
                if (0 === e) break;
                let t = this.activeTasks[e - 1], i = this.activeContainerMap[t];
                if (!i) break;
                if (!i.isShowExpand) break;
                let n = document.querySelector(`#webview_${g}`), a = n.parentElement, o = a.parentElement,
                    r = i.$el.parentElement.parentElement.getBoundingClientRect(), s = r.top,
                    l = document.querySelector(".td-collapse,.xly-side"), d = r.height;
                void 0 !== l && null !== l && (d = -1 === i.currentCategoryId ? l.clientHeight - 90 : l.clientHeight - 70);
                let u = `position:absolute;left: 0px;top: ${s - 42}px;\n        width: ${r.width}px;height: ${d}px; overflow:hidden;`;
                o.style = u;
                let c = i.$refs.pluginPlaceholder, h = c.getBoundingClientRect(),
                    f = `position:absolute;left: ${c.offsetLeft}px; top: ${h.top - s + 10}px;\n      width: ${h.width}px; height: 28px; z-index: 1;`;
                a.style = f;
                {
                    let e = n.shadowRoot.childElementCount;
                    for (let t = 0; t < e; t++) {
                        let e = n.shadowRoot.children[t];
                        if ("application/browser-plugin" === e.type.toLowerCase()) {
                            e.style = "width: 284px; height: 100%;";
                            break
                        }
                    }
                }
                m.information("show webview", h, f)
            } while (0)
        }

        hideTaskAdWebview(e) {
            do {
                if (!this.vipPluginEnable) break;
                let t = "-10000px",
                    i = `position:absolute;left: ${t};top: 142px;width: 540px;height: 28px; z-index=1; opacity:0;`;
                if (void 0 === e) {
                    let e = document.querySelector(`#webview_${g}`).parentElement;
                    e.style.left !== t && (e.style = i);
                    break
                }
                if (0 === this.activeTasks.length) break;
                let n = this.activeTasks.indexOf(e);
                if (delete this.activeContainerMap[e], -1 !== n && this.activeTasks.splice(n, 1), document.querySelector(`#webview_${g}`).parentElement.style.left === t) break;
                if (m.information("active hide", this.activeTasks.length, e, this.activeTasks), 0 === this.activeTasks.length) {
                    document.querySelector(`#webview_${g}`).parentElement.style = i
                }
            } while (0)
        }

        create(e, t, i) {
            let n = [!1, ""];
            switch (-1 === v.indexOf(t) && (n = [!1, `support for ${t} will coming soon`]), t) {
                case g:
                    n = e.name === g ? this.createTaskAdWebview(t, i) : [!1, "the client can not create this webview"];
                    break;
                case p:
                    e.name === p ? (n = this.createPanWebview(t, i), this.emit("create_pan_tab")) : n = [!1, "the client can not create this webview"]
            }
            return m.information("create webview", n), n
        }

        attachDownloadItemActiveChange() {
            c.default.attachListener(u.NodeEventMesssageNS.eventDownloadItemActive, (e, t, i, n, a, o) => {
                if (e === d.DownloadKernel.CategroyViewID.Downloading) if (t) {
                    let e = n.__vue__;
                    e && e.$nextTick(() => {
                        this.showTaskAdWebview(i, e)
                    })
                } else this.hideTaskAdWebview(i)
            })
        }

        createTaskAdWebview(e, t) {
            let i = [!1, ""];
            do {
                let o = `webview_${g}`;
                if (document.querySelector(`#${o}`)) {
                    i = this.webviewCreatedMap[o] === e ? [!0, "success"] : [!1, `webview already created by other ${this.webviewCreatedMap[o]}`];
                    break
                }
                let r = document.createElement("webview");
                t.nodeintegration && (r.nodeintegration = t.nodeintegration), r.id = o, r.style = "height: 100%; width: 100%;", r.src = t.src, r.preload = `file:///${__rootDir}/out/plugin-boot.js`, r.addEventListener("did-finish-load", () => {
                    let e = r.getWebContents();
                    if (e && !e.isDestroyed()) {
                        let t = e.getOSProcessId(), i = e.getURL();
                        a.ipcRenderer.send(f.ThunderChannelList.channelRMSetEnvironmentVariable, t.toString(), i), e.once("destroyed", () => {
                            a.ipcRenderer.send(f.ThunderChannelList.channelRMSetEnvironmentVariable, t.toString())
                        })
                    }
                }), document.querySelector("#webview_container").appendChild(r), i = [!0, "success"], this.webviewCreatedMap[o] = e, r.addEventListener("dom-ready", e => {
                    this.vipPluginEnable = !0, this.emit("vip_plugin_enable", this.vipPluginEnable)
                }), this.attachDownloadItemActiveChange(), window.addEventListener("keyup", e => n(this, void 0, void 0, function* () {
                    "F12" === e.key && e.altKey && (yield h.DevEnvHelperNS.isDevToolsEnable()) && r && r.openDevTools()
                }), !0)
            } while (0);
            return i
        }

        createPanWebview(e, t) {
            let o = [!1, ""];
            do {
                let s = `webview_${t.id}`;
                if (s || (s = `webview_${p}`), document.querySelector(`#${s}`)) {
                    o = this.webviewCreatedMap[s] === e ? [!0, "success"] : [!1, `webview already created by other ${this.webviewCreatedMap[s]}`];
                    break
                }
                let d = document.createElement("webview");
                t.nodeintegration && (d.nodeintegration = t.nodeintegration), "development" !== process.env.RUN_ENV && (d.disablewebsecurity = "disablewebsecurity"), d.id = s, d.style = "height: 100%; width: 100%;", d.src = t.src, d.preload = `file:///${__rootDir}/out/plugin-boot.js`, d.addEventListener("did-finish-load", () => {
                    let e = d.getWebContents();
                    if (e && !e.isDestroyed()) {
                        let t = e.getOSProcessId(), i = e.getURL();
                        a.ipcRenderer.send(f.ThunderChannelList.channelRMSetEnvironmentVariable, t.toString(), i), e.once("destroyed", () => {
                            a.ipcRenderer.send(f.ThunderChannelList.channelRMSetEnvironmentVariable, t.toString())
                        })
                    }
                }), document.querySelector("#pan-18BE0BEB-6C82-4D16-83C8-5566BE72D176").appendChild(d), o = [!0, "success"], this.webviewCreatedMap[s] = e, d.addEventListener("dom-ready", e => {
                    let t = d.getWebContents();
                    t && t.on("context-menu", (e, t) => {
                        l.ContextMenuNS.popContextMenu(e, t)
                    })
                }), d.addEventListener("new-window", e => {
                    let t = e.url;
                    const n = i(44).parse(t).protocol;
                    "http:" !== n && "https:" !== n || r.client.callServerFunction("openNewTab", t).catch()
                }), window.addEventListener("keyup", e => n(this, void 0, void 0, function* () {
                    "F12" === e.key && e.shiftKey && (yield h.DevEnvHelperNS.isDevToolsEnable()) && d && d.openDevTools()
                }), !0), window.addEventListener("resize", () => {
                })
            } while (0);
            return o
        }
    }

    t.PluginWebviewMgr = y, function (e) {
        const t = new y;
        e.getWebViewMgr = function () {
            return t
        }
    }(t.PluginWebviewMgrNS || (t.PluginWebviewMgrNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        let t;
        !function (e) {
            e[e.Default = 0] = "Default", e[e.Color = 1] = "Color", e[e.Wallpaper = 2] = "Wallpaper", e[e.Custom = 3] = "Custom", e[e.Cool = 4] = "Cool"
        }(t = e.SkinType || (e.SkinType = {})), e.defaultSkinInfo = {type: t.Default, colorID: 0}
    }(t.SkinHelperNS || (t.SkinHelperNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(0), o = i(134), r = i(447), s = i(331), l = i(25), d = i(448),
        u = s.MsgQueueManagerNS.MsgQueue.getInstance().getQueue("notification"),
        c = a.default.getLogger("NotificationHelper");
    !function (e) {
        function t(e) {
            return !e.type || e.type !== o.Notification.TipsType.DownloadComplete && e.type !== o.Notification.TipsType.DownloadFail && e.type !== o.Notification.TipsType.ConsumptionTips && e.type !== o.Notification.TipsType.CommunityTips
        }

        function i(e, t) {
            r.NotificationNS.getCurrentWindow() ? u.getCurrentProperty() < e.priority ? (a(e, t), r.NotificationNS.close().catch()) : e.noDelay || a(e, t) : (a(e, t), u.deQueue())
        }

        function a(e, i) {
            if (t(e)) {
                let e = (new Date).getTime();
                d.MemoryConfigNS.setValue("ad", "adTipsLastPopupTime", e), c.information("enQueueNotification, adTipsLastPopupTime:", e)
            }
            u.enQueue({
                callback: () => n(this, void 0, void 0, function* () {
                    r.NotificationNS.notify(e, i).catch()
                }), name: e.name, priority: e.priority
            })
        }

        e.notify = function e(n, a) {
            do {
                if (c.information("notify options:", n), n.priority = n.priority || 0, t(n)) {
                    let t = l.default.getConfigInfo("ad", "adTipsPopupMode"),
                        i = d.MemoryConfigNS.getValue("ad", "adTipsLastPopupTime", 0);
                    if ("single" === t) {
                        if (i) {
                            c.information("adTipsPopupMode single, adTipsLastPopupTime:", i);
                            break
                        }
                    } else if ("interval" === t) {
                        let t = l.default.getConfigInfo("ad", "adTipsInterval");
                        if (t) {
                            let o = (new Date).getTime();
                            if (o - i < 60 * t * 1e3) {
                                c.information("adTipsPopupMode interval, adTipsLastPopupTime:", i, "currentTime:", o, "interval:", t), setTimeout(() => {
                                    e(n, a)
                                }, 60 * t * 1e3 - (o - i) + 1e3);
                                break
                            }
                        }
                    }
                }
                i(n, a)
            } while (0)
        }, e.clearNotificationsByName = function (e) {
            u.clearQueuesByName(e)
        }
    }(t.NotificationHelper || (t.NotificationHelper = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        let t;
        !function (e) {
            e.DownloadComplete = "DownloadComplete", e.DownloadFail = "DownloadFail", e.ConsumptionTips = "ConsumptionTips", e.CommunityTips = "CommunityTips", e.AdvertisementTips = "AdvertisementTips", e.AdvertisementWebPageTips = "AdvertisementWebPageTips"
        }(t = e.TipsType || (e.TipsType = {}))
    }(t.Notification || (t.Notification = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(7);
    !function (e) {
        e.getValue = function (e, t, i) {
            return n(this, void 0, void 0, function* () {
                return yield a.client.callServerFunction("GetConfigValue", e, t, i)
            })
        }, e.setValue = function (e, t, i) {
            return n(this, void 0, void 0, function* () {
                yield a.client.callServerFunction("SetConfigValue", e, t, i)
            })
        }
    }(t.ConfigHelperNS || (t.ConfigHelperNS = {}))
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(366), a = i(270);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\common\\generator-view\\conf-component\\conf-button.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(369), a = i(278);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\common\\generator-view\\conf-component\\conf-input.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(370), a = i(284);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\common\\generator-view\\conf-component\\conf-text.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(5), r = i(63), s = i(58), l = i(134), d = i(133), u = i(9), c = i(14), h = i(6), f = i(448),
        g = h.default(a.join(__rootDir, "../bin/ThunderHelper.node"));
    var p, v;
    !function (e) {
        e.Market = "Market", e.Functional = "Functional", e.WebPage = "WebPage"
    }(p = t.OrderType || (t.OrderType = {})), function (e) {
        e[e.TextButton = 1] = "TextButton", e[e.SmallImageButton = 2] = "SmallImageButton", e[e.BigImageButton = 3] = "BigImageButton", e[e.Image = 4] = "Image", e[e.Flash = 5] = "Flash"
    }(v = t.StyleType || (t.StyleType = {}));
    t.AdTips = class {
    }
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(141), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(8), o = i(574), r = i(602);
    let s = class extends a.Vue {
    };
    s = n([a.Component({components: {MainLeft: o.default, MainBody: r.default}})], s), t.default = s
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(143), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(575), a = i(33);
    t.default = a.connector.connect({
        mapCommitToProps: {selectNav: "SELECT_NAV"},
        mapGettersToProps: {curNav: e => e.currentNav, navList: e => e.navList}
    })(n.default)
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(145), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(8), o = i(576), r = i(585), s = i(7);
    let l = class extends a.Vue {
        constructor() {
            super(...arguments), this.dragable = !0, this.curUserHeader = ""
        }

        select(e) {
            this.selectNav(e), s.client.callServerFunction("CloseSettingCenter")
        }
    };
    n([a.Prop({})], l.prototype, "curNav", void 0), n([a.Prop({})], l.prototype, "navList", void 0), n([a.Prop({})], l.prototype, "selectNav", void 0), l = n([a.Component({
        components: {
            LoginArea: o.default,
            SystemButtons: r.default
        }
    })], l), t.default = l
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(147), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(17), r = i(8), s = i(2), l = i(16), d = i(34), u = i(24), c = i(0), h = i(9), f = i(14), g = i(6),
        p = i(577), v = i(579), m = i(20), y = i(96), k = i(330), T = i(332), w = i(7), C = i(413);
    let {isDef: S} = f.ThunderUtil;
    const b = g.default(s.join(__rootDir, "../bin/ThunderHelper.node")), I = i(584),
        _ = c.default.getLogger("login-area");
    let A = class extends r.Vue {
        constructor() {
            super(...arguments), this.vipRenewEnable = !1, this.imgSrc = "", this.title = "", this.overflow = !1, this.overFlowPath = `${__rootDir}/static/transparent-img.png`, this.userNick = "", this.curLoginStatus = "unlogin", this.oldLoginStatus = "unlogin", this.isLogin = !1, this.isShowPersonalInfoWnd = !1, this.curUserid = "", this.isVip = 0, this.isYear = 0, this.vipLevel = 0, this.vipType = 2, this.headerUrl = "", this.curLoginHeaderUrl = "", this.yearIcon = "vip-icon-nian is-large is-disabled", this.rectDatas = "", this.bShowUserInfoPanle = !1, this.yearTipsText = "", this.strOpenVip = "", this.isShowYearTip = !1, this.isCanShowOpenVipBtn = !1, this.isShowVipPluginBtn = !1, this.isCanShowXufeiBtn = !1, this.curIconUrl = null, this.curIconText = "", this.cashTipTrigger = null, this.promptData = null, this.promptTextClicked = !1, this.personalInfoWnd = null, this.nVipGrow = 0, this.vipData = null, this.syncMsgEventId = void 0, this.syncMsgState = T.SyncMsgHelperNS.SyncMsgState.Connected, this.syncMsgOnceTimerID = null, this.eventHoverWindowReadyToShow = -1
        }

        onLoginChange(e) {
            return a(this, void 0, void 0, function* () {
                e ? this.syncMsgOnceTimerID = setTimeout(() => a(this, void 0, void 0, function* () {
                    (yield T.SyncMsgHelperNS.checkSyncMsg()) ? (this.syncMsgEventId = T.SyncMsgHelperNS.attachSyncMsgStateChangeEvent((e, t) => a(this, void 0, void 0, function* () {
                        this.syncMsgState = e
                    })), this.syncMsgState = T.SyncMsgHelperNS.getSyncMsgState()) : this.syncMsgState = T.SyncMsgHelperNS.SyncMsgState.Error
                }), 15e3) : (this.syncMsgOnceTimerID && (clearTimeout(this.syncMsgOnceTimerID), this.syncMsgOnceTimerID = null), this.syncMsgEventId && (T.SyncMsgHelperNS.detachSyncMsgStateChangeEvent(this.syncMsgEventId), this.syncMsgEventId = void 0))
            })
        }

        onHeaderChange(e, t) {
            _.information("curLoginHeaderUrl cur=", e, ";old=", t)
        }

        onVipButtonShow() {
            if (!this.vipRenewEnable) return;
            let e = this.$refs.userNick.clientWidth, t = !1;
            do {
                if (!this.vipButtonShow) break;
                if (!this.vipIconShow) break;
                if (e <= 126) break;
                t = !0
            } while (0);
            _.information("vip renew ", this.vipIconShow, e, t), this.overflow = t
        }

        get vipIconShow() {
            return this.isLogin && !this.isCanShowOpenVipBtn
        }

        get toolTipTitle() {
            let e = "您有代金券可使用";
            do {
                if (!this.vipRenewEnable) break;
                e = this.title
            } while (0);
            return e
        }

        get tooltipTrigger() {
            let e = null;
            do {
                if (!this.vipRenewEnable) {
                    e = this.cashTipTrigger;
                    break
                }
                if (!this.title) break;
                e = "hover"
            } while (0);
            return e
        }

        get vipButtonShow() {
            return "online" === this.curLoginStatus && (this.isShowVipPluginBtn || this.isCanShowOpenVipBtn || this.isCanShowXufeiBtn)
        }

        get strNickCss() {
            let e = "";
            return this.isLogin && 0 !== this.isVip && (e = "is-vip"), e
        }

        get userYearIcon() {
            return 0 !== this.isYear && 0 !== this.isVip ? (this.yearIcon = "vip-icon-nian", this.yearTipsText = "迅雷年费会员", this.strOpenVip = "") : (this.yearIcon = "vip-icon-nian is-disabled", this.yearTipsText = "年费会员享更低价格 更高特权", this.strOpenVip = "开通会员"), this.yearIcon
        }

        get strIsOffline() {
            let e = "";
            return "offline" === this.curLoginStatus && (e = "is-offline"), _.information("strIsOffline:", e), e
        }

        get showInfoIcon() {
            return this.isLogin && (this.syncMsgState === T.SyncMsgHelperNS.SyncMsgState.Close || this.syncMsgState === T.SyncMsgHelperNS.SyncMsgState.Error)
        }

        get showRestoreIcon() {
            return this.isLogin && this.syncMsgState === T.SyncMsgHelperNS.SyncMsgState.Connecting
        }

        closePersonalInfoWnd() {
            null !== this.personalInfoWnd && (this.personalInfoWnd.isDestroyed() || this.personalInfoWnd.close(), this.personalInfoWnd = null)
        }

        setDefaultHeader() {
            _.information("setDefaultHeader"), this.curLoginHeaderUrl = ""
        }

        setDefaultIcon() {
            _.information("setDefaultIcon"), this.curIconUrl = I
        }

        showPersonalInfoWnd(e) {
            return a(this, void 0, void 0, function* () {
                let t = this.getClientRectsEx(), i = this.isLoginInfoRect(t);
                if (_.information("datastr", t, i), t = JSON.stringify({
                    width: 100,
                    height: JSON.parse(t).height
                }), i && (this.personalInfoWnd = yield u.LoginHelperNS.loginUIHelper.createPersonalInfoWnd(e, t), null !== this.personalInfoWnd)) {
                    let e = () => {
                        t = this.getClientRectsEx(), (i = this.isLoginInfoRect(t)) ? (null != this.personalInfoWnd && (this.personalInfoWnd.show(), d.ToolsUtilitiesAWNS.setForegroundWindow(b, this.personalInfoWnd)), this.isLogin && this.stat("userinfo_show")) : this.closePersonalInfoWnd(), w.client.detachServerEvent(C.ThunderEvent.hoverWindowReadyToShow, this.eventHoverWindowReadyToShow)
                    };
                    this.personalInfoWnd.once("ready-to-show", () => {
                        e()
                    }), this.eventHoverWindowReadyToShow = w.client.attachServerEvent(C.ThunderEvent.hoverWindowReadyToShow, () => {
                        e()
                    }), this.personalInfoWnd.once("closed", () => {
                        this.personalInfoWnd = null
                    })
                }
            })
        }

        onPromptTitleShow(e) {
            if (_.information("onPromptTitleShow", e), e) {
                let e = "";
                e = "is_ad=1";
                let t = encodeURIComponent(e);
                _.information(e, t), h.XLStatNS.trackEvent("clienttop", "nolog_head_nickname_show", "", 0, 0, 0, 0, t)
            }
        }

        onToolYearTip(e) {
            if (e) {
                if (this.$emit("tooltip-show"), "开通会员" === this.strOpenVip) {
                    let e = "";
                    e = "is_vip=" + this.isVip + ",vip_type=" + this.vipType, 0 === this.isVip && 0 === this.nVipGrow ? e += ",show_type=1" : 0 === this.isVip && 0 !== this.nVipGrow && (e += ",show_type=2");
                    let t = encodeURIComponent(e);
                    _.information(e, t), h.XLStatNS.trackEvent("clienttop", "xufei_botton_show", "", 0, 0, 0, 0, t)
                }
            } else this.$emit("tooltip-hide");
            this.isShowYearTip = e
        }

        onIconClick() {
            v.VipRenewIconManagerNS.getIconManager().onIconClick()
        }

        onRenewClick() {
            this.vipBtnClick && this.vipBtnClick()
        }

        getClientRectsEx() {
            let e = null, t = 60, i = 110;
            S(this.$refs.userAvatar) && null !== (e = this.$refs.userAvatar.$el.getClientRects()) && void 0 !== e && e.length > 0 && null !== e[0] && void 0 !== e[0] && (t = e[0].left, i = e[0].right);
            let n = i - t + 5, a = n;
            return JSON.stringify({width: n, height: a})
        }

        isLoginInfoRect(e) {
            let t = !1;
            do {
                let i = o.screen.getCursorScreenPoint(), n = null;
                try {
                    n = JSON.parse(e)
                } catch (e) {
                    _.warning(e)
                }
                if (null === n) break;
                let a = o.remote.getCurrentWindow().getBounds(), r = a.x + 26, s = a.y + 60,
                    l = a.x + 26 + Number(n.width), d = a.y + 60 + Number(n.height);
                i.x >= r && i.x <= l && i.y >= s && i.y <= d && (t = !0)
            } while (0);
            return t
        }

        getUserAvatarRect() {
            let e = o.remote.getCurrentWindow().getBounds(), t = this.$refs.userAvatar.getClientRects(),
                i = e.x + t[0].left, n = e.y + t[0].top, a = t[0].right - t[0].left, r = t[0].bottom - t[0].top;
            return JSON.stringify({x: i, y: n, width: a, height: r})
        }

        enter(e) {
            if (_.information("enter:", e, this.isLogin, this.curLoginStatus, this.personalInfoWnd), "offline" !== this.curLoginStatus && null === this.personalInfoWnd) this.showPersonalInfoWnd(e).catch(); else if ("offline" === this.curLoginStatus && "head" === e) {
                let e = this.getUserAvatarRect();
                this.closePersonalInfoWnd(), u.LoginHelperNS.loginUIHelper.createRetryLoginWnd("userAvatar", e)
            }
        }

        clickPromptTitle(e) {
            if (_.information("点击促销文案", this.promptData.title), _.information("islogin", this.isLogin), _.information("curLoginStatus", this.curLoginStatus), !this.isLogin) {
                let t = `button=${e}`;
                t += ",is_ad=1", _.information("extData", t);
                let i = encodeURIComponent(t);
                _.information(t, i), h.XLStatNS.trackEvent("clienttop", "nolog_head_nickname_click", "", 0, 0, 0, 0, i), this.promptTextClicked = !0, _.information("this.curLoginHeaderUrl", this.curLoginHeaderUrl), u.LoginHelperNS.loginHelper.showLoginDlg("clienthead", !0), _.information("this.curLoginHeaderUrl", this.curLoginHeaderUrl)
            }
        }

        clickUserHeader(e) {
            if (_.information("点击登录", this.curLoginStatus), this.isLogin && "online" === this.curLoginStatus) {
                let t = "http://pc.xunlei.com/d#/users/" + this.curUserid + "?entrypage=client_leftright_login&entry=client_leftright_login_head";
                w.client.callServerFunction("OpenNewTab", t);
                let i = `button=${e}`;
                i = i + ",is_vip=" + this.isVip + ",vip_type=" + this.vipType + ",referfrom=v_pc_xlx_ggong_head_nickname";
                let n = encodeURIComponent(i);
                _.information(i, n), h.XLStatNS.trackEvent("clienttop", "head_nickname_click", "", 0, 0, 0, 0, n)
            } else "unlogin" === this.curLoginStatus && u.LoginHelperNS.loginHelper.showLoginDlg("clienthead", !0);
            let t = `button=${e}`, i = "no";
            this.isLogin && (i = "yes"), t = `${t},is_login=${i}`, !this.isLogin && this.promptData && this.clickPromptTitle("head"), h.XLStatNS.trackEvent("clienttop", "clienttop_userinfo_click", "", 0, 0, 0, 0, t)
        }

        onClick(e) {
            let t = "", i = "", n = "";
            if ("nian" === e ? (t = "https://vip.xunlei.com/vip_service/year/?referfrom=v_pc_xlx_ggong_yearicon", i = "nf_icon_click", n = "v_pc_xlx_ggong_yearicon") : "vip" === e ? (t = 0 !== this.isVip ? "https://vip.xunlei.com/vip_service/rule/?referfrom=v_pc_xlx_ggong_vipicon" : "https://pay.xunlei.com/pay.html?bizNo=baijin?referfrom=v_pc_xlx_ggong_vipicon", i = "vip_icon_click", n = "v_pc_xlx_ggong_vipicon") : "nian_tip" === e ? (this.isShowYearTip = !1, t = "https://vip.xunlei.com/vip_service/year/?referfrom=v_pc_xlx_ggong_pay_top", i = "xufei_botton_click", n = "v_pc_xlx_ggong_pay_top") : "vip-center" === e && (t = "https://vip.xunlei.com/", i = "vip_center_click", n = "v_pc_xlx_ggong_vipcenter"), "" !== t) {
                w.client.callServerFunction("OpenNewTab", t);
                let a = "";
                a = "is_vip=" + this.isVip + ",vip_type=" + this.vipType + ",referfrom=" + n, "vip" === e ? 0 === this.isVip && 0 === this.nVipGrow ? a += ",show_type=1,aidfrom=ktnovip" : 0 === this.isVip && 0 !== this.nVipGrow && (a += ",show_type=2,aidfrom=ktnovip1") : "nian_tip" === e && (0 === this.isVip && 0 === this.nVipGrow ? a += ",show_type=1,aidfrom=xfbtn_exp7_kt" : 0 === this.isVip && 0 !== this.nVipGrow && (a += ",show_type=2,aidfrom=xfbtn_exp7_kt"));
                let o = encodeURIComponent(a);
                _.information(e, a, o), h.XLStatNS.trackEvent("clienttop", i, "", 0, 0, 0, 0, o)
            }
        }

        switchAccount() {
            this.isLogin = !1, this.curUserid = "", this.curLoginStatus = "unlogin", this.userNick = "", this.curLoginHeaderUrl = "", this.rectDatas = "", this.updateLoginStatus(), u.LoginHelperNS.loginHelper.switchAccount("changeaccount")
        }

        personalCenter() {
            w.client.callServerFunction("OpenNewTab", "http://i.xunlei.com/login.html")
        }

        updateLoginStatus() {
            if (_.information(this.oldLoginStatus, this.curLoginStatus), this.oldLoginStatus === this.curLoginStatus) ; else {
                let e = this.oldLoginStatus;
                this.oldLoginStatus = this.curLoginStatus, l.NativeCallModule.nativeCall.CallNativeFunction("NativeFireEvent", "onLoginStatusChange", e, this.curLoginStatus, function (e) {
                }), m.server.fireClientEvent("onLoginStatusChange", e, this.curLoginStatus), m.server.fireClientEvent("OnLoginStatusChange", e, this.curLoginStatus)
            }
            this.checkPromptState()
        }

        updateUserInfo(e) {
            return a(this, void 0, void 0, function* () {
                return new Promise(t => {
                    u.LoginHelperNS.loginHelper.getAllUserInfo(i => a(this, void 0, void 0, function* () {
                        do {
                            if (_.information("收到 getAllUserInfo 返回数据 userInfo:", i), null === i || void 0 === i) {
                                _.information("getAllUserInfo 得到数据是 null");
                                break
                            }
                            "login" === e && (this.isLogin = !0, this.curLoginStatus = "online", this.updateLoginStatus()), this.curUserid = i.userID, this.userNick = f.ThunderUtil.unescapeHTML(i.nickName), this.rectDatas = "", "login" === e && h.XLStatNS.setUserID(Number(this.curUserid));
                            let t = i.imgURL;
                            t = null === t || void 0 === t || "" === t ? "" : t.replace("%s", "100x100"), this.headerUrl = t;
                            let n = yield u.LoginHelperNS.loginHelper.updateHeaderAw(this.headerUrl, this.curUserid);
                            if ("online" === this.curLoginStatus && null !== n && void 0 !== n && "" !== n && (this.curLoginHeaderUrl = n), null === i.vipList || void 0 === i.vipList) break;
                            if (null === i.vipList[0] || void 0 === i.vipList[0]) break;
                            let a = i.vipList[0];
                            a.isYear = 1;
                            if (a.isVip == 0) {
                                a.vipLevel = 10;
                                a.isVip = 1;
                                a.vasType = 5;
                            }
                            if (this.vipData = [{
                                VIPLevel: a.vipLevel,
                                isVIP: a.isVip,
                                isYear: a.isYear,
                                uid: i.userID,
                                vasID: 2,
                                vasType: a.vasType
                            }], "update" === e) {
                                let e = {isVip: Number(a.isVip), vasType: Number(a.vasType), expireDate: a.expireDate};
                                v.VipRenewIconManagerNS.getIconManager().updateUserVipData(e)
                            }
                            this.isYear = Number(a.isYear), this.isVip = Number(a.isVip), this.vipLevel = Number(a.vipLevel), this.vipType = Number(a.vasType), "" !== a.vipGrow && (this.nVipGrow = Number(a.vipGrow))
                        } while (0);
                        t()
                    }))
                })
            })
        }

        setChangeData(e, t) {
            if (_.information("onLoginFailed:getCurInternetState: setChangeData: ", e, t), 0 === e && 2 === t) {
                this.isLogin = !1, this.curLoginStatus = "offline", this.updateLoginStatus();
                let e = this.getUserAvatarRect();
                this.closePersonalInfoWnd(), u.LoginHelperNS.loginUIHelper.createRetryLoginWnd("userAvatar", e)
            } else this.isLogin = !1, this.curLoginStatus = "unlogin", this.userNick = "", this.rectDatas = "", this.curLoginHeaderUrl = "", this.updateLoginStatus()
        }

        checkPromptState() {
            if (_.information("islogin", this.isLogin, "currentloginstatus", this.curLoginStatus, "nickname", this.userNick), this.isLogin || "unlogin" !== this.curLoginStatus) "online" === this.curLoginStatus && (this.promptData = null); else {
                let e = p.LoginPromptManagerNS.getPromptData();
                e && (null != this.promptData && this.promptData.id === e.id || this.onPromptTitleShow(!0), this.promptData = e, this.curLoginHeaderUrl = this.promptData.imgLocalPath, _.information("prompt data", this.promptData))
            }
        }

        stat(e) {
            let t = `is_login=${this.isLogin ? 1 : 0},is_vip=${this.isVip}`;
            _.information(e, t), h.XLStatNS.trackEvent("user_info", e, "", 0, 0, 0, 0, t)
        }

        pingThroughXLUserServer() {
            return a(this, void 0, void 0, function* () {
                try {
                    const e = yield i(18);
                    return e.defaults.adapter = i(21), e.request({
                        method: "options",
                        url: "https://xluser-ssl.xunlei.com/xluser.core.login"
                    }).then(e => !!(e && e.status >= 200 && e.status <= 300)).catch(e => !1)
                } catch (e) {
                    return !1
                }
            })
        }

        updateVipRenew(e) {
            do {
                if (!this.vipRenewEnable) break;
                if (!e) break;
                void 0 !== e.title && (this.title = e.title), e.imgSrc && (this.imgSrc = e.imgSrc), e.onClick && (this.vipBtnClick = e.onClick), void 0 !== e.isVisible && (this.isShowVipPluginBtn = e.isVisible, this.isShowVipPluginBtn ? void 0 !== e.buttonType && ("kt" === e.buttonType ? this.isCanShowOpenVipBtn = !0 : this.isCanShowOpenVipBtn = !1) : (this.isCanShowOpenVipBtn = !1, this.isCanShowXufeiBtn = !1))
            } while (0)
        }

        getSyncMsgState() {
            return this.syncMsgState
        }

        mounted() {
            let e = {GetSyncMsgState: this.getSyncMsgState.bind(this)};
            m.server.registerFunctions(e), k.VipPluginSwitchConfigNS.getVipRenewButtonEnable().then(e => a(this, void 0, void 0, function* () {
                if (1 !== e) {
                    let e = v.VipRenewIconManagerNS.getIconManager();
                    e.attachListener(v.UserEventNS.userTypeChanged, t => {
                        if (e.$hasCash ? this.cashTipTrigger = "hover" : this.cashTipTrigger = null, 7 === t || 6 === t || 8 === t ? (this.isCanShowOpenVipBtn = !0, this.isCanShowXufeiBtn = !1, this.curIconText = "开通会员") : 9 === t || 10 === t || 11 === t || 12 === t || 13 === t || 14 === t ? (this.isCanShowOpenVipBtn = !1, this.isCanShowXufeiBtn = !0, this.curIconText = "续费会员") : (this.isCanShowOpenVipBtn = !1, this.isCanShowXufeiBtn = !1), e.$iconData && (this.curIconUrl = e.$iconData.iconUrl, this.curIconText = e.$iconData.iconText, _.information("curIconUrl", this.curIconUrl), _.information("curIconText", this.curIconText)), this.isCanShowOpenVipBtn || this.isCanShowXufeiBtn) {
                            v.VipRenewIconManagerNS.getIconManager().onIconShow()
                        }
                    })
                } else y.PluginFunctionUINS.on("add_vip_renew_button", e => {
                    this.vipRenewEnable = !0, this.updateVipRenew(e), this.onVipButtonShow()
                }), y.PluginFunctionUINS.on("update_vip_renew_button", e => {
                    this.updateVipRenew(e)
                })
            })).catch(), w.client.attachServerEvent("OnLoginBefore", (e, t, i) => {
                if (_.information("收到onLoginBefore事件：this.oldLoginStatus = ", this.oldLoginStatus, t, i), "unlogin" === this.oldLoginStatus) if (this.rectDatas = "", this.curLoginStatus = "loging", this.updateLoginStatus(), null !== i && void 0 !== i && "" !== i && null !== t && void 0 !== t && "" !== t) {
                    this.userNick = t, this.curLoginHeaderUrl = "";
                    let e = u.LoginHelperNS.loginHelper.getUserHeader(i);
                    _.information("onLoginBefore:getUserHeader = ", e, "this.curLoginStatus:", this.curLoginStatus), "loging" === this.curLoginStatus && null !== e && void 0 !== e && "" !== e && (this.curLoginHeaderUrl = e)
                } else this.userNick = "正在登录...", this.curLoginHeaderUrl = ""
            }), w.client.attachServerEvent("OnLoginSuc", e => a(this, void 0, void 0, function* () {
                if (_.information("收到 onLoginSuc 事件"), this.promptTextClicked && this.promptData && this.promptData.url) {
                    this.promptTextClicked = !1;
                    let e = this.promptData.url;
                    _.information("prompt url", e), w.client.callServerFunction("OpenNewTab", e)
                }
                yield this.updateUserInfo("login"), this.enter("onLoginSuc")
            })), w.client.attachServerEvent("OnGetUserInfoFinished", e => a(this, void 0, void 0, function* () {
                _.information("收到 onGetUserInfoFinished 事件"), yield this.updateUserInfo("update");
                let e = yield u.LoginHelperNS.loginHelper.updateHeaderAw(this.headerUrl, this.curUserid);
                _.information("下载头像成功：", e, this.curLoginStatus), "online" === this.curLoginStatus && null !== e && void 0 !== e && "" !== e && (this.curLoginHeaderUrl = e, l.NativeCallModule.nativeCall.CallNativeFunction("NativeFireEvent", "onUserHeaderChange", e, t => {
                    _.information("onUserHeaderChange", e, t)
                }))
            })), w.client.attachServerEvent("OnLoginFailed", (e, t, i) => {
                _.information("收到 onLoginFailed 事件, this.oldLoginStatus:", this.oldLoginStatus, ";erro:", t, ";code:", i);
                let n = Number(t), a = u.LoginHelperNS.loginHelper.getCurInternetState();
                "offline" !== this.oldLoginStatus ? 0 === a ? setTimeout(() => {
                    let e = u.LoginHelperNS.loginHelper.getCurInternetState();
                    this.setChangeData(n, e)
                }, 3e3) : this.setChangeData(n, a) : 1 === n && (this.isLogin = !1, this.curLoginStatus = "unlogin", this.userNick = "", this.rectDatas = "", this.curLoginHeaderUrl = "", this.updateLoginStatus())
            }), w.client.attachServerEvent("OnLogout", e => {
                _.information("收到 onLogout 事件"), this.isLogin = !1, this.curLoginStatus = "unlogin", this.userNick = "", this.curLoginHeaderUrl = "", this.rectDatas = "", this.updateLoginStatus(), this.closePersonalInfoWnd(), v.VipRenewIconManagerNS.getIconManager().onLogout(), h.XLStatNS.setUserID(0)
            }), w.client.attachServerEvent("OnSwitchAccount", e => {
                this.switchAccount(), this.closePersonalInfoWnd()
            }), w.client.attachServerEvent("OnInternetConnectChange", (e, t, i) => a(this, void 0, void 0, function* () {
                if (2 === i) {
                    let e = yield this.pingThroughXLUserServer();
                    if ("online" === this.curLoginStatus && !e) {
                        this.isLogin = !1, this.curLoginStatus = "offline", this.updateLoginStatus();
                        let e = this.getUserAvatarRect();
                        this.closePersonalInfoWnd(), u.LoginHelperNS.loginUIHelper.createRetryLoginWnd("userAvatar", e)
                    }
                } else 1 === i && (_.information("onInternetConnectChange:", this.curLoginStatus), "offline" === this.curLoginStatus && setTimeout(() => a(this, void 0, void 0, function* () {
                    (yield this.pingThroughXLUserServer()) && (h.XLStatNS.trackEvent("user_info", "broken_net_to_login", "", 0, 0, 0, 0, "type=1"), u.LoginHelperNS.loginHelper.logIn("RetryLogin"))
                }), 3e3))
            })), w.client.attachServerEvent("OnUserDetailInfoChange", (e, t) => {
                if (null !== t && void 0 !== t && "" !== t) try {
                    let e = JSON.parse(t);
                    this.userNick = f.ThunderUtil.unescapeHTML(e.nickName), this.$nextTick(() => {
                        this.onVipButtonShow()
                    })
                } catch (e) {
                    _.warning(e)
                }
            }), w.client.attachServerEvent("OnLoginUpdate", (e, t, i) => {
                _.information("收到事件 onLoginUpdate:", t, i), "vipinfo" !== t && "userinfo" !== t || this.updateUserInfo("update").catch(), w.client.broadcastEvent("onUserInfoChange", t, i, e => {
                    _.information("fire onUserInfoChange:", e)
                }), m.server.fireClientEvent("onUserInfoChange", t, i), m.server.fireClientEvent("OnUserInfoChange", t, i)
            }), o.remote.ipcMain.on("onCancelRetry", () => {
                _.information("收到 onCancelRetry 事件"), this.isLogin = !1, this.curLoginStatus = "unlogin", this.userNick = "", this.curLoginHeaderUrl = "", this.rectDatas = "", this.updateLoginStatus(), u.LoginHelperNS.loginHelper.logout()
            });
            let t = p.LoginPromptManagerNS.getManager();
            t.attachListener(p.LoginPromptManagerEventNS.promptDataGet, e => {
                _.information("prompt data event result", e), e && this.checkPromptState()
            }), t.init(), _.information("attach prompt data event")
        }
    };
    n([r.Watch("isLogin")], A.prototype, "onLoginChange", null), n([r.Watch("curLoginHeaderUrl", {immediate: !0})], A.prototype, "onHeaderChange", null), n([r.Watch("vipButtonShow")], A.prototype, "onVipButtonShow", null), A = n([r.Component({})], A), t.default = A
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(149), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(586), a = i(33);
    t.default = a.connector.connect({mapCommitToProps: {createNewTab: "CREATE_NEW_TAB"}})(n.default)
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(151), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(8), r = i(12), s = i(10), l = i(451), d = i(326), u = i(22), c = i(37), h = i(2), f = i(6), g = i(18),
        p = i(9), v = i(0), m = i(73), y = i(7), k = i(70), T = i(13), w = i(14), C = i(328),
        S = f.default(h.join(__rootDir, "../bin/ThunderHelper.node")),
        b = v.default.getLogger("system-buttons"), {isDef: I} = w.ThunderUtil;
    let _ = class extends o.Vue {
        constructor() {
            super(...arguments), this.bSelectAutoRun = !0, this.maximized = !1, this.disableHover = !1, this.showNewIcon = !1, this.communityName = "community", this.blankPage = "新标签页", this.bSelectShowBookmark = !1, this.isShowNewTag = !1
        }

        onMaximizedChange(e, t) {
        }

        onShowNewTag(e) {
            return a(this, void 0, void 0, function* () {
                if (e) {
                    let e = 0, t = 0, i = 0;
                    try {
                        e = Number(yield y.client.callServerFunction("IsLogined"))
                    } catch (e) {
                        b.warning(e)
                    }
                    try {
                        let e = JSON.parse(yield y.client.callServerFunction("GetUserInfo", 2));
                        I(e) && (i = Number(e.vasType), t = Number(e.isVip))
                    } catch (e) {
                        b.warning(e)
                    }
                    p.XLStatNS.trackEvent("user_info", "clienttop_skincenter_red_show", "", 0, 0, 0, 0, `is_login=${e},is_vip=${t},vip_type=${i},is_red=1`)
                }
            })
        }

        showNewTag() {
            return a(this, void 0, void 0, function* () {
                do {
                    let e = s.ConfigNS.getValue("Skin", "ClickTag", 0), t = new Date,
                        i = yield C.default.getWallpapers();
                    if (i) for (let n of i) if (t.getTime() - n.updated_at < 6048e5 && e < n.updated_at) {
                        this.isShowNewTag = !0;
                        break
                    }
                    if (this.isShowNewTag) break;
                    let n = yield C.default.getCoolWallpapers();
                    if (n) for (let i of n) if (t.getTime() - i.updated_at < 6048e5 && e < i.updated_at) {
                        this.isShowNewTag = !0;
                        break
                    }
                    if (this.isShowNewTag) break;
                    let a = yield C.default.getCoolShakes();
                    if (a) for (let i of a) if (t.getTime() - i.updated_at < 6048e5 && e < i.updated_at) {
                        this.isShowNewTag = !0;
                        break
                    }
                } while (0)
            })
        }

        showMenu(e) {
            return a(this, void 0, void 0, function* () {
                p.XLStatNS.trackEvent("clienttop", "clienttop_dropdown_click"), this.showNewIcon = !1, s.ConfigNS.getValue("XLUpdate", "ShowMainUpdateIcon", !0) && s.ConfigNS.setValue("XLUpdate", "ShowMainUpdateIcon", !1);
                let t = S.readRegString("HKEY_CURRENT_USER", "Software\\Microsoft\\Windows\\CurrentVersion\\Run", "Thunder");
                this.bSelectAutoRun = "" !== t, s.ConfigNS.getValue("ConfigNormalSession", "ConfigNormal_AutoRun", !0) !== this.bSelectAutoRun && s.ConfigNS.setValue("ConfigNormalSession", "ConfigNormal_AutoRun", this.bSelectAutoRun), this.bSelectShowBookmark = s.ConfigNS.getValue("Bookmark", "ShowBookmarkBar", 0) && !0;
                let i = [];
                i.push({
                    type: "normal",
                    label: "新建下载(&N)",
                    accelerator: "CmdOrCtrl+N",
                    role: "",
                    icon: `${__rootDir}/static/icon/newtask.png`,
                    click: () => {
                        this.menuItemClick("newtask", !0)
                    }
                }, {
                    type: "normal", label: "导入未完成下载", click: () => {
                        this.menuItemClick("unfinished", !0)
                    }
                }, {
                    type: "normal", label: "设置中心", icon: `${__rootDir}/static/icon/config.png`, click: () => {
                        this.menuItemClick("setting", !0)
                    }
                }, {type: "normal", label: "关于迅雷", click: () => {
                        this.menuItemClick("more_about", !0)
                    }
                }, {type: "separator"}, {
                    type: "normal",
                    label: "退出(&X)",
                    icon: `${__rootDir}/static/icon/exit.png`,
                    click: () => {
                        this.menuItemClick("quit")
                    }
                });
                let n = yield(yield r.asyncRemoteCall.getMenu()).buildFromTemplate(i),
                    a = yield r.asyncRemoteCall.getCurrentWindow();
                yield m.MenuSkinNS.setStyle(n, {});
                let o = document.getElementsByClassName("xly-aside"), l = void 0;
                o && o[0] && (l = o[0].clientWidth), yield d.ContextMenuNS.popupAt(n, {window: a, x: l}, e.target)
            })
        }

        menuItemClick(e, t) {
            if (t) {
                let t = "button=" + e;
                p.XLStatNS.trackEvent("clienttop", "clienttop_dropdownlist_click", "", 0, 0, 0, 0, t)
            }
            if ("quit" === e) l.default.exitThunderX("system-menu"); else if ("newtask" === e) l.default.showNewTaskPanel("system-menu"); else if ("setting" === e) p.XLStatNS.trackEvent("setting_center", "setting_panel_show", "", 0, 0, 0, 0, "entry=menu"), y.client.callServerFunction("OpenSettingCenter"); else if ("autorun" === e) this.bSelectAutoRun ? this.bSelectAutoRun = !1 : this.bSelectAutoRun = !0, s.ConfigNS.setValue("ConfigNormalSession", "ConfigNormal_AutoRun", this.bSelectAutoRun); else if ("unfinished" === e) l.default.importUncompleted("system-menu"); else if ("download_diagnosis" === e) u.MessageBox.custom("DownloadDetectTools", {singleton: !0}, {modal: !1}).then(e => {
                e.action, c.MessageBoxNS.Action.OK
            }).catch(); else if ("check" === e) s.ConfigNS.getValue("XLUpdate", "ShowMenuUpdateIcon", !1) && s.ConfigNS.setValue("XLUpdate", "ShowMenuUpdateIcon", !1), S.startManualUpdateWithUI(); else if ("personal" === e) this.showPersonalManagerPlatform(); else if ("more_about" === e) u.MessageBox.custom("about", {
                windowWidth: 450,
                windowHeight: 299
            }); else if ("more_kefu" === e) y.client.callServerFunction("OpenNewTab", "http://help.xunlei.com/").catch(); else if ("more_bbs" === e) y.client.callServerFunction("OpenNewTab", "http://bbs.xunlei.com/").catch(); else if ("privacy" === e) y.client.callServerFunction("OpenNewTab", "https://i.xunlei.com/xluser/privacy.html").catch(); else if ("feedback" === e) {
                let e = S.getPeerID(), t = h.join(__rootDir, "../../Thunder.exe"),
                    i = "http://misc-xl9-ssl.xunlei.com/client/view/dist/1.0/feedback.html?version=" + S.getFileVersion(t) + "&pid=" + e;
                y.client.callServerFunction("OpenNewTab", i).catch()
            }
        }

        bookMarkClick(e) {
            let t = `button=${e}`;
            p.XLStatNS.trackEvent("clienttop", "clienttop_dropdownlist_bookmarks_click", "", 0, 0, 0, 0, t)
        }

        loadUpgradeConfig(e) {
            if (0 === e.code && e.data) if (e.data.md5 && e.data.t) {
                s.ConfigNS.getValue("XLUpdate", "UpdateMd5", "") !== e.data.md5 && 2 === parseInt(e.data.t, 10) && (s.ConfigNS.setValue("XLUpdate", "UpdateMd5", e.data.md5), s.ConfigNS.setValue("XLUpdate", "ShowMainUpdateIcon", !0), s.ConfigNS.setValue("XLUpdate", "ShowMenuUpdateIcon", !0)), s.ConfigNS.getValue("XLUpdate", "ShowMainUpdateIcon", !0) && (this.showNewIcon = !0)
            } else s.ConfigNS.setValue("XLUpdate", "UpdateMd5", ""), s.ConfigNS.setValue("XLUpdate", "ShowMainUpdateIcon", !1), s.ConfigNS.setValue("XLUpdate", "ShowMenuUpdateIcon", !1); else s.ConfigNS.setValue("XLUpdate", "UpdateMd5", ""), s.ConfigNS.setValue("XLUpdate", "ShowMainUpdateIcon", !1), s.ConfigNS.setValue("XLUpdate", "ShowMenuUpdateIcon", !1)
        }

        checkUpgrade() {
        }

        showIndividuation() {
            return a(this, void 0, void 0, function* () {
                let e = 0, t = 0, i = 0;
                try {
                    e = Number(yield y.client.callServerFunction("IsLogined"))
                } catch (e) {
                    b.warning(e)
                }
                try {
                    let e = JSON.parse(yield y.client.callServerFunction("GetUserInfo", 2));
                    I(e) && (i = Number(e.vasType), t = Number(e.isVip))
                } catch (e) {
                    b.warning(e)
                }
                let n = this.isShowNewTag ? 1 : 0;
                if (this.isShowNewTag) {
                    let e = new Date;
                    s.ConfigNS.setValue("Skin", "ClickTag", e.getTime()), this.isShowNewTag = !1
                }
                p.XLStatNS.trackEvent("user_info", "personalized_center_entrance", "", 0, 0, 0, 0, `is_login=${e},is_vip=${t},vip_type=${i},source=right_corner,is_red=${n}`), yield y.client.callServerFunction("ShowIndividuation")
            })
        }

        showPersonalManagerPlatform() {
            return a(this, void 0, void 0, function* () {
                let e = yield k.default(!1, !0);
                e && "" !== e && (yield y.client.callServerFunction("OpenNewTab", "https://vip.xunlei.com/thunder-x-custom-editon/"))
            })
        }

        mounted() {
            return a(this, void 0, void 0, function* () {
                setTimeout(() => {
                    this.checkUpgrade()
                }, 3e3), s.ConfigNS.attachListener(T.NodeEventMesssageNS.eventConfigInitFinished, () => {
                    this.showNewTag()
                })
            })
        }
    };
    n([o.Prop({})], _.prototype, "createNewTab", void 0), n([o.Watch("maximized")], _.prototype, "onMaximizedChange", null), n([o.Watch("isShowNewTag")], _.prototype, "onShowNewTag", null), _ = n([o.Component({components: {}})], _), t.default = _
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(153), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(603), a = i(33);
    t.default = a.connector.connect({
        mapStateToProps: {
            tabs: e => e.Tabs.tabs,
            currentTabId: e => e.Tabs.current,
            preloadPath: e => `file:///${__rootDir}/out/common-preload.js`
        },
        mapCommitToProps: {createNewTab: "CREATE_NEW_TAB", selectNav: "SELECT_NAV"},
        mapDispatchToProps: {selectTab: "selectTab"},
        mapGettersToProps: {currentTab: e => e.currentTab, curNav: e => e.currentNav}
    })(n.default)
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(155), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(8), r = i(604), s = i(67), l = i(610), d = i(79), u = i(24), c = i(7), h = i(20), f = i(68);
    let g = class extends o.Vue {
        constructor() {
            super(...arguments), this.text = "", this.isLogined = !1, this.settingTab = !1, this.lastTabId = 0
        }

        onCurNavChange(e, t) {
            h.server.fireClientEvent("OnCurNavChange", e, t)
        }

        oncurrentTabIdChange() {
            0 !== this.currentTabId && (this.settingTab = !1)
        }

        get panViewShow() {
            return "pan-plugin" === f(this.currentTab, "tab", "name") && f(this.currentTab, "tab", "type") === s.TabType.XDAS
        }

        get panStyle() {
            let e = !1;
            return e = !(!(this.curNav === d.NavViewID.Cloud) || this.settingTab)
        }

        get findPageStyle() {
            let e = !1;
            return e = !(!(this.curNav === d.NavViewID.Browser) || this.settingTab)
        }

        closeSettingCenter() {
            this.settingTab = !1, this.selectTab(this.lastTabId)
        }

        mounted() {
            return a(this, void 0, void 0, function* () {
                c.client.attachServerEvent("OnLoginSuc", (e, ...t) => {
                    this.isLogined = !0
                }), c.client.attachServerEvent("OnLogout", (e, ...t) => {
                    this.isLogined = !1
                }), this.isLogined = yield u.LoginHelperNS.loginHelper.isLoginedAw(), h.server.registerFunctions({
                    GetCurrentNav: (e, t, ...i) => this.curNav,
                    SelectNav: (e, t, ...i) => {
                        let n = i[0];
                        n && this.selectNav(n)
                    },
                    OpenSettingCenter: (e, t, ...i) => {
                        this.lastTabId = this.currentTabId, this.selectTab(0), this.settingTab = !0
                    },
                    CloseSettingCenter: (e, t, ...i) => {
                        this.settingTab = !1
                    }
                })
            })
        }
    };
    n([o.Prop()], g.prototype, "curNav", void 0), n([o.Prop({})], g.prototype, "currentTab", void 0), n([o.Prop({})], g.prototype, "currentTabId", void 0), n([o.Prop({})], g.prototype, "selectNav", void 0), n([o.Prop({})], g.prototype, "selectTab", void 0), n([o.Prop({})], g.prototype, "createNewTab", void 0), n([o.Watch("curNav", {immediate: !0})], g.prototype, "onCurNavChange", null), n([o.Watch("currentTabId")], g.prototype, "oncurrentTabIdChange", null), g = n([o.Component({
        components: {
            MainTop: r.default,
            PanPluginView: () => Promise.resolve().then(() => i(621)),
            DownloadPanel: () => Promise.resolve().then(() => i(623)),
            FindPage: l.default,
            SettingViewContainer: () => Promise.resolve().then(() => i(679))
        }
    })], g), t.default = g
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(157), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(0), r = i(8), s = i(9), l = i(335), d = i(17), u = i(26), c = i(28), h = i(12), f = i(20), g = i(7),
        p = i(38);
    i(768);
    const v = o.default.getLogger("main-top-search");
    let m = class extends r.Vue {
        constructor() {
            super(...arguments), this.text = "", this.disableHover = !1, this.maximized = !1, this.dragable = !0, this.isPopupMenu = !1
        }

        get isFindPage() {
            return "find-page" === this.curNav
        }

        get isSearchPage() {
            return "pan-plugin-view" === this.curNav || "download-panel" === this.curNav
        }

        closeMainWindow() {
            return a(this, void 0, void 0, function* () {
                s.XLStatNS.trackEvent("clienttop", "clienttop_close_click"), this.disableHover = !0, yield l.QuitMessageBoxMgrNS.popupCreateShortcutMessageBox(), this.$nextTick(() => {
                    d.ipcRenderer.send("closeMainWindow")
                })
            })
        }

        minizeMainWindow(e) {
            this.disableHover = !0;
            let t = encodeURIComponent("button=small_get");
            s.XLStatNS.trackEvent("clienttop", "clienttop_maxminum_click", "", 0, 0, 0, 0, t), this.$nextTick(() => {
                d.ipcRenderer.send("minizeMainWindow")
            })
        }

        popupMenu() {
            return a(this, void 0, void 0, function* () {
                if ("download-panel" === this.curNav) return p.ThunderNewTask.createPreNewTaskWindow(null);
                this.isPopupMenu = !0, setTimeout(() => {
                    this.$refs.menuButton.focus()
                }, 100), s.XLStatNS.trackEvent("pc_yunpan", "top_operation_click", "", 0, 0, 0, 0, "clickid=add")
            })
        }

        onBlur() {
            this.isPopupMenu = !1
        }

        uploadLocalFiles() {
            this.isPopupMenu = !1, v.information("uploadLocalFiles"), f.server.callClientFunctionByName("ThunderPanPluginWebview", "IpcUploadLocalFiles"), s.XLStatNS.trackEvent("pc_yunpan", "top_add_btn_child_click", "", 0, 0, 0, 0, "clickid=local_upload")
        }

        addLink() {
            this.isPopupMenu = !1, v.information("addLink"), p.ThunderNewTask.createPreNewTaskWindow(null, "cloudmenu"), s.XLStatNS.trackEvent("pc_yunpan", "top_add_btn_child_click", "", 0, 0, 0, 0, "clickid=link")
        }

        addBt() {
            this.isPopupMenu = !1, v.information("addBt"), g.client.callServerFunction("ImportTorrent", "cloudmenu"), s.XLStatNS.trackEvent("pc_yunpan", "top_add_btn_child_click", "", 0, 0, 0, 0, "clickid=BT_link")
        }

        createFolder() {
            this.isPopupMenu = !1, v.information("createFolder"), this.$nextTick(() => {
                document.getElementById("webview_home-1EAC214F-7644-4163-9EB8-AF4BAA62D144").focus(), f.server.callClientFunctionByName("ThunderPanPluginWebview", "IpcCreateFolder")
            }), s.XLStatNS.trackEvent("pc_yunpan", "top_add_btn_child_click", "", 0, 0, 0, 0, "clickid=new_folder")
        }

        toggleMaximizeMainWindow() {
            this.disableHover = !0;
            let e = `button=${this.maximized ? "get_back" : "big_get"}`, t = encodeURIComponent(e);
            s.XLStatNS.trackEvent("clienttop", "clienttop_maxminum_click", "", 0, 0, 0, 0, t), this.$nextTick(() => {
                this.maximized ? d.ipcRenderer.send("restoreMainWindow") : d.ipcRenderer.send("maximizeMainWindow")
            })
        }

        closeSettingCenter() {
            this.$emit("close")
        }

        mounted() {
            return a(this, void 0, void 0, function* () {
                const e = yield h.asyncRemoteCall.getCurrentWindow();
                (yield e.isMaximized()) && (this.maximized = !0), e.on("maximize", () => {
                    this.maximized = !0
                }), e.on("minimize", () => {
                    this.maximized = !1
                }), e.on("unmaximize", () => {
                    this.maximized = !1
                }), d.ipcRenderer.on(c.ThunderChannelList.channelMRMainWndMax, function () {
                    u.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnMainWindowVisibleChange", !0), f.server.fireClientEvent("OnMainWindowVisibleChange", !0)
                }), d.ipcRenderer.on(c.ThunderChannelList.channelMRMainWndMin, function () {
                    u.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnMainWindowVisibleChange", !1), f.server.fireClientEvent("OnMainWindowVisibleChange", !1)
                }), d.ipcRenderer.on(c.ThunderChannelList.channelMRMainWndRestore, function () {
                    u.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnMainWindowVisibleChange", !0), f.server.fireClientEvent("OnMainWindowVisibleChange", !0)
                })
            })
        }
    };
    n([r.Prop({default: "download-panel"})], m.prototype, "curNav", void 0), n([r.Prop()], m.prototype, "isLogined", void 0), n([r.Prop()], m.prototype, "settingTab", void 0), m = n([r.Component({components: {FindPageMainTop: () => Promise.resolve().then(() => i(605))}})], m), t.default = m
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(159), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(8), o = i(606);
    let r = class extends a.Vue {
    };
    n([a.Prop()], r.prototype, "isFindPage", void 0), r = n([a.Component({components: {AddressBarContainer: o.default}})], r), t.default = r
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(161), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(607), a = i(33);
    t.default = a.connector.connect({
        mapStateToProps: {
            currentTabIndex: e => e.Tabs.current,
            bookMarks: e => e.BookMarks.bookMarks,
            allNetGroups: e => e.Group.all
        },
        mapGettersToProps: {
            currentTab: e => e.currentTab,
            currentSelectdTaskIds: e => e.currentSelectdTaskInfos.map(e => e.taskId),
            curNav: e => e.currentNav
        },
        mapCommitToProps: {
            createNewTab: "CREATE_NEW_TAB",
            onOriginalUrlChange: "ON_ORIGINAL_URL_CHANGE",
            addBookMarksItem: "ADD_BOOK_MARKS_ITEM",
            deleteBookMarksItem: "REMOVE_BOOK_MARKS_ITEM",
            setBookMarksItemTop: "SET_BOOK_MARKS_ITEM_TOP"
        },
        mapDispatchToProps: {getGroupData: "getGroupData"}
    })(n.default)
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(163), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(17), r = i(12), s = i(2), l = i(8), d = i(4), u = i(67), c = i(14), h = i(72), f = i(9), g = i(22),
        p = i(321), v = i(0), m = i(6), y = i(69), k = i(25), T = i(37), w = i(73), C = i(26), S = i(10), b = i(18),
        I = i(28), _ = i(5), A = i(34), D = i(7), x = i(81), N = i(79), E = i(13),
        P = m.default(s.join(__rootDir, "../bin/ThunderHelper.node")), M = v.default.getLogger("address-bar"),
        O = p.CommunityNaviteFunctionNS.CommunityNaviteFunction.getNativeModule(), F = i(68);
    let L = class extends l.Vue {
        constructor() {
            super(...arguments), this.textData = "", this.placeholder = "输入网址、电影名等想要搜索的信息", this.placeholders = [], this.placeholderSwitchTimer = null, this.isMunuOpenUrl = !1, this.isCanUndo = !0, this.flag = !0, this.curText = "", this.inputFocus = !1, this.communityName = "community", this.blankPage = "新标签页", this.timer = 0, this.switchOn = 0, this.searchSuffix = [], this.isSelectDropItem = !1, this.showFavanimation = !1, this.showFavoritesTip = !1, this.favTipTimerId = void 0, this.curRelatedKey = "关联词", this.heanderHeight = 48, this.dialogWidth = 400, this.groupEntrySection = "groupEntry", this.groupEntryKey = "open", this.commandid = 0
        }

        get relatedKeyWord() {
            let e = "";
            return -1 === this.curRelatedKey.indexOf("关联词") && (e = this.curRelatedKey), e
        }

        onCurrentTabChange(e) {
            if (this.isCanUndo = !1, this.hideCollectIcon || (this.$refs.collect && this.$refs.collect.classList.remove("is-animation"), this.showFavanimation = !1), !d.isNullOrUndefined(this.currentTab) && !d.isNullOrUndefined(this.currentTab.tab) && this.currentTab.tab.getTabType() === u.TabType.Chromium) {
                if (window.innerWidth < 1160) {
                    let e = window.innerHeight;
                    window.resizeTo(1160, e)
                }
            }
        }

        popEditableDefaultContextMenuForAddressBar(e, t, i, n) {
            return a(this, void 0, void 0, function* () {
                (yield r.asyncRemoteCall.getCurrentWebContents()).once("context-menu", (n, o) => a(this, void 0, void 0, function* () {
                    if (o.isEditable) {
                        let n = [{
                            label: "撤销",
                            enabled: o.editFlags.canUndo && e,
                            click: () => a(this, void 0, void 0, function* () {
                                f.XLStatNS.trackEvent("clienttop", "clienttop_address_rmenu_click", "", 0, 0, 0, 0, "button=undo"), (yield r.asyncRemoteCall.getCurrentWebContents()).undo()
                            })
                        }, {type: "separator"}, {
                            label: "剪切",
                            enabled: o.editFlags.canCut,
                            click: () => a(this, void 0, void 0, function* () {
                                f.XLStatNS.trackEvent("clienttop", "clienttop_address_rmenu_click", "", 0, 0, 0, 0, "button=shear"), (yield r.asyncRemoteCall.getCurrentWebContents()).cut()
                            })
                        }, {
                            label: "复制",
                            enabled: o.editFlags.canCopy,
                            click: () => a(this, void 0, void 0, function* () {
                                f.XLStatNS.trackEvent("clienttop", "clienttop_address_rmenu_click", "", 0, 0, 0, 0, "button=copy"), (yield r.asyncRemoteCall.getCurrentWebContents()).copy()
                            })
                        }, {
                            label: "粘贴",
                            enabled: o.editFlags.canPaste && c.ThunderUtil.isClipboardTextFormatAvailable(),
                            click: () => a(this, void 0, void 0, function* () {
                                f.XLStatNS.trackEvent("clienttop", "clienttop_address_rmenu_click", "", 0, 0, 0, 0, "button=paste"), (yield r.asyncRemoteCall.getCurrentWebContents()).paste()
                            })
                        }, {
                            label: "删除",
                            enabled: o.editFlags.canDelete,
                            click: () => a(this, void 0, void 0, function* () {
                                f.XLStatNS.trackEvent("clienttop", "clienttop_address_rmenu_click", "", 0, 0, 0, 0, "button=delete"), (yield r.asyncRemoteCall.getCurrentWebContents()).delete()
                            })
                        }, {type: "separator"}, {
                            label: "全选",
                            enabled: o.editFlags.canSelectAll,
                            click: () => a(this, void 0, void 0, function* () {
                                f.XLStatNS.trackEvent("clienttop", "clienttop_address_rmenu_click", "", 0, 0, 0, 0, "button=chooseall"), (yield r.asyncRemoteCall.getCurrentWebContents()).selectAll()
                            })
                        }];
                        if (void 0 !== t && "function" == typeof t) {
                            let e = t(o);
                            void 0 !== e && e.length > 0 && (void 0 === i ? i = n.length : (i < 0 && (i = n.length + 1 + i) < 0 && (i = 0), i > n.length && (i = n.length)), n.splice(i, 0, ...e))
                        }
                        let s = yield(yield r.asyncRemoteCall.getMenu()).buildFromTemplate(n);
                        yield w.MenuSkinNS.setStyle(s, {});
                        let l = yield r.asyncRemoteCall.getCurrentWindow();
                        s.popup({window: l})
                    }
                }))
            })
        }

        get canGoBack() {
            let e = !1;
            do {
                if (d.isNullOrUndefined(this.currentTab) || d.isNullOrUndefined(this.currentTab.tab)) break;
                e = this.currentTab.tab.canGoBack
            } while (0);
            return e
        }

        get canGoForward() {
            let e = !1;
            do {
                if (d.isNullOrUndefined(this.currentTab) || d.isNullOrUndefined(this.currentTab.tab)) break;
                e = this.currentTab.tab.canGoForward
            } while (0);
            return e
        }

        get canRefresh() {
            let e = !1;
            do {
                if (d.isNullOrUndefined(this.currentTab) || d.isNullOrUndefined(this.currentTab.tab)) break;
                if (this.isShowHomepage) {
                    e = !0;
                    break
                }
                if (this.currentTab.tab.getTabType() !== u.TabType.Chromium) break;
                e = !0
            } while (0);
            return e
        }

        get text() {
            let e = "";
            do {
                if (d.isNullOrUndefined(this.currentTab) || d.isNullOrUndefined(this.currentTab.tab)) break;
                if (this.currentTab.tab.getTabType() !== u.TabType.Chromium || this.currentTab.tab.isDefaultTab()) break;
                if (!this.currentTab.tab.showUrl) break;
                e = this.currentTab.tab.url
            } while (0);
            return this.textData = e, e
        }

        onFindPageSelect() {
            if (this.isFindPage) {
                let e = "";
                do {
                    if (d.isNullOrUndefined(this.currentTab) || d.isNullOrUndefined(this.currentTab.tab)) break;
                    if (this.currentTab.tab.getTabType() !== u.TabType.Chromium || this.currentTab.tab.isDefaultTab()) break;
                    if (!this.currentTab.tab.showUrl) break;
                    e = this.currentTab.tab.url, this.textData = e
                } while (0)
            } else {
                let e = "";
                do {
                    if (d.isNullOrUndefined(this.currentTab) || d.isNullOrUndefined(this.currentTab.tab)) break;
                    if (this.currentTab.tab.getTabType() !== u.TabType.Chromium || this.currentTab.tab.isDefaultTab()) break;
                    if (!this.currentTab.tab.showUrl) break;
                    this.textData = e
                } while (0)
            }
        }

        get isHttps() {
            return /^https/.test(this.text)
        }

        get isShowHomepage() {
            return 0 === this.currentTabIndex && 1 !== this.currentSelectdTaskIds.length
        }

        get domain() {
            let e = "";
            if (void 0 !== this.curUrl && "" !== this.curUrl) {
                e = new URL(this.curUrl).host
            }
            return e
        }

        get curUrl() {
            return F(this.currentTab, "tab", "url")
        }

        get hideCollectIcon() {
            return F(this.currentTab, "tab", "type") === u.TabType.XDAS || F(this.currentTab, "tab", "name") === this.communityName || F(this.currentTab, "tab", "title") === this.blankPage || !1 === F(this.currentTab, "tab", "showUrl")
        }

        get showGroupEnrty() {
            return !1
        }

        get groupIsOpen() {
            return k.default.getConfigInfo(this.groupEntrySection, this.groupEntryKey)
        }

        relatedMenuClick(e) {
            this.curRelatedKey = e || "关联词", e = e || "", S.ConfigNS.setValue("SearchBar", "RelatedKey", e)
        }

        downloadIcon(e, t) {
            return a(this, void 0, void 0, function* () {
                let i = null, n = !1;
                try {
                    i = yield b.default.get(e, {responseType: "arraybuffer"})
                } catch (e) {
                    M.error("error=====" + e)
                }
                return null !== i && void 0 !== i.status && 200 === i.status && null !== i.data && (n = yield _.FileSystemAWNS.writeFileAW(t, i.data)), n
            })
        }

        addressbarCollect() {
            f.XLStatNS.trackEvent("clienttop", "clienttop_address_click", "", 0, 0, 0, 0, `button=collect,url=${encodeURIComponent(this.curUrl)}`), this.handleCollect()
        }

        handleCollect() {
            return a(this, void 0, void 0, function* () {
                let e = yield(yield r.asyncRemoteCall.getCurrentWindow()).getBounds(),
                    t = {y: e.y + this.heanderHeight, x: e.x + (e.width - this.dialogWidth) / 2, modal: !1},
                    i = void 0 === this.bookMarks[this.curUrl] ? "add" : "edit", n = "";
                "add" === i ? (n = F(this.currentTab, "tab", "title"), f.XLStatNS.trackEvent("clienttop", "bookmarks_add")) : (n = this.bookMarks[this.curUrl].name, f.XLStatNS.trackEvent("clienttop", "bookmarks_modify"));
                let o = {state: i, title: n};
                g.MessageBox.custom("BookMarks", o, t).then(e => a(this, void 0, void 0, function* () {
                    if (e.action === T.MessageBoxNS.Action.OK) {
                        if ("ok" === e.args.state) {
                            let t = "";
                            if (-1 === this.curUrl.indexOf("ftp://")) {
                                let e = A.ToolsUtilitiesAWNS.genarateMd5(this.domain), i = this.currentTab.tab.iconUrl;
                                if (M.information("iconMd5 ", e, i), "" !== i) {
                                    t = __profilesDir + "/BookMarksIcon/" + e + ".png";
                                    let i = yield _.FileSystemAWNS.readdirAW(__profilesDir);
                                    do {
                                        let e = !1;
                                        for (let t of i) if ("BookMarksIcon" === t) {
                                            e = !0;
                                            break
                                        }
                                        if (e) break;
                                        (yield _.FileSystemAWNS.mkdirAW(__profilesDir + "/BookMarksIcon")) || M.information("创建保存书签icon文件夹失败")
                                    } while (0)
                                }
                                (yield this.downloadIcon(i, t)) || (t = "")
                            }
                            let n = {};
                            n[this.curUrl] = {
                                name: e.args.title,
                                url: this.curUrl,
                                iconUrl: t
                            }, this.addBookMarksItem(n), "add" === i && this.showFavAnimation(), this.dialogClick("add-to", this.curUrl, e.args.title)
                        }
                    } else e.action === T.MessageBoxNS.Action.Cancel && void 0 !== this.bookMarks[this.curUrl] && (this.deleteBookMarksItem(this.curUrl), f.XLStatNS.trackEvent("clienttop", "bookmarks_delete"), this.dialogClick(e.args.state, this.curUrl, e.args.title))
                })).catch()
            })
        }

        showFavAnimation() {
            this.showFavanimation ? (this.$refs.collect.classList.remove("is-animation"), this.showFavanimation = !1, setTimeout(() => {
                this.showFavanimation = !0
            }, 0)) : this.showFavanimation = !0
        }

        onOpenFavorites(e) {
            return a(this, void 0, void 0, function* () {
                f.XLStatNS.trackEvent("clienttop", "clienttop_address_click", "", 0, 0, 0, 0, "button=favorites"), this.closeFavoritesTip();
                let e = yield(yield r.asyncRemoteCall.getCurrentWindow()).getBounds(),
                    t = this.$refs.search_btn.getBoundingClientRect(), i = {
                        x: Math.round(e.x + t.right) - 300,
                        y: Math.round(e.y + t.bottom) + 3,
                        modal: !1,
                        width: 300,
                        height: 325
                    }, n = (Object.values(this.bookMarks) || []).reverse();
                g.MessageBox.custom("Favorites", n, i).catch()
            })
        }

        dialogClick(e, t, i) {
            let n = `button=${e},bookmarks_name=${i}, bookmarks_site=${t}`;
            f.XLStatNS.trackEvent("clienttop", "bookmarks_yitianjia", "", 0, 0, 0, 0, n)
        }

        goBack() {
            do {
                if (d.isNullOrUndefined(this.currentTab) || d.isNullOrUndefined(this.currentTab.tab)) break;
                f.XLStatNS.trackEvent("clienttop", "clienttop_address_click", "", 0, 0, 0, 0, "button=left"), this.currentTab.tab.goBack()
            } while (0)
        }

        goForward() {
            do {
                if (d.isNullOrUndefined(this.currentTab) || d.isNullOrUndefined(this.currentTab.tab)) break;
                f.XLStatNS.trackEvent("clienttop", "clienttop_address_click", "", 0, 0, 0, 0, "button=right"), this.currentTab.tab.goForward()
            } while (0)
        }

        goRefresh() {
            do {
                if (f.XLStatNS.trackEvent("clienttop", "clienttop_address_click", "", 0, 0, 0, 0, "button=refresh"), this.isShowHomepage) this.refreshHomepage(!1); else {
                    if (d.isNullOrUndefined(this.currentTab) || d.isNullOrUndefined(this.currentTab.tab)) break;
                    this.currentTab.tab.refresh(!1)
                }
            } while (0)
        }

        onSearchBtnClick() {
            let e = this.$refs.input.$el.querySelector("input"), t = "";
            e && e.value && (t = e.value), t || "输入网址、电影名等想要搜索的信息" !== this.placeholder && (t = this.placeholder), f.XLStatNS.trackEvent("clienttop", "clienttop_address_click", "", 0, 0, 0, 0, `button=magnifier,url=${encodeURIComponent(t)}`), this.curNav === N.NavViewID.Cloud && f.XLStatNS.trackEvent("pc_yunpan", "top_operation_click", "", 0, 0, 0, 0, `button=search,url=${encodeURIComponent(t)}`), this.navigate()
        }

        navigate(e) {
            do {
                if (this.isSelectDropItem) break;
                let t = void 0;
                if (t = void 0 === e ? this.$refs.input.$el.querySelector("input") : e.target, d.isNullOrUndefined(t) || d.isNullOrUndefined(t.value)) break;
                let i = t.value.trim();
                if (i || "输入网址、电影名等想要搜索的信息" !== this.placeholder && (i = this.placeholder), this.handleBirdKey(i)) {
                    M.information("顶部地址栏输入为迅雷口令,已中断Tab导航");
                    break
                }
                M.information("顶部地址栏输入不是迅雷口令", i), this.openUrl(i)
            } while (0);
            this.isCanUndo = !1, this.isSelectDropItem = !1
        }

        needNewTab() {
            let e = !1;
            do {
                if (this.currentTab.tab.getTabType() !== u.TabType.Chromium || !this.isFindPage) {
                    e = !0;
                    break
                }
                if ("community" === this.currentTab.tab.name) {
                    e = !0;
                    break
                }
            } while (0);
            return e
        }

        openUrl(e, t) {
            M.information("openUlr", e, t);
            do {
                if (d.isNullOrUndefined(e)) break;
                let i = "word=" + encodeURIComponent(e);
                i += `,key_word=${encodeURIComponent(this.relatedKeyWord)}`, f.XLStatNS.trackEvent("clienttop", "clienttop_address_search", "", 0, 0, 0, 0, i);
                let n = e, a = h.URLHelperNS.isUrl(e);
                if (a.ret && void 0 !== a.suggest && (n = a.suggest), null !== t && void 0 !== t || (t = !1 === a.ret), t && (n = x.default.getConfigValue("search", "search_engine_url", "https://www.baidu.com/s?tn=48021271_21_hao_pg&wd=$word$"), n = -1 === this.curRelatedKey.indexOf("关联词") ? n.replace("$word$", encodeURIComponent(`${e} ${this.curRelatedKey}`)) : n.replace("$word$", encodeURIComponent(e))), M.information("open url", n, t), this.needNewTab()) {
                    let e = {tabType: u.TabType.Chromium, tabParam: {url: n}};
                    this.createNewTab(e)
                } else {
                    this.currentTab.tab.navigate(n);
                    let e = this.currentTab.tab.getBrowser();
                    this.onOriginalUrlChange({originalUrl: n, browser: e}), this.isCanUndo = !0
                }
            } while (0)
        }

        handleBirdKey(e) {
            let t = h.URLHelperNS.isBirdKey(e);
            return !!(t && t.length > 0) && (y.openBirdKeyDecodeDialog(e, {from: "address"}, P), !0)
        }

        onInputFocus() {
            do {
                if (this.inputFocus) break;
                this.inputFocus = !0, this.$refs.input.$el.querySelector("input").select(), this.stopPlaceholderSwitchTimer()
            } while (0)
        }

        onInputBlur() {
            this.inputFocus = !1, this.startPlaceholderSwitchTimer()
        }

        handle(e) {
            return a(this, void 0, void 0, function* () {
                e = e.trimLeft(), this.curText = e, this.textData = e, this.isCanUndo = !0, !this.isMunuOpenUrl && this.flag && (clearTimeout(this.timer), this.timer = setTimeout(() => a(this, void 0, void 0, function* () {
                    if (this.flag) {
                        let t = this.$el.getBoundingClientRect();
                        C.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnAddressBarInputChanged", e, Math.round(t.left), Math.round(t.top + t.height + 3), Math.round(t.width), Math.round(t.height)), o.ipcRenderer.send(I.ThunderChannelList.channelRMShowSearchWindow, !0)
                    }
                }), 200))
            })
        }

        handle2() {
            return a(this, void 0, void 0, function* () {
                this.isCanUndo = !0;
                let e = this.curText;
                if (!this.isMunuOpenUrl) {
                    let t = this.$el.getBoundingClientRect();
                    C.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnAddressBarInputChanged", e, Math.round(t.left), Math.round(t.top + t.height + 3), Math.round(t.width), Math.round(t.height)), o.ipcRenderer.send(I.ThunderChannelList.channelRMShowSearchWindow, !0)
                }
                setTimeout(() => {
                    this.flag = !0
                }, 10)
            })
        }

        handlePopInputMenu(e) {
            this.popEditableDefaultContextMenuForAddressBar(this.isCanUndo, e => {
                let t = [], i = c.ThunderUtil.isClipboardTextFormatAvailable(), n = !1;
                if (i) {
                    let e = P.getClipBoardText();
                    n = h.URLHelperNS.isUrl(e).ret
                }
                return t.push({
                    label: "粘贴并立即打开", click: () => {
                        f.XLStatNS.trackEvent("clienttop", "clienttop_address_rmenu_click", "", 0, 0, 0, 0, "button=open"), this.isMunuOpenUrl = !0;
                        let e = P.getClipBoardText();
                        this.openUrl(e, !1), setTimeout(() => {
                            this.isMunuOpenUrl = !1
                        }, 1e3)
                    }, enabled: e.editFlags.canPaste && i && n
                }), t.push({
                    label: "粘贴并全网搜索", click: () => {
                        f.XLStatNS.trackEvent("clienttop", "clienttop_address_rmenu_click", "", 0, 0, 0, 0, "button=search"), this.isMunuOpenUrl = !0;
                        let e = P.getClipBoardText();
                        this.openUrl(e, !0), setTimeout(() => {
                            this.isMunuOpenUrl = !1
                        }, 1e3)
                    }, enabled: e.editFlags.canPaste && i && !n
                }), t
            }, -4).catch()
        }

        refreshHomepage(e = !1) {
            let t = document.querySelector(".iframe-home");
            do {
                if (!t) break;
                e ? t.getWebContents().session.clearCache(() => {
                    t.reload()
                }) : t.reload()
            } while (0)
        }

        getRecommends() {
            return a(this, void 0, void 0, function* () {
                let e = void 0, t = null;
                try {
                    b.default.defaults.adapter = i(21), t = yield b.default.get("http://static-xl.a.88cdn.com/json/thunderx_search_bar.json", {timeout: 1e4})
                } catch (e) {
                    M.warning(e)
                }
                if (null !== t && void 0 !== t.status && 200 === t.status && void 0 !== t.data && null !== t.data) {
                    let i = 3;
                    for (let e = 0; e < t.data.length && !(i <= 0); ++e, --i) this.placeholders.push(t.data[e].title);
                    try {
                        e = JSON.stringify(t.data)
                    } catch (e) {
                        M.warning(e)
                    }
                }
                return null !== e && void 0 !== e || (e = ""), D.client.callServerFunction("SetSearchRecommends", e), e
            })
        }

        closeFavoritesTip() {
            this.favTipTimerId && (clearTimeout(this.favTipTimerId), this.favTipTimerId = void 0), this.showFavoritesTip && (this.showFavoritesTip = !1, S.ConfigNS.setValue("SearchBar", "FavoritesTip", !1))
        }

        mounted() {
            return a(this, void 0, void 0, function* () {
                S.ConfigNS.attachListener(E.NodeEventMesssageNS.eventConfigInitFinished, () => {
                    this.curRelatedKey = S.ConfigNS.getValue("SearchBar", "RelatedKey", "关联词"), this.showFavoritesTip = S.ConfigNS.getValue("SearchBar", "FavoritesTip", !0), this.showFavoritesTip && (this.favTipTimerId = setTimeout(() => {
                        this.closeFavoritesTip()
                    }, 5e3))
                }), this.getGroupData(), o.ipcRenderer.on(I.ThunderChannelList.channelMRFWSelectAddressDropItem, (e, t) => {
                    this.textData = t
                }), o.ipcRenderer.on(I.ThunderChannelList.channelMRFWAddressDropWndKeyDown, (e, t) => {
                    13 === t && this.navigate()
                }), document.addEventListener("keydown", e => {
                    e.ctrlKey && 65 === e.keyCode && e.preventDefault(), this.inputFocus && (40 !== e.keyCode && 38 !== e.keyCode && 13 !== e.keyCode || o.ipcRenderer.send(I.ThunderChannelList.channelRMAddressKeyDown, e.keyCode))
                }), document.addEventListener("keyup", this.handleKeyUp, !0), document.addEventListener("compositionstart", () => {
                    this.inputFocus && (this.flag = !1)
                }), document.addEventListener("compositionend", () => {
                    if (!this.inputFocus) return;
                    this.$refs.input.$el.querySelector("input").placeholder === document.activeElement.placeholder && this.handle2()
                }), O.on("handleCollent", e => {
                    this.handleCollect()
                }), O.on("bookmarks.top", e => {
                    this.setBookMarksItemTop(e)
                }), O.on("bookmarks.editfinish", (e, t) => a(this, void 0, void 0, function* () {
                    let i = t.url, n = "";
                    if (i) {
                        n = new URL(i).host
                    }
                    if (e.action === T.MessageBoxNS.Action.OK) {
                        if ("ok" === e.args.state) {
                            let a = "";
                            if (-1 === i.indexOf("ftp://")) {
                                let e = A.ToolsUtilitiesAWNS.genarateMd5(n), i = t.iconUrl;
                                if (M.information("iconMd5 ", e, i), "" !== i) {
                                    a = __profilesDir + "/BookMarksIcon/" + e + ".png";
                                    let t = yield _.FileSystemAWNS.readdirAW(__profilesDir);
                                    do {
                                        let e = !1;
                                        for (let i of t) if ("BookMarksIcon" === i) {
                                            e = !0;
                                            break
                                        }
                                        if (e) break;
                                        (yield _.FileSystemAWNS.mkdirAW(__profilesDir + "/BookMarksIcon")) || M.information("创建保存书签icon文件夹失败")
                                    } while (0)
                                }
                                (yield this.downloadIcon(i, a)) || (a = "")
                            }
                            let o = {};
                            o[i] = {
                                name: e.args.title,
                                url: i,
                                iconUrl: a
                            }, this.addBookMarksItem(o), "add" === t.state && this.showFavAnimation()
                        }
                    } else e.action === T.MessageBoxNS.Action.Cancel && void 0 !== this.bookMarks[i] && this.deleteBookMarksItem(i)
                })), setTimeout(() => {
                    this.switchOn = k.default.getConfigInfo("searchBar", "enableAssociativeWord"), null !== this.switchOn && void 0 !== this.switchOn || (this.switchOn = 1), this.searchSuffix = k.default.getConfigInfo("searchBar", "searchSuffix") || this.searchSuffix, S.ConfigNS.setValue("SearchBar", "EnableAssociativeWord", this.switchOn), S.ConfigNS.setValue("SearchBar", "SearchSuffix", this.searchSuffix.toString())
                }, 3e3), (yield r.asyncRemoteCall.getCurrentWindow()).hookWindowMessage(528, () => {
                    do {
                        if (!this.$refs.input) break;
                        let e = P.getCursorPos(),
                            t = this.$refs.input.$el.querySelector("input").getBoundingClientRect();
                        o.ipcRenderer.send(I.ThunderChannelList.channelRMClickMouse, e.x, e.y, Math.round(t.left), Math.round(t.top), Math.round(t.right), Math.round(t.bottom))
                    } while (0)
                }), yield this.getRecommends(), this.startPlaceholderSwitchTimer()
            })
        }

        startPlaceholderSwitchTimer() {
        }

        stopPlaceholderSwitchTimer() {
        }

        beforeDestroy() {
            document.removeEventListener("keyup", this.handleKeyUp, !0), this.stopPlaceholderSwitchTimer()
        }

        handleKeyUp(e) {
            this.isShowHomepage && 116 === e.keyCode && this.refreshHomepage(e.ctrlKey)
        }
    };
    n([l.Prop()], L.prototype, "isFindPage", void 0), n([l.Prop({})], L.prototype, "currentTab", void 0), n([l.Prop({})], L.prototype, "curNav", void 0), n([l.Prop({})], L.prototype, "currentSelectdTaskIds", void 0), n([l.Prop({})], L.prototype, "currentTabIndex", void 0), n([l.Prop({})], L.prototype, "bookMarks", void 0), n([l.Prop({})], L.prototype, "allNetGroups", void 0), n([l.Prop({})], L.prototype, "addBookMarksItem", void 0), n([l.Prop({})], L.prototype, "deleteBookMarksItem", void 0), n([l.Prop({})], L.prototype, "setBookMarksItemTop", void 0), n([l.Prop({})], L.prototype, "getGroupData", void 0), n([l.Watch("currentTab")], L.prototype, "onCurrentTabChange", null), n([l.Prop({})], L.prototype, "createNewTab", void 0), n([l.Prop({})], L.prototype, "onOriginalUrlChange", void 0), n([l.Watch("isFindPage")], L.prototype, "onFindPageSelect", null), L = n([l.Component], L), t.default = L
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(165), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(611), a = i(33);
    t.default = a.connector.connect({
        mapStateToProps: {
            bookMarks: e => e.BookMarks.bookMarks,
            currentCategoryId: e => e.DownloadListState.currentCategoryId,
            tabs: e => e.Tabs.tabs.filter(e => !e.tab.hideUI),
            current: e => e.Tabs.current
        },
        mapCommitToProps: {
            createNewTab: "CREATE_NEW_TAB",
            onBrowserBindWindowHandle: "ON_BIND_WND_HANDLE",
            onBrowserTitleChange: "ON_TITLE_CHANGE",
            onBrowserLoadStatusChange: "ON_LOAD_STATUS_CHANGE",
            onBrowserAddressChange: "ON_ADDRESS_CHANGE",
            onBrowserNewBrowserPopupCompleted: "ON_NEW_BROWSER_POPUP_COMPLETED",
            onBrowserLoadStart: "ON_LOAD_START",
            onBrowserLoadEnd: "ON_LOAD_END",
            onBrowserLoadError: "ON_LOAD_ERROR",
            onBrowserFavIconChange: "ON_FAV_ICON_GET",
            onAppQuit: "ON_APP_QUIT",
            updateTabs: "UPDATE_TABS",
            updateCurrent: "UPDATE_CURRENT",
            updateBookMarksIconUrl: "UPDATE_BOOK_MARKS_ICONURL"
        },
        mapDispatchToProps: {
            closeTab: "closeTab",
            closeTabByName: "closeTabByName",
            selectTab: "selectTab",
            onJsCallNativeFunction: "onChromiumCallNativeFunction",
            onJsCheckNativeFunction: "onChromiumCheckNativeFunction",
            onBrowserNewBrowserPopup: "onNewBrowserPopup",
            removeTabCtrl: "removeTabCtrl",
            onCreateNewTab: "onCreateNewTab"
        },
        mapGettersToProps: {
            unread: e => e.totalUnread,
            allTabs: e => e.allTabs,
            currentTab: e => e.currentTab,
            currentNav: e => e.currentNav
        }
    })(n.default)
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(167), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0}), i(774);
    const o = i(8), r = i(612), s = i(67), l = i(80), d = i(125), u = i(23), c = i(615), h = i(92), f = i(17),
        g = i(12), p = i(16), v = i(32), m = i(55), y = i(616), k = i(4), T = i(2), w = i(0), C = i(6), S = i(38),
        b = i(9), I = i(312), _ = i(22), A = i(37), D = i(73), x = i(34), N = i(18), E = i(5), P = i(20), M = i(44),
        O = i(3), F = i(11), L = i(14), B = i(59), U = i(61), R = i(25), K = i(322), W = i(431),
        V = w.default.getLogger("Thunder.Main.Renderer.view.tabs"),
        H = C.default(T.join(__rootDir, "../bin/ThunderHelper.node")), z = l.TabEventManagerNS.getEventEmitter(),
        j = i(68);
    let G = class extends o.Vue {
        constructor() {
            super(...arguments), this.titleCue = "推荐", this.isLoading = !1, this.hasDownloading = !1, this.newCount = 0, this.totalTabsOpened = !1, this.totalTabsCreated = !1, this.appendChild = null, this.tabsCount = 1, this.nextListenerCookie = 0, this.listenerMap = new Map, this.lastMainWndVisible = !1, this.lastMainWndMinimized = !1, this.tabEventEmiting = !1, this.panPluginAttachFunc = null
        }

        onTabsUpdated(e) {
            this.tabsCount = e.length, f.ipcRenderer.send("total-tabs-update", {tabs: e, current: this.current})
        }

        onCurrentUpdated(e) {
            f.ipcRenderer.send("total-tabs-update", {tabs: this.tabs, current: e})
        }

        get browserTabStyle() {
            return "find-page" === this.currentNav ? "position: fixed;" : "position: initial;"
        }

        get homepageShow() {
            return this.currentTabIsChromium || "recommend" !== this.currentTabName ? "opacity: 0; width: 0; height: 0; overflow: hidden;" : ""
        }

        get settingViewShow() {
            return "conf-setting" === j(this.currentTab, "tab", "name") && "设置中心" === j(this.currentTab, "title")
        }

        get hadSettingTab() {
            return -1 !== this.innerGetTabIndexByTitleAndName({name: "conf-setting", title: "设置中心"})
        }

        innerGetTabIndexByTitleAndName(e) {
            let t = -1;
            if (void 0 === this.tabs) return t;
            for (let i = 0; i < this.tabs.length; i++) if (this.tabs[i].title === e.title && this.tabs[i].tab.name === e.name) {
                t = i;
                break
            }
            return t
        }

        get currentTabIsChromium() {
            return j(this.currentTab, "tab", "type") === s.TabType.Chromium
        }

        get currentTabName() {
            return j(this.currentTab, "tab", "name")
        }

        get currentTabTitle() {
            return j(this.currentTab, "title")
        }

        get isDownloadingTab() {
            return 0 === this.current
        }

        isTabLoading(e) {
            let t = !1;
            do {
                let i = this.tabs[e].tab;
                if (k.isNullOrUndefined(i)) break;
                "loading" === i.state && (t = !0)
            } while (0);
            return t
        }

        handleAdd(e) {
            b.XLStatNS.trackEvent("clienttop", "clienttop_newtab_add");
            let t = {tabType: s.TabType.Chromium, tabParam: {showUrl: !1}};
            k.isNullOrUndefined(e) ? t.tabParam.index = this.tabs.length : t.tabParam.index = e + 1, this.createNewTab(t), this.$root.$emit("tab.createTab", t)
        }

        handleRemove({tab: e, index: t}) {
            return a(this, void 0, void 0, function* () {
                b.XLStatNS.trackEvent("clienttop", "clienttop_newtab_close");
                do {
                    let i = e.tab.getBeforeCloseExtra();
                    if (i && i.content) {
                        let n = yield _.MessageBox.confirm(i);
                        if (n.action === A.MessageBoxNS.Action.OK) {
                            void 0 === i.okCallbackId || null === i.okCallbackId || isNaN(i.okCallbackId) || e.tab.callNativeFunctionCallback(i.nativeCallId, i.okCallbackId, t);
                            break
                        }
                        if (n.action === A.MessageBoxNS.Action.Close) break
                    }
                    let n = {tabInfo: e, index: t};
                    this.closeTab(n), this.$root.$emit("tab.closeTab", n);
                    let a = n.tabInfo.tab.getCurUrl();
                    this.trackBrowserEvent("new_tab_close", a, "load_status=" + this.getLoadStatus(n.tabInfo.tab.state))
                } while (0)
            })
        }

        handleChange({tab: e, index: t}) {
            V.verbose(e), this.selectTab(t)
        }

        handleClick() {
            V.information("tab.click", j(this.tabs, `${this.current}`)), this.$root.$emit("tab.click", j(this.tabs, `${this.current}`))
        }

        tabListeners(e, t) {
            return {
                contextmenu: () => {
                    this.handlePopInputMenu(e, t)
                }
            }
        }

        handlePopInputMenu(e, t) {
            let i = e.getTitle();
            0 !== t && "设置中心" !== i && this.popEditableDefaultContextMenu(t)
        }

        handleOpenCopyTab(e, t) {
            let i = {tabType: s.TabType.Chromium, tabParam: {url: e, index: t + 1}};
            this.createNewTab(i)
        }

        getLoadStatus(e) {
            let t = "loading";
            switch (e) {
                case"loaded":
                    t = "success";
                    break;
                case"error":
                    t = "fail";
                    break;
                default:
                    t = "loading"
            }
            return t
        }

        handleCloseTab(e) {
            if (e > 0) {
                let t = {tabInfo: this.tabs[e], index: e};
                this.closeTab(t), this.$root.$emit("tab.closeTab", t);
                let i = t.tabInfo.tab.getCurUrl();
                this.trackBrowserEvent("new_tab_close", i, "load_status=" + this.getLoadStatus(t.tabInfo.tab.state))
            }
        }

        handleMiddleDown(e) {
            e.index > 0 && this.handleCloseTab(e.index)
        }

        popEditableDefaultContextMenu(e) {
            return a(this, void 0, void 0, function* () {
                (yield g.asyncRemoteCall.getCurrentWebContents()).once("context-menu", (t, i) => a(this, void 0, void 0, function* () {
                    let t = this.tabs.length > 2, i = e !== this.tabs.length - 1, n = [{
                            label: "打开新的标签页", accelerator: "CmdOrCtrl+T", click: () => {
                                this.menuItemClick("add", e)
                            }
                        }, {type: "separator"}, {
                            label: "重新加载", accelerator: "CmdOrCtrl+R", click: () => {
                                this.menuItemClick("reload", e)
                            }
                        }, {
                            label: "复制", enabled: "社区" !== this.tabs[e].tab.getTitle(), click: () => {
                                this.menuItemClick("copy", e)
                            }
                        }, {
                            label: "关闭标签页", accelerator: "CmdOrCtrl+W", click: () => {
                                this.menuItemClick("close", e)
                            }
                        }, {
                            label: "关闭其他标签页", enabled: t, click: () => {
                                this.menuItemClick("close-other-tabs", e)
                            }
                        }, {
                            label: "关闭右侧标签页", enabled: i, click: () => {
                                this.menuItemClick("close-tabs-to-the-right", e)
                            }
                        }], a = yield(yield g.asyncRemoteCall.getMenu()).buildFromTemplate(n),
                        o = yield g.asyncRemoteCall.getCurrentWindow();
                    yield D.MenuSkinNS.setStyle(a, {}), yield a.popup({window: o})
                }))
            })
        }

        menuItemClick(e, t, i) {
            if ("add" === e) this.handleAdd(t); else if ("close" === e) this.handleCloseTab(t); else if ("reload" === e) this.tabs[t].tab.refresh(!1); else if ("copy" === e) this.handleOpenCopyTab(this.tabs[t].tab.url, t); else if ("close-other-tabs" === e) {
                let e = t;
                for (let t = this.tabs.length - 1; t > 0; t--) t !== e && this.handleCloseTab(t)
            } else if ("close-tabs-to-the-right" === e) {
                let e = t;
                for (let t = this.tabs.length - 1; t > 0; t--) t > e && this.handleCloseTab(t)
            }
        }

        handleKeydownHotkey(e) {
            do {
                if (!e.ctrlKey) break;
                if ("t" === e.key || "T" === e.key) {
                    this.handleAdd(this.current);
                    break
                }
                if ("r" !== e.key && "R" !== e.key || this.tabs[this.current].tab.refresh(!1), "w" === e.key || "W" === e.key) {
                    this.handleCloseTab(this.current);
                    break
                }
            } while (0)
        }

        mounted() {
            return a(this, void 0, void 0, function* () {
                z.on(l.TabEventManagerNS.EventType.CreateNewTab, this.onCreateTab), (yield g.asyncRemoteCall.getGlobalShortcut()).register("ctrl+shift+f12", () => {
                    this.tabs[this.current].tab.showDevTool(!0)
                }), window.addEventListener("keydown", this.handleKeydownHotkey, !0), window.addEventListener("keyup", e => {
                    "F5" === e.key && this.tabs[this.current].tab.refresh(!1)
                }, !0);
                let e = [{eventName: "init-done", listener: this.onInit}, {
                    eventName: "before-nav",
                    listener: this.onBeforeNavigate
                }, {eventName: "title-change", listener: this.onTitleChange}, {
                    eventName: "favicon-url-change",
                    listener: this.onFaviconURLChange
                }, {eventName: "address-change", listener: this.onAddressChange}, {
                    eventName: "new-browser-popup",
                    listener: this.onNewBrowserPopup
                }, {
                    eventName: "new-browser-popup-done",
                    listener: this.onNewBrowserPopupCompleted
                }, {eventName: "open-url-from-tab", listener: this.onOpenURLFromTab}, {
                    eventName: "destroyed",
                    listener: this.onAfterBrowserDestroy
                }, {eventName: "load-start", listener: this.onLoadStart}, {
                    eventName: "load-end",
                    listener: this.onLoadEnd
                }, {eventName: "loading-state-change", listener: this.onLoadingStateChange}, {
                    eventName: "load-error",
                    listener: this.onLoadError
                }, {eventName: "got-focus", listener: this.onGotFocus}, {
                    eventName: "before-download",
                    listener: this.onBeforeDownload.bind(this)
                }, {
                    eventName: "custom-protocol-execution",
                    listener: this.onCustomProtocalExecution.bind(this)
                }, {
                    eventName: "call-native-func",
                    listener: this.onChromiumJsCallNativeFunction
                }, {eventName: "check-native-func", listener: this.onChromiumCheckNativeFunction}, {
                    eventName: "close",
                    listener: this.onClose
                }, {eventName: "hotkey", listener: this.onHotKey}];
                l.setDefaultListeners(e);
                let t = [{
                    functionName: "openNewTab",
                    nativeFunc: this.openNewTab.bind(this)
                }, {
                    functionName: "OpenNewTab",
                    nativeFunc: this.openNewTab.bind(this)
                }, {
                    functionName: "GetTabIndexByTitleAndName",
                    nativeFunc: this.getTabIndexByTitleAndName.bind(this)
                }, {
                    functionName: "SelectTab",
                    nativeFunc: this.selectTabByIndex.bind(this)
                }, {
                    functionName: "IsTabSelected",
                    nativeFunc: this.isTabSelected.bind(this)
                }, {
                    functionName: "CloseCurrentTab",
                    nativeFunc: this.closeCurrentTab.bind(this)
                }, {
                    functionName: "CloseTabByIndex",
                    nativeFunc: this.closeTabByIndex.bind(this)
                }, {
                    functionName: "TabBeforeClose",
                    nativeFunc: this.tabBeforeClose.bind(this)
                }, {
                    functionName: "CloseTabByName",
                    nativeFunc: this.closeTabName.bind(this)
                }, {
                    functionName: "AttachTabEvent",
                    nativeFunc: this.attachTabEvent.bind(this)
                }, {functionName: "DetachTabEvent", nativeFunc: this.detachTabEvent.bind(this)}];
                v.NativeCallNS.registerNativeFunction(t);
                let i = {
                    openNewTab: this.plugin_openNewTab.bind(this),
                    OpenNewTab: (e, t, ...i) => {
                        do {
                            let n = i[0], a = "vip-download-webview";
                            if (t.name.toLowerCase() !== a.toLowerCase() && this.isVipPayUrl(n) && P.server.isRemoteClientExist(a)) {
                                P.server.callClientFunctionByName(a, "OpenPayVipUrl", n);
                                break
                            }
                            this.plugin_openNewTab(e, t, ...i)
                        } while (0)
                    },
                    GetTabIndexByTitleAndName: this.plugin_getTabIndexByTitleAndName.bind(this),
                    SelectTab: this.plugin_selectTabByIndex.bind(this),
                    CloseTabByIndex: this.plugin_closeTabByIndex.bind(this)
                };
                P.server.registerFunctions(i);
                let n = yield g.asyncRemoteCall.getCurrentWindow();
                n.on("resize", () => {
                    this.resizeCurrentBrowserWindow()
                }), n.on("move", () => {
                    this.resizeCurrentBrowserWindow()
                }), n.on("show", () => {
                    this.resizeCurrentBrowserWindow()
                }), m.quitPromises.add(this.quitBrowser), p.NativeCallModule.nativeCall.AttachNativeEvent("onWebEvent", (...e) => {
                    if (0 === this.tabs.length) return;
                    if (k.isNullOrUndefined(e) || k.isNullOrUndefined(e[0])) return;
                    let t = e[0];
                    e.splice(0, 1);
                    for (let i = 0; i < this.tabs.length; i++) this.tabs[i].tab.fireEvent(t, ...e)
                }), p.NativeCallModule.nativeCall.AttachNativeEvent("onFireLoginEvent", (e, t) => {
                    if (0 !== this.tabs.length) for (let i = 0; i < this.tabs.length; i++) {
                        let n = this.tabs[i];
                        n && n.tab.getTabType() !== s.TabType.XDAS && this.tabs[i].tab.fireEvent("onFireLoginEvent", e, t)
                    }
                }), p.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", e => {
                    if (0 !== this.tabs.length) for (let t = 0; t < this.tabs.length; t++) this.tabs[t].tab.fireEvent("OnUserLogin", e)
                }), p.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", e => {
                    if (0 !== this.tabs.length) {
                        V.information("监听到了退出事件！onLogout");
                        for (let t = 0; t < this.tabs.length; t++) this.tabs[t].tab.fireEvent("OnUserLogout", e)
                    }
                }), p.NativeCallModule.nativeCall.AttachNativeEvent("onLoginWndClose", e => {
                    if (0 !== this.tabs.length) {
                        V.information("监听到了关闭事件：onLoginWndClose：", e);
                        for (let t = 0; t < this.tabs.length; t++) this.tabs[t].tab.fireEvent("OnLoginWndClose", e)
                    }
                }), this.lastMainWndVisible = yield n.isVisible(), this.lastMainWndMinimized = yield n.isMinimizable(), n.on("hide", this.fireTabVisibleChangeEvent), n.on("minimize", this.fireTabVisibleChangeEvent), n.on("show", this.fireTabVisibleChangeEvent), n.on("restore", this.fireTabVisibleChangeEvent), n.on("maximize", this.fireTabVisibleChangeEvent), n.on("unmaximize", this.fireTabVisibleChangeEvent), z.on(l.TabEventManagerNS.EventType.RemoveTab, this.onTabEvent), z.on(l.TabEventManagerNS.EventType.AddTab, this.onTabEvent), z.on(l.TabEventManagerNS.EventType.ChangeTab, this.onTabEvent), z.on(l.TabEventManagerNS.EventType.VisibleChange, this.onTabVisibleChange)
            })
        }

        trackBrowserEvent(e, t, i = "") {
            do {
                if (!t || "" === t) break;
                let n = M.parse(t);
                if (n.host && n.host.indexOf(".xunlei.com") < 0) break;
                i = i + (i.length > 0 ? "," : "") + "url=" + encodeURIComponent(t), b.XLStatNS.trackEvent("new_tab", e, "", 0, 0, 0, 0, i)
            } while (0)
        }

        fireTabVisibleChangeEvent() {
            return a(this, void 0, void 0, function* () {
                let e = yield g.asyncRemoteCall.getCurrentWindow();
                if (e && !(yield e.isDestroyed())) {
                    let t = yield e.isVisible(), i = yield e.isMinimized();
                    if (this.tabEventEmiting || (t && !i) !== (this.lastMainWndVisible && !this.lastMainWndMinimized)) {
                        V.information("发送tab状态和主窗口状态改变事件 visible:", t, ", minimized:", i, ", current:", this.current);
                        for (let e = 0; e < this.tabs.length; e++) this.tabs[e].tab.fireEvent("OnTabVisibleChange", t && !i, this.current === e), z.emit(l.TabEventManagerNS.EventType.VisibleChange, this.tabs[e].tab, t && !i, this.current === e)
                    }
                    this.lastMainWndVisible = t, this.lastMainWndMinimized = i
                }
            })
        }

        onTabEvent() {
            this.$nextTick(() => a(this, void 0, void 0, function* () {
                this.tabEventEmiting = !0, yield this.fireTabVisibleChangeEvent(), this.tabEventEmiting = !1
            }))
        }

        onTabVisibleChange(e, t, i) {
            if (V.information("onTabVisibleChange", e, t, i), t && i && e.getTabType() === s.TabType.Chromium) do {
                let t = e.getBrowser();
                if (k.isNullOrUndefined(t)) {
                    V.error(t);
                    break
                }
                let i = t.getWindowHandle();
                if (!1 === H.isWindowHandle(i)) break;
                H.setWindowFocus(i, !0)
            } while (0)
        }

        onCreateTab(e, t) {
            V.information("[tbc] onCreateTab", t), this.onCreateNewTab({newTab: e, createTabParam: t})
        }

        quitBrowser() {
            return a(this, void 0, void 0, function* () {
                return (yield g.asyncRemoteCall.getGlobalShortcut()).unregister("ctrl+shift+f12"), new Promise(e => {
                    this.onAppQuit(), e(!0)
                })
            })
        }

        getBrowserTab(e) {
            let t = null;
            if (this.allTabs) {
                let i = null;
                for (let n = 0; n < this.allTabs.length; ++n) i = this.allTabs[n].tab.getBrowser(), k.isNullOrUndefined(i) || e === i && (t = this.allTabs[n].tab)
            }
            return t
        }

        fireBrowserEvent(e, t) {
            V.information("fireBrowserEvent eventName", e, "tabName", t);
            let i = this.listenerMap.get(e);
            i && i.forEach((e, i) => {
                e.tabName === t && e.tab.callNativeFunctionCallback(e.nativeCallId, e.callBackId, t)
            })
        }

        onInit(e, t) {
            let i = e.target;
            if (i) {
                let e = {hwnd: i.getWindowHandle(), browser: i};
                this.onBrowserBindWindowHandle(e), i.addCustomProtocol("ed2k://"), i.addCustomProtocol("thunder://"), i.addCustomProtocol("magnet:?"), i.registerHotKey(h.Key.F5, h.KeyModifiers.CTRL_DOWN), i.registerHotKey(h.Key.F5, h.KeyModifiers.NONE), i.registerHotKey(h.Key.T, h.KeyModifiers.CTRL_DOWN), i.registerHotKey(h.Key.R, h.KeyModifiers.CTRL_DOWN), i.registerHotKey(h.Key.W, h.KeyModifiers.CTRL_DOWN), c.registerContextMenu(i)
            }
        }

        onTitleChange(e, t) {
            V.information("onTitleChange title", t);
            let i = {title: t, browser: e.target}, n = this.getBrowserTab(e.target);
            if (!k.isNullOrUndefined(n)) {
                this.fireBrowserEvent("OnTitleChange", n.name);
                let e = n.url;
                K.CommonSitesMgrNS.getInstance().updateItem({url: e, name: t}, "OnTitleChange")
            }
            this.onBrowserTitleChange(i)
        }

        onBeforeNavigate(e, t, i, n) {
            V.information("beforenavigate", t, i, n), t && this.trackBrowserEvent("browser_load_before_navigation", i)
        }

        onFaviconURLChange(e, t) {
            V.information("icon", t);
            let i = "", n = 0;
            for (n = 0; n < this.tabs.length; n++) if (this.tabs[n].tab.getBrowser() === e.target) {
                i = this.tabs[n].tab.url;
                break
            }
            let a = {iconUrl: t, browser: e.target};
            do {
                if (!i) break;
                if ("" === i) break;
                this.getIcon(i, t).catch(), k.isNullOrUndefined(this.tabs[n]) || this.fireBrowserEvent("OnFaviconURLChange", this.tabs[n].tab.name), this.onBrowserFavIconChange(a)
            } while (0)
        }

        onAddressChange(e, t, i) {
            V.information("onAddressChange", t, i);
            let n = {isMainFrame: t, url: i, browser: e.target}, a = this.getBrowserTab(e.target);
            if (!k.isNullOrUndefined(a) && (this.fireBrowserEvent("OnAddressChange", a.name), t)) {
                let e = ["http://misc.xl9.xunlei.com/chrome/client/view/dist/1.0/new_tab.html", "http://pc.xunlei.com/pages/#/new-tab", "http://pc.xunlei.com/pages/#/help/question?tab=user_guide", "http://pc.xunlei.com/pages/#/help/question?tab=usually_question"];
                "community" === a.name || e.includes(i) || (K.CommonSitesMgrNS.getInstance().updateItem({url: i}, "OnAddressChange"), W.historyManager.update({url: i}, "OnAddressChange"))
            }
            this.onBrowserAddressChange(n)
        }

        onNewBrowserPopup(e, t, i, n, o, r) {
            return a(this, void 0, void 0, function* () {
                let t = e.target.getURL(), n = {url: i, refUrl: t, ev: e};
                b.XLStatNS.trackEvent("clienttop", "browsertabpage_show", "", 0, 0, 0, 0, "source=url_click");
                let a = this.getBrowserTab(e.target);
                k.isNullOrUndefined(a) || this.fireBrowserEvent("OnNewBrowserPopup", a.name), yield this.onBrowserNewBrowserPopup(n)
            })
        }

        onNewBrowserPopupCompleted(e, t) {
            V.information(t);
            let i = {url: t, browser: e.target}, n = this.getBrowserTab(e.target);
            k.isNullOrUndefined(n) || this.fireBrowserEvent("OnNewBrowserPopupCompleted", n.name), this.onBrowserNewBrowserPopupCompleted(i)
        }

        onOpenURLFromTab(e, t, i) {
            V.information(t), V.information(i)
        }

        onAfterBrowserDestroy(e) {
            V.information(e.target)
        }

        onLoadStart(e, t, i, n) {
            V.information("OnLoadStart", t, i, n);
            let a = e.target, o = {isMainFrame: t, url: i, transitionType: n, browser: a}, r = this.getBrowserTab(a);
            k.isNullOrUndefined(r) || this.fireBrowserEvent("OnLoadStart", r.name), this.onBrowserLoadStart(o), t && this.trackBrowserEvent("browser_load_navigation_start", i)
        }

        onLoadEnd(e, t, i, n, a) {
            V.information("onLoadEnd", t, i, n, a);
            let o = e.target, r = {isMainFrame: t, url: i, frameName: n, httpStatusCode: a, browser: o},
                s = this.getBrowserTab(o);
            k.isNullOrUndefined(s) || this.fireBrowserEvent("OnLoadEnd", s.name), this.onBrowserLoadEnd(r), t && "error" !== s.state && this.trackBrowserEvent("browser_load_navigation_result", i, "result=success")
        }

        onLoadingStateChange(e, t, i, n) {
            V.information("onLoadingStateChange", t, i, n);
            let a = e.target, o = {isLoading: t, canGoBack: i, canGoForward: n, browser: a}, r = this.getBrowserTab(a);
            k.isNullOrUndefined(r) || this.fireBrowserEvent("OnLoadingStateChange", r.name), this.onBrowserLoadStatusChange(o)
        }

        onLoadError(e, t, i, n, a, o) {
            V.information("OnLoadError", t, n, a, o, i);
            let r = e.target, s = {isMainFrame: t, url: i, errorCode: n, errorText: a, failedUrl: o, browser: r},
                l = this.getBrowserTab(r);
            k.isNullOrUndefined(l) || this.fireBrowserEvent("OnLoadError", l.name), this.onBrowserLoadError(s), t && this.trackBrowserEvent("browser_load_navigation_result", i, "result=fail")
        }

        onGotFocus(e) {
            return a(this, void 0, void 0, function* () {
                let t = void 0;
                for (let i = 0; i < this.tabs.length; i++) k.isNullOrUndefined(this.tabs[i]) || k.isNullOrUndefined(this.tabs[i].tab) || (t = this.tabs[i].tab.getBrowser(), k.isNullOrUndefined(t) || e.target === t && z.emit(l.TabEventManagerNS.EventType.GotFocus, this.tabs[i].tab));
                let i = (yield(yield g.asyncRemoteCall.getCurrentWindow()).getNativeWindowHandle()).readUInt32LE(0);
                I.ThunderWindowNS.bringWindowToTop(i)
            })
        }

        onBeforeDownload(e, t, i, n, o) {
            return a(this, void 0, void 0, function* () {
                V.information("onBeforeDownload", t, i, "suggestName:", n, "mimeType", o);
                const e = ["http://lx.patch1.9you.com/xlwan/%E8%BF%85%E9%9B%B7_%E7%A5%9E%E5%BA%A7.exe"];
                let r = R.default.getConfigInfo("webgame", "directDownloadUrls");
                if (k.isArray(r) || (r = e), V.information("onBeforeDownload urlList", r), r.includes(t)) {
                    const e = F.DownloadKernelTaskManager.getTaskManager();
                    let i = yield B.TaskUtilitiesAWNS.batchFindTaskAW([{
                        taskType: O.DownloadKernel.TaskType.P2sp,
                        value: t
                    }]);
                    if (i.length > 0) {
                        let e = i[0];
                        _.MessageBox.confirm({
                            title: "重复下载，该任务已存在列表中",
                            type: _.MessageBox.ConfirmType.Warning,
                            fileName: e.getTaskName(),
                            okText: "查看",
                            cancelText: "取消",
                            cancelVisible: !0
                        }).then(t => a(this, void 0, void 0, function* () {
                            if (t.action === A.MessageBoxNS.Action.OK) {
                                let t = e.getId();
                                S.ThunderNewTask.selectTask(t)
                            } else t.action, A.MessageBoxNS.Action.Cancel
                        })).catch()
                    } else {
                        let i = L.ThunderUtil.getDefaultDownloadDir(), n = U.ParseUrlFileNameNS.getNameFromUrl(t),
                            o = {taskName: n = n.replace(/[*?/\\:|<>\"]/g, "_"), savePath: i},
                            r = {url: t, refUrl: "", cookie: "", nameFixed: 1},
                            s = yield e.createTask(O.DownloadKernel.TaskType.P2sp, {taskBaseInfo: o, p2spTaskInfo: r});
                        if (null !== s) {
                            let t = s.getTaskAttribute(O.DownloadKernel.TaskAttribute.TaskId);
                            e.startTask(t), _.MessageBox.confirm({
                                title: "任务已创建，请前往下载列表查看",
                                type: _.MessageBox.ConfirmType.Success,
                                fileName: s.getTaskName(),
                                okText: "立即查看",
                                cancelVisible: !1
                            }).then(e => a(this, void 0, void 0, function* () {
                                if (e.action === A.MessageBoxNS.Action.OK) {
                                    let e = s.getId();
                                    S.ThunderNewTask.selectTask(e)
                                }
                            })).catch()
                        }
                    }
                } else S.ThunderNewTask.createTaskByUrl(t, n)
            })
        }

        onCustomProtocalExecution(e, t) {
            S.ThunderNewTask.createTaskByUrl(t)
        }

        onChromiumJsCallNativeFunction(e, t, i, n) {
            let a = {nativeCallId: 0, functionName: t, callBackId: i, browser: e.target, args: n};
            this.onJsCallNativeFunction(a)
        }

        onChromiumCheckNativeFunction(e, t, i) {
            let n = {nativeCallId: 0, functionName: t, callBackId: i, browser: e.target};
            this.onJsCheckNativeFunction(n)
        }

        onClose(e) {
            V.information("onClose");
            let t = void 0;
            for (let i = 0; i < this.allTabs.length; i++) if (!k.isNullOrUndefined(this.allTabs[i]) && !k.isNullOrUndefined(this.allTabs[i].tab) && (t = this.allTabs[i].tab.getBrowser(), !k.isNullOrUndefined(t) && e.target === t)) {
                let e = {tabInfo: this.allTabs[i], index: i};
                this.fireBrowserEvent("OnCloseBrowser", j(e, "tabInfo", "tab", "name")), this.closeTab(e);
                break
            }
        }

        onHotKey(e, t, i) {
            V.information("onHotKey", i, t);
            let n = void 0;
            for (let a = 0; a < this.tabs.length; a++) if (!k.isNullOrUndefined(this.tabs[a]) && !k.isNullOrUndefined(this.tabs[a].tab) && (n = this.tabs[a].tab.getBrowser(), !k.isNullOrUndefined(n) && e.target === n)) {
                116 === t && e.target.refresh();
                do {
                    if (4 !== i) break;
                    84 === t && this.handleAdd(this.current), 82 === t && this.tabs[this.current].tab.refresh(!1), 87 === t && this.handleCloseTab(this.current)
                } while (0);
                break
            }
        }

        getIcon(e, t) {
            return a(this, void 0, void 0, function* () {
                let i = new URL(e).host, n = x.ToolsUtilitiesAWNS.genarateMd5(i),
                    a = __profilesDir + "/BookMarksIcon/" + n + ".png";
                return yield this.downloadIcon(e, t, a)
            })
        }

        downloadIcon(e, t, i) {
            return a(this, void 0, void 0, function* () {
                let n = null, a = !1;
                try {
                    n = yield N.default.get(t, {responseType: "arraybuffer"})
                } catch (e) {
                    V.error("error " + e)
                }
                if (null !== n && void 0 !== n.status && 200 === n.status && null !== n.data && (a = yield E.FileSystemAWNS.writeFileAW(i, n.data))) {
                    let t = {url: e, iconUrl: i};
                    this.updateBookMarksIconUrl(t), K.CommonSitesMgrNS.getInstance().updateItem({
                        url: e,
                        iconUrl: i
                    }, "OnFaviconURLChange"), W.historyManager.update({url: e, iconUrl: i}, "OnFaviconURLChange")
                }
                return a
            })
        }

        internal_openNewTab(e, t) {
            let i = {url: e};
            if (t) try {
                i = Object.assign(i, JSON.parse(t))
            } catch (e) {
                V.warning(e)
            }
            let n = {tabType: s.TabType.Chromium, tabParam: i};
            V.information("tabParam:", i), this.createNewTab(n)
        }

        openNewTab(e, t, i, n) {
            do {
                if (V.information(e), k.isNullOrUndefined(e)) {
                    V.error(e);
                    break
                }
                if (k.isNullOrUndefined(t) || k.isNullOrUndefined(i)) {
                    V.error(t, i);
                    break
                }
                if (k.isNullOrUndefined(n) || k.isNullOrUndefined(n[0])) {
                    let n = e.callNativeFunctionCallback(t, i, u.NativeFunctionErrorCode.ParamError);
                    !0 !== n && V.error(n);
                    break
                }
                this.internal_openNewTab(n[0], n[1]), e.callNativeFunctionCallback(t, i, u.NativeFunctionErrorCode.Success, "create_new_tab_ok")
            } while (0)
        }

        plugin_openNewTab(e, t, ...i) {
            do {
                if (!e) break;
                if (!i || !i[0]) break;
                this.internal_openNewTab(i[0], i[1])
            } while (0)
        }

        internal_getTabIndexByTitleAndName(e) {
            let t = -1;
            do {
                let i = null;
                try {
                    i = JSON.parse(e)
                } catch (e) {
                    V.warning(e)
                }
                if (!i) break;
                if (void 0 !== this.tabs) for (let e = 0; e < this.tabs.length; e++) if (this.tabs[e].title === i.title && this.tabs[e].tab.name === i.name) {
                    t = e;
                    break
                }
            } while (0);
            return t
        }

        getTabIndexByTitleAndName(e, t, i, n) {
            do {
                if (V.information(e), k.isNullOrUndefined(e)) {
                    V.error(e);
                    break
                }
                if (k.isNullOrUndefined(t) || k.isNullOrUndefined(i)) {
                    V.error(t, i);
                    break
                }
                if (k.isNullOrUndefined(n) || k.isNullOrUndefined(n[0])) {
                    let n = e.callNativeFunctionCallback(t, i, u.NativeFunctionErrorCode.ParamError);
                    !0 !== n && V.error(n);
                    break
                }
                let a = this.internal_getTabIndexByTitleAndName(n[0]);
                e.callNativeFunctionCallback(t, i, u.NativeFunctionErrorCode.Success, a)
            } while (0)
        }

        plugin_getTabIndexByTitleAndName(e, t, ...i) {
            let n = -1;
            do {
                if (!e) break;
                if (!i || !i[0]) break;
                n = this.internal_getTabIndexByTitleAndName(i[0])
            } while (0);
            return n
        }

        isVipPayUrl(e) {
            let t = !1;
            do {
                if (!e) break;
                let i = M.parse(e);
                if (!i) break;
                if ("http:" !== i.protocol && "https:" !== i.protocol) break;
                if ("pay.xunlei.com" === i.host) {
                    if (L.ThunderUtil.getQueryString(e, "referfrom")) {
                        t = !0;
                        break
                    }
                }
            } while (0);
            return t
        }

        closeCurrentTab(e, t, i, n) {
            do {
                if (V.information("closeCurrentTab", e), k.isNullOrUndefined(e)) {
                    V.error(e);
                    break
                }
                if (k.isNullOrUndefined(t) || k.isNullOrUndefined(i)) {
                    V.error(t, i);
                    break
                }
                if (e === this.tabs[this.current].tab) {
                    let e = {tabInfo: this.tabs[this.current], index: this.current};
                    this.closeTab(e)
                }
            } while (0)
        }

        tabBeforeClose(e, t, i, n) {
            do {
                if (V.information("tabBeforeClose", e), k.isNullOrUndefined(e)) {
                    V.error(e);
                    break
                }
                if (k.isNullOrUndefined(t) || k.isNullOrUndefined(i)) {
                    V.error(t, i);
                    break
                }
                let a = null;
                if (n[0]) try {
                    a = JSON.parse(n[0])
                } catch (e) {
                }
                let o = n[1];
                a && "object" == typeof a && (a = Object.assign({}, a, {
                    nativeCallId: t,
                    okCallbackId: o
                })), e.setBeforeCloseExtra(a), e.callNativeFunctionCallback(t, i, u.NativeFunctionErrorCode.Success)
            } while (0)
        }

        closeTabName(e, t, i, n) {
            V.information("closeTabName args", n);
            do {
                if (k.isNullOrUndefined(e) || k.isNullOrUndefined(t) || k.isNullOrUndefined(i)) break;
                if (k.isNullOrUndefined(n) || k.isNullOrUndefined(n[0])) {
                    e.callNativeFunctionCallback(t, i, u.NativeFunctionErrorCode.ParamError);
                    break
                }
                this.closeTabByName(n[0]), e.callNativeFunctionCallback(t, i, u.NativeFunctionErrorCode.Success)
            } while (0)
        }

        attachTabEvent(e, t, i, n) {
            V.information("attachTabEvent args", n);
            do {
                if (k.isNullOrUndefined(e) || k.isNullOrUndefined(t) || k.isNullOrUndefined(i)) break;
                if (k.isNullOrUndefined(n) || k.isNullOrUndefined(n[0]) || k.isNullOrUndefined(n[1])) {
                    e.callNativeFunctionCallback(t, i, u.NativeFunctionErrorCode.ParamError);
                    break
                }
                let a = n[0], o = {};
                o.tab = e, o.nativeCallId = t, o.tabName = n[1], o.callBackId = n[2];
                let r = this.nextListenerCookie, s = this.listenerMap.get(a);
                s || (s = new Map, this.listenerMap.set(a, s)), s.set(r, o), ++this.nextListenerCookie, V.information("attachTabEvent listenerMap", this.listenerMap, r), e.callNativeFunctionCallback(t, i, u.NativeFunctionErrorCode.Success, r)
            } while (0)
        }

        detachTabEvent(e, t, i, n) {
            V.information("detachEvent enter");
            do {
                if (k.isNullOrUndefined(e) || k.isNullOrUndefined(t) || k.isNullOrUndefined(i)) break;
                if (k.isNullOrUndefined(n) || k.isNullOrUndefined(n[0])) {
                    e.callNativeFunctionCallback(t, i, u.NativeFunctionErrorCode.ParamError);
                    break
                }
                let a = n[0];
                V.information("detachEvent cookie:", a), this.listenerMap.forEach(e => {
                    e.delete(a)
                }), e.callNativeFunctionCallback(t, i, u.NativeFunctionErrorCode.Success)
            } while (0)
        }

        internal_closeTabByIndex(e) {
            {
                let t = {tabInfo: this.tabs[e], index: e};
                this.closeTab(t), this.$root.$emit("tab.closeTab", t)
            }
        }

        closeTabByIndex(e, t, i, n) {
            do {
                if (k.isNullOrUndefined(e)) {
                    V.error(e);
                    break
                }
                if (k.isNullOrUndefined(t) || k.isNullOrUndefined(i)) {
                    V.error(t, i);
                    break
                }
                const a = n[0];
                if (k.isNullOrUndefined(a)) break;
                this.internal_closeTabByIndex(a), e.callNativeFunctionCallback(t, i, u.NativeFunctionErrorCode.Success, {
                    tabs: this.tabs,
                    current: this.current
                })
            } while (0)
        }

        plugin_closeTabByIndex(e, t, ...i) {
            let n = void 0;
            do {
                if (!e) break;
                if (!i || !i[0]) break;
                this.internal_closeTabByIndex(i[0]), n = {tabs: this.tabs, current: this.current}
            } while (0);
            return n
        }

        isTabSelected(e, t, i, n) {
            let a = !1;
            do {
                if (V.information("isTabSelected tab:", e), k.isNullOrUndefined(e)) {
                    V.error(e);
                    break
                }
                if (k.isNullOrUndefined(t) || k.isNullOrUndefined(i)) {
                    V.error(t, i);
                    break
                }
                e === this.tabs[this.current].tab && (a = !0), e.callNativeFunctionCallback(t, i, u.NativeFunctionErrorCode.Success, a)
            } while (0);
            return a
        }

        selectTabByIndex(e, t, i, n) {
            do {
                if (V.information("selectTabByIndex", e), k.isNullOrUndefined(e)) {
                    V.error(e);
                    break
                }
                if (k.isNullOrUndefined(t) || k.isNullOrUndefined(i)) {
                    V.error(t, i);
                    break
                }
                let a = n[0];
                V.information("selectTabByIndex index", a), this.selectTab(a), e.callNativeFunctionCallback(t, i, u.NativeFunctionErrorCode.Success, "create_new_tab_ok")
            } while (0)
        }

        plugin_selectTabByIndex(e, t, ...i) {
            do {
                if (!e) break;
                if (!i || !i[0]) break;
                let t = i[0];
                this.selectTab(t)
            } while (0)
        }

        resizeCurrentBrowserWindow() {
            do {
                if (0 === this.tabs.length) break;
                let e = this.tabs[this.current].tab;
                if (k.isNullOrUndefined(e)) break;
                if (e.getTabType() === s.TabType.Chromium) {
                    let t = e.getBrowser();
                    if (k.isNullOrUndefined(t)) break;
                    if (!0 === e.isErrorPage) break;
                    let i = t.getWindowHandle();
                    if (!1 === H.isWindowHandle(i)) {
                        V.error(i);
                        break
                    }
                    d.BrowserSupportNS.resizeBrowserWindow(i)
                }
            } while (0)
        }

        handleTotalClick(e) {
            return a(this, void 0, void 0, function* () {
                if (this.totalTabsOpened) return;
                const t = e.currentTarget.getBoundingClientRect(), i = e.currentTarget.cloneNode();
                if (i.style.position = "fixed", i.style.zIndex = "100", i.style.opacity = "0", i.style.top = t.top + "px", i.style.left = t.left + "px", i.style.marginTop = "0", this.totalTabsCreated) document.body.appendChild(i), this.appendChild = i, f.ipcRenderer.send("message-box-open", {
                    name: "TotalTabs",
                    position: {
                        x: Math.floor(window.screenX + t.left - 147 + 28),
                        y: Math.floor(window.screenY + t.top + 28)
                    }
                }); else {
                    this.totalTabsOpened = this.totalTabsCreated = !0, document.body.appendChild(i), this.appendChild = i, _.MessageBox.custom("TotalTabs", {
                        tabs: this.tabs,
                        current: this.current
                    }, {
                        width: 147,
                        height: 395,
                        x: Math.floor(window.screenX + t.left - 147 + 28),
                        y: Math.floor(window.screenY + t.top + 28),
                        modal: !1,
                        transparent: !1
                    }), (yield g.asyncRemoteCall.getIpcMain()).on("total-tabs-hide", () => {
                        this.totalTabsOpened = !1, this.appendChild && (document.body.removeChild(this.appendChild), this.appendChild = null)
                    })
                }
            })
        }
    };
    n([o.Prop({})], G.prototype, "bookMarks", void 0), n([o.Prop({})], G.prototype, "currentCategoryId", void 0), n([o.Prop({})], G.prototype, "currentTab", void 0), n([o.Prop({})], G.prototype, "tabs", void 0), n([o.Prop({})], G.prototype, "allTabs", void 0), n([o.Prop({})], G.prototype, "unread", void 0), n([o.Prop({})], G.prototype, "updateBookMarksIconUrl", void 0), n([o.Prop({})], G.prototype, "createNewTab", void 0), n([o.Prop({})], G.prototype, "onBrowserBindWindowHandle", void 0), n([o.Prop({})], G.prototype, "onBrowserTitleChange", void 0), n([o.Prop({})], G.prototype, "onBrowserFavIconChange", void 0), n([o.Prop({})], G.prototype, "onBrowserLoadStatusChange", void 0), n([o.Prop({})], G.prototype, "onBrowserAddressChange", void 0), n([o.Prop({})], G.prototype, "onBrowserNewBrowserPopup", void 0), n([o.Prop({})], G.prototype, "onBrowserNewBrowserPopupCompleted", void 0), n([o.Prop({})], G.prototype, "onBrowserLoadStart", void 0), n([o.Prop({})], G.prototype, "onBrowserLoadEnd", void 0), n([o.Prop({})], G.prototype, "onBrowserLoadError", void 0), n([o.Prop({})], G.prototype, "selectTab", void 0), n([o.Prop({})], G.prototype, "closeTab", void 0), n([o.Prop({})], G.prototype, "closeTabByName", void 0), n([o.Prop({})], G.prototype, "removeTabCtrl", void 0), n([o.Prop({})], G.prototype, "onCreateNewTab", void 0), n([o.Prop({})], G.prototype, "onAppQuit", void 0), n([o.Prop({})], G.prototype, "onJsCallNativeFunction", void 0), n([o.Prop({})], G.prototype, "onJsCheckNativeFunction", void 0), n([o.Prop({default: "transparent"})], G.prototype, "background", void 0), n([o.Prop({default: 0})], G.prototype, "current", void 0), n([o.Prop({})], G.prototype, "updateCurrent", void 0), n([o.Prop({})], G.prototype, "updateTabs", void 0), n([o.Prop({})], G.prototype, "currentNav", void 0), n([o.Watch("tabs", {deep: !0})], G.prototype, "onTabsUpdated", null), n([o.Watch("current")], G.prototype, "onCurrentUpdated", null), G = n([o.Component({
        filters: {unread: y.unread},
        components: {HomePage: r.default, BrowserViewContainer: () => Promise.resolve().then(() => i(617))}
    })], G), t.default = G
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(169), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(613), a = i(33);
    t.default = a.connector.connect({
        mapStateToProps: {
            tabs: e => e.Tabs.tabs,
            homePageUrl: e => e.WebView.homePageUrl,
            preloadPath: e => `file:///${__rootDir}/out/common-preload.js`
        },
        mapCommitToProps: {onMounted: "ON_MOUNTED", createNewTab: "CREATE_NEW_TAB"},
        mapDispatchToProps: {selectTab: "selectTab"}
    })(n.default)
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(171), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(2), r = i(8), s = i(67), l = i(452), d = i(0), u = i(83), c = d.default.getLogger("home-page"),
        h = i(26), f = i(326);
    let g = class extends r.Vue {
        constructor() {
            super(...arguments), this.elementId = "home-1EAC214F-7644-4163-9EB8-AF4BAA62D144"
        }

        indexOfTab(e) {
            let t = -1;
            for (let i = 0; i < this.tabs.length; i++) if (this.tabs[i].tab.getTabType() === s.TabType.Chromium && this.tabs[i].tab.getOriginalUrl() === e) {
                t = i;
                break
            }
            return t
        }

        mounted() {
            this.enableDevTools(), this.initNativeCall()
        }

        enableDevTools() {
            window.addEventListener("keyup", e => a(this, void 0, void 0, function* () {
                "F12" === e.key && e.shiftKey && (yield u.DevEnvHelperNS.isDevToolsEnable()) && this.$refs.webview.openDevTools()
            }), !0)
        }

        initNativeCall() {
            return a(this, void 0, void 0, function* () {
                let e = l.default.getPluginUpdater(o.join(__rootDir, "plugins/ThunderXWebXDAS"));
                h.NativeCallHostModule.nativeCallHost.initialize();
                let t = yield e.getCurFilePath();
                c.information("url", t), this.onMounted(`file:///${o.join(t, "index.html")}`), e.active();
                const n = document.querySelector(`#${this.elementId}`);
                n.addEventListener("new-window", e => {
                    let t = e.url;
                    const n = i(44).parse(t).protocol;
                    if ("http:" === n || "https:" === n) {
                        let e = {tabType: s.TabType.Chromium, tabParam: {url: t}};
                        this.createNewTab(e)
                    }
                });
                let a = void 0;
                n.addEventListener("dom-ready", e => {
                    a || (a = n.getWebContents()).on("context-menu", (e, t) => {
                        f.ContextMenuNS.popContextMenu(e, t)
                    })
                })
            })
        }
    };
    n([r.Prop({})], g.prototype, "tabs", void 0), n([r.Prop({})], g.prototype, "homePageUrl", void 0), n([r.Prop({})], g.prototype, "preloadPath", void 0), n([r.Prop({})], g.prototype, "onMounted", void 0), n([r.Prop({})], g.prototype, "createNewTab", void 0), n([r.Prop({})], g.prototype, "selectTab", void 0), g = n([r.Component], g), t.default = g
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(173), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(618), a = i(33);
    t.default = a.connector.connect({mapGettersToProps: {currentTab: e => e.currentTab}})(n.default)
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(175), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(8), o = i(4), r = i(68);
    let s = class extends a.Vue {
        get canGoBack() {
            let e = !1;
            do {
                if (o.isNullOrUndefined(this.currentTab) || o.isNullOrUndefined(this.currentTab.tab)) break;
                e = this.currentTab.tab.canGoBack
            } while (0);
            return e
        }

        goBack() {
            do {
                if (o.isNullOrUndefined(this.currentTab) || o.isNullOrUndefined(this.currentTab.tab)) break;
                this.currentTab.tab.goBack()
            } while (0)
        }

        refresh() {
            do {
                if (o.isNullOrUndefined(this.currentTab) || o.isNullOrUndefined(this.currentTab.tab)) break;
                this.currentTab.tab.refresh(!1)
            } while (0)
        }

        isDownloadTab() {
            return "" === r(this.currentTab, "tab", "url") && "下载" === r(this.currentTab, "title")
        }

        get isError() {
            return !this.isDownloadTab() && !0 === r(this.currentTab, "tab", "isErrorPage")
        }

        get isLoading() {
            return !this.isDownloadTab() && !0 === r(this.currentTab, "tab", "isLoadingPage")
        }
    };
    n([a.Prop({})], s.prototype, "currentTab", void 0), s = n([a.Component({components: {Loading: () => Promise.resolve().then(() => i(462))}})], s), t.default = s
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(177), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(8), o = i(4), r = i(68);
    let s = class extends a.Vue {
        get canGoBack() {
            let e = !1;
            do {
                if (o.isNullOrUndefined(this.currentTab) || o.isNullOrUndefined(this.currentTab.tab)) break;
                e = this.currentTab.tab.canGoBack
            } while (0);
            return e
        }

        goBack() {
            do {
                if (o.isNullOrUndefined(this.currentTab) || o.isNullOrUndefined(this.currentTab.tab)) break;
                this.currentTab.tab.goBack()
            } while (0)
        }

        refresh() {
            do {
                if (o.isNullOrUndefined(this.currentTab) || o.isNullOrUndefined(this.currentTab.tab)) break;
                this.currentTab.tab.refresh(!1)
            } while (0)
        }

        isDownloadTab() {
            return "" === r(this.currentTab, "tab", "url") && "下载" === r(this.currentTab, "title")
        }

        get isError() {
            return !this.isDownloadTab() && !0 === r(this.currentTab, "tab", "isErrorPage")
        }

        get isLoading() {
            return !this.isDownloadTab() && !0 === r(this.currentTab, "tab", "isLoadingPage")
        }
    };
    n([a.Prop({})], s.prototype, "currentTab", void 0), s = n([a.Component({components: {Loading: () => Promise.resolve().then(() => i(462))}})], s), t.default = s
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(179), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(624), a = i(33);
    t.default = a.connector.connect({
        mapStateToProps: {
            currentCategoryId: e => e.DownloadListState.currentCategoryId,
            currentCategoryViewId: e => e.DownloadListState.currentCategoryViewId,
            showPrivateSpaceOpenPage: e => e.PrivateSpaceState.showPrivateSpaceOpenPage,
            showUpgradeTask: e => e.UpgradeTaskState.showUpgradeTask,
            currentTabId: e => e.Tabs.current
        },
        mapCommitToProps: {
            UPDATE_CATEGORY: "UPDATE_CATEGORY",
            UPDATE_CATEGORYVIEW: "UPDATE_CATEGORYVIEW",
            SHOW_PRIVATE_SPACE_OPEN_PAGE: "SHOW_PRIVATE_SPACE_OPEN_PAGE",
            SHOW_UPGRADE_TASK: "SHOW_UPGRADE_TASK",
            UPDATE_VIP_SPEED_STATUS: "UPDATE_VIP_SPEED_STATUS",
            UPDATE_DEFAULT_SPEED_STATUS: "UPDATE_DEFAULT_SPEED_STATUS"
        },
        mapDispatchToProps: {selectTab: "selectTab"},
        mapGettersToProps: {downloadingOrder: e => e.downloadingOrder, canStartAll: e => e.canStartAll}
    })(n.default)
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(181), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(17), r = i(12), s = i(8), l = i(625), d = i(632), u = i(636), c = i(639), h = i(642), f = i(643),
        g = i(644), p = i(661), v = i(675), m = i(3), y = i(29), k = i(76), T = i(13), w = i(97), C = i(70), S = i(16),
        b = i(36), I = i(27), _ = i(79), A = i(7), D = i(43), x = i(30), N = i(15), E = i(453), P = i(11), M = i(677),
        O = i(80), F = i(96), L = i(131), B = i(24), U = i(20), R = i(9), K = i(336), W = i(25),
        V = L.PluginWebviewMgrNS.getWebViewMgr(), H = P.DownloadKernelTaskManager.getTaskManager(),
        z = N.DownloadKernelEventManager.getEventManager(), j = y.DownloadKernelCategoryManager.getCategoryManager(),
        G = E.DownloadKernelUpgradeNS.getUpgrade();
    let $ = !1, X = class extends s.Vue {
        constructor() {
            super(...arguments), this.adShow = !1, this.isFengxingAdShow = !1, this.removeCategoryCookie = -1, this.leftBottomAdShow = !1, this.canLeftBottomAdShow = !1, this.isSearch = !1
        }

        onIsSearchChange(e) {
            this.$emit("show-download-list-search", e)
        }

        onTabSelectChange(e) {
            return a(this, void 0, void 0, function* () {
                O.setCurrentTabID(e), U.server.fireClientEvent("OnThunderTabSelectChange", e), this.tryRestorePrivate()
            })
        }

        onCategoryChange(e, t) {
            if (-1 !== e) {
                let t = j.getCategoryFromId(e);
                if (t) {
                    R.XLStatNS.trackEvent("download_leftpanel", "private_page_show", "", 0, 0, 0, 0, "");
                    let i = j.getCategoryView(e, m.DownloadKernel.CategroyViewID.Downloading), n = i.getTaskCount();
                    n += (i = j.getCategoryView(e, m.DownloadKernel.CategroyViewID.Completed)).getTaskCount();
                    let a = t.getPassword();
                    if ((!a || "" === a) && 0 === n) return void this.SHOW_PRIVATE_SPACE_OPEN_PAGE(!0)
                }
            }
            this.SHOW_PRIVATE_SPACE_OPEN_PAGE(!1)
        }

        onDownloadingOrderChange(e) {
            H.isLoadStorageTaskFinish() && D.DownloadDispatchNS.updateTasksOrder(e)
        }

        onCanStartAll(e) {
            o.ipcRenderer.send("can-start-all-task", e)
        }

        onShowLeftBottomAdChange(e) {
            e && K.adLeftBottomHelper.handleEvent("ad_show"), this.$nextTick(() => {
                V.updateTaskAdWebview()
            })
        }

        get bShowLeftBottomAd() {
            return !this.isFengxingAdShow && this.leftBottomAdShow && this.canLeftBottomAdShow
        }

        handleLeftBottomAdShow(e) {
            this.leftBottomAdShow = e
        }

        handleAdShow(e) {
            this.adShow = e, this.currentCategoryViewId === m.DownloadKernel.CategroyViewID.Downloading && this.$nextTick(() => {
                V.updateTaskAdWebview()
            })
        }

        get isShowPrivateSpace() {
            return -1 !== this.currentCategoryId
        }

        myComputer() {
            -1 !== this.currentCategoryId && this.UPDATE_CATEGORY(-1)
        }

        keydownShowSearchUI(e) {
            if (e.ctrlKey && 70 === e.keyCode) ; else if (e.ctrlKey && 65 === e.keyCode) this.isSearch || this.$refs.downloadlist.selectAll(); else if (27 === e.keyCode) {
                if (this.isShowPrivateSpace) return;
                this.closeSearchUI(), this.$nextTick(() => {
                    this.$refs.downloadlist.$el.focus()
                })
            } else !this.isSearch && e.ctrlKey
        }

        closeSearchUI() {
            this.isSearch = !1, this.currentCategoryViewId === m.DownloadKernel.CategroyViewID.Downloading && this.$nextTick(() => {
                V.updateTaskAdWebview()
            })
        }

        keyOpenSearchUI() {
            R.XLStatNS.trackEvent("download_leftpanel", "search_start_click", "", 0, 0, 0, 0, "entry=ctrlf"), this.openSearchUI()
        }

        openSearchUI() {
            this.isShowPrivateSpace || (this.isSearch = !0)
        }

        isVipUser() {
            return a(this, void 0, void 0, function* () {
                let e = !1;
                if (yield B.LoginHelperNS.loginHelper.isLoginedAw()) {
                    "0" !== (yield B.LoginHelperNS.loginHelper.getUserInfoByKeyAw("isVip", "vip_xl")) && (e = !0)
                }
                return e
            })
        }

        privateSpace() {
            return a(this, void 0, void 0, function* () {
                let e = yield C.default(!1, !0, "privatespace");
                if (e && "" !== e) {
                    let t = j.getPrivateCategoryFromUserId(e);
                    if (t && this.currentCategoryId !== t.getId()) {
                        0 === (yield k.PrivateSpaceHelperNS.accessPrivateCategory(e)) && this.UPDATE_CATEGORY(t.getId())
                    }
                }
            })
        }

        handleMenuClick(e) {
            switch (e) {
                case"my_computer":
                    this.myComputer();
                    break;
                case"private_space":
                    this.privateSpace()
            }
        }

        onUpgradeProgress(e, t) {
            e > t ? this.SHOW_UPGRADE_TASK(!0) : setTimeout(() => {
                this.SHOW_UPGRADE_TASK(!1)
            }, 10)
        }

        handleSwitchCategory(e, t, i, n) {
            return a(this, void 0, void 0, function* () {
                this.isSearch = !1;
                let a = yield r.asyncRemoteCall.getCurrentWindow();
                if (n && ((yield a.isMinimized()) && (yield a.restore()), yield a.show(), 0 !== this.currentTabId && this.selectTab(0)), (yield A.client.callServerFunction("GetCurrentNav")) !== _.NavViewID.Download && (yield A.client.callServerFunction("SelectNav", _.NavViewID.Download)), this.currentCategoryId !== e) if (-1 === e) this.UPDATE_CATEGORY(e); else {
                    let t = yield A.client.callServerFunction("GetUserID");
                    if (0 !== (yield k.PrivateSpaceHelperNS.accessPrivateCategory(t))) return;
                    this.UPDATE_CATEGORY(e)
                }
                this.$nextTick(() => {
                    this.currentCategoryViewId !== t && this.UPDATE_CATEGORYVIEW(t), this.$refs.downloadlist.selectTask(t, i)
                })
            })
        }

        handleOpenSearchPage(e) {
            if (e) {
                let e = "entry=morelist";
                R.XLStatNS.trackEvent("download_leftpanel", "search_start_click", "", 0, 0, 0, 0, e), this.openSearchUI()
            } else this.closeSearchUI()
        }

        needUpgradeTask() {
            return a(this, void 0, void 0, function* () {
                let e = "", t = 0, i = yield r.asyncRemoteCall.getProcess();
                for (let n = 0; n < i.argv.length; n++) {
                    if (0 === i.argv[n].indexOf("-StartType:")) e = i.argv[n].substr("-StartType:".length); else {
                        if (0 === i.argv[n].indexOf("-PreVersion:")) {
                            let e = i.argv[n].substr("-PreVersion:".length), a = e.indexOf(".");
                            a && (e = e.substr(0, a)) && (t = parseInt(e, 10))
                        }
                    }
                }
                let n = !1;
                return ("Install" === e && t < 9 || "LiveUD" === e && (0 === t || t < 9)) && (n = !0), n
            })
        }

        protectPrivate() {
            this.UPDATE_CATEGORY(-1), k.PrivateSpaceHelperNS.setNeedPassword(!0), -1 !== this.currentCategoryId && ($ = !0)
        }

        tryRestorePrivate() {
            $ && 0 === this.currentTabId && ($ = !1, this.handleMenuClick("private_space"))
        }

        created() {
            return a(this, void 0, void 0, function* () {
                k.PrivateSpaceHelperNS.init(), this.onLogoutEventId = S.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", e => {
                    -1 !== this.currentCategoryId && this.UPDATE_CATEGORY(-1);
                    let t = j.getPrivateCategoryFromUserId(e);
                    t && b.TaskOperatorNs.pauseCategoryAllTask(t.getId(), m.DownloadKernel.TaskStopReason.PrivateLoginOut), this.canLeftBottomAdShow = !1
                });
                let e = yield r.asyncRemoteCall.getCurrentWindow();
                e.on("hide", () => {
                    this.protectPrivate()
                }), e.on("minimize", () => {
                    this.protectPrivate()
                }), o.ipcRenderer.on("main-window-state-active-show", () => {
                    this.tryRestorePrivate()
                }), w.downloadContextMenu.attachListener(T.NodeEventMesssageNS.eventDownloadContextMenuClick, this.handleMenuClick), I.default.attachListener(T.NodeEventMesssageNS.eventDownloadSwitchCategory, this.handleSwitchCategory), I.default.attachListener(T.NodeEventMesssageNS.eventShowSearchTaskPage, this.handleOpenSearchPage), x.DownloadKernelManager.attachListener(T.NodeEventMesssageNS.eventDownloadKernelInitEnd, () => a(this, void 0, void 0, function* () {
                    (yield this.needUpgradeTask()) && G.init() && (G.attachListener(G.eventUpgradeProgress, this.onUpgradeProgress), G.startUpgrade());
                    const {LoginHelperNS: e} = yield Promise.resolve().then(() => i(24));
                    this.onLoginEventId = S.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", t => {
                        G.init() && G.upgradePrivateSpace(t), e.loginHelper.getAllUserInfo(e => {
                            this.setUserVipAdConfig(e).catch()
                        })
                    }), this.onUserInfoChangeCookie = S.NativeCallModule.nativeCall.AttachNativeEvent("onUserInfoChange", (t, i) => {
                        "vipinfo" === t && e.loginHelper.getAllUserInfo(e => {
                            this.setUserVipAdConfig(e).catch()
                        })
                    }), (yield e.loginHelper.isLoginedAw()) && e.loginHelper.getAllUserInfo(e => {
                        G.init() && e && G.upgradePrivateSpace(e.userID), this.setUserVipAdConfig(e).catch()
                    })
                })), A.client.attachServerEvent("fengxing_ad_show", (e, t) => {
                    this.isFengxingAdShow = t, this.currentCategoryViewId === m.DownloadKernel.CategroyViewID.Downloading && this.$nextTick(() => {
                        V.updateTaskAdWebview()
                    })
                })
            })
        }

        setUserVipAdConfig(e) {
            return a(this, void 0, void 0, function* () {
                let t = e.vipList[0], i = Number(t.isVip), n = W.default.getConfigInfo("cooperateAd", "allShow");
                0 !== i && 1 !== n && ((yield K.adLeftBottomHelper.isNoDisturb()) || (this.canLeftBottomAdShow = !0))
            })
        }

        onUpdateVipTaskStatus(e) {
            this.UPDATE_VIP_SPEED_STATUS(e)
        }

        onDefaultVipTaskStatus(e) {
            this.UPDATE_DEFAULT_SPEED_STATUS(e)
        }

        mounted() {
            F.PluginFunctionUINS.on("update_vip_task_status", this.onUpdateVipTaskStatus.bind(this)), F.PluginFunctionUINS.on("init_vip_task_status", this.onDefaultVipTaskStatus.bind(this)), this.removeCategoryCookie = z.attachTaskEvent(m.DownloadKernel.TaskEventType.RemoveFromCategoryView, (...e) => {
                do {
                    if (!e) break;
                    if (e[0] !== m.DownloadKernel.TaskEventType.RemoveFromCategoryView) break;
                    if (void 0 === e[1] || !e[2] || !e[3]) break;
                    if (e[2] !== m.DownloadKernel.CategroyViewID.Downloading) break;
                    let t = e[3], i = {};
                    for (let e of t) i[e.getId()] = null;
                    this.UPDATE_VIP_SPEED_STATUS(i)
                } while (0)
            })
        }

        destroyed() {
            F.PluginFunctionUINS.removeListener("update_vip_task_status", this.onUpdateVipTaskStatus.bind(this)), F.PluginFunctionUINS.removeListener("init_vip_task_status", this.onDefaultVipTaskStatus.bind(this)), -1 !== this.removeCategoryCookie && (z.detachTaskEvent(m.DownloadKernel.TaskEventType.RemoveFromCategoryView, this.removeCategoryCookie), this.removeCategoryCookie = -1), k.PrivateSpaceHelperNS.uninit(), void 0 !== this.onLogoutEventId && (S.NativeCallModule.nativeCall.DetachNativeEvent("onLogout", this.onLogoutEventId), this.onLogoutEventId = void 0), void 0 !== this.onLoginEventId && (S.NativeCallModule.nativeCall.DetachNativeEvent("onLoginSuc", this.onLoginEventId), this.onLoginEventId = void 0), void 0 !== this.onUserInfoChangeCookie && (S.NativeCallModule.nativeCall.DetachNativeEvent("onUserInfoChange", this.onUserInfoChangeCookie), this.onUserInfoChangeCookie = void 0), w.downloadContextMenu.detachListener(T.NodeEventMesssageNS.eventDownloadContextMenuClick, this.handleMenuClick), I.default.detachListener(T.NodeEventMesssageNS.eventDownloadSwitchCategory, this.handleSwitchCategory), G.detachListener(G.eventUpgradeProgress, this.onUpgradeProgress)
        }
    };
    n([s.Prop({})], X.prototype, "currentTabId", void 0), n([s.Prop({})], X.prototype, "currentCategoryId", void 0), n([s.Prop({})], X.prototype, "currentCategoryViewId", void 0), n([s.Prop({})], X.prototype, "showPrivateSpaceOpenPage", void 0), n([s.Prop({})], X.prototype, "showUpgradeTask", void 0), n([s.Prop({})], X.prototype, "downloadingOrder", void 0), n([s.Prop({})], X.prototype, "canStartAll", void 0), n([s.Prop({})], X.prototype, "SHOW_PRIVATE_SPACE_OPEN_PAGE", void 0), n([s.Prop({})], X.prototype, "SHOW_UPGRADE_TASK", void 0), n([s.Prop({})], X.prototype, "selectTab", void 0), n([s.Prop({})], X.prototype, "UPDATE_CATEGORY", void 0), n([s.Prop({})], X.prototype, "UPDATE_CATEGORYVIEW", void 0), n([s.Prop({})], X.prototype, "UPDATE_VIP_SPEED_STATUS", void 0), n([s.Prop({})], X.prototype, "UPDATE_DEFAULT_SPEED_STATUS", void 0), n([s.Watch("isSearch")], X.prototype, "onIsSearchChange", null), n([s.Watch("currentTabId")], X.prototype, "onTabSelectChange", null), n([s.Watch("currentCategoryId", {immediate: !0})], X.prototype, "onCategoryChange", null), n([s.Watch("downloadingOrder", {immediate: !0})], X.prototype, "onDownloadingOrderChange", null), n([s.Watch("canStartAll")], X.prototype, "onCanStartAll", null), n([s.Watch("bShowLeftBottomAd")], X.prototype, "onShowLeftBottomAdChange", null), X = n([s.Component({
        components: {
            ToolBarContainer: l.default,
            DownloadListContainer: p.default,
            PrivateSpaceOpenPageContainer: v.default,
            DownloadSearchContainer: M.default,
            UpgradeTaskContainer: u.default,
            ToastNotify: c.default,
            StatusBarContainer: d.default,
            AdPlatformCtrl: h.default,
            AdLeftBottom: f.default,
            TaskDetail: g.default
        }
    })], X), t.default = X
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(183), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(626), a = i(33);
    t.default = a.connector.connect({
        mapStateToProps: {
            currentCategoryId: e => e.DownloadListState.currentCategoryId,
            currentCategoryViewId: e => e.DownloadListState.currentCategoryViewId,
            downloadingButtons: e => e.ToolbarState.downloadingButtons,
            completedButtons: e => e.ToolbarState.completedButtons,
            recycleButtons: e => e.ToolbarState.recycleButtons,
            privateDownloadingButtons: e => e.ToolbarState.privateDownloadingButtons,
            privateCompletedButtons: e => e.ToolbarState.privateCompletedButtons
        }, mapDispatchToProps: {attachToolbarEvent: "attachToolbarEvent"}, mapGettersToProps: {}
    })(n.default)
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(185), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(8), r = i(0), s = i(7), l = i(9), d = i(22), u = i(3), c = i(627), h = i(629), f = i(330), g = i(99),
        p = i(10), v = i(62), m = i(432), y = i(15), k = i(4), T = i(25),
        w = y.DownloadKernelEventManager.getEventManager(), C = r.default.getLogger("tool-bar");
    let S = class extends o.Vue {
        constructor() {
            super(...arguments), this.timerId = -1, this.vipButtonPluginEnable = -1, this.lastMobileQRCode = "", this.syncStateChangedCookie = null, this.shouleiSyncState = "offline", this.shouleiButtonNewIcon = !1, this.shouleiButtonTooltip = !1, this.taskCreatedCookie = void 0
        }

        get toolbarButtons() {
            let e = [];
            return -1 === this.currentCategoryId ? this.currentCategoryViewId === u.DownloadKernel.CategroyViewID.Downloading ? e = this.downloadingButtons : this.currentCategoryViewId === u.DownloadKernel.CategroyViewID.Completed ? e = this.completedButtons : this.currentCategoryViewId === u.DownloadKernel.CategroyViewID.Recycle && (e = this.recycleButtons) : this.currentCategoryViewId === u.DownloadKernel.CategroyViewID.Downloading ? e = this.privateDownloadingButtons : this.currentCategoryViewId === u.DownloadKernel.CategroyViewID.Completed && (e = this.privateCompletedButtons), e
        }

        onShouleiButtonClick() {
            if (this.shouleiButtonNewIcon) {
                this.shouleiButtonNewIcon = !1;
                let e = v.TimeHelperNS.formatDate(new Date, "yyyy-MM-dd");
                p.ConfigNS.setValue("ShouleiDownload", "SyncButtonNewClickDate", e), setTimeout(() => {
                    s.client.callServerFunction("UpdateButton", "toolbar_button", this.getShouleiButtonInfo())
                }, 0)
            }
            let e = "status=" + ("online" === this.shouleiSyncState ? "connected" : "disconnected");
            l.XLStatNS.trackEvent("download_leftpanel", "top_connect_shoulei_click", "", 0, 0, 0, 0, e), d.MessageBox.custom("shoulei-sync-guide", {
                type: "online" === this.shouleiSyncState ? "remoting" : "open",
                sfrom: "list",
                statFrom: "top_icon"
            }).catch()
        }

        onShouleiButtonTooltipClose() {
            this.shouleiButtonTooltip = !1, setTimeout(() => {
                s.client.callServerFunction("UpdateButton", "toolbar_button", this.getShouleiButtonInfo())
            }, 0), l.XLStatNS.trackEvent("download_leftpanel", "top_connect_shoulei_toast_click", "", 0, 0, 0, 0, "button=close")
        }

        onShouleiButtonTooltipClick() {
            this.shouleiButtonTooltip = !1, this.shouleiButtonNewIcon = !1, d.MessageBox.custom("shoulei-sync-guide", {
                type: "online" === this.shouleiSyncState ? "remoting" : "open",
                sfrom: "list",
                statFrom: "icon_toast"
            }).catch(), setTimeout(() => {
                s.client.callServerFunction("UpdateButton", "toolbar_button", this.getShouleiButtonInfo())
            }, 0), l.XLStatNS.trackEvent("download_leftpanel", "top_connect_shoulei_toast_click", "", 0, 0, 0, 0, "button=bubble")
        }

        getShouleiButtonInfo() {
            return {
                id: "mobile-sync",
                onClick: this.onShouleiButtonClick.bind(this),
                onTooltipClose: this.shouleiButtonTooltip ? this.onShouleiButtonTooltipClose.bind(this) : null,
                onTooltipClick: this.shouleiButtonTooltip ? this.onShouleiButtonTooltipClick.bind(this) : null,
                position: 1,
                tooltipTitle: "手机可以遥控电脑下载啦！",
                tooltipSubTitle: "回家直接看大片",
                imgSrc: "online" === this.shouleiSyncState ? "xdas://res/xlx-icon-control" : "xdas://res/xlx-icon-control is-animation",
                title: "online" === this.shouleiSyncState ? "手机遥控下载中" : "手机遥控下载",
                loading: "online" === this.shouleiSyncState,
                newIcon: "online" !== this.shouleiSyncState && this.shouleiButtonNewIcon,
                tooltip: this.shouleiButtonTooltip
            }
        }

        detachTaskCreated() {
            this.taskCreatedCookie && (w.detachTaskEvent(u.DownloadKernel.TaskEventType.TaskCreated, this.taskCreatedCookie), this.taskCreatedCookie = void 0)
        }

        onTaskCreated(e, t) {
            do {
                if (e !== u.DownloadKernel.TaskEventType.TaskCreated || !t || t.length <= 0) break;
                if ("online" === this.shouleiSyncState) break;
                for (let e = 0; e < t.length; ++e) {
                    let i = t[e];
                    if (!i) continue;
                    if (i.getTaskAttribute(u.DownloadKernel.TaskAttribute.Background)) continue;
                    if (-1 !== i.getTaskAttribute(u.DownloadKernel.TaskAttribute.CategoryId)) continue;
                    this.detachTaskCreated();
                    let n = v.TimeHelperNS.formatDate(new Date, "yyyy-MM-dd");
                    p.ConfigNS.setValue("ShouleiDownload", "SyncButtonToolTip", n), this.shouleiButtonTooltip = !0, s.client.callServerFunction("UpdateButton", "toolbar_button", this.getShouleiButtonInfo()), l.XLStatNS.trackEvent("download_leftpanel", "top_connect_shoulei_toast_show");
                    break
                }
            } while (0)
        }

        addShouleiButton() {
            return a(this, void 0, void 0, function* () {
                const e = g.ShouleiListSyncNS.getMananger();
                if (yield e.enable()) {
                    this.shouleiSyncState = e.getState();
                    let t = T.default.getConfigInfo("shouleiDownload", "enableSyncNewIcon"),
                        i = T.default.getConfigInfo("shouleiDownload", "syncNewIconLimitTimes") || 1,
                        n = p.ConfigNS.getValue("ShouleiDownload", "SyncButtonNewTimes", 0);
                    if (k.isNullOrUndefined(t) || 1 === t) {
                        let e = v.TimeHelperNS.formatDate(new Date, "yyyy-MM-dd");
                        this.shouleiButtonNewIcon = p.ConfigNS.getValue("ShouleiDownload", "SyncButtonNewClickDate", "") !== e, this.shouleiButtonNewIcon && (n < i ? p.ConfigNS.getValue("ShouleiDownload", "SyncButtonShowDate", "") !== e && (p.ConfigNS.setValue("ShouleiDownload", "SyncButtonNewTimes", n + 1), p.ConfigNS.setValue("ShouleiDownload", "SyncButtonShowDate", e)) : n === i ? p.ConfigNS.getValue("ShouleiDownload", "SyncButtonShowDate", "") !== e && (this.shouleiButtonNewIcon = !1) : this.shouleiButtonNewIcon = !1)
                    }
                    s.client.callServerFunction("CreateButton", "toolbar_button", this.getShouleiButtonInfo()), l.XLStatNS.trackEvent("download_leftpanel", "top_connect_shoulei_show"), this.syncStateChangedCookie = e.attachEvent("OnConnectStateChanged", e => {
                        this.shouleiSyncState = e, s.client.callServerFunction("UpdateButton", "toolbar_button", this.getShouleiButtonInfo())
                    })
                } else m.getMobileImgSrc().then(e => {
                    if (C.information("getMobileImgSrc", e), e) {
                        this.lastMobileQRCode = e;
                        let t = {
                            id: "mobile",
                            imgSrc: `${__rootDir}/static/icon/mobile_xl.png`,
                            title: "手机迅雷",
                            onClick: () => {
                                l.XLStatNS.trackEvent("download_leftpanel", "top_shoulei_icon_click"), d.MessageBox.custom("img-dlg", {
                                    src: this.lastMobileQRCode,
                                    width: 400,
                                    height: 276
                                }, {width: 400, height: 276}).catch()
                            },
                            position: 4
                        };
                        l.XLStatNS.trackEvent("download_leftpanel", "top_shoulei_icon_show"), s.client.callServerFunction("CreateButton", "toolbar_button", t)
                    }
                })
            })
        }

        mounted() {
            this.attachToolbarEvent(), f.VipPluginSwitchConfigNS.getToolbarVipButtonEnable().then(e => {
                this.vipButtonPluginEnable = e
            }), setTimeout(() => {
                this.addShouleiButton().catch()
            }, 2e3);
            this.timerId = setInterval(() => {
                m.getMobileImgSrc().catch()
            }, 36e5)
        }

        destroyed() {
            if (-1 !== this.timerId && (clearInterval(this.timerId), this.timerId = -1), this.syncStateChangedCookie) {
                g.ShouleiListSyncNS.getMananger().detachEvent("OnConnectStateChanged", this.syncStateChangedCookie), this.syncStateChangedCookie = null
            }
            this.detachTaskCreated()
        }
    };
    n([o.Prop({})], S.prototype, "currentCategoryId", void 0), n([o.Prop({})], S.prototype, "currentCategoryViewId", void 0), n([o.Prop({})], S.prototype, "downloadingButtons", void 0), n([o.Prop({})], S.prototype, "completedButtons", void 0), n([o.Prop({})], S.prototype, "recycleButtons", void 0), n([o.Prop({})], S.prototype, "privateDownloadingButtons", void 0), n([o.Prop({})], S.prototype, "privateCompletedButtons", void 0), n([o.Prop({})], S.prototype, "attachToolbarEvent", void 0), S = n([o.Component({
        components: {
            ToolBarButtonContainer: c.default,
            ToolBarVipButtonContainer: h.default
        }
    })], S), t.default = S
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(187), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(628), a = i(33);
    t.default = a.connector.connect({
        mapStateToProps: {
            currentCategoryId: e => e.DownloadListState.currentCategoryId,
            currentCategoryViewId: e => e.DownloadListState.currentCategoryViewId,
            showPrivateSpaceOpenPage: e => e.PrivateSpaceState.showPrivateSpaceOpenPage
        },
        mapCommitToProps: {CREATE_NEW_TAB: "CREATE_NEW_TAB", SORT_CATEGORY_BY_FUNCTION: "SORT_CATEGORY_BY_FUNCTION"},
        mapGettersToProps: {currentSelectdTaskInfos: e => e.currentSelectdTaskInfos}
    })(n.default)
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(189), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(8);
    let o = class extends a.Vue {
        constructor() {
            super(...arguments), this.disabled = !1
        }

        get customClass() {
            let e = "";
            do {
                if (this.imgSrc && "" !== this.imgSrc) {
                    let t = "xdas://res/";
                    0 === this.imgSrc.indexOf(t) && (e = this.imgSrc.substr(t.length));
                    break
                }
                e = this.id
            } while (0);
            return e
        }

        onSelectChange(e) {
            let t = this.buttonClassFilter;
            this.buttonClassFilter || (t = (() => ""));
            let i = t(this);
            i.then ? i.then(e => {
                this.disabled = "" !== e
            }) : this.disabled = "" !== i
        }

        handleClick(e) {
            this.disabled || this.click(e, this)
        }

        handleToolTipClose(e) {
            this.tooltipClose && this.tooltipClose(e, this)
        }

        handleToolTipClick(e) {
            this.tooltipClick && this.tooltipClick(e, this)
        }

        handleEnter(e) {
            this.disabled || this.enter && this.enter()
        }
    };
    n([a.Prop({})], o.prototype, "redDot", void 0), n([a.Prop({})], o.prototype, "imgSrc", void 0), n([a.Prop({})], o.prototype, "title", void 0), n([a.Prop({})], o.prototype, "id", void 0), n([a.Prop({})], o.prototype, "newIcon", void 0), n([a.Prop({})], o.prototype, "loading", void 0), n([a.Prop({})], o.prototype, "tooltip", void 0), n([a.Prop({})], o.prototype, "tooltipTitle", void 0), n([a.Prop({})], o.prototype, "tooltipSubTitle", void 0), n([a.Prop({})], o.prototype, "currentCategoryId", void 0), n([a.Prop({})], o.prototype, "currentCategoryViewId", void 0), n([a.Prop({})], o.prototype, "showPrivateSpaceOpenPage", void 0), n([a.Prop({})], o.prototype, "currentSelectdTaskInfos", void 0), n([a.Prop({})], o.prototype, "buttonClassFilter", void 0), n([a.Prop({})], o.prototype, "click", void 0), n([a.Prop({})], o.prototype, "tooltipClose", void 0), n([a.Prop({})], o.prototype, "tooltipClick", void 0), n([a.Prop({})], o.prototype, "enter", void 0), n([a.Prop({})], o.prototype, "CREATE_NEW_TAB", void 0), n([a.Prop({})], o.prototype, "SORT_CATEGORY_BY_FUNCTION", void 0), n([a.Watch("currentSelectdTaskInfos", {immediate: !0})], o.prototype, "onSelectChange", null), o = n([a.Component], o), t.default = o
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(191), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(630), a = i(33);
    t.default = a.connector.connect({
        mapStateToProps: {
            currentCategoryId: e => e.DownloadListState.currentCategoryId,
            currentCategoryViewId: e => e.DownloadListState.currentCategoryViewId,
            showPrivateSpaceOpenPage: e => e.PrivateSpaceState.showPrivateSpaceOpenPage
        },
        mapCommitToProps: {CREATE_NEW_TAB: "CREATE_NEW_TAB", SORT_CATEGORY_BY_FUNCTION: "SORT_CATEGORY_BY_FUNCTION"},
        mapGettersToProps: {currentSelectdTaskInfos: e => e.currentSelectdTaskInfos}
    })(n.default)
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(193), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(8), r = i(7), s = i(0).default.getLogger("DownloadPanel.ToolBarVipButton"), l = i(631);
    let d = class extends o.Vue {
        constructor() {
            super(...arguments), this.disabled = !1, this.disableClass = "", this.vipIcon = "", this.hoverTitle = "", this.newClick = null, this.hasRedPoint = !1, this.clickUrl = "https://vip.xunlei.com/index.html?referfrom=v_pc_xlx_ggong_taskbar_vip", this.cfgType = "", this.iconMgr = null
        }

        onSelectChange(e) {
            return a(this, void 0, void 0, function* () {
                "xlx-icon-nav-file" !== this.id && "xlx-icon-nav-folder" !== this.id || (this.disableClass = yield this.buttonClassFilter(this.currentCategoryId, this.currentCategoryViewId, e, this.showPrivateSpaceOpenPage), "" === this.disableClass ? this.disabled = !1 : this.disabled = !0)
            })
        }

        handleClick(e) {
            this.disabled || (s.information("handleClick, clickUrl=", this.clickUrl), "" !== this.cfgType && r.client.callServerFunction("SetValue", "ToolBarButtonVipIcon", this.cfgType, this.clickUrl).catch(), r.client.callServerFunction("OpenNewTab", this.clickUrl).catch(), this.iconMgr.sendStat("download_leftpanel", "top_vipicon_click"), this.hasRedPoint && (this.hasRedPoint = !1))
        }

        handleError(e) {
            this.vipIcon = ""
        }

        get handleTitle() {
            return "" === this.hoverTitle ? this.title : this.hoverTitle
        }

        handleEnter(e) {
            this.iconMgr.sendStat("download_leftpanel", "top_vipicon_hover_show")
        }

        get filterClass() {
            let e = this.disableClass;
            do {
                if ("" !== e) break;
                "string" == typeof (e = this.buttonClassFilter(this.currentCategoryId, this.currentCategoryViewId, this.currentSelectdTaskInfos, this.showPrivateSpaceOpenPage)) && (this.disabled = "" !== e), this.hasRedPoint && (e = "is-new")
            } while (0);
            return e
        }

        mounted() {
            return a(this, void 0, void 0, function* () {
                this.iconMgr = new l.VipIconMgr(this), this.iconMgr.init()
            })
        }
    };
    n([o.Prop({})], d.prototype, "title", void 0), n([o.Prop({})], d.prototype, "id", void 0), n([o.Prop({})], d.prototype, "currentCategoryId", void 0), n([o.Prop({})], d.prototype, "currentCategoryViewId", void 0), n([o.Prop({})], d.prototype, "showPrivateSpaceOpenPage", void 0), n([o.Prop({})], d.prototype, "currentSelectdTaskInfos", void 0), n([o.Prop({})], d.prototype, "buttonClassFilter", void 0), n([o.Prop({})], d.prototype, "CREATE_NEW_TAB", void 0), n([o.Prop({})], d.prototype, "SORT_CATEGORY_BY_FUNCTION", void 0), n([o.Watch("currentSelectdTaskInfos", {immediate: !0})], d.prototype, "onSelectChange", null), d = n([o.Component], d), t.default = d
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(195), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(633), a = i(33);
    t.default = a.connector.connect({
        mapStateToProps: {
            tabs: e => e.Tabs.tabs,
            current: e => e.Tabs.current,
            currentCategoryId: e => e.DownloadListState.currentCategoryId
        }, mapCommitToProps: {UPDATE_CATEGORY: "UPDATE_CATEGORY"}, mapDispatchToProps: {}, mapGettersToProps: {}
    })(n.default)
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(197), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(8), r = i(14), s = i(13), l = i(95), d = i(30), u = i(334), c = i(634), h = i(16), f = i(7), g = i(24),
        p = i(10), v = i(49), m = i(46), y = i(9), k = i(26), T = i(44), w = i(2), C = i(6), S = i(3), b = i(15),
        I = i(25), _ = i(429), A = i(22), D = i(70), x = i(96), N = i(99), E = i(29), P = i(76),
        M = b.DownloadKernelEventManager.getEventManager(),
        O = C.default(w.join(__rootDir, "../bin/ThunderHelper.node")), F = i(635).urls,
        L = v.ToastNotifyManagerNS.getToastNotifyManger(), B = E.DownloadKernelCategoryManager.getCategoryManager();
    let U = class extends o.Vue {
        constructor() {
            super(...arguments), this.totalDownloadSpeed = 0, this.totalUploadSpeed = 0, this.todayDownSize = 0, this.todayUpSize = 0, this.downloadVipSpeed = 0, this.downloadCompleteTaskType = u.ScheduleCompleteTaskType.UnKnown, this.canShowVipSpeed = !1, this.canShowDiskBusy = !1, this.showVipText = "会员登录", this.wkyDisplay = "none", this.isFreeDownload = !1, this.vipType = void 0, this.isLimit = !1, this.popUp = !1, this.limitSpeetMenuText = "限速下载", this.entryText = "下载计划", this.scheduleTaskCount = 0, this.diskIdleInfo = [{
                name: "",
                percent: "0",
                percentBase: "0"
            }], this.onceDiskInfo = !1, this.diskInfo = [], this.everySecondDiskInfo = {}, this.timeDiskIdleId = -1, this.taskIds = [], this.taskPath = [], this.showTime = 0, this.hideTime = 0, this.shouleiSyncEnable = !1, this.shouleiSyncState = "offline", this.canShowPcNode = !1, this.pcNodeImgSrc = "", this.pcNodeTooltip = "", this.pcBtnClick = null, this.pcNodeOpened = !1, this.pcNodePopOptions = {}, this.canShowKuainiaoTip = !1, this.canShowKuainiaoInterface = !1, this.kuainiaoImgSrc = "", this.kuaiNiaoText = "", this.kuaiNiaoTipText = "", this.kuaiNiaoClick = null, this.kuaiNiaoTipClick = null
        }

        get isInPrivateSpace() {
            return -1 !== this.currentCategoryId
        }

        handlePrivateSpace() {
            return a(this, void 0, void 0, function* () {
                let e = `state=${-1 === this.currentCategoryId ? "entry" : "quit"}`;
                if (y.XLStatNS.trackEvent("download_leftpanel", "dl_private_space_btn_click", "", 0, 0, 0, 0, e), -1 === this.currentCategoryId) {
                    let e = yield D.default(!1, !0, "privatespace");
                    if (e && "" !== e) {
                        let t = B.getPrivateCategoryFromUserId(e);
                        if (t && this.currentCategoryId !== t.getId()) {
                            0 === (yield P.PrivateSpaceHelperNS.accessPrivateCategory(e)) && this.UPDATE_CATEGORY(t.getId())
                        }
                    }
                } else this.UPDATE_CATEGORY(-1)
            })
        }

        get kuainiaoClass() {
            let e = "";
            do {
                if (this.kuainiaoImgSrc) {
                    let t = "xdas://res/";
                    0 === this.kuainiaoImgSrc.indexOf(t) && (e = this.kuainiaoImgSrc.substr(t.length));
                    break
                }
            } while (0);
            return e
        }

        onIsDiskInfoChange(e) {
            if (e) y.XLStatNS.trackEvent("download_leftpanel", "disk_overload_icon_show"), this.showTime = (new Date).getTime(); else {
                this.hideTime = (new Date).getTime();
                let e = "dur=" + ((this.hideTime - this.showTime) / 1e3).toString();
                y.XLStatNS.trackEvent("download_leftpanel", "disk_overload_icon_show_dur", "", 0, 0, 0, 0, e)
            }
        }

        onIsLimtChanged(e) {
            e ? (this.limitSpeetMenuText = "限速下载中", this.entryText = "限速下载中") : (this.limitSpeetMenuText = "限速下载", this.entryText = "下载计划")
        }

        get pcNodeTooltipVisible() {
            let e = !1;
            return this.pcNodeTooltip && (e = !0), e
        }

        get pcNodePopEnable() {
            let e = !0;
            do {
                if (this.pcNodeOpened) {
                    this.pcNodePopOptions.statusDesc && this.pcNodePopOptions.actionText || (e = !1);
                    break
                }
                this.pcNodePopOptions.introduction && this.pcNodePopOptions.buttonText || (e = !1)
            } while (0);
            return e
        }

        get vipText() {
            return this.showVipText
        }

        get curHoverSpeed() {
            let e = "";
            return e = r.ThunderUtil.formatSize(this.totalDownloadSpeed, 1) + "/s"
        }

        get curSpeed() {
            let e = "";
            return e = this.totalDownloadSpeed >= 1024e3 ? r.ThunderUtil.formatSize(this.totalDownloadSpeed, 1) + "/s" : r.ThunderUtil.formatSize(this.totalDownloadSpeed, 0) + "/s"
        }

        get curUpSpeed() {
            let e = "";
            return e = r.ThunderUtil.formatSize(this.totalUploadSpeed, 1) + "/s"
        }

        get curVipSpeed() {
            let e = "";
            return e = this.downloadVipSpeed >= 1024e3 ? r.ThunderUtil.formatSize(this.downloadVipSpeed, 1) + "/s" : r.ThunderUtil.formatSize(this.downloadVipSpeed, 0) + "/s"
        }

        get downSize() {
            let e = "";
            return e = r.ThunderUtil.formatSize(this.todayDownSize)
        }

        get upSize() {
            let e = "";
            return e = r.ThunderUtil.formatSize(this.todayUpSize)
        }

        get shouleiRemoteSyncText() {
            return "online" === this.shouleiSyncState ? "手机遥控下载中" : "手机遥控下载"
        }

        showPop() {
            y.XLStatNS.trackEvent("download_leftpanel", "bottom_speed_hover"), this.popUpScheduleMenu(!1)
        }

        viewMoreData() {
            return a(this, void 0, void 0, function* () {
                y.XLStatNS.trackEvent("download_leftpanel", "bottom_speed_pop_click");
                let e = yield D.default(!1, !0, "download_data");
                e && "" !== e && A.MessageBox.custom("DownloadData", {
                    windowWidth: 450,
                    windowHeight: this.canShowVipSpeed ? 523 : 597
                })
            })
        }

        onKuainiaoTextClick() {
            this.kuaiNiaoClick && this.kuaiNiaoClick()
        }

        onKuainiaoTipClick() {
            this.kuaiNiaoTipClick && this.kuaiNiaoTipClick()
        }

        handClickleVipText() {
            if ("会员登录" === this.showVipText) g.LoginHelperNS.loginHelper.showLoginDlg("vip", !0); else if ("会员加速" === this.showVipText) {
                let e = "https://pay.xunlei.com/pay.html?bizNo=baijin&selectBizno=baijin&timeType=1001&referfrom=v_pc_xlx_hytq_js&aidfrom=bottom";
                f.client.callServerFunction("OpenNewTab", e).catch();
                let t = `clickid=bottom,vip_type=${this.vipType}`;
                y.XLStatNS.trackEvent("xlx_vip_event", "hyjs_click", "", 0, 0, 0, 0, t)
            }
        }

        openTab() {
            f.client.callServerFunction("OpenNewTab", "http://yangtai.xunlei.com/?p=11111").catch()
        }

        hover() {
            y.XLStatNS.trackEvent("download_leftpanel", "disk_overload_popup_show")
        }

        onConfigInitFinished() {
            let e = l.DownloadModeNS.getCurrentDownloadMode();
            this.isLimit = "1" !== e, this.isFreeDownload = l.DownloadModeNS.getFreeDownLoad(), this.downloadCompleteTaskType = u.ScheduleTaskNS.getDownloadCompleteTaskType(), c.FlowMonitorNS.startMonitor(), _.default.init(), u.ScheduleTaskNS.init(), d.DownloadKernelManager.attachListener(s.NodeEventMesssageNS.eventGlobalDownloadSpeedChanged, e => {
                this.totalDownloadSpeed = c.FlowMonitorNS.getCurrentDownloadSpeed(), this.downloadVipSpeed = c.FlowMonitorNS.getCurrentVipSpeed(), this.todayDownSize = c.FlowMonitorNS.getTodayDownloadSize()
            }), d.DownloadKernelManager.attachListener(s.NodeEventMesssageNS.eventGlobalUploadSpeedChanged, e => {
                this.totalUploadSpeed = e, this.todayUpSize = c.FlowMonitorNS.getTodayUploadSize()
            })
        }

        onGetUserInfo() {
            g.LoginHelperNS.loginHelper.getAllUserInfo(e => {
                do {
                    if (null === e || void 0 === e) break;
                    let t = e.vipList[0], i = Number(t.isVip);
                    if (this.vipType = Number(t.vasType), 0 !== i) this.canShowVipSpeed = !0; else {
                        this.showVipText = "会员加速";
                        let e = `btn_type=bottom,vip_type=${this.vipType}`;
                        y.XLStatNS.trackEvent("xlx_vip_event", "hyjs_show", "", 0, 0, 0, 0, e)
                    }
                } while (0)
            })
        }

        created() {
            p.ConfigNS.attachListener(s.NodeEventMesssageNS.eventConfigInitFinished, () => {
                this.onConfigInitFinished()
            }), p.ConfigNS.attachListener(s.NodeEventMesssageNS.eventConfigValueChanged, (e, t, i, n) => {
                switch (e) {
                    case"ConfigNet":
                        "ConfigNet_Type" === t && ("1" === String(n) ? this.isLimit = !1 : this.isLimit = !0)
                }
            }), h.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", () => {
                this.onGetUserInfo()
            }), h.NativeCallModule.nativeCall.AttachNativeEvent("onUserInfoChange", (e, t) => {
                "vipinfo" === e && this.onGetUserInfo()
            }), h.NativeCallModule.nativeCall.AttachNativeEvent("getCurrentTabUrl", e => {
                let t = !1, i = T.parse(this.tabs[this.current].tab.url).hostname;
                do {
                    if ("" === i) break;
                    for (let e = 0; e < F.length; e++) if (F[e].url === i) {
                        t = !0;
                        break
                    }
                } while (0);
                k.NativeCallHostModule.nativeCallHost.fireNativeEvent(e, t)
            }), h.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", () => {
                this.canShowVipSpeed = !1, this.showVipText = "会员登录", this.vipType = void 0
            })
        }

        updateDiskInfo(e) {
            if (this.everySecondDiskInfo.hasOwnProperty(e.name) || (this.everySecondDiskInfo[e.name] = []), this.everySecondDiskInfo[e.name].length >= 6 && this.everySecondDiskInfo[e.name].splice(0, 1), this.everySecondDiskInfo[e.name].push(e.percent), 6 === this.everySecondDiskInfo[e.name].length) {
                let t = (this.everySecondDiskInfo[e.name][0] + this.everySecondDiskInfo[e.name][1] + this.everySecondDiskInfo[e.name][2] + this.everySecondDiskInfo[e.name][3] + this.everySecondDiskInfo[e.name][4] + this.everySecondDiskInfo[e.name][5]) / 6;
                t = Math.floor(t);
                let i = e.name, n = e.name,
                    a = {name: i = e.name.slice(0, 2) + "(" + n.slice(2), percent: t.toString()};
                if (t >= 99) {
                    for (let n of this.taskPath) if (-1 !== e.name.indexOf(n) || -1 !== e.name.indexOf(n.toLocaleUpperCase())) {
                        let e = !1;
                        for (let n of this.diskInfo) if (n.name === i) {
                            n.percent = t.toString(), e = !0;
                            break
                        }
                        e || this.diskInfo.push(a), this.canShowDiskBusy = !0
                    }
                } else this.diskInfo.some((e, t) => {
                    if (e.name === a.name) return this.diskInfo.splice(t), void (0 === this.diskInfo.length && (this.canShowDiskBusy = !1))
                })
            }
        }

        startAttchDiskIdleInfo() {
            0 !== I.default.getConfigInfo("diskIdleInfo", "enable") && (this.timeDiskIdleId = setInterval(() => {
                O.asyncDiskIdleInfo(e => {
                    do {
                        if (!e || 0 === e.length) break;
                        if (!this.onceDiskInfo) {
                            this.diskIdleInfo = e, this.onceDiskInfo = !0;
                            break
                        }
                        if (e.length !== this.diskIdleInfo.length) break;
                        for (let t in this.diskIdleInfo) {
                            if (!this.diskIdleInfo[t] || !e[t] || !e[t].name) break;
                            if (e[t].name === this.diskIdleInfo[t].name) {
                                let i = (Number(e[t].percent) - Number(this.diskIdleInfo[t].percent)) / (Number(e[t].percentBase) - Number(this.diskIdleInfo[t].percentBase));
                                i = Math.floor(100 * (1 - i));
                                let n = {name: e[t].name, percent: i};
                                "_Total" !== e[t].name && this.updateDiskInfo(n)
                            }
                        }
                        this.diskIdleInfo = e
                    } while (0)
                })
            }, 1e3))
        }

        handlePcNodeClick() {
            this.pcBtnClick && this.pcBtnClick()
        }

        showWkyPop() {
            "none" === this.wkyDisplay && (this.wkyDisplay = "block", this.pcNodePopOptions && this.pcNodePopOptions.onHover && this.pcNodePopOptions.onHover())
        }

        hideWkyPop(e) {
            do {
                if ("none" === this.wkyDisplay) break;
                if (!e) {
                    this.wkyDisplay = "none";
                    break
                }
                let t = document.getElementById("status-wky-pop");
                if (!t) break;
                let i = t.getBoundingClientRect();
                (e.clientX < i.left || e.clientX > i.right || e.clientY < i.top || e.clientY - 3 > i.bottom) && (this.wkyDisplay = "none")
            } while (0)
        }

        onWkyJoin() {
            this.hideWkyPop(), this.pcNodePopOptions && this.pcNodePopOptions.onJoin && this.pcNodePopOptions.onJoin()
        }

        onWkyAction() {
            this.hideWkyPop(), this.pcNodePopOptions && this.pcNodePopOptions.onAction && this.pcNodePopOptions.onAction()
        }

        onWkyDetail() {
            this.hideWkyPop(), this.pcNodePopOptions && this.pcNodePopOptions.onDetail && this.pcNodePopOptions.onDetail()
        }

        updatePcNodeButtonInfo(e, t) {
            do {
                if (!this.canShowPcNode) break;
                if (!e) break;
                e.imgSrc && (this.pcNodeImgSrc = e.imgSrc), void 0 !== e.opened && (this.pcNodeOpened = e.opened), e.onClick && (this.pcBtnClick = e.onClick), void 0 !== e.tooltip && (this.pcNodeTooltip = e.tooltip), e.popOptions && (this.pcNodePopOptions = Object.assign({}, this.pcNodePopOptions, e.popOptions))
            } while (0)
        }

        updateKuainiaoButtonInfo(e, t) {
            do {
                if (!this.canShowKuainiaoInterface) break;
                e.imgSrc && (this.kuainiaoImgSrc = e.imgSrc), e.text && (this.kuaiNiaoText = e.text), void 0 !== e.tooltip && (e.tooltip && (this.kuaiNiaoText || this.kuainiaoImgSrc) ? (this.kuaiNiaoTipText = e.tooltip, this.canShowKuainiaoTip = !0) : (this.kuaiNiaoTipText = "", this.canShowKuainiaoTip = !1)), e.onClick && (this.kuaiNiaoClick = e.onClick), e.onTipClick && (this.kuaiNiaoTipClick = (() => {
                    e.onTipClick()
                }))
            } while (0)
        }

        mounted() {
            return a(this, void 0, void 0, function* () {
                this.scheduleTaskCount = u.ScheduleTaskNS.getScheduleTaskCount(), u.ScheduleTaskNS.getEventEmitter().on(u.ScheduleTaskEventType.ScheduleTaskCountChange, e => {
                    this.scheduleTaskCount = e
                }), x.PluginFunctionUINS.on("add_pc_node_button", (e, t) => {
                    this.canShowPcNode = !0, this.updatePcNodeButtonInfo(e, t), this.pcNodePopOptions && this.pcNodePopOptions.onShow && this.pcNodePopOptions.onShow()
                }), x.PluginFunctionUINS.on("update_pc_node_button", (e, t) => {
                    this.updatePcNodeButtonInfo(e, t)
                }), x.PluginFunctionUINS.on("add_kuainiao_button", (e, t) => {
                    this.canShowKuainiaoInterface = !0, this.updateKuainiaoButtonInfo(e, t), e.onShow && e.onShow()
                }), x.PluginFunctionUINS.on("update_kuainiao_button", (e, t) => {
                    this.updateKuainiaoButtonInfo(e, t)
                }), x.PluginFunctionUINS.on("remove_kuainiao_button", e => {
                    this.canShowKuainiaoInterface = !1, this.canShowKuainiaoTip = !1, this.kuainiaoImgSrc = "", this.kuaiNiaoText = "", this.kuaiNiaoTipText = "", this.kuaiNiaoClick = null, this.kuaiNiaoTipClick = null
                }), M.attachTaskEvent(S.DownloadKernel.TaskEventType.StatusChanged, (...e) => {
                    do {
                        if (!e) break;
                        if (e[0] !== S.DownloadKernel.TaskEventType.StatusChanged) break;
                        let t = e[1];
                        if (!t) break;
                        let i = "";
                        for (let e = 0; e < t.length; ++e) {
                            let n = t[e];
                            if (!n) continue;
                            let a = n.getTaskAttribute(S.DownloadKernel.TaskAttribute.GroupTaskId);
                            if (n.getTaskAttribute(S.DownloadKernel.TaskAttribute.Background) || a > 0) continue;
                            let o = n.getTaskStatus();
                            i = n.getTaskAttribute(S.DownloadKernel.TaskAttribute.SavePath).slice(0, 2);
                            let r = n.getTaskAttribute(S.DownloadKernel.TaskAttribute.TaskId),
                                s = this.taskIds.indexOf(r), l = this.taskPath.indexOf(i);
                            o === S.DownloadKernel.TaskStatus.StartWaiting || o === S.DownloadKernel.TaskStatus.StartPending || o === S.DownloadKernel.TaskStatus.Started ? -1 === s && (this.taskIds.push(r), this.taskPath.push(i)) : -1 !== s && (this.taskIds.splice(s, 1), -1 !== l && this.taskPath.splice(l, 1))
                        }
                        0 !== this.taskIds.length ? -1 === this.timeDiskIdleId && this.startAttchDiskIdleInfo() : (this.canShowDiskBusy = !1, clearInterval(this.timeDiskIdleId), this.timeDiskIdleId = -1)
                    } while (0)
                });
                const e = N.ShouleiListSyncNS.getMananger();
                this.shouleiSyncEnable = yield e.enable(), this.shouleiSyncEnable && (this.shouleiSyncState = e.getState(), e.attachEvent("OnConnectStateChanged", e => {
                    this.shouleiSyncState = e
                }))
            })
        }

        onPopUpBlur() {
            this.popUpScheduleMenu(!1)
        }

        popUpScheduleMenu(e) {
            this.popUp = e
        }

        handleClick(e) {
            let t = "";
            switch (this.isFreeDownload = l.DownloadModeNS.getFreeDownLoad(), this.downloadCompleteTaskType = u.ScheduleTaskNS.getDownloadCompleteTaskType(), e) {
                case"entry":
                    y.XLStatNS.trackEvent("download_leftpanel", "bottom_plan_click"), this.popUpScheduleMenu(!0);
                    break;
                case"totalSpeed":
                    t = "button=fullspeed", y.XLStatNS.trackEvent("download_leftpanel", "bottom_planlist_click", "", 0, 0, 0, 0, t), l.DownloadModeNS.setFullDownloadMode(), L.showNotify(v.ToastNotifyManagerNS.notifyIdScheduleTaskDownloadMode, m.ToastNotifyItemType.GreenNotify, "已为您切换至全速下载模式", 3e3), this.popUpScheduleMenu(!1);
                    break;
                case"limitSpeed":
                    t = "button=limitspeed", y.XLStatNS.trackEvent("download_leftpanel", "bottom_planlist_click", "", 0, 0, 0, 0, t), l.DownloadModeNS.showCustomDownloadModeDlg().then(e => {
                        e && L.showNotify(v.ToastNotifyManagerNS.notifyIdScheduleTaskDownloadMode, m.ToastNotifyItemType.GreenNotify, "已为您切换至限速下载模式", 3e3)
                    }).catch(), this.popUpScheduleMenu(!1);
                    break;
                case"shouleiSync":
                    t = "button=connect_shoulei,status=" + ("online" === this.shouleiSyncState ? "on" : "off"), y.XLStatNS.trackEvent("download_leftpanel", "bottom_planlist_click", "", 0, 0, 0, 0, t), A.MessageBox.custom("shoulei-sync-guide", {
                        type: "online" === this.shouleiSyncState ? "remoting" : "open",
                        sfrom: "plan",
                        statFrom: "left_corner"
                    }).catch(), this.popUpScheduleMenu(!1);
                    break;
                case"freeDownload":
                    this.isFreeDownload ? (t = "button=freedom,status=off", y.XLStatNS.trackEvent("download_leftpanel", "bottom_planlist_click", "", 0, 0, 0, 0, t), u.ScheduleTaskNS.closeFreeDownLoad(), l.DownloadModeNS.setFreeDownLoadConfig(!1)) : u.ScheduleTaskNS.popMessageBox(() => {
                        t = "button=freedom,status=on", y.XLStatNS.trackEvent("download_leftpanel", "bottom_planlist_click", "", 0, 0, 0, 0, t), l.DownloadModeNS.setFreeDownLoadConfig(!0), u.ScheduleTaskNS.startFreeDownLoad()
                    }), this.popUpScheduleMenu(!1);
                    break;
                case"scheduleTask":
                    t = "button=plan", y.XLStatNS.trackEvent("download_leftpanel", "bottom_planlist_click", "", 0, 0, 0, 0, t), u.ScheduleTaskNS.showPlanTaskDlg(), this.popUpScheduleMenu(!1);
                    break;
                case"shutdown":
                    this.downloadCompleteTaskType !== u.ScheduleCompleteTaskType.ShutDown ? (t = "button=finished_close", y.XLStatNS.trackEvent("download_leftpanel", "bottom_planlist_click", "", 0, 0, 0, 0, t), u.ScheduleTaskNS.setDownloadCompleteTaskType(u.ScheduleCompleteTaskType.ShutDown)) : u.ScheduleTaskNS.cancelDownloadCompleteTask(), this.popUpScheduleMenu(!1);
                    break;
                case"sleep":
                    this.downloadCompleteTaskType !== u.ScheduleCompleteTaskType.Sleep ? (t = "button=finished_sleep", y.XLStatNS.trackEvent("download_leftpanel", "bottom_planlist_click", "", 0, 0, 0, 0, t), u.ScheduleTaskNS.setDownloadCompleteTaskType(u.ScheduleCompleteTaskType.Sleep)) : u.ScheduleTaskNS.cancelDownloadCompleteTask(), this.popUpScheduleMenu(!1);
                    break;
                case"exit":
                    this.downloadCompleteTaskType !== u.ScheduleCompleteTaskType.Exit ? (t = "button=finished_exit", y.XLStatNS.trackEvent("download_leftpanel", "bottom_planlist_click", "", 0, 0, 0, 0, t), u.ScheduleTaskNS.setDownloadCompleteTaskType(u.ScheduleCompleteTaskType.Exit)) : u.ScheduleTaskNS.cancelDownloadCompleteTask(), this.popUpScheduleMenu(!1);
                    break;
                default:
                    this.popUpScheduleMenu(!1)
            }
        }
    };
    n([o.Prop({})], U.prototype, "currentCategoryId", void 0), n([o.Prop({})], U.prototype, "UPDATE_CATEGORY", void 0), n([o.Prop({})], U.prototype, "current", void 0), n([o.Prop({})], U.prototype, "tabs", void 0), n([o.Watch("canShowDiskBusy")], U.prototype, "onIsDiskInfoChange", null), n([o.Watch("isLimit")], U.prototype, "onIsLimtChanged", null), U = n([o.Component], U), t.default = U
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(199), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(637), a = i(33);
    t.default = a.connector.connect({
        mapStateToProps: {showUpgradeTask: e => e.UpgradeTaskState.showUpgradeTask},
        mapCommitToProps: {SHOW_UPGRADE_TASK: "SHOW_UPGRADE_TASK"},
        mapDispatchToProps: {},
        mapGettersToProps: {}
    })(n.default)
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(201), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0}), i(785);
    const a = i(8), o = i(453).DownloadKernelUpgradeNS.getUpgrade();
    let r = class extends a.Vue {
        constructor() {
            super(...arguments), this.progress = 0
        }

        onUpgradeProgress(e, t) {
            this.progress = e > 0 ? Math.floor(100 * t / e) : 0
        }

        created() {
            o.attachListener(o.eventUpgradeProgress, this.onUpgradeProgress)
        }

        destroyed() {
            o.detachListener(o.eventUpgradeProgress, this.onUpgradeProgress)
        }
    };
    r = n([a.Component], r), t.default = r
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(203), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0}), i(787);
    const a = i(8), o = i(49), r = i(46), s = o.ToastNotifyManagerNS.getToastNotifyManger();
    let l = class extends a.Vue {
        constructor() {
            super(...arguments), this.show = !1, this.showNotifyItem = null, this.message = "", this.type = "send", this.durationTimer = void 0, this.isUp = !1
        }

        onHasLeftBottomAdChange(e) {
            this.isUp = e
        }

        get cancel() {
            return !!this.showNotifyItem && this.showNotifyItem.getCancel()
        }

        get cancelText() {
            return this.showNotifyItem ? this.showNotifyItem.getCancelText() : ""
        }

        get component() {
            let e = "";
            return this.showNotifyItem && this.showNotifyItem.getType() === r.ToastNotifyItemType.Custom && (e = this.showNotifyItem.getComponentId()), e
        }

        handleClose() {
            this.showNotifyItem && (this.showNotifyItem.close(), s.closeNotify(this.showNotifyItem.getId()))
        }

        handleCancel() {
            this.showNotifyItem && (this.showNotifyItem.getCancel() && this.showNotifyItem.cancel(), s.closeNotify(this.showNotifyItem.getId()))
        }

        handleMouseMove() {
            void 0 !== this.durationTimer && (clearTimeout(this.durationTimer), this.durationTimer = void 0)
        }

        handleMouseOut() {
            if (this.showNotifyItem) {
                let e = this.showNotifyItem.getDuration();
                e && e > 0 && (this.durationTimer = setTimeout(() => {
                    this.durationTimer = void 0, this.showNotifyItem && s.closeNotify(this.showNotifyItem.getId())
                }, e))
            }
        }

        onShowNotify(e, t) {
            switch (void 0 !== this.durationTimer && (clearTimeout(this.durationTimer), this.durationTimer = void 0), this.showNotifyItem = t, this.message = t.getMessage(), t.getType()) {
                case r.ToastNotifyItemType.GreenNotify:
                    this.type = "send";
                    break;
                case r.ToastNotifyItemType.RedNotify:
                case r.ToastNotifyItemType.RedCancelNotify:
                    this.type = "fail"
            }
            this.show = !0;
            let i = t.getDuration();
            i && i > 0 && (this.durationTimer = setTimeout(() => {
                this.durationTimer = void 0, s.closeNotify(e)
            }, i))
        }

        onCloseNotify(e, t) {
            this.showNotifyItem && e === this.showNotifyItem.getId() && (this.show = !1, this.showNotifyItem = null), void 0 !== this.durationTimer && (clearTimeout(this.durationTimer), this.durationTimer = void 0)
        }

        onUpdateNotify(e, t) {
            this.onShowNotify(e, t)
        }

        created() {
            s.attachListener("OnShowNotify", this.onShowNotify), s.attachListener("OnUpdateNotify", this.onUpdateNotify), s.attachListener("OnCloseNotify", this.onCloseNotify)
        }

        destroyed() {
            s.detachListener("OnShowNotify", this.onShowNotify), s.detachListener("OnUpdateNotify", this.onUpdateNotify), s.detachListener("OnCloseNotify", this.onCloseNotify)
        }
    };
    n([a.Prop({})], l.prototype, "hasLeftBottomAd", void 0), n([a.Watch("hasLeftBottomAd")], l.prototype, "onHasLeftBottomAdChange", null), l = n([a.Component({components: {GetCoinPrizeToast: () => Promise.resolve().then(() => i(640))}})], l), t.default = l
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(205), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(8), r = i(14);
    let {isDef: s} = r.ThunderUtil;
    const l = i(7), d = i(9), u = i(10);
    let c = class extends o.Vue {
        constructor() {
            super(...arguments), this.coinCount = "", this.userId = ""
        }

        getIsVip() {
            return a(this, void 0, void 0, function* () {
                let e = !1;
                try {
                    let t = JSON.parse(yield l.client.callServerFunction("GetUserInfo", 2));
                    if (s(t)) {
                        e = Number(t.isVip) > 0
                    }
                } catch (e) {
                }
                return e
            })
        }

        handlePrize() {
            return a(this, void 0, void 0, function* () {
                yield l.client.callServerFunction("OpenNewTab", "https://misc-xl9-ssl.xunlei.com/welfare-pc/?entrypage=dltab_detail&entry=task_list");
                let e = yield this.getIsVip();
                d.XLStatNS.trackEvent("download_leftpanel", "coin_get_toast_click", "", 0, 0, 0, 0, {is_vip: e ? "1" : "0"}), u.ConfigNS.setValue("Toast", "GetCoinPrizePopDate" + this.userId, (new Date).toLocaleDateString()), u.ConfigNS.setValue("Toast", "GetCoinPrizePopClick" + this.userId, !0), this.$emit("ok")
            })
        }

        handleClose() {
            u.ConfigNS.setValue("Toast", "GetCoinPrizePopDate" + this.userId, (new Date).toLocaleDateString()), u.ConfigNS.setValue("Toast", "GetCoinPrizePopClick" + this.userId, !0), this.$emit("close")
        }

        mounted() {
            return a(this, void 0, void 0, function* () {
                let e = yield this.getIsVip();
                this.coinCount = e ? "+8" : "+5", this.userId = yield l.client.callServerFunction("GetUserID"), d.XLStatNS.trackEvent("download_leftpanel", "coin_get_toast_show", "", 0, 0, 0, 0, {is_vip: e ? "1" : "0"})
            })
        }
    };
    n([o.Prop({})], c.prototype, "data", void 0), n([o.Prop({})], c.prototype, "isUp", void 0), c = n([o.Component], c), t.default = c
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(207), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(8), o = i(454), r = i(63), s = i(100);
    let l = class extends a.Vue {
        constructor() {
            super(...arguments), this.cookie = null, this.content = "", this.btnText = "", this.iconUrl = "", this.sceneData = {}, this.orderData = {}, this.styleEx = {}, this.contextColor = "", this.contextBkgColor = "", this.btnColor = "", this.btnBkgColor = ""
        }

        get adBackground() {
            let e = "";
            do {
                if (!this.styleEx) break;
                if (!this.styleEx.background) break;
                e = `background: ${this.styleEx.background};`
            } while (0);
            return e
        }

        get adPColor() {
            let e = "";
            do {
                if (!this.styleEx) break;
                if (!this.styleEx.p_color) break;
                e = `color: ${this.styleEx.p_color};`
            } while (0);
            return e
        }

        get adOptionAStyle() {
            let e = "";
            do {
                if (!this.styleEx) break;
                this.styleEx.a_color && (e = `color: ${this.styleEx.a_color};`), this.styleEx.a_background && (e = `${e}background: ${this.styleEx.a_background};`)
            } while (0);
            return e
        }

        checkStyleExValid(e) {
            let t = !0;
            do {
                if (!e) {
                    t = !1;
                    break
                }
                if (e.background && !/^#[a-fA-F0-9]{6}/.test(e.background)) {
                    t = !1;
                    break
                }
                if (e.p_color && !/^#[a-fA-F0-9]{6}/.test(e.p_color)) {
                    t = !1;
                    break
                }
                if (e.a_background && !/^#[a-fA-F0-9]{6}/.test(e.a_background)) {
                    t = !1;
                    break
                }
                if (e.a_color && !/^#[a-fA-F0-9]{6}/.test(e.a_color)) {
                    t = !1;
                    break
                }
            } while (0);
            return t
        }

        onClick(e) {
            if (this.$emit("ad-show", !1), "btn" === e || "content" === e) {
                let e = this.orderData.openType, t = this.orderData.targetUrl, i = this.orderData.targetSubUrl;
                r.AdHelperNS.execute(e, t, i)
            }
            o.adPlatform.handleEvent(e)
        }

        created() {
            this.cookie = o.adPlatform.attachListener(s.AdCommonNS.eventAdShow, (e, t, i, n) => {
                e === s.AdCommonNS.AdName.AdPlatform && (this.sceneData = t, this.orderData = i, this.content = i.content, this.btnText = i.btnText, this.iconUrl = i.iconUrl, this.checkStyleExValid(n) ? this.styleEx = n : this.styleEx = {}, this.$emit("ad-show", !0), o.adPlatform.handleEvent("ad_show"))
            })
        }

        destroyed() {
            null !== this.cookie && (o.adPlatform.detachListener(s.AdCommonNS.eventAdShow, this.cookie), this.cookie = null)
        }
    };
    l = n([a.Component], l), t.default = l
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(209), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(8), o = i(336), r = i(63), s = i(100);
    let l = class extends a.Vue {
        constructor() {
            super(...arguments), this.cookie = null, this.content = "", this.picFile = "", this.orderData = {}
        }

        onClick(e) {
            if ("content" === e) {
                let e = this.orderData.openType, t = this.orderData.targetUrl, i = this.orderData.targetSubUrl;
                r.AdHelperNS.execute(e, t, i)
            } else "close" === e ? this.$emit("ad-left-bottom-show", !1) : "nodisturb" === e && (o.adLeftBottomHelper.setNoDisturb(), this.$emit("ad-left-bottom-show", !1));
            o.adLeftBottomHelper.handleEvent(e)
        }

        created() {
            this.cookie = o.adLeftBottomHelper.attachListener(s.AdCommonNS.eventAdShow, (e, t) => {
                e === s.AdCommonNS.AdName.AdLeftBottomVip && (this.orderData = t, this.picFile = t.picFile, this.$emit("ad-left-bottom-show", !0))
            })
        }

        destroyed() {
            null !== this.cookie && (o.adLeftBottomHelper.detachListener(s.AdCommonNS.eventAdShow, this.cookie), this.cookie = null)
        }
    };
    n([a.Prop({})], l.prototype, "isSearch", void 0), l = n([a.Component], l), t.default = l
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(211), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(645), a = i(33);
    t.default = a.connector.connect({
        mapStateToProps: {
            tabs: e => e.Tabs.tabs,
            preloadPath: e => `file:///${__rootDir}/out/common-preload.js`
        },
        mapCommitToProps: {createNewTab: "CREATE_NEW_TAB", selectNav: "SELECT_NAV"},
        mapDispatchToProps: {selectTab: "selectTab"}
    })(n.default)
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(213), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(8), r = i(67), s = i(27), l = i(11), d = i(15), u = i(13), c = i(3), h = i(7), f = i(315), g = i(71),
        p = i(24), v = i(646), m = i(9), y = i(0).default.getLogger("task-detail"),
        k = l.DownloadKernelTaskManager.getTaskManager(), T = d.DownloadKernelEventManager.getEventManager();
    let w = class extends o.Vue {
        constructor() {
            super(...arguments), this.elementId = "home-1EAC214F-7644-4163-9EB8-AF4BAA62D144", this.transition = !1, this.curTaskId = 0, this.curTask = null, this.select = !1, this.curPannel = "", this.curIndex = C.Comments, this.curCategoryid = c.DownloadKernel.CategroyViewID.Downloading, this.unFireIndex = C.Comments, this.playingMediaIndex = -1, this.playingCurTask = !1, this.playingTaskId = 0, this.intervalGetPlayMedia = void 0, this.updatePlayAreaTimer = void 0, this.chosenTasks = [], this.multiChosenTaskList = [], this.curUserId = "", this.isLogined = !1
        }

        get curTaskName() {
            return 0 !== this.curTaskId ? (y.information("###  this.curTaskId", this.curTaskId), this.curTask.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskName)) : ""
        }

        get curTaskStatus() {
            return 0 !== this.curTaskId ? this.curTask.getTaskStatus() : c.DownloadKernel.TaskStatus.Unkown
        }

        get isBtOrGroup() {
            if (0 !== this.curTaskId) {
                let e = this.curTask.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskType);
                return e === c.DownloadKernel.TaskType.Bt || e === c.DownloadKernel.TaskType.Group
            }
            return !1
        }

        switchNav(e) {
            this.selectNav(e)
        }

        indexOfTab(e) {
            let t = -1;
            for (let i = 0; i < this.tabs.length; i++) if (this.tabs[i].tab.getTabType() === r.TabType.Chromium && this.tabs[i].tab.getOriginalUrl() === e) {
                t = i;
                break
            }
            return t
        }

        updateTaskInfo(...e) {
            y.information("updateTaskInfo", this.curTaskId);
            do {
                if (!e) break;
                if (!e[1]) break;
                let t = e[1];
                for (let e = 0; e < t.length; ++e) {
                    let i = t[e];
                    if (i && i.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskId) === this.curTaskId) {
                        this.curTask = i;
                        break
                    }
                }
            } while (0)
        }

        operate(e, t = "right", ...i) {
            return a(this, void 0, void 0, function* () {
                return h.client.callServerFunction("OperateTask", this.curTaskId, e, ...i)
            })
        }

        updateUserInfo() {
            return a(this, void 0, void 0, function* () {
                this.curUserId = yield p.LoginHelperNS.loginHelper.getUserInfoAw("userid"), this.userInfo = yield p.LoginHelperNS.loginHelper.getUserInfoAw(), this.isLogined && (this.vipInfo = p.LoginHelperNS.loginHelper.getVipInfo())
            })
        }

        onCurTaskChange() {
            this.getPlayMedia()
        }

        updatePosition() {
            return a(this, void 0, void 0, function* () {
                yield g.clientProduct.updateXmpPosition()
            })
        }

        onScroll(e) {
            return a(this, void 0, void 0, function* () {
                this.$nextTick(() => {
                    let t, i = document.querySelector("div#xly-task-detail-preview.xly-preview"),
                        n = {width: 0, height: 0, x: 0, y: 0};
                    if (i && (t = i.getBoundingClientRect()), t) if (n.y = t.top, n.x = t.left, n.width = t.width, n.height = t.height, e.srcElement.scrollTop > 0) n.y = 42, n.height = 259, g.clientProduct.updateDownloadEmbedRect(n), this.updatePosition(); else if (0 !== this.playingTaskId) {
                        let e = k.getTaskFromTaskId(this.playingTaskId);
                        if (e) {
                            let t = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.GroupTaskId);
                            t > 0 ? t === this.curTaskId && (g.clientProduct.updateDownloadEmbedRect(n), this.updatePosition()) : this.playingTaskId === this.curTaskId && (g.clientProduct.updateDownloadEmbedRect(n), this.updatePosition()), m.XLStatNS.trackEvent("download_detail", "dl_detail_yunpan_ceiling_play")
                        }
                    }
                })
            })
        }

        attachScrollEvent() {
            document.querySelector("div#xly-task-detail-down__main.xly-down__main").addEventListener("scroll", this.onScroll.bind(this))
        }

        getPlayMedia() {
            return a(this, void 0, void 0, function* () {
                if (v.crossClient.isConnected() || v.crossClient.connect("xmplite"), !v.crossClient.isConnected()) return this.playingMediaIndex = -1, this.playingCurTask = !1, void (this.playingTaskId = -1);
                if (this.playingTaskId = yield v.crossClient.crossProductCall("XmpPlayerGetCurrentMediaAttribute", 33), this.playingTaskId !== this.curTaskId) return this.playingMediaIndex = -1, void (this.playingCurTask = !1);
                this.playingCurTask = !0;
                let e = yield v.crossClient.crossProductCall("XmpPlayerGetCurrentMediaAttribute", 34);
                this.playingMediaIndex = e
            })
        }

        mounted() {
            return a(this, void 0, void 0, function* () {
                f.HistoryTaskSpeedInfoNS.init().catch(), s.default.attachListener(u.NodeEventMesssageNS.eventDownloadItemActive, (e, t, i, n, a, o) => {
                    t ? (this.curTaskId = i, this.curTask = k.getTaskFromTaskId(this.curTaskId), this.select = !0, this.curCategoryid = e, this.curIndex = o, y.information("#### DownloadItemActive", i, e, o)) : (a || i === this.curTaskId) && (this.curTaskId = 0, this.curTask = null, this.curPannel = "", this.select = !1)
                }), s.default.attachListener(u.NodeEventMesssageNS.eventDetailSwitch2Index, (e, t) => {
                    y.information("DetailSwitch2Index", e, t), this.curTaskId = e, this.curIndex = t
                }), T.attachTaskEvent(c.DownloadKernel.TaskEventType.DetailChanged, (...e) => {
                    this.updateTaskInfo(...e)
                }), h.client.attachServerEvent("OnLoginSuc", (e, ...t) => {
                    this.isLogined = !0
                }), h.client.attachServerEvent("OnLogout", (e, ...t) => {
                    this.isLogined = !1
                }), this.isLogined = yield p.LoginHelperNS.loginHelper.isLoginedAw(), yield this.getPlayMedia(), this.intervalGetPlayMedia = setInterval(this.getPlayMedia, 2e3), this.attachScrollEvent(), h.client.attachServerEvent("OnDownloadItemChosen", (e, ...t) => {
                    if (t && !(t.length < 4)) {
                        if (this.timeoutSetChosenTasks && (clearTimeout(this.timeoutSetChosenTasks), this.timeoutSetChosenTasks = void 0), !0 === t[1]) {
                            -1 === this.chosenTasks.findIndex(e => e === t[2]) && (this.chosenTasks.push(t[2]), this.curCategoryid = t[0])
                        } else {
                            let e = this.chosenTasks.findIndex(e => e === t[2]);
                            -1 !== e && this.chosenTasks.splice(e, 1)
                        }
                        this.timeoutSetChosenTasks = setTimeout(() => {
                            this.multiChosenTaskList = Object.assign([], this.chosenTasks), this.timeoutSetChosenTasks = void 0
                        }, 50)
                    }
                }), window.addEventListener("resize", this.updateViewPos), window.addEventListener("maximize", this.updateViewPos)
            })
        }

        beforeDestroy() {
            window.removeEventListener("resize", this.updateViewPos), window.removeEventListener("maximize", this.updateViewPos), clearInterval(this.intervalGetPlayMedia);
            let e = document.querySelector("div#xly-task-detail-down__main.xly-down__main");
            e && e.removeEventListener("scroll", this.onScroll)
        }

        updateViewPos() {
            let e, t = document.querySelector("div.td-tabs__pane"), i = {width: 0, height: 0, x: 0, y: 0};
            if (t && (e = t.getBoundingClientRect()), !e) return;
            i.y = e.top, i.x = e.left, i.width = e.width, i.height = e.height;
            let n = {width: 350, height: 200, x: window.innerWidth - 350 - 40, y: window.innerHeight - 200 - 30};
            g.clientProduct.updateMiniRect(n), g.clientProduct.updateDownloadEmbedRect(i), g.clientProduct.updateXmpPosition()
        }
    };
    var C;
    n([o.Prop({})], w.prototype, "tabs", void 0), n([o.Prop({})], w.prototype, "preloadPath", void 0), n([o.Prop({})], w.prototype, "createNewTab", void 0), n([o.Prop({})], w.prototype, "selectTab", void 0), n([o.Prop({})], w.prototype, "selectNav", void 0), n([o.Watch("isLogined")], w.prototype, "updateUserInfo", null), n([o.Watch("curTaskId", {immediate: !0})], w.prototype, "onCurTaskChange", null), w = n([o.Component({
        components: {
            XlTab: () => Promise.resolve().then(() => i(647)),
            XlHeader: () => Promise.resolve().then(() => i(654)),
            XlDetail: () => Promise.resolve().then(() => i(655)),
            FileList: () => Promise.resolve().then(() => i(656)),
            MultiChosenTasks: () => Promise.resolve().then(() => i(658))
        }
    })], w), t.default = w, function (e) {
        e.Comments = "comments", e.FileList = "files", e.Attribute = "detail"
    }(C || (C = {}))
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(215), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(8), r = i(3), s = i(11), l = i(15), d = i(41), u = i(20), c = i(9),
        h = l.DownloadKernelEventManager.getEventManager(), f = i(0).default.getLogger("XlTab.view"),
        g = s.DownloadKernelTaskManager.getTaskManager();
    let p = class extends o.Vue {
        constructor() {
            super(...arguments), this.tabs = [{title: "速度", key: "TaskChart"}, {
                title: "属性",
                key: "Attribute"
            }], this.activeKey = "TaskChart", this.eventOnTaskStatusChange = -1
        }

        onCurTaskIdChange() {
            return a(this, void 0, void 0, function* () {
                this.curTask = g.getTaskFromTaskId(this.curTaskId);
                let e = this.curTask.isSupportPlay(), t = this.curTask.getTaskStatus(), i = !1;
                t !== r.DownloadKernel.TaskStatus.Seeding && t !== r.DownloadKernel.TaskStatus.Succeeded || (i = yield d.TaskCtrlOperatorNS.isExistTaskFile(this.curTask.getTaskBaseInfo())), e && this.curCategoryid === r.DownloadKernel.CategroyViewID.Downloading && t !== r.DownloadKernel.TaskStatus.Failed ? (this.tabs = [{
                    title: "边下边播",
                    key: "Preview"
                }, {title: "速度", key: "TaskChart"}, {
                    title: "属性",
                    key: "Attribute"
                }], this.activeKey = "Preview") : e && i && this.curCategoryid === r.DownloadKernel.CategroyViewID.Completed ? (this.tabs = [{
                    title: "播放",
                    key: "Preview"
                }, {title: "速度", key: "TaskChart"}, {
                    title: "属性",
                    key: "Attribute"
                }], this.activeKey = "Preview") : (this.tabs = [{title: "速度", key: "TaskChart"}, {
                    title: "属性",
                    key: "Attribute"
                }], this.activeKey = "TaskChart")
            })
        }

        onActiveKeyChange() {
            let e = "module_type=" + this.activeKey;
            c.XLStatNS.trackEvent("download_detail", "dl_detail_status_show", "", 0, 0, 0, 0, e), u.server.fireClientEvent("OnHomeTabChange", this.activeKey, this.curTaskId.toString()), f.information("activeKey: ", this.activeKey), this.$emit("tabChange", this.activeKey)
        }

        onTabChange(e) {
            this.activeKey = e
        }

        mounted() {
            this.eventOnTaskStatusChange = h.attachTaskEvent(r.DownloadKernel.TaskEventType.StatusChanged, (...e) => {
                if (!e || e[0] !== r.DownloadKernel.TaskEventType.StatusChanged) return;
                if (!e[1]) return;
                let t = e[1];
                for (let e of t) if (e.getId() === this.curTaskId) {
                    e.getTaskStatus() === r.DownloadKernel.TaskStatus.Failed && (this.tabs = [{
                        title: "速度",
                        key: "TaskChart"
                    }, {title: "属性", key: "Attribute"}], this.activeKey = "TaskChart");
                    break
                }
            })
        }

        beforeDestroy() {
            h.detachTaskEvent(r.DownloadKernel.TaskEventType.StatusChanged, this.eventOnTaskStatusChange)
        }
    };
    n([o.Prop({default: 0})], p.prototype, "curTaskId", void 0), n([o.Prop({default: ""})], p.prototype, "curUserId", void 0), n([o.Prop()], p.prototype, "curCategoryid", void 0), n([o.Watch("curTaskId", {immediate: !0})], p.prototype, "onCurTaskIdChange", null), n([o.Watch("activeKey", {immediate: !0})], p.prototype, "onActiveKeyChange", null), p = n([o.Component({
        components: {
            Preview: () => Promise.resolve().then(() => i(648)),
            Attribute: () => Promise.resolve().then(() => i(649)),
            TaskChart: () => Promise.resolve().then(() => i(651))
        }
    })], p), t.default = p
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(217), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(8), r = i(71), s = i(7), l = i(3), d = i(11), u = i(9), c = i(54),
        h = i(0).default.getLogger("Thunder-Preview"), f = d.DownloadKernelTaskManager.getTaskManager();
    let g = class extends o.Vue {
        constructor() {
            super(...arguments), this.pageHeight = 0, this.client = r.clientProduct, this.loading = !1, this.eventOnShowDownAndPlayToast = -1, this.loadingTimer = null
        }

        play() {
            return a(this, void 0, void 0, function* () {
                let e, t = f.getTaskFromTaskId(this.curTaskId).getType(),
                    i = document.querySelector("div.td-tabs__pane"), n = {width: 0, height: 0, x: 0, y: 0};
                i && (e = i.getBoundingClientRect()), n.y = e.top, n.x = e.left, n.width = e.width, n.height = e.height;
                let a = {width: 350, height: 200, x: window.innerWidth - 350 - 40, y: window.innerHeight - 200 - 30};
                r.clientProduct.updateMiniRect(a), r.clientProduct.updateDownloadEmbedRect(n), h.information("play miniRect", a, "rect", n), t === l.DownloadKernel.TaskType.Bt || t === l.DownloadKernel.TaskType.Group ? s.client.callServerFunction("PlayBtOrGroupTask", this.curTaskId).then().catch() : s.client.callServerFunction("OperateTask", this.curTaskId, "play").then().catch(), s.client.attachServerEvent("OnXmpState", (e, t, i, n) => {
                    t === c.XmpEvent.onPreOpen && this.curTaskId.toString() === i && (this.loading = !1, clearTimeout(this.loadingTimer), this.loadingTimer = null)
                }), u.XLStatNS.trackEvent("download_detail", "dl_detail_play_btn_click")
            })
        }

        onShowDownAndPlayToast(e, ...t) {
            this.loading = !0, this.loadingTimer && (clearTimeout(this.loadingTimer), this.loadingTimer = null), this.loadingTimer = setTimeout(() => {
                this.loading = !1
            }, 5e3)
        }

        mounted() {
            this.eventOnShowDownAndPlayToast = s.client.attachServerEvent("OnShowDownAndPlayToast", this.onShowDownAndPlayToast)
        }

        beforeDestroy() {
            this.pageHeight = window.innerHeight, s.client.detachServerEvent("OnShowDownAndPlayToast", this.eventOnShowDownAndPlayToast)
        }
    };
    n([o.Prop({default: 0})], g.prototype, "curTaskId", void 0), n([o.Prop()], g.prototype, "curCategoryid", void 0), n([o.Prop()], g.prototype, "playingCurTask", void 0), g = n([o.Component], g), t.default = g
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(219), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(0), o = i(8), r = i(3), s = i(11), l = i(15);
    let d = i(650);
    const u = i(14), c = a.default.getLogger("task-detail-Attribute"), h = s.DownloadKernelTaskManager.getTaskManager(),
        f = l.DownloadKernelEventManager.getEventManager();
    let g = class extends o.Vue {
        constructor() {
            super(...arguments), this.eventOnTaskDetailChange = -1, this.myChart = null, this.originSize = 0, this.p2pSize = 0, this.p2sSize = 0, this.offlineSize = 0, this.channelSize = 0, this.downloadSize = 0, this.fileSize = 0
        }

        get originPercent() {
            return 0 === this.fileSize ? "0.00" : (this.originSize / this.fileSize * 100).toFixed(2)
        }

        get p2pPercent() {
            return 0 === this.fileSize ? "0.00" : (this.p2pSize / this.fileSize * 100).toFixed(2)
        }

        get p2sPercent() {
            return 0 === this.fileSize ? "0.00" : (this.p2sSize / this.fileSize * 100).toFixed(2)
        }

        get offlinePercent() {
            return 0 === this.fileSize ? "0.00" : (this.offlineSize / this.fileSize * 100).toFixed(2)
        }

        get undownloadSize() {
            return 0 === this.fileSize ? 1 : this.task.getTaskStatus() === r.DownloadKernel.TaskStatus.Seeding || this.task.getTaskStatus() === r.DownloadKernel.TaskStatus.Succeeded ? 0 : Math.max(this.fileSize - this.downloadSize, 0)
        }

        get undownloadPercent() {
            return 0 === this.fileSize ? "0.00" : (this.undownloadSize / this.fileSize * 100).toFixed(2)
        }

        get fileSizeFormat() {
            return this.formatSize(this.fileSize)
        }

        watchTaskInfoChange() {
            this.task = h.getTaskFromTaskId(this.curTaskId), this.drawTaskInfo(!1)
        }

        drawPie(e = !0) {
            if (null == this.myChart) return;
            let t = {
                legend: {orient: "vertical", left: 10},
                series: [{
                    type: "pie",
                    radius: ["80%", "100%"],
                    avoidLabelOverlap: !1,
                    hoverAnimation: !1,
                    animation: e,
                    itemStyle: {normal: {label: {show: !1}, labelLine: {show: !1}}},
                    color: ["#7ee09e", "#23D9D6", "#3980FA", "#FECB56", "#e6eeff"],
                    data: [{value: this.originSize}, {value: this.p2sSize}, {value: this.p2pSize}, {value: this.offlineSize}, {value: this.undownloadSize}]
                }]
            };
            t && "object" == typeof t && this.myChart.setOption(t, !0)
        }

        formatSize(e) {
            return u.ThunderUtil.formatSize(e)
        }

        init() {
            this.task = h.getTaskFromTaskId(this.curTaskId);
            let e = document.getElementById("chart");
            this.myChart = d.init(e), this.drawTaskInfo(!1)
        }

        drawTaskInfo(e = !0) {
            let t = this.task.getTaskChannelInfo(), i = this.task.getTaskBaseInfo();
            this.originSize = t.originSize, this.p2pSize = t.p2pSize, this.p2sSize = t.p2sSize, this.offlineSize = t.offlineSize, this.channelSize = this.originSize + this.p2pSize + this.p2sSize + this.offlineSize, this.downloadSize = i.validDownloadSize, this.fileSize = i.fileSize, this.channelSize < this.downloadSize && (this.p2pSize > 0 ? this.p2pSize = this.p2pSize + this.downloadSize - this.channelSize : this.offlineSize > 0 ? this.offlineSize = this.offlineSize + this.downloadSize - this.channelSize : this.originSize > 0 ? this.originSize = this.originSize + this.downloadSize - this.channelSize : this.p2sSize > 0 && (this.p2sSize = this.p2sSize + this.downloadSize - this.channelSize)), this.drawPie(e)
        }

        updateTaskInfo(...e) {
            do {
                if (!e) break;
                if (!e[1]) break;
                let t = e[1];
                for (let e = 0; e < t.length; ++e) {
                    let i = t[e];
                    if (i && i.getTaskAttribute(r.DownloadKernel.TaskAttribute.TaskId) === this.curTaskId) {
                        this.task = i, this.drawTaskInfo();
                        break
                    }
                }
            } while (0)
        }

        mounted() {
            c.information("### attribute mounted"), this.init(), this.eventOnTaskDetailChange = f.attachTaskEvent(r.DownloadKernel.TaskEventType.DetailChanged, (...e) => {
                this.updateTaskInfo(...e)
            })
        }

        beforeDestroy() {
            c.information("### attribute beforeDestroy"), f.detachTaskEvent(r.DownloadKernel.TaskEventType.DetailChanged, this.eventOnTaskDetailChange)
        }
    };
    n([o.Prop({default: 0})], g.prototype, "curTaskId", void 0), n([o.Watch("curTaskId", {immediate: !0})], g.prototype, "watchTaskInfoChange", null), g = n([o.Component], g), t.default = g
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(221), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(0), r = i(4), s = i(3), l = i(11), d = i(15), u = i(41), c = i(62), h = i(315), f = i(652), g = i(8),
        p = i(14), v = i(316), m = i(24), y = i(9), k = d.DownloadKernelEventManager.getEventManager(),
        T = l.DownloadKernelTaskManager.getTaskManager(), w = o.default.getLogger("TaskChart");
    let C = class extends g.Vue {
        constructor() {
            super(...arguments), this.width = 0, this.height = 0, this.progress = 0, this.avgSpeed = 0, this.maxSpeed = 0, this.downloadSpeed = 0, this.vipSpeed = 0, this.taskSpeedInfo = {}, this.curTask = {}, this.speedCurveColor = {
                gradientColorEnd: "rgba(63,133,255,.1)",
                gradientColorStart: "rgba(63,133,255,.5)",
                lineColorEnd: "#3F85FF",
                lineColorStart: "#3F85FF"
            }, this.whiteVipSpeedCurveColor = {
                gradientColorEnd: "rgba(235,121,113,.1)",
                gradientColorStart: "rgba(240,134,127,.5)",
                lineColorEnd: "#eb7971",
                lineColorStart: "#eb7971"
            }, this.superVipSpeedCurveColor = {
                gradientColorEnd: "rgba(235,176,73,.1)",
                gradientColorStart: "rgba(235,176,73,.5)",
                lineColorEnd: "#ebb049",
                lineColorStart: "#ebb049"
            }, this.userSpeedCurveColor = {
                gradientColorEnd: "rgba(63,133,255,.1)",
                gradientColorStart: "rgba(63,133,255,.5)",
                lineColorEnd: "#3f85ff",
                lineColorStart: "#3f85ff"
            }, this.eventOnTaskDetailChange = -1, this.eventOnTaskStatusChange = -1, this.options = [], this.lastPoint = 0, this.points = [], this.requireAnimation = -1, this.srcUsing = "0", this.srcTotal = "0", this.remain = "--:--:--", this.isBtOrGroup = !1, this.isSupportPlay = !1, this.curTaskBase = {}, this.vipInfo = {}, this.lastPoints = [], this.increasePoints = [], this.curveLeft = 0, this.curveTop = 155, this.downloadingPeriod = 1, this.lastData = [], this.curData = [], this.lastPointX = 0, this.lastPointY = 0, this.maxValue = 0, this.historyMaxValue = 0, this.lastMaxValue = 0, this.maxValueIncrease = 0, this.frame = 10, this.taskFileExist = !0, this.historyVipSpeedColorMap = {}, this.curTaskIsTryTask = !1, this.showCurveCutLine = !0
        }

        onCurUserIdChange() {
            return a(this, void 0, void 0, function* () {
                if (this.userSpeedCurveColor = this.speedCurveColor, "" === this.curUserId) this.vipInfo = {}; else {
                    if (this.vipInfo = m.LoginHelperNS.loginHelper.getVipInfo(), "0" === this.vipInfo.isVip) return;
                    "3" === this.vipInfo.vasType ? this.userSpeedCurveColor = this.whiteVipSpeedCurveColor : "5" === this.vipInfo.vasType && (this.userSpeedCurveColor = this.superVipSpeedCurveColor)
                }
                let e = [].concat(Object.values(Object.values(this.filteredData[0])));
                this.maxValue = this.getMaxValue(e), this.draw(!1)
            })
        }

        onTaskChange() {
            return a(this, void 0, void 0, function* () {
                if (0 === this.curTaskId) return;
                this.lastPoint = 0, this.curTask = T.getTaskFromTaskId(this.curTaskId), this.isDestroyed(), this.curTaskBase = this.curTask.getTaskBaseInfo(), this.isSupportPlay = this.isTaskSupportPlay();
                let e = this.curTask.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSize),
                    t = this.curTask.getTaskAttribute(s.DownloadKernel.TaskAttribute.FileSize),
                    i = this.curTask.getTaskStatus(), n = 0;
                0 !== t && 0 !== e && (n = i === s.DownloadKernel.TaskStatus.Succeeded || i === s.DownloadKernel.TaskStatus.Seeding || e >= t ? 100 : Math.floor(e / t * 100)), this.taskSpeedInfo = yield this.getHistorySpeedInfo(this.curTaskId, n), yield this.getHistoryVipSpeedColor(), this.maxSpeed = this.taskSpeedInfo.maxSpeed;
                let a = this.curTask.getType();
                this.isBtOrGroup = a === s.DownloadKernel.TaskType.Bt || a === s.DownloadKernel.TaskType.Group, this.updateDownloadInfo();
                let o = [].concat(Object.values(Object.values(this.filteredData[0])));
                this.maxValue = this.getMaxValue(o), this.draw(!1)
            })
        }

        updateOptions() {
            this.$set(this.options, 0, {
                speedCurveColor: this.speedCurveColor,
                data: this.taskSpeedInfo.historySpeedMap
            })
        }

        formatSize(e) {
            return p.ThunderUtil.formatSize(e)
        }

        operate(e, t) {
            v.TaskOperate.operateTaskActions(this.curTaskId, e, t), "play" === e && this.$emit("tabChange", "Preview");
            let i = "button=" + e;
            y.XLStatNS.trackEvent("download_detail", "dl_detail_speed_btn_click", "", 0, 0, 0, 0, i)
        }

        get isFast() {
            return [8, 10].includes(this.curTaskStatus) && 1 === this.downloadingPeriod
        }

        get isVip() {
            if (!this.vipInfo || "0" === this.vipInfo.isVip) return !1;
            let e = !1;
            if (this.curTaskIsTryTask && this.historyVipSpeedColorMap) {
                let t = Object.keys(this.historyVipSpeedColorMap), i = t[t.length - 1];
                e = [1, 2].includes(+this.historyVipSpeedColorMap[i])
            }
            return 1 == +this.vipInfo.isVip && ("3" === this.vipInfo.vasType || "5" === this.vipInfo.vasType) || e
        }

        get curTaskCategoryviewId() {
            return this.curTask.getTaskAttribute(s.DownloadKernel.TaskAttribute.CategoryViewId)
        }

        get curTaskStatus() {
            return this.curTask.getTaskStatus()
        }

        isDestroyed() {
            return a(this, void 0, void 0, function* () {
                let e = !1;
                this.curTaskStatus !== s.DownloadKernel.TaskStatus.Seeding && this.curTaskStatus !== s.DownloadKernel.TaskStatus.Succeeded || (e = yield u.TaskCtrlOperatorNS.isExistTaskFile(this.curTask.getTaskBaseInfo())), this.taskFileExist = e
            })
        }

        get curTaskErrorType() {
            if (this.curTaskStatus !== s.DownloadKernel.TaskStatus.Failed) return null;
            let e = "未知错误";
            switch (this.curTask.getTaskAttribute(s.DownloadKernel.TaskAttribute.ErrorCode)) {
                case s.DownloadKernel.TaskError.Unkown:
                    e = "未知错误";
                    break;
                case s.DownloadKernel.TaskError.Create:
                    e = "任务创建失败, 无法继续下载";
                    break;
                case s.DownloadKernel.TaskError.InvaldLink:
                    e = "任务链接失效, 无法继续下载";
                    break;
                case s.DownloadKernel.TaskError.InvaldConfig:
                    e = "任务配置文件错误, 无法继续下载";
                    break;
                case s.DownloadKernel.TaskError.Timeout:
                    e = "任务连接超时, 无法继续下载";
                    break;
                case s.DownloadKernel.TaskError.VerifyData:
                    e = "任务校验失败, 无法继续下载";
                    break;
                case s.DownloadKernel.TaskError.Forbidden:
                    e = "任务被禁止下载, 无法继续下载";
                    break;
                case s.DownloadKernel.TaskError.FilePathOverRanging:
                    e = "文件路径超出系统限制, 无法继续下载";
                    break;
                case s.DownloadKernel.TaskError.FileCreate:
                    e = "文件创建失败, 无法继续下载";
                    break;
                case s.DownloadKernel.TaskError.FileWrite:
                    e = "文件写入失败, 无法继续下载";
                    break;
                case s.DownloadKernel.TaskError.FileRead:
                    e = "文件读取失败, 无法继续下载";
                    break;
                case s.DownloadKernel.TaskError.FileRename:
                    e = "文件重命名失败, 无法继续下载";
                    break;
                case s.DownloadKernel.TaskError.FileFull:
                    e = "磁盘空间不足, 无法继续下载";
                    break;
                case s.DownloadKernel.TaskError.FileOccupied:
                    e = "文件被占用, 无法继续下载";
                    break;
                case s.DownloadKernel.TaskError.FileAccessDenied:
                    e = "权限不足, 无法继续下载";
                    break;
                case s.DownloadKernel.TaskError.BtUploadExist:
                    e = "BT任务已存在, 无法继续下载";
                    break;
                case s.DownloadKernel.TaskError.ForbinddenResource:
                    e = "敏感资源, 无法继续下载";
                    break;
                case s.DownloadKernel.TaskError.ForbinddenAccount:
                    e = "账号异常无法下载";
                    break;
                case s.DownloadKernel.TaskError.ForbinddenArea:
                case s.DownloadKernel.TaskError.ForbinddenCopyright:
                case s.DownloadKernel.TaskError.ForbinddenReaction:
                case s.DownloadKernel.TaskError.ForbinddenPorn:
                    e = "应版权方要求, 无法下载";
                    break;
                case s.DownloadKernel.TaskError.torrentFileNotExist:
                    e = "种子文件不存在, 无法继续下载";
                    break;
                default:
                    e = "未知错误"
            }
            return e
        }

        isTaskSupportPlay() {
            return this.curTask.isSupportPlay()
        }

        get filteredData() {
            return this.filterData(this.options)
        }

        transformedData() {
            return this.filteredData.map(e => this.transformData(e))
        }

        getMaxValue(e = []) {
            let t = 0;
            return e.forEach(e => {
                t = Math.max(t, parseInt(e, 10))
            }), t
        }

        filterData(e) {
            return e.map(e => {
                let t = {};
                return Object.keys(e.data).forEach((i, n, a) => {
                    i % this.step != 0 && i !== a.length || (t[i] = e.data[i])
                }), t
            })
        }

        onTaskStatusChange() {
        }

        draw(e = !0) {
            let t = this.$refs.dataChart;
            if (this.clearCanvas(), cancelAnimationFrame(this.requireAnimation), w.information("draw canvas: ", JSON.stringify(this.transformedData())), t && t.getContext) {
                let i = t.getContext("2d");
                this.options.forEach((t, n) => {
                    let a = this.transformedData()[n], o = this.bSplineRender(a);
                    if (this.points = o, e || (this.lastData = a, this.lastMaxValue = this.maxValue, this.lastPoint = a[a.length - 1].xValue || 0, this.lastPointX = a[a.length - 1].x || 0, this.lastPointY = a[a.length - 1].y || 0), i.setLineDash([]), !1 !== this.curTaskIsTryTask || e) {
                        if (!e && 0 === n) {
                            let e = [], t = [], n = {
                                0: {
                                    gradientColorEnd: "rgba(63,133,255,.1)",
                                    gradientColorStart: "rgba(63,133,255,.5)",
                                    lineColorEnd: "#3F85FF",
                                    lineColorStart: "#3F85FF"
                                },
                                1: {
                                    gradientColorEnd: "rgba(235,121,113,.1)",
                                    gradientColorStart: "rgba(240,134,127,.5)",
                                    lineColorEnd: "#eb7971",
                                    lineColorStart: "#eb7971"
                                },
                                2: {
                                    gradientColorEnd: "rgba(235,176,73,.1)",
                                    gradientColorStart: "rgba(235,176,73,.5)",
                                    lineColorEnd: "#ebb049",
                                    lineColorStart: "#ebb049"
                                }
                            }, a = this.transformedData()[0], o = this.bSplineRender(a);
                            Object.keys(this.historyVipSpeedColorMap).forEach(i => {
                                let n = this.historyVipSpeedColorMap[i] || 0;
                                if (t[t.length - 1] !== n) {
                                    let o = a.find(e => e.xValue === +i);
                                    o && (e.push((o || {x: 0}).x), t.push(n))
                                }
                            });
                            for (let r = 0; r < e.length; r++) {
                                let s = [];
                                if (r === e.length - 1) s = o; else {
                                    let t = o.findIndex(t => t.x >= e[r + 1]);
                                    (s = o.splice(0, t - 1)).push(o[0])
                                }
                                i.setLineDash([]), this.drawLineAndGradient(i, a, n[t[r]].lineColorStart, n[t[r]].lineColorEnd, n[t[r]].gradientColorStart, n[t[r]].gradientColorEnd, 2, s)
                            }
                        }
                    } else this.drawLineAndGradient(i, a, this.userSpeedCurveColor.lineColorStart, this.userSpeedCurveColor.lineColorEnd, this.userSpeedCurveColor.gradientColorStart, this.userSpeedCurveColor.gradientColorEnd, 2, o)
                }), e && (this.requireAnimation = requestAnimationFrame(() => this.drawPoints(i, 0)))
            }
        }

        drawPoints(e, t) {
            if (!(t >= 60)) {
                if (t % (60 / this.frame) != 0) return t += 1, void (this.requireAnimation = requestAnimationFrame(() => this.drawPoints(e, t)));
                59 === t && (this.maxValue = this.lastMaxValue), this.options.forEach((i, n) => {
                    if (0 === t) {
                        this.maxValue = this.lastMaxValue;
                        let e = [].concat(Object.values(Object.values(this.filteredData[0])));
                        this.historyMaxValue = this.getMaxValue(e.slice(0, e.length - 1));
                        let t = e[e.length - 1];
                        t <= this.historyMaxValue ? this.lastMaxValue > this.historyMaxValue ? this.maxValueIncrease = (this.historyMaxValue - this.lastMaxValue) / this.frame : this.maxValueIncrease = 0 : t > this.lastMaxValue && (this.maxValueIncrease = (t - this.lastMaxValue) / this.frame), this.lastMaxValue = this.getMaxValue(e)
                    }
                    this.maxValue += this.maxValueIncrease;
                    let a = Object.assign({}, this.filteredData[0]);
                    a[this.progress] = Math.min(a[this.progress], this.maxValue);
                    let o = this.transformData(a);
                    if (0 === o.length) return;
                    let r = o.length - 1;
                    0 === t ? (this.lastData = o.slice(0, r), this.lastPoint === o[r].xValue || 0 === r ? (this.xPoint = 0, this.lastData[r] = {
                        x: this.lastPointX,
                        y: this.lastPointY
                    }, this.yPoint = (o[r].y - this.lastPointY) / this.frame) : (this.xPoint = (o[r].x - o[r - 1].x) / this.frame, this.yPoint = (o[r].y - o[r - 1].y) / this.frame, this.lastData[r] = {
                        xValue: o[r - 1].xValue,
                        yValue: o[r - 1].yValue,
                        x: o[r - 1].x,
                        y: o[r - 1].y
                    }), this.lastPoint = o[r].xValue, this.lastPointX = o[r].x, this.lastPointY = o[r].y) : (o[r].x = this.lastData[r].x, o[r].y = this.lastData[r].y, this.lastData = o), this.lastData[r].x = this.lastData[r].x + this.xPoint, this.lastData[r].y = this.lastData[r].y + this.yPoint;
                    let s = this.bSplineRender(this.lastData);
                    if (this.clearCanvas(), !1 === this.curTaskIsTryTask) this.drawLineAndGradient(e, this.lastData, this.userSpeedCurveColor.lineColorStart, this.userSpeedCurveColor.lineColorEnd, this.userSpeedCurveColor.gradientColorStart, this.userSpeedCurveColor.gradientColorEnd, 2, s); else if (0 === n) {
                        let t = [], i = [], n = {
                            0: {
                                gradientColorEnd: "rgba(63,133,255,.1)",
                                gradientColorStart: "rgba(63,133,255,.5)",
                                lineColorEnd: "#3F85FF",
                                lineColorStart: "#3F85FF"
                            },
                            1: {
                                gradientColorEnd: "rgba(235,121,113,.1)",
                                gradientColorStart: "rgba(240,134,127,.5)",
                                lineColorEnd: "#eb7971",
                                lineColorStart: "#eb7971"
                            },
                            2: {
                                gradientColorEnd: "rgba(235,176,73,.1)",
                                gradientColorStart: "rgba(235,176,73,.5)",
                                lineColorEnd: "#ebb049",
                                lineColorStart: "#ebb049"
                            }
                        };
                        Object.keys(this.historyVipSpeedColorMap).forEach(e => {
                            let n = this.historyVipSpeedColorMap[e] || 0;
                            if (i[i.length - 1] !== n) {
                                let a = this.lastData.find(t => t.xValue === +e);
                                a && (t.push((a || {x: 0}).x), i.push(n))
                            }
                        });
                        for (let a = 0; a < t.length; a++) {
                            let o = [];
                            if (a === t.length - 1) o = s; else {
                                let e = s.findIndex(e => e.x >= t[a + 1]);
                                (o = s.splice(0, e - 1)).push(s[0])
                            }
                            this.drawLineAndGradient(e, this.lastData, n[i[a]].lineColorStart, n[i[a]].lineColorEnd, n[i[a]].gradientColorStart, n[i[a]].gradientColorEnd, 2, o)
                        }
                    }
                }), t += 1, this.requireAnimation = requestAnimationFrame(() => this.drawPoints(e, t))
            }
        }

        transformData(e = {}) {
            return Object.keys(e).map(e => parseInt(e, 10)).sort((e, t) => e - t).map(t => ({
                xValue: t,
                yValue: parseInt(e[t], 10),
                x: this.width * t / 100,
                y: this.height * this.paddingTopPercent / 100 + this.height * (100 - this.paddingTopPercent - this.paddingBottomPercent) / 100 * (1 - parseInt(e[t], 10) / (this.maxValue || 1))
            }))
        }

        drawLineAndGradient(e, t, i, n, a, o, r, s) {
            if (!t.length || !s.length) return void (this.curveTop = 20);
            e.lineWidth = r * this.scale, e.beginPath(), e.moveTo((s[0] || t[0]).x, (s[0] || t[0]).y);
            let l = this.renderPath(e, s);
            s[l] ? (this.curveLeft = s[l].x / this.scale - 8, this.curveTop = s[l].y / this.scale + 10) : 0 === s.length && (this.curveLeft = 0, this.curveTop = this.height / this.scale);
            let d = e.createLinearGradient(0, 0, t[t.length - 1].x, 0);
            d.addColorStop(0, i), d.addColorStop(1, n), e.strokeStyle = d, e.stroke(), e.lineTo(s[l].x, this.height), e.lineTo(s[0].x, this.height), e.lineTo(s[0].x, s[0].y);
            let u = e.createLinearGradient(0, 0, 0, this.height);
            u.addColorStop(0, a), u.addColorStop(1, o), e.fillStyle = u, e.closePath(), e.fill()
        }

        drawLine(e, t, i, n, a, o) {
            if (!t.length) return;
            if (!o.length) return;
            e.lineWidth = a * this.scale, e.beginPath(), e.moveTo((o[0] || t[0]).x, (o[0] || t[0]).y), this.renderPath(e, o);
            let r = e.createLinearGradient(0, 0, t[t.length - 1].x, 0);
            r.addColorStop(0, i), r.addColorStop(1, n), e.strokeStyle = r, e.stroke()
        }

        drawGradient(e, t, i, n, a) {
            if (!t.length) return;
            if (!a.length) return;
            e.beginPath(), e.moveTo((a[0] || t[0]).x, (a[0] || t[0]).y);
            let o = this.renderPath(e, a);
            e.lineTo(a[o].x, this.height), e.lineTo(a[0].x, this.height), e.lineTo(a[0].x, a[0].y);
            let r = e.createLinearGradient(0, 0, 0, this.height);
            r.addColorStop(0, i), r.addColorStop(1, n), e.fillStyle = r, e.closePath(), e.fill()
        }

        renderPath(e, t) {
            if (0 === t.length) return 0;
            e.moveTo(t[0].x, t[0].y);
            let i = 0;
            for (let n = 1; n < t.length; n++) t[n] && (e.lineTo(t[n].x, t[n].y), i = n);
            return i
        }

        clearCanvas() {
            let e = this.$refs.dataChart;
            if (e && e.getContext) {
                e.getContext("2d").clearRect(0, 0, this.width, this.height)
            }
        }

        bSplineRender(e) {
            return new f.BSpline({
                degree: 3,
                points: e,
                tessellation: Math.round(this.width * this.progress / 100 * 1.5)
            }).curvePoints.map(([e, t]) => ({x: e, y: t}))
        }

        initCanvas() {
            let e = this.$refs.dataChart;
            if (this.width = Math.floor(this.$refs.canvasBox.clientWidth) * this.scale, this.height = Math.floor(this.$refs.canvasBox.clientHeight - 40 - this.topMargin) * this.scale, e.setAttribute("width", this.width), e.setAttribute("height", this.height), this.userSpeedCurveColor = this.speedCurveColor, "" === this.curUserId) this.vipInfo = {}; else {
                if (this.vipInfo = m.LoginHelperNS.loginHelper.getVipInfo(), "0" === this.vipInfo.isVip) return;
                "3" === this.vipInfo.vasType ? this.userSpeedCurveColor = this.whiteVipSpeedCurveColor : "5" === this.vipInfo.vasType && (this.userSpeedCurveColor = this.superVipSpeedCurveColor)
            }
        }

        updateDownloadInfo() {
            this.downloadSpeed = this.curTask.getDownloadSpeed(), this.vipSpeed = this.curTask.getVipSpeed(), this.maxSpeed = Math.max(this.maxSpeed, this.downloadSpeed);
            let e = this.curTask.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSize),
                t = this.curTask.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadingPeriod);
            t < 1 && (t = 1), this.downloadingPeriod = t, this.avgSpeed = Math.round(e / t), this.avgSpeed > this.maxSpeed && (this.maxSpeed = this.avgSpeed);
            let i = this.curTask.getTaskStatus();
            if (i === s.DownloadKernel.TaskStatus.Succeeded || i === s.DownloadKernel.TaskStatus.Seeding) this.progress = 100; else {
                let t = this.curTask.getTaskAttribute(s.DownloadKernel.TaskAttribute.FileSize);
                if (0 !== t && (this.progress = e / t * 100, this.progress = Math.floor(this.progress), this.progress > 100 ? this.progress = 100 : this.progress < 0 && (this.progress = 0)), this.downloadSpeed > 0 && t > 0) {
                    let i = "--:--:--", n = t - e;
                    if (n > 0) {
                        let e = n / this.downloadSpeed;
                        i = c.TimeHelperNS.formatSeconds(e)
                    }
                    this.remain = i
                }
            }
            this.srcUsing = this.curTask.getTaskAttribute(s.DownloadKernel.TaskAttribute.SrcUsing), this.srcTotal = this.curTask.getTaskAttribute(s.DownloadKernel.TaskAttribute.SrcTotal), r.isNullOrUndefined(this.taskSpeedInfo) || (100 === this.progress && this.taskSpeedInfo.historySpeedMap[this.progress] || (this.taskSpeedInfo.historySpeedMap[this.progress] = this.downloadSpeed), this.updateOptions())
        }

        updateTaskInfo(...e) {
            do {
                if (!e) break;
                if (!e[1]) break;
                let t = e[1];
                for (let e = 0; e < t.length; ++e) {
                    let i = t[e];
                    if (i && i.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskId) === this.curTaskId) {
                        this.updateDownloadInfo(), this.$nextTick(() => this.draw());
                        break
                    }
                }
            } while (0)
        }

        onResize() {
            this.lastPoint = 0, this.initCanvas(), this.draw(!1)
        }

        judgeCurTaskIsTryTask(e) {
            if (!e) return;
            let t = Object.values(e);
            this.curTaskIsTryTask = void 0 !== t.find(e => void 0 !== e && null !== e)
        }

        getHistoryVipSpeedColor() {
            return a(this, void 0, void 0, function* () {
                let e = this.curTask.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSize),
                    t = this.curTask.getTaskAttribute(s.DownloadKernel.TaskAttribute.FileSize),
                    i = this.curTask.getTaskStatus(), n = 0;
                0 !== t && 0 !== e && (n = i === s.DownloadKernel.TaskStatus.Succeeded || i === s.DownloadKernel.TaskStatus.Seeding || e >= t ? 100 : Math.floor(e / t * 100));
                let a = yield this.getHistorySpeedInfo(this.curTaskId, n);
                this.historyVipSpeedColorMap = a.historyVipSpeedColorMap, this.judgeCurTaskIsTryTask(this.historyVipSpeedColorMap)
            })
        }

        mounted() {
            return a(this, void 0, void 0, function* () {
                this.eventOnTaskDetailChange = k.attachTaskEvent(s.DownloadKernel.TaskEventType.DetailChanged, (...e) => a(this, void 0, void 0, function* () {
                    !e || e.length < 3 || 0 == (e[2] & s.DownloadKernel.TaskDetailChangedFlags.UserRead) && 0 == (e[2] & s.DownloadKernel.TaskDetailChangedFlags.PlayPosition) && (yield this.getHistoryVipSpeedColor(), this.updateTaskInfo(...e))
                })), this.eventOnTaskStatusChange = k.attachTaskEvent(s.DownloadKernel.TaskEventType.StatusChanged, (...e) => {
                    this.onTaskStatusChange()
                }), this.initCanvas(), window.addEventListener("resize", this.onResize), this.curveTop = this.height / this.scale
            })
        }

        beforeDestroy() {
            k.detachTaskEvent(s.DownloadKernel.TaskEventType.DetailChanged, this.eventOnTaskDetailChange), k.detachTaskEvent(s.DownloadKernel.TaskEventType.InsertToCategoryView, this.eventOnTaskStatusChange), window.removeEventListener("resize", this.onResize)
        }

        getHistorySpeedInfo(e, t) {
            return a(this, void 0, void 0, function* () {
                let i = {maxSpeed: 0, historySpeedMap: {}, historyIncreaseSpeedMap: {}},
                    n = yield h.HistoryTaskSpeedInfoNS.getTaskSpeedInfo(e);
                do {
                    if (!n) break;
                    if (!n.maxSpeed || n.maxSpeed < 0) break;
                    i.maxSpeed = n.maxSpeed;
                    let e = n.speedInfoMap;
                    if (!e) break;
                    void 0 === t && (t = 0), (!(t = parseInt(t.toString(), 10)) || t < 0) && (t = 0), t > 100 && (t = 100);
                    let a = {0: 0}, o = {0: 0}, r = {};
                    for (let i in e) if (void 0 !== e[i]) {
                        let n = parseInt(i, 10);
                        if (n <= t) {
                            let t = e[i];
                            a[n] = t.downloadSpeed, o[n] = t.addSpeed, r[n] = t.vipSpeedColor
                        }
                    }
                    i.historySpeedMap = a, i.historyIncreaseSpeedMap = o, i.historyVipSpeedColorMap = r
                } while (0);
                return i
            })
        }
    };
    n([g.Prop({default: 2})], C.prototype, "paddingTopPercent", void 0), n([g.Prop({default: 0})], C.prototype, "paddingBottomPercent", void 0), n([g.Prop({default: Math.max(window.devicePixelRatio, 2)})], C.prototype, "scale", void 0), n([g.Prop({default: 1})], C.prototype, "step", void 0), n([g.Prop({default: 21})], C.prototype, "topMargin", void 0), n([g.Prop({default: 0})], C.prototype, "curTaskId", void 0), n([g.Prop({default: ""})], C.prototype, "curUserId", void 0), n([g.Watch("curUserId")], C.prototype, "onCurUserIdChange", null), n([g.Watch("curTaskId", {immediate: !0})], C.prototype, "onTaskChange", null), C = n([g.Component], C), t.default = C
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(223), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(8);
    let o = class extends a.Vue {
        mounted() {
        }
    };
    n([a.Prop({default: ""})], o.prototype, "curTaskName", void 0), o = n([a.Component], o), t.default = o
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(225), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(8), r = i(17), s = i(36), l = i(3), d = i(11), u = i(7), c = i(20), h = i(62), f = i(24), g = i(303),
        p = i(9), v = i(0).default.getLogger("dltab_detail_detail"), m = d.DownloadKernelTaskManager.getTaskManager();
    let y = class extends o.Vue {
        constructor() {
            super(...arguments), this.showMore = !1, this.taskName = "", this.files = [], this.taskType = void 0, this.fileSize = 0, this.savePath = "", this.url = "", this.refUrl = "", this.signatureCode = "", this.createTime = "", this.downloadTime = 0, this.downloadTimeStr = "00:00:00", this.description = "", this.md5 = "", this.copyCodeSuccess = !1, this.serverModule = c.server, this.panFreeSpace = -1, this.panSavePathId = "", this.panFileId = "", this.panTaskId = "", this.panTaskData = {}, this.client = u.client, this.panTaskProgress = 0, this.isSupportPlay = !1, this.timeoutGetProcess = void 0
        }

        onTaskChange() {
            return a(this, void 0, void 0, function* () {
                v.information("XlDetail onTaskChange "), this.showMore = !1, clearTimeout(this.timeoutGetProcess), this.init(), "" === this.curUserId ? (this.panTaskId = "", this.panSavePathId = "", this.panTaskData = {}, this.panFileId = "") : this.queryTaskAndUpdate()
            })
        }

        onUserChange() {
            return a(this, void 0, void 0, function* () {
                clearTimeout(this.timeoutGetProcess), "" !== this.curUserId ? (this.refleshFreeSpace(!1), this.queryTaskAndUpdate()) : (this.panTaskId = "", this.panSavePathId = "", this.panTaskData = {}, this.panFileId = "", this.panFreeSpace = -1)
            })
        }

        queryTaskAndUpdate() {
            return a(this, void 0, void 0, function* () {
                let e = yield g.thunderPanTask.queryTask(this.curTaskId, this.curUserId);
                if (e) {
                    if (console.warn("### query task", e), e.FileId) {
                        let t = yield c.server.callClientFunctionByName("ThunderPanPluginWebview", "IpcGetFiles", [e.FileId]);
                        if (t && (!t[0] || t[0].files && 1 !== t[0].files.length) && !t[2]) return console.warn("### delete task", e, t), g.thunderPanTask.deleteTask(null, e.FileId), this.panTaskId = "", this.panSavePathId = "", this.panTaskData = {}, void (this.panFileId = "")
                    }
                    return this.panTaskId = e.PanTaskId, this.panSavePathId = e.PathId, this.panTaskData = JSON.parse(e.Data), this.panFileId = e.FileId, void (this.panFileId ? this.panTaskProgress = 100 : this.getPanTaskProgress())
                }
                this.panTaskId = "", this.panSavePathId = "", this.panTaskData = {}, this.panFileId = ""
            })
        }

        onTaskStatusChange() {
            v.information("XlDetail onTaskStatusChange "), this.taskDownloadingInteval && clearInterval(this.taskDownloadingInteval), this.curTaskStatus === l.DownloadKernel.TaskStatus.Started && (this.taskDownloadingInteval = setInterval(() => {
                this.downloadTime += 1, this.downloadTimeStr = h.TimeHelperNS.formatSeconds(this.downloadTime)
            }, 1e3))
        }

        get panTaskType() {
            return "" === this.curUserId ? 1 : this.panTaskId || this.panFileId || 9 !== this.curTaskStatus ? this.panTaskId || this.panFileId || !(-1 === this.panFreeSpace || this.panFreeSpace >= this.fileSize) ? -1 !== this.panFreeSpace && this.panFreeSpace < this.fileSize ? 4 : this.panTaskId || this.panFileId ? 5 : 1 : 3 : 2
        }

        onPanTaskTypeChange() {
            let e = "";
            e = 1 === this.panTaskType ? "login" : 2 === this.panTaskType ? "unsave" : 3 === this.panTaskType ? "save" : 4 === this.panTaskType ? "refresh" : 5 === this.panTaskType && this.isSupportPlay ? "play" : "look", this.statShow("show", e)
        }

        showLoginWnd() {
            f.LoginHelperNS.loginHelper.showLoginDlg("TaskDetail"), this.statShow("click", "receive")
        }

        onClickPath() {
            this.$emit("switchNav", "pan-plugin-view"), c.server.callClientFunctionByName("ThunderPanPluginWebview", "IpcRedirectCurrentDirectory", {
                selectFileIdList: [],
                titleList: this.panTaskData.title.split("\\"),
                idList: this.panTaskData.id.split("\\")
            })
        }

        consumePanTask() {
            return a(this, void 0, void 0, function* () {
                this.isSupportPlay ? c.server.callClientFunctionByName("ThunderPanPluginWebview", "ShowFileDetail", {
                    fileId: this.panFileId,
                    isPlayInstantly: this.isSupportPlay
                }) : (this.$emit("switchNav", "pan-plugin-view"), c.server.callClientFunctionByName("ThunderPanPluginWebview", "IpcRedirectCurrentDirectory", {
                    selectFileIdList: [this.panFileId],
                    titleList: this.panTaskData.title.split("\\"),
                    idList: this.panTaskData.id.split("\\")
                })), this.statShow("click", this.isSupportPlay ? "play" : "look")
            })
        }

        getPanTaskProgress() {
            return a(this, void 0, void 0, function* () {
                if (!this.panTaskId) return;
                let e = yield c.server.callClientFunctionByName("ThunderPanPluginWebview", "IpcGetSingleUrlTask", this.panTaskId);
                console.warn("### getPanTaskProgress", this.panTaskId, e, this.panFileId, this.panTaskProgress), e && e[0] && e[0].phase !== k.error ? (this.saveStatus = e[0].phase, "" === e[0].file_id || this.panFileId || (this.panFileId = e[0].file_id, g.thunderPanTask.updateTaskFileId(this.panTaskId, this.panFileId)), this.saveStatus !== k.complete ? (100 === e[0].progress ? this.panTaskProgress = 99 : this.panTaskProgress = e[0].progress, this.timeoutGetProcess = setTimeout(this.getPanTaskProgress, 5e3)) : this.panTaskProgress = 100) : this.panFileId || g.thunderPanTask.deleteTask(this.panTaskId)
            })
        }

        clickSave() {
            return a(this, void 0, void 0, function* () {
                if (yield this.selectPanPath(), !this.panTaskData) return;
                let e = yield c.server.callClientFunctionByName("ThunderPanPluginWebview", "IpcBatchAddUrlsToDrive", [{
                    name: this.taskName,
                    url: this.url,
                    parentId: this.panSavePathId,
                    files: [...this.files],
                    path: this.panTaskData.title
                }]);
                console.warn("### res IpcBatchAddUrlsToDrive", e), e && e[0] && e[0][0] && e[0][0].task ? (this.panTaskId = e[0][0].task.id, g.thunderPanTask.insertTask(this.curTaskId, this.panTaskId, this.curUserId, JSON.stringify(this.panTaskData)), this.getPanTaskProgress(), this.statShow("click", "save")) : v.error("wrong result")
            })
        }

        selectPanPath() {
            return a(this, void 0, void 0, function* () {
                let e = yield c.server.callClientFunctionByName("ThunderPanPluginWebview", "IpcTreePath", {});
                if (!e || !e[0] || e[0].error) return;
                this.panSavePathId = e[0].parentId;
                let t = "", i = "";
                for (let n of e[0].path) t += "\\" + n.title, i += "\\" + n.id;
                this.panTaskData = {id: i.slice(1), title: t.slice(1)}
            })
        }

        refleshFreeSpace(e = !0) {
            return a(this, void 0, void 0, function* () {
                let t = yield c.server.callClientFunctionByName("ThunderPanPluginWebview", "IpcGetDriveInfo");
                t && t[0] && (this.panFreeSpace = t[0].limit - t[0].usage, e && this.statShow("click", "reflesh"))
            })
        }

        handleShow() {
            return a(this, void 0, void 0, function* () {
                this.showMore ? (this.showMore = !1, this.statShow("click", "fold")) : (this.showMore = !0, this.statShow("click", "unfold"), this.task.getType() === l.DownloadKernel.TaskType.P2sp || this.task.getType() === l.DownloadKernel.TaskType.Emule ? !this.md5 && this.task.getTaskStatus() === l.DownloadKernel.TaskStatus.Succeeded || this.task.getTaskStatus() === l.DownloadKernel.TaskStatus.Seeding ? this.md5 = yield u.client.callServerFunction("GetFileMd5", this.task.getSavePath() + "/" + this.task.getTaskName()) : this.md5 = "该数据需等待任务下载完成" : this.md5 = "文件夹暂不支持计算")
            })
        }

        setDescription() {
            if (!this.description) return;
            m.getTaskFromTaskId(this.curTaskId).setDescription(this.description)
        }

        copyLink(e, t = "url") {
            r.clipboard.writeText(e), this.statShow("click", "copy_link"), this.$message({
                message: "复制成功",
                type: "success",
                position: "middle"
            })
        }

        openUrl() {
            u.client.callServerFunction("OpenNewTab", this.refUrl).catch()
        }

        openDir() {
            s.TaskOperatorNs.openTaskFolder(this.task.getTaskBaseInfo(), !0).catch(), this.statShow("click", "open_folder")
        }

        init() {
            return a(this, void 0, void 0, function* () {
                if (this.taskDownloadingInteval && clearInterval(this.taskDownloadingInteval), this.task = m.getTaskFromTaskId(this.curTaskId), this.taskName = this.task.getTaskName(), this.taskType = this.task.getType(), this.fileSize = this.task.getTaskAttribute(l.DownloadKernel.TaskAttribute.FileSize), this.files = [], this.taskType === l.DownloadKernel.TaskType.Bt) {
                    let e = [], t = this.task.getExtraObject().getBtFileList();
                    Object.keys(t).length > 1 ? this.isSupportPlay = !1 : this.isSupportPlay = this.task.isSupportPlay();
                    for (let [, i]of t) i.getBtFileAttribute(l.DownloadKernel.BtFileAttribute.Download) && e.push(String(i.getBtFileAttribute(l.DownloadKernel.BtFileAttribute.RealIndex)));
                    this.files = e
                } else this.isSupportPlay = this.task.isSupportPlay();
                this.savePath = this.task.getTaskAttribute(l.DownloadKernel.TaskAttribute.SavePath), this.refUrl = this.task.getTaskAttribute(l.DownloadKernel.TaskAttribute.RefUrl), this.url = this.task.getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskUrl), this.task.getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskType) === l.DownloadKernel.TaskType.Bt ? this.signatureCode = this.task.getExtraObject().getInfoId() : this.signatureCode = "", this.createTime = h.TimeHelperNS.formatDate(new Date(this.task.getTaskAttribute(l.DownloadKernel.TaskAttribute.CreateTime)), "yyyy-MM-dd hh:mm:ss"), this.downloadTime = this.task.getTaskAttribute(l.DownloadKernel.TaskAttribute.DownloadingPeriod), this.downloadTimeStr = h.TimeHelperNS.formatSeconds(this.downloadTime), this.task.getTaskStatus() === l.DownloadKernel.TaskStatus.Started && (this.taskDownloadingInteval = setInterval(() => {
                    this.downloadTime += 1, this.downloadTimeStr = h.TimeHelperNS.formatSeconds(this.downloadTime)
                }, 1e3)), this.description = this.task.getTaskBaseInfo().description, this.md5 = "", this.url && this.statShow("show", "copy_link")
            })
        }

        mounted() {
            v.information("XlDetail mounted"), -1 !== this.curTaskId && this.init()
        }

        beforeDestroy() {
            clearTimeout(this.timeoutGetProcess), this.taskDownloadingInteval && clearInterval(this.taskDownloadingInteval)
        }

        statShow(e, t) {
            let i;
            i = "show" === e ? "btn_type=" : "clickid=", i += t, p.XLStatNS.trackEvent("download_detail", "dl_detail_yunpan_save_module_" + e, "", 0, 0, 0, 0, i)
        }
    };
    var k;
    n([o.Prop({default: -1})], y.prototype, "curTaskId", void 0), n([o.Prop({})], y.prototype, "curTaskStatus", void 0), n([o.Prop({default: ""})], y.prototype, "curUserId", void 0), n([o.Watch("curTaskId", {immediate: !0})], y.prototype, "onTaskChange", null), n([o.Watch("curUserId")], y.prototype, "onUserChange", null), n([o.Watch("curTaskStatus", {immediate: !0})], y.prototype, "onTaskStatusChange", null), n([o.Watch("panTaskType", {immediate: !0})], y.prototype, "onPanTaskTypeChange", null), y = n([o.Component], y), t.default = y, function (e) {
        e.pending = "PHASE_TYPE_PENDING", e.running = "PHASE_TYPE_RUNNING", e.error = "PHASE_TYPE_ERROR", e.complete = "PHASE_TYPE_COMPLETE"
    }(k || (k = {}))
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(227), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(8), r = i(3), s = i(11), l = i(15), d = i(60), u = i(5), c = i(45), h = i(2), f = i(14), g = i(0),
        p = i(7), v = i(71), m = i(68), y = g.default.getLogger("task-detail-FileList"),
        k = l.DownloadKernelEventManager.getEventManager(), T = s.DownloadKernelTaskManager.getTaskManager(),
        w = (e, t) => e < t ? -1 : e === t ? 0 : 1;
    let C = class extends o.Vue {
        constructor() {
            super(...arguments), this.eventBtSubFileDetailChanged = -1, this.eventGroupTaskSubFileDetailChanged = -1, this.subFiles = [], this.branchMap = {}, this.leafMap = {}, this.tree = [], this.disabledKeys = [], this.editingSelected = !1, this.checkedKeys = [], this.defaultCheckedKeys = [], this.originCheckedKeys = [], this.editingExpanded = [], this.expandedKeys = [], this.defaultExpandedKeys = [], this.selectedFailedSubFile = !1, this.selectedFileIndex = "", this.loading = !1, this.eventPlayBtOrGroupTask = -1, this.columns = [{
                label: "文件名称",
                prop: "name",
                sortable: !0,
                sorter: (e, t) => w(e.data.fileName.toLowerCase(), t.data.fileName.toLowerCase())
            }, {
                label: "大小",
                prop: "fileSize",
                width: 78,
                sortable: !0,
                sorter: (e, t) => w(e.data.fileSize, t.data.fileSize)
            }, {
                label: "进度",
                prop: "progress",
                width: 78,
                sortable: !0,
                sorter: (e, t) => w(this.getProgress(e), this.getProgress(t))
            }]
        }

        onCurTaskChange() {
            y.information("onCurTaskChange"), this.init()
        }

        get checkedKeysCache() {
            return this.checkedKeys.reduce((e, t) => (e[t] = !0, e), {})
        }

        get selectedFailedSubFileRetryDownload() {
            let e = m(this.curTask, "status");
            return e = e ? parseInt(e, 10) : 0, !!(this.selectedFailedSubFile && e >= 7 && e <= 10)
        }

        haveSelectItem(e) {
            let t = !1;
            if ("branch" === e.type) for (let i of e.children) t = t || this.haveSelectItem(i); else t = -1 !== this.checkedKeys.indexOf(e.key);
            return t
        }

        formatSize(e) {
            return f.ThunderUtil.formatSize(e)
        }

        rowIcon(e) {
            if (!e) return "xly-type-unknown";
            if ("leaf" !== e.type) return "xly-type-group";
            let t = e.name.substring(e.name.lastIndexOf(".") + 1);
            return -1 !== "avi|mp4|mkv|mpeg|mpg|wmv|rmvb|rm|mov|ts|m2ts|tp|3gp|flv".indexOf(t) ? "xly-type-mkv" : -1 !== "txt|doc|docx|xls|xlsx|csv|wps|rtf".indexOf(t) ? "xly-type-doc" : -1 !== "exe|msi|com|bat|cmd|py|vbs".indexOf(t) ? "xly-type-exe" : -1 !== "rar|zip|7z|cab|lzh|jar".indexOf(t) ? "xly-type-rar" : -1 !== "iso|img|bin|nrg|ccd|vcd|dts|cdi|gho|mds|mdf".indexOf(t) ? "xly-type-iso" : "pdf" === t ? "xly-type-pdf" : "xly-type-unknown"
        }

        isComplete(e) {
            return 4 !== this.curTask.getType() ? e.data.downloadSize === e.data.fileSize && e.data.isNeedDownload && e.data.downloadSize && 3 === e.data.status : [8, 10].includes(e.data.status)
        }

        getProgress(e) {
            if (e && e.data && 0 === e.data.fileSize) return 0;
            if ("branch" === e.type) return e.data.downloadSize / e.data.fileSize;
            let t = this.subFiles[e.data.index].downloadSize / this.subFiles[e.data.index].fileSize;
            return (4 !== this.curTask.getType() ? e.data.downloadSize === e.data.fileSize && e.data.isNeedDownload && e.data.downloadSize && 3 === e.data.status : [8, 10].includes(e.data.status)) || (t = 1 === t ? .9999 : t), t
        }

        parseFileList(e) {
            let t = {};
            this.branchMap = {}, this.leafMap = {}, this.setBranch("", ""), e.forEach(e => {
                const {filePath: i} = e;
                if (!t[i]) {
                    t[i] = !0;
                    let e = "";
                    i.split("\\").forEach(t => {
                        "" !== t && (this.setBranch(e, t), e = e ? `${e}\\${t}` : t)
                    })
                }
                this.setLeaf(i.slice(0, -1), e)
            }), this.updateTree(null), this.tree = this.branchMap[""].children
        }

        setBranch(e, t) {
            let i = this.branchMap[e], n = e ? `${e}\\${t}` : t, a = this.branchMap[n];
            return a || (a = this.branchMap[n] = {
                type: "branch",
                name: t,
                children: [],
                key: n,
                parent: i,
                data: {fileName: t}
            }, i && i.children.push(a)), a
        }

        updateTree(e) {
            this.disabledKeys = Object.values(this.leafMap).filter(e => e.data.downloadSize && e.data.downloadSize === e.data.fileSize && e.data.isNeedDownload).map(e => e.key), this.editingSelected ? this.defaultCheckedKeys = this.checkedKeys : this.checkedKeys = this.defaultCheckedKeys = this.originCheckedKeys = e || Object.keys(this.leafMap).filter(e => this.leafMap[e].data.isNeedDownload), this.editingExpanded ? this.defaultExpandedKeys = this.expandedKeys : this.expandedKeys = this.defaultExpandedKeys = [], this.caculateBranch()
        }

        caculateBranch() {
            this.caculateBranchProp(this.branchMap[""], ["fileSize", "downloadSize", "isAllDownloadItemFinished", "selectedFailedSubFile"], this.reduceFn.bind(this))
        }

        caculateBranchProp(e, t, i) {
            let n = e.children.reduce((e, n) => {
                if ("branch" === n.type && this.caculateBranchProp(n, t, i), "function" == typeof i) return i(t, e, n);
                {
                    let i = [];
                    for (let a = 0; a < t.length; ++a) i[a] = e[a] + ("branch" === n.type || this.checkedKeysCache[n.key] ? n.data[t[a]] : 0);
                    return i
                }
            }, new Array(t.length).fill(0));
            for (let i = 0; i < n.length; ++i) e.data[t[i]] = n[i]
        }

        reduceFn(e, t, i) {
            let n = [];
            for (let a = 0; a < e.length; ++a) "isAllDownloadItemFinished" === e[a] ? n[a] = this.isAllDownloadItemFinished(t[a], i) : "selectedFailedSubFile" === e[a] ? this.updateSelectedFailedSubFile(i) : n[a] = t[a] + ("branch" === i.type || this.checkedKeysCache[i.key] ? i.data[e[a]] : 0);
            return n
        }

        updateSelectedFailedSubFile(e) {
            this.selectedFailedSubFile || e.data.errMessage && e.data.isNeedDownload && (this.selectedFailedSubFile = !0)
        }

        isAllDownloadItemFinished(e, t) {
            let i = !1;
            if (!1 !== e) {
                let n = !1;
                n = !t.data.isNeedDownload || (4 !== this.curTask.getType() ? t.data.downloadSize === t.data.fileSize && t.data.downloadSize && 3 === t.data.status : [8, 10].includes(t.data.status)), i = 0 !== e ? n && e : n
            }
            return i
        }

        setLeaf(e, t) {
            let i = e ? `${e}\\${t.fileName}` : t.fileName, n = this.branchMap[e], a = this.leafMap[i];
            return a || (a = this.leafMap[i] = {
                type: "leaf",
                fullPath: i,
                name: t.fileName,
                key: i,
                parent: n,
                data: t
            }, n.children.push(a)), a
        }

        openFile(e) {
            return a(this, void 0, void 0, function* () {
                yield this.updateDstRect(), p.client.callServerFunction("OperateTask", this.curTaskId, "open", e.data.index)
            })
        }

        playFile(e) {
            return a(this, void 0, void 0, function* () {
                yield this.updateDstRect(), p.client.callServerFunction("OperateTask", this.curTaskId, "play", {fileIndex: e.data.index}).then().catch()
            })
        }

        updateDstRect() {
            return a(this, void 0, void 0, function* () {
                let e, t = document.querySelector("div.td-tabs__pane"), i = {width: 0, height: 0, x: 0, y: 0};
                t && (e = t.getBoundingClientRect()), i.y = e.top, i.x = e.left, i.width = e.width, i.height = e.height;
                let n = {width: 350, height: 200, x: window.innerWidth - 350 - 40, y: window.innerHeight - 200 - 30};
                v.clientProduct.updateMiniRect(n), v.clientProduct.updateDownloadEmbedRect(i), y.information("play miniRect", n, "rect", i)
            })
        }

        openDir(e) {
            let t = this.curTask.getSavePath(), i = this.curTask.getTaskName();
            2 === this.curTask.getType() && i && "" !== i && (i.indexOf(".") === i.length - 1 && (i = i.substring(0, i.length - 1)), t = h.join(t, i));
            let n = h.join(t, e.key);
            p.client.callServerFunction("ShellOpen", n)
        }

        downloadSelected() {
            if (!this.selectedFailedSubFile && !this.editingSelected) return;
            let e = this.checkedKeys.filter(e => e in this.leafMap).map(e => this.leafMap[e].data.index),
                t = e.join("");
            if (this.selectedFileIndex === t) {
                if (!this.selectedFailedSubFile) return
            } else this.selectedFileIndex = t;
            this.loading = !0, this.operate("downloadSelectFiles", null, JSON.stringify(e)).then(() => {
                this.loading = !1, this.editingSelected = !1, this.updateTree(this.checkedKeys)
            })
        }

        isSupportPlay(e) {
            return "branch" !== e.type && (!!this.subFiles[e.data.index] && this.subFiles[e.data.index].isSupportPlay)
        }

        onCheckedChange(e) {
            let t = e.filter(e => e in this.leafMap).map(e => this.leafMap[e].data.index);
            t.length === this.originCheckedKeys.length && this.originCheckedKeys.every(e => t.includes(m(this.leafMap[e], "data", "index"))) ? this.editingSelected = !1 : this.editingSelected = !0, this.checkedKeys = e, this.caculateBranch()
        }

        getFileList(e) {
            return a(this, void 0, void 0, function* () {
                let t = "", i = !0, n = [], a = e.getTaskAttribute(r.DownloadKernel.TaskAttribute.TaskType);
                if (a === r.DownloadKernel.TaskType.Bt) {
                    let a = e.getExtraObject().getBtFileList(),
                        o = e.getTaskAttribute(r.DownloadKernel.TaskAttribute.SavePath),
                        s = e.getTaskAttribute(r.DownloadKernel.TaskAttribute.TaskName);
                    void 0 !== s && "" !== s && s.indexOf(".") === s.length - 1 && (s = s.substring(0, s.length - 1));
                    let l = yield c.SingleBtTaskNS.isSingleBtTask(e);
                    for (let [, f]of a) {
                        let a = {};
                        a.index = f.getBtFileAttribute(r.DownloadKernel.BtFileAttribute.RealIndex), a.filePath = f.getBtFileAttribute(r.DownloadKernel.BtFileAttribute.FilePath), a.fileName = f.getBtFileAttribute(r.DownloadKernel.BtFileAttribute.FileName), a.isNeedDownload = f.getBtFileAttribute(r.DownloadKernel.BtFileAttribute.Download), a.fileSize = f.getBtFileAttribute(r.DownloadKernel.BtFileAttribute.FileSize), a.cid = f.getBtFileAttribute(r.DownloadKernel.BtFileAttribute.Cid), a.gcid = f.getBtFileAttribute(r.DownloadKernel.BtFileAttribute.Gcid), a.status = f.getBtFileAttribute(r.DownloadKernel.BtFileAttribute.FileStatus), a.downloadSize = f.getBtFileAttribute(r.DownloadKernel.BtFileAttribute.DownloadSize), a.errCode = f.getBtFileAttribute(r.DownloadKernel.BtFileAttribute.ErrorCode), a.isSupportPlay = f.isSupportPlay(), a.userRead = f.getUserRead(), 0 !== a.errCode ? a.errMessage = d.TaskStatusHelper.getTaskErrorInfoByCode(a.errCode) : a.errMessage = "", a.status === r.DownloadKernel.BtFileStatus.Complete ? (t = l ? c.SingleBtTaskNS.getSinleBtTaskFilePath(e) : h.join(o, s, a.filePath, a.fileName), i = yield u.FileSystemAWNS.existsAW(t), a.isDelete = !i) : a.isDelete = !1, n[a.index] = a
                    }
                } else if (a === r.DownloadKernel.TaskType.Group) {
                    let a = e.getExtraObject(), o = a.getSubTaskCount(), s = "";
                    for (let e = 0; e < o; ++e) {
                        let o = a.getSubTaskByIndex(e);
                        if (o) {
                            let a = {};
                            a.index = e, a.filePath = o.getTaskAttribute(r.DownloadKernel.TaskAttribute.RelativePath), a.taskId = o.getTaskAttribute(r.DownloadKernel.TaskAttribute.TaskId), a.fileName = o.getTaskAttribute(r.DownloadKernel.TaskAttribute.TaskName), a.url = o.getTaskAttribute(r.DownloadKernel.TaskAttribute.TaskUrl), a.refUrl = o.getTaskAttribute(r.DownloadKernel.TaskAttribute.RefUrl), a.isNeedDownload = o.getTaskAttribute(r.DownloadKernel.TaskAttribute.DownloadSubTask), a.fileSize = o.getTaskAttribute(r.DownloadKernel.TaskAttribute.FileSize), a.downloadSize = o.getTaskAttribute(r.DownloadKernel.TaskAttribute.DownloadSize), a.cid = o.getTaskAttribute(r.DownloadKernel.TaskAttribute.Cid), a.gcid = o.getTaskAttribute(r.DownloadKernel.TaskAttribute.Gcid), a.status = o.getTaskStatus(), a.errCode = o.getTaskAttribute(r.DownloadKernel.TaskAttribute.ErrorCode), a.isSupportPlay = o.isSupportPlay(), a.userRead = o.getUserRead(), a.status === r.DownloadKernel.TaskStatus.Failed ? a.errMessage = d.TaskStatusHelper.getTaskErrorInfoByCode(a.errCode) : a.errMessage = "";
                            let l = o.getTaskChannelInfo();
                            a.dcdnStatus = l.dcdnStatus, s = o.getTaskAttribute(r.DownloadKernel.TaskAttribute.SavePath), a.status === r.DownloadKernel.TaskStatus.Succeeded || a.status === r.DownloadKernel.TaskStatus.Seeding ? (t = h.join(s, a.fileName), i = yield u.FileSystemAWNS.existsAW(t), a.isDelete = !i) : a.isDelete = !1, n.push(a)
                        }
                    }
                }
                return n
            })
        }

        updateTreeStatus(e) {
            let t = this.leafMap["" === e.filePath ? e.fileName : `${e.filePath}${e.fileName}`];
            if (!t || !t.data) return void y.error("error in updateTreeStatus", "node: ", t, "fileinfo: ", e);
            let i = t.data.downloadSize;
            if (this.$set(t, "data", e), t.parent && "" !== t.parent.key) {
                if (t = t.parent, this.$set(t.data, "downloadSize", e.downloadSize - i), 3 === e.status) {
                    let e = !0;
                    for (let i = 0; i < t.children.length; i++) if ("branch" === t.children[i].type && !1 === t.children[i].data.isAllDownloadItemFinished || "leaf" === t.children[i].type && 3 !== t.children[i].data.status) {
                        e = !1;
                        break
                    }
                    t.data.isAllDownloadItemFinished = e
                }
            } else ;
        }

        getBtSubFileList(e, t) {
            let i = [];
            do {
                let n = T.getTaskFromTaskId(e);
                if (!n) break;
                if (n.getTaskAttribute(r.DownloadKernel.TaskAttribute.TaskType) !== r.DownloadKernel.TaskType.Bt) break;
                let a = n.getExtraObject();
                if (!a) break;
                for (let e = 0; e < t.length; ++e) {
                    let n = t[e], o = a.getBtFileByRealIndex(n.realIndex);
                    if (!o) continue;
                    let s = {};
                    s.index = n.realIndex, s.filePath = n.relativePath, s.fileName = o.getBtFileAttribute(r.DownloadKernel.BtFileAttribute.FileName), s.isNeedDownload = o.getIsDownload(), s.isSupportPlay = o.isSupportPlay(), s.fileSize = n.fileSize, s.cid = n.cid, s.gcid = n.gcid, s.status = n.fileStatus, s.downloadSize = n.downloadSize, s.errCode = n.errorCode, s.userRead = n.userRead, 0 !== s.errCode ? s.errMessage = d.TaskStatusHelper.getTaskErrorInfoByCode(s.errCode) : s.errMessage = "", i.push(s)
                }
            } while (0);
            return i
        }

        onBtSubFileDetailChanged(...e) {
            do {
                if (!e) break;
                if (e[0] !== r.DownloadKernel.TaskEventType.BtSubFileDetailChanged) break;
                if (!e[1] || !e[2]) break;
                let t = e[1];
                if (t !== this.curTaskId) break;
                let i = e[2], n = this.getBtSubFileList(t, i);
                for (let e of n) this.$set(this.subFiles, e.index, e), this.updateTreeStatus(e)
            } while (0)
        }

        getGroupTaskSubFileList(e) {
            let t = [];
            for (let i = 0; i < e.length; ++i) {
                let n = e[i];
                if (n) {
                    let e = {};
                    e.filePath = n.getTaskAttribute(r.DownloadKernel.TaskAttribute.RelativePath), e.index = n.getTaskAttribute(r.DownloadKernel.TaskAttribute.FileIndex), e.taskId = n.getTaskAttribute(r.DownloadKernel.TaskAttribute.TaskId), e.fileName = n.getTaskAttribute(r.DownloadKernel.TaskAttribute.TaskName), e.url = n.getTaskAttribute(r.DownloadKernel.TaskAttribute.TaskUrl), e.refUrl = n.getTaskAttribute(r.DownloadKernel.TaskAttribute.RefUrl), e.isNeedDownload = n.getTaskAttribute(r.DownloadKernel.TaskAttribute.DownloadSubTask), e.fileSize = n.getTaskAttribute(r.DownloadKernel.TaskAttribute.FileSize), e.downloadSize = n.getTaskAttribute(r.DownloadKernel.TaskAttribute.DownloadSize), e.cid = n.getTaskAttribute(r.DownloadKernel.TaskAttribute.Cid), e.gcid = n.getTaskAttribute(r.DownloadKernel.TaskAttribute.Gcid), e.status = n.getTaskStatus(), e.errCode = n.getTaskAttribute(r.DownloadKernel.TaskAttribute.ErrorCode), e.userRead = n.getUserRead(), e.isSupportPlay = n.isSupportPlay(), e.status === r.DownloadKernel.TaskStatus.Failed ? e.errMessage = d.TaskStatusHelper.getTaskErrorInfoByCode(e.errCode) : e.errMessage = "";
                    let i = n.getTaskChannelInfo();
                    e.dcdnStatus = i.dcdnStatus, t.push(e)
                }
            }
            return t
        }

        onGroupTaskSubFileDetailChanged(...e) {
            do {
                if (!e) break;
                if (e[0] !== r.DownloadKernel.TaskEventType.GroupTaskSubFileDetailChanged) break;
                if (!e[1]) break;
                e[1].forEach((e, t) => {
                    if (t === this.curTaskId) {
                        let t = this.getGroupTaskSubFileList(e);
                        for (let e of t) this.$set(this.subFiles, e.index, e), this.updateTreeStatus(e)
                    }
                })
            } while (0)
        }

        init() {
            return a(this, void 0, void 0, function* () {
                y.information("init FileList"), this.curTask = T.getTaskFromTaskId(this.curTaskId), -1 !== this.eventBtSubFileDetailChanged && (k.detachTaskEvent(r.DownloadKernel.TaskEventType.BtSubFileDetailChanged, this.eventBtSubFileDetailChanged), this.eventBtSubFileDetailChanged = -1), -1 !== this.eventGroupTaskSubFileDetailChanged && (k.detachTaskEvent(r.DownloadKernel.TaskEventType.GroupTaskSubFileDetailChanged, this.eventGroupTaskSubFileDetailChanged), this.eventGroupTaskSubFileDetailChanged = -1), this.subFiles = yield this.getFileList(this.curTask), this.parseFileList(this.subFiles), this.curTask.getType() === r.DownloadKernel.TaskType.Bt ? this.eventBtSubFileDetailChanged = k.attachTaskEvent(r.DownloadKernel.TaskEventType.BtSubFileDetailChanged, (...e) => {
                    this.onBtSubFileDetailChanged(...e)
                }) : this.curTask.getType() === r.DownloadKernel.TaskType.Group && (this.eventGroupTaskSubFileDetailChanged = k.attachTaskEvent(r.DownloadKernel.TaskEventType.GroupTaskSubFileDetailChanged, (...e) => {
                    this.onGroupTaskSubFileDetailChanged(...e)
                }))
            })
        }

        playBtOrGroupTask(e, ...t) {
            return a(this, void 0, void 0, function* () {
                if (!(t.length < 1) && parseInt(t[0], 10) === this.curTaskId) for (let e of Object.values(this.leafMap)) if (!e.data.errMessage && 1 === e.data.isNeedDownload && !0 !== e.data.isDelete && !0 === e.data.isSupportPlay) {
                    e.data.status, p.client.callServerFunction("OperateTask", this.curTaskId, "downAndPlay", {fileIndex: e.data.index}).then().catch();
                    break
                }
            })
        }

        mounted() {
            this.init(), this.eventPlayBtOrGroupTask = p.client.attachServerEvent("PlayBtOrGroupTask", this.playBtOrGroupTask.bind(this))
        }

        beforeDestroy() {
            -1 !== this.eventBtSubFileDetailChanged && (k.detachTaskEvent(r.DownloadKernel.TaskEventType.BtSubFileDetailChanged, this.eventBtSubFileDetailChanged), this.eventBtSubFileDetailChanged = -1), -1 !== this.eventGroupTaskSubFileDetailChanged && (k.detachTaskEvent(r.DownloadKernel.TaskEventType.GroupTaskSubFileDetailChanged, this.eventGroupTaskSubFileDetailChanged), this.eventGroupTaskSubFileDetailChanged = -1), p.client.detachServerEvent("PlayBtOrGroupTask", this.eventPlayBtOrGroupTask)
        }
    };
    n([o.Prop()], C.prototype, "curTaskId", void 0), n([o.Prop()], C.prototype, "operate", void 0), n([o.Prop()], C.prototype, "playingCurTask", void 0), n([o.Prop()], C.prototype, "playingMediaIndex", void 0), n([o.Watch("curTaskId", {immediate: !0})], C.prototype, "onCurTaskChange", null), C = n([o.Component], C), t.default = C
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(229), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(8), r = i(11), s = i(3), l = i(43), d = i(17), u = i(36), c = i(41), h = i(9),
        f = r.DownloadKernelTaskManager.getTaskManager();
    let g = class extends o.Vue {
        constructor() {
            super(...arguments), this.hasErrorTask = !1, this.hasStopTask = !1, this.hasStartedTask = !1, this.hasUnRemoveTask = !1
        }

        onTaskIdsChange() {
            return a(this, void 0, void 0, function* () {
                if (this.hasErrorTask = !1, this.hasStopTask = !1, this.hasStartedTask = !1, this.curCategoryid === s.DownloadKernel.CategroyViewID.Downloading) for (let e of this.taskIds) {
                    let t = f.getTaskFromTaskId(e);
                    if (!t) continue;
                    let i = t.getTaskStatus();
                    i === s.DownloadKernel.TaskStatus.Failed ? this.hasErrorTask = !0 : i === s.DownloadKernel.TaskStatus.Stopped || i === s.DownloadKernel.TaskStatus.StopPending ? this.hasStopTask = !0 : [3, 4, 5].includes(i) && (this.hasStartedTask = !0)
                } else if (this.curCategoryid === s.DownloadKernel.CategroyViewID.Completed) {
                    let e = !1;
                    for (let t of this.taskIds) {
                        if (e) break;
                        let i = f.getTaskFromTaskId(t);
                        i && (e = yield c.TaskCtrlOperatorNS.isExistTaskFile(i.getTaskBaseInfo()))
                    }
                    this.hasUnRemoveTask = e
                }
            })
        }

        getSelectdTaskInfos() {
            let e = [];
            for (let t of this.taskIds) e.push(f.getTaskFromTaskId(t).getTaskBaseInfo());
            return e
        }

        start() {
            l.DownloadDispatchNS.startTasks(this.taskIds), this.stat("all_download")
        }

        stop() {
            f.batchStopTask(this.taskIds, s.DownloadKernel.TaskStopReason.Manual), this.stat("all_pause")
        }

        remove() {
            let e = this.getSelectdTaskInfos();
            e.length > 0 && u.TaskOperatorNs.deleteTasks(e), this.stat("delete")
        }

        copyLinks() {
            let e = "";
            for (let t of this.taskIds) {
                e += f.getTaskFromTaskId(t).getTaskBaseInfo().url + "\r"
            }
            d.clipboard.writeText(e), this.stat("copy_link")
        }

        move2Dir() {
            let e = this.getSelectdTaskInfos();
            e.length > 0 && u.TaskOperatorNs.move2Dir(e).catch(() => {
            }), this.stat("move")
        }

        copy2Dir() {
            let e = this.getSelectdTaskInfos();
            e.length > 0 && u.TaskOperatorNs.copy2Dir(e).catch(() => {
            }), this.stat("copy_file")
        }

        restore() {
            f.batchRecoverFromRecycle(this.taskIds), this.stat("recovery")
        }

        destroy() {
            let e = this.getSelectdTaskInfos();
            e.length > 0 && u.TaskOperatorNs.destroyTasks(e), this.stat("delete")
        }

        redownloadTask() {
            let e = this.getSelectdTaskInfos();
            if (e.length > 0) {
                let t = "";
                void 0 !== this.curCategoryid && this.curCategoryid === s.DownloadKernel.CategroyViewID.Completed ? t = "finished_rk_reload_click" : this.curCategoryid === s.DownloadKernel.CategroyViewID.Recycle && (t = "dustbin_rk_reload_click"), c.TaskCtrlOperatorNS.redownloadTask(e, void 0, t).catch()
            }
            this.stat("retry_download")
        }

        stat(e) {
            let t = "clild_tab=" + this.curCategoryid + ",clickid=" + e;
            h.XLStatNS.trackEvent("download_detail", "dl_filelist_batch_operation_click", "", 0, 0, 0, 0, t)
        }
    };
    n([o.Prop()], g.prototype, "taskIds", void 0), n([o.Prop()], g.prototype, "curCategoryid", void 0), n([o.Watch("taskIds", {immediate: !0})], g.prototype, "onTaskIdsChange", null), g = n([o.Component({components: {MultiChosenItem: () => Promise.resolve().then(() => i(659))}})], g), t.default = g
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(231), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(8), o = i(47), r = i(11), s = i(3), l = i(14), d = i(62),
        u = r.DownloadKernelTaskManager.getTaskManager();
    let c = class extends a.Vue {
        constructor() {
            super(...arguments), this.taskName = ""
        }

        onTaskIdChange() {
            let e = u.getTaskFromTaskId(this.taskId).getTaskBaseInfo();
            this.taskName = e.taskName, 0 === e.taskType ? this.iconType = "xlx-icon-type-group" : this.iconType = o.TaskUtilHelper.getTaskIcon(e.taskName, e.taskType), this.fileSize = l.ThunderUtil.formatSize(e.fileSize), e.taskStatus === s.DownloadKernel.TaskStatus.Seeding || e.taskStatus === s.DownloadKernel.TaskStatus.Succeeded ? this.displayTime = d.TimeHelperNS.formatDate(new Date(e.completionTime), "yyyy-MM-dd hh:mm") : this.displayTime = d.TimeHelperNS.formatDate(new Date(e.createTime), "yyyy-MM-dd hh:mm")
        }

        created() {
        }
    };
    n([a.Prop()], c.prototype, "taskId", void 0), n([a.Watch("taskId", {immediate: !0})], c.prototype, "onTaskIdChange", null), c = n([a.Component], c), t.default = c
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(233), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(662), a = i(33);
    t.default = a.connector.connect({
        mapStateToProps: {
            currentCategoryId: e => e.DownloadListState.currentCategoryId,
            currentCategoryViewId: e => e.DownloadListState.currentCategoryViewId,
            currentTabId: e => e.Tabs.current
        },
        mapCommitToProps: {
            UPDATE_CATEGORY: "UPDATE_CATEGORY",
            UPDATE_CATEGORYVIEW: "UPDATE_CATEGORYVIEW",
            INIT_CATEGORY_TASKLIST: "INIT_CATEGORY_TASKLIST",
            UPDATE_DOWNLOADING_SELECTED_TASKS: "UPDATE_DOWNLOADING_SELECTED_TASKS",
            UPDATE_COMPLETED_SELECTED_TASKS: "UPDATE_COMPLETED_SELECTED_TASKS",
            UPDATE_RECYCLE_SELECTED_TASKS: "UPDATE_RECYCLE_SELECTED_TASKS",
            MOVE_TO_TOP: "MOVE_TO_TOP",
            MOVE_TO_BOTTOM: "MOVE_TO_BOTTOM",
            SELECT_PRE: "SELECT_PRE",
            SELECT_NEXT: "SELECT_NEXT",
            INSERT_TO_CATEGORY_VIEW: "INSERT_TO_CATEGORY_VIEW",
            UPDATE_TASK_STATUS: "UPDATE_TASK_STATUS",
            SORT_CATEGORY_HISTORY: "SORT_CATEGORY_HISTORY",
            SORT_CATEGORY_BY_FUNCTION: "SORT_CATEGORY_BY_FUNCTION",
            UPDATE_DOWNLOADING_TASKLIST: "UPDATE_DOWNLOADING_TASKLIST",
            UPDATE_COMPLETED_TASKLIST: "UPDATE_COMPLETED_TASKLIST",
            UPDATE_RECYCLE_TASKLIST: "UPDATE_RECYCLE_TASKLIST"
        },
        mapDispatchToProps: {attachTaskEvent: "attachTaskEvent", selectTab: "selectTab"},
        mapGettersToProps: {
            downloadingTaskList: e => e.downloadingTaskList,
            completedTaskList: e => e.completedTaskList,
            recycleTaskList: e => e.recycleTaskList,
            downloadingTaskBaseList: e => e.downloadingTaskBaseList,
            completedTaskBaseList: e => e.completedTaskBaseList,
            recycleTaskBaseList: e => e.recycleTaskBaseList,
            currentSelectdTaskInfos: e => e.currentSelectdTaskInfos,
            downloadingSelectedIndexs: e => e.downloadingSelectedIndexs,
            completedSelectedTaskIndexs: e => e.completedSelectedTaskIndexs,
            recycleSelectedTaskIndexs: e => e.recycleSelectedTaskIndexs,
            canStartAll: e => e.canStartAll
        }
    })(n.default)
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(235), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(8), r = i(0), s = i(3), l = i(60), d = i(455), u = i(36), c = i(97), h = i(13), f = i(27), g = i(9),
        p = i(30), v = i(15), m = i(11), y = i(324), k = i(45), T = i(63), w = i(10), C = i(7), S = i(81), b = i(29),
        I = i(68), _ = v.DownloadKernelEventManager.getEventManager(), A = m.DownloadKernelTaskManager.getTaskManager(),
        D = b.DownloadKernelCategoryManager.getCategoryManager(), x = r.default.getLogger("DownloadList");
    let N = class extends o.Vue {
        constructor() {
            super(...arguments), this.categoryLastSelectList = [{
                category: s.DownloadKernel.CategroyViewID.Downloading,
                lastIndex: 0
            }, {
                category: s.DownloadKernel.CategroyViewID.Completed,
                lastIndex: 0
            }, {
                category: s.DownloadKernel.CategroyViewID.Recycle,
                lastIndex: 0
            }], this.bLoadDbFinish = !1, this.insertToCategoryViewEventId = void 0, this.statusChangedEventId = void 0, this.dataBaseLoadCookie = void 0, this.isHoverClass = !1, this.emptyHotwordList = [], this.delayStatTimer = null, this.completedFilterTaskList = this.completedTaskList, this.completedFilter = "全部"
        }

        onCategoryChange(e) {
            f.default.fireEvent(h.NodeEventMesssageNS.eventDownloadItemActive, this.currentCategoryViewId, !1, 0, null, !0), this.INIT_CATEGORY_TASKLIST(), this.$nextTick(() => {
                x.information("onCategoryChange nextTick"), this.completedListRestore()
            }), this.UPDATE_CATEGORYVIEW(s.DownloadKernel.CategroyViewID.Downloading)
        }

        onCategoryViewChange(e, t) {
            t === s.DownloadKernel.CategroyViewID.Completed && this.completedListRestore()
        }

        onCompletedTaskListChange(e) {
            if (x.information("onCompletedTaskListChange"), "全部" === this.completedFilter) this.completedFilterTaskList = e; else {
                let t = e.filter(e => -1 !== this.completedFilterTaskList.indexOf(e));
                this.completedFilterTaskList = t
            }
        }

        onCompletedFilterChange() {
            this.UPDATE_COMPLETED_SELECTED_TASKS([])
        }

        get isInPrivateSpace() {
            return -1 !== this.currentCategoryId
        }

        completedListRestore() {
            y.CompletedFilterNS.reset(), this.completedFilter = "全部", this.completedFilterTaskList = this.completedTaskList
        }

        onFilterMenuClick(e, t) {
            if (this.completedFilter = e.label, t) {
                let e = this.completedTaskList.filter(e => -1 !== t.indexOf(e));
                this.completedFilterTaskList = e
            } else this.completedFilterTaskList = this.completedTaskList
        }

        showFilterMenu(e) {
            y.CompletedFilterNS.showMenu(this.$refs.filterMenu, this.currentCategoryId, (e, t) => {
                this.onFilterMenuClick(e, t)
            }).catch()
        }

        handleCollapseChange(e) {
            let t = e, i = "", n = "";
            t === s.DownloadKernel.CategroyViewID.Downloading ? (i = "downloading_click", n = "type=" + (this.hasDownloading ? "yes" : "no")) : t === s.DownloadKernel.CategroyViewID.Completed ? i = "finished_click" : t === s.DownloadKernel.CategroyViewID.Recycle && (i = "dustbin_click"), g.XLStatNS.trackEvent("download_leftpanel", i, "", 0, 0, 0, 0, n), this.UPDATE_CATEGORYVIEW(t)
        }

        handleDelete(e, t) {
            do {
                if (40 === e.keyCode) {
                    1 === this.currentSelectdTaskInfos.length && this.SELECT_NEXT();
                    break
                }
                if (38 === e.keyCode) {
                    1 === this.currentSelectdTaskInfos.length && this.SELECT_PRE();
                    break
                }
                if ("Delete" !== e.key) break;
                if (!l.TaskStatusHelper.canMoveSelectedTask(void 0, this.currentSelectdTaskInfos)) break;
                void 0 === t && (-1 !== this.currentCategoryId ? t = !0 : e.shiftKey && (t = !0)), t ? u.TaskOperatorNs.destroyTasks(this.currentSelectdTaskInfos) : u.TaskOperatorNs.deleteTasks(this.currentSelectdTaskInfos)
            } while (0)
        }

        handlePauseAll() {
            -1 === this.currentCategoryId ? u.TaskOperatorNs.pauseAll(s.DownloadKernel.TaskStopReason.PauseAll) : u.TaskOperatorNs.pauseCategoryAllTask(this.currentCategoryId, s.DownloadKernel.TaskStopReason.PauseAll), g.XLStatNS.trackEvent("download_leftpanel", "downloading_right_button_click", "", 0, 0, 0, 0, "button=pause")
        }

        handleStartAll() {
            -1 === this.currentCategoryId ? u.TaskOperatorNs.startAll() : u.TaskOperatorNs.startCategoryAllTask(this.currentCategoryId), g.XLStatNS.trackEvent("download_leftpanel", "downloading_right_button_click", "", 0, 0, 0, 0, "button=start")
        }

        get hasDownloading() {
            return this.downloadingTaskBaseList.length > 0
        }

        get isAllDownloading() {
            let e = !0;
            for (let t of this.downloadingTaskBaseList) if (t.taskStatus !== s.DownloadKernel.TaskStatus.StartWaiting && t.taskStatus !== s.DownloadKernel.TaskStatus.StartPending && t.taskStatus !== s.DownloadKernel.TaskStatus.Started) {
                e = !1;
                break
            }
            return e
        }

        onIsAllDownloadingChange(e) {
            this.hasDownloading && (this.delayStatTimer && clearTimeout(this.delayStatTimer), this.delayStatTimer = setTimeout(() => {
                g.XLStatNS.trackEvent("download_leftpanel", "downloading_right_button_show", "", 0, 0, 0, 0, "button=" + (e ? "pause" : "start"))
            }, 1))
        }

        get downloadingCategoryTitle() {
            let e = "正在下载";
            return 0 !== this.downloadingTaskList.length && (e = e + "(" + this.downloadingTaskList.length + ")"), e
        }

        get completedCategoryTitle() {
            let e = "已完成";
            return 0 !== this.completedFilterTaskList.length && (e = e + "(" + this.completedFilterTaskList.length + ")"), e
        }

        get recycleCategoryTitle() {
            let e = "回收站";
            return 0 !== this.recycleTaskList.length && (e = e + "(" + this.recycleTaskList.length + ")"), e
        }

        get downloadProgress() {
            let e = 0, t = 0, i = 0;
            for (let e of this.downloadingTaskBaseList) e.taskStatus !== s.DownloadKernel.TaskStatus.Failed && (t += e.fileSize, i += e.downloadSize);
            return t > 0 && (e = i / t), e > 1 && (e = 1), 100 * e
        }

        downloadingItemDbClick() {
            l.TaskStatusHelper.canStopSelectedTask(this.currentCategoryViewId, this.currentSelectdTaskInfos) ? u.TaskOperatorNs.pauseTasks(this.currentSelectdTaskInfos, s.DownloadKernel.TaskStopReason.Manual) : l.TaskStatusHelper.canStartSelectedTask(this.currentCategoryViewId, this.currentSelectdTaskInfos) ? u.TaskOperatorNs.startTasks(this.currentSelectdTaskInfos) : x.information("downloaditem dbclick do nothing")
        }

        handleHotwordsClick(e) {
            return a(this, void 0, void 0, function* () {
                if ("" === e.url) {
                    yield S.default.isInitedAW();
                    let t = S.default.getConfigValue("search", "search_engine_url", "https://www.baidu.com/s?tn=58025142_4_oem_dg&wd=$word$");
                    t = t.replace("$word$", encodeURIComponent(e.word)), e.url = t
                }
                yield C.client.callServerFunction("OpenNewTab", e.url), g.XLStatNS.trackEvent("download_leftpanel", "downloading_hotword_click", "", 0, 0, 0, 0, {
                    word: e.word,
                    is_ad: e.isAd ? 1 : 0
                })
            })
        }

        handleDownloadingItemMenu(e) {
            c.downloadContextMenu.setContextInfo(this, this.currentCategoryId, this.downloadingTaskList.length), c.downloadContextMenu.popMenu(c.DownloadMenuType.DownloadingItem, e)
        }

        handleCompletedItemMenu(e) {
            c.downloadContextMenu.setContextInfo(this, this.currentCategoryId), c.downloadContextMenu.popMenu(c.DownloadMenuType.CompletedItem, e)
        }

        handleRecycleItemMenu(e) {
            c.downloadContextMenu.setContextInfo(this, this.currentCategoryId), c.downloadContextMenu.popMenu(c.DownloadMenuType.RecycleItem, e)
        }

        handleDownloadingBlankMenu(e) {
            -1 === this.currentCategoryId && (0 === this.currentSelectdTaskInfos.length ? (c.downloadContextMenu.setContextInfo(this, this.currentCategoryId), c.downloadContextMenu.popMenu(c.DownloadMenuType.DownloadingBlank, e)) : this.handleDownloadingItemMenu(e))
        }

        handleRecycleBlankMenu(e) {
            0 === this.currentSelectdTaskInfos.length ? (c.downloadContextMenu.setContextInfo(this, this.currentCategoryId), c.downloadContextMenu.popMenu(c.DownloadMenuType.RecycleBlank, e)) : this.handleRecycleItemMenu(e)
        }

        handleDownloadingCategoryMore(e) {
            c.downloadContextMenu.setContextInfo(this, this.currentCategoryId), c.downloadContextMenu.popMenu(c.DownloadMenuType.DownloadingCategory, e)
        }

        handleDownloadingCategoryMenu(e) {
            this.currentCategoryViewId === s.DownloadKernel.CategroyViewID.Downloading ? -1 === this.currentCategoryId && this.handleDownloadingCategoryMore(e) : this.handleCollapseChange(s.DownloadKernel.CategroyViewID.Downloading)
        }

        handleCompletedCategoryMore(e) {
            c.downloadContextMenu.setContextInfo(this, this.currentCategoryId), c.downloadContextMenu.popMenu(c.DownloadMenuType.CompletedCategory, e)
        }

        handleCompletedCategoryMenu(e) {
            this.currentCategoryViewId === s.DownloadKernel.CategroyViewID.Completed ? this.handleCompletedCategoryMore(e) : this.handleCollapseChange(s.DownloadKernel.CategroyViewID.Completed)
        }

        handleRecycleCategoryMore(e) {
            c.downloadContextMenu.setContextInfo(this, this.currentCategoryId), c.downloadContextMenu.popMenu(c.DownloadMenuType.RecycleCategory, e)
        }

        handleRecycleCategoryMenu(e) {
            this.currentCategoryViewId === s.DownloadKernel.CategroyViewID.Recycle ? this.handleRecycleCategoryMore(e) : this.handleCollapseChange(s.DownloadKernel.CategroyViewID.Recycle)
        }

        selectAll() {
            let e = [], t = null;
            switch (this.currentCategoryViewId) {
                case s.DownloadKernel.CategroyViewID.Downloading:
                    t = this.UPDATE_DOWNLOADING_SELECTED_TASKS, e = [...this.downloadingTaskList];
                    break;
                case s.DownloadKernel.CategroyViewID.Completed:
                    t = this.UPDATE_COMPLETED_SELECTED_TASKS, e = [...this.completedFilterTaskList];
                    break;
                case s.DownloadKernel.CategroyViewID.Recycle:
                    t = this.UPDATE_RECYCLE_SELECTED_TASKS, e = [...this.recycleTaskList]
            }
            e.length > 0 && null !== t && t(e)
        }

        moveUp() {
            this.MOVE_TO_TOP(this.downloadingSelectedIndexs)
        }

        moveDown() {
            this.MOVE_TO_BOTTOM(this.downloadingSelectedIndexs)
        }

        handleMenuClick(e, ...t) {
            switch (e) {
                case"select_all":
                    this.selectAll();
                    break;
                case"move_up":
                    this.moveUp();
                    break;
                case"move_down":
                    this.moveDown()
            }
        }

        handleMenuPopup() {
        }

        handleMenuEnd() {
        }

        scrollToSpecified(e, t, i, n, a) {
            let o = i.indexOf(e);
            -1 !== o && (1 === n.length && n[0] === e ? this.$refs[t].scrollTo(o) : o <= this.$refs[t].getLoadedCount() - 1 ? a([e]) : (this.$refs[t].setLoadedCount(o + 1), this.$nextTick(() => {
                a([e])
            })))
        }

        selectTask(e, t) {
            void 0 !== t && (e === s.DownloadKernel.CategroyViewID.Downloading ? this.scrollToSpecified(t, "downloading", this.downloadingTaskList, this.downloadingSelectedIndexs, this.UPDATE_DOWNLOADING_SELECTED_TASKS) : e === s.DownloadKernel.CategroyViewID.Completed ? "全部" !== this.completedFilter ? (this.completedListRestore(), this.$nextTick(() => {
                this.scrollToSpecified(t, "completed", this.completedTaskList, this.completedSelectedTaskIndexs, this.UPDATE_COMPLETED_SELECTED_TASKS)
            })) : this.scrollToSpecified(t, "completed", this.completedTaskList, this.completedSelectedTaskIndexs, this.UPDATE_COMPLETED_SELECTED_TASKS) : e === s.DownloadKernel.CategroyViewID.Recycle && this.scrollToSpecified(t, "dustbin", this.recycleTaskList, this.recycleSelectedTaskIndexs, this.UPDATE_RECYCLE_SELECTED_TASKS))
        }

        created() {
            this.attachTaskEvent(), c.downloadContextMenu.attachListener(h.NodeEventMesssageNS.eventDownloadContextMenuClick, this.handleMenuClick), c.downloadContextMenu.attachListener(h.NodeEventMesssageNS.eventDownloadContextMenuPopup, this.handleMenuPopup), c.downloadContextMenu.attachListener(h.NodeEventMesssageNS.eventDownloadContextMenuEnd, this.handleMenuEnd), f.default.attachListener(h.NodeEventMesssageNS.evetDownloadMove2Tail, (e, t) => {
                this.MOVE_TO_BOTTOM([e]), t && this.$nextTick(() => {
                    t()
                })
            })
        }

        shouldChange2Complete() {
            let e = !1;
            do {
                if (this.currentCategoryViewId === s.DownloadKernel.CategroyViewID.Recycle && this.recycleSelectedTaskIndexs.length > 0) {
                    e = !1;
                    break
                }
                if (this.currentCategoryViewId !== s.DownloadKernel.CategroyViewID.Downloading) {
                    e = !0;
                    break
                }
                if (this.downloadingSelectedIndexs.length > 0) {
                    e = !1;
                    break
                }
                e = !0;
                for (let t of this.downloadingTaskBaseList) if (t.taskStatus === s.DownloadKernel.TaskStatus.StartPending || t.taskStatus === s.DownloadKernel.TaskStatus.Started) {
                    e = !1;
                    break
                }
            } while (0);
            return e
        }

        shouldChangeCompleteSelect() {
            let e = !1;
            do {
                if (this.currentCategoryViewId !== s.DownloadKernel.CategroyViewID.Completed) {
                    e = !0;
                    break
                }
                if (0 === this.completedSelectedTaskIndexs.length) {
                    e = !0;
                    break
                }
            } while (0);
            return e
        }

        onTaskDataBaseLoadEnd() {
            this.bLoadDbFinish = !0, this.$nextTick(() => {
                w.ConfigNS.attachListener(h.NodeEventMesssageNS.eventConfigInitFinished, () => {
                    this.SORT_CATEGORY_HISTORY(), 0 === this.downloadingTaskList.length && this.completedTaskList.length > 0 && this.UPDATE_CATEGORYVIEW(s.DownloadKernel.CategroyViewID.Completed)
                })
            })
        }

        handleKeyDown(e) {
            if (e.ctrlKey && 68 === e.keyCode) this.currentCategoryViewId === s.DownloadKernel.CategroyViewID.Downloading && this.currentSelectdTaskInfos.length > 0 && u.TaskOperatorNs.startTasks(this.currentSelectdTaskInfos); else if (e.ctrlKey && 83 === e.keyCode) this.currentCategoryViewId === s.DownloadKernel.CategroyViewID.Downloading && this.currentSelectdTaskInfos.length > 0 && u.TaskOperatorNs.pauseTasks(this.currentSelectdTaskInfos, s.DownloadKernel.TaskStopReason.Manual); else if (e.ctrlKey && 69 === e.keyCode) 1 === this.currentSelectdTaskInfos.length && (u.TaskOperatorNs.openTaskFolder(this.currentSelectdTaskInfos[0]).catch(e => {
                x.warning(e)
            }), this.currentCategoryViewId === s.DownloadKernel.CategroyViewID.Completed && u.TaskOperatorNs.markReadStatus(this.currentSelectdTaskInfos, 1)); else if (e.ctrlKey && 82 === e.keyCode) this.currentCategoryViewId === s.DownloadKernel.CategroyViewID.Recycle && this.currentSelectdTaskInfos.length > 0 && u.TaskOperatorNs.recoverTask(this.currentSelectdTaskInfos); else if (e.ctrlKey && 13 === e.keyCode && (this.currentCategoryViewId === s.DownloadKernel.CategroyViewID.Recycle || this.currentCategoryViewId === s.DownloadKernel.CategroyViewID.Completed) && 1 === this.currentSelectdTaskInfos.length) {
                let e = this.currentSelectdTaskInfos[0].taskStatus;
                if (e === s.DownloadKernel.TaskStatus.Succeeded || e === s.DownloadKernel.TaskStatus.Seeding) {
                    let e = "";
                    if (this.currentCategoryViewId === s.DownloadKernel.CategroyViewID.Completed ? e = "finished" : this.currentCategoryViewId === s.DownloadKernel.CategroyViewID.Recycle && (e = "dustbin"), this.currentSelectdTaskInfos[0].taskType === s.DownloadKernel.TaskType.Bt) {
                        let e = A.getTaskFromTaskId(this.currentSelectdTaskInfos[0].taskId);
                        k.SingleBtTaskNS.isSingleBtTask(e).then(e => {
                            e ? u.TaskOperatorNs.openTaskItem(this.currentSelectdTaskInfos[0]).catch() : u.TaskOperatorNs.openTaskFolder(this.currentSelectdTaskInfos[0], !0).catch()
                        }).catch()
                    } else if (this.currentSelectdTaskInfos[0].taskType === s.DownloadKernel.TaskType.Group) {
                        let e = A.getTaskFromTaskId(this.currentSelectdTaskInfos[0].taskId);
                        u.TaskOperatorNs.executeInstallFile(e).then(e => {
                            e || u.TaskOperatorNs.openTaskFolder(this.currentSelectdTaskInfos[0], !0).catch()
                        }).catch()
                    } else u.TaskOperatorNs.openTaskItem(this.currentSelectdTaskInfos[0], void 0, void 0, e, this.currentCategoryId).catch(e => {
                        x.warning(e)
                    });
                    this.currentCategoryViewId === s.DownloadKernel.CategroyViewID.Completed && u.TaskOperatorNs.markReadStatus(this.currentSelectdTaskInfos, 1)
                }
            }
        }

        getHotwords() {
            return a(this, void 0, void 0, function* () {
                const e = yield i(18);
                e.defaults.adapter = i(21);
                let t = [], n = !1;
                try {
                    let i = yield e.request({method: "get", url: "http://static-xl.a.88cdn.com/json/hotwords.json"});
                    200 === i.status && i.data && (t = i.data, n = !0)
                } catch (e) {
                    x.information("request hotwords.json exception! e", e)
                }
                if (x.information("request hotwords.json data:", t), n || g.XLStatNS.trackEvent("download_leftpanel", "downloading_hotword_update_fail"), t.length > 0) {
                    let e = yield T.AdHelperNS.getHotWordsAw(), i = I(e, "data", 0, "query");
                    x.information("getHotWordsAw adQueryWord:", i), i && i.length > 0 ? t[t.length - 1] = {
                        word: i,
                        url: "",
                        isAd: !0
                    } : g.XLStatNS.trackEvent("download_leftpanel", "downloading_hotword_ad_update_fail");
                    for (let e = 0; e < t.length / 2; ++e) {
                        this.emptyHotwordList[e] = [];
                        for (let i = 0; i < 2 && 2 * e + i < t.length; ++i) this.emptyHotwordList[e][i] = t[2 * e + i]
                    }
                    x.information("this.emptyHotwordList:", this.emptyHotwordList), g.XLStatNS.trackEvent("download_leftpanel", "downloading_hotword_show")
                }
            })
        }

        mounted() {
            y.CompletedFilterNS.refresh((e, t) => {
                do {
                    if ("全部" === e) {
                        this.completedListRestore();
                        break
                    }
                    if (e && (this.completedFilter = e), t) {
                        let e = this.completedTaskList.filter(e => -1 !== t.indexOf(e));
                        this.completedFilterTaskList = e
                    }
                } while (0)
            }), this.statusChangedEventId = _.attachTaskEvent(s.DownloadKernel.TaskEventType.StatusChanged, (...e) => {
                do {
                    if (!e) break;
                    if (e[0] !== s.DownloadKernel.TaskEventType.StatusChanged) break;
                    if (!e[1]) break;
                    let t = e[1];
                    if (x.verbose("StatusChanged groupId:", t[0].getTaskAttribute(s.DownloadKernel.TaskAttribute.GroupTaskId), ", status:", t[0].getTaskStatus()), t.length > 0) {
                        if (t[0].getTaskAttribute(s.DownloadKernel.TaskAttribute.CategoryId) !== this.currentCategoryId) break;
                        if (this.UPDATE_TASK_STATUS(t.map(e => e.getTaskBaseInfo())), t[0].getTaskAttribute(s.DownloadKernel.TaskAttribute.Background)) break;
                        if (t[0].getTaskAttribute(s.DownloadKernel.TaskAttribute.GroupTaskId) > 0) break;
                        t[0].getTaskStatus() !== s.DownloadKernel.TaskStatus.Succeeded && t[0].getTaskStatus() !== s.DownloadKernel.TaskStatus.Seeding || this.$nextTick(() => {
                            let e = this.shouldChange2Complete(), t = this.shouldChangeCompleteSelect();
                            e && setTimeout(() => {
                                this.UPDATE_CATEGORYVIEW(s.DownloadKernel.CategroyViewID.Completed), t && this.UPDATE_COMPLETED_SELECTED_TASKS([this.completedTaskList[0]])
                            }, 0)
                        })
                    }
                } while (0)
            }), A.isLoadStorageTaskFinish() ? (this.bLoadDbFinish = !0, w.ConfigNS.attachListener(h.NodeEventMesssageNS.eventConfigInitFinished, () => {
                this.INIT_CATEGORY_TASKLIST()
            })) : (this.dataBaseLoadCookie = 0, p.DownloadKernelManager.attachListener(h.NodeEventMesssageNS.eventTaskDataBaseLoadEnd, this.onTaskDataBaseLoadEnd)), this.insertToCategoryViewEventId = _.attachTaskEvent(s.DownloadKernel.TaskEventType.InsertToCategoryView, (...e) => {
                do {
                    if (!e) break;
                    if (e[0] !== s.DownloadKernel.TaskEventType.InsertToCategoryView) break;
                    if (void 0 === e[1] || !e[2] || !e[3]) break;
                    let t = e[1];
                    if (-1 === t || D.isPrivateCategory(t)) {
                        let i = e[2], n = e[3], a = e[4], o = n.map(e => e.getTaskBaseInfo());
                        this.INSERT_TO_CATEGORY_VIEW({
                            id: i,
                            categoryId: t,
                            tasks: o
                        }), this.bLoadDbFinish && -1 === t && i === s.DownloadKernel.CategroyViewID.Downloading && (a === s.DownloadKernel.TaskInsertReason.Create && this.UPDATE_CATEGORY(t), this.$nextTick(() => {
                            if (this.currentCategoryViewId !== s.DownloadKernel.CategroyViewID.Downloading) this.UPDATE_CATEGORYVIEW(s.DownloadKernel.CategroyViewID.Downloading), this.$nextTick(() => {
                                setTimeout(() => {
                                    let e = this.downloadingTaskList[0];
                                    this.UPDATE_DOWNLOADING_SELECTED_TASKS([e])
                                }, 0)
                            }); else {
                                let e = this.downloadingTaskList[0];
                                this.UPDATE_DOWNLOADING_SELECTED_TASKS([e])
                            }
                        }))
                    }
                } while (0)
            }), setTimeout(() => {
                this.getHotwords().catch()
            }, 2e3)
        }

        destroyed() {
            c.downloadContextMenu.detachListener(h.NodeEventMesssageNS.eventDownloadContextMenuClick, this.handleMenuClick), c.downloadContextMenu.detachListener(h.NodeEventMesssageNS.eventDownloadContextMenuPopup, this.handleMenuPopup), c.downloadContextMenu.detachListener(h.NodeEventMesssageNS.eventDownloadContextMenuEnd, this.handleMenuEnd), void 0 !== this.insertToCategoryViewEventId && _.detachTaskEvent(s.DownloadKernel.TaskEventType.InsertToCategoryView, this.insertToCategoryViewEventId), void 0 !== this.statusChangedEventId && _.detachTaskEvent(s.DownloadKernel.TaskEventType.StatusChanged, this.statusChangedEventId), void 0 !== this.dataBaseLoadCookie && (this.dataBaseLoadCookie = void 0, p.DownloadKernelManager.detachListener(h.NodeEventMesssageNS.eventTaskDataBaseLoadEnd, this.onTaskDataBaseLoadEnd))
        }
    };
    n([o.Prop({})], N.prototype, "currentTabId", void 0), n([o.Prop({})], N.prototype, "currentCategoryId", void 0), n([o.Prop({})], N.prototype, "currentCategoryViewId", void 0), n([o.Prop({})], N.prototype, "downloadingTaskList", void 0), n([o.Prop({})], N.prototype, "downloadingTaskBaseList", void 0), n([o.Prop({})], N.prototype, "completedTaskList", void 0), n([o.Prop({})], N.prototype, "completedTaskBaseList", void 0), n([o.Prop({})], N.prototype, "recycleTaskList", void 0), n([o.Prop({})], N.prototype, "recycleTaskBaseList", void 0), n([o.Prop({})], N.prototype, "downloadingSelectedIndexs", void 0), n([o.Prop({})], N.prototype, "completedSelectedTaskIndexs", void 0), n([o.Prop({})], N.prototype, "recycleSelectedTaskIndexs", void 0), n([o.Prop({})], N.prototype, "currentSelectdTaskInfos", void 0), n([o.Prop({})], N.prototype, "canStartAll", void 0), n([o.Prop({})], N.prototype, "UPDATE_CATEGORY", void 0), n([o.Prop({})], N.prototype, "UPDATE_CATEGORYVIEW", void 0), n([o.Prop({})], N.prototype, "SORT_CATEGORY_HISTORY", void 0), n([o.Prop({})], N.prototype, "SORT_CATEGORY_BY_FUNCTION", void 0), n([o.Prop({})], N.prototype, "UPDATE_DOWNLOADING_SELECTED_TASKS", void 0), n([o.Prop({})], N.prototype, "UPDATE_COMPLETED_SELECTED_TASKS", void 0), n([o.Prop({})], N.prototype, "UPDATE_RECYCLE_SELECTED_TASKS", void 0), n([o.Prop({})], N.prototype, "MOVE_TO_TOP", void 0), n([o.Prop({})], N.prototype, "UPDATE_DOWNLOADING_TASKLIST", void 0), n([o.Prop({})], N.prototype, "UPDATE_COMPLETED_TASKLIST", void 0), n([o.Prop({})], N.prototype, "UPDATE_RECYCLE_TASKLIST", void 0), n([o.Prop({})], N.prototype, "MOVE_TO_BOTTOM", void 0), n([o.Prop({})], N.prototype, "SELECT_PRE", void 0), n([o.Prop({})], N.prototype, "SELECT_NEXT", void 0), n([o.Prop({})], N.prototype, "INIT_CATEGORY_TASKLIST", void 0), n([o.Prop({})], N.prototype, "INSERT_TO_CATEGORY_VIEW", void 0), n([o.Prop({})], N.prototype, "UPDATE_TASK_STATUS", void 0), n([o.Prop({})], N.prototype, "attachTaskEvent", void 0), n([o.Prop({})], N.prototype, "selectTab", void 0), n([o.Watch("currentCategoryId")], N.prototype, "onCategoryChange", null), n([o.Watch("currentCategoryViewId")], N.prototype, "onCategoryViewChange", null), n([o.Watch("completedTaskList")], N.prototype, "onCompletedTaskListChange", null), n([o.Watch("completedFilter")], N.prototype, "onCompletedFilterChange", null), n([o.Watch("isAllDownloading", {immediate: !0})], N.prototype, "onIsAllDownloadingChange", null), N = n([o.Component({components: {DownloadCategory: d.default}})], N), t.default = N
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(237), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(8), r = i(0), s = i(3), l = i(663), d = i(670), u = i(672), c = i(27), h = i(13), f = i(11), g = i(312),
        p = i(131), v = i(10), m = i(25), y = i(41), k = r.default.getLogger("DownloadCategory"),
        T = p.PluginWebviewMgrNS.getWebViewMgr(), w = f.DownloadKernelTaskManager.getTaskManager();
    let C = class extends o.Vue {
        constructor() {
            super(...arguments), this.enbaleVipPlugin = !1, this.observer = null, this.vipPluginAttachFunc = null, this.loadedIndex = 0, this.deleted = {}, this.opened = {}, this.dataChecking = {}, this.fileTransferTooltipVisible = {}, this.showFileTransferTipTaskId = void 0
        }

        get taskCount() {
            return this.tasklist.length
        }

        get loadedList() {
            let e = this.loadedIndex + 20;
            return e > this.taskCount && (e = this.taskCount), k.information("load more", e), this.tasklist.slice(0, e)
        }

        get loadedListWithKey() {
            return this.loadedList.map(e => Object.assign({
                key: e,
                template: {
                    class: {
                        "is-deleted": this.deleted[e],
                        "is-finish": !this.opened[e],
                        "is-check": this.dataChecking[e]
                    }
                }
            }))
        }

        onLoadedListChanged(e) {
            e.forEach(e => {
                this.$set(this.deleted, String(e), e in this.deleted && this.deleted[e]), this.$set(this.opened, String(e), e in this.opened && this.opened[e])
            }), this.updateShouleiFileTransferTip().catch()
        }

        onTasklistChange(e, t) {
            this.$nextTick(() => {
                this.currentCategoryViewId === s.DownloadKernel.CategroyViewID.Downloading && T.updateTaskAdWebview()
            })
        }

        handleCategoryShow(e) {
            return a(this, void 0, void 0, function* () {
                if (e === s.DownloadKernel.CategroyViewID.Completed && this.showFileTransferTipTaskId) {
                    let e = v.ConfigNS.getValue("ShouleiDownload", "AutoShowFileTransferToolTip", 1);
                    k.information("handleCategoryShow autoShowToolTip", e), 1 === e && v.ConfigNS.setValue("ShouleiDownload", "AutoShowFileTransferToolTip", 0)
                }
            })
        }

        updateShouleiFileTransferTip() {
            return a(this, void 0, void 0, function* () {
                this.taskCount > 0 && "CompletedItemContainer" === this.componentName && v.ConfigNS.attachListener(h.NodeEventMesssageNS.eventConfigInitFinished, () => a(this, void 0, void 0, function* () {
                    let e = v.ConfigNS.getValue("ShouleiDownload", "AutoShowFileTransferToolTip", 1);
                    if (k.information("updateShouleiFileTransferTip autoShowToolTip", e), 1 === e) {
                        yield m.default.isInitedAw();
                        let e = m.default.getConfigInfo("shouleiDownload", "enableTransfer");
                        if (k.information("updateShouleiFileTransferTip enableTransfer", e), 0 !== e) {
                            let e = void 0;
                            for (let t = 0; t < this.loadedList.length; ++t) {
                                let i = this.loadedList[t];
                                if (yield y.TaskCtrlOperatorNS.isExistTaskFile(w.getTaskFromTaskId(i).getTaskBaseInfo())) {
                                    e = i;
                                    break
                                }
                            }
                            k.information("updateShouleiFileTransferTip", e), e !== this.showFileTransferTipTaskId && (this.showFileTransferTipTaskId && this.$set(this.fileTransferTooltipVisible, String(this.showFileTransferTipTaskId), !1), e && (this.$set(this.fileTransferTooltipVisible, String(e), !0), this.showFileTransferTipTaskId = e)), this.currentCategoryViewId === s.DownloadKernel.CategroyViewID.Completed && this.showFileTransferTipTaskId && v.ConfigNS.setValue("ShouleiDownload", "AutoShowFileTransferToolTip", 0)
                        }
                    }
                }))
            })
        }

        getLoadedCount() {
            return this.loadedIndex
        }

        setLoadedCount(e) {
            e > this.taskCount && (e = this.taskCount), this.loadedIndex = e
        }

        loadMore(e) {
            this.loadedIndex + 20 > this.taskCount ? this.loadedIndex = this.taskCount : this.loadedIndex += 20, e()
        }

        handleSelectChange(e) {
            this.COMMIT_SELECT(e)
        }

        handleListChange(e) {
            const t = e.map(e => {
                let t = Object.assign({}, e);
                return delete t.template, t.key
            });
            this.COMMIT_UPDATE_TASKLIST(t)
        }

        handleScroll(e) {
            this.currentCategoryViewId === s.DownloadKernel.CategroyViewID.Downloading && T.updateTaskAdWebview()
        }

        handleSorting() {
            this.currentCategoryViewId === s.DownloadKernel.CategroyViewID.Downloading && (T.hideTaskAdWebview(), T.setSorting(!0))
        }

        handleSortEnd() {
            this.currentCategoryViewId === s.DownloadKernel.CategroyViewID.Downloading && (T.setSorting(!1), T.updateTaskAdWebview())
        }

        handleItemDbClick(e) {
            this.$emit("dblclick", e)
        }

        handleContextMenu(e) {
            this.$emit("contextmenu", e)
        }

        handleCancleActive(e) {
            k.information("receive eventShowHomePage", e);
            let t = w.getTaskFromTaskId(e);
            if (t) {
                let e = t.getTaskAttribute(s.DownloadKernel.TaskAttribute.CategoryViewId);
                e !== s.DownloadKernel.CategroyViewID.Unkown && e === this.currentCategoryViewId && this.COMMIT_SELECT([])
            }
        }

        handleActiveChange(e, t) {
            e && this.$nextTick(() => {
                this.scrollTo(t)
            })
        }

        handleActiveNearby(e) {
            do {
                if (0 === this.taskCount) break;
                if (e > this.taskCount) break;
                e <= this.taskCount - 1 ? this.COMMIT_SELECT([this.tasklist[e]]) : this.COMMIT_SELECT([this.tasklist[e - 1]])
            } while (0)
        }

        scrollTo(e) {
            let t = this.$el, i = t.querySelectorAll(".td-draglist-item"), n = void 0,
                a = document.querySelector(".td-collapse,.xlx-side");
            void 0 !== a && null !== a && (n = -1 === this.currentCategoryId ? a.clientHeight - 95 : a.clientHeight - 70);
            do {
                if (null === i || void 0 === i || 0 === i.length) break;
                if (e < 0) break;
                if (e > i.length - 1) break;
                let a = 0, o = 0;
                for (let t of i) {
                    if (o === e) break;
                    a += 1, t.classList.contains("v-leave") || (o += 1)
                }
                a === i.length && (a -= 1);
                let r = i[a];
                k.information("scroll index & realIndex", e, a), g.ThunderWindowNS.autoAdaptScrollIntoView(r, t, n)
            } while (0)
        }

        onVipPluginLoaded(e) {
            this.enbaleVipPlugin = e
        }

        resizeHandler(e) {
            this.enbaleVipPlugin && this.currentCategoryViewId === s.DownloadKernel.CategroyViewID.Downloading && T.updateTaskAdWebview()
        }

        mounted() {
            c.default.attachListener(h.NodeEventMesssageNS.eventShowHomePage, this.handleCancleActive), this.enbaleVipPlugin = T.isVipPluginEnable(), this.vipPluginAttachFunc = this.onVipPluginLoaded.bind(this), T.on("vip_plugin_enable", this.vipPluginAttachFunc), window.addEventListener("resize", this.resizeHandler.bind(this)), this.observer = new MutationObserver(e => {
                this.enbaleVipPlugin && this.currentCategoryViewId === s.DownloadKernel.CategroyViewID.Downloading && T.updateTaskAdWebview()
            });
            this.observer.observe(this.$el, {
                attributes: !0,
                childList: !0,
                characterData: !0
            }), this.updateShouleiFileTransferTip().catch()
        }

        destroyed() {
            this.observer && this.observer.disconnect(), c.default.detachListener(h.NodeEventMesssageNS.eventShowHomePage, this.handleCancleActive), T.removeListener("vip_plugin_enable", this.vipPluginAttachFunc), window.removeEventListener("resize", this.resizeHandler.bind(this))
        }
    };
    n([o.Prop({})], C.prototype, "pulseForRename", void 0), n([o.Prop({default: ""})], C.prototype, "sharedKeyWords", void 0), n([o.Prop({})], C.prototype, "itemType", void 0), n([o.Prop({})], C.prototype, "currentCategoryId", void 0), n([o.Prop({})], C.prototype, "currentCategoryViewId", void 0), n([o.Prop({})], C.prototype, "componentName", void 0), n([o.Prop({})], C.prototype, "tasklist", void 0), n([o.Prop({})], C.prototype, "selectedTaskIds", void 0), n([o.Prop({default: !0})], C.prototype, "sortable", void 0), n([o.Prop({})], C.prototype, "COMMIT_SELECT", void 0), n([o.Prop({})], C.prototype, "COMMIT_UPDATE_TASKLIST", void 0), n([o.Watch("loadedList", {immediate: !0})], C.prototype, "onLoadedListChanged", null), n([o.Watch("tasklist")], C.prototype, "onTasklistChange", null), n([o.Watch("currentCategoryViewId")], C.prototype, "handleCategoryShow", null), C = n([o.Component({
        components: {
            DownloadingItemContainer: l.default,
            CompletedItemContainer: d.default,
            RecycleItemContainer: u.default
        }
    })], C), t.default = C
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(239), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(664), a = i(33), o = i(3), r = i(29).DownloadKernelCategoryManager.getCategoryManager();
    t.default = a.connector.connect({
        mapStateToProps: {
            taskBase: (e, t) => {
                let i = null, n = t.taskId, a = t.currentCategoryId;
                if (-1 === a) {
                    for (let t = 0; t < e.DownloadListState.taskList.length; t++) if (e.DownloadListState.taskList[t].id === o.DownloadKernel.CategroyViewID.Downloading) {
                        i = e.DownloadListState.taskList[t].tasksMap[n];
                        break
                    }
                } else if (r.isPrivateCategory(a)) for (let t = 0; t < e.DownloadListState.taskListPrivate.length; t++) e.DownloadListState.taskListPrivate[t].id === o.DownloadKernel.CategroyViewID.Downloading && (i = e.DownloadListState.taskListPrivate[t].tasksMap[n]);
                return i
            }, vipSpeedInfo: (e, t) => {
                let i = null, n = t.taskId;
                return i = e.VipSpeedState.vipSpeedMap[n] ? e.VipSpeedState.vipSpeedMap[n] : e.VipSpeedState.defaultStatus
            }
        }
    })(n.default)
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(241), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(8), r = i(3), s = i(11), l = i(14), d = i(62), u = i(47), c = i(60), h = i(13), f = i(36), g = i(27),
        p = i(9), v = i(127), m = i(15), y = i(43), k = i(0), T = i(456), w = i(88),
        C = i(131).PluginWebviewMgrNS.getWebViewMgr(), S = m.DownloadKernelEventManager.getEventManager(),
        b = s.DownloadKernelTaskManager.getTaskManager(), I = k.default.getLogger("DownloadPanel.DownloadingItem");
    let _ = class extends o.Vue {
        constructor() {
            super(...arguments), this.btSubDetailCookie = -1, this.groupTaskStatusCookie = -1, this.groupTaskSubFileDetailChangedCookie = -1, this.p2spTaskDetailChangedCookie = -1, this.hover = !1, this.titleOverFlow = "", this.subTaskCount = 0, this.highLight = "", this.fileNameDefaultCursor = "cursor:default", this.percentVisible = !1, this.isQuerying = !1, this.startStatusPrompt = void 0, this.playProgress = 0, this.taskExtraLoaded = !1, this.toolTip = {
                validating: "",
                remainTime: ""
            }
        }

        onChosenChanged(e) {
            e && (this.percentVisible = !1), g.default.fireEvent(h.NodeEventMesssageNS.eventDownloadItemChosen, r.DownloadKernel.CategroyViewID.Downloading, this.taskBase.taskId, e, this.active)
        }

        onTaskBaseChanged() {
            let e = w.DownloadJammedNS.isValidatingFileData(this.taskId),
                t = w.DownloadJammedNS.isCorrectingData(this.taskId);
            if (e) {
                this.toolTip.validating = "正在校验文件...";
                let e = w.DownloadJammedNS.getValidationDuration(this.taskId);
                e && e.remainSeconds !== 1 / 0 ? this.toolTip.remainTime = "剩余" + d.TimeHelperNS.formatSeconds(e.remainSeconds) : this.toolTip.remainTime = "剩余--:--:--"
            } else t && (this.toolTip.validating = "检查到部分文件错误", this.toolTip.remainTime = "正在重新下载");
            this.dataValidating = e, this.$emit("update:dataChecking", e || t)
        }

        onEnableVipPlugin(e) {
            e && this.isShowExpand && this.$nextTick(() => {
                g.default.fireEvent(h.NodeEventMesssageNS.eventDownloadItemActive, r.DownloadKernel.CategroyViewID.Downloading, this.currentCategoryViewId === r.DownloadKernel.CategroyViewID.Downloading, this.taskBase.taskId, this.$el)
            })
        }

        onTaskFailedChange(e) {
            "search" !== this.itemType && this.enbaleVipPlugin && this.active && (e ? C.hideTaskAdWebview(this.taskId) : this.$nextTick(() => {
                C.showTaskAdWebview(this.taskId, this)
            }))
        }

        onOptionsChanged(e, t) {
            this.active && g.default.fireEvent(h.NodeEventMesssageNS.eventDownloadItemActive, r.DownloadKernel.CategroyViewID.Downloading, e === r.DownloadKernel.CategroyViewID.Downloading, this.taskBase.taskId, this.$el), this.chosen && g.default.fireEvent(h.NodeEventMesssageNS.eventDownloadItemChosen, r.DownloadKernel.CategroyViewID.Downloading, this.taskBase.taskId, e === r.DownloadKernel.CategroyViewID.Downloading, this.active)
        }

        onKeyWordsChange(e, t) {
            this.highLight = l.ThunderUtil.keywordsHighLight(this.taskBase.taskName, e, null)
        }

        onRenamePulse(e, t) {
            this.highLight = l.ThunderUtil.keywordsHighLight(this.taskBase.taskName, this.sharedKeyWords, null)
        }

        get remindType() {
            let e = "none";
            do {
                if (!this.vipSpeedInfo) break;
                if (!this.vipSpeedInfo.remindType) break;
                e = this.vipSpeedInfo.remindType
            } while (0);
            return e
        }

        get remindShow() {
            return "online" === this.remindType || "fail" === this.remindType || "remind" === this.remindType || "reminded" === this.remindType || "online_read" === this.remindType
        }

        get remindClass() {
            let e = "";
            switch (this.remindType) {
                case"reminded":
                    e = "is-remind";
                    break;
                case"online":
                    e = "is-suc";
                    break;
                case"online_read":
                    e = "is-suc is-read";
                    break;
                case"fail":
                    e = "is-fail"
            }
            return e
        }

        get remindLabel() {
            let e = "";
            switch (this.remindType) {
                case"reminded":
                    e = "已提醒";
                    break;
                case"online":
                case"online_read":
                    e = "已上线";
                    break;
                case"fail":
                    e = "未成功"
            }
            return e
        }

        get canShowHuddle() {
            let e = !1;
            do {
                if (!this.active) break;
                if (this.taskStatus === r.DownloadKernel.TaskStatus.Failed) break;
                if (this.isGroup) break;
                e = !0
            } while (0);
            return e
        }

        get canPlay() {
            let e = !1;
            do {
                if (this.taskError) break;
                if (this.taskBase.isMoving) break;
                if (!this.taskExtraLoaded) break;
                let t = b.getTaskFromTaskId(this.taskBase.taskId);
                t && (e = t.isSupportPlay())
            } while (0);
            return e
        }

        get playProgressStyle() {
            return this.playCompleted ? "width: 0%;" : "width: " + 100 * this.playProgress + "%;"
        }

        get playCompleted() {
            return 1 === this.playProgress
        }

        get subTaskCountDesc() {
            return this.subTaskCount > 999 ? "999+文件" : this.subTaskCount + "个文件"
        }

        onActiveChanged(e, t) {
            "search" !== this.itemType && this.currentCategoryViewId === r.DownloadKernel.CategroyViewID.Downloading && g.default.fireEvent(h.NodeEventMesssageNS.eventDownloadItemActive, r.DownloadKernel.CategroyViewID.Downloading, this.active, this.taskBase.taskId, this.$el), e && (this.percentVisible = !1), this.$emit("active-change", e)
        }

        onTaskIdChanged(e, t) {
            void 0 !== t && (this.unInitialize(), this.initialize())
        }

        get taskError() {
            return this.taskBase.taskStatus === r.DownloadKernel.TaskStatus.Failed
        }

        get isForbidden() {
            let e = !1;
            do {
                if (this.taskError) {
                    let t = 0, i = b.getTaskFromTaskId(this.taskBase.taskId);
                    if (null !== i && (t = i.getTaskAttribute(r.DownloadKernel.TaskAttribute.ErrorCode)), 7 === t) {
                        e = !0;
                        break
                    }
                    if (t >= 700 && t <= 799) {
                        e = !0;
                        break
                    }
                }
            } while (0);
            return e
        }

        get errInfo() {
            let e = "";
            if (this.taskError) {
                let t = 0, i = b.getTaskFromTaskId(this.taskBase.taskId);
                null !== i && (t = i.getTaskAttribute(r.DownloadKernel.TaskAttribute.ErrorCode)), e = c.TaskStatusHelper.getTaskErrorInfoByCode(t)
            }
            return e
        }

        handleFileCountClick() {
            this.active ? g.default.fireEvent(h.NodeEventMesssageNS.eventDetailSwitch2Index, this.taskBase.taskId, v.DetailIndex.FileList) : g.default.fireEvent(h.NodeEventMesssageNS.eventDownloadItemActive, r.DownloadKernel.CategroyViewID.Downloading, !0, this.taskBase.taskId, this.$el, void 0, v.DetailIndex.FileList)
        }

        handleItemMouseOut() {
            this.percentVisible = !1, this.hover = !1
        }

        handleItemMouseHover() {
            this.hover = !0;
            do {
                if (this.chosen) {
                    this.percentVisible = !1;
                    break
                }
                if (this.active) {
                    this.percentVisible = !1;
                    break
                }
                this.percentVisible = !0;
                break
            } while (0)
        }

        handleTaskNameMouseOver(e) {
            let t = e.target, i = t.scrollHeight, n = t.offsetHeight;
            this.titleOverFlow = i > n ? this.taskBase.taskName : ""
        }

        handleIconMouseHover(e) {
            let t = w.DownloadJammedNS.isValidatingFileData(this.taskId);
            w.DownloadJammedNS.isCorrectingData(this.taskId) && !t && (I.information("mouse over media icon when data correcting"), p.XLStatNS.trackEvent("download_leftpanel", "data_error_correction_icon_hover", "", 0, 0, 0, 0, ""))
        }

        get fileTypeClass() {
            return u.TaskUtilHelper.getTaskIcon(this.taskBase.taskName, this.taskBase.taskType, "xly-type-")
        }

        get taskName() {
            return "search" !== this.itemType ? this.taskBase.taskName : this.highLight
        }

        get fileSize() {
            return this.taskBase.fileSize
        }

        get fileSizeFormat() {
            return l.ThunderUtil.formatSizeCustom(this.taskBase.fileSize)
        }

        get downloadSize() {
            return this.taskBase.downloadSize
        }

        get downloadSizeFormat() {
            return l.ThunderUtil.formatSizeCustom(this.taskBase.downloadSize)
        }

        get progress() {
            let e = 0;
            return 0 !== this.taskBase.fileSize && (e = this.taskBase.downloadSize / this.taskBase.fileSize), I.information("data in validating:", this.taskBase.downloadSize - this.taskBase.validDownloadSize, ", downloaded:", this.taskBase.downloadSize, ",progress:", e), 100 * e
        }

        get progressPercent() {
            let e = 0;
            0 !== this.taskBase.fileSize && (e = this.taskBase.downloadSize / this.taskBase.fileSize), e >= 1 && (e = .9999);
            let t = (100 * e).toFixed(2) + "%";
            return "100.00%" === t && (t = "99.99%"), t
        }

        get taskStatus() {
            return this.taskBase.taskStatus
        }

        get taskStatusSpeedInfo() {
            let e = "", t = c.TaskStatusHelper.getTaskStatusPrompt(this.taskBase);
            if (this.startStatusPrompt = c.TaskStatusHelper.getTaskStartStatusPrompt(this.taskBase), void 0 !== t || void 0 !== this.startStatusPrompt) "完成" === (e = void 0 !== this.startStatusPrompt ? this.startStatusPrompt : t) && (e = ""), "暂停" === e && (e = "已暂停"); else {
                let t = this.taskBase.downloadSpeed;
                e = l.ThunderUtil.formatSizeCustom(t, 1, 4) + "/s"
            }
            return e
        }

        get taskType() {
            return this.taskBase.taskType
        }

        get showStartTemplate() {
            let e = !1;
            return this.taskBase.taskStatus !== r.DownloadKernel.TaskStatus.StartPending && this.taskBase.taskStatus !== r.DownloadKernel.TaskStatus.StopPending && this.taskBase.taskStatus !== r.DownloadKernel.TaskStatus.Started || (e = !0), e
        }

        get canStart() {
            let e = !1;
            do {
                if (this.taskBase.isMoving) break;
                e = !this.canPause
            } while (0);
            return e
        }

        get canPause() {
            let e = !1;
            return this.taskBase.taskStatus !== r.DownloadKernel.TaskStatus.StartWaiting && this.taskBase.taskStatus !== r.DownloadKernel.TaskStatus.StartPending && this.taskBase.taskStatus !== r.DownloadKernel.TaskStatus.Started || (e = !0), e
        }

        get isGroup() {
            let e = !1;
            return this.taskBase.taskType === r.DownloadKernel.TaskType.Group && (e = !0), e
        }

        get isBt() {
            let e = !1;
            return this.taskBase.taskType === r.DownloadKernel.TaskType.Bt && (e = !0), e
        }

        get bTaskCountShow() {
            let e = !1;
            return (this.isBt || this.isGroup) && (this.active || this.chosen) && (e = !0), e
        }

        get remain() {
            let e = "--:--:--";
            if (!this.hover || this.chosen || this.active) {
                if (this.taskBase.downloadSpeed > 0 && this.taskBase.fileSize > 0) {
                    let t = this.taskBase.fileSize - this.taskBase.downloadSize;
                    if (t > 0) {
                        let i = t / this.taskBase.downloadSpeed;
                        e = d.TimeHelperNS.formatSecondsCustom(i)
                    }
                }
            } else e = this.progressPercent;
            return e
        }

        get isFailed() {
            return this.taskStatus === r.DownloadKernel.TaskStatus.Failed
        }

        get isShowExpand() {
            return this.taskStatus !== r.DownloadKernel.TaskStatus.Failed && ("search" !== this.itemType && this.active)
        }

        get isSuperVip() {
            let e = !1;
            return this.enbaleVipPlugin && this.vipSpeedInfo && (e = this.vipSpeedInfo.isShowSuperSpeed && this.vipSpeedInfo.isAcclerated), e
        }

        handleClickSensitive() {
            do {
                if (!this.vipSpeedInfo) break;
                if (!this.vipSpeedInfo.isSensitive) break;
                if (!this.vipSpeedInfo.sensitive) break;
                if (!this.vipSpeedInfo.sensitive.onAction) break;
                this.vipSpeedInfo.sensitive.onAction()
            } while (0)
        }

        onShowQueryTip(e) {
            if (e) {
                let e = T.QueryTaskInfoNS.getQueryTaskId();
                this.isQuerying = e === this.taskBase.taskId
            } else this.isQuerying = !1
        }

        statExtData() {
            let e = "panel_type=mypc";
            return -1 !== this.currentCategoryId && (e = "panel_type=private"), e
        }

        handlePlayTask() {
            p.XLStatNS.trackEvent("download_leftpanel", "bianxiabianbo_click", "", 0, 0, 0, 0, this.statExtData()), b.getTaskFromTaskId(this.taskBase.taskId) && f.TaskOperatorNs.downloadAndPlay(this.taskBase.taskId, -1, "bianxiabianbo", "downloading", this.currentCategoryId, !1, 0, !this.playCompleted).catch()
        }

        handleStartTask() {
            p.XLStatNS.trackEvent("download_leftpanel", "downloading_right_continue_click", "", 0, 0, 0, 0, this.statExtData()), y.DownloadDispatchNS.startTask(this.taskBase.taskId)
        }

        handlePauseTask() {
            p.XLStatNS.trackEvent("download_leftpanel", "downloading_right_pause_click", "", 0, 0, 0, 0, this.statExtData()), b.stopTask(this.taskBase.taskId, r.DownloadKernel.TaskStopReason.Manual)
        }

        handleDestroyTask() {
            f.TaskOperatorNs.destroyTasks([this.taskBase])
        }

        handleDbClick(e) {
            this.$emit("dblclick", e)
        }

        handleGroupAccelerateClick() {
            this.vipSpeedInfo && this.vipSpeedInfo.huddle && this.vipSpeedInfo.huddle.onClick && this.vipSpeedInfo.huddle.onClick()
        }

        updateBtTaskPlayProgress(e) {
            let t = e.getExtraObject(), i = [];
            t.getDownloadFile().forEach(e => {
                let n = t.getBtFileByRealIndex(e);
                if (n.isSupportPlay()) {
                    let e = 0, t = n.getBtFileAttribute(r.DownloadKernel.BtFileAttribute.Duration),
                        a = n.getBtFileAttribute(r.DownloadKernel.BtFileAttribute.PlayPosition);
                    t && (e = a / t), i.push(e)
                }
            }), i.length && (this.playProgress = i.reduce(function (e, t, i, n) {
                return e + t
            }) / i.length)
        }

        updateGroupTaskPlayProgress(e) {
            let t = e.getExtraObject(), i = [];
            for (let e = 0; e < this.subTaskCount; ++e) {
                let n = t.getSubTaskByIndex(e);
                if (n && n.isSupportPlay()) {
                    let e = 0, t = n.getTaskAttribute(r.DownloadKernel.TaskAttribute.Duration),
                        a = n.getTaskAttribute(r.DownloadKernel.TaskAttribute.PlayPosition);
                    t && (e = a / t), i.push(e)
                }
            }
            i.length && (this.playProgress = i.reduce(function (e, t, i, n) {
                return e + t
            }) / i.length)
        }

        updateP2spTaskPlayProgress(e) {
            if (e.isSupportPlay()) {
                let t = e.getTaskAttribute(r.DownloadKernel.TaskAttribute.Duration),
                    i = e.getTaskAttribute(r.DownloadKernel.TaskAttribute.PlayPosition);
                t && (this.playProgress = i / t)
            }
        }

        onBtSubFileDetailChanged(...e) {
            do {
                if (!e) break;
                if (e[0] !== r.DownloadKernel.TaskEventType.BtSubFileDetailChanged) break;
                if (!e[1] || !e[2]) break;
                if (e[1] === this.taskBase.taskId) {
                    let e = b.getTaskFromTaskId(this.taskBase.taskId), t = e.getExtraObject().getDownloadFile();
                    t.length !== this.subTaskCount && (this.subTaskCount = t.length), this.updateBtTaskPlayProgress(e)
                }
            } while (0)
        }

        onGroupTaskStatusChanged(...e) {
            do {
                if (!e) break;
                if (e[0] !== r.DownloadKernel.TaskEventType.StatusChanged) break;
                if (!e[1]) break;
                let t = e[1];
                if (t[0].getTaskAttribute(r.DownloadKernel.TaskAttribute.CategoryId) !== this.currentCategoryId) break;
                for (let e = 0; e < t.length; e++) {
                    let i = t[e];
                    if (i.getTaskAttribute(r.DownloadKernel.TaskAttribute.TaskId) === this.taskId) {
                        let e = i.getExtraObject();
                        this.subTaskCount = e.getDownloadTaskCount(), this.updateGroupTaskPlayProgress(i);
                        break
                    }
                }
            } while (0)
        }

        onGroupTaskSubFileDetailChanged(...e) {
            do {
                if (!e) break;
                if (e[0] !== r.DownloadKernel.TaskEventType.GroupTaskSubFileDetailChanged) break;
                if (!e[1]) break;
                e[1].forEach((e, t) => {
                    if (t === this.taskId) {
                        let e = b.getTaskFromTaskId(t);
                        e && this.updateGroupTaskPlayProgress(e)
                    }
                })
            } while (0)
        }

        onP2spTaskDetailChanged(...e) {
            do {
                if (!e) break;
                if (e[0] !== r.DownloadKernel.TaskEventType.DetailChanged) break;
                if (!e[1]) break;
                let t = e[2];
                if (t & r.DownloadKernel.TaskDetailChangedFlags.PlayPosition || t & r.DownloadKernel.TaskDetailChangedFlags.Duration) {
                    let t = e[1];
                    for (let e = 0; e < t.length; ++e) {
                        let i = t[e];
                        if (i && i.getId() === this.taskId) {
                            this.updateP2spTaskPlayProgress(i);
                            break
                        }
                    }
                }
            } while (0)
        }

        initialize() {
            return a(this, void 0, void 0, function* () {
                let e = b.getTaskFromTaskId(this.taskBase.taskId);
                if (this.taskBase.taskType === r.DownloadKernel.TaskType.Bt) {
                    this.btSubDetailCookie = S.attachTaskEvent(r.DownloadKernel.TaskEventType.BtSubFileDetailChanged, this.onBtSubFileDetailChanged);
                    let t = e.getExtraObject().getDownloadFile();
                    this.subTaskCount = t.length, this.updateBtTaskPlayProgress(e)
                } else if (this.taskBase.taskType === r.DownloadKernel.TaskType.Group) {
                    this.groupTaskStatusCookie = S.attachTaskEvent(r.DownloadKernel.TaskEventType.StatusChanged, this.onGroupTaskStatusChanged);
                    let t = e.getExtraObject();
                    this.subTaskCount = t.getDownloadTaskCount(), this.groupTaskSubFileDetailChangedCookie = S.attachTaskEvent(r.DownloadKernel.TaskEventType.GroupTaskSubFileDetailChanged, this.onGroupTaskSubFileDetailChanged), this.updateGroupTaskPlayProgress(e)
                } else this.p2spTaskDetailChangedCookie = S.attachTaskEvent(r.DownloadKernel.TaskEventType.DetailChanged, this.onP2spTaskDetailChanged), this.updateP2spTaskPlayProgress(e)
            })
        }

        unInitialize() {
            return a(this, void 0, void 0, function* () {
                -1 !== this.btSubDetailCookie && (S.detachTaskEvent(r.DownloadKernel.TaskEventType.BtSubFileDetailChanged, this.btSubDetailCookie), this.btSubDetailCookie = -1), -1 !== this.groupTaskStatusCookie && (S.detachTaskEvent(r.DownloadKernel.TaskEventType.StatusChanged, this.groupTaskStatusCookie), this.groupTaskStatusCookie = -1), -1 !== this.groupTaskSubFileDetailChangedCookie && (S.detachTaskEvent(r.DownloadKernel.TaskEventType.GroupTaskSubFileDetailChanged, this.groupTaskSubFileDetailChangedCookie), this.groupTaskSubFileDetailChangedCookie = -1), -1 !== this.p2spTaskDetailChangedCookie && (S.detachTaskEvent(r.DownloadKernel.TaskEventType.DetailChanged, this.p2spTaskDetailChangedCookie), this.p2spTaskDetailChangedCookie = -1)
            })
        }

        created() {
            if (this.isBt) {
                if (b.getTaskFromTaskId(this.taskBase.taskId).getExtraObject().isBtFileLoadEnd()) this.taskExtraLoaded = !0; else {
                    let e = void 0, t = () => {
                        this.taskExtraLoaded = !0, S.detachTaskEvent(r.DownloadKernel.TaskEventType.BtSubFileLoaded, e), e = void 0
                    };
                    e = S.attachTaskEvent(r.DownloadKernel.TaskEventType.BtSubFileLoaded, t)
                }
            } else this.taskExtraLoaded = !0;
            this.initialize()
        }

        destroyed() {
            this.unInitialize(), "search" !== this.itemType && (this.active && (g.default.fireEvent(h.NodeEventMesssageNS.eventDownloadItemActive, r.DownloadKernel.CategroyViewID.Downloading, !1, this.taskBase.taskId, this.$el), g.default.getNeedSelectNext() && (g.default.setNeedSelectNext(!1), this.$emit("active-nearby", this.index))), this.chosen && g.default.fireEvent(h.NodeEventMesssageNS.eventDownloadItemChosen, r.DownloadKernel.CategroyViewID.Downloading, this.taskBase.taskId, !1, !1))
        }
    };
    n([o.Prop({})], _.prototype, "enbaleVipPlugin", void 0), n([o.Prop({})], _.prototype, "vipSpeedInfo", void 0), n([o.Prop({})], _.prototype, "pulseForRename", void 0), n([o.Prop({default: ""})], _.prototype, "sharedKeyWords", void 0), n([o.Prop({})], _.prototype, "itemType", void 0), n([o.Prop({})], _.prototype, "index", void 0), n([o.Prop({})], _.prototype, "taskId", void 0), n([o.Prop({})], _.prototype, "taskBase", void 0), n([o.Prop({})], _.prototype, "currentCategoryId", void 0), n([o.Prop({})], _.prototype, "currentCategoryViewId", void 0), n([o.Prop()], _.prototype, "chosen", void 0), n([o.Prop()], _.prototype, "active", void 0), n([o.Prop()], _.prototype, "dataChecking", void 0), n([o.Watch("chosen")], _.prototype, "onChosenChanged", null), n([o.Watch("taskBase")], _.prototype, "onTaskBaseChanged", null), n([o.Watch("enbaleVipPlugin")], _.prototype, "onEnableVipPlugin", null), n([o.Watch("isFailed")], _.prototype, "onTaskFailedChange", null), n([o.Watch("currentCategoryViewId")], _.prototype, "onOptionsChanged", null), n([o.Watch("sharedKeyWords", {immediate: !0})], _.prototype, "onKeyWordsChange", null), n([o.Watch("pulseForRename", {immediate: !0})], _.prototype, "onRenamePulse", null), n([o.Watch("active")], _.prototype, "onActiveChanged", null), n([o.Watch("taskId", {immediate: !0})], _.prototype, "onTaskIdChanged", null), _ = n([o.Component({
        components: {ItemVipSpeedPlugin: () => Promise.resolve().then(() => i(669))},
        watch: {}
    })], _), t.default = _
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(243), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(8), r = i(20), s = i(3), l = i(14);
    let d = class extends o.Vue {
        onHoverChanged(e, t) {
            return a(this, void 0, void 0, function* () {
                r.server.fireClientEvent("on_task_item_hover", e, this.taskId, this.vipSpeedInfo, "hover")
            })
        }

        clickVipLink() {
            return a(this, void 0, void 0, function* () {
                r.server.fireClientEvent("on_vip_link_click", this.taskId, this.vipSpeedInfo, "hover")
            })
        }

        get taskId() {
            let e = void 0;
            return this.taskBase && (e = this.taskBase.taskId), e
        }

        get taskStatus() {
            return this.taskBase.taskStatus
        }

        get isShowVipSpeed() {
            let e = !1;
            do {
                if (this.taskStatus !== s.DownloadKernel.TaskStatus.Started) break;
                if (this.startStatusPrompt) break;
                if (!this.vipSpeedInfo) break;
                if (!this.vipSpeedInfo.isShowVipSpeed) break;
                e = this.vipSpeedInfo.isShowVipSpeed
            } while (0);
            return e
        }

        get isShowSuperSpeed() {
            let e = !0;
            do {
                if (!this.vipSpeedInfo) break;
                if (void 0 === this.vipSpeedInfo.isShowSuperSpeed) break;
                e = this.vipSpeedInfo.isShowSuperSpeed
            } while (0);
            return e
        }

        get vipSpeed() {
            return "+" + l.ThunderUtil.formatSizeCustom(this.taskBase.vipSpeed, 1, 4) + "/s"
        }

        get isShowVipHover() {
            let e = !1;
            do {
                if (!this.isHover) break;
                this.vipSpeedInfo && this.vipSpeedInfo.isShowVipHover && (e = this.vipSpeedInfo.isShowVipHover)
            } while (0);
            return e
        }

        get isShowSuperHover() {
            let e = !1;
            do {
                if (!this.isHover) break;
                this.vipSpeedInfo && this.vipSpeedInfo.isShowSuperHover && (e = this.vipSpeedInfo.isShowSuperHover)
            } while (0);
            return e
        }

        get hoverText() {
            let e = "";
            do {
                if (!this.isHover) break;
                if (this.vipSpeedInfo && this.vipSpeedInfo.hoverText) {
                    e = this.vipSpeedInfo.hoverText;
                    break
                }
            } while (0);
            return e
        }

        get isHover() {
            let e = !1;
            do {
                if (this.active) break;
                if (!this.hover) break;
                e = !0
            } while (0);
            return e
        }
    };
    n([o.Prop({})], d.prototype, "vipSpeedInfo", void 0), n([o.Prop({})], d.prototype, "taskBase", void 0), n([o.Prop({})], d.prototype, "startStatusPrompt", void 0), n([o.Prop({})], d.prototype, "active", void 0), n([o.Prop({})], d.prototype, "hover", void 0), n([o.Watch("isHover")], d.prototype, "onHoverChanged", null), d = n([o.Component({components: {}})], d), t.default = d
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(245), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(671), a = i(33), o = i(3), r = i(29).DownloadKernelCategoryManager.getCategoryManager();
    t.default = a.connector.connect({
        mapStateToProps: {
            taskBase: (e, t) => {
                let i = null, n = t.taskId, a = t.currentCategoryId;
                if (-1 === a) {
                    for (let t = 0; t < e.DownloadListState.taskList.length; t++) if (e.DownloadListState.taskList[t].id === o.DownloadKernel.CategroyViewID.Completed) {
                        i = e.DownloadListState.taskList[t].tasksMap[n];
                        break
                    }
                } else if (r.isPrivateCategory(a)) for (let t = 0; t < e.DownloadListState.taskListPrivate.length; t++) e.DownloadListState.taskListPrivate[t].id === o.DownloadKernel.CategroyViewID.Completed && (i = e.DownloadListState.taskListPrivate[t].tasksMap[n]);
                return i
            }
        }
    })(n.default)
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(247), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(2), r = i(53), s = i(8), l = i(0), d = i(3), u = i(11), c = i(62), h = i(14), f = i(47), g = i(41),
        p = i(36), v = i(13), m = i(9), y = i(127), k = i(27), T = i(22), w = i(37), C = i(51), S = i(5), b = i(45),
        I = i(15), _ = i(25), A = l.default.getLogger("Thunder.Download.Completed"),
        D = u.DownloadKernelTaskManager.getTaskManager(), x = I.DownloadKernelEventManager.getEventManager();
    let N = class extends s.Vue {
        constructor() {
            super(...arguments), this.btSubDetailCookie = -1, this.groupTaskSubFileDetailChangedCookie = -1, this.p2spTaskDetailChangedCookie = -1, this.titleOverFlow = "", this.lastFullFileName = void 0, this.fileTypeClass = "", this.isInstallFileIcon = !1, this.installFileIcon = "", this.highLight = "", this.fileNameDefaultCursor = "cursor:default", this.playProgress = 0, this.taskExtraLoaded = !1, this.isShowShouleiFileTransfer = !1, this.enableShouleiFileTransfer = !1
        }

        onChosenChanged(e) {
            k.default.fireEvent(v.NodeEventMesssageNS.eventDownloadItemChosen, d.DownloadKernel.CategroyViewID.Completed, this.taskBase.taskId, e, this.active)
        }

        onActiveChanged(e, t) {
            "search" !== this.itemType && k.default.fireEvent(v.NodeEventMesssageNS.eventDownloadItemActive, d.DownloadKernel.CategroyViewID.Completed, e, this.taskBase.taskId, this.$el), this.$emit("active-change", e)
        }

        onOptionsChanged(e, t) {
            this.active && k.default.fireEvent(v.NodeEventMesssageNS.eventDownloadItemActive, d.DownloadKernel.CategroyViewID.Completed, e === d.DownloadKernel.CategroyViewID.Completed, this.taskBase.taskId, this.$el), this.chosen && k.default.fireEvent(v.NodeEventMesssageNS.eventDownloadItemChosen, d.DownloadKernel.CategroyViewID.Completed, this.taskBase.taskId, e === d.DownloadKernel.CategroyViewID.Completed, this.active)
        }

        onFullFileNameChange(e, t) {
            return a(this, void 0, void 0, function* () {
                void 0 !== t && r.unwatchFile(t, this.handleWatchFile), this.handleWatchFile().catch(), e && r.watchFile(e, this.handleWatchFile), this.fileTypeClass = yield this.getFileTypeClass().catch()
            })
        }

        onOpenedChange(e) {
            this.$emit("update:opened", e)
        }

        onKeyWordsChange(e, t) {
            this.highLight = h.ThunderUtil.keywordsHighLight(this.taskBase.taskName, e, null)
        }

        onRenamePulse(e, t) {
            this.highLight = h.ThunderUtil.keywordsHighLight(this.taskBase.taskName, this.sharedKeyWords, null)
        }

        get showShouleiFileTransferIcon() {
            return !(this.currentCategoryViewId !== d.DownloadKernel.CategroyViewID.Completed || this.deleted || !this.enableShouleiFileTransfer || !this.fileTransferTooltip && !this.isShowShouleiFileTransfer || this.taskBase.taskType === d.DownloadKernel.TaskType.Group)
        }

        onShouleiFileTransferIconShow(e) {
            e && m.XLStatNS.trackEvent("download_leftpanel", "send_file_to_shoulei_entry_icon_show")
        }

        get canPlay() {
            let e = !1;
            do {
                if (this.deleted) break;
                if (this.taskBase.isMoving) break;
                if (!this.taskExtraLoaded) break;
                let t = D.getTaskFromTaskId(this.taskBase.taskId);
                t && (e = t.isSupportPlay())
            } while (0);
            return e
        }

        get opened() {
            return 1 === this.taskBase.userRead
        }

        get markTitle() {
            let e = "标记为未打开";
            return e = this.opened ? "标记为未打开" : "标记为已打开"
        }

        get fullFileName() {
            let e = this.taskBase.savePath, t = this.taskBase.taskName;
            void 0 !== t && t.indexOf(".") === t.length - 1 && (t = t.substring(0, t.length - 1));
            let i = "";
            return i = this.taskBase.taskType === d.DownloadKernel.TaskType.Group ? e : o.join(e, t)
        }

        handleWatchFile(e, t) {
            return a(this, void 0, void 0, function* () {
                void 0 !== e && void 0 !== t && A.information("fs watchFile", e.mtime, t.mtime, this.fullFileName), (yield g.TaskCtrlOperatorNS.isExistTaskFile(this.taskBase)) ? this.$emit("update:deleted", !1) : this.$emit("update:deleted", !0)
            })
        }

        updateBtTaskPlayProgress(e) {
            let t = e.getExtraObject(), i = [];
            t.getDownloadFile().forEach(e => {
                let n = t.getBtFileByRealIndex(e);
                if (n.isSupportPlay()) {
                    let e = 0, t = n.getBtFileAttribute(d.DownloadKernel.BtFileAttribute.Duration),
                        a = n.getBtFileAttribute(d.DownloadKernel.BtFileAttribute.PlayPosition);
                    t && (e = a / t), A.information("play progress bt", n.getBtFileAttribute(d.DownloadKernel.BtFileAttribute.FileName), a, t), i.push(e)
                }
            }), i.length && (this.playProgress = i.reduce(function (e, t, i, n) {
                return e + t
            }) / i.length, A.information("play progress bt2", this.playProgress, i))
        }

        updateGroupTaskPlayProgress(e) {
            let t = e.getExtraObject(), i = t.getDownloadTaskCount(), n = [];
            for (let e = 0; e < i; ++e) {
                let i = t.getSubTaskByIndex(e);
                if (i && i.isSupportPlay()) {
                    let e = 0, t = i.getTaskAttribute(d.DownloadKernel.TaskAttribute.Duration),
                        a = i.getTaskAttribute(d.DownloadKernel.TaskAttribute.PlayPosition);
                    t && (e = a / t), n.push(e)
                }
            }
            n.length && (this.playProgress = n.reduce(function (e, t, i, n) {
                return e + t
            }) / n.length)
        }

        updateP2spTaskPlayProgress(e) {
            if (e.isSupportPlay()) {
                let t = e.getTaskAttribute(d.DownloadKernel.TaskAttribute.Duration),
                    i = e.getTaskAttribute(d.DownloadKernel.TaskAttribute.PlayPosition);
                t && (this.playProgress = i / t)
            }
        }

        onBtSubFileDetailChanged(...e) {
            do {
                if (!e) break;
                if (e[0] !== d.DownloadKernel.TaskEventType.BtSubFileDetailChanged) break;
                if (!e[1] || !e[2]) break;
                if (e[1] === this.taskBase.taskId) {
                    let e = D.getTaskFromTaskId(this.taskBase.taskId);
                    this.updateBtTaskPlayProgress(e)
                }
            } while (0)
        }

        onGroupTaskStatusChanged(...e) {
            do {
                if (!e) break;
                if (e[0] !== d.DownloadKernel.TaskEventType.StatusChanged) break;
                if (!e[1]) break;
                let t = e[1];
                if (t[0].getTaskAttribute(d.DownloadKernel.TaskAttribute.CategoryId) !== this.currentCategoryId) break;
                for (let e = 0; e < t.length; e++) {
                    let i = t[e];
                    if (i.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskId) === this.taskId) {
                        this.updateGroupTaskPlayProgress(i);
                        break
                    }
                }
            } while (0)
        }

        onGroupTaskSubFileDetailChanged(...e) {
            do {
                if (!e) break;
                if (e[0] !== d.DownloadKernel.TaskEventType.GroupTaskSubFileDetailChanged) break;
                if (!e[1]) break;
                e[1].forEach((e, t) => {
                    if (t === this.taskId) {
                        let e = D.getTaskFromTaskId(t);
                        e && this.updateGroupTaskPlayProgress(e)
                    }
                })
            } while (0)
        }

        onP2spTaskDetailChanged(...e) {
            do {
                if (!e) break;
                if (e[0] !== d.DownloadKernel.TaskEventType.DetailChanged) break;
                if (!e[1]) break;
                let t = e[2];
                if (t & d.DownloadKernel.TaskDetailChangedFlags.PlayPosition || t & d.DownloadKernel.TaskDetailChangedFlags.Duration) {
                    let t = e[1];
                    for (let e = 0; e < t.length; ++e) {
                        let i = t[e];
                        if (i && i.getId() === this.taskId) {
                            this.updateP2spTaskPlayProgress(i);
                            break
                        }
                    }
                }
            } while (0)
        }

        initialize() {
            return a(this, void 0, void 0, function* () {
                let e = D.getTaskFromTaskId(this.taskBase.taskId);
                this.taskBase.taskType === d.DownloadKernel.TaskType.Bt ? (this.btSubDetailCookie = x.attachTaskEvent(d.DownloadKernel.TaskEventType.BtSubFileDetailChanged, this.onBtSubFileDetailChanged), this.updateBtTaskPlayProgress(e)) : this.taskBase.taskType === d.DownloadKernel.TaskType.Group ? (this.groupTaskSubFileDetailChangedCookie = x.attachTaskEvent(d.DownloadKernel.TaskEventType.GroupTaskSubFileDetailChanged, this.onGroupTaskSubFileDetailChanged), this.updateGroupTaskPlayProgress(e)) : (this.p2spTaskDetailChangedCookie = x.attachTaskEvent(d.DownloadKernel.TaskEventType.DetailChanged, this.onP2spTaskDetailChanged), this.updateP2spTaskPlayProgress(e))
            })
        }

        unInitialize() {
            return a(this, void 0, void 0, function* () {
                -1 !== this.btSubDetailCookie && (x.detachTaskEvent(d.DownloadKernel.TaskEventType.BtSubFileDetailChanged, this.btSubDetailCookie), this.btSubDetailCookie = -1), -1 !== this.groupTaskSubFileDetailChangedCookie && (x.detachTaskEvent(d.DownloadKernel.TaskEventType.GroupTaskSubFileDetailChanged, this.groupTaskSubFileDetailChangedCookie), this.groupTaskSubFileDetailChangedCookie = -1), -1 !== this.p2spTaskDetailChangedCookie && (x.detachTaskEvent(d.DownloadKernel.TaskEventType.DetailChanged, this.p2spTaskDetailChangedCookie), this.p2spTaskDetailChangedCookie = -1)
            })
        }

        created() {
            if (this.isBt) {
                if (D.getTaskFromTaskId(this.taskBase.taskId).getExtraObject().isBtFileLoadEnd()) this.taskExtraLoaded = !0; else {
                    let e = void 0, t = () => {
                        this.taskExtraLoaded = !0, this.$nextTick(() => {
                            this.handleWatchFile()
                        }), x.detachTaskEvent(d.DownloadKernel.TaskEventType.BtSubFileLoaded, e), e = void 0
                    };
                    e = x.attachTaskEvent(d.DownloadKernel.TaskEventType.BtSubFileLoaded, t)
                }
            } else this.taskExtraLoaded = !0;
            this.initialize(), _.default.isInitedAw().then(() => {
                this.enableShouleiFileTransfer = 0 !== _.default.getConfigInfo("shouleiDownload", "enableTransfer")
            }).catch()
        }

        destroyed() {
            this.unInitialize(), A.information("item destroyed"), r.unwatchFile(this.fullFileName, this.handleWatchFile), "search" !== this.itemType && (this.active && (k.default.fireEvent(v.NodeEventMesssageNS.eventDownloadItemActive, d.DownloadKernel.CategroyViewID.Completed, !1, this.taskBase.taskId, this.$el), k.default.getNeedSelectNext() && (k.default.setNeedSelectNext(!1), this.$emit("active-nearby", this.index))), this.chosen && k.default.fireEvent(v.NodeEventMesssageNS.eventDownloadItemChosen, d.DownloadKernel.CategroyViewID.Completed, this.taskBase.taskId, !1, !1))
        }

        get isExe() {
            let e = !1;
            do {
                if (this.taskBase.taskType !== d.DownloadKernel.TaskType.Emule && this.taskBase.taskType !== d.DownloadKernel.TaskType.P2sp) break;
                let t = o.extname(this.taskBase.taskName);
                if (null === t || void 0 === t) break;
                if (".exe" === t.toLowerCase()) {
                    e = !0;
                    break
                }
            } while (0);
            return e
        }

        getFileTypeClass() {
            return a(this, void 0, void 0, function* () {
                let e = "xly-icon-type";
                if (e = e + " " + f.TaskUtilHelper.getTaskIcon(this.taskBase.taskName, this.taskBase.taskType), this.isGroup) {
                    let t = D.getTaskFromTaskId(this.taskBase.taskId), i = this.getInstallFileName(t);
                    if (null !== i && void 0 !== i && "" !== i) {
                        let t = g.TaskCtrlOperatorNS.getSavePathByFileName(this.taskBase.taskId, i);
                        if (null !== t && void 0 !== t && "" !== t) {
                            if (yield S.FileSystemAWNS.existsAW(t)) {
                                let i = yield p.TaskOperatorNs.getFileIcon(t).catch();
                                null !== i && void 0 !== i && "" !== i && (this.isInstallFileIcon = !0, this.installFileIcon = i, e = "xly-icon-type")
                            }
                        }
                    }
                } else if (this.isExe && (yield S.FileSystemAWNS.existsAW(this.fullFileName))) {
                    let t = yield p.TaskOperatorNs.getFileIcon(this.fullFileName).catch();
                    null !== t && void 0 !== t && "" !== t && (this.isInstallFileIcon = !0, this.installFileIcon = t, e = "xly-icon-type")
                }
                return e
            })
        }

        get taskName() {
            return "search" !== this.itemType ? this.taskBase.taskName : this.highLight
        }

        get fileSizeFormat() {
            return h.ThunderUtil.formatSize(this.taskBase.fileSize)
        }

        get completeTime() {
            let e = "", t = this.taskBase.completionTime;
            if (t > 0) {
                let i = new Date(t);
                e = c.TimeHelperNS.formatDate(i, "yyyy-MM-dd hh:mm")
            }
            return e
        }

        get isGroup() {
            let e = !1;
            return this.taskBase.taskType === d.DownloadKernel.TaskType.Group && (e = !0), e
        }

        get isBt() {
            let e = !1;
            return this.taskBase.taskType === d.DownloadKernel.TaskType.Bt && (e = !0), e
        }

        get bTaskCountShow() {
            let e = !1;
            return (this.isBt || this.isGroup) && (this.active || this.chosen) && (e = !0), e
        }

        get playProgressStyle() {
            return this.playCompleted ? "width: 0%;" : "width: " + 100 * this.playProgress + "%;"
        }

        get playCompleted() {
            return 1 === this.playProgress
        }

        get subTaskCount() {
            let e = "0个文件", t = 0;
            if (this.isBt) {
                t = D.getTaskFromTaskId(this.taskBase.taskId).getExtraObject().getDownloadFile().length
            } else if (this.isGroup) {
                t = D.getTaskFromTaskId(this.taskBase.taskId).getExtraObject().getDownloadTaskCount()
            }
            return e = t < 1e3 ? t + "个文件" : "999+文件"
        }

        getInstallFileName(e) {
            let t = "";
            do {
                if (e.getTaskAttribute(d.DownloadKernel.TaskAttribute.TaskType) !== d.DownloadKernel.TaskType.Group) break;
                let i = e.getExtraObject().getUserData(C.TaskUserDataGUID.guidDownloadCompleteInstall, "installFile");
                if (void 0 === i || null === i || "" === i || "0" === i) break;
                t = i
            } while (0);
            return t
        }

        handleMark() {
            this.opened ? (m.XLStatNS.trackEvent("download_leftpanel", "finished_left_markcancel_click", "", 0, 0, 0, 0, this.statExtData()), p.TaskOperatorNs.markReadStatus([this.taskBase], 0)) : (m.XLStatNS.trackEvent("download_leftpanel", "finished_left_mark_click", "", 0, 0, 0, 0, this.statExtData()), p.TaskOperatorNs.markReadStatus([this.taskBase], 1))
        }

        handleTaskNameMouseOver(e) {
            let t = e.target, i = t.scrollHeight, n = t.offsetHeight;
            this.titleOverFlow = i > n ? this.taskName : ""
        }

        statExtData() {
            let e = "panel_type=mypc";
            return -1 !== this.currentCategoryId && (e = "panel_type=private"), e
        }

        handleFileTransferIconClick() {
            m.XLStatNS.trackEvent("download_leftpanel", "send_file_to_shoulei_entry_icon_click"), g.TaskCtrlOperatorNS.shouleiFileTransfer(this.taskBase).catch()
        }

        handleFileTransferTooltipClose() {
            this.fileTransferTooltip && this.$emit("update:fileTransferTooltip", !1)
        }

        handlePlayTask() {
            let e = this.statExtData();
            e = `${e},panel=finished,click_source=play`, m.XLStatNS.trackEvent("download_leftpanel", "play_click", "", 0, 0, 0, 0, e), D.getTaskFromTaskId(this.taskBase.taskId) && (p.TaskOperatorNs.downloadAndPlay(this.taskBase.taskId, -1, "play", "finished", this.currentCategoryId, !1, 0, !this.playCompleted).catch(), p.TaskOperatorNs.markReadStatus([this.taskBase], 1))
        }

        handleOpenFile() {
            m.XLStatNS.trackEvent("download_leftpanel", "finished_right_openfiles_click", "", 0, 0, 0, 0, this.statExtData()), p.TaskOperatorNs.markReadStatus([this.taskBase], 1), p.TaskOperatorNs.openTaskFolder(this.taskBase)
        }

        handleDestroyTask() {
            m.XLStatNS.trackEvent("download_leftpanel", "finished_right_delete_click", "", 0, 0, 0, 0, this.statExtData()), p.TaskOperatorNs.destroyTasks([this.taskBase], !1)
        }

        handleDbClick() {
            p.TaskOperatorNs.markReadStatus([this.taskBase], 1);
            do {
                if (this.deleted) {
                    T.MessageBox.confirm({
                        title: "此文件已经被删除，是否需要重新下载？",
                        type: T.MessageBox.ConfirmType.Warning,
                        okText: "重新下载",
                        cancelText: "删除任务"
                    }).then(e => {
                        e.action === w.MessageBoxNS.Action.OK ? g.TaskCtrlOperatorNS.redownloadTask([this.taskBase], !1) : e.action === w.MessageBoxNS.Action.Cancel && p.TaskOperatorNs.destroyTasks([this.taskBase], !1)
                    });
                    break
                }
                if (this.taskBase.taskType === d.DownloadKernel.TaskType.Bt) {
                    let e = D.getTaskFromTaskId(this.taskBase.taskId);
                    b.SingleBtTaskNS.isSingleBtTask(e).then(e => {
                        e ? p.TaskOperatorNs.openTaskItem(this.taskBase) : p.TaskOperatorNs.openTaskFolder(this.taskBase, !0)
                    }).catch()
                } else if (this.taskBase.taskType === d.DownloadKernel.TaskType.Group) {
                    let e = D.getTaskFromTaskId(this.taskBase.taskId);
                    p.TaskOperatorNs.executeInstallFile(e).then(e => {
                        e || p.TaskOperatorNs.openTaskFolder(this.taskBase, !0)
                    }).catch()
                } else if (this.canPlay) {
                    let e = "double_click", t = this.statExtData();
                    t = `${t},panel=finished,click_source=${e}`, m.XLStatNS.trackEvent("download_leftpanel", "play_click", "", 0, 0, 0, 0, t), D.getTaskFromTaskId(this.taskBase.taskId) && p.TaskOperatorNs.downloadAndPlay(this.taskBase.taskId, -1, e, "finished", this.currentCategoryId).catch()
                } else p.TaskOperatorNs.openTaskItem(this.taskBase)
            } while (0)
        }

        handleFileCountClick() {
            this.active ? k.default.fireEvent(v.NodeEventMesssageNS.eventDetailSwitch2Index, this.taskBase.taskId, y.DetailIndex.FileList) : k.default.fireEvent(v.NodeEventMesssageNS.eventDownloadItemActive, d.DownloadKernel.CategroyViewID.Completed, !0, this.taskBase.taskId, this.$el, void 0, y.DetailIndex.FileList)
        }
    };
    n([s.Prop({})], N.prototype, "fileTransferTooltip", void 0), n([s.Prop({})], N.prototype, "pulseForRename", void 0), n([s.Prop({})], N.prototype, "sharedKeyWords", void 0), n([s.Prop({})], N.prototype, "itemType", void 0), n([s.Prop({})], N.prototype, "index", void 0), n([s.Prop({})], N.prototype, "taskId", void 0), n([s.Prop({})], N.prototype, "taskBase", void 0), n([s.Prop({})], N.prototype, "currentCategoryId", void 0), n([s.Prop({})], N.prototype, "currentCategoryViewId", void 0), n([s.Prop()], N.prototype, "deleted", void 0), n([s.Prop()], N.prototype, "chosen", void 0), n([s.Prop()], N.prototype, "active", void 0), n([s.Watch("chosen")], N.prototype, "onChosenChanged", null), n([s.Watch("active")], N.prototype, "onActiveChanged", null), n([s.Watch("currentCategoryViewId")], N.prototype, "onOptionsChanged", null), n([s.Watch("fullFileName", {immediate: !0})], N.prototype, "onFullFileNameChange", null), n([s.Watch("opened", {immediate: !0})], N.prototype, "onOpenedChange", null), n([s.Watch("sharedKeyWords", {immediate: !0})], N.prototype, "onKeyWordsChange", null), n([s.Watch("pulseForRename", {immediate: !0})], N.prototype, "onRenamePulse", null), n([s.Watch("showShouleiFileTransferIcon", {immediate: !0})], N.prototype, "onShouleiFileTransferIconShow", null), N = n([s.Component], N), t.default = N
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(249), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(673), a = i(33), o = i(3);
    t.default = a.connector.connect({
        mapStateToProps: {
            taskBase: (e, t) => {
                let i = null, n = t.taskId;
                if (-1 === t.currentCategoryId) for (let t = 0; t < e.DownloadListState.taskList.length; t++) if (e.DownloadListState.taskList[t].id === o.DownloadKernel.CategroyViewID.Recycle) {
                    i = e.DownloadListState.taskList[t].tasksMap[n];
                    break
                }
                return i
            }
        }
    })(n.default)
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(251), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(2), r = i(53), s = i(8), l = i(3), d = i(11), u = i(62), c = i(14), h = i(47), f = i(41), g = i(36),
        p = i(13), v = i(27), m = i(9), y = i(22), k = i(37), T = i(5), w = i(45),
        C = d.DownloadKernelTaskManager.getTaskManager();
    let S = class extends s.Vue {
        constructor() {
            super(...arguments), this.titleOverFlow = "", this.bAttachFile = !1, this.highLight = "", this.fileNameDefaultCursor = "cursor:default", this.fileIcon = "", this.isFileIcon = !1, this.fileTypeClass = ""
        }

        onOptionsChanged(e, t) {
            this.active && v.default.fireEvent(p.NodeEventMesssageNS.eventDownloadItemActive, l.DownloadKernel.CategroyViewID.Recycle, e === l.DownloadKernel.CategroyViewID.Recycle, this.taskBase.taskId, this.$el), this.chosen && v.default.fireEvent(p.NodeEventMesssageNS.eventDownloadItemChosen, l.DownloadKernel.CategroyViewID.Recycle, this.taskBase.taskId, e === l.DownloadKernel.CategroyViewID.Recycle, this.active)
        }

        onChosenChanged(e) {
            v.default.fireEvent(p.NodeEventMesssageNS.eventDownloadItemChosen, l.DownloadKernel.CategroyViewID.Recycle, this.taskBase.taskId, e, this.active)
        }

        onActiveChanged(e, t) {
            "search" !== this.itemType && v.default.fireEvent(p.NodeEventMesssageNS.eventDownloadItemActive, l.DownloadKernel.CategroyViewID.Recycle, e, this.taskBase.taskId, this.$el), this.$emit("active-change", e)
        }

        onTaskIdChanged(e, t) {
            this.taskBase.taskStatus !== l.DownloadKernel.TaskStatus.Succeeded && this.taskBase.taskStatus !== l.DownloadKernel.TaskStatus.Seeding || (this.bAttachFile = !0, this.handleWatchFile(), r.watchFile(this.fullFileName, this.handleWatchFile))
        }

        onKeyWordsChange(e, t) {
            this.highLight = c.ThunderUtil.keywordsHighLight(this.taskBase.taskName, e, null)
        }

        onRenamePulse(e, t) {
            this.highLight = c.ThunderUtil.keywordsHighLight(this.taskBase.taskName, this.sharedKeyWords, null)
        }

        onFullFileNameChange(e, t) {
            return a(this, void 0, void 0, function* () {
                this.fileTypeClass = yield this.getFileTypeClass().catch()
            })
        }

        get fullFileName() {
            let e = this.taskBase.savePath, t = this.taskBase.taskName;
            void 0 !== t && t.indexOf(".") === t.length - 1 && (t = t.substring(0, t.length - 1));
            let i = "";
            return i = this.taskBase.taskType === l.DownloadKernel.TaskType.Group ? e : o.join(e, t)
        }

        get isExe() {
            let e = !1;
            do {
                if (this.taskBase.taskStatus !== l.DownloadKernel.TaskStatus.Succeeded && this.taskBase.taskStatus !== l.DownloadKernel.TaskStatus.Seeding) break;
                if (this.taskBase.taskType !== l.DownloadKernel.TaskType.Emule && this.taskBase.taskType !== l.DownloadKernel.TaskType.P2sp) break;
                let t = o.extname(this.taskBase.taskName);
                if (null === t || void 0 === t) break;
                if (".exe" === t.toLowerCase()) {
                    e = !0;
                    break
                }
            } while (0);
            return e
        }

        getFileTypeClass() {
            return a(this, void 0, void 0, function* () {
                let e = "";
                if (this.isExe) {
                    if (yield T.FileSystemAWNS.existsAW(this.fullFileName)) {
                        let e = yield g.TaskOperatorNs.getFileIcon(this.fullFileName).catch();
                        e && "" !== e && (this.isFileIcon = !0, this.fileIcon = e)
                    }
                } else e = h.TaskUtilHelper.getTaskIcon(this.taskBase.taskName, this.taskBase.taskType);
                return e
            })
        }

        get taskName() {
            return "search" !== this.itemType ? this.taskBase.taskName : this.highLight
        }

        get fileSizeFormat() {
            return c.ThunderUtil.formatSize(this.taskBase.fileSize)
        }

        get creationTime() {
            let e = "", t = this.taskBase.createTime;
            if (t > 0) {
                let i = new Date(t);
                e = u.TimeHelperNS.formatDate(i, "yyyy-MM-dd hh:mm")
            }
            return e
        }

        get canPlay() {
            let e = !1, t = C.getTaskFromTaskId(this.taskBase.taskId);
            return t && (e = t.isSupportPlay()), e
        }

        get isSingleTask() {
            let e = !0;
            if (this.taskBase.taskType === l.DownloadKernel.TaskType.Bt) {
                C.getTaskFromTaskId(this.taskBase.taskId).getExtraObject().getDownloadFile().length > 1 && (e = !1)
            }
            return e
        }

        handleWatchFile() {
            return a(this, void 0, void 0, function* () {
                (yield f.TaskCtrlOperatorNS.isExistTaskFile(this.taskBase)) ? this.$emit("update:deleted", !1) : this.$emit("update:deleted", !0)
            })
        }

        handleTaskNameMouseOver(e) {
            let t = e.target, i = t.scrollHeight, n = t.offsetHeight;
            this.titleOverFlow = i > n ? this.taskName : ""
        }

        statExtData() {
            let e = "panel_type=mypc";
            return -1 !== this.currentCategoryId && (e = "panel_type=private"), e
        }

        handleRestore() {
            m.XLStatNS.trackEvent("download_leftpanel", "dustbin_right_uno_click", "", 0, 0, 0, 0, this.statExtData()), C.recoverFromRecycle(this.taskBase.taskId)
        }

        handleClear() {
            m.XLStatNS.trackEvent("download_leftpanel", "dustbin_right_completedelete_click", "", 0, 0, 0, 0, this.statExtData()), g.TaskOperatorNs.destroyTasks([this.taskBase])
        }

        handleDbClick() {
            return a(this, void 0, void 0, function* () {
                do {
                    if (this.taskBase.taskStatus === l.DownloadKernel.TaskStatus.Succeeded || this.taskBase.taskStatus === l.DownloadKernel.TaskStatus.Seeding) {
                        if (!(yield f.TaskCtrlOperatorNS.canOpenSelectedTaskFile(this.taskBase))) {
                            y.MessageBox.confirm({
                                title: "此文件已经被删除，是否需要重新下载？",
                                type: y.MessageBox.ConfirmType.Warning,
                                okText: "重新下载",
                                cancelText: "删除任务"
                            }).then(e => {
                                e.action === k.MessageBoxNS.Action.OK ? f.TaskCtrlOperatorNS.redownloadTask([this.taskBase], !1) : e.action === k.MessageBoxNS.Action.Cancel && g.TaskOperatorNs.destroyTasks([this.taskBase], !1)
                            });
                            break
                        }
                        if (this.taskBase.taskType === l.DownloadKernel.TaskType.Bt) {
                            let e = C.getTaskFromTaskId(this.taskBase.taskId);
                            w.SingleBtTaskNS.isSingleBtTask(e).then(e => {
                                e ? g.TaskOperatorNs.openTaskItem(this.taskBase) : g.TaskOperatorNs.openTaskFolder(this.taskBase, !0)
                            }).catch()
                        } else if (this.taskBase.taskType === l.DownloadKernel.TaskType.Group) g.TaskOperatorNs.openTaskFolder(this.taskBase, !0); else if (this.canPlay && this.isSingleTask) {
                            let e = "double_click", t = "panel=dustbin,click_source=" + e;
                            m.XLStatNS.trackEvent("download_leftpanel", "play_click", "", 0, 0, 0, 0, t), C.getTaskFromTaskId(this.taskBase.taskId) && g.TaskOperatorNs.downloadAndPlay(this.taskBase.taskId, -1, e, "dustbin", this.currentCategoryId).catch()
                        } else g.TaskOperatorNs.openTaskItem(this.taskBase)
                    }
                } while (0)
            })
        }

        destroyed() {
            this.bAttachFile && (this.bAttachFile = !1, r.unwatchFile(this.fullFileName, this.handleWatchFile)), "search" !== this.itemType && (this.active && (v.default.fireEvent(p.NodeEventMesssageNS.eventDownloadItemActive, l.DownloadKernel.CategroyViewID.Recycle, !1, this.taskBase.taskId, this.$el), v.default.getNeedSelectNext() && (v.default.setNeedSelectNext(!1), this.$emit("active-nearby", this.index))), this.chosen && v.default.fireEvent(p.NodeEventMesssageNS.eventDownloadItemChosen, l.DownloadKernel.CategroyViewID.Recycle, this.taskBase.taskId, !1, !1))
        }
    };
    n([s.Prop({})], S.prototype, "pulseForRename", void 0), n([s.Prop({})], S.prototype, "sharedKeyWords", void 0), n([s.Prop({})], S.prototype, "itemType", void 0), n([s.Prop({})], S.prototype, "index", void 0), n([s.Prop({})], S.prototype, "taskId", void 0), n([s.Prop({})], S.prototype, "taskBase", void 0), n([s.Prop({})], S.prototype, "currentCategoryId", void 0), n([s.Prop({})], S.prototype, "currentCategoryViewId", void 0), n([s.Prop()], S.prototype, "active", void 0), n([s.Prop()], S.prototype, "chosen", void 0), n([s.Prop()], S.prototype, "deleted", void 0), n([s.Watch("currentCategoryViewId")], S.prototype, "onOptionsChanged", null), n([s.Watch("chosen")], S.prototype, "onChosenChanged", null), n([s.Watch("active")], S.prototype, "onActiveChanged", null), n([s.Watch("taskId", {immediate: !0})], S.prototype, "onTaskIdChanged", null), n([s.Watch("sharedKeyWords", {immediate: !0})], S.prototype, "onKeyWordsChange", null), n([s.Watch("pulseForRename", {immediate: !0})], S.prototype, "onRenamePulse", null), n([s.Watch("fullFileName", {immediate: !0})], S.prototype, "onFullFileNameChange", null), S = n([s.Component], S), t.default = S
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(253), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(676), a = i(33);
    t.default = a.connector.connect({
        mapStateToProps: {showPrivateSpaceOpenPage: e => e.PrivateSpaceState.showPrivateSpaceOpenPage},
        mapCommitToProps: {
            SHOW_PRIVATE_SPACE_OPEN_PAGE: "SHOW_PRIVATE_SPACE_OPEN_PAGE",
            UPDATE_CATEGORYVIEW: "UPDATE_CATEGORYVIEW"
        },
        mapDispatchToProps: {},
        mapGettersToProps: {}
    })(n.default)
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(255), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(8), r = i(76), s = i(7), l = i(9);
    let d = class extends o.Vue {
        constructor() {
            super(...arguments), this.privateSpaceSetPasswordListener = null
        }

        stat(e) {
            let t = `button=${e}`;
            l.XLStatNS.trackEvent("download_leftpanel", "top_private_page_click", "", 0, 0, 0, 0, t)
        }

        openPrivateSpace() {
            return a(this, void 0, void 0, function* () {
                let e = yield s.client.callServerFunction("GetUserID");
                if (e && "" !== e) {
                    this.stat("open"), 0 === (yield r.PrivateSpaceHelperNS.phoneVerifyPrivateCategory(e)) && r.PrivateSpaceHelperNS.openPrivateCategory(e)
                }
            })
        }

        created() {
            let e = r.PrivateSpaceHelperNS.getEventEmitter();
            this.privateSpaceSetPasswordListener || (this.privateSpaceSetPasswordListener = (e => {
                e && this.SHOW_PRIVATE_SPACE_OPEN_PAGE(!1)
            }), e.on(r.PrivateSpaceHelperNS.EventType.SetPassword, this.privateSpaceSetPasswordListener))
        }

        destroyed() {
            if (this.privateSpaceSetPasswordListener) {
                r.PrivateSpaceHelperNS.getEventEmitter().removeListener(r.PrivateSpaceHelperNS.EventType.SetPassword, this.privateSpaceSetPasswordListener), this.privateSpaceSetPasswordListener = null
            }
        }
    };
    n([o.Prop({})], d.prototype, "SHOW_PRIVATE_SPACE_OPEN_PAGE", void 0), n([o.Prop({})], d.prototype, "UPDATE_CATEGORYVIEW", void 0), d = n([o.Component], d), t.default = d
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(257), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(678), a = i(33);
    t.default = a.connector.connect({
        mapStateToProps: {
            currentCategoryId: e => e.DownloadListState.currentCategoryId,
            currentCategoryViewId: e => e.DownloadListState.currentCategoryViewId,
            currentTabId: e => e.Tabs.current
        },
        mapCommitToProps: {
            UPDATE_CATEGORY: "UPDATE_CATEGORY",
            UPDATE_CATEGORYVIEW: "UPDATE_CATEGORYVIEW",
            UPDATE_DOWNLOADING_SELECTED_TASKS: "UPDATE_DOWNLOADING_SELECTED_TASKS",
            UPDATE_COMPLETED_SELECTED_TASKS: "UPDATE_COMPLETED_SELECTED_TASKS",
            UPDATE_RECYCLE_SELECTED_TASKS: "UPDATE_RECYCLE_SELECTED_TASKS",
            UPDATE_TASK_STATUS: "UPDATE_TASK_STATUS",
            UPDATE_DOWNLOADING_TASKLIST: "UPDATE_DOWNLOADING_TASKLIST",
            UPDATE_COMPLETED_TASKLIST: "UPDATE_COMPLETED_TASKLIST",
            UPDATE_RECYCLE_TASKLIST: "UPDATE_RECYCLE_TASKLIST"
        },
        mapDispatchToProps: {attachTaskEvent: "attachTaskEvent", selectTab: "selectTab"},
        mapGettersToProps: {
            downloadingTaskList: e => e.downloadingTaskList,
            completedTaskList: e => e.completedTaskList,
            recycleTaskList: e => e.recycleTaskList,
            downloadingTaskBaseList: e => e.downloadingTaskBaseList,
            completedTaskBaseList: e => e.completedTaskBaseList,
            recycleTaskBaseList: e => e.recycleTaskBaseList,
            currentSelectdTaskInfos: e => e.currentSelectdTaskInfos,
            downloadingSelectedIndexs: e => e.downloadingSelectedIndexs,
            completedSelectedTaskIndexs: e => e.completedSelectedTaskIndexs,
            recycleSelectedTaskIndexs: e => e.recycleSelectedTaskIndexs
        }
    })(n.default)
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(259), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(8), o = i(0), r = i(3), s = i(60), l = i(455), d = i(36), u = i(97), c = i(13), h = i(27), f = i(9),
        g = i(30), p = i(15), v = i(11), m = i(4), y = i(73), k = i(31),
        T = p.DownloadKernelEventManager.getEventManager(), w = v.DownloadKernelTaskManager.getTaskManager(),
        C = o.default.getLogger("DownloadList");
    let S = class extends a.Vue {
        constructor() {
            super(...arguments), this.categoryLastSelectList = [{
                category: r.DownloadKernel.CategroyViewID.Downloading,
                lastIndex: 0
            }, {
                category: r.DownloadKernel.CategroyViewID.Completed,
                lastIndex: 0
            }, {
                category: r.DownloadKernel.CategroyViewID.Recycle,
                lastIndex: 0
            }], this.showNoResultTip = !1, this.showResultCountTip = !1, this.bLoadDbFinish = !1, this.insertToCategoryViewEventId = void 0, this.removeFromCategoryViewEventId = void 0, this.statusChangedEventId = void 0, this.dataBaseLoadCookie = void 0, this.inputFlag = !0, this.resultCount = 0, this.escapeCode = "", this.pulseEventFlag = !1, this.downloadingSearchArray = [], this.completeSearchArray = [], this.recycleSearchArray = [], this.downloadingSearchSelIndexs = [], this.completeSearchSelIndexs = [], this.recycleSearchSelIndexs = [], this.currentSelSearchTaskIds = [], this.searchListPanel = "Downloading", this.holderTextTip = "", this.searchType = "search", this.curSearchKey = "", this.inputFocus = !1
        }

        get recycleSearchList() {
            return void 0 === this.recycleSearchArray ? [] : this.recycleSearchArray
        }

        get completeSearchList() {
            return void 0 === this.completeSearchArray ? [] : this.completeSearchArray
        }

        get downloadingSearchList() {
            return void 0 !== this.downloadingSearchArray ? this.downloadingSearchArray : []
        }

        onInputFocus(e) {
            this.holderTextTip = "", this.inputFocus = !0
        }

        onInputBlur(e) {
            this.inputFocus = !1, this.curSearchKey.length < 1 && (this.holderTextTip = "搜索下载记录", this.showResultCountTip = !1)
        }

        preHandleSearchKey() {
            let e = this.curSearchKey.split(" "), t = [];
            if (e) for (let i = 0; i < e.length; i++) e[i].trim().length > 0 && t.push(e[i].trim());
            return t
        }

        getArrayIntersection(e, t) {
            let i = [], n = new Set(t);
            return i = Array.from(new Set(e.filter(e => n.has(e))))
        }

        replaceSpecialKeyForDB(e) {
            return e !== (e = e.replace(/\/|'|\[|]|%|&|_|\(|\)/g, function (e) {
                return "/" + e
            })) && (this.escapeCode = "/"), e
        }

        internalSearch(e) {
            C.information("多关键字数组:", e);
            let t = [], i = [];
            for (let n = 0; n < e.length; n++) {
                let a = r.DownloadKernel.SearchKeyType.NameInclude;
                this.escapeCode = "";
                let o = this.replaceSpecialKeyForDB(e[n]);
                k.ThunderKernel.searchTask(a, o, -1, this.escapeCode, n => {
                    let a, o;
                    if (this.clearSearch(), i = n, t[t.length] = i, t.length === e.length) {
                        let e;
                        t.length > 0 && (e = t[0]);
                        for (let i = 1; i < t.length; i++) e = this.getArrayIntersection(e, t[i]);
                        this.resultCount = e.length;
                        for (let t = 0; t < e.length; t++) (a = w.getTaskFromTaskId(e[t])) && (o = a.getTaskAttribute(r.DownloadKernel.TaskAttribute.CategoryViewId)), o && (o === r.DownloadKernel.CategroyViewID.Downloading ? this.downloadingSearchArray.push(e[t]) : o === r.DownloadKernel.CategroyViewID.Completed ? this.completeSearchArray.push(e[t]) : o === r.DownloadKernel.CategroyViewID.Recycle && this.recycleSearchArray.push(e[t]))
                    }
                })
            }
        }

        startSearch() {
            this.inputFlag && (m.isNullOrUndefined(this.curSearchKey) || (this.curSearchKey.trim().length < 1 ? this.clearSearch() : (this.showNoResultTip = !0, this.showResultCountTip = !0, this.internalSearch(this.preHandleSearchKey()))))
        }

        onDownloadTaskSelect(e) {
            if (!e) return;
            if (!e.length) return;
            let t, i;
            this.currentSelSearchTaskIds = e, this.currentSelSearchTaskInfos = [];
            for (let n = 0; n < e.length; n++) t = (i = w.getTaskFromTaskId(e[n])).getTaskBaseInfo(), this.currentSelSearchTaskInfos.push(t);
            this.$el.focus()
        }

        handlePopInputMenu() {
            y.MenuSkinNS.popEditableDefaultContextMenu(void 0, -4)
        }

        onCategoryChange(e) {
            h.default.fireEvent(c.NodeEventMesssageNS.eventDownloadItemActive, this.currentCategoryViewId, !1, 0, null, !0), this.UPDATE_CATEGORYVIEW(r.DownloadKernel.CategroyViewID.Downloading), -1 !== this.currentCategoryId && this.closeSearch()
        }

        clearSearch() {
            this.downloadingSearchArray = [], this.completeSearchArray = [], this.recycleSearchArray = [], this.resultCount = 0, this.showResultCountTip = !1, this.showNoResultTip = !1
        }

        clickCloseSearch() {
            f.XLStatNS.trackEvent("download_leftpanel", "search_close_click", "", 0, 0, 0, 0, "entry=close"), this.closeSearch()
        }

        keyCloseSearch() {
            f.XLStatNS.trackEvent("download_leftpanel", "search_close_click", "", 0, 0, 0, 0, "entry=ctrlf"), this.closeSearch()
        }

        closeSearch() {
            this.$emit("close:keysearch"), this.clearSearch(), this.curSearchKey = ""
        }

        handleDelete(e = !1) {
            e ? d.TaskOperatorNs.destroyTasks(this.currentSelSearchTaskInfos) : d.TaskOperatorNs.deleteTasks(this.currentSelSearchTaskInfos)
        }

        get downloadingCategoryTitle() {
            let e = "正在下载";
            return 0 !== this.downloadingSearchArray.length && (e = e + "(" + this.downloadingSearchArray.length + ")"), e
        }

        get completedCategoryTitle() {
            let e = "已完成";
            return 0 !== this.completeSearchArray.length && (e = e + "(" + this.completeSearchArray.length + ")"), e
        }

        get recycleCategoryTitle() {
            let e = "回收站";
            return 0 !== this.recycleSearchArray.length && (e = e + "(" + this.recycleSearchArray.length + ")"), e
        }

        downloadingItemDbClick() {
            s.TaskStatusHelper.canStopSelectedTask(this.currentCategoryViewId, this.currentSelSearchTaskInfos) ? d.TaskOperatorNs.pauseTasks(this.currentSelSearchTaskInfos, r.DownloadKernel.TaskStopReason.Manual) : s.TaskStatusHelper.canStartSelectedTask(this.currentCategoryViewId, this.currentSelSearchTaskInfos) ? d.TaskOperatorNs.startTasks(this.currentSelSearchTaskInfos) : C.information("downloaditem dbclick do nothing")
        }

        recycleItemDbClick() {
            C.information("垃圾箱双击")
        }

        handleDownloadingItemMenu(e) {
            u.downloadContextMenu.setContextInfo(this, this.currentCategoryId, this.downloadingTaskList.length, !0);
            let t = u.DownloadMenuType.DownloadingItem;
            this.currentSelSearchTaskInfos.length > 1 && (t = u.DownloadMenuType.SearchMultiSel), u.downloadContextMenu.popMenu(t, e)
        }

        handleCompletedItemMenu(e) {
            u.downloadContextMenu.setContextInfo(this, this.currentCategoryId, null, !0);
            let t = u.DownloadMenuType.CompletedItem;
            this.currentSelSearchTaskInfos.length > 1 && (t = u.DownloadMenuType.SearchMultiSel), u.downloadContextMenu.popMenu(t, e)
        }

        handleRecycleItemMenu(e) {
            u.downloadContextMenu.setContextInfo(this, this.currentCategoryId, null, !0);
            let t = u.DownloadMenuType.RecycleItem;
            this.currentSelSearchTaskInfos.length > 1 && (t = u.DownloadMenuType.SearchMultiSel), u.downloadContextMenu.popMenu(t, e)
        }

        handleMenuClick(e, ...t) {
            e
        }

        focusEdit() {
            let e = this.$refs.input.$el.querySelector("input");
            e && e.focus()
        }

        keydownSearch(e) {
            this.curSearchKey = e, this.$nextTick(() => {
                this.startSearch()
            })
        }

        compositionStart(e) {
            this.inputFocus && (this.inputFlag = !1)
        }

        compositionEnd(e) {
            this.inputFocus && (this.inputFlag = !0, this.$nextTick(() => {
                this.startSearch()
            }))
        }

        created() {
            this.attachTaskEvent(), this.holderTextTip = "搜索下载记录", u.downloadContextMenu.attachListener(c.NodeEventMesssageNS.eventDownloadContextMenuClick, this.handleMenuClick), this.currentSelSearchTaskInfos = [], document.addEventListener("compositionstart", this.compositionStart), document.addEventListener("compositionend", this.compositionEnd)
        }

        shouldChange2Complete() {
            let e = !1;
            do {
                if (this.currentCategoryViewId === r.DownloadKernel.CategroyViewID.Recycle && this.recycleSelectedTaskIndexs.length > 0) {
                    e = !1;
                    break
                }
                if (this.currentCategoryViewId !== r.DownloadKernel.CategroyViewID.Downloading) {
                    e = !0;
                    break
                }
                if (this.downloadingSelectedIndexs.length > 0) {
                    e = !1;
                    break
                }
                e = !0;
                for (let t of this.downloadingTaskBaseList) if (t.taskStatus === r.DownloadKernel.TaskStatus.StartPending || t.taskStatus === r.DownloadKernel.TaskStatus.Started) {
                    e = !1;
                    break
                }
            } while (0);
            return e
        }

        shouldChangeCompleteSelect() {
            let e = !1;
            do {
                if (this.currentCategoryViewId !== r.DownloadKernel.CategroyViewID.Completed) {
                    e = !0;
                    break
                }
                if (0 === this.completedSelectedTaskIndexs.length) {
                    e = !0;
                    break
                }
            } while (0);
            return e
        }

        onTaskDataBaseLoadEnd() {
            this.bLoadDbFinish = !0, this.$nextTick(() => {
                0 === this.downloadingTaskList.length && this.completedTaskList.length > 0 && this.UPDATE_CATEGORYVIEW(r.DownloadKernel.CategroyViewID.Completed)
            })
        }

        mounted() {
            this.statusChangedEventId = T.attachTaskEvent(r.DownloadKernel.TaskEventType.StatusChanged, (...e) => {
                do {
                    if (!e) break;
                    if (e[0] !== r.DownloadKernel.TaskEventType.StatusChanged) break;
                    if (!e[1]) break;
                    let t = e[1];
                    if (t.length > 0) {
                        if (t[0].getTaskAttribute(r.DownloadKernel.TaskAttribute.CategoryId) !== this.currentCategoryId) break;
                        if (this.UPDATE_TASK_STATUS(t.map(e => e.getTaskBaseInfo())), t[0].getTaskAttribute(r.DownloadKernel.TaskAttribute.Background)) break;
                        if (t[0].getTaskAttribute(r.DownloadKernel.TaskAttribute.GroupTaskId) > 0) break;
                        t[0].getTaskStatus() !== r.DownloadKernel.TaskStatus.Succeeded && t[0].getTaskStatus() !== r.DownloadKernel.TaskStatus.Seeding || this.$nextTick(() => {
                            this.startSearch()
                        })
                    }
                } while (0)
            }), w.isLoadStorageTaskFinish() ? this.bLoadDbFinish = !0 : (this.dataBaseLoadCookie = 0, g.DownloadKernelManager.attachListener(c.NodeEventMesssageNS.eventTaskDataBaseLoadEnd, this.onTaskDataBaseLoadEnd)), this.removeFromCategoryViewEventId = T.attachTaskEvent(r.DownloadKernel.TaskEventType.RemoveFromCategoryView, (...e) => {
                do {
                    if (!e) break;
                    if (e[0] !== r.DownloadKernel.TaskEventType.RemoveFromCategoryView) break;
                    if (void 0 === e[1] || !e[2] || !e[3]) break;
                    if (e[1] !== this.currentCategoryId) break;
                    let t = e[2], i = e[3];
                    if (t === r.DownloadKernel.CategroyViewID.Downloading) {
                        if (!this.downloadingSearchArray) break;
                        for (let e of i) {
                            let t = e.getId(), i = this.downloadingSearchArray.indexOf(t);
                            -1 !== i && this.downloadingSearchArray.splice(i, 1)
                        }
                        break
                    }
                    if (t === r.DownloadKernel.CategroyViewID.Completed) {
                        if (!this.completeSearchArray) break;
                        for (let e of i) {
                            let t = e.getId(), i = this.completeSearchArray.indexOf(t);
                            -1 !== i && this.completeSearchArray.splice(i, 1)
                        }
                        break
                    }
                    if (t === r.DownloadKernel.CategroyViewID.Recycle) {
                        if (!this.recycleSearchArray) break;
                        for (let e of i) {
                            let t = e.getId(), i = this.recycleSearchArray.indexOf(t);
                            -1 !== i && this.recycleSearchArray.splice(i, 1)
                        }
                        break
                    }
                } while (0)
            }), this.insertToCategoryViewEventId = T.attachTaskEvent(r.DownloadKernel.TaskEventType.InsertToCategoryView, (...e) => {
                do {
                    if (!e) break;
                    if (e[0] !== r.DownloadKernel.TaskEventType.InsertToCategoryView) break;
                    if (void 0 === e[1] || !e[2] || !e[3]) break;
                    let t = e[1], i = e[2], n = e[3], a = e[4];
                    n.map(e => e.getTaskBaseInfo()), this.$nextTick(() => {
                        this.startSearch()
                    }), this.bLoadDbFinish && i === r.DownloadKernel.CategroyViewID.Downloading && (a === r.DownloadKernel.TaskInsertReason.Create && this.UPDATE_CATEGORY(t), this.$nextTick(() => {
                        if (this.currentCategoryViewId !== r.DownloadKernel.CategroyViewID.Downloading) this.UPDATE_CATEGORYVIEW(r.DownloadKernel.CategroyViewID.Downloading), this.$nextTick(() => {
                            setTimeout(() => {
                                let e = this.downloadingTaskList[0];
                                this.UPDATE_DOWNLOADING_SELECTED_TASKS([e])
                            }, 0)
                        }); else {
                            let e = this.downloadingTaskList[0];
                            this.UPDATE_DOWNLOADING_SELECTED_TASKS([e])
                        }
                    }))
                } while (0)
            }), this.cookieOfTaskRenamed = T.attachTaskEvent(r.DownloadKernel.TaskEventType.TaskRenamed, (...e) => {
                do {
                    if (!e) break;
                    if (e[0] !== r.DownloadKernel.TaskEventType.TaskRenamed) break;
                    this.pulseEventFlag = !this.pulseEventFlag, this.$nextTick(() => {
                        this.startSearch()
                    })
                } while (0)
            }), this.cookieOfTaskDestroyed = T.attachTaskEvent(r.DownloadKernel.TaskEventType.TaskDestroyed, (...e) => {
                do {
                    if (!e) break;
                    if (e[0] !== r.DownloadKernel.TaskEventType.TaskDestroyed) break;
                    this.pulseEventFlag = !this.pulseEventFlag, this.$nextTick(() => {
                        this.startSearch()
                    })
                } while (0)
            })
        }

        destroyed() {
            u.downloadContextMenu.detachListener(c.NodeEventMesssageNS.eventDownloadContextMenuClick, this.handleMenuClick), document.removeEventListener("compositionstart", this.compositionStart), document.removeEventListener("compositionend", this.compositionEnd), this.clearSearch(), void 0 !== this.insertToCategoryViewEventId && T.detachTaskEvent(r.DownloadKernel.TaskEventType.InsertToCategoryView, this.insertToCategoryViewEventId), void 0 !== this.removeFromCategoryViewEventId && T.detachTaskEvent(r.DownloadKernel.TaskEventType.RemoveFromCategoryView, this.removeFromCategoryViewEventId), void 0 !== this.statusChangedEventId && T.detachTaskEvent(r.DownloadKernel.TaskEventType.StatusChanged, this.statusChangedEventId), void 0 !== this.dataBaseLoadCookie && (this.dataBaseLoadCookie = void 0, g.DownloadKernelManager.detachListener(c.NodeEventMesssageNS.eventTaskDataBaseLoadEnd, this.onTaskDataBaseLoadEnd)), this.cookieOfTaskRenamed && (this.cookieOfTaskRenamed = void 0, T.detachTaskEvent(r.DownloadKernel.TaskEventType.TaskRenamed, this.cookieOfTaskRenamed)), this.cookieOfTaskDestroyed && (this.cookieOfTaskDestroyed = void 0, T.detachTaskEvent(r.DownloadKernel.TaskEventType.TaskDestroyed, this.cookieOfTaskDestroyed))
        }
    };
    n([a.Prop({})], S.prototype, "hasLeftBottomAd", void 0), n([a.Prop({})], S.prototype, "currentTabId", void 0), n([a.Prop({})], S.prototype, "currentCategoryId", void 0), n([a.Prop({})], S.prototype, "currentCategoryViewId", void 0), n([a.Prop({})], S.prototype, "downloadingTaskList", void 0), n([a.Prop({})], S.prototype, "downloadingTaskBaseList", void 0), n([a.Prop({})], S.prototype, "completedTaskList", void 0), n([a.Prop({})], S.prototype, "completedTaskBaseList", void 0), n([a.Prop({})], S.prototype, "recycleTaskList", void 0), n([a.Prop({})], S.prototype, "recycleTaskBaseList", void 0), n([a.Prop({})], S.prototype, "downloadingSelectedIndexs", void 0), n([a.Prop({})], S.prototype, "completedSelectedTaskIndexs", void 0), n([a.Prop({})], S.prototype, "recycleSelectedTaskIndexs", void 0), n([a.Prop({})], S.prototype, "currentSelectdTaskInfos", void 0), n([a.Prop({})], S.prototype, "downloadingResultCount", void 0), n([a.Prop({})], S.prototype, "completedResultCount", void 0), n([a.Prop({})], S.prototype, "recycleResultCount", void 0), n([a.Prop({})], S.prototype, "UPDATE_CATEGORY", void 0), n([a.Prop({})], S.prototype, "UPDATE_CATEGORYVIEW", void 0), n([a.Prop({})], S.prototype, "UPDATE_DOWNLOADING_SELECTED_TASKS", void 0), n([a.Prop({})], S.prototype, "UPDATE_COMPLETED_SELECTED_TASKS", void 0), n([a.Prop({})], S.prototype, "UPDATE_RECYCLE_SELECTED_TASKS", void 0), n([a.Prop({})], S.prototype, "UPDATE_DOWNLOADING_TASKLIST", void 0), n([a.Prop({})], S.prototype, "UPDATE_COMPLETED_TASKLIST", void 0), n([a.Prop({})], S.prototype, "UPDATE_RECYCLE_TASKLIST", void 0), n([a.Prop({})], S.prototype, "UPDATE_TASK_STATUS", void 0), n([a.Prop({})], S.prototype, "attachTaskEvent", void 0), n([a.Prop({})], S.prototype, "selectTab", void 0), n([a.Watch("currentCategoryId")], S.prototype, "onCategoryChange", null), S = n([a.Component({components: {DownloadCategory: l.default}})], S), t.default = S
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(261), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(680), a = i(33);
    t.default = a.connector.connect({
        mapDispatchToProps: {initSettingData: "initSettingData"},
        mapStateToProps: {formData: e => e.SettingConf.formData, confSchema: e => e.SettingConf.confSchema},
        mapCommitToProps: {
            removeConfigData: "REMOVE_CONFIG_DATA",
            setConfigValue: "SET_CONFIG_VALUE",
            setFormData: "SET_FOMR_DATA",
            addFormdataItem: "ADD_FORMDATA_ITEM",
            addSchemaItem: "ADD_SCHEMA_ITEM",
            addSelectItem: "ADD_SELECT_ITEM"
        },
        mapGettersToProps: {baseSetting: "baseSetting"}
    })(n.default)
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(263), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(681), r = i(8), s = i(16), l = i(10), d = i(13), u = i(321), c = i(77), h = i(90), f = i(24),
        g = i(0).default.getLogger("setting-center-view"),
        p = u.CommunityNaviteFunctionNS.CommunityNaviteFunction.getNativeModule();
    let v = class extends r.Vue {
        constructor() {
            super(...arguments), this.userId = "", this.currenIndex = 0, this.scrollSumHeight = 0, this.autoScroll = !1, this.browserSettingPosition = [2, 1], this.browsersConfSection = "Motitor", this.browserSettingItemType = "confCheckbox", this.browserSelectAll = "Motitor-MotitorAll"
        }

        handleScroll() {
            if (this.autoScroll) return void (this.autoScroll = !1);
            0 === this.getScrollTop() && (this.scrollSumHeight = 0, this.currenIndex = 0);
            let e = document.querySelectorAll(".contain-tab")[this.currenIndex];
            if (null !== e && void 0 !== e) if (e.offsetHeight + this.scrollSumHeight <= this.getScrollTop()) this.scrollSumHeight += e.offsetHeight, this.currenIndex++; else if (this.scrollSumHeight - this.getScrollTop() >= e.offsetHeight || 0 === this.getScrollTop()) {
                if (0 === this.currenIndex) return;
                0 === this.getScrollTop() ? this.scrollSumHeight = 0 : this.scrollSumHeight -= e.offsetHeight, this.currenIndex--
            }
        }

        getScrollTop() {
            return this.$refs.settinContain.scrollTop
        }

        setScrollTop(e) {
            this.$refs.settinContain.scrollTop = e
        }

        clickTab(e) {
            this.scrollSumHeight = 0, this.currenIndex = e;
            let t = document.querySelectorAll(".contain-tab");
            if (null !== t && void 0 !== t) for (let i = 0; i < e; i++) this.scrollSumHeight += t[i].offsetHeight;
            this.autoScroll = !0, this.setScrollTop(this.scrollSumHeight)
        }

        handleConfChange(e, t = "") {
            if ("" === t || void 0 === this.formData[t]) return;
            let i = void 0 !== this.formData[t].isReleventUser ? this.userId : "",
                n = {section: this.formData[t].section, key: this.formData[t].key, value: e, name: t, userId: i};
            this.setConfigValue(n)
        }

        getUserID() {
            return a(this, void 0, void 0, function* () {
                return new Promise(e => {
                    f.LoginHelperNS.loginHelper.getUserInfo("userid", function (t) {
                        g.information("getUserID:userid = ", t), e(t)
                    })
                })
            })
        }

        created() {
            l.ConfigNS.attachListener(d.NodeEventMesssageNS.eventConfigInitFinished, () => {
                this.initSettingData()
            })
        }

        mounted() {
            return a(this, void 0, void 0, function* () {
                (yield f.LoginHelperNS.loginHelper.isLoginedAw()) && (this.userId = yield this.getUserID()), this.confChangeEventId = s.NativeCallModule.nativeCall.AttachNativeEvent("OnConfigValueChanaged", (e, t, i, n) => {
                    void 0 !== this.formData[`${e}-${t}`] && this.setFormData({section: e, key: t, value: n})
                }), this.loginEventId = s.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", e => {
                    this.userId = e;
                    let t = l.ConfigNS.getValue("UserCommunitySet", `radio_id_${e}`, "1");
                    g.information("setting-center:handleConfChange", t), this.handleConfChange(t, "UserCommunitySet-radio_id_")
                }), this.logoutEventId = s.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", () => {
                    this.userId = ""
                }), p.on("selectMsgNotice", () => {
                    this.clickTab(3)
                }), c.SettingConfigHelperNS.configBrowserHelper.attachListener(d.NodeEventMesssageNS.eventConfigBrowserInitFinished, () => {
                    let e = c.SettingConfigHelperNS.configBrowserHelper.getConfigShowBrowsers();
                    g.information("browsers", e);
                    for (let t = 0; t < e.length; t++) void 0 === this.formData[`${this.browsersConfSection}-${e[t].key}`] && (this.addFormdataItem({
                        section: this.browsersConfSection,
                        key: e[t].key,
                        type: "number",
                        value: e[t].isSelect ? 1 : 0,
                        selectAllName: this.browserSelectAll
                    }), this.addSchemaItem({
                        position: this.browserSettingPosition,
                        schemaItem: {
                            name: `${this.browsersConfSection}-${e[t].key}`,
                            type: this.browserSettingItemType,
                            label: e[t].content,
                            liClasses: "inline"
                        },
                        direction: 0
                    }), this.addSelectItem({
                        target: this.browserSelectAll,
                        from: `${this.browsersConfSection}-${e[t].key}`
                    }));
                    if (e.length > 0) {
                        let t = e[e.length - 1];
                        this.handleConfChange(t.isSelect ? 1 : 0, `${this.browsersConfSection}-${t.key}`)
                    }
                    if (!this.formData[`${this.browsersConfSection}-browserConfigGuideButton`]) {
                        let e = {
                            type: "confBtn",
                            text: "手动更改浏览器默认下载方式",
                            classes: "td-button--small noMargin",
                            boxType: "browserGuideConfBox",
                            style: h.default().whetherShowEntry() ? "margin-left: 0" : "display: none",
                            extEles: [{
                                type: "confTip",
                                text: "由于技术原理的限制，迅雷默认提供的“接管浏览器”功能，未能有效接管HTTPS\n协议的下载请求。建议您手动更改浏览器默认下载方式，可以完美接管浏览器的\n所有下载请求！目前支持“360安全浏览器、搜狗浏览器、QQ浏览器”",
                                classes: "td-icon-info",
                                style: h.default().whetherShowEntry() ? "margin-left: 0" : "display: none"
                            }]
                        };
                        this.addFormdataItem({
                            section: this.browsersConfSection,
                            key: "browserConfigGuideButton",
                            type: "number",
                            value: ""
                        }), this.addSchemaItem({position: this.browserSettingPosition, schemaItem: e, direction: -1})
                    }
                })
            })
        }

        beforeDestroy() {
            this.confChangeEventId && s.NativeCallModule.nativeCall.DetachNativeEvent("OnConfigValueChanaged", this.confChangeEventId), this.loginEventId && s.NativeCallModule.nativeCall.DetachNativeEvent("onLoginSuc", this.loginEventId), this.logoutEventId && s.NativeCallModule.nativeCall.DetachNativeEvent("onLogout", this.logoutEventId), p.removeAllListeners("selectMsgNotice"), this.removeConfigData()
        }
    };
    n([r.Prop({})], v.prototype, "initSettingData", void 0), n([r.Prop({})], v.prototype, "formData", void 0), n([r.Prop({})], v.prototype, "confSchema", void 0), n([r.Prop({})], v.prototype, "removeConfigData", void 0), n([r.Prop({})], v.prototype, "setConfigValue", void 0), n([r.Prop({})], v.prototype, "setFormData", void 0), n([r.Prop({})], v.prototype, "addFormdataItem", void 0), n([r.Prop({})], v.prototype, "addSchemaItem", void 0), n([r.Prop({})], v.prototype, "addSelectItem", void 0), v = n([r.Component({components: {generatorView: o.default}})], v), t.default = v
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(265), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(682), o = i(687), r = i(82), s = i(138), l = i(689), d = i(690), u = i(137), c = i(691), h = i(457),
        f = i(136), g = i(692), p = i(8);
    let v = class extends p.Vue {
        handleInput(e, t = "") {
            "" === t ? this.$emit("input", e, this.item.name) : this.$emit("input", e, t)
        }
    };
    n([p.Prop({})], v.prototype, "item", void 0), n([p.Prop({})], v.prototype, "formData", void 0), n([p.Prop()], v.prototype, "value", void 0), v = n([p.Component({
        components: {
            confCheckbox: a.default,
            confRadio: o.default,
            confSelect: r.default,
            confText: s.default,
            confCheckboxInput: l.default,
            confCheckboxSelect: d.default,
            confInput: u.default,
            confSpeedText: h.default,
            confTextarea: c.default,
            confBtn: f.default,
            confProxyList: g.default
        }
    })], v), t.default = v
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(267), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(8), r = i(135), s = i(101), l = i(136), d = i(82), u = i(137), c = i(685), h = i(686), f = i(138);
    let g = class extends o.Vue {
        handleInput(e, t = "") {
            return a(this, void 0, void 0, function* () {
                if ("" === t ? this.$emit("input", e, this.item.name) : this.$emit("input", e, t), void 0 !== this.item.linkItem && e) {
                    let t = yield r.ConfigHelperNS.getValue(this.formData[this.item.linkItem.name].section, this.formData[this.item.linkItem.name].key, "");
                    "" !== e && this.$emit("input", t, this.item.linkItem.name)
                }
            })
        }
    };
    n([o.Prop({})], g.prototype, "item", void 0), n([o.Prop({})], g.prototype, "formData", void 0), n([o.Prop()], g.prototype, "value", void 0), n([o.Prop()], g.prototype, "label", void 0), g = n([o.Component({
        components: {
            confTip: s.default,
            confBtn: l.default,
            confSelect: d.default,
            confInput: u.default,
            confSpeed: c.default,
            confSpeedTime: h.default,
            confText: f.default
        }
    })], g), t.default = g
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(269), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(8);
    let o = class extends a.Vue {
    };
    n([a.Prop()], o.prototype, "classes", void 0), n([a.Prop()], o.prototype, "text", void 0), o = n([a.Component({})], o), t.default = o
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(271), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(8), r = i(135), s = i(22), l = i(37), d = i(14), u = i(16), c = i(101), h = i(457);
    let f = class extends o.Vue {
        popDialog(e) {
            switch (e.boxType) {
                case"speedConfBox":
                    u.NativeCallModule.nativeCall.CallNativeFunction("ShowCustomDownloadModeDlg", () => {
                    });
                    break;
                case"browserGuideConfBox":
                    u.NativeCallModule.nativeCall.CallNativeFunction("ShowBrowserGuideDlg", () => {
                    });
                    break;
                case"function":
                    e.handle();
                    break;
                case"pop":
                    this.messagePop(e)
            }
        }

        messagePop(e) {
            return a(this, void 0, void 0, function* () {
                let t = d.ThunderUtil.deepCopy(e.pop.formData);
                for (let i in t) t[i].value = yield r.ConfigHelperNS.getValue(e.pop.formData[i].section, e.pop.formData[i].key, e.pop.formData[i].value);
                s.MessageBox.pop({
                    title: e.pop.title,
                    size: e.pop.size,
                    schemas: e.pop.schema,
                    formData: t
                }, e.pop.dialogOption).then(e => {
                    if (e.action === l.MessageBoxNS.Action.OK) for (let t in e.formData) r.ConfigHelperNS.setValue(e.formData[t].section, e.formData[t].key, e.formData[t].value)
                }).catch()
            })
        }
    };
    n([o.Prop({})], f.prototype, "item", void 0), n([o.Prop()], f.prototype, "classes", void 0), n([o.Prop()], f.prototype, "text", void 0), n([o.Prop()], f.prototype, "disabled", void 0), n([o.Prop({})], f.prototype, "formData", void 0), f = n([o.Component({
        components: {
            confTip: c.default,
            confSpeedText: h.default
        }
    })], f), t.default = f
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(273), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(8), r = i(135);
    let s = class extends o.Vue {
        constructor() {
            super(...arguments), this.maxDownloadSpeed = "", this.maxUploadSpeed = ""
        }

        onFormDataChange(e) {
            this.updateMaxDownloadSpeed(), this.updateMaxUploadSpeed()
        }

        standardNumber(e) {
            let t = parseInt(e + "", 10);
            return t > 9 ? t + "" : "0" + t
        }

        updateMaxDownloadSpeed() {
            return a(this, void 0, void 0, function* () {
                let e = "不限速";
                this.formData["ConfigNet-ConfigNet_Custom_DownloadSpeedChk"].value && (e = (yield r.ConfigHelperNS.getValue("ConfigNet", "ConfigNet_Custom_MaxDownloadSpeedTmp", 1024)) + "KB/S"), this.maxDownloadSpeed = e
            })
        }

        updateMaxUploadSpeed() {
            return a(this, void 0, void 0, function* () {
                let e = "不限速";
                this.formData["ConfigNet-ConfigNet_Custom_UploadSpeedChk"].value && (e = (yield r.ConfigHelperNS.getValue("ConfigNet", "ConfigNet_Custom_MaxUploadSpeedTmp", 1024)) + "KB/S"), this.maxUploadSpeed = e
            })
        }
    };
    n([o.Prop({})], s.prototype, "item", void 0), n([o.Prop({})], s.prototype, "formData", void 0), n([o.Watch("formData", {
        immediate: !0,
        deep: !0
    })], s.prototype, "onFormDataChange", null), s = n([o.Component], s), t.default = s
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(275), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(8), r = i(12), s = i(338), l = i(458), d = i(20), u = i(0).default.getLogger("conf-select");
    let c = class extends o.Vue {
        constructor() {
            super(...arguments), this.schema = null, this.tooltipVisible = !1, this.tipContent = "", this.dyNamicOptions = [], this.valueData = ""
        }

        onFormDataChange(e) {
            this.item.updateByDataChange && e && e[this.name] && (this.valueData = e[this.name].value)
        }

        handleInput(e) {
            if (void 0 !== this.item.hasDeleteOption && e === this.item.deleteOptionText) return this.$emit("input", [], this.item.optionByName), void ("openThunderPan" === this.item.slotOption && d.server.callClientFunctionByName("ThunderPanPluginWebview", "IpcClearRecentFolder"));
            this.tooltipVisible || this.item.blurUpdate || this.$emit("input", e, this.item.name), this.valueData = e
        }

        handleOutFocus() {
            this.item.blurUpdate && !this.tooltipVisible && this.$emit("input", this.valueData, this.item.name)
        }

        selectPath() {
            return a(this, void 0, void 0, function* () {
                (yield r.asyncRemoteCall.getDialog()).showOpenDialog({
                    defaultPath: this.valueData,
                    properties: [this.fileType]
                }, e => {
                    void 0 !== e && (void 0 !== this.name ? this.$emit("input", e[0], this.name) : this.$emit("input", e[0], this.item.name), this.valueData = e[0])
                })
            })
        }

        get optionList() {
            if (this.item.optionByName && this.formData[this.item.optionByName] && this.formData[this.item.optionByName].value) {
                let e = this.formData[this.item.optionByName].value,
                    t = [...e].reverse().slice(0, this.item.maxOptionLen || e.length);
                return this.item.deleteOptionText && t.push(this.item.deleteOptionText), t
            }
            return this.options
        }

        get fileType() {
            return this.item.slotOption
        }

        get rules() {
            let e;
            do {
                if (!this.item.rules) break;
                e = this.item.rules.map(e => Array.isArray(e) ? new Function(e[0], e[1]) : e)
            } while (0);
            return e
        }

        handleChangePath(e) {
            return a(this, void 0, void 0, function* () {
                let t = "openDirectory";
                if ("openFile" === e ? t = "openFile" : "openThunderPan" === e && (t = "openThunderPan"), "openFile" === t || "openDirectory" === t) {
                    const e = yield r.asyncRemoteCall.getDialog();
                    let i = yield r.asyncRemoteCall.getCurrentWindow();
                    e.showOpenDialog(i, {defaultPath: this.valueData, properties: [t]}, e => {
                        void 0 !== e && (void 0 !== this.name ? this.$emit("input", e[0], this.name) : this.$emit("input", e[0], this.item.name), this.valueData = e[0]), this.$refs.root.focusEdit()
                    })
                } else if ("openThunderPan" === t) {
                    let e = yield d.server.callClientFunctionByName("ThunderPanPluginWebview", "IpcTreePath", {});
                    if (!e || !e[0] || e[0].error) return;
                    let t = "", i = "";
                    for (let n of e[0].path) t += "\\" + n.title, i += "\\" + n.id;
                    i = i.slice(1), t = t.slice(1), void 0 !== this.name ? this.$emit("input", t, this.name) : this.$emit("input", t, this.item.name), this.valueData = t, d.server.callClientFunctionByName("ThunderPanPluginWebview", "IpcSetDefaultSavePath", {
                        id: i,
                        name: t
                    })
                }
            })
        }

        validate(e) {
            u.information("value....", e), this.handleInput(e), void 0 !== this.item.hasDeleteOption && e === this.item.deleteOptionText || this.item.rules && this.schema.validate({[this.item.name]: e}, (e, t) => {
                u.information("errors", e), null === e ? this.tooltipVisible = !1 : (u.information("路径有误", e), this.tipContent = e[0].message, this.tooltipVisible = !0)
            })
        }

        created() {
            this.item.rules && (this.schema = new s.default({[this.item.name]: this.rules})), void 0 !== this.value ? this.valueData = this.value.value.toString() : this.valueData = this.formData[this.item.name].value.toString()
        }
    };
    n([o.Prop({})], c.prototype, "item", void 0), n([o.Prop()], c.prototype, "label", void 0), n([o.Prop({})], c.prototype, "formData", void 0), n([o.Prop()], c.prototype, "options", void 0), n([o.Prop()], c.prototype, "value", void 0), n([o.Prop()], c.prototype, "disabled", void 0), n([o.Prop()], c.prototype, "classes", void 0), n([o.Prop()], c.prototype, "name", void 0), n([o.Prop()], c.prototype, "placeHolder", void 0), n([o.Watch("formData", {deep: !0})], c.prototype, "onFormDataChange", null), c = n([o.Component({components: {SelectNative: l.default}})], c), t.default = c
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(277), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(399), r = i(12), s = i(8);
    let l = class extends s.Vue {
        onOptionsChanged() {
            return a(this, void 0, void 0, function* () {
                yield this.appendContent()
            })
        }

        appendContent() {
            return a(this, void 0, void 0, function* () {
                if (!this.dropdown) {
                    let e = yield o.electron.DropdownWindow.__resolve();
                    this.dropdown = yield new e
                }
                this.dropdown.clear();
                let e = yield o.electron.DropdownWindowContent.__resolve();
                for (let t of this.options) if (t) if ("separator" === t) {
                    let t = yield new e({type: "separator"});
                    yield this.dropdown.append(t)
                } else {
                    let i = yield new e({
                        label: t ? t.toString() : "", click: () => {
                            this.$refs.select.menuVisible = !1, this.$emit("input", t, !0)
                        }
                    });
                    yield this.dropdown.append(i)
                }
            })
        }

        handleMenuShow() {
            return a(this, void 0, void 0, function* () {
                if (void 0 === this.options || !Array.isArray(this.options) || 0 === this.options.length) return;
                this.dropdown || (yield this.appendContent());
                let e = this.$el.getBoundingClientRect();
                const {DropDownWindowSkinNS: t} = yield Promise.resolve().then(() => i(683));
                t.setStyle(this.dropdown, {
                    windowPreference: {
                        marginLeft: 0,
                        marginRight: 0,
                        stringWidth: Math.round(e.width) - 39
                    }
                });
                let n = yield r.asyncRemoteCall.getCurrentWindow();
                this.dropdown.popup({window: n, x: Math.round(e.left), y: Math.round(e.top + e.height + 4)})
            })
        }

        focusEdit() {
            if (this.$refs.select) {
                let e = this.$refs.select.$el.querySelector("input");
                null !== e && void 0 !== e && e.focus()
            }
        }
    };
    n([s.Prop()], l.prototype, "value", void 0), n([s.Prop({default: () => []})], l.prototype, "options", void 0), n([s.Watch("options")], l.prototype, "onOptionsChanged", null), l = n([s.Component], l), t.default = l
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(279), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(338), o = i(8), r = i(136);
    let s = class extends o.Vue {
        constructor() {
            super(...arguments), this.shortcutKey = "", this.funKey = !0, this.valueData = " ", this.canRegister = !1, this.schema = null, this.tooltip = "", this.tooltipVisible = !1
        }

        get rules() {
            let e;
            do {
                if (!this.item.rules) break;
                e = this.item.rules.map(e => Array.isArray(e) ? new Function(e[0], e[1]) : e)
            } while (0);
            return e
        }

        handleInput(e) {
            this.valueData = e, this.$emit("input", e, this.name)
        }

        handleChange(e) {
            let t = e.target;
            this.valueData = t.value, void 0 !== this.item.ShortcutKey && this.canRegister ? this.$emit("input", t.value, this.name) : void 0 === this.item.ShortcutKey && this.$emit("input", t.value, this.name)
        }

        handleKeyDown(e) {
            if (void 0 !== this.item.ShortcutKey) {
                let t = /Digit\d/.test(e.code) || e.keyCode >= 65 && e.keyCode <= 90;
                if (this.shortcutKey = "", this.funKey = !1, this.canRegister = !1, this.valueData = "", "Backspace" === e.key) return this.valueData = "无", void this.$emit("input", "", this.name);
                e.altKey && (this.shortcutKey = "Alt+"), e.ctrlKey && (this.shortcutKey = "" === this.shortcutKey ? "Crtl+" : `${this.shortcutKey}Crtl+`), e.shiftKey && (this.shortcutKey = "" === this.shortcutKey ? "Shift+" : `${this.shortcutKey}Shift+`);
                let i = "Alt" === e.key || "Shift" === e.key || "Control" === e.key ? "" : t ? e.code[e.code.length - 1] : e.key;
                this.valueData = this.shortcutKey + i, "" !== i && (this.funKey = !0), this.shortcutKey + i !== i && "" !== i && (this.canRegister = !0, this.valueData = this.shortcutKey + i, this.$emit("input", this.valueData, this.name))
            }
        }

        handleKeyup() {
            this.funKey || void 0 === this.item.ShortcutKey || (this.valueData = "无", this.$emit("input", "", this.name))
        }

        mounted() {
            this.valueData = this.value.value
        }

        validate(e) {
            this.item.rules && this.schema.validate({[this.item.name]: e}, (e, t) => {
                this.tooltipVisible = null !== e
            })
        }

        outFocus() {
            this.tooltipVisible = !1
        }

        created() {
            this.item.rules && (this.schema = new a.default({[this.item.name]: this.rules}))
        }
    };
    n([o.Prop()], s.prototype, "item", void 0), n([o.Prop({})], s.prototype, "formData", void 0), n([o.Prop()], s.prototype, "disabled", void 0), n([o.Prop()], s.prototype, "value", void 0), n([o.Prop()], s.prototype, "name", void 0), n([o.Prop()], s.prototype, "label", void 0), s = n([o.Component({components: {confBtn: r.default}})], s), t.default = s
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(281), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(338), o = i(8);
    let r = class extends o.Vue {
        constructor() {
            super(...arguments), this.schema = null, this.tooltip = "", this.tooltipVisible = !1, this.timeout = null
        }

        get rules() {
            return (this.item.rules || []).map(e => Array.isArray(e) ? new Function(e[0], e[1]) : e)
        }

        get doEmit() {
            return this.item.doEmit ? new Function(this.item.doEmit[0], this.item.doEmit[1]) : null
        }

        get doBlur() {
            return this.item.doBlur ? new Function(this.item.doBlur[0], this.item.doBlur[1]) : null
        }

        get sliderValue() {
            let e;
            return e = "number" == typeof this.value ? this.value : "object" == typeof this.value ? Number(this.value.value) : Number(this.value), this.item.scales && this.item.scales.length ? Math.min(Math.max(this.item.scales[0], e), this.item.scales[this.item.scales.length - 1]) : e
        }

        handleSliderUpdate(e) {
            this.handleInput(e.toString())
        }

        handleInput(e) {
            this.doEmit ? this.doEmit(this.item.name, e, this.value.value) : this.$emit("input", e, this.item.name), this.doValidate(e)
        }

        doValidate(e) {
            this.schema && this.schema.validate({[this.item.name]: e}, (e, t) => {
                null === e ? this.hideTooltip() : this.showTooltip(e[0].message)
            })
        }

        handleBlur() {
            let e;
            e = "object" == typeof this.value ? this.value.value : this.value, this.doBlur && this.doBlur(this.item.name, e), this.$nextTick(() => {
                let e;
                e = "object" == typeof this.value ? this.value.value : this.value, this.doValidate(e)
            })
        }

        showTooltip(e) {
            this.tooltip = e, this.$refs.tooltip.show(this.$refs.input.$el)
        }

        hideTooltip() {
            this.$refs.tooltip.hide()
        }

        created() {
            this.item.rules && (this.schema = new a.default({[this.item.name]: this.rules}))
        }
    };
    n([o.Prop({})], r.prototype, "item", void 0), n([o.Prop()], r.prototype, "value", void 0), n([o.Prop()], r.prototype, "disabled", void 0), r = n([o.Component], r), t.default = r
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(283), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(8), o = i(458);
    let r = class extends a.Vue {
        constructor() {
            super(...arguments), this.data = [{
                label: "开始限速时间",
                options: [{index: 0, type: "hour"}, {index: 1, type: "minute"}]
            }, {
                label: "结束限速时间",
                options: [{index: 2, type: "hour"}, {index: 3, type: "minute"}]
            }], this.hours = Array.from({length: 24}, (e, t) => t), this.minutes = Array.from({length: 60}, (e, t) => t)
        }

        handleInput(e, t) {
            let i = this.value.slice(0), n = Object.assign({}, i[t]);
            n.value = e, i[t] = n, this.$emit("input", i, this.item.name)
        }
    };
    n([a.Prop({})], r.prototype, "item", void 0), n([a.Prop()], r.prototype, "value", void 0), n([a.Prop()], r.prototype, "disabled", void 0), r = n([a.Component({components: {SelectNative: o.default}})], r), t.default = r
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(285), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(8), o = i(16);
    let r = class extends a.Vue {
        constructor() {
            super(...arguments), this.userId = ""
        }

        get clas() {
            return void 0 !== this.classes ? this.classes : this.item.classes
        }

        get textContent() {
            return void 0 !== this.item.text ? this.item.text : this.text
        }

        mounted() {
            void 0 !== this.item.isReleventUser && this.item.isReleventUser && (o.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", e => {
                this.userId = e
            }), o.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", () => {
                this.userId = ""
            }))
        }
    };
    n([a.Prop({})], r.prototype, "item", void 0), n([a.Prop()], r.prototype, "classes", void 0), n([a.Prop()], r.prototype, "extIndex", void 0), n([a.Prop()], r.prototype, "text", void 0), r = n([a.Component({})], r), t.default = r
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(287), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(8), r = i(101), s = i(136), l = i(137), d = i(82), u = i(688), c = i(16), h = i(7);
    let f = class extends o.Vue {
        constructor() {
            super(...arguments), this.userId = ""
        }

        handleInput(e, t = "") {
            "" === t ? this.$emit("input", e, this.item.name) : this.$emit("input", e, t)
        }

        setUserId() {
            return a(this, void 0, void 0, function* () {
                let e = yield h.client.callServerFunction("GetUserID");
                this.userId = e
            })
        }

        mounted() {
            return a(this, void 0, void 0, function* () {
                void 0 !== this.item.isReleventUser && this.item.isReleventUser && (this.setUserId(), c.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", e => {
                    this.userId = e
                }), c.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", () => {
                    this.userId = ""
                }))
            })
        }
    };
    n([o.Prop({})], f.prototype, "item", void 0), n([o.Prop({})], f.prototype, "formData", void 0), n([o.Prop()], f.prototype, "value", void 0), f = n([o.Component({
        components: {
            confTip: r.default,
            confBtn: s.default,
            confInput: l.default,
            confSelect: d.default,
            confContainer: u.default
        }
    })], f), t.default = f
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(289), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(8), o = i(82);
    let r = class extends a.Vue {
        handleInput(e, t = "") {
            "" === t ? this.$emit("input", e, this.item.name) : this.$emit("input", e, t)
        }
    };
    n([a.Prop({})], r.prototype, "item", void 0), n([a.Prop({})], r.prototype, "formData", void 0), n([a.Prop()], r.prototype, "value", void 0), n([a.Prop()], r.prototype, "disabled", void 0), r = n([a.Component({components: {confSelect: o.default}})], r), t.default = r
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(291), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(8), o = i(101), r = i(137), s = i(138), l = i(82);
    let d = class extends a.Vue {
        handleInput(e, t = "") {
            "" === t ? this.$emit("input", e, this.item.name) : this.$emit("input", e, t)
        }
    };
    n([a.Prop({})], d.prototype, "item", void 0), n([a.Prop({})], d.prototype, "formData", void 0), d = n([a.Component({
        components: {
            confTip: o.default,
            confInput: r.default,
            confText: s.default,
            confSelect: l.default
        }
    })], d), t.default = d
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(293), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(8), o = i(101), r = i(138), s = i(82);
    let l = class extends a.Vue {
        handleInput(e, t = "") {
            "" === t ? this.$emit("input", e, this.item.name) : this.$emit("input", e, t)
        }
    };
    n([a.Prop({})], l.prototype, "item", void 0), n([a.Prop({})], l.prototype, "formData", void 0), l = n([a.Component({
        components: {
            confTip: o.default,
            confText: r.default,
            confSelect: s.default
        }
    })], l), t.default = l
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(295), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(8);
    let o = class extends a.Vue {
        handleChange(e) {
            let t = e.target;
            this.$emit("input", t.value, this.item.name)
        }
    };
    n([a.Prop({})], o.prototype, "item", void 0), n([a.Prop({})], o.prototype, "formData", void 0), n([a.Prop()], o.prototype, "value", void 0), n([a.Prop()], o.prototype, "label", void 0), o = n([a.Component({components: {}})], o), t.default = o
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(297), a = i.n(n);
    for (var o in n) "default" !== o && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(o);
    t.default = a.a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__decorate || function (e, t, i, n) {
        var a, o = arguments.length, r = o < 3 ? t : null === n ? n = Object.getOwnPropertyDescriptor(t, i) : n;
        if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(e, t, i, n); else for (var s = e.length - 1; s >= 0; s--) (a = e[s]) && (r = (o < 3 ? a(r) : o > 3 ? a(t, i, r) : a(t, i)) || r);
        return o > 3 && r && Object.defineProperty(t, i, r), r
    }, a = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const o = i(8), r = i(135), s = i(22), l = i(37), d = i(333);
    let u = class extends o.Vue {
        constructor() {
            super(...arguments), this.selectedItem = null, this.proxyList = []
        }

        handleInput(e, t) {
            let i = this.value.slice(0), n = Object.assign({}, i[t]);
            n.value = e, i[t] = n, this.$emit("input", i, this.item.name)
        }

        handleAddProxyResult(e, t, i, n, a, o) {
            let r = !1, s = {name: e, host: t, port: i, type: n, userName: a, passWord: o};
            if (this.proxyList.length > 0) for (let t = 0; t < this.proxyList.length; ++t) if (this.proxyList[t].name === e) {
                r = !0;
                break
            }
            r || (this.proxyList.push(s), this.saveProxys())
        }

        handleAddProxy() {
            s.MessageBox.custom("AddProxy").then(e => {
                if (e.action === l.MessageBoxNS.Action.OK) {
                    let t = e.args.name, i = e.args.host, n = e.args.port, a = e.args.type, o = e.args.userName,
                        r = e.args.passWord;
                    this.handleAddProxyResult(t, i, n, a, o, r)
                }
            }).catch()
        }

        handleModifyProxy() {
            this.selectedItem && s.MessageBox.custom("AddProxy", this.selectedItem).then(e => a(this, void 0, void 0, function* () {
                if (e.action === l.MessageBoxNS.Action.OK) for (let t = 0; t < this.proxyList.length; ++t) if (this.proxyList[t].name === this.selectedItem.name) {
                    let i = this.selectedItem.name;
                    if (this.proxyList[t].name = e.args.name, this.proxyList[t].host = e.args.host, this.proxyList[t].port = e.args.port, this.proxyList[t].type = e.args.type, this.proxyList[t].userName = e.args.userName, this.proxyList[t].passWord = e.args.passWord, this.selectedItem = this.proxyList[t], this.saveProxys(), "2" === (yield r.ConfigHelperNS.getValue("ProxySetting", "ConfigProxy_Type", "0")) && (this.handleApplyProxy(), i === this.selectedItem.name)) {
                        let e = d.ProxyNS.ProxyType.Http;
                        "SOCKS5" === this.selectedItem.type && (e = d.ProxyNS.ProxyType.Sock5), d.ProxyNS.setProxy(e, this.selectedItem.host, this.selectedItem.port, this.selectedItem.userName, this.selectedItem.passWord)
                    }
                    break
                }
            })).catch()
        }

        handleDeleteProxy() {
            this.selectedItem && s.MessageBox.confirm({
                title: "您确定删除此代理吗？",
                type: s.MessageBox.ConfirmType.Warning
            }, {width: 400, height: 174, center: !0}).then(e => a(this, void 0, void 0, function* () {
                if (e.action === l.MessageBoxNS.Action.OK) for (let e = 0; e < this.proxyList.length; ++e) if (this.proxyList[e].name === this.selectedItem.name) {
                    let t = this.selectedItem.name;
                    this.proxyList.splice(e, 1), this.selectedItem = null, this.saveProxys();
                    let i = yield r.ConfigHelperNS.getValue("ProxySetting", "ConnectType_Http", "直接连接");
                    t === i && this.$emit("input", "直接连接", "ProxySetting-ConnectType_Http"), t === (i = yield r.ConfigHelperNS.getValue("ProxySetting", "ConnectType_Hub", "直接连接")) && this.$emit("input", "直接连接", "ProxySetting-ConnectType_Hub"), t === (i = yield r.ConfigHelperNS.getValue("ProxySetting", "ConnectType_Ftp", "直接连接")) && this.$emit("input", "直接连接", "ProxySetting-ConnectType_Ftp");
                    break
                }
            })).catch()
        }

        handleApplyProxy() {
            this.selectedItem && (this.$emit("input", "2", "ProxySetting-ConfigProxy_Type"), this.$emit("input", this.selectedItem.name, "ProxySetting-ConnectType_Hub"), this.$emit("input", this.selectedItem.name, "ProxySetting-ConnectType_Http"), this.$emit("input", this.selectedItem.name, "ProxySetting-ConnectType_Ftp"))
        }

        formatProxys() {
            let e = [];
            if (this.proxyList.length > 0) for (let t = 0; t < this.proxyList.length; ++t) {
                let i = this.proxyList[t].name;
                i = (i = (i = (i = (i = i + ";" + this.proxyList[t].host) + ";" + this.proxyList[t].port) + ";" + this.proxyList[t].type) + ";" + this.proxyList[t].userName) + ";" + this.proxyList[t].passWord, e.push(i)
            }
            return e
        }

        getProxyNames() {
            let e = ["直接连接"];
            if (this.proxyList.length > 0) for (let t = 0; t < this.proxyList.length; ++t) this.proxyList[t].name && this.proxyList[t].name.length > 0 && e.push(this.proxyList[t].name);
            return e
        }

        saveProxys() {
            r.ConfigHelperNS.setValue("ProxyList", "proxys", this.formatProxys()).catch(), r.ConfigHelperNS.setValue("ConnectType", "ProxyName", this.getProxyNames()).catch()
        }

        initProxys() {
            return a(this, void 0, void 0, function* () {
                let e = yield r.ConfigHelperNS.getValue("ProxyList", "proxys", []);
                if (e.length > 0) for (let t = 0; t < e.length; ++t) {
                    let i = e[t].split(";"), n = {};
                    n.name = i[0], n.host = i[1], n.type = i[3], n.userName = void 0 !== i[4] ? i[4] : "", n.passWord = void 0 !== i[5] ? i[5] : "", i[2] ? n.port = Number(i[2]) ? Number(i[2]) : 80 : n.port = 80, this.proxyList.push(n)
                }
            })
        }

        mounted() {
            this.initProxys().catch()
        }
    };
    n([o.Prop({})], u.prototype, "item", void 0), n([o.Prop()], u.prototype, "value", void 0), n([o.Prop()], u.prototype, "disabled", void 0), u = n([o.Component({components: {}})], u), t.default = u
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(17), a = i(4), o = i(103), r = i(104), s = i(64);
    !function (e) {
        class t extends s.CommonIPCBase.Communicator {
            constructor() {
                super()
            }

            initialize(e) {
                this.currInfo = {id: void 0, context: e, isMainCommunicator: !1}
            }

            connect() {
                this.isConnected ? o.warning("has been connected") : (this.sendConnectMsgToMain(), this.isConnected = !0, this.startListenIPCMessage(!1))
            }

            disconnect() {
                this.isConnected ? (this.isConnected = !1, this.sendDisconnectMsgToMain()) : o.warning("hasnot been connected yet")
            }

            sendMessageToMain(e) {
                this.sendIPCMsgToMain(e)
            }

            sendMessageToMainSync(e) {
                return this.sendIPCMsgToMain(e, !0)
            }

            sendMessageToRenderer(e, t) {
                this.sendIPCMsgToRenderer(e, t)
            }

            handleRendererConnectMsg(e, t) {
                do {
                    if (a.isNullOrUndefined(t)) {
                        o.error("msgInfo is null");
                        break
                    }
                    let e = t.msg.args[0];
                    if (a.isNullOrUndefined(e)) {
                        o.error("connectRendererInfo is null");
                        break
                    }
                    o.information(`Renderer: new renderer will connect, id = ${e.id}, context = ${e.context}`), this.rendererInfos.push(e)
                } while (0)
            }

            handleRendererDisconnectMsg(e, t) {
                do {
                    if (a.isNullOrUndefined(t)) {
                        o.error("msgInfo is null");
                        break
                    }
                    let e = t.msg.args[0];
                    if (a.isNullOrUndefined(e)) {
                        o.error("disconnectRendererInfo is null");
                        break
                    }
                    o.information(`renderer will disconnect, id = ${e.id}, context = ${e.context}`);
                    for (let t = 0; t < this.rendererInfos.length; ++t) if (this.rendererInfos[t] === e) {
                        this.rendererInfos.splice(t, 1);
                        break
                    }
                } while (0)
            }

            sendConnectMsgToMain() {
                let e = this.sendMessageToMainSync({name: r.CommonIPCMessage.msgIPCRendererConnect, args: []});
                this.currInfo.id = e[0], this.rendererInfos = e[1]
            }

            sendDisconnectMsgToMain() {
                this.sendMessageToMain({name: r.CommonIPCMessage.msgIPCRendererDisconnect, args: []})
            }

            sendIPCMsgToMain(e, t = !1) {
                let i = void 0;
                do {
                    if (a.isNullOrUndefined(e)) {
                        o.error("msg is null");
                        break
                    }
                    i = (t ? n.ipcRenderer.sendSync : n.ipcRenderer.send)(r.CommonIPCMessage.msgIPCSendToMain, {
                        msg: e,
                        senderInfo: this.currInfo
                    })
                } while (0);
                return i
            }

            sendIPCMsgToRenderer(e, t) {
                do {
                    if (a.isNullOrUndefined(e)) {
                        o.error("rendererId is null");
                        break
                    }
                    if (a.isNullOrUndefined(t)) {
                        o.error("msg is null");
                        break
                    }
                    let i = [e].concat(t.args);
                    t.args = i, n.ipcRenderer.send(r.CommonIPCMessage.msgIPCSendToRenderer, {
                        msg: t,
                        senderInfo: this.currInfo
                    })
                } while (0)
            }
        }

        e.RendererCommunicator = t, e.rendererCommunicator = new t
    }(t.CommonIPCRenderer || (t.CommonIPCRenderer = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(0), a = i(3), o = i(15), r = n.default.getLogger("DownloadKernel.CategoryView"),
        s = o.DownloadKernelEventManager.getEventManager();
    t.CategoryView = class {
        constructor(e, t) {
            this.categoryId = e, this.categoryViewId = t, this.tasks = new Map
        }

        getCategoryViewId() {
            return this.categoryViewId
        }

        getTasks() {
            return this.tasks
        }

        getTaskCount() {
            return this.tasks.size
        }

        insertTask(e, t = a.DownloadKernel.TaskInsertReason.Unknown) {
            if (null !== e) {
                let i = [];
                for (let t = 0; t < e.length; ++t) {
                    let n = e[t];
                    if (!n) continue;
                    n.setCategoryViewId(this.categoryViewId);
                    let o = n.getTaskAttribute(a.DownloadKernel.TaskAttribute.TaskId);
                    0 !== o && (this.tasks.set(o, n), i.push(n)), r.information("insertTask categoryId:", this.categoryId, ", catygoryViewId:", this.categoryViewId, "taskId:", o)
                }
                s.fireTaskEvent(a.DownloadKernel.TaskEventType.InsertToCategoryView, this.categoryId, this.categoryViewId, i, t)
            }
        }

        removeTask(e) {
            if (null !== e) {
                let t = [];
                for (let i = 0; i < e.length; ++i) {
                    let n = e[i];
                    if (!n) continue;
                    let o = n.getTaskAttribute(a.DownloadKernel.TaskAttribute.TaskId);
                    this.tasks.has(o) && (this.tasks.delete(o), t.push(n)), r.information("removeTask catygoryView:", this.categoryViewId, "taskId:", o)
                }
                s.fireTaskEvent(a.DownloadKernel.TaskEventType.RemoveFromCategoryView, this.categoryId, this.categoryViewId, t)
            }
        }
    }
}, function (e, t, i) {
    "use strict";
    var n = i(48), a = i(496), o = {"Content-Type": "application/x-www-form-urlencoded"};

    function r(e, t) {
        !n.isUndefined(e) && n.isUndefined(e["Content-Type"]) && (e["Content-Type"] = t)
    }

    var s, l = {
        adapter: ("undefined" != typeof XMLHttpRequest ? s = i(497) : "undefined" != typeof process && (s = i(21)), s),
        transformRequest: [function (e, t) {
            return a(t, "Content-Type"), n.isFormData(e) || n.isArrayBuffer(e) || n.isBuffer(e) || n.isStream(e) || n.isFile(e) || n.isBlob(e) ? e : n.isArrayBufferView(e) ? e.buffer : n.isURLSearchParams(e) ? (r(t, "application/x-www-form-urlencoded;charset=utf-8"), e.toString()) : n.isObject(e) ? (r(t, "application/json;charset=utf-8"), JSON.stringify(e)) : e
        }],
        transformResponse: [function (e) {
            if ("string" == typeof e) try {
                e = JSON.parse(e)
            } catch (e) {
            }
            return e
        }],
        timeout: 0,
        xsrfCookieName: "XSRF-TOKEN",
        xsrfHeaderName: "X-XSRF-TOKEN",
        maxContentLength: -1,
        validateStatus: function (e) {
            return e >= 200 && e < 300
        }
    };
    l.headers = {common: {Accept: "application/json, text/plain, */*"}}, n.forEach(["delete", "get", "head"], function (e) {
        l.headers[e] = {}
    }), n.forEach(["post", "put", "patch"], function (e) {
        l.headers[e] = n.merge(o)
    }), e.exports = l
}, function (e, t, i) {
    "use strict";
    var n = i(406);
    e.exports = function (e, t, i, a, o) {
        var r = new Error(e);
        return n(r, t, i, a, o)
    }
}, function (e, t) {
    e.exports = require("https")
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(31), o = i(0), r = i(4), s = o.default.getLogger("download-panel-thunderPanTask");
    !function (e) {
        e.createPanTable = function () {
            let e = a.ThunderKernel.beginTransaction();
            a.ThunderKernel.execSqlite("CREATE TABLE if not exists ThunderPanTask (       id  INTEGER PRIMARY KEY,       TaskId BIGINT not null,       PanTaskId varchar(255),       Data Blob,       FileId varchar(255),       UserId varchar(20) not null,       FOREIGN KEY(TaskId) REFERENCES TaskBase(TaskId)      );", e => {
            }), a.ThunderKernel.execSqlite("CREATE INDEX if not exists PanTaskId ON ThunderPanTask (PanTaskId);                              CREATE INDEX if not exists FileId ON ThunderPanTask (FileId);                              CREATE INDEX if not exists TaskId ON ThunderPanTask (TaskId);    ", e => {
            }), a.ThunderKernel.commitTransaction(e)
        }, e.insertTask = function (e, t, i, n) {
            let o, l = !0;
            return r.isNullOrUndefined(n) ? (s.error("error param, expect data, got 0. "), !1) : (o = `INSERT INTO ThunderPanTask (TaskId, PanTaskId, UserId, Data) VALUES (${e}, '${t}', '${i}', '${n}')`, a.ThunderKernel.execSqlite(o, e => {
                l = !!e
            }), l)
        }, e.queryTask = function (e, t) {
            return n(this, void 0, void 0, function* () {
                let i = {};
                return new Promise(function (n, o) {
                    a.ThunderKernel.querySqlite(`SELECT PanTaskId, FileId, Data from ThunderPanTask where TaskId = ${e} and userId = '${t}'`, e => {
                        if (e && 1 === e.length) {
                            for (let t of e[0]) i[t.key] = t.value;
                            n(i)
                        } else n(void 0)
                    })
                })
            })
        }, e.deleteTask = function (e, t, i) {
            let n, o = !1;
            if (e) n = `DELETE FROM ThunderPanTask where PanTaskId = '${e}'`; else if (t) n = `DELETE FROM ThunderPanTask WHERE FileId = '${t}'`; else {
                if (!i) return s.error("deleteTask got wrong param, expect 1, get 0"), !1;
                n = `DELETE FROM ThunderPanTask where TaskId = ${i}`
            }
            return a.ThunderKernel.execSqlite(n, e => {
                e && (o = !0)
            }), o
        }, e.updateTaskPath = function (e, t) {
            let i = !1;
            return a.ThunderKernel.execSqlite(`UPDATE ThunderPanTask SET Data = '${t}' where fileId = '${e}'`, e => {
                e && (i = !0)
            }), i
        }, e.updateTaskFileId = function (e, t) {
            let i = !1;
            return a.ThunderKernel.execSqlite(`UPDATE ThunderPanTask SET FileId = '${t}' WHERE PanTaskId = '${e}';`, e => {
                e && (i = !0)
            }), i
        }
    }(t.thunderPanTask || (t.thunderPanTask = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(3), a = i(40).DownloadKernelCategoryViewManager.getCategoryViewManager(),
        o = i(0).default.getLogger("TaskCtrlHelper.DownloadProgress");
    !function (e) {
        function t() {
            let e = -1, t = 0, i = 0, r = [], s = a.getCategoryViewFromId(n.DownloadKernel.CategroyViewID.Downloading);
            if (s) {
                let a = s.getTasks(), o = void 0, l = void 0;
                for (let [, e]of a) null !== e && ((o = e.getTaskStatus()) !== n.DownloadKernel.TaskStatus.PreDownloading && o !== n.DownloadKernel.TaskStatus.StartWaiting && o !== n.DownloadKernel.TaskStatus.StartPending && o !== n.DownloadKernel.TaskStatus.Started || (t += (l = e.getTaskBaseInfo()).fileSize, i += l.downloadSize, r.push(e.getId())));
                t > 0 && (e = i / t)
            }
            return r.length > 0 && -1 === e && (e = 0), e >= 1 && (e = 1), o.information("progress:", e), {
                progress: e,
                downloadingTaskIds: r
            }
        }

        e.getDownloadDetails = t, e.getDownloadProgressPercent = function () {
            let e = t().progress, i = "0.01%";
            return i = (100 * (e = e < 0 ? 0 : e)).toFixed(2) + "%"
        }, e.getDownloadProgress = function () {
            let e = t().progress;
            return e = e < 0 ? 0 : e
        }
    }(t.DownloadProgressNS || (t.DownloadProgressNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(2), a = i(35), o = i(3), r = i(10), s = i(60);
    !function (e) {
        let t;

        function i(e, i) {
            let n = {sortBy: t.Default, asce: !0};
            do {
                if (void 0 === e || null === e) break;
                let a = "", s = "";
                if (e === o.DownloadKernel.CategroyViewID.Downloading) -1 === i ? (a = "CategoryViewId1_SortAttr", s = "CategoryViewId1_SortState") : (a = "CategoryViewId4_SortAttr", s = "CategoryViewId4_SortState"); else if (e === o.DownloadKernel.CategroyViewID.Completed) -1 === i ? (a = "CategoryViewId2_SortAttr", s = "CategoryViewId2_SortState") : (a = "CategoryViewId5_SortAttr", s = "CategoryViewId5_SortState"); else {
                    if (e !== o.DownloadKernel.CategroyViewID.Recycle) break;
                    a = "CategoryViewId3_SortAttr", s = "CategoryViewId3_SortState"
                }
                let l = r.ConfigNS.getValue("TaskList", a, t.Default);
                e !== o.DownloadKernel.CategroyViewID.Downloading && (l !== t.ByProgress && l !== t.ByState || (l = t.Default));
                let d = 0 === r.ConfigNS.getValue("TaskList", s, -1);
                n.sortBy = l, n.asce = d
            } while (0);
            return n
        }

        function l(e, t, i) {
            do {
                if (void 0 === t || null === t) break;
                let n = "", a = "";
                if (t === o.DownloadKernel.CategroyViewID.Downloading) -1 === i ? (n = "CategoryViewId1_SortAttr", a = "CategoryViewId1_SortState") : (n = "CategoryViewId4_SortAttr", a = "CategoryViewId4_SortState"); else if (t === o.DownloadKernel.CategroyViewID.Completed) -1 === i ? (n = "CategoryViewId2_SortAttr", a = "CategoryViewId2_SortState") : (n = "CategoryViewId5_SortAttr", a = "CategoryViewId5_SortState"); else {
                    if (t !== o.DownloadKernel.CategroyViewID.Recycle) break;
                    n = "CategoryViewId3_SortAttr", a = "CategoryViewId3_SortState"
                }
                r.ConfigNS.setValue("TaskList", n, e.sortBy);
                let s = e.asce ? 0 : -1;
                r.ConfigNS.setValue("TaskList", a, s)
            } while (0)
        }

        function d(e, t) {
            let i = null;
            return e === o.DownloadKernel.CategroyViewID.Downloading ? i = ((e, i) => {
                let n = e.createTime, a = i.createTime;
                return t ? n - a : a - n
            }) : e === o.DownloadKernel.CategroyViewID.Completed ? i = ((e, i) => {
                let n = e.completionTime, a = i.completionTime;
                return t ? n - a : a - n
            }) : e === o.DownloadKernel.CategroyViewID.Recycle && (i = ((e, i) => {
                let n = e.recycleTime, a = i.recycleTime;
                return t ? n - a : a - n
            })), i
        }

        function u(e) {
            return (t, i) => {
                let a = t.taskType, o = i.taskType;
                if (e) {
                    if (a === o) {
                        let e = n.extname(t.taskName).toLowerCase(), a = n.extname(i.taskName).toLowerCase();
                        return e === a ? 0 : e < a ? -1 : 1
                    }
                    return a - o
                }
                if (a === o) {
                    let e = n.extname(t.taskName).toLowerCase(), a = n.extname(i.taskName).toLowerCase();
                    return e === a ? 0 : e < a ? 1 : -1
                }
                return o - a
            }
        }

        function c(e) {
            return (t, i) => {
                let n = t.fileSize, a = i.fileSize;
                return e ? n - a : a - n
            }
        }

        function h(e) {
            return (t, i) => {
                let n = t.taskName, o = i.taskName;
                return e ? a.ThunderHelper.compareStr(o, n) : a.ThunderHelper.compareStr(n, o)
            }
        }

        function f(e) {
            return (t, i) => {
                let n = s.TaskStatusHelper.getValueForSort(t), a = s.TaskStatusHelper.getValueForSort(i);
                return e ? n - a : a - n
            }
        }

        function g(e) {
            return (t, i) => {
                if (0 === t.fileSize && i.fileSize > 0) return e ? -1 : 1;
                if (t.fileSize > 0 && 0 === i.fileSize) return e ? 1 : -1;
                if (0 === t.fileSize && 0 === i.fileSize) return 0;
                {
                    let n = t.downloadSize / t.fileSize, a = i.downloadSize / i.fileSize;
                    return e ? n - a : a - n
                }
            }
        }

        function p(e, n, a) {
            let o = null;
            void 0 !== a && null !== a || (a = i(e, n));
            do {
                if (a.asce = !1, a.sortBy === t.Default) {
                    o = d(e, !1);
                    break
                }
                if (a.sortBy === t.ByTime_Creation || a.sortBy === t.ByTime_Completion || a.sortBy === t.ByTime_Remain) {
                    o = d(e, a.asce);
                    break
                }
                if (a.sortBy === t.BySize) {
                    o = c(a.asce);
                    break
                }
                if (a.sortBy === t.ByType) {
                    o = u(a.asce);
                    break
                }
                if (a.sortBy === t.ByName) {
                    o = h(a.asce);
                    break
                }
                if (a.sortBy === t.ByProgress) {
                    o = g(a.asce);
                    break
                }
                if (a.sortBy === t.ByState) {
                    o = f(a.asce);
                    break
                }
            } while (0);
            return null === o && (o = d(e, !1)), o
        }

        function v(e, t, i) {
            let n = void 0, a = void 0;
            return e === o.DownloadKernel.CategroyViewID.Downloading ? a = 0 : e === o.DownloadKernel.CategroyViewID.Completed ? a = 1 : e === o.DownloadKernel.CategroyViewID.Recycle && (a = 2), void 0 !== a && (n = {
                compareFn: p(e, t, i),
                index: a,
                categoryId: t
            }), n
        }

        !function (e) {
            e[e.Default = -10] = "Default", e[e.ByTime_Remain = 14] = "ByTime_Remain", e[e.ByTime_Creation = 17] = "ByTime_Creation", e[e.ByTime_Completion = 19] = "ByTime_Completion", e[e.ByType = 16] = "ByType", e[e.ByName = 1] = "ByName", e[e.BySize = 9] = "BySize", e[e.ByProgress = 18] = "ByProgress", e[e.ByState = 10] = "ByState", e[e.ByTime = 99] = "ByTime"
        }(t = e.SortType || (e.SortType = {})), e.getSortConfig = i, e.setSortConfig = l, e.getSortFuncByConfig = p, e.getSortCommitParamByConfig = v, e.handleSortMenuClick = function (e, i, n, a, r) {
            let s = !1;
            i === t.ByTime && (i = a === o.DownloadKernel.CategroyViewID.Downloading ? t.ByTime_Creation : a === o.DownloadKernel.CategroyViewID.Completed ? t.ByTime_Completion : a === o.DownloadKernel.CategroyViewID.Recycle ? t.ByTime_Remain : t.Default), i !== t.Default && (s = void 0 === n || n), l({
                sortBy: i,
                asce: !s
            }, a, r), e(v(a, r))
        }
    }(t.SortNS || (t.SortNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(18), o = i(2), r = i(6), s = i(34), l = i(14),
        d = r.default(o.join(__rootDir, "../bin/ThunderHelper.node")), u = i(0).default.getLogger("errorcode-config");
    let {isDef: c} = l.ThunderUtil;
    var h;
    !function (e) {
        e.Download = "download", e.Speed = "speed", e.Dcdn = "dcdn"
    }(h = t.ErrorType || (t.ErrorType = {}));

    class f {
        constructor() {
            this.codeMap = new Map, this.codes = null, this.getConfigs().then(e => {
                e && 0 === e.result && e.task_info && e.task_info.pc_client && (this.codes = e.task_info.pc_client, this.codes.speed_code && this.setCodeMap(h.Speed, this.codes.speed_code), this.codes.download_code && this.setCodeMap(h.Download, this.codes.download_code), this.codes.dcdn_code && this.setCodeMap(h.Dcdn, this.codes.dcdn_code))
            }).catch()
        }

        getMessage(e, t) {
            let i = void 0, n = this.codeMap.get(e);
            return n && (i = n.get(t)), i
        }

        getData(e) {
            let t = void 0;
            return this.codes && this.codes[e] && (t = JSON.stringify(this.codes[e])), t
        }

        getConfigs() {
            return n(this, void 0, void 0, function* () {
                let e = (yield this.getThunderVersionNumber()) || 0, t = Math.floor((new Date).getTime() / 1e3),
                    n = Math.random(), o = "!@#$%^&*()QAZxl_pc" + e + t + n,
                    r = "client_name=xl_pc&client_version=" + e + "&ts=" + t + "&r=" + n + "&key=" + (o = (o = s.ToolsUtilitiesAWNS.genarateMd5(o)).toUpperCase());
                u.information("key", o);
                const l = `http://download.code.lixian.vip.xunlei.com/errcode?${r}`;
                u.information("url", l);
                let d = null;
                try {
                    a.default.defaults.adapter = i(21);
                    let e = yield a.default.get(l, {timeout: 15e3});
                    u.information("getConfigs res", e), 200 === e.status && c(e.data) && e.data instanceof Object && (d = e.data)
                } catch (e) {
                    u.warning(e)
                }
                return d
            })
        }

        setCodeMap(e, t) {
            let i = new Map;
            for (let e of t) if (e.code) {
                let t = e.code.length, n = e.code.search(/\-/);
                if (n > 0 && n < t - 1) {
                    let a = Number(e.code.substring(0, n)), o = Number(e.code.substring(n + 1, t));
                    for (let t = a; t <= o; t++) i.set(t, e.message)
                } else {
                    let t = Number(e.code);
                    i.set(t, e.message)
                }
            }
            this.codeMap.set(e, i)
        }

        getThunderVersionNumber() {
            return n(this, void 0, void 0, function* () {
                let e = o.join(__rootDir, "../../Thunder.exe"), t = 0, i = d.getFileVersion(e).split(".");
                if (i && 4 === i.length) {
                    let e = Number(i[0]).valueOf(), n = Number(i[1]).valueOf(), a = Number(i[2]).valueOf();
                    t = 128 * Math.pow(2, 24) + e * Math.pow(2, 16) + n * Math.pow(2, 8) + a
                }
                return t
            })
        }
    }

    t.ErrorCodeConfig = f, t.default = new f
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(0), o = i(2), r = i(6), s = i(4), l = i(65),
        d = r.default(o.join(__rootDir, "../bin/ThunderHelper.node")), u = a.default.getLogger("BaiduDWZ");
    let c = {};

    function h(e, t, i) {
        return n(this, void 0, void 0, function* () {
            return s.isNullOrUndefined(t) && (t = 120), s.isNullOrUndefined(i) && (i = "xdas_send2phone_qr"), l.fetchSlRes({
                url: "/xlppc.dljgo.api/v2/create",
                data: {url: e, timeout: t, source: i},
                method: "post"
            })
        })
    }

    t.getBaiduDWZ = function (e) {
        return n(this, void 0, void 0, function* () {
            let t = "";
            u.information("getBaiduDWZ enter cacheDWZs = ", c);
            do {
                if (null === e || "" === e) break;
                if (-1 !== e.indexOf("&taskDownload=")) {
                    let t = e.match(/.*&taskDownload=(.*)&scheme=xunleiapp:.?/);
                    if (t && t.length > 0) {
                        let i = t[1];
                        d.isThunderPrivateUrl(i) || (i = d.makeThunderPrivateUrl(i), e = e.replace(t[1], i))
                    }
                }
                u.information("getBaiduDWZ url = ", e);
                let i = e;
                if (null !== c[i] && void 0 !== c[i]) {
                    t = c[i];
                    break
                }
                let n = "";
                try {
                    let t = yield h(e);
                    u.information("getBaiduDWZ res = ", t), 200 === t.status && t.data && "ok" === t.data.result && (n = t.data.dlj)
                } catch (e) {
                    n = ""
                }
                "" !== n && (c[i] = n), t = n
            } while (0);
            return u.information("getBaiduDWZ leave ret = ", t), t
        })
    }
}, function (e, t) {
    (function () {
        t.defaults = {
            .1: {
                explicitCharkey: !1,
                trim: !0,
                normalize: !0,
                normalizeTags: !1,
                attrkey: "@",
                charkey: "#",
                explicitArray: !1,
                ignoreAttrs: !1,
                mergeAttrs: !1,
                explicitRoot: !1,
                validator: null,
                xmlns: !1,
                explicitChildren: !1,
                childkey: "@@",
                charsAsChildren: !1,
                includeWhiteChars: !1,
                async: !1,
                strict: !0,
                attrNameProcessors: null,
                attrValueProcessors: null,
                tagNameProcessors: null,
                valueProcessors: null,
                emptyTag: ""
            },
            .2: {
                explicitCharkey: !1,
                trim: !1,
                normalize: !1,
                normalizeTags: !1,
                attrkey: "$",
                charkey: "_",
                explicitArray: !0,
                ignoreAttrs: !1,
                mergeAttrs: !1,
                explicitRoot: !0,
                validator: null,
                xmlns: !1,
                explicitChildren: !1,
                preserveChildrenOrder: !1,
                childkey: "$$",
                charsAsChildren: !1,
                includeWhiteChars: !1,
                async: !1,
                strict: !0,
                attrNameProcessors: null,
                attrValueProcessors: null,
                tagNameProcessors: null,
                valueProcessors: null,
                rootName: "root",
                xmldec: {version: "1.0", encoding: "UTF-8", standalone: !0},
                doctype: null,
                renderOpts: {pretty: !0, indent: "  ", newline: "\n"},
                headless: !1,
                chunkSize: 1e4,
                emptyTag: "",
                cdata: !1
            }
        }
    }).call(this)
}, function (e, t, i) {
    (function () {
        var t, n, a, o, r, s, l, d, u, c, h, f, g, p = {}.hasOwnProperty;
        l = i(115), d = i(116), t = i(113), n = i(114), u = i(112), h = i(121), f = i(122), c = i(123), a = i(117), o = i(119), r = i(118), s = i(120), g = i(420), e.exports = function (e) {
            function i(e) {
                i.__super__.constructor.call(this, e)
            }

            return function (e, t) {
                for (var i in t) p.call(t, i) && (e[i] = t[i]);

                function n() {
                    this.constructor = e
                }

                n.prototype = t.prototype, e.prototype = new n, e.__super__ = t.prototype
            }(i, g), i.prototype.document = function (e) {
                var t, i, a, o, r;
                for (this.textispresent = !1, o = "", i = 0, a = (r = e.children).length; i < a; i++) t = r[i], o += function () {
                    switch (!1) {
                        case!(t instanceof l):
                            return this.declaration(t);
                        case!(t instanceof d):
                            return this.docType(t);
                        case!(t instanceof n):
                            return this.comment(t);
                        case!(t instanceof c):
                            return this.processingInstruction(t);
                        default:
                            return this.element(t, 0)
                    }
                }.call(this);
                return this.pretty && o.slice(-this.newline.length) === this.newline && (o = o.slice(0, -this.newline.length)), o
            }, i.prototype.attribute = function (e) {
                return " " + e.name + '="' + e.value + '"'
            }, i.prototype.cdata = function (e, t) {
                return this.space(t) + "<![CDATA[" + e.text + "]]>" + this.newline
            }, i.prototype.comment = function (e, t) {
                return this.space(t) + "\x3c!-- " + e.text + " --\x3e" + this.newline
            }, i.prototype.declaration = function (e, t) {
                var i;
                return i = this.space(t), i += '<?xml version="' + e.version + '"', null != e.encoding && (i += ' encoding="' + e.encoding + '"'), null != e.standalone && (i += ' standalone="' + e.standalone + '"'), i += this.spacebeforeslash + "?>", i += this.newline
            }, i.prototype.docType = function (e, i) {
                var l, d, u, h, f;
                if (i || (i = 0), h = this.space(i), h += "<!DOCTYPE " + e.root().name, e.pubID && e.sysID ? h += ' PUBLIC "' + e.pubID + '" "' + e.sysID + '"' : e.sysID && (h += ' SYSTEM "' + e.sysID + '"'), e.children.length > 0) {
                    for (h += " [", h += this.newline, d = 0, u = (f = e.children).length; d < u; d++) l = f[d], h += function () {
                        switch (!1) {
                            case!(l instanceof a):
                                return this.dtdAttList(l, i + 1);
                            case!(l instanceof o):
                                return this.dtdElement(l, i + 1);
                            case!(l instanceof r):
                                return this.dtdEntity(l, i + 1);
                            case!(l instanceof s):
                                return this.dtdNotation(l, i + 1);
                            case!(l instanceof t):
                                return this.cdata(l, i + 1);
                            case!(l instanceof n):
                                return this.comment(l, i + 1);
                            case!(l instanceof c):
                                return this.processingInstruction(l, i + 1);
                            default:
                                throw new Error("Unknown DTD node type: " + l.constructor.name)
                        }
                    }.call(this);
                    h += "]"
                }
                return h += this.spacebeforeslash + ">", h += this.newline
            }, i.prototype.element = function (e, i) {
                var a, o, r, s, l, d, g, v, m, y, k, T, w;
                for (g in i || (i = 0), w = !1, this.textispresent ? (this.newline = "", this.pretty = !1) : (this.newline = this.newlinedefault, this.pretty = this.prettydefault), v = "", v += (T = this.space(i)) + "<" + e.name, m = e.attributes) p.call(m, g) && (a = m[g], v += this.attribute(a));
                if (0 === e.children.length || e.children.every(function (e) {
                    return "" === e.value
                })) this.allowEmpty ? v += "></" + e.name + ">" + this.newline : v += this.spacebeforeslash + "/>" + this.newline; else if (this.pretty && 1 === e.children.length && null != e.children[0].value) v += ">", v += e.children[0].value, v += "</" + e.name + ">" + this.newline; else {
                    if (this.dontprettytextnodes) for (r = 0, l = (y = e.children).length; r < l; r++) if (null != (o = y[r]).value) {
                        this.textispresent++, w = !0;
                        break
                    }
                    for (this.textispresent && (this.newline = "", this.pretty = !1, T = this.space(i)), v += ">" + this.newline, s = 0, d = (k = e.children).length; s < d; s++) o = k[s], v += function () {
                        switch (!1) {
                            case!(o instanceof t):
                                return this.cdata(o, i + 1);
                            case!(o instanceof n):
                                return this.comment(o, i + 1);
                            case!(o instanceof u):
                                return this.element(o, i + 1);
                            case!(o instanceof h):
                                return this.raw(o, i + 1);
                            case!(o instanceof f):
                                return this.text(o, i + 1);
                            case!(o instanceof c):
                                return this.processingInstruction(o, i + 1);
                            default:
                                throw new Error("Unknown XML node type: " + o.constructor.name)
                        }
                    }.call(this);
                    w && this.textispresent--, this.textispresent || (this.newline = this.newlinedefault, this.pretty = this.prettydefault), v += T + "</" + e.name + ">" + this.newline
                }
                return v
            }, i.prototype.processingInstruction = function (e, t) {
                var i;
                return i = this.space(t) + "<?" + e.target, e.value && (i += " " + e.value), i += this.spacebeforeslash + "?>" + this.newline
            }, i.prototype.raw = function (e, t) {
                return this.space(t) + e.value + this.newline
            }, i.prototype.text = function (e, t) {
                return this.space(t) + e.value + this.newline
            }, i.prototype.dtdAttList = function (e, t) {
                var i;
                return i = this.space(t) + "<!ATTLIST " + e.elementName + " " + e.attributeName + " " + e.attributeType, "#DEFAULT" !== e.defaultValueType && (i += " " + e.defaultValueType), e.defaultValue && (i += ' "' + e.defaultValue + '"'), i += this.spacebeforeslash + ">" + this.newline
            }, i.prototype.dtdElement = function (e, t) {
                return this.space(t) + "<!ELEMENT " + e.name + " " + e.value + this.spacebeforeslash + ">" + this.newline
            }, i.prototype.dtdEntity = function (e, t) {
                var i;
                return i = this.space(t) + "<!ENTITY", e.pe && (i += " %"), i += " " + e.name, e.value ? i += ' "' + e.value + '"' : (e.pubID && e.sysID ? i += ' PUBLIC "' + e.pubID + '" "' + e.sysID + '"' : e.sysID && (i += ' SYSTEM "' + e.sysID + '"'), e.nData && (i += " NDATA " + e.nData)), i += this.spacebeforeslash + ">" + this.newline
            }, i.prototype.dtdNotation = function (e, t) {
                var i;
                return i = this.space(t) + "<!NOTATION " + e.name, e.pubID && e.sysID ? i += ' PUBLIC "' + e.pubID + '" "' + e.sysID + '"' : e.pubID ? i += ' PUBLIC "' + e.pubID + '"' : e.sysID && (i += ' SYSTEM "' + e.sysID + '"'), i += this.spacebeforeslash + ">" + this.newline
            }, i.prototype.openNode = function (e, t) {
                var i, n, a, o;
                if (t || (t = 0), e instanceof u) {
                    for (n in a = this.space(t) + "<" + e.name, o = e.attributes) p.call(o, n) && (i = o[n], a += this.attribute(i));
                    return a += (e.children ? ">" : "/>") + this.newline
                }
                return a = this.space(t) + "<!DOCTYPE " + e.rootNodeName, e.pubID && e.sysID ? a += ' PUBLIC "' + e.pubID + '" "' + e.sysID + '"' : e.sysID && (a += ' SYSTEM "' + e.sysID + '"'), a += (e.children ? " [" : ">") + this.newline
            }, i.prototype.closeNode = function (e, t) {
                switch (t || (t = 0), !1) {
                    case!(e instanceof u):
                        return this.space(t) + "</" + e.name + ">" + this.newline;
                    case!(e instanceof d):
                        return this.space(t) + "]>" + this.newline
                }
            }, i
        }()
    }).call(this)
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(92), o = i(125), r = i(25), s = i(4), l = i(23), d = i(9), u = i(44),
        c = i(0).default.getLogger("Thunder.BrowserControl"), h = [".xunlei.com", "h5-pccloud.onethingpcs.com"];

    class f {
        constructor() {
            this.privateNativeFunctionMap = [], this.limitNative = !1, this.accessibilityNatives = [], this.state = "loading"
        }

        setNativeOptions(e) {
            e && e.limit && (this.limitNative = !0, this.accessibilityNatives = e.methods || [])
        }

        trackBrowserEvent(e, t, i = "") {
            do {
                if (!t || "" === t) break;
                let n = u.parse(t);
                if (n.host && n.host.indexOf(".xunlei.com") < 0) break;
                i = i + (i.length > 0 ? "," : "") + "url=" + encodeURIComponent(t), d.XLStatNS.trackEvent("new_tab", e, "", 0, 0, 0, 0, i)
            } while (0)
        }

        createChromiumBrowser(e, t, i, r, l) {
            return n(this, void 0, void 0, function* () {
                do {
                    if (c.information("[tbc] createChromiumBrowser", t), s.isNullOrUndefined(e) || s.isNullOrUndefined(t) || s.isNullOrUndefined(i) || s.isNullOrUndefined(r)) break;
                    o.BrowserSupportNS.browserIsInitFinish() || (this.trackBrowserEvent("browser_load_init", t), yield o.BrowserSupportNS.initTBC()), this.trackBrowserEvent("browser_load_create", t);
                    let n = new a.Browser;
                    if (n.init({rect: r, parent_window: e, is_popup: i, url: t, visible: !1}), n) {
                        this.browser = n, null !== l && void 0 !== l && l.length > 0 && this.attachListeners(l);
                        let e = {
                            eventName: "call-native-func", listener: (e, i, n, a) => {
                                let o = a && a.length > 0 ? a[0] : void 0;
                                a = a && a.length > 0 ? a.slice(1) : a, this.onJsCallNativeFunction(0, i, n, a, t, o)
                            }
                        };
                        this.attachListener(e), this.browser.on("init-done", () => {
                            c.information("[tbc] init-done", t)
                        }), this.browser.on("before-nav", (e, t, i, n) => {
                            t && (c.information("[tbc] before-nav", i), this.trackBrowserEvent("browser_load_before_navigation", i))
                        }), this.browser.on("load-start", (e, t, i, n) => {
                            t && (c.information("[tbc] load-start", i), this.state = "loading", this.trackBrowserEvent("browser_load_navigation_start", i))
                        }), this.browser.on("load-end", (e, t, i, n, a) => {
                            t && "error" !== this.state && (this.state = "loaded", this.trackBrowserEvent("browser_load_navigation_result", i, "result=success"))
                        }), this.browser.on("load-error", (e, t, i, n, a, o) => {
                            !0 === t && (-105 !== n && -21 !== n && -106 !== n && -118 !== n && -7 !== n && -101 !== n || (this.state = "error", this.trackBrowserEvent("browser_load_navigation_result", i, "result=fail")))
                        })
                    }
                } while (0);
                return c.information("[tbc] createChromiumBrowser end", t), null
            })
        }

        showDevTool(e) {
            do {
                if (s.isNullOrUndefined(this.browser)) break;
                if (s.isNullOrUndefined(e)) break;
                this.browser.showDevTool(e)
            } while (0);
            return !1
        }

        navigate(e) {
            let t = !1;
            do {
                if (s.isNullOrUndefined(this.browser)) break;
                this.browser.navigate(e, "", "", !1), t = !0
            } while (0);
            return t
        }

        refresh(e) {
            do {
                if (s.isNullOrUndefined(this.browser)) break;
                if (s.isNullOrUndefined(e)) break;
                this.state = "loading", this.browser.refresh()
            } while (0);
            return !1
        }

        stop() {
            do {
                if (s.isNullOrUndefined(this.browser)) break;
                this.browser.stop()
            } while (0);
            return !1
        }

        destroyBrowser(e) {
            do {
                if (s.isNullOrUndefined(this.browser)) break;
                if (s.isNullOrUndefined(e)) break;
                c.information("[tbc]destroyBrowser"), this.browser.destroy(e), this.browser.removeAllListeners()
            } while (0);
            return !1
        }

        attachListener(e) {
            do {
                if (s.isNullOrUndefined(this.browser)) break;
                if (s.isNullOrUndefined(e) || s.isNullOrUndefined(e.eventName) || s.isNullOrUndefined(e.listener)) break;
                this.browser.addListener(e.eventName, e.listener)
            } while (0)
        }

        detachListener(e) {
            let t = !1;
            do {
                if (s.isNullOrUndefined(e)) break;
                if (s.isNullOrUndefined(e.eventName) || "" === e.eventName) break;
                if (s.isNullOrUndefined(this.browser)) break;
                this.browser.removeListener(e.eventName, e.listener), t = !0
            } while (0);
            return t
        }

        getBrowser() {
            return this.browser
        }

        getState() {
            return this.state
        }

        attachListeners(e) {
            do {
                if (s.isNullOrUndefined(this.browser)) break;
                for (let t of e) s.isNullOrUndefined(t) || s.isNullOrUndefined(t.eventName) || s.isNullOrUndefined(t.listener) || this.browser.addListener(t.eventName, t.listener)
            } while (0)
        }

        registerNativeFunction(e, t, i) {
            let n = !1;
            do {
                if (s.isNullOrUndefined(e) || "" === e) break;
                if (s.isNullOrUndefined(t)) break;
                if (!0 === i) {
                    if (s.isNullOrUndefined(this.privateNativeFunctionMap)) break;
                    let i = this.privateNativeFunctionMap.filter(t => e === t.functionName);
                    if (s.isNullOrUndefined(i) || i.length <= 0) {
                        let i = {functionName: e, nativeFunc: t};
                        this.privateNativeFunctionMap.push(i), n = !0
                    }
                } else {
                    if (s.isNullOrUndefined(f.nativeFunctionMap)) break;
                    let i = f.nativeFunctionMap.filter(t => e === t.functionName);
                    if (s.isNullOrUndefined(i) || i.length <= 0) {
                        let i = {functionName: e, nativeFunc: t};
                        f.nativeFunctionMap.push(i), n = !0
                    }
                }
            } while (0);
            return n
        }

        unregisterNativeFunction(e, t) {
            let i = !1;
            do {
                if (s.isNullOrUndefined(e) || "" === e) break;
                if (!0 === t) {
                    if (s.isNullOrUndefined(this.privateNativeFunctionMap)) break;
                    for (let t in this.privateNativeFunctionMap) if (this.privateNativeFunctionMap[Number(t)].functionName === e) {
                        this.privateNativeFunctionMap.splice(Number(t), 1), i = !0;
                        break
                    }
                } else {
                    if (s.isNullOrUndefined(f.nativeFunctionMap)) break;
                    for (let t in f.nativeFunctionMap) if (f.nativeFunctionMap[Number(t)].functionName === e) {
                        f.nativeFunctionMap.splice(Number(t), 1), i = !0;
                        break
                    }
                }
            } while (0);
            return i
        }

        callNativeFunctionCallback(e, t, ...i) {
            let n = !1;
            do {
                if (s.isNullOrUndefined(t)) break;
                if (s.isNullOrUndefined(this.browser)) break;
                this.browser.callJsFunctionById(t, ...i), n = !0
            } while (0);
            return n
        }

        callJSFunction(e, t, ...i) {
            let n = !1;
            do {
                if (s.isNullOrUndefined(t) || "" === t) break;
                if (s.isNullOrUndefined(this.browser)) break;
                this.browser.callJsFunctionByName(t, ...i), n = !0
            } while (0);
            return n
        }

        fireEvent(e, ...t) {
            let i = !1;
            do {
                if (s.isNullOrUndefined(e) || "" === e) break;
                if (s.isNullOrUndefined(this.browser)) break;
                this.browser.fireEvent(e, t), i = !0
            } while (0);
            return i
        }

        onJsCallNativeFunction(e, t, i, n, a, o) {
            let d = !1;
            do {
                if (s.isNullOrUndefined(e), s.isNullOrUndefined(t) || "" === t) break;
                if (s.isNullOrUndefined(f.nativeFunctionMap)) break;
                let u = r.default.getConfigInfo("nativeFunc", "domains") || h;
                if (!this.isUrlInDomains(a, u, o) && !s.isNullOrUndefined(this.browser)) {
                    this.browser.callJsFunctionById(i, l.NativeFunctionErrorCode.NotAllowed);
                    break
                }
                let c = f.nativeFunctionMap.filter(e => t === e.functionName);
                (s.isNullOrUndefined(c) || 0 === c.length || s.isNullOrUndefined(c[0].nativeFunc)) && (c = this.privateNativeFunctionMap.filter(e => t === e.functionName));
                let g = void 0, p = l.NativeFunctionErrorCode.Success;
                if (s.isNullOrUndefined(c) || 0 === c.length || s.isNullOrUndefined(c[0].nativeFunc)) {
                    if (p = l.NativeFunctionErrorCode.FunctionUnExist, s.isNullOrUndefined(i)) {
                        d = !0;
                        break
                    }
                    if (s.isNullOrUndefined(this.browser)) break;
                    this.browser.callJsFunctionById(i, p, g)
                } else this.limitNative && -1 === this.accessibilityNatives.indexOf(t) ? (p = l.NativeFunctionErrorCode.NotAllowed, this.browser.callJsFunctionById(i, p, g)) : c[0].nativeFunc(this, e, i, n)
            } while (0);
            return d
        }

        onJsCheckNativeFunction(e, t, i) {
            do {
                if (s.isNullOrUndefined(e), s.isNullOrUndefined(i)) break;
                if (s.isNullOrUndefined(t) || "" === t) break;
                if (s.isNullOrUndefined(f.nativeFunctionMap)) break;
                let n = f.nativeFunctionMap.filter(e => t === e.functionName), a = l.NativeFunctionErrorCode.Success;
                if ((s.isNullOrUndefined(n) || s.isNullOrUndefined(n[0]) || s.isNullOrUndefined(n[0].nativeFunc)) && (a = l.NativeFunctionErrorCode.FunctionUnExist), s.isNullOrUndefined(this.browser)) break;
                this.browser.callJsFunctionById(i, a)
            } while (0);
            return !1
        }

        static registerDefaultNativeFunction(e) {
            do {
                if (null === e || void 0 === e || e.length <= 0) break;
                for (let t = 0; t < e.length; ++t) {
                    let i = e[t].functionName, n = e[t].nativeFunc;
                    if (s.isNullOrUndefined(f.nativeFunctionMap)) break;
                    let a = f.nativeFunctionMap.filter(e => i === e.functionName);
                    if (s.isNullOrUndefined(a) || a.length <= 0) {
                        let e = {functionName: i, nativeFunc: n};
                        f.nativeFunctionMap.push(e)
                    }
                }
            } while (0)
        }

        isUrlInDomains(e, t, i) {
            let n = !1;
            for (let a = 0; a < t.length; ++a) if (e.includes(t[a]) || i && i.includes(t[a])) {
                n = !0;
                break
            }
            return n
        }
    }

    f.nativeFunctionMap = [], t.BrowserCtrl = f
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(4);
    let o = !1, r = !1, s = 0;
    const l = 2, d = 2;
    !function (e) {
        function t(e) {
            do {
                if (o) break;
                if (!e) break;
                o = !0, r = e.getDPIAwareSupport(), s = e.getSysDPIFactor()
            } while (0)
        }

        function i(e, i) {
            t(e);
            let n = 1;
            return n = r && i ? e.getMonitorDPIFactor(i) : s
        }

        function u() {
            return window.document.querySelector(".xly-findpage .xly-browser-tab").getBoundingClientRect()
        }

        e.getDpiFactor = i, e.getBrowserWindowPosition = function (e, a) {
            return n(this, void 0, void 0, function* () {
                let n = {x: 0, y: 0, width: 0, height: 0};
                do {
                    if (!e || !a) break;
                    let o = (yield a.getNativeWindowHandle()).readUIntLE(0, 4);
                    t(e);
                    let r = i(e, o), s = u(), c = yield a.getContentSize();
                    n = {
                        x: s.left * r,
                        y: s.bottom * r,
                        width: (c[0] - s.left - l) * r,
                        height: (c[1] - s.bottom - d) * r
                    }
                } while (0);
                return n
            })
        }, e.getHeaderRect = u, e.isWindowShow = function () {
            let e = window.document.querySelector(".xly-findpage.is-show");
            return !!a.isNullOrUndefined(e)
        }
    }(t.BrowserWindowNS || (t.BrowserWindowNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(17), o = i(12), r = i(28);
    !function (e) {
        e.resizeToFitContent = function (e = 0, t = 0, i) {
            return n(this, void 0, void 0, function* () {
                let n = yield o.asyncRemoteCall.getCurrentWindow();
                if (e > 0 && t > 0) yield n.setSize(e, t); else {
                    let e = document.querySelector(".td-dialog");
                    yield n.setSize(e.offsetWidth, e.offsetHeight)
                }
                i && "function" == typeof i && i(), window.requestIdleCallback(() => {
                    n.show()
                })
            })
        }, e.autoAdaptScrollIntoView = function (e, t, i) {
            let n = t.scrollTop, a = t.getBoundingClientRect(), o = e.getBoundingClientRect(), r = a.bottom;
            void 0 !== i && "number" == typeof i && i > 0 && (r = a.top + i), o.top < a.top ? t.scrollTop = n - (a.top - o.top) : o.bottom > r && (t.scrollTop = n + (o.bottom - r))
        }, e.fitWindowPosInParent = function (e, t) {
            return n(this, void 0, void 0, function* () {
                e || (e = yield o.asyncRemoteCall.getCurrentWindow()), t || (t = yield e.getParentWindow()), a.ipcRenderer.sendSync(r.ThunderChannelList.channelRMSetPosition, yield e.getNativeWindowHandle(), yield t.getNativeWindowHandle())
            })
        }, e.getWindowsInParentCenterPos = function (e, t, i) {
            return n(this, void 0, void 0, function* () {
                i || (i = yield o.asyncRemoteCall.getCurrentWindow());
                let n = yield i.getPosition(), r = yield i.getSize(),
                    s = "browser" !== process.type ? yield o.asyncRemoteCall.getScreen() : a.screen,
                    l = yield s.getCursorScreenPoint(), d = yield s.getDisplayNearestPoint(l), u = d.size.width,
                    c = d.size.height, h = r[0], f = r[1];
                n[0] + h > u && (h = u - n[0]), n[1] + f > c && (f = c - n[1]);
                let g = n[0] + (h - e) / 2, p = n[1] + (f - t) / 2;
                return g < 0 ? g = 0 : g > u - e && (g = u - e), p < 0 ? p = 0 : p > c - t && (p = c - t), [Math.round(g), Math.round(p)]
            })
        }, e.centerWnd = function (e, t, i) {
            do {
                if ("browser" !== process.type) break;
                if (!e || !t) break;
                let n = e.getNativeWindowHandle().readUIntLE(0, 4);
                if (!n) break;
                let o = t.getPosition(), r = t.getSize(), s = e.getSize(), l = a.screen.getCursorScreenPoint(),
                    d = a.screen.getDisplayNearestPoint(l), u = d.scaleFactor, c = d.size.width, h = d.size.height,
                    f = r[0], g = r[1];
                o[0] + f > c && (f = c - o[0]), o[1] + g > h && (g = h - o[1]);
                let p = o[0] + (f - s[0]) / 2, v = o[1] + (g - s[1]) / 2;
                p < 0 ? p = 0 : p > c - s[0] && (p = c - s[0]), v < 0 ? v = 0 : v > h - s[1] && (v = h - s[1]), i.setWindowPos(n, 0, p * u, v * u, 0, 0, 5)
            } while (0)
        }, e.bringWindowToTop = function (e) {
            return n(this, void 0, void 0, function* () {
                if (!e) {
                    let t = yield(yield o.asyncRemoteCall.getCurrentWindow()).getNativeWindowHandle();
                    e = t.readUIntLE(0, 4)
                }
                a.ipcRenderer.send(r.ThunderChannelList.channelMRBringWindowToTop, e)
            })
        }
    }(t.ThunderWindowNS || (t.ThunderWindowNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(65), o = i(10), r = i(24), s = i(4);
    let l = void 0;
    !function (e) {
        function t() {
            let e = "", t = new Date;
            return e = `${t.getFullYear()}${t.getMonth() + 1}${t.getDate()}`
        }

        e.isAlreadySign = function () {
            return n(this, void 0, void 0, function* () {
                let e = !1;
                if (yield r.LoginHelperNS.loginHelper.isLoginedAw()) try {
                    let t = yield a.fetchSlRes({url: "/xlppc.movie.guess.api/api/query_coin", data: {}, method: "get"});
                    if (null !== t && void 0 !== t && 200 === t.status && !s.isNullOrUndefined(t.data)) {
                        let i = t.data;
                        s.isNullOrUndefined(i.data) || s.isNullOrUndefined(i.data.is_answered) || (e = i.data.is_answered)
                    }
                } catch (e) {
                }
                return e
            })
        }, e.isHaveSignQuestion = function () {
            return n(this, void 0, void 0, function* () {
                let e = !1;
                do {
                    if (void 0 !== l && o.ConfigNS.getValue("sign", "getQuestionTime", "") === t()) {
                        e = !!l;
                        break
                    }
                    try {
                        let t = yield a.fetchSlRes({url: "/sign/pc/get_question", data: {}});
                        null !== t && void 0 !== t && 200 === t.status && null !== t.data && void 0 !== t.data && (0 === t.data.err_code ? (e = !0, l = !0) : (e = !1, l = !1))
                    } catch (e) {
                    }
                    o.ConfigNS.setValue("sign", "getQuestionTime", t())
                } while (0);
                return e
            })
        }, e.actSwitch = function (e) {
            return n(this, void 0, void 0, function* () {
                let t = {actSwitch: !1};
                try {
                    let i = yield a.fetchRequest({
                        method: "get",
                        url: "https://msg-vip-ssl.xunlei.com/xlact/conf",
                        data: {actid: e, source: 3e3}
                    });
                    if (null !== i && void 0 !== i && 200 === i.status && null !== i.data && void 0 !== i.data) {
                        let e = i.data;
                        if (0 === e.result && e.data) {
                            let i = e.data;
                            "on" === i.switch && (t = {actSwitch: !0, width: i.width, height: i.height})
                        }
                    }
                } catch (e) {
                }
                return t
            })
        }, e.getCurDate = t
    }(t.CommonSignFunctionNs || (t.CommonSignFunctionNs = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(0), r = i(5), s = i(3), l = i(60), d = i(11), u = i(315), c = i(41), h = i(45), f = i(69),
        g = i(4), p = i(34), v = i(25), m = i(51), y = i(128), k = i(47), T = i(426), w = i(35),
        C = o.default.getLogger("NativeFunction.TaskInfo"), S = d.DownloadKernelTaskManager.getTaskManager();

    class b {
        constructor() {
            u.HistoryTaskSpeedInfoNS.init().catch()
        }

        getHistoryTaskInfoString(e) {
            return n(this, void 0, void 0, function* () {
                let t = "", i = yield this.getTaskInfo(e);
                if (i) {
                    "1111111111111111111111111111111111111111" === i.gcid && (i.gcid = "");
                    let n = S.getTaskFromTaskId(e);
                    if (n) {
                        let a = yield this.getFileList(n);
                        i.fileList = a;
                        let o = i.progress, r = yield this.getHistorySpeedInfo(e, o);
                        r && (r.maxSpeed && (i.maxSpeed = r.maxSpeed), r.historySpeedMap && (i.historySpeed = r.historySpeedMap), r.historyIncreaseSpeedMap && (i.historyIncreaseSpeed = r.historyIncreaseSpeedMap), r.historyVipSpeedColorMap && (i.historyVipSpeedColor = r.historyVipSpeedColorMap), t = JSON.stringify(i), C.information("taskInfo: ", t))
                    } else C.warning("task is null")
                } else C.warning("taskInfo is null");
                return t
            })
        }

        getTaskInfoString(e) {
            return n(this, void 0, void 0, function* () {
                let t = "", i = yield this.getTaskInfo(e);
                return i ? (t = JSON.stringify(i), C.information("taskInfo: ", t)) : C.warning("taskInfo is null"), t
            })
        }

        getBtSubFileListString(e, t) {
            let i = [];
            do {
                let n = S.getTaskFromTaskId(e);
                if (!n) break;
                if (n.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskType) !== s.DownloadKernel.TaskType.Bt) break;
                let a = n.getExtraObject();
                if (!a) break;
                for (let e = 0; e < t.length; ++e) {
                    let n = t[e], o = a.getBtFileByRealIndex(n.realIndex);
                    if (!o) continue;
                    let r = {};
                    r.index = n.realIndex, r.filePath = n.relativePath, r.fileName = o.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.FileName), r.isNeedDownload = o.getIsDownload(), r.isSupportPlay = o.isSupportPlay(), r.fileSize = n.fileSize, r.cid = n.cid, r.gcid = n.gcid, r.status = n.fileStatus, r.downloadSize = n.downloadSize, r.errCode = n.errorCode, r.userRead = n.userRead, 0 !== r.errCode ? r.errMessage = l.TaskStatusHelper.getTaskErrorInfoByCode(r.errCode) : r.errMessage = "", i.push(r)
                }
            } while (0);
            return JSON.stringify(i)
        }

        getGroupTaskSubFileListString(e) {
            let t = [];
            for (let i = 0; i < e.length; ++i) {
                let n = e[i];
                if (n) {
                    let e = {};
                    e.filePath = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.RelativePath), e.index = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.FileIndex), e.taskId = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskId), e.fileName = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskName), e.url = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskUrl), e.refUrl = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.RefUrl), e.isNeedDownload = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSubTask), e.fileSize = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.FileSize), e.downloadSize = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSize), e.cid = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.Cid), e.gcid = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.Gcid), e.status = n.getTaskStatus(), e.errCode = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.ErrorCode), e.userRead = n.getUserRead(), e.isSupportPlay = n.isSupportPlay(), e.status === s.DownloadKernel.TaskStatus.Failed ? e.errMessage = l.TaskStatusHelper.getTaskErrorInfoByCode(e.errCode) : e.errMessage = "";
                    let i = n.getTaskChannelInfo();
                    e.dcdnStatus = i.dcdnStatus, t.push(e)
                }
            }
            return JSON.stringify(t)
        }

        calcGroupTaskUniqueId(e) {
            let t = "", i = e.getExtraObject(), n = i.getSubTaskCount();
            if (n > 0) {
                let e = [];
                for (let t = 0; t < n; ++t) {
                    let n = i.getSubTaskByIndex(t).getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskUrl);
                    g.isString(n) && n.length > 0 && e.push(n)
                }
                if (e.length > 0) {
                    e.sort();
                    let i = e.length, n = "#" + i + "#";
                    C.information("CalcGroupTaskUniqueID urlNum: ", i);
                    for (let t = 0; t < i; ++t) n += e[t] + "#";
                    let a = Buffer.alloc(n.length);
                    a.write(n), (t = p.ToolsUtilitiesAWNS.encryptSha1Buffer(a)) && (t = t.toUpperCase())
                }
            }
            return t
        }

        getTaskInfo(e) {
            return n(this, void 0, void 0, function* () {
                let t = {}, i = S.getTaskFromTaskId(e);
                if (i) {
                    let n = i.getTaskStatus(), o = 0;
                    n !== s.DownloadKernel.TaskStatus.Succeeded && n !== s.DownloadKernel.TaskStatus.Seeding || (o = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.CompletionTime)), i.getTaskAttribute(s.DownloadKernel.TaskAttribute.RecycleTime) > 0 && (n = 20);
                    let r = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.RefUrl),
                        d = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskUrl), u = "",
                        c = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskType),
                        h = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskName);
                    c !== s.DownloadKernel.TaskType.P2sp && c !== s.DownloadKernel.TaskType.Emule || (u = a.extname(h)) && (u = u.substring(1));
                    let g = "";
                    if (c === s.DownloadKernel.TaskType.Bt) {
                        g = i.getExtraObject().getInfoId()
                    }
                    let p = "", v = i.getTaskChannelInfo(),
                        m = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSize),
                        k = v.offlineSize + v.originSize + v.p2pSize + v.p2sSize;
                    k < m && (v.p2pSize > 0 ? v.p2pSize = v.p2pSize + m - k : v.offlineSize > 0 ? v.offlineSize = v.offlineSize + m - k : v.originSize > 0 ? v.originSize = v.originSize + m - k : v.p2sSize > 0 && (v.p2sSize = v.p2sSize + m - k));
                    let T = "";
                    c === s.DownloadKernel.TaskType.P2sp || c === s.DownloadKernel.TaskType.Emule ? T = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.Gcid) : c === s.DownloadKernel.TaskType.Group && (C.information("calcGroupTaskUniqueId before"), T = this.calcGroupTaskUniqueId(i), C.information("calcGroupTaskUniqueId end, taskId: ", i.getId(), ", uniqueId: ", T));
                    let w = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.FileSize),
                        S = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.SrcTotal),
                        b = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.SrcUsing),
                        I = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadingPeriod),
                        _ = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.CreateTime),
                        A = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.SavePath),
                        D = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.Description),
                        x = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.ErrorCode),
                        N = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.Moving), E = yield this.getActions(i),
                        P = this.getProgress(i), M = this.getSpeedInfo(i),
                        O = yield y.VipPluginFunctionNS.getVipSpeedColor(e);
                    if (t.status = n, t.taskID = e, t.type = c, t.name = h, t.gcid = T, t.suffix = u, t.url = d, t.refUrl = r, t.isFromVest = !1, t.isMoving = N, "" !== d || "" !== g) {
                        let e = "" === d ? g : d, i = yield f.isVestUrl(e, "vestURL");
                        t.isFromVest = i
                    }
                    t.size = w, t.downloadSize = m, t.progress = P, t.allResourceCount = S, t.resourceCount = b, t.errCode = x, t.status === s.DownloadKernel.TaskStatus.Failed ? t.errMessage = l.TaskStatusHelper.getTaskErrorInfoByCode(t.errCode) : t.errMessage = "", i.getStopReason() === s.DownloadKernel.TaskStopReason.SelectDownloadLists ? t.stopReason = "downloadSelected" : t.stopReason = "", t.actions = E, t.averageSpeed = M.averageSpeed, t.speed = M.speed, t.increaseSpeed = M.increaseSpeed, t.vipSpeedColor = O, t.channelInfo = v, t.savePath = A, t.infoId = g, t.duration = I, t.createTime = _, t.completeTime = o, t.md5 = p, t.note = D
                }
                return t
            })
        }

        isForbidden(e) {
            let t = !1;
            do {
                if (e.getTaskStatus() === s.DownloadKernel.TaskStatus.Failed) {
                    let i = e.getTaskAttribute(s.DownloadKernel.TaskAttribute.ErrorCode);
                    if (7 === i) {
                        t = !0;
                        break
                    }
                    if (i >= 700 && i <= 799) {
                        t = !0;
                        break
                    }
                }
            } while (0);
            return t
        }

        getActions(e) {
            return n(this, void 0, void 0, function* () {
                let t = [], i = !0;
                0 === v.default.getConfigInfo("shouleiDownload", "enable") && (i = !1);
                let n = e.getTaskStatus();
                do {
                    if (n !== s.DownloadKernel.TaskStatus.Failed && n !== s.DownloadKernel.TaskStatus.Unkown) {
                        if (e.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskType) !== s.DownloadKernel.TaskType.Group) t.push("repost"); else {
                            let i = e.getExtraObject().getUserData(m.TaskUserDataGUID.guidDownloadGroupTask, "canRepost");
                            i && "true" === i && t.push("repost")
                        }
                    }
                    if (e.getTaskAttribute(s.DownloadKernel.TaskAttribute.RecycleTime) > 0) {
                        t.push("restore"), t.push("delete");
                        break
                    }
                    if (this.isForbidden(e)) {
                        t.push("delete");
                        break
                    }
                    if (n === s.DownloadKernel.TaskStatus.Succeeded || n === s.DownloadKernel.TaskStatus.Seeding) {
                        let i = e.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskType);
                        if (i === s.DownloadKernel.TaskType.Group) {
                            if (!(yield c.TaskCtrlOperatorNS.isExistTaskFile(e.getTaskBaseInfo()))) {
                                t.push("delete");
                                break
                            }
                            t.push("openFolder")
                        } else {
                            let n = void 0;
                            if (yield h.SingleBtTaskNS.isSingleBtTask(e)) n = h.SingleBtTaskNS.getSinleBtTaskFilePath(e); else {
                                let o = e.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskName),
                                    r = e.getTaskAttribute(s.DownloadKernel.TaskAttribute.SavePath);
                                n = a.join(r, o), i !== s.DownloadKernel.TaskType.Emule && i !== s.DownloadKernel.TaskType.P2sp || k.TaskUtilHelper.isIsoExt(o) && w.ThunderHelper.isWindow8OrLater() && ("" !== (yield T.DiskImageHelperNS.getVirtualDiskPhysicalPath(n)) ? t.push("ejectiso") : t.push("mountiso"))
                            }
                            if (!(yield r.FileSystemAWNS.existsAW(n))) {
                                t.push("delete");
                                break
                            }
                            t.push("openFolder"), i !== s.DownloadKernel.TaskType.Bt && t.push("open")
                        }
                        e.isSupportPlay() && (t.push("play"), t.push("subtitleDownload"), 1 === e.getVideoFileCount() && t.push("videoPreview"));
                        break
                    }
                    if (1 === e.getTaskAttribute(s.DownloadKernel.TaskAttribute.Forbidden)) {
                        t.push("delete");
                        break
                    }
                    e.isSupportPlay() && n !== s.DownloadKernel.TaskStatus.Failed && t.push("downAndPlay"), n === s.DownloadKernel.TaskStatus.Stopped || n === s.DownloadKernel.TaskStatus.Failed || n === s.DownloadKernel.TaskStatus.Unkown ? t.push("continue") : t.push("pause"), e.isSupportPlay() && (t.push("subtitleDownload"), 1 === e.getVideoFileCount() && t.push("videoPreview"))
                } while (0);
                if (e.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskType) !== s.DownloadKernel.TaskType.Group) if (0 !== v.default.getConfigInfo("shouleiDownload", "enableTransfer")) {
                    let a = e.getTaskAttribute(s.DownloadKernel.TaskAttribute.CategoryViewId);
                    n !== s.DownloadKernel.TaskStatus.Succeeded && n !== s.DownloadKernel.TaskStatus.Seeding || !(yield c.TaskCtrlOperatorNS.isExistTaskFile(e.getTaskBaseInfo())) ? a === s.DownloadKernel.CategroyViewID.Downloading ? t.push("shouleiTransfer") : i && t.push("shouleiDownload") : t.push("shouleiTransfer")
                } else i && t.push("shouleiDownload");
                return t
            })
        }

        getProgress(e) {
            let t = 0, i = e.getTaskStatus(), n = e.getTaskAttribute(s.DownloadKernel.TaskAttribute.FileSize),
                a = e.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSize);
            return 0 !== n && 0 !== a && (i === s.DownloadKernel.TaskStatus.Succeeded || i === s.DownloadKernel.TaskStatus.Seeding || a >= n ? t = 100 : (t = a / n * 100, t = parseInt(t.toString(), 10))), t
        }

        getFileList(e) {
            return n(this, void 0, void 0, function* () {
                let t = "", i = !0, n = [], o = e.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskType);
                if (o === s.DownloadKernel.TaskType.Bt) {
                    let o = e.getExtraObject().getBtFileList(),
                        d = e.getTaskAttribute(s.DownloadKernel.TaskAttribute.SavePath),
                        u = e.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskName);
                    void 0 !== u && "" !== u && u.indexOf(".") === u.length - 1 && (u = u.substring(0, u.length - 1));
                    let c = yield h.SingleBtTaskNS.isSingleBtTask(e);
                    for (let [, f]of o) {
                        let o = {};
                        o.index = f.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.RealIndex), o.filePath = f.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.FilePath), o.fileName = f.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.FileName), o.isNeedDownload = f.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.Download), o.fileSize = f.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.FileSize), o.cid = f.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.Cid), o.gcid = f.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.Gcid), o.status = f.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.FileStatus), o.downloadSize = f.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.DownloadSize), o.errCode = f.getBtFileAttribute(s.DownloadKernel.BtFileAttribute.ErrorCode), o.isSupportPlay = f.isSupportPlay(), o.userRead = f.getUserRead(), 0 !== o.errCode ? o.errMessage = l.TaskStatusHelper.getTaskErrorInfoByCode(o.errCode) : o.errMessage = "", o.status === s.DownloadKernel.BtFileStatus.Complete ? (t = c ? h.SingleBtTaskNS.getSinleBtTaskFilePath(e) : a.join(d, u, o.filePath, o.fileName), i = yield r.FileSystemAWNS.existsAW(t), o.isDelete = !i) : o.isDelete = !1, n.push(o)
                    }
                } else if (o === s.DownloadKernel.TaskType.Group) {
                    let o = e.getExtraObject(), d = o.getSubTaskCount(), u = "";
                    for (let e = 0; e < d; ++e) {
                        let d = o.getSubTaskByIndex(e);
                        if (d) {
                            let o = {};
                            o.index = e, o.filePath = d.getTaskAttribute(s.DownloadKernel.TaskAttribute.RelativePath), o.taskId = d.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskId), o.fileName = d.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskName), o.url = d.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskUrl), o.refUrl = d.getTaskAttribute(s.DownloadKernel.TaskAttribute.RefUrl), o.isNeedDownload = d.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSubTask), o.fileSize = d.getTaskAttribute(s.DownloadKernel.TaskAttribute.FileSize), o.downloadSize = d.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSize), o.cid = d.getTaskAttribute(s.DownloadKernel.TaskAttribute.Cid), o.gcid = d.getTaskAttribute(s.DownloadKernel.TaskAttribute.Gcid), o.status = d.getTaskStatus(), o.errCode = d.getTaskAttribute(s.DownloadKernel.TaskAttribute.ErrorCode), o.isSupportPlay = d.isSupportPlay(), o.userRead = d.getUserRead(), o.status === s.DownloadKernel.TaskStatus.Failed ? o.errMessage = l.TaskStatusHelper.getTaskErrorInfoByCode(o.errCode) : o.errMessage = "";
                            let c = d.getTaskChannelInfo();
                            o.dcdnStatus = c.dcdnStatus, u = d.getTaskAttribute(s.DownloadKernel.TaskAttribute.SavePath), o.status === s.DownloadKernel.TaskStatus.Succeeded || o.status === s.DownloadKernel.TaskStatus.Seeding ? (t = a.join(u, o.fileName), i = yield r.FileSystemAWNS.existsAW(t), o.isDelete = !i) : o.isDelete = !1, n.push(o)
                        }
                    }
                }
                return n
            })
        }

        getSpeedInfo(e) {
            let t = e.getDownloadSpeed(), i = 0, n = e.getVipSpeed(),
                a = e.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSize),
                o = e.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadingPeriod);
            o < 1 && (o = 1), i = a / o, i = parseInt(i.toString(), 10);
            let r = {};
            return r.averageSpeed = i, r.speed = t, r.increaseSpeed = n, r
        }

        getHistorySpeedInfo(e, t) {
            return n(this, void 0, void 0, function* () {
                let i = {maxSpeed: 0, historySpeedMap: {}, historyIncreaseSpeedMap: {}},
                    n = yield u.HistoryTaskSpeedInfoNS.getTaskSpeedInfo(e);
                do {
                    if (!n) break;
                    if (!n.maxSpeed || n.maxSpeed < 0) break;
                    i.maxSpeed = n.maxSpeed;
                    let e = n.speedInfoMap;
                    if (!e) break;
                    void 0 === t && (t = 0), (!(t = parseInt(t.toString(), 10)) || t < 0) && (t = 0), t > 100 && (t = 100);
                    let a = {}, o = {}, r = {};
                    for (let i in e) if (void 0 !== e[i]) {
                        let n = parseInt(i, 10);
                        if (n <= t) {
                            let t = e[i];
                            a[n] = t.downloadSpeed, o[n] = t.addSpeed, r[n] = t.vipSpeedColor
                        }
                    }
                    i.historySpeedMap = a, i.historyIncreaseSpeedMap = o, i.historyVipSpeedColorMap = r
                } while (0);
                return i
            })
        }
    }

    t.TaskInfoManager = b, function (e) {
        const t = new b;
        e.getTaskInfoManager = function () {
            return t
        }
    }(t.TaskInfoManagerNS || (t.TaskInfoManagerNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(0), r = i(5), s = i(3), l = i(15), d = i(11), u = i(4), c = i(128),
        h = o.default.getLogger("NativeFunction.TaskInfoHistory"), f = l.DownloadKernelEventManager.getEventManager(),
        g = d.DownloadKernelTaskManager.getTaskManager();
    !function (e) {
        const t = new class {
            constructor() {
                this.isInit = !1
            }

            init() {
                return n(this, void 0, void 0, function* () {
                    this.isInit || (this.isInit = !0, this.taskSpeedMap = new Map, this.dataPath = a.join(__profilesDir, "TaskSpeedInfo"), (yield r.FileSystemAWNS.existsAW(this.dataPath)) || (yield r.FileSystemAWNS.mkdirsAW(this.dataPath)), f.attachTaskEvent(s.DownloadKernel.TaskEventType.DetailChanged, (...e) => {
                        this.onTaskDetailChanged(...e)
                    }), f.attachTaskEvent(s.DownloadKernel.TaskEventType.StatusChanged, (...e) => {
                        this.onTaskStatusChanged(...e)
                    }))
                })
            }

            getTaskSpeedInfo(e) {
                return n(this, void 0, void 0, function* () {
                    let t = this.taskSpeedMap.get(e);
                    return t || (yield this.loadTaskSpeedInfo(e), t = this.taskSpeedMap.get(e)), t && this.checkTaskSpeedInfo(e, t), t
                })
            }

            onTaskDetailChanged(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== s.DownloadKernel.TaskEventType.DetailChanged) break;
                    let t = e[1], i = e[2];
                    if (!t || !i) break;
                    for (let e = 0; e < t.length; ++e) {
                        let i = t[e];
                        if (!i) continue;
                        let n = 0, a = 0, o = i.getDownloadSpeed(), r = i.getVipSpeed(),
                            l = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskId),
                            d = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSize),
                            u = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadingPeriod);
                        u < 1 && (u = 1), n = Math.round(d / u);
                        let c = i.getTaskStatus();
                        if (c === s.DownloadKernel.TaskStatus.Succeeded || c === s.DownloadKernel.TaskStatus.Seeding) a = 100; else {
                            let e = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.FileSize);
                            0 !== e && (a = d / e * 100, (a = parseInt(a.toString(), 10)) > 100 ? a = 100 : a < 0 && (a = 0))
                        }
                        this.updateProgress(l, n, a, o, r).catch(e => {
                            h.warning(e)
                        })
                    }
                } while (0)
            }

            onTaskStatusChanged(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== s.DownloadKernel.TaskEventType.StatusChanged) break;
                    if (!e[1]) break;
                    let t = e[1];
                    for (let e = 0; e < t.length; ++e) {
                        let i = t[e];
                        if (!i) continue;
                        let n = i.getTaskStatus(), o = i.getTaskPreStatus();
                        if (n !== s.DownloadKernel.TaskStatus.StartWaiting && n !== s.DownloadKernel.TaskStatus.StartPending || o !== s.DownloadKernel.TaskStatus.StandBy) {
                            if (n === s.DownloadKernel.TaskStatus.Succeeded || n === s.DownloadKernel.TaskStatus.Seeding) {
                                let e = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskId),
                                    t = this.taskSpeedMap.get(e);
                                if (t) {
                                    let n = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSize),
                                        a = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadingPeriod);
                                    a < 1 && (a = 1), t.aveSpeed = Math.round(n / a), this.checkTaskSpeedInfo(e, t)
                                }
                            } else if (n === s.DownloadKernel.TaskStatus.DestroyPending) {
                                let e = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskId),
                                    t = a.join(this.dataPath, "TaskInfoEx_" + e + ".txt");
                                h.information("destroy task taskId:", e, ", taskinfo file:", t), r.FileSystemAWNS.unlinkAW(t).catch(), this.taskSpeedMap.delete(e)
                            }
                        } else {
                            let e = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskId),
                                t = this.taskSpeedMap.get(e);
                            t && (t.speedInfoMap = {}, this.taskSpeedMap.set(e, t), this.saveTaskSpeedInfo(e).catch(e => {
                                h.warning(e)
                            }))
                        }
                    }
                } while (0)
            }

            updateProgress(e, t, i, a, o) {
                return n(this, void 0, void 0, function* () {
                    let n = this.taskSpeedMap.get(e);
                    n || (n = this.newTaskSpeedInfo(e)), n.aveSpeed = t, a > n.maxSpeed && (n.maxSpeed = a), n.progress = i;
                    let r = yield c.VipPluginFunctionNS.getVipSpeedColor(e),
                        s = {progress: i, downloadSpeed: a, addSpeed: o, vipSpeedColor: r}, l = Math.floor(i);
                    100 === l && n.speedInfoMap[l] || (n.speedInfoMap[l] = s, this.taskSpeedMap.set(e, n), yield this.saveTaskSpeedInfo(e))
                })
            }

            newTaskSpeedInfo(e) {
                let t = {};
                return t.taskId = e, t.aveSpeed = 0, t.maxSpeed = 0, t.progress = 0, t.speedInfoMap = {}, t
            }

            loadTaskSpeedInfo(e) {
                return n(this, void 0, void 0, function* () {
                    let t = !1, i = "TaskInfoEx_" + e.toString() + ".txt", n = a.join(this.dataPath, i);
                    if (yield r.FileSystemAWNS.existsAW(n)) {
                        let i = yield r.FileSystemAWNS.readFileAW(n);
                        if (i) {
                            let n = null;
                            try {
                                n = JSON.parse(i.toString())
                            } catch (e) {
                                h.warning(e)
                            }
                            null !== n && (this.taskSpeedMap.set(e, n), t = !0)
                        }
                    }
                    return t
                })
            }

            checkTaskSpeedInfo(e, t) {
                let i = g.getTaskFromTaskId(e);
                if (!i) return;
                let n = i.getTaskStatus(), a = !1;
                if (u.isNumber(t.aveSpeed) || (h.warning("checkTaskSpeedInfo bad aveSpeed", ", taskId: ", e), t.aveSpeed = 0, a = !0), u.isNumber(t.maxSpeed) || (h.warning("checkTaskSpeedInfo bad maxSpeed", ", taskId: ", e), t.maxSpeed = 0, a = !0), t.aveSpeed > t.maxSpeed && (h.warning("checkTaskSpeedInfo aveSpeed > maxSpeed", ", taskId: ", e), t.aveSpeed = t.maxSpeed, a = !0), n === s.DownloadKernel.TaskStatus.Succeeded || n === s.DownloadKernel.TaskStatus.Seeding) {
                    h.information("checkTaskSpeedInfo check complete data");
                    let n = t.speedInfoMap[100], o = t.speedInfoMap[0];
                    if (!(u.isObject(n) && u.isObject(o) || 0 !== t.aveSpeed)) {
                        let n = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadSize),
                            o = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.DownloadingPeriod);
                        o < 1 && (o = 1), t.aveSpeed = Math.round(n / o), h.information("checkTaskSpeedInfo recalc aveSpeed:", t.aveSpeed, ", taskId: ", e), a = !0
                    }
                }
                a && this.saveTaskSpeedInfo(e).catch()
            }

            saveTaskSpeedInfo(e) {
                return n(this, void 0, void 0, function* () {
                    let t = !1, i = this.taskSpeedMap.get(e);
                    if (i) {
                        let n = JSON.stringify(i), o = "TaskInfoEx_" + e.toString() + ".txt",
                            s = a.join(this.dataPath, o);
                        t = yield r.FileSystemAWNS.writeFileAW(s, n)
                    }
                    return t
                })
            }
        };
        e.init = function () {
            return n(this, void 0, void 0, function* () {
                yield t.init()
            })
        }, e.getTaskSpeedInfo = function (e) {
            return n(this, void 0, void 0, function* () {
                return yield t.getTaskSpeedInfo(e)
            })
        }
    }(t.HistoryTaskSpeedInfoNS || (t.HistoryTaskSpeedInfoNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(12), r = i(0), s = i(13), l = i(3), d = i(11), u = i(36), c = i(22), h = i(27), f = i(43),
        g = i(129), p = i(4), v = i(5), m = i(426), y = i(15), k = r.default.getLogger("Thunder.TaskOperator"),
        T = d.DownloadKernelTaskManager.getTaskManager(), w = g.SubtitleManagerNS.getSubtitleManger(),
        C = y.DownloadKernelEventManager.getEventManager();
    t.TaskOperate = class {
        static operateTaskActions(e, t, i) {
            return n(this, void 0, void 0, function* () {
                switch (t) {
                    case"play":
                        this.playTask(e, i);
                        break;
                    case"playfromPreview":
                        this.playFromPreview(e, i).catch();
                        break;
                    case"downAndPlay":
                        this.downloadAndPlayTask(e, i);
                        break;
                    case"dlnaPlay":
                        this.downloadAndPlayTask(e, i, !0);
                        break;
                    case"openFolder":
                        this.openFolder(e);
                        break;
                    case"open":
                        this.open(e, i);
                        break;
                    case"continue":
                        this.startTask(e);
                        break;
                    case"pause":
                        this.stopTask(e);
                        break;
                    case"restore":
                        this.restoreTask(e);
                        break;
                    case"delete":
                        this.deleteTask(e);
                        break;
                    case"note":
                        this.noteTask(e, i);
                        break;
                    case"downloadSelectFiles":
                        yield this.downloadSelectFiles(e, i);
                        break;
                    case"showHomePage":
                        this.showHomePage(e);
                        break;
                    case"install":
                        this.installFile(e, i);
                        break;
                    case"subtitleDownload":
                        this.openSubtitleDlg(e);
                        break;
                    case"repost":
                        this.createBirdKey(e);
                        break;
                    case"mountiso":
                        this.attachVirtualDisk(e).catch();
                        break;
                    case"ejectiso":
                        this.detachVirtualDisk(e).catch()
                }
            })
        }

        static getTaskBirdKeyData(e) {
            return u.TaskOperatorNs.getTaskBirdKeyData(e)
        }

        static playTask(e, t) {
            let i = T.getTaskFromTaskId(e);
            if (i) {
                if (p.isString(t)) try {
                    t = JSON.parse(t)
                } catch (e) {
                    k.warning(e)
                }
                if (null !== t && void 0 !== t && "object" == typeof t) {
                    let n = !0;
                    if ("finished" === t.panel && (n = !1), k.information("playTask extra", t, "isEmbed", n, "categoryId", t.categoryId), u.TaskOperatorNs.downloadAndPlay(e, t.fileIndex, void 0, t.panel, t.categoryId, !1, t.percent, !0, n).catch(), !p.isNullOrUndefined(t.fileIndex)) {
                        let e = i.getType();
                        if (e === l.DownloadKernel.TaskType.Bt) {
                            let e = i.getExtraObject().getBtFileByRealIndex(t.fileIndex);
                            e && e.setUserRead(1)
                        } else if (e === l.DownloadKernel.TaskType.Group) {
                            let e = i.getExtraObject().getSubTaskByIndex(t.fileIndex);
                            e && e.setUserRead(1)
                        }
                    }
                } else u.TaskOperatorNs.downloadAndPlay(e, void 0, void 0, void 0, void 0, void 0, void 0, !0, !0).catch();
                i.setUserRead(1)
            }
        }

        static playFromPreview(e, t) {
            return n(this, void 0, void 0, function* () {
                let i = T.getTaskFromTaskId(e);
                if (!i) return void k.information("错误的任务ID,taskid=", e);
                let n, a = i.getTaskAttribute(l.DownloadKernel.TaskAttribute.CategoryViewId),
                    o = i.getTaskAttribute(l.DownloadKernel.TaskAttribute.CategoryId);
                p.isString(t) ? n = JSON.parse(t) : p.isObject(t) && (n = t);
                let r = -1, s = i.getType();
                if (s === l.DownloadKernel.TaskType.Bt) {
                    let e = i.getExtraObject().getBtFileList();
                    for (let [t, i]of e) if (i.isSupportPlay()) {
                        r = t;
                        break
                    }
                } else s === l.DownloadKernel.TaskType.Emule || s === l.DownloadKernel.TaskType.P2sp ? r = 0 : k.warning("不支持播放");
                let d = 0;
                n && void 0 !== n.posPercent && (d = n.posPercent), n && (n.fileIndex = r, n.panel = a, n.categoryId = o, n.percent = d), k.information("播放预览视频: fileIndex=", r, " panel=", a, " categoryId=", o, " percent=", d), this.playTask(e, n)
            })
        }

        static downloadAndPlayTask(e, t, i) {
            if (T.getTaskFromTaskId(e)) {
                if (p.isString(t)) try {
                    t = JSON.parse(t)
                } catch (e) {
                    k.warning(e)
                }
                null !== t && void 0 !== t && "object" == typeof t ? u.TaskOperatorNs.downloadAndPlay(e, t.fileIndex, void 0, t.panel, t.categoryId, i, void 0, !0, !0).catch() : u.TaskOperatorNs.downloadAndPlay(e, void 0, void 0, "downloading", void 0, i, void 0, !0, !0).catch()
            }
        }

        static openFolder(e) {
            let t = T.getTaskFromTaskId(e);
            if (t) {
                let e = t.getTaskBaseInfo();
                u.TaskOperatorNs.markReadStatus([e], 1), u.TaskOperatorNs.openTaskFolder(e, !0).catch()
            }
        }

        static open(e, t) {
            let i = T.getTaskFromTaskId(e);
            if (i) {
                let e = i.getTaskBaseInfo(), n = -1;
                if (n = null === t || void 0 === t || "" === t ? -1 : Number(t), u.TaskOperatorNs.openTaskItem(e, n, void 0, void 0, void 0, !0).catch(), n >= 0) {
                    let e = i.getType();
                    if (e === l.DownloadKernel.TaskType.Bt) {
                        let e = i.getExtraObject().getBtFileByRealIndex(n);
                        e && e.setUserRead(1)
                    } else if (e === l.DownloadKernel.TaskType.Group) {
                        let e = i.getExtraObject().getSubTaskByIndex(n);
                        e && e.setUserRead(1)
                    }
                }
                i.setUserRead(1)
            }
        }

        static startTask(e) {
            f.DownloadDispatchNS.startTask(e)
        }

        static stopTask(e) {
            T.stopTask(e, l.DownloadKernel.TaskStopReason.Manual)
        }

        static restoreTask(e) {
            T.recoverFromRecycle(e)
        }

        static deleteTask(e) {
            let t = T.getTaskFromTaskId(e);
            if (t) {
                let e = t.getTaskBaseInfo();
                u.TaskOperatorNs.destroyTasks([e])
            }
        }

        static noteTask(e, t) {
            if (t) {
                let i = T.getTaskFromTaskId(e);
                i && i.setDescription(t)
            }
        }

        static downloadSelectFiles(e, t) {
            return n(this, void 0, void 0, function* () {
                (yield T.downloadTaskSelectFiles(e, t)) && f.DownloadDispatchNS.startTask(e)
            })
        }

        static showHomePage(e) {
            h.default.fireEvent(s.NodeEventMesssageNS.eventShowHomePage, e)
        }

        static installFile(e, t) {
            if (null !== t && void 0 !== t && "" !== t) try {
                let i = JSON.parse(t), n = i.path, a = "";
                null !== i.runParams && void 0 !== i.runParams && "" !== i.runParams && (a = i.runParams);
                let o = T.getTaskFromTaskId(e);
                u.TaskOperatorNs.executeInstallFile(o, n, a).catch()
            } catch (e) {
            }
        }

        static openSubtitleDlg(e) {
            let t = T.getTaskFromTaskId(e);
            if (t) {
                let i = t.getTaskName(), n = t.getType(), o = "";
                t && (o = t.getSavePath()), n === l.DownloadKernel.TaskType.Bt && t.getExtraObject().getDownloadFile().length > 1 && (o = a.join(o, i));
                let r = t.getTaskAttribute(l.DownloadKernel.TaskAttribute.CategoryViewId), s = w.getDisaplayName(e),
                    d = 0;
                (d = s.length) > 1 ? c.MessageBox.custom("SubtitleTaskFilelist", {
                    size: "large",
                    taskId: e,
                    taskName: i,
                    taskType: n,
                    fileList: s,
                    saveDir: o,
                    categoryViewId: r
                }, {center: !0, width: 500, height: 329}).catch() : c.MessageBox.custom("SubtitleSearch", {
                    taskId: e,
                    taskName: i,
                    cid: s[0].cid,
                    saveDir: o,
                    from: "taskList",
                    categoryViewId: r
                }, {center: !0, width: 500, height: 323}).catch()
            }
        }

        static createBirdKey(e) {
            u.TaskOperatorNs.createBirdKey(e)
        }

        static attachVirtualDisk(e) {
            return n(this, void 0, void 0, function* () {
                do {
                    let t = T.getTaskFromTaskId(e);
                    if (!t) break;
                    let i = t.getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskName),
                        n = t.getTaskAttribute(l.DownloadKernel.TaskAttribute.SavePath), r = a.join(n, i);
                    if (!(yield v.FileSystemAWNS.existsAW(r))) break;
                    let s = yield m.DiskImageHelperNS.attachVirtualDisk(r);
                    "" !== s && (yield(yield o.asyncRemoteCall.getShell()).showItemInFolder(s), C.fireTaskEvent(l.DownloadKernel.TaskEventType.DetailChanged, [t], l.DownloadKernel.TaskDetailChangedFlags.UnKnown))
                } while (0)
            })
        }

        static detachVirtualDisk(e) {
            return n(this, void 0, void 0, function* () {
                do {
                    let t = T.getTaskFromTaskId(e);
                    if (!t) break;
                    let i = t.getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskName),
                        n = t.getTaskAttribute(l.DownloadKernel.TaskAttribute.SavePath), o = a.join(n, i);
                    if (!(yield v.FileSystemAWNS.existsAW(o))) break;
                    (yield m.DiskImageHelperNS.detachVirtualDisk(o)) && C.fireTaskEvent(l.DownloadKernel.TaskEventType.DetailChanged, [t], l.DownloadKernel.TaskDetailChangedFlags.UnKnown)
                } while (0)
            })
        }
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(2), a = i(6).default(n.join(__rootDir, "../bin/ThunderHelper.node"));
    !function (e) {
        e.getXmpPath = function () {
            let e = "";
            return e = n.join(__rootDir, "../../XMP/XMP.exe")
        }, e.getXmpReg = function (e) {
            let t = "";
            do {
                if (null === e || void 0 === e || "" === e) break;
                let i = "HKEY_LOCAL_MACHINE", n = "Software\\Thunder Network\\Xmp", o = e;
                t = a.queryRegValue(i, n, o);
                let r = a.getLongPathName(t);
                null !== r && void 0 !== r && "" !== r && (t = r)
            } while (0);
            return t
        }
    }(t.DownloadAndPlayNS || (t.DownloadAndPlayNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(57), o = i(93), r = i(2), s = i(5), l = i(3), d = i(11), u = i(15), c = i(43), h = i(38), f = i(0),
        g = i(317), p = i(427), v = i(10), m = i(6), y = i(22), k = i(14), T = i(17), w = i(12), C = i(28), S = i(94),
        b = i(37), I = i(59), _ = i(35), A = m.default(r.join(__rootDir, "../bin/ThunderHelper.node")),
        D = f.default.getLogger("DownloadAndPlayHelper"), x = d.DownloadKernelTaskManager.getTaskManager(),
        N = u.DownloadKernelEventManager.getEventManager(),
        E = ["libcurl.dll", "libeay32.dll", "ssleay32.dll", "XLBugHandler.dll", "XLBugReport.exe", "MediaInfo.dll", "resources\\bin\\SDK\\"];
    const P = new class {
        constructor() {
            this.taskStatusChangedEventTable = [], D.information("constructor DownloadAndPlayHelper object")
        }

        init() {
            return n(this, void 0, void 0, function* () {
                if (!1 === (yield this.isCodecsIntegral())) {
                    let e = a.tmpdir(), t = "", i = r.join(e, "..\\..\\"), n = r.join(i, t);
                    (yield s.FileSystemAWNS.existsAW(n)) && (yield s.FileSystemAWNS.unlinkAW(n)), D.information("downloadplay:", i, n);
                    let o = "";
                    D.information(i, n);
                    let d = {
                        taskBaseInfo: {savePath: i, taskName: t},
                        p2spTaskInfo: {url: o, nameFixed: 1},
                        isBackground: !0
                    }, u = yield x.createTask(l.DownloadKernel.TaskType.P2sp, d);
                    if (null !== u) {
                        let e = u.getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskId);
                        this.attachTaskStatusChangedEvent(e), c.DownloadDispatchNS.startTask(e)
                    }
                }
                p.DownloadAndPlayNodeIPCNS.init()
            })
        }

        uninit() {
            p.DownloadAndPlayNodeIPCNS.uninit()
        }

        openXmp(e) {
            return n(this, void 0, void 0, function* () {
                let t = 0;
                {
                    let i = g.DownloadAndPlayNS.getXmpPath();
                    if (null === i || void 0 === i || "" === i) yield this.installXmp(); else {
                        let n = r.dirname(i);
                        A.shellExecute(0, "open", i, e, n, "SW_SHOW") > 32 && (t = 1)
                    }
                }
                return t
            })
        }

        getXmpCoreVersion() {
            return n(this, void 0, void 0, function* () {
                let e = "", t = g.DownloadAndPlayNS.getXmpPath();
                return (yield s.FileSystemAWNS.existsAW(t)) && (e = A.getFileVersion(t)), e
            })
        }

        getXmpUserDataPath() {
            return n(this, void 0, void 0, function* () {
                let e = "";
                do {
                    let t = yield this.getXmpCoreVersion();
                    if (null === t || void 0 === t || "" === t) break;
                    let i = r.join(__rootDir, "../../XMP");
                    t = "V" + t, e = r.join(i, t) + "\\XMP5\\" + t
                } while (0);
                return e
            })
        }

        getXmpBuildNum() {
            return n(this, void 0, void 0, function* () {
                let e = "";
                do {
                    let t = yield this.getXmpCoreVersion();
                    if (null === t || void 0 === t || "" === t) break;
                    let i = t.split(/\./);
                    null !== i && void 0 !== i && 4 === i.length && (e = i[3])
                } while (0);
                return e
            })
        }

        isCodecsIntegral() {
            return n(this, void 0, void 0, function* () {
                let e = !1;
                {
                    let t = A.getPublicUserDataPath(),
                        i = r.join(t, "Thunder Network\\APlayer\\codecs\\avisplitter.dll"),
                        n = r.join(t, "Thunder Network\\APlayer\\codecs\\realmediasplitter.dll");
                    (yield s.FileSystemAWNS.existsAW(i)) && (yield s.FileSystemAWNS.existsAW(n)) && (e = !0)
                }
                return e
            })
        }

        attachTaskStatusChangedEvent(e) {
            void 0 !== this.taskStatusChangedEventTable[e] && null !== this.taskStatusChangedEventTable[e] || (this.taskStatusChangedEventTable[e] = N.attachTaskEvent(l.DownloadKernel.TaskEventType.StatusChanged, (...t) => {
                do {
                    if (!t) break;
                    if (t[0] !== l.DownloadKernel.TaskEventType.StatusChanged) break;
                    if (!t[1]) break;
                    let i = t[1];
                    if (i.length > 0) {
                        let t = i[0].getTaskAttribute(l.DownloadKernel.TaskAttribute.SavePath),
                            n = i[0].getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskName), a = r.join(t, n);
                        s.FileSystemAWNS.existsAW(a).then(t => {
                            if (t && i[0].getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskId) === e) {
                                let t = i[0].getTaskStatus();
                                t !== l.DownloadKernel.TaskStatus.Succeeded && t !== l.DownloadKernel.TaskStatus.Seeding || (D.information("downloadplay:运行exe = ", a), o.spawn(a), null !== this.taskStatusChangedEventTable[e] && void 0 !== this.taskStatusChangedEventTable[e] && (D.information("downloadplay:取消监听 ", this.taskStatusChangedEventTable[e]), N.detachTaskEvent(l.DownloadKernel.TaskEventType.StatusChanged, this.taskStatusChangedEventTable[e]), this.taskStatusChangedEventTable[e] = null))
                            }
                        }).catch()
                    }
                } while (0)
            }))
        }
    };
    t.default = P
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(3), r = i(11), s = i(15), l = i(30), d = i(13), u = i(61), c = i(5), h = i(35), f = i(47),
        g = i(7), p = i(59), v = i(36), m = i(42), y = i(0), k = r.DownloadKernelTaskManager.getTaskManager(),
        T = s.DownloadKernelEventManager.getEventManager(), w = y.default.getLogger("XmpUnionNS");
    !function (e) {
        function t(e, t, i, a) {
            return n(this, void 0, void 0, function* () {
                let r = !1, l = 0;
                return !function (e) {
                    let t = !1;
                    do {
                        if (!e) break;
                        0 !== (e = e.toLowerCase()).indexOf("ed2k://") && 0 !== e.indexOf("http://") && 0 !== e.indexOf("https://") && 0 !== e.indexOf("ftp://") && 0 !== e.indexOf("thunder:") || (t = !0)
                    } while (0);
                    return t
                }(e) ? function (e) {
                    let t = !1;
                    do {
                        if (!e) break;
                        if (0 === (e = e.toLowerCase()).indexOf("magnet:?")) {
                            t = !0;
                            break
                        }
                    } while (0);
                    return t
                }(e) && (l = yield s(e)) : l = yield function (e, t, i) {
                    return n(this, void 0, void 0, function* () {
                        let n = 0;
                        do {
                            let a = yield g.client.callServerFunction("GetDownloadDir"), r = i;
                            r && "" !== r || (r = u.ParseUrlFileNameNS.getNameFromUrl(e));
                            let s = null, l = {savePath: a, taskName: r}, d = h.ThunderHelper.getTaskTypeFromUrl(e);
                            if (d === o.DownloadKernel.TaskType.P2sp) {
                                let i = {taskType: o.DownloadKernel.TaskType.P2sp, value: e},
                                    a = yield p.TaskUtilitiesAWNS.batchFindTaskAW([i]);
                                if (a && a[0]) {
                                    n = a[0].getTaskAttribute(o.DownloadKernel.TaskAttribute.TaskId);
                                    let e = a[0].getTaskAttribute(o.DownloadKernel.TaskAttribute.RecycleTime);
                                    e > 0 && k.recoverFromRecycle(n);
                                    break
                                }
                                let r = {url: e, refUrl: t || "", downloadSubTask: 1};
                                yield y(), s = yield k.createTask(o.DownloadKernel.TaskType.P2sp, {
                                    taskBaseInfo: l,
                                    p2spTaskInfo: r
                                })
                            } else if (d === o.DownloadKernel.TaskType.Emule) {
                                let t = m.Common.parseEd2kUrl(e);
                                if (null !== t) {
                                    let e = {taskType: o.DownloadKernel.TaskType.Emule, value: t.fileHash},
                                        i = yield p.TaskUtilitiesAWNS.batchFindTaskAW([e]);
                                    if (i && i[0]) {
                                        n = i[0].getTaskAttribute(o.DownloadKernel.TaskAttribute.TaskId);
                                        let e = i[0].getTaskAttribute(o.DownloadKernel.TaskAttribute.RecycleTime);
                                        e > 0 && k.recoverFromRecycle(n);
                                        break
                                    }
                                }
                                let i = {url: e, downloadSubTask: 1};
                                yield y(), s = yield k.createTask(o.DownloadKernel.TaskType.Emule, {
                                    taskBaseInfo: l,
                                    emuleTaskInfo: i
                                })
                            }
                            null !== s && (n = s.getTaskAttribute(o.DownloadKernel.TaskAttribute.TaskId))
                        } while (0);
                        return n
                    })
                }(e, i, t), l && a && (r = yield v.TaskOperatorNs.downloadAndPlay(l)), r
            })
        }

        function i(e, i) {
            return n(this, void 0, void 0, function* () {
                do {
                    if (!e || !(yield c.FileSystemAWNS.existsAW(e))) break;
                    let n = yield c.FileSystemAWNS.readFileAW(e);
                    if (yield c.FileSystemAWNS.unlinkAW(e), null === n || void 0 === n || "" === n.toString()) {
                        w.information("parseUnionFileAndCreateTasks:读取内容 buf为null");
                        break
                    }
                    let a = n.toString(), o = (a += "\r\n").split("\r\n");
                    if (o.length <= 1) {
                        w.information("parseUnionFileAndCreateTasks:lines.length <= 1");
                        break
                    }
                    let r = new Map, s = new Map, l = new Map, d = [], u = [], h = [];
                    for (let e = 0; e < o.length; ++e) {
                        let t = o[e].split("=");
                        if (null !== t && 2 === t.length) {
                            let e = t[0].toLowerCase(), i = t[1];
                            if (null !== e && "" !== e) {
                                i = i.replace(/\+/g, "%20"), i = decodeURIComponent(i), w.information("parseUnionFileAndCreateTasks key, value:", e, i);
                                let t = e.match(/^tasks\[\d+\]/), n = "";
                                null !== t && void 0 !== t && (n = t[0]);
                                let a = /url/;
                                a.test(e) ? "" !== n ? r.set(n, i) : d.push(i) : (a = /referer/).test(e) ? "" !== n ? l.set(n, i) : h.push(i) : (a = /^tasks\[\d+\]\[name\]/).test(e) && ("" !== n ? s.set(n, i) : u.push(i))
                            }
                        }
                    }
                    w.information("parseUnionFileAndCreateTasks urlsInfo:", r);
                    let f = !1;
                    if (r.size > 0) for (let e of r) {
                        let n = e[0], a = e[1], o = void 0, r = l.get(n) || "";
                        null !== s && s.size > 0 && (o = s.get(n)), w.information("parseUnionFileAndCreateTasks name, url:", o, a), (f = yield t(a, o, r, !f && i)) && (i = !1)
                    }
                    if (w.information("parseUnionFileAndCreateTasks urllist:", d), d.length >= 1) for (let e = 0; e < d.length; ++e) w.information("parseUnionFileAndCreateTasks name, url:", u[e], d[e]), (f = yield t(d[e], u[e], h[e], !f && i)) && (i = !1)
                } while (0)
            })
        }

        function r(e, t) {
            return n(this, void 0, void 0, function* () {
                let i = 0;
                do {
                    if (!e) break;
                    let n = yield p.TaskUtilitiesAWNS.parserBtFileInfoAW(e);
                    if (!n) break;
                    let a = {taskType: o.DownloadKernel.TaskType.Bt, value: n.infoId},
                        r = yield p.TaskUtilitiesAWNS.batchFindTaskAW([a]);
                    if (r && r[0]) {
                        i = r[0].getTaskAttribute(o.DownloadKernel.TaskAttribute.TaskId), r[0].getTaskAttribute(o.DownloadKernel.TaskAttribute.RecycleTime) > 0 && k.recoverFromRecycle(i);
                        break
                    }
                    let s = [];
                    for (let e = 0; e < n.fileLists.length; ++e) f.TaskUtilHelper.isVideoFileExt(n.fileLists[e].fileName) && s.push(n.fileLists[e].realIndex);
                    if (0 === s.length) break;
                    let l = n.trackerUrls.join("\n"), d = {
                        taskBaseInfo: {
                            savePath: yield g.client.callServerFunction("GetDownloadDir"),
                            taskName: t && "" !== t ? t : n.title
                        },
                        btTaskInfo: {
                            seedFile: e,
                            displayName: n.title,
                            fileRealIndexLists: s,
                            fileLists: n.fileLists,
                            infoId: n.infoId,
                            tracker: l
                        },
                        isBackground: !1
                    };
                    yield y();
                    let u = yield k.createTask(o.DownloadKernel.TaskType.Bt, d);
                    u && (i = u.getTaskAttribute(o.DownloadKernel.TaskAttribute.TaskId))
                } while (0);
                return i
            })
        }

        function s(e, t) {
            return n(this, void 0, void 0, function* () {
                let i = 0;
                {
                    let n = yield g.client.callServerFunction("GetDownloadDir"),
                        s = u.ParseUrlFileNameNS.parseMagnetUrl(e) + ".torrent", l = a.join(n, s), d = {
                            taskBaseInfo: {taskName: s, savePath: n},
                            magnetTaskInfo: {url: e, torrentFilePath: l},
                            isBackground: !0
                        };
                    yield y();
                    let h = yield k.createTask(o.DownloadKernel.TaskType.Magnet, d);
                    if (null !== h) {
                        let e = h.getTaskAttribute(o.DownloadKernel.TaskAttribute.TaskId);
                        k.startTask(e), yield C(e, t)
                    }
                    (yield c.FileSystemAWNS.existsAW(l)) && (i = yield r(e, name))
                }
                return i
            })
        }

        function y() {
            return n(this, void 0, void 0, function* () {
                return new Promise(e => {
                    k.isLoadStorageTaskFinish() ? e() : l.DownloadKernelManager.attachListener(d.NodeEventMesssageNS.eventTaskDataBaseLoadEnd, () => {
                        e()
                    })
                })
            })
        }

        function C(e, t) {
            return n(this, void 0, void 0, function* () {
                let i = 0, n = !1;
                return new Promise(a => {
                    y().then(() => {
                        i = T.attachTaskEvent(o.DownloadKernel.TaskEventType.StatusChanged, (...t) => {
                            do {
                                if (!t) break;
                                if (t[0] !== o.DownloadKernel.TaskEventType.StatusChanged) break;
                                if (!t[1]) break;
                                let r = t[1];
                                for (let t = 0; t < r.length; ++t) {
                                    let s = r[t];
                                    if (!s) continue;
                                    let l = s.getTaskAttribute(o.DownloadKernel.TaskAttribute.TaskId);
                                    if (e === l) {
                                        s.getTaskStatus() === o.DownloadKernel.TaskStatus.Succeeded && (T.detachTaskEvent(o.DownloadKernel.TaskEventType.StatusChanged, i), n || (n = !0, a(!0)));
                                        break
                                    }
                                }
                            } while (0)
                        })
                    }).catch(), t && setTimeout(() => {
                        n || (n = !0, a(!1))
                    }, t)
                })
            })
        }

        e.createUnionPlayTasks = function (e, t) {
            return n(this, void 0, void 0, function* () {
                do {
                    if (!e) break;
                    let n = e.indexOf("unionfile:");
                    n > -1 && (e = e.substring(n + 10)), yield i(decodeURIComponent(e), t)
                } while (0)
            })
        }, e.createDowndAndPlayTask = t
    }(t.DownloadAndPlayUnionNS || (t.DownloadAndPlayUnionNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(0), r = i(6), s = r.default(a.join(__rootDir, "../bin/ThunderHelper.node")), l = i(16),
        d = i(24), u = i(39), c = i(9), h = o.default.getLogger("MessageChannel");
    let f = null, g = void 0, p = null;
    !function (e) {
        let t, i;

        function o() {
            return p || (p = r.default(a.join(__rootDir, "../bin/ThunderMsgChannel.node"))), p
        }

        function v() {
            return g || (g = s.getFileVersion(a.join(__rootDir, "../../xluagc.dll"))), g
        }

        !function (e) {
            e[e.Init = 0] = "Init", e[e.Connecting = 1] = "Connecting", e[e.Connected = 2] = "Connected", e[e.ConnectRecovering = 3] = "ConnectRecovering"
        }(t = e.LongConnectState || (e.LongConnectState = {})), function (e) {
            e[e.Init = 0] = "Init", e[e.Logining = 1] = "Logining", e[e.Login = 2] = "Login", e[e.LoginFailed = 3] = "LoginFailed", e[e.Logouting = 4] = "Logouting", e[e.Logout = 5] = "Logout", e[e.LogoutFailed = 6] = "LogoutFailed"
        }(i = e.UserState || (e.UserState = {})), e.eventUserLogin = "OnMessageChannelUserLogin", e.eventUserLoginFailed = "OnMessageChannelUserLoginFailed", e.eventUserLogout = "OnMessageChannelUserLogout", e.eventUserLogoutFailed = "OnMessageChannelUserLogoutFailed", e.eventServiceCallbackId = "OnMessageChannelServiceCallback", e.eventGroupServiceCallbackId = "OnMessageChannelGroupServiceCallback", e.getThunderMsgChannel = o;
        const m = new class extends u.default {
            constructor() {
                super(...arguments), this.longConnectState = t.Init, this.userState = i.Init, this.userLoginEventId = void 0, this.userLogoutEventId = void 0, this.userCheckInTryTimes = 0, this.userCheckOutTryTimes = 0, this.maxTryTimes = 3, this.userId = "0", this.statDataInfo = new Map
            }

            init() {
                let e = s.getPeerID();
                h.information("[MsgChannelStat]init appid:0, peerid:", e);
                let t = o().init(e, "0", this.initCallback.bind(this), this.longConnectCallback.bind(this), this.userStateCallback.bind(this));
                return t && (this.userLoginEventId = l.NativeCallModule.nativeCall.AttachNativeEvent("OnUserLogin", this.onUserLogin.bind(this)), this.userLogoutEventId = l.NativeCallModule.nativeCall.AttachNativeEvent("OnUserLogout", this.onUserLogout.bind(this)), f = setInterval(() => {
                    this.sendMsgCountStat()
                }, 6e4)), t
            }

            uninit() {
                return void 0 !== this.userLoginEventId && (l.NativeCallModule.nativeCall.DetachNativeEvent("OnUserLogin", this.userLoginEventId), this.userLoginEventId = void 0), void 0 !== this.userLogoutEventId && (l.NativeCallModule.nativeCall.DetachNativeEvent("OnUserLogout", this.userLogoutEventId), this.userLogoutEventId = void 0), f && (h.information("killTimer..."), clearInterval(f), f = null), o().uninit()
            }

            registerService(e) {
                return o().registerService(e, this.serviceCallback.bind(this))
            }

            unregisterService(e) {
                return o().unregisterService(e)
            }

            joinGroup(e) {
                return o().joinGroup(e, this.groupServiceCallback.bind(this))
            }

            leaveGroup(e) {
                return o().leaveGroup(e)
            }

            getLongConnectState() {
                return this.longConnectState
            }

            getUserState() {
                return this.userState
            }

            getCurrentTime() {
                return Math.floor((new Date).getTime() / 1e3).toString()
            }

            sendMsgCountStat() {
                for (let [e, t]of this.statDataInfo) if (e && "" !== e && t) {
                    let e = "sdk_version=" + v() + ",msg_count=" + t.msgCount + ",cmdtype=" + t.cmdType + ",begin_time=" + t.beginTime + ",end_time=" + t.endTime + ",uid=" + t.userId;
                    "" !== t.serviceType ? (e = e + ",servicetype=" + t.serviceType, h.information("[MsgChannelStat]longlink_recvmessage_count extdata:", e), c.XLStatNS.trackEvent("community", "longlink_recvmessage_count", "", 0, 0, 0, 0, e)) : "" !== t.groupId && (e = e + ",groupid=" + t.groupId, h.information("[MsgChannelStat]longlink_recvmessage_count extdata:", e), c.XLStatNS.trackEvent("community", "longlink_recvmessage_count", "", 0, 0, 0, 0, e))
                }
                this.statDataInfo.clear()
            }

            getUserID() {
                return n(this, void 0, void 0, function* () {
                    return new Promise(e => {
                        d.LoginHelperNS.loginHelper.getUserInfo("userid", function (t) {
                            h.information("getUserID:userid = ", t), e(t)
                        })
                    })
                })
            }

            getSessionID() {
                return n(this, void 0, void 0, function* () {
                    return new Promise(e => {
                        d.LoginHelperNS.loginHelper.getUserInfo("sessionid", function (t) {
                            h.information("getSessionID:sessionid = ", t), e(t)
                        })
                    })
                })
            }

            onUserLogin(e) {
                return n(this, void 0, void 0, function* () {
                    if (h.information("onUserLogin userState:", this.userState), this.longConnectState === t.Connected) {
                        let t = yield this.getSessionID();
                        h.information("onUserLogin userCheckIn uid = ", e, " token = ", t), this.userCheckInTryTimes = 0, this.userState = i.Logining, o().userCheckIn(e, t)
                    }
                })
            }

            onUserLogout() {
                h.information("onUserLogout userState:", this.userState), this.userState !== i.Logining && this.userState !== i.Login || (this.userCheckOutTryTimes = 0, this.userState = i.Logouting, o().userCheckOut())
            }

            initCallback(e) {
                return n(this, void 0, void 0, function* () {
                    h.information("[MsgChannelStat]initCallback ret:", e);
                    let t = "sdk_version=" + v();
                    t = t + ",ret=" + e, h.information("[MsgChannelStat]initCallback longlink_xluagcinit extData: ", t), c.XLStatNS.trackEvent("community", "longlink_xluagcinit", "", 0, 0, 0, 0, t)
                })
            }

            onLongConnectSuccess() {
                return n(this, void 0, void 0, function* () {
                    this.longConnectState = t.Connected;
                    let e = yield this.getUserID(), n = yield this.getSessionID();
                    e && "" !== e && this.userState !== i.Logining && this.userState !== i.Login && setTimeout(() => {
                        h.information("longConnectCallback user has already logged in. userId:", e, ", sessionId:", n, ", start checking in message channel."), this.userCheckInTryTimes = 0, this.userState = i.Logining, o().userCheckIn(e, n)
                    }, 1)
                })
            }

            longConnectCallback(e) {
                return n(this, void 0, void 0, function* () {
                    h.information("longConnectCallback state:", e);
                    let i = "sdk_version=" + v();
                    1 === e ? (this.longConnectState = t.Connecting, h.information("[MsgChannelStat]longConnectCallback connecting:", this.longConnectState)) : 2 === e ? (h.information("[MsgChannelStat]longConnectCallback connect success."), yield this.onLongConnectSuccess(), i += ",ret=1", h.information("[MsgChannelStat]longlink_deviceloginend extdata:", i), c.XLStatNS.trackEvent("community", "longlink_deviceloginend", "", 0, 0, 0, 0, i)) : 3 === e && (h.information("[MsgChannelStat]longConnectCallback connect recovering."), this.longConnectState = t.ConnectRecovering, i += ",ret=0", h.information("longlink_deviceloginend extdata:", i), c.XLStatNS.trackEvent("community", "longlink_deviceloginend", "", 0, 0, 0, 0, i))
                })
            }

            onMessageChannelUserLogin() {
                h.information("userStateCallback login success, this.userState:", this.userState), this.userState = i.Login, this.userCheckInTryTimes = 0, this.fireEvent(e.eventUserLogin)
            }

            onMessageChannelUserLoginFailed() {
                return n(this, void 0, void 0, function* () {
                    if (h.information("userStateCallback login failed, this.userState:", this.userState, ", userCheckInTryTimes:", this.userCheckInTryTimes), this.userState = i.LoginFailed, this.fireEvent(e.eventUserLoginFailed), this.userCheckInTryTimes = this.userCheckInTryTimes + 1, this.userCheckInTryTimes < this.maxTryTimes) {
                        let e = yield this.getUserID(), t = yield this.getSessionID();
                        e && "" !== e && setTimeout(() => {
                            h.information("uid = ", e, " token = ", t), h.information("userStateCallback retry login userCheckInTryTimes:", this.userCheckInTryTimes), this.userState = i.Logining, o().userCheckIn(e, t)
                        }, 1)
                    }
                })
            }

            onMessageChannelUserLogout() {
                h.information("userStateCallback logout success."), this.userState = i.Logout, this.userCheckOutTryTimes = 0, this.fireEvent(e.eventUserLogout)
            }

            onMessageChannelUserLogoutFailed() {
                h.information("userStateCallback logout failed, self.UserState:", this.userState), this.userState = i.LogoutFailed, this.fireEvent(e.eventUserLogoutFailed), h.information("userStateCallback retry logout, this.userCheckOutTryTimes:", this.userCheckOutTryTimes), this.userCheckOutTryTimes = this.userCheckOutTryTimes + 1, this.userCheckOutTryTimes < this.maxTryTimes && setTimeout(() => {
                    this.userState = i.Logouting, o().userCheckOut(), h.information("userStateCallback retry logout, userCheckOutTryTimes", this.userCheckOutTryTimes)
                }, 1)
            }

            userStateCallback(e) {
                return n(this, void 0, void 0, function* () {
                    h.information("userStateCallback state = ", e);
                    let t = "sdk_version=" + v();
                    if (0 === e) {
                        this.onMessageChannelUserLogin(), t += ",ret=1";
                        let e = yield this.getUserID();
                        this.userId = e, h.information("[MsgChannelStat]longlink_userloginend extdata:", t), c.XLStatNS.trackEvent("community", "longlink_userloginend", "", 0, 0, 0, 0, t)
                    } else 1 === e ? (yield this.onMessageChannelUserLoginFailed(), this.userId = "0", t += ",ret=0", h.information("[MsgChannelStat]longlink_userloginend extdata:", t), c.XLStatNS.trackEvent("community", "longlink_userloginend", "", 0, 0, 0, 0, t)) : 2 === e ? (this.onMessageChannelUserLogout(), this.userId = "0", this.sendMsgCountStat()) : 3 === e && (this.userId = "0", this.onMessageChannelUserLogoutFailed())
                })
            }

            serviceCallback(t, i, n) {
                h.information("[MsgChannelStat]serviceCallback serviceType:", t, ", msgCount:", i, ", msgArray:", n), this.fireEvent(e.eventServiceCallbackId, t, n);
                let a = "serviceType_" + t + "_" + this.userId;
                if (this.statDataInfo.has(a)) {
                    let e = this.statDataInfo.get(a);
                    e.endTime = this.getCurrentTime(), e.msgCount = e.msgCount + i
                } else {
                    let e = {
                        serviceType: "",
                        groupId: "",
                        cmdType: "",
                        beginTime: "",
                        endTime: "",
                        msgCount: 0,
                        userId: "0"
                    };
                    e.beginTime = this.getCurrentTime(), e.endTime = this.getCurrentTime(), e.msgCount = i, e.serviceType = t, e.cmdType = "1", e.userId = this.userId, this.statDataInfo.set(a, e)
                }
            }

            groupServiceCallback(t, i, n) {
                h.information("groupServiceCallback groupId:", t, ", msgCount:", i, ", msgArray:", n), this.fireEvent(e.eventGroupServiceCallbackId, t, n);
                let a = "groupId_" + t + "_" + this.userId;
                if (this.statDataInfo.has(a)) {
                    let e = this.statDataInfo.get(a);
                    e.endTime = this.getCurrentTime(), e.msgCount = e.msgCount + i
                } else {
                    let e = {
                        serviceType: "",
                        groupId: "",
                        cmdType: "",
                        beginTime: "",
                        endTime: "",
                        msgCount: 0,
                        userId: "0"
                    };
                    e.beginTime = this.getCurrentTime(), e.endTime = this.getCurrentTime(), e.msgCount = i, e.groupId = t, e.cmdType = "2", e.userId = this.userId, this.statDataInfo.set(a, e)
                }
            }
        };
        e.init = function () {
            return m.init()
        }, e.uninit = function () {
            return m.uninit()
        }, e.registerService = function (e) {
            return m.registerService(e)
        }, e.unregisterService = function (e) {
            return m.unregisterService(e)
        }, e.attachListener = function (e, t) {
            m.attachListener(e, t)
        }, e.detachListener = function (e, t) {
            m.detachListener(e, t)
        }, e.joinGroup = function (e) {
            return m.joinGroup(e)
        }, e.leaveGroup = function (e) {
            return m.leaveGroup(e)
        }, e.getLongConnectState = function () {
            return m.getLongConnectState()
        }, e.getUserState = function () {
            return m.getUserState()
        }
    }(t.MessageChannelNS || (t.MessageChannelNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(0), a = i(19), o = i(32), r = i(23), s = i(537), l = i(27), d = i(13), u = i(4),
        c = n.default.getLogger("CommunityNaviteFunction"), h = s.CommunityTaskManagerNS.getTaskManager();
    !function (e) {
        class t extends a.EventEmitter {
            constructor() {
                super(), this.isRegisted = !1, c.verbose("construct")
            }

            static getNativeModule() {
                return t.instance || (t.instance = new t), t.instance
            }

            registerNativeFunction() {
                if (!this.isRegisted) {
                    this.isRegisted = !0;
                    let e = [{
                        functionName: "GetTaskSpeedByGcid",
                        nativeFunc: this.getTaskSpeedByGcid
                    }, {
                        functionName: "GetTaskNameByGcid",
                        nativeFunc: this.getTaskNameByGcid
                    }, {functionName: "SwitchToTask", nativeFunc: this.switchToTask}, {
                        functionName: "NotifyUnreadNum",
                        nativeFunc: this.notifyUnreadNum
                    }, {functionName: "ShowChatPanel", nativeFunc: this.showChatPanel}, {
                        functionName: "NewMessage",
                        nativeFunc: this.newMessage
                    }, {functionName: "OpenCommunityGroup", nativeFunc: this.openCommunityGroup}];
                    o.NativeCallNS.registerNativeFunction(e), h.init()
                }
            }

            sendOpenCommunityEvent(e, t) {
                void 0 !== t && (c.information("sendOpenCommunityEvent", e), t.fireEvent("OnShowCommunity", e.type, e.entry, JSON.stringify(e.extra)))
            }

            showChatPanel(e, i, n, a) {
                do {
                    if (u.isNullOrUndefined(e) || u.isNullOrUndefined(i) || u.isNullOrUndefined(n)) break;
                    if (c.verbose(a), !a || !a[0]) {
                        e.callNativeFunctionCallback(i, n, r.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let o = {type: "chat", extra: {userId: a[0]}};
                    t.getNativeModule().emit("openComunityGroup", o), e.callNativeFunctionCallback(i, n, r.NativeFunctionErrorCode.Success)
                } while (0)
            }

            newMessage(e, i, n, a) {
                do {
                    if (u.isNullOrUndefined(e) || u.isNullOrUndefined(n) || u.isNullOrUndefined(i)) break;
                    if (c.information("newMessage", a), c.verbose(a), !a || !a[0]) {
                        e.callNativeFunctionCallback(i, n, r.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    const o = a[0];
                    try {
                        let a = JSON.parse(o);
                        t.getNativeModule().emit("newMessage", a), e.callNativeFunctionCallback(i, n, r.NativeFunctionErrorCode.Success)
                    } catch (e) {
                        c.information("newMessage parse data error")
                    }
                } while (0)
            }

            getTaskSpeedByGcid(e, t, i, n) {
                do {
                    if (u.isNullOrUndefined(e) || u.isNullOrUndefined(i) || u.isNullOrUndefined(t)) break;
                    if (c.verbose(n), !n || !n[0]) {
                        e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    const a = n[0];
                    let o = h.getTaskAverageSpeedByTaskUniqueID(a);
                    c.information("getTaskSpeedByGcid gcid:", a, ", taskAverageSpeed:", o), e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.Success, "" + o)
                } while (0)
            }

            getTaskNameByGcid(e, t, i, n) {
                do {
                    if (u.isNullOrUndefined(e) || u.isNullOrUndefined(i) || u.isNullOrUndefined(t)) break;
                    if (c.verbose(n), !n || !n[0]) {
                        e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    const a = n[0];
                    let o = h.getTaskNameByTaskUniqueID(a);
                    c.information("getTaskSpeedByGcid gcid:", a, ", taskName:", o), e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.Success, o)
                } while (0)
            }

            switchToTask(e, t, i, n) {
                do {
                    if (u.isNullOrUndefined(e) || u.isNullOrUndefined(i) || u.isNullOrUndefined(t)) break;
                    if (c.verbose(n), !n || !n[0]) {
                        e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    const a = n[0];
                    c.information("switchToTask", a);
                    let o = h.getTaskInfoByTaskUniqueID(a);
                    if (!o) {
                        e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    c.information("switchToTask gcid:", a, ", taskInfo:", o), l.default.fireEvent(d.NodeEventMesssageNS.eventDownloadSwitchCategory, o.categoryId, o.categoryViewId, o.taskId), e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.Success)
                } while (0)
            }

            notifyUnreadNum(e, i, n, a) {
                do {
                    if (u.isNullOrUndefined(e) || u.isNullOrUndefined(n) || u.isNullOrUndefined(i)) break;
                    if (c.verbose(a), !a || !Array.isArray(a) || a.length < 2) {
                        e.callNativeFunctionCallback(i, n, r.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    const o = a[0];
                    let s = null;
                    try {
                        s = JSON.parse(a[1])
                    } catch (e) {
                        break
                    }
                    t.getNativeModule().emit("NotifyUnreadNum", {
                        totalNum: a[0],
                        detail: s
                    }), c.information("notifyUnreadNum", o), e.callNativeFunctionCallback(i, n, r.NativeFunctionErrorCode.Success)
                } while (0)
            }

            openCommunityGroup(e, i, n, a) {
                do {
                    if (u.isNullOrUndefined(e) || u.isNullOrUndefined(n) || u.isNullOrUndefined(i)) break;
                    if (!a || !Array.isArray(a)) {
                        e.callNativeFunctionCallback(i, n, r.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let o = null;
                    try {
                        o = JSON.parse(a[0])
                    } catch (e) {
                        break
                    }
                    t.getNativeModule().emit("openComunityGroup", o), e.callNativeFunctionCallback(i, n, r.NativeFunctionErrorCode.Success)
                } while (0)
            }
        }

        t.instance = null, e.CommunityNaviteFunction = t
    }(t.CommunityNaviteFunctionNS || (t.CommunityNaviteFunctionNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(5), o = i(55), r = `${__profilesDir}/commonsites.json`, s = 100, l = 3e4;

    class d {
        constructor() {
            this.inited = !1, this.needSave = !1, this.heartTimerId = void 0, this.allSites = {}, this.quitAttached = !1, this.commonly = void 0
        }

        init() {
            return n(this, void 0, void 0, function* () {
                do {
                    if (this.inited) break;
                    if (this.inited = !0, !(yield a.FileSystemAWNS.existsAW(r))) break;
                    let e = (yield a.FileSystemAWNS.readFileAW(r)).toString(), t = null;
                    try {
                        t = JSON.parse(e)
                    } catch (e) {
                    }
                    if (!t) break;
                    this.allSites = {};
                    for (let e = 0; e < t.length; e++) t[e].url && (t[e].visit = t[e].visit || 1, this.allSites[t[e].url] = t[e])
                } while (0)
            })
        }

        save() {
            return n(this, void 0, void 0, function* () {
                do {
                    if (!this.needSave) break;
                    this.needSave = !1;
                    let e = Object.values(this.allSites);
                    if (e.length <= s) {
                        yield a.FileSystemAWNS.writeFileAW(r, JSON.stringify(e));
                        break
                    }
                    e.sort((e, t) => t.date - e.date), yield a.FileSystemAWNS.writeFileAW(r, JSON.stringify(e.slice(0, s)))
                } while (0)
            })
        }

        getMostCommonly() {
            return n(this, void 0, void 0, function* () {
                if (void 0 === this.commonly) {
                    yield this.init();
                    let e = Object.values(this.allSites);
                    e.sort((e, t) => e.visit !== t.visit ? t.visit - e.visit : t.date && e.date ? t.date - e.date : 0), this.commonly = e.filter(e => {
                        let t = !0;
                        do {
                            if (!e.url) {
                                t = !1;
                                break
                            }
                            if (!e.name) {
                                t = !1;
                                break
                            }
                            if (e.visit < 4) {
                                t = !1;
                                break
                            }
                            if (-1 !== e.url.indexOf("xunlei.com")) {
                                t = -1 !== e.url.indexOf("movie.xunlei.com") || -1 !== e.url.indexOf("live.xunlei.com") || -1 !== e.url.indexOf("yingshiku.xunlei.com");
                                break
                            }
                        } while (0);
                        return t
                    }), this.commonly.length > 4 && (this.commonly = this.commonly.slice(0, 4))
                }
                return this.commonly
            })
        }

        updateItem(e, t) {
            return n(this, void 0, void 0, function* () {
                if (-1 !== e.url.indexOf("xunlei.com") && -1 === e.url.indexOf("movie.xunlei.com") && -1 === e.url.indexOf("live.xunlei.com") && -1 === e.url.indexOf("yingshiku.xunlei.com")) return;
                yield this.init();
                let i = this.allSites[e.url];
                ("OnAddressChange" === t || i) && (i ? ("OnAddressChange" === t && (e.visit = i.visit + 1, e.date = (new Date).getTime()), this.allSites[i.url] = Object.assign({}, i, e)) : (e.visit = 1, e.date = (new Date).getTime(), this.allSites[e.url] = e), this.needSave = !0, void 0 === this.heartTimerId && (this.heartTimerId = setTimeout(() => n(this, void 0, void 0, function* () {
                    clearTimeout(this.heartTimerId), this.heartTimerId = void 0, yield this.save()
                }), l)), this.quitAttached || (this.quitAttached = !0, o.quitPromises.add(() => new Promise(e => n(this, void 0, void 0, function* () {
                    this.heartTimerId && (clearTimeout(this.heartTimerId), this.heartTimerId = void 0), yield this.save(), e(!0)
                })))))
            })
        }

        clear() {
            return n(this, void 0, void 0, function* () {
                yield a.FileSystemAWNS.unlinkAW(r), this.allSites = {}, this.commonly = [], this.needSave = !1, this.heartTimerId && (clearTimeout(this.heartTimerId), this.heartTimerId = void 0)
            })
        }

        delete(e) {
            return n(this, void 0, void 0, function* () {
                do {
                    if (!e) break;
                    if (!this.allSites.hasOwnProperty(e)) break;
                    if (delete this.allSites[e], !this.commonly || 0 === this.commonly.length) break;
                    for (let t = 0; t < this.commonly.length; t++) if (this.commonly[t].url === e) {
                        this.commonly.splice(t, 1);
                        break
                    }
                    this.needSave = !0, yield this.save()
                } while (0)
            })
        }
    }

    t.CommonSitesMgr = d, function (e) {
        const t = new d;
        e.getInstance = function () {
            return t
        }
    }(t.CommonSitesMgrNS || (t.CommonSitesMgrNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(10), o = i(78), r = i(2), s = i(546), l = r.join(__rootDir, "../../download-complete.wav");
    !function (e) {
        function t(t, i) {
            let n;
            for (let a = 0; a < e.conf.sechema.length; ++a) if ((n = e.conf.sechema[a]).name === t) {
                if (!n.children) break;
                for (let t = 0; t < n.children.length; t++) if (n.children[t].name === i) {
                    n.children.splice(t, 1), e.conf.sechema[a] = n;
                    break
                }
                break
            }
        }

        function i(t, i, n) {
            let a;
            for (let o = 0; o < e.conf.sechema.length; ++o) if ((a = e.conf.sechema[o]).name === t) {
                if (!a.children) break;
                let t = a.children.length;
                for (let r = 0; r < t; r++) if (a.children[r].name === n) {
                    r === t - 1 ? a.children.push(i) : a.children.splice(r + 1 > t - 1 ? t - 1 : r + 1, 0, i), e.conf.sechema[o] = a;
                    break
                }
                break
            }
        }

        function d(t, i) {
            let n, a = !1;
            for (let o = 0; o < e.conf.sechema.length; ++o) if ((n = e.conf.sechema[o]).name === t) {
                if (!n.children) break;
                let e = n.children.length;
                for (let t = 0; t < e; t++) if (n.children[t].name === i) {
                    a = !0;
                    break
                }
                break
            }
            return a
        }

        e.conf = {
            sechema: [{
                name: "基本设置",
                children: [{
                    name: "ConfigNormalSession-ConfigNormal_AutoRun",
                    type: "confCheckbox",
                    label: "开机启动迅雷",
                    classes: ""
                }, {
                    name: "Others-AntiDisturb",
                    type: "confCheckbox",
                    label: "开启免打扰模式",
                    classes: "",
                    extEles: [{
                        type: "confTip",
                        classes: "xly-icon-help",
                        text: "免打扰模式下，当您运行全屏程序时，迅雷将\n自动帮您取消提示消息弹出，避免打扰您的其\n它体验。",
                        value: ""
                    }]
                }, {
                    name: "BossKey-BossKeySwitch",
                    type: "confCheckboxInput",
                    label: "启用老板键",
                    styles: "display: flex; align-items: center;",
                    extEles: [{
                        type: "confInput",
                        name: "BossKey-BossKeyName",
                        label: " ",
                        toolTipsContent: "注册老板键失败,请选择功能键 + 字母键/数字键",
                        rules: [["rule, value, callback", "let errors = [];\n                    value = String(value);\n                    if (value.indexOf('+') === -1 ) {\n                      errors.push(new Error('注册老板键失败,请选择功能键 + 字母键/数字键'));\n                    }\n                    callback(errors);"]],
                        outClasses: "xly-input-size-1",
                        ShortcutKey: !0,
                        style: "padding-right: 3px"
                    }, {type: "confTip", text: "如果老板来了，按老板键，迅雷将自动隐身", classes: "xly-icon-help"}]
                }, {
                    name: "TaskDefaultSettings-NewTaskDlgWithoutMainWnd",
                    type: "confCheckbox",
                    label: "新建任务时显示主界面"
                }, {
                    name: "TaskDefaultSettings-downloadModel",
                    text: "下载模式",
                    type: "confText",
                    ulClasses: "xly-setting-content__vertical",
                    children: [{
                        name: "ConfigNet-ConfigNet_Type",
                        type: "confRadio",
                        label: "全速下载",
                        extEles: [{
                            type: "confTip",
                            text: "p2sp下载完的文件会通过p2p的方式上传分享，\n帮助其它网友加速下载，绝不会涉及任何用户隐\n私。下载和分享是通过智能带宽控制的技术，不\n会影响您的上网体验，请放心使用。",
                            classes: "xly-icon-help"
                        }, {
                            type: "confBtn",
                            text: "修改配置",
                            classes: "td-button--small td-button--other",
                            outerClass: "inline",
                            boxType: "speedConfBox",
                            extEles: [{type: "confSpeedText", classes: "xly-setting-content__description inline"}]
                        }],
                        extActiveValue: "0",
                        labels: ["全速下载", "限速下载"],
                        option: ["1", "0"]
                    }]
                }]
            }, {
                name: "云盘设置",
                classes: "xly-setting-cloud",
                children: [{
                    label: "下载转存目录",
                    type: "confText",
                    text: "下载转存目录",
                    classes: "xly-setting-content__title",
                    liClasses: "xly-setting-content__align",
                    liStyles: "display: flex;",
                    children: [{
                        name: "ThunderPanPlugin-defaultSavePath",
                        type: "confSelect",
                        label: "",
                        optionByName: "ThunderPanPlugin-savePaths",
                        liClasses: "td-select xly-select-setting",
                        slotOption: "openThunderPan",
                        editable: !1,
                        hasDeleteOption: !0,
                        deleteOptionText: "清除历史转存目录",
                        maxOptionLen: 5,
                        blurUpdate: !0
                    }, {
                        name: "ThunderPanPlugin-lastUsePath",
                        type: "confCheckbox",
                        label: "自动修改为上次使用的目录",
                        linkItem: {
                            section: "ThunderPanPlugin",
                            key: "lastUsePath",
                            name: "ThunderPanPlugin-defaultSavePath"
                        }
                    }]
                }, {
                    label: "取回本地目录",
                    type: "confText",
                    text: "取回本地目录",
                    classes: "xly-setting-content__title",
                    liClasses: "xly-setting-content__align",
                    liStyles: "display: flex;",
                    children: [{
                        name: "ThunderPanPlugin-defaultDownloadPath",
                        type: "confSelect",
                        label: "",
                        optionByName: "ThunderPanPlugin-downloadPaths",
                        liClasses: "td-select xly-select-setting",
                        slotOption: "openDirectory",
                        editable: !0,
                        hasDeleteOption: !0,
                        deleteOptionText: "清除历史取回目录",
                        maxOptionLen: 5,
                        blurUpdate: !0,
                        rules: [["rule, value, callback", "let errors = [];\n                    do {\n                      let dir = '';\n                      let ip = '';\n                      if (/^[c-zC-Z]:\\\\/.test(value)) {\n                        dir = value.slice(3);\n                      } else {\n                        if (value.indexOf('\\\\\\\\') === 0) {\n                          let index = value.indexOf('\\\\', 2);\n                          if (index === -1 || index === value.length - 1) {\n                            errors.push(new Error('不合法的存储路径'));\n                            break;\n                          }\n                          dir = value.slice(2);\n                          ip = dir.substr(0, index - 2);\n                          if (ip === '') {\n                            errors.push(new Error('不合法的存储路径'));\n                            break;\n                          }\n                        } else {\n                          errors.push(new Error('不合法的存储路径'));\n                          break;\n                        }\n                      }\n                      if (/[\\*\\\"<>\\?:\\|]/i.test(dir)) {\n                        errors.push(new Error('下载目录名称不能包含下列任何字符：:|* ?“<>'));\n                        break;\n                      }\n                      if (value.length > 256) {\n                        errors.push(new Error('您输入的下载目录路径长度超过系统限制，请控制在256个字符以内'));\n                        break;\n                      }\n                      if (ip === '') {\n                        break;\n                      }\n                      let index = ip.indexOf('.ipv6-literal.net');\n                      if (index !== -1) {\n                        ip = ip.substr(0, index);\n                        index = ip.indexOf('%');\n                        if (index !== -1) {\n                          ip = ip.substr(0, index);\n                        }\n                        ip = ip.replace(/\\-/g, ':');\n                        if (!/^\\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:)))(%.+)?\\s*$/.test(ip)) {\n                          errors.push(new Error('不合法的存储路径'));\n                        }\n                      } else {\n                        if (\n                          !/(?=(\\b|\\D))(((\\d{1,2})|(1\\d{1,2})|(2[0-4]\\d)|(25[0-5]))\\.){3}((\\d{1,2})|(1\\d{1,2})|(2[0-4]\\d)|(25[0-5]))(?=(\\b|\\D))/.test(\n                            ip\n                          )\n                        ) {\n                          errors.push(new Error('不合法的存储路径'));\n                        }\n                      }\n                    } while (false);\n                    callback(errors);"]]
                    }, {
                        name: "ThunderPanPlugin-useDefault",
                        type: "confCheckbox",
                        label: "取回时不再询问",
                        linkItem: {
                            section: "ThunderPanPlugin",
                            key: "defaultDownloadPath",
                            name: "ThunderPanPlugin-defaultDownloadPath"
                        }
                    }]
                }, {
                    label: "同时取回任务数",
                    type: "confText",
                    text: "同时取回任务数",
                    classes: "xly-setting-content__title",
                    liClasses: "xly-setting-content__align",
                    liStyles: "display: flex; align-items: center;",
                    children: [{
                        name: "ThunderPanPlugin-MaxDownloadTaskNum",
                        type: "confSelect",
                        label: "",
                        classes: "xly-select-size-1",
                        option: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10"]
                    }]
                }]
            }, {
                name: "接管设置",
                children: [{
                    name: "Monitor-MonitorClipBoard",
                    type: "confCheckbox",
                    label: "接管剪切板"
                }, {name: "Motitor-MotitorAll", type: "confCheckbox", label: "接管所有浏览器", children: []}, {
                    name: "",
                    type: "confText",
                    text: "接管下载类型",
                    value: "xly-setting-content__text"
                }, {
                    name: "Monitor-WatchTraditionLink",
                    type: "confCheckbox",
                    label: "传统下载",
                    liClasses: "inline",
                    option: []
                }, {
                    name: "Monitor-ConfigWatch_Bt",
                    type: "confCheckbox",
                    label: "BT下载",
                    liClasses: "inline"
                }, {
                    name: "EMuleGenericSettings-EMuleWatchLink",
                    type: "confCheckbox",
                    label: "eMule下载",
                    liClasses: "inline",
                    option: []
                }, {
                    name: "MagnetGenericSettings-MagnetWatchLink",
                    type: "confCheckbox",
                    label: "磁力链接下载",
                    liClasses: "inline"
                }, {
                    name: "",
                    text: "下载文件拓展名",
                    type: "confText",
                    liStyles: "display: flex; align-items: center;",
                    classes: "xly-setting-content__title",
                    children: [{
                        type: "confBtn",
                        label: "下载文件拓展名",
                        listEles: [{
                            text: "点击编辑",
                            bindName: "Monitor-WatchTraditionLink",
                            classes: "td-button td-button--small td-button--other",
                            boxType: "pop",
                            pop: {
                                title: "编辑下载文件扩展名",
                                maximizable: !1,
                                schema: [{
                                    type: "confText",
                                    classes: "xly-dialog-setting__tips",
                                    text: " 您可以编辑传统下载中的下载文件扩展名："
                                }, {type: "confTextarea", name: "Monitor-ExtendNames"}],
                                formData: {
                                    "Monitor-ExtendNames": {
                                        section: "Monitor",
                                        key: "ExtendNames",
                                        value: o.BHOConfigNS.getDefaultExtendNames()
                                    }
                                }
                            }
                        }]
                    }]
                }]
            }, {
                name: "下载设置",
                classes: "xly-setting-down",
                children: [{
                    name: "TaskDefaultSettings-OpenSilenceDownload",
                    type: "confCheckbox",
                    label: "一键下载",
                    extEles: [{
                        type: "confTip",
                        text: '"一键下载" 生效时,点击下载链接将直接建立下载任务,不会弹出新建任务面板',
                        classes: "xly-icon-help"
                    }]
                }, {
                    label: "下载目录",
                    type: "confText",
                    text: "下载目录",
                    classes: "xly-setting-content__title",
                    liClasses: "xly-setting-content__align",
                    children: [{
                        name: "TaskDefaultSettings-DefaultPath",
                        type: "confSelect",
                        label: "",
                        optionByName: "PathAndCategory-historyDownloadPaths",
                        liClasses: "td-select xly-select-setting",
                        slotOption: "openDirectory",
                        editable: !0,
                        hasDeleteOption: !0,
                        deleteOptionText: "清除历史下载目录",
                        maxOptionLen: 5,
                        blurUpdate: !0,
                        rules: [["rule, value, callback", "let errors = [];\n                    do {\n                      let dir = '';\n                      let ip = '';\n                      if (/^[c-zC-Z]:\\\\/.test(value)) {\n                        dir = value.slice(3);\n                      } else {\n                        if (value.indexOf('\\\\\\\\') === 0) {\n                          let index = value.indexOf('\\\\', 2);\n                          if (index === -1 || index === value.length - 1) {\n                            errors.push(new Error('不合法的存储路径'));\n                            break;\n                          }\n                          dir = value.slice(2);\n                          ip = dir.substr(0, index - 2);\n                          if (ip === '') {\n                            errors.push(new Error('不合法的存储路径'));\n                            break;\n                          }\n                        } else {\n                          errors.push(new Error('不合法的存储路径'));\n                          break;\n                        }\n                      }\n                      if (/[\\*\\\"<>\\?:\\|]/i.test(dir)) {\n                        errors.push(new Error('下载目录名称不能包含下列任何字符：:|* ?“<>'));\n                        break;\n                      }\n                      if (value.length > 256) {\n                        errors.push(new Error('您输入的下载目录路径长度超过系统限制，请控制在256个字符以内'));\n                        break;\n                      }\n                      if (ip === '') {\n                        break;\n                      }\n                      let index = ip.indexOf('.ipv6-literal.net');\n                      if (index !== -1) {\n                        ip = ip.substr(0, index);\n                        index = ip.indexOf('%');\n                        if (index !== -1) {\n                          ip = ip.substr(0, index);\n                        }\n                        ip = ip.replace(/\\-/g, ':');\n                        if (!/^\\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)(\\.(25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)){3}))|:)))(%.+)?\\s*$/.test(ip)) {\n                          errors.push(new Error('不合法的存储路径'));\n                        }\n                      } else {\n                        if (\n                          !/(?=(\\b|\\D))(((\\d{1,2})|(1\\d{1,2})|(2[0-4]\\d)|(25[0-5]))\\.){3}((\\d{1,2})|(1\\d{1,2})|(2[0-4]\\d)|(25[0-5]))(?=(\\b|\\D))/.test(\n                            ip\n                          )\n                        ) {\n                          errors.push(new Error('不合法的存储路径'));\n                        }\n                      }\n                    } while (false);\n                    callback(errors);"]]
                    }, {
                        name: "TaskDefaultSettings-UseLastCatalog",
                        type: "confCheckbox",
                        label: "自动修改为上次使用的目录",
                        linkItem: {
                            section: "PathAndCategory",
                            key: "LastUsedPath",
                            name: "TaskDefaultSettings-DefaultPath"
                        }
                    }]
                }, {
                    name: "",
                    type: "confText",
                    text: "默认下载方式",
                    children: [{
                        name: "TaskDefaultSettings-NewTaskStartMode",
                        type: "confRadio",
                        ulClasses: "xly-setting-content__indentation",
                        tipClass: "xly-setting-content__tips tip-text",
                        option: ["立即下载", "手动下载"],
                        labels: ["立即下载", "手动下载"]
                    }]
                }, {
                    name: "TaskDefaultSettings-OrignHostThreads",
                    type: "confSelect",
                    label: "原始地址线程数",
                    classes: "xly-select-size-1",
                    option: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10"]
                }, {
                    name: "TaskDefaultSettings-MaxResourceLimit",
                    type: "confCheckboxInput",
                    label: "限制全局最大同时下载资源数",
                    styles: "display: flex; align-items: center;",
                    extEles: [{
                        type: "confInput",
                        name: "TaskDefaultSettings-MaxResourceCount",
                        label: " ",
                        toolTipsContent: "输入值必须大于0",
                        rules: [["rule, value, callback", "let errors = [];\n                    let speed = 100;\n                    if (value.trim() !== '') {\n                      speed = Number(value);\n                      if (isNaN(speed) || speed <= 0) {\n                        errors.push(new Error('输入值必须大于0'));\n                      }\n                      callback(errors);\n                    }"]],
                        outClasses: "xly-select-size-2"
                    }, {
                        type: "confTip",
                        text: "如果您在使用迅雷下载时，发现网络响应变慢或掉线等情况。\n这可能是由于您的路由器性能难以支撑较大的同时下载资源\n数。您可以尝试降低此项数值，从而降低路由器的负载。建\n议您在保持网络稳定的前提下，让此项数值尽可能的大",
                        classes: "xly-icon-help"
                    }]
                }, {
                    name: "TaskDefaultSettings-AwayModeEnabled",
                    type: "confCheckbox",
                    label: '启用"离开模式"',
                    extEles: [{
                        type: "confTip",
                        text: "启用“离开模式”后，在电脑处于“睡眠”状态时，\n迅雷仍然能帮您继续下载资源",
                        classes: "xly-icon-help"
                    }]
                }]
            }, {
                name: "任务管理",
                classes: "xly-setting-content__vertical",
                children: [{
                    name: "ConfigNormalSession-ConfigNormal_AutoStartUnFinishedTask",
                    type: "confCheckbox",
                    label: "启动迅雷后自动开始未完成任务"
                }, {
                    name: "ConfigNormalSession-ConfigNormal_MaxRunningTaskCount",
                    type: "confSelect",
                    label: "同时下载的最大任务数",
                    classes: "xly-select-size-1",
                    option: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50"]
                }, {
                    name: "ConfigNormalSession-ConfigNormal_AutoSlowTask2Tail",
                    type: "confCheckbox",
                    label: "自动将低速任务移动至列尾"
                }, {
                    name: "ConfigNoLimitDownload-TaskCountAutoAdd",
                    type: "confCheckboxInput",
                    label: "全局下载速度低于",
                    styles: "display: flex; align-items: center;",
                    extEles: [{
                        type: "confInput",
                        name: "ConfigNoLimitDownload-TaskCountAutoAddRate",
                        label: " ",
                        toolTipsContent: "输入速度值必须大于0",
                        rules: [["rule, value, callback", "let errors = [];\n                    let speed = 100;\n                    if (value.trim() !== '') {\n                      speed = Number(value);\n                      if (isNaN(speed) || speed <= 0) {\n                        errors.push(new Error('输入速度值必须大于0'));\n                      }\n                      callback(errors);\n                    }"]],
                        outClasses: "xly-input-size-1"
                    }, {
                        type: "confText",
                        classes: "xly-input-size",
                        text: " KB/s自动增加同时下载任务数",
                        style: "padding-right: 3px"
                    }, {
                        type: "confTip",
                        text: "当您使用迅雷进行排队下载时，开启本选项能够尽量\n充分利用您的网络带宽进行下载。本选项合理的设定\n值应为您的网络带宽最大下载速度的80%。假设您最\n大下载速度曾达到1000KB/s，则此项合理的设定值\n应为800KB/s。",
                        classes: "xly-icon-help"
                    }]
                }, {
                    name: "ConfigNoLimitDownload-OpenNoLimitDownload",
                    type: "confCheckboxSelect",
                    label: "优先下载小于",
                    extEles: [{
                        type: "confSelect",
                        classes: "xly-select-size-1",
                        name: "ConfigNoLimitDownload-NoLimitDownloadFileSize",
                        option: ["5", "10", "20", "30", "50", "100"],
                        style: "padding-left: 3px"
                    }, {type: "confText", classes: "textCenter flexLay", text: "MB的任务", style: "padding-left: 5px"}],
                    classes: "flexLay"
                }, {
                    name: "ConfigNormalSession-ConfigNormal_AutoDeleteNotExistFile",
                    type: "confCheckbox",
                    label: "自动删除“文件不存在”的任务"
                }, {name: "TaskDefaultSettings-OpenFile", type: "confCheckbox", label: "下载完成后自动打开"}]
            }, {
                name: "提醒",
                children: [{
                    name: "ConfigMsg-ConfigMsg_Finish",
                    type: "confCheckbox",
                    label: "下载完成时右下角弹窗提示"
                }, {
                    name: "ConfigMsg-ConfigMsg_FailSuggest",
                    type: "confCheckbox",
                    label: "下载失败时右下角弹窗提示"
                }, {
                    name: "ConfigMsg-ConfigMsg_PlayWaveWhileFinish",
                    type: "confCheckbox",
                    label: "下载完成后播放提示音"
                }, {
                    type: "confSelect",
                    name: "ConfigMsg-ConfigMsg_WavePath",
                    classes: "xly-select-setting--normal td-select xly-select-setting",
                    slotOption: "openFile",
                    outerClass: "td-checkbox",
                    editable: !0
                }, {name: "UserCommunitySet-radio_id_", type: "confCheckbox", label: "接收消息通知", isReleventUser: !0}]
            }, {
                name: "悬浮窗",
                classes: "xly-setting-content__vertical",
                children: [{
                    name: "ConfigFloatPanel-FloatPanelValue",
                    type: "confRadio",
                    label: "显示悬浮窗",
                    option: ["0", "1", "2"],
                    labels: ["显示悬浮窗", "下载时显示悬浮窗", "隐藏悬浮窗"],
                    ulClasses: "xly-setting-content__vertical"
                }]
            }, {
                name: "高级设置",
                classes: "xly-setting-content xly-setting-advanced",
                children: [{
                    name: "",
                    type: "confText",
                    ulClasses: "xly-setting-content__indentation",
                    text: "BT下载",
                    children: [{
                        name: "BtGenericSettings-AutoBTNewTask",
                        type: "confCheckbox",
                        label: "下载种子文件后自动打开新建面板"
                    }, {name: "BtGenericSettings-AssocTorrent", type: "confCheckbox", label: "启动时关联BT种子文件(.torrent文件)"}]
                }, {
                    name: "",
                    text: "下载磁盘缓存",
                    type: "confText",
                    tip: "磁盘缓存越大，下载速度越快，占用资源越多",
                    tipClass: "xly-setting-content__description",
                    children: [{
                        name: "DiskCache-DiskCacheSelect",
                        type: "confRadio",
                        label: "256",
                        ulClasses: "xly-setting-content__horizontal",
                        option: ["128", "256", "512"],
                        labels: ["128M", "256M", "512M"]
                    }]
                }, {
                    label: "下载加速",
                    classes: "xly-setting-content__indentation",
                    children: [{
                        name: "ConfigNet-ConfigNet_OpenMirrorImageIncreaseSpeed",
                        type: "confCheckbox",
                        label: "开启镜像服务器加速"
                    }, {
                        name: "",
                        text: "全网数据挖掘，自动匹配与原始资源相同的镜像供用户下载",
                        label: "",
                        type: "confText",
                        classes: "xly-setting-content__description"
                    }, {
                        name: "ConfigNet-ConfigNet_OpenXunleiP2PIncreaseSpeed",
                        type: "confCheckbox",
                        label: "开启迅雷P2P加速"
                    }, {
                        name: "",
                        label: "",
                        text: "利用P2P技术进行用户间加速，该通道产生的上传流量会慢慢提升通道的健康度，从而提升通道加速效果",
                        type: "confText",
                        classes: "xly-setting-content__description"
                    }]
                }, {
                    text: "下载代理设置",
                    ulClasses: "xly-setting-content__vertical",
                    type: "confText",
                    tip: "该设置仅对下载生效，对网页浏览无效",
                    tipClass: "xly-setting-content__description",
                    children: [{
                        name: "ProxySetting-ConfigProxy_Type",
                        type: "confRadio",
                        ulClasses: "xly-setting-content__part",
                        extEles: [{type: "", label: " "}, {type: "", label: " "}, {
                            type: "confContainer",
                            label: "",
                            ulClasses: "xly-setting-advanced__config",
                            extEles: [{
                                name: "ProxySetting-ConnectType_Hub",
                                type: "confSelect",
                                label: "迅雷服务器连接",
                                classes: "xly-select-size-2",
                                updateByDataChange: !0,
                                optionByName: "ConnectType-ProxyName"
                            }, {
                                name: "ProxySetting-ConnectType_Http",
                                type: "confSelect",
                                label: "HTTP连接",
                                classes: "xly-select-size-2",
                                updateByDataChange: !0,
                                optionByName: "ConnectType-ProxyName"
                            }, {
                                name: "ProxySetting-ConnectType_Ftp",
                                type: "confSelect",
                                label: "FTP连接",
                                classes: "xly-select-size-2",
                                updateByDataChange: !0,
                                optionByName: "ConnectType-ProxyName"
                            }]
                        }],
                        extActiveValue: "2",
                        labels: ["不使用代理服务器", "使用IE代理服务器", "使用自定义代理服务器"],
                        option: ["0", "1", "2"]
                    }, {name: "", type: "confProxyList"}]
                }]
            }],
            formData: {
                "ThunderPanPlugin-MaxUploadTaskNum": {
                    section: "ThunderPanPlugin",
                    key: "MaxUploadTaskNum",
                    value: 5
                },
                "ThunderPanPlugin-MaxDownloadTaskNum": {
                    section: "ThunderPanPlugin",
                    key: "MaxDownloadTaskNum",
                    value: 5
                },
                "ThunderPanPlugin-defaultDownloadPath": {
                    section: "ThunderPanPlugin",
                    key: "defaultDownloadPath",
                    value: "C:\\迅雷下载"
                },
                "ThunderPanPlugin-downloadPaths": {section: "ThunderPanPlugin", key: "downloadPaths", value: []},
                "ThunderPanPlugin-useDefault": {section: "ThunderPanPlugin", key: "useDefault", value: !1},
                "ThunderPanPlugin-lastUsePath": {section: "ThunderPanPlugin", key: "lastUsePath", value: !1},
                "ThunderPanPlugin-defaultSavePath": {
                    section: "ThunderPanPlugin",
                    key: "defaultSavePath",
                    value: "我的云盘/我的转存"
                },
                "ThunderPanPlugin-savePaths": {section: "ThunderPanPlugin", key: "savePaths", value: []},
                "ConfigNormalSession-ConfigNormal_AutoRun": {
                    section: "ConfigNormalSession",
                    key: "ConfigNormal_AutoRun",
                    value: !0
                },
                "Others-AntiDisturb": {section: "Others", key: "AntiDisturb", value: !0},
                "ConfigNormalSession-ConfigNormal_AutoStartUnFinishedTask": {
                    section: "ConfigNormalSession",
                    key: "ConfigNormal_AutoStartUnFinishedTask",
                    value: !1
                },
                "TaskDefaultSettings-DefaultPath": {section: "TaskDefaultSettings", key: "DefaultPath", value: ""},
                "TaskDefaultSettings-UseLastCatalog": {
                    section: "TaskDefaultSettings",
                    key: "UseLastCatalog",
                    value: !0
                },
                "DiskCache-DiskCacheSelect": {section: "DiskCache", key: "DiskCacheSelect", value: "256"},
                "TaskDefaultSettings-NewTaskStartMode": {
                    section: "TaskDefaultSettings",
                    key: "NewTaskStartMode",
                    value: "立即下载",
                    optionToValue: {"立即下载": 1, "手动下载": 0}
                },
                "ConfigNormalSession-ConfigNormal_MaxRunningTaskCount": {
                    section: "ConfigNormalSession",
                    key: "ConfigNormal_MaxRunningTaskCount",
                    value: "5"
                },
                "ConfigNormalSession-ConfigNormal_AutoDeleteNotExistFile": {
                    section: "ConfigNormalSession",
                    key: "ConfigNormal_AutoDeleteNotExistFile",
                    value: !1
                },
                "TaskDefaultSettings-OpenFile": {section: "TaskDefaultSettings", key: "OpenFile", value: !1},
                "ConfigNet-ConfigNet_Type": {section: "ConfigNet", key: "ConfigNet_Type", value: "1"},
                "ProxySetting-ConfigProxy_Type": {section: "ProxySetting", key: "ConfigProxy_Type", value: "0"},
                "ProxySetting-ConnectType_Hub": {section: "ProxySetting", key: "ConnectType_Hub", value: "直接连接"},
                "ProxySetting-ConnectType_Http": {section: "ProxySetting", key: "ConnectType_Http", value: "直接连接"},
                "ProxySetting-ConnectType_Ftp": {section: "ProxySetting", key: "ConnectType_Ftp", value: "直接连接"},
                "ConfigMsg-ConfigMsg_Finish": {section: "ConfigMsg", key: "ConfigMsg_Finish", value: !0},
                "ConfigMsg-ConfigMsg_PlayWaveWhileFinish": {
                    section: "ConfigMsg",
                    key: "ConfigMsg_PlayWaveWhileFinish",
                    value: !0
                },
                "ConfigMsg-ConfigMsg_WavePath": {section: "ConfigMsg", key: "ConfigMsg_WavePath", value: l},
                "ConfigMsg-ConfigMsg_FailSuggest": {section: "ConfigMsg", key: "ConfigMsg_FailSuggest", value: !0},
                "ConfigMsg-ConfigMsg_TodayRecommend": {
                    section: "ConfigMsg",
                    key: "ConfigMsg_TodayRecommend",
                    value: !0
                },
                "Monitor-MonitorClipBoard": {section: "Monitor", key: "MonitorClipBoard", value: !0},
                "Monitor-ShortcutMonitor": {section: "Monitor", key: "ShortcutMonitor", value: !0},
                "Monitor-WatchTraditionLink": {section: "Monitor", key: "WatchTraditionLink", value: !0},
                "Monitor-ConfigWatch_Bt": {section: "Monitor", key: "ConfigWatch_Bt", value: !0},
                "EMuleGenericSettings-EMuleWatchLink": {
                    section: "EMuleGenericSettings",
                    key: "EMuleWatchLink",
                    value: !0
                },
                "MagnetGenericSettings-MagnetWatchLink": {
                    section: "MagnetGenericSettings",
                    key: "MagnetWatchLink",
                    value: !0
                },
                "BtGenericSettings-AutoBTNewTask": {section: "BtGenericSettings", key: "AutoBTNewTask", value: !0},
                "BtGenericSettings-AssocTorrent": {section: "BtGenericSettings", key: "AssocTorrent", value: !0},
                "TaskDefaultSettings-OpenSilenceDownload": {
                    section: "TaskDefaultSettings",
                    key: "OpenSilenceDownload",
                    type: "number",
                    value: 0
                },
                "TaskDefaultSettings-AwayModeEnabled": {
                    section: "TaskDefaultSettings",
                    key: "AwayModeEnabled",
                    value: !1
                },
                "BossKey-BossKeySwitch": {section: "BossKey", key: "BossKeySwitch", value: !1},
                "BossKey-BossKeyName": {section: "BossKey", key: "BossKeyName", value: "Alt+D"},
                "TaskDefaultSettings-NewTaskDlgWithoutMainWnd": {
                    section: "TaskDefaultSettings",
                    key: "NewTaskDlgWithoutMainWnd",
                    value: !0
                },
                "ConfigFloatPanel-FloatPanelValue": {
                    section: "ConfigFloatPanel",
                    key: "FloatPanelValue",
                    value: "0",
                    immediatelySave: !0
                },
                "TaskDefaultSettings-OrignHostThreads": {
                    section: "TaskDefaultSettings",
                    key: "OrignHostThreads",
                    value: "5"
                },
                "TaskDefaultSettings-MaxResourceLimit": {
                    section: "TaskDefaultSettings",
                    key: "MaxResourceLimit",
                    value: !1
                },
                "TaskDefaultSettings-MaxResourceCount": {
                    section: "TaskDefaultSettings",
                    key: "MaxResourceCount",
                    value: "500"
                },
                "ConfigNoLimitDownload-TaskCountAutoAdd": {
                    section: "ConfigNoLimitDownload",
                    key: "TaskCountAutoAdd",
                    value: !1
                },
                "ConfigNoLimitDownload-TaskCountAutoAddRate": {
                    section: "ConfigNoLimitDownload",
                    key: "TaskCountAutoAddRate",
                    value: "100"
                },
                "ConfigNormalSession-ConfigNormal_AutoSlowTask2Tail": {
                    section: "ConfigNormalSession",
                    key: "ConfigNormal_AutoSlowTask2Tail",
                    value: !1
                },
                "ConfigNoLimitDownload-OpenNoLimitDownload": {
                    section: "ConfigNoLimitDownload",
                    key: "OpenNoLimitDownload",
                    value: !1
                },
                "ConfigNoLimitDownload-NoLimitDownloadFileSize": {
                    section: "ConfigNoLimitDownload",
                    key: "NoLimitDownloadFileSize",
                    value: "30"
                },
                "ConfigNet-ConfigNet_OpenMirrorImageIncreaseSpeed": {
                    section: "ConfigNet",
                    key: "ConfigNet_OpenMirrorImageIncreaseSpeed",
                    value: !0
                },
                "ConfigNet-ConfigNet_OpenXunleiP2PIncreaseSpeed": {
                    section: "ConfigNet",
                    key: "ConfigNet_OpenXunleiP2PIncreaseSpeed",
                    value: !0
                },
                "ConfigNet-ConfigNet_Custom_DownloadSpeedChk": {
                    section: "ConfigNet",
                    key: "ConfigNet_Custom_DownloadSpeedChk",
                    value: !0,
                    immediatelySave: !0
                },
                "ConfigNet-ConfigNet_Custom_UploadSpeedChk": {
                    section: "ConfigNet",
                    key: "ConfigNet_Custom_UploadSpeedChk",
                    value: !0,
                    immediatelySave: !0
                },
                "ConfigNet-ConfigNet_Custom_MaxDownloadSpeed": {
                    section: "ConfigNet",
                    key: "ConfigNet_Custom_MaxDownloadSpeed",
                    value: "1024",
                    immediatelySave: !0
                },
                "ConfigNet-ConfigNet_Custom_MaxUploadSpeed": {
                    section: "ConfigNet",
                    key: "ConfigNet_Custom_MaxUploadSpeed",
                    value: "1024",
                    immediatelySave: !0
                },
                "ConfigNet-ConfigNet_Custom_Time_Switch": {
                    section: "ConfigNet",
                    key: "ConfigNet_Custom_Time_Switch",
                    value: !1,
                    immediatelySave: !0
                },
                "ConfigNet-ConfigNet_Custom_Time_Begin_Hour": {
                    section: "ConfigNet",
                    key: "ConfigNet_Custom_Time_Begin_Hour",
                    value: "0",
                    immediatelySave: !0
                },
                "ConfigNet-ConfigNet_Custom_Time_Begin_Minute": {
                    section: "ConfigNet",
                    key: "ConfigNet_Custom_Time_Begin_Minute",
                    value: "0",
                    immediatelySave: !0
                },
                "ConfigNet-ConfigNet_Custom_Time_End_Hour": {
                    section: "ConfigNet",
                    key: "ConfigNet_Custom_Time_End_Hour",
                    value: "23",
                    immediatelySave: !0
                },
                "ConfigNet-ConfigNet_Custom_Time_End_Minute": {
                    section: "ConfigNet",
                    key: "ConfigNet_Custom_Time_End_Minute",
                    value: "59",
                    immediatelySave: !0
                },
                "BtGenericSettings-ConfigBt_SetPortType": {
                    section: "BtGenericSettings",
                    key: "ConfigBt_SetPortType",
                    value: "0"
                },
                "BtGenericSettings-ConfigBt_Manul_TcpPort": {
                    section: "BtGenericSettings",
                    key: "ConfigBt_Manul_TcpPort",
                    value: "15000"
                },
                "UserCommunitySet-radio_id_": {
                    section: "UserCommunitySet",
                    key: "radio_id_",
                    value: !0,
                    isReleventUser: !0,
                    immediatelySave: !0
                },
                "GenericSettings-AnimationLevel": {section: "GenericSettings", key: "AnimationLevel", value: "1"},
                "Motitor-MotitorAll": {
                    section: "Motitor",
                    key: "MotitorAll",
                    value: 1,
                    type: "number",
                    selectItems: ["Motitor-MotitorIE浏览器"]
                },
                "Bookmark-ShowBookmarkBar": {section: "Bookmark", key: "ShowBookmarkBar", value: 1},
                "PathAndCategory-historyDownloadPaths": {
                    section: "PathAndCategory",
                    key: "historyDownloadPaths",
                    value: []
                },
                "DownloadAndPlay-LanuchMediaPlayer": {
                    section: "DownloadAndPlay",
                    key: "LanuchMediaPlayer",
                    value: "0",
                    immediatelySave: !0
                },
                "ConnectType-ProxyName": {section: "ConnectType", key: "ProxyName", value: ["直接连接"]}
            }
        }, e.setBaseConf = function () {
            let t = Object.values(e.conf.formData);
            for (let i = 0; i < t.length; i++) {
                let n = "";
                if (void 0 !== t[i].optionToValue) {
                    let e = a.ConfigNS.getValue(t[i].section, t[i].key, t[i].optionToValue[t[i].value]);
                    for (let a in t[i].optionToValue) if (t[i].optionToValue[a] === e) {
                        n = a;
                        break
                    }
                } else n = a.ConfigNS.getValue(t[i].section, t[i].key, t[i].value);
                e.conf.formData[`${t[i].section}-${t[i].key}`].value = n
            }
        }, e.initConf = function () {
            return a.ConfigNS.init(r.join(__profilesDir, "config.json"))
        }, e.getConfSchema = function () {
            return e.conf.sechema
        }, e.getConfFormData = function () {
            return e.conf.formData
        }, e.addSettingItemData = function (t, i) {
            let n = !1;
            if (t.name && t.name.length > 0 && t.children) {
                let i = !1;
                for (let a = 0; a < e.conf.sechema.length; ++a) if (e.conf.sechema[a].name === t.name) {
                    i = !0;
                    let o = t.children[0], r = !1;
                    for (let t = 0; t < e.conf.sechema[a].children.length; ++t) {
                        let i = e.conf.sechema[a].children[t];
                        if (i.name === o.name) {
                            if (r = !0, n = !0, o.children.length > 0) for (let e = 0; e < o.children.length; ++e) if (i.children.length > 0) {
                                let t = !1;
                                for (let n = 0; n < i.children.length; ++n) if (o.children[e].name === i.children[n].name) {
                                    t = !0;
                                    break
                                }
                                t || i.children.push(o.children[e])
                            } else i.children.push(o.children[e]);
                            break
                        }
                    }
                    r || (n = !0, e.conf.sechema[a].children.push(t.children[0]));
                    break
                }
                i || (n = !0, e.conf.sechema.push(t))
            }
            for (let t in i) e.conf.formData[t] = i[t];
            return n
        }, e.removeSettingItemData = function (t, i) {
            let n = !1;
            if (t.name && t.name.length > 0 && t.children) for (let i = 0; i < e.conf.sechema.length; ++i) if (e.conf.sechema[i].name === t.name) {
                let a = t.children[0];
                for (let t = 0; t < e.conf.sechema[i].children.length; ++t) {
                    let o = e.conf.sechema[i].children[t];
                    if (o.name === a.name) {
                        if (a.children.length > 0 && o.children.length > 0) for (let e = 0; e < a.children.length; ++e) for (let t = 0; t < o.children.length; ++t) if (a.children[e].name === o.children[t].name) {
                            n = !0, o.children.splice(t, 1);
                            break
                        }
                        0 === o.children.length && (n = !0, e.conf.sechema[i].children.splice(t, 1));
                        break
                    }
                }
                0 === e.conf.sechema[i].children.length && (n = !0, e.conf.sechema.splice(i, 1));
                break
            }
            for (let t in i) e.conf.formData[t] && delete e.conf.formData[t];
            return n
        }, e.removeSettingItem = t, e.addSettingItem = i, e.isSettingItemExist = d, e.getConfSchemaEx = function () {
            return n(this, void 0, void 0, function* () {
                return yield s.confAdd.updateAssociate(t, d, i), e.conf.sechema
            })
        }
    }(t.SettingInit || (t.SettingInit = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(12), o = i(0), r = i(9), s = i(22), l = i(3), d = i(73), u = i(5), c = i(31),
        h = o.default.getLogger("task filter");
    let f = "全部", g = void 0;
    const p = `${__profilesDir}/task-filters.json`;
    let v = !1;
    !function (e) {
        let t;
        !function (e) {
            e[e.Name = 1] = "Name", e[e.Filter = 2] = "Filter"
        }(t || (t = {}));
        const i = [{
                type: "checkbox",
                label: "视频文件",
                extFilter: "avi|mp4|mkv|mpeg|mpg|wmv|rmvb|rm|mov|ts|m2ts|tp|3gp|flv"
            }, {
                type: "checkbox",
                label: "音频文件",
                extFilter: "mp3|wma|m4a|aac|wav|flac|ape|alac|wv|opus|ogg|dts"
            }, {type: "checkbox", label: "图片文件", extFilter: "bmp|jpg|jpeg|png|gif|webp|psd|tga"}, {
                type: "checkbox",
                label: "应用程序",
                extFilter: "exe|msi|com|bat|cmd|py|vbs"
            }, {type: "checkbox", label: "压缩文件", extFilter: "rar|zip|7z|cab|lzh|jar"}, {
                type: "checkbox",
                label: "镜像文件",
                extFilter: "iso|img|bin|nrg|ccd|vcd|dts|cdi|gho|mds|mdf"
            }, {type: "checkbox", label: "文档文件", extFilter: "txt|doc|docx|xls|xlsx|csv|wps|rtf|pdf"}],
            o = [{type: "checkbox", label: "全部", id: "all"}, {type: "separator"}, {
                type: "checkbox",
                label: "BT任务",
                taskType: l.DownloadKernel.TaskType.Bt
            }, {type: "checkbox", label: "任务组", taskType: l.DownloadKernel.TaskType.Group}, {
                type: "normal",
                label: "自定义",
                id: "custom"
            }];
        let m = [...o];

        function y() {
            return n(this, void 0, void 0, function* () {
                do {
                    if (v) break;
                    if (v = !0, !(yield u.FileSystemAWNS.existsAW(p))) {
                        m.splice(2, 0, ...i);
                        break
                    }
                    let e = (yield u.FileSystemAWNS.readFileAW(p)).toString(), t = null;
                    try {
                        t = JSON.parse(e)
                    } catch (e) {
                    }
                    t ? t.length > 0 && m.splice(2, 0, ...t) : m.splice(2, 0, ...i)
                } while (0)
            })
        }

        function k() {
            return m.filter(e => "custom" === e.id || "checkbox" === e.type && !e.id && !e.taskType)
        }

        e.initFilter = y, e.saveFilter = function (e, i) {
            return n(this, void 0, void 0, function* () {
                e = e.map(e => ({
                    label: e.label,
                    extFilter: e.extFilter,
                    nameFilter: e.nameFilter
                })), (m = [...o]).splice(2, 0, ...e), yield u.FileSystemAWNS.writeFileAW(p, JSON.stringify(e));
                do {
                    if (!g) break;
                    if (!i || !i.reason) break;
                    if ("remove" === i.reason) {
                        i.data.label === f && (f = "全部", g("全部"));
                        break
                    }
                    if (!i.data) break;
                    if ("modify" === i.reason && i.data.type) {
                        if (i.data.lastSelect !== f) break;
                        if ((i.data.type & t.Name) === t.Name && i.data.lastSelect && (f = i.data.label, g(f)), (i.data.type & t.Filter) === t.Filter) {
                            let e = l.DownloadKernel.FilterKeyType.ExtEqual;
                            i.data.nameFilter && (e = l.DownloadKernel.FilterKeyType.NameLikeAndExtEqual), c.ThunderKernel.filterTask(e, i.data.nameFilter ? i.data.nameFilter : "", i.data.extFilter ? i.data.extFilter : "", e => {
                                h.information("task filter", e), g(void 0, e)
                            }, -1)
                        }
                        break
                    }
                } while (0)
            })
        }, e.reset = function () {
            f = "全部"
        }, e.refresh = function (e) {
            g = e
        }, e.getCustomOptions = k, e.getMenuOptions = function (e, t) {
            return n(this, void 0, void 0, function* () {
                yield y();
                let i = [];
                for (let n of m) n.type = n.type ? n.type : "checkbox", "separator" === n.type ? i.push({type: n.type}) : i.push({
                    type: n.type,
                    label: n.label,
                    enabled: n.enabled,
                    icon: n.icon,
                    id: n.id,
                    checked: f === n.label,
                    click: i => {
                        let a = `category=${encodeURIComponent(i.label)}`;
                        r.XLStatNS.trackEvent("download_leftpanel", "finished_tab_float_click", "", 0, 0, 0, 0, a);
                        do {
                            if ("function" != typeof t) break;
                            if ("custom" === n.id) {
                                let e = k();
                                s.MessageBox.custom("custom-task-filter", {items: JSON.stringify(e)}, {
                                    width: 506,
                                    height: 390
                                }).catch();
                                break
                            }
                            if (i.label === f) {
                                h.information("select old item");
                                break
                            }
                            if (f = i.label, "all" === n.id) {
                                t(n);
                                break
                            }
                            let a = l.DownloadKernel.FilterKeyType.ExtEqual;
                            n.taskType ? a = l.DownloadKernel.FilterKeyType.TaskTypeEqual : n.nameFilter && "" !== n.nameFilter.trim() && (a = l.DownloadKernel.FilterKeyType.NameLikeAndExtEqual), c.ThunderKernel.filterTask(a, n.nameFilter ? n.nameFilter : "", n.extFilter ? n.extFilter : "", e => {
                                h.information("task filter", e), t(n, e)
                            }, e, void 0, n.taskType)
                        } while (0)
                    }
                });
                return i
            })
        }, e.showMenu = function (e, t, i) {
            return n(this, void 0, void 0, function* () {
                r.XLStatNS.trackEvent("download_leftpanel", "finished_tab_float_show"), yield y();
                let n = [];
                for (let e of m) e.type = e.type ? e.type : "checkbox", "separator" === e.type ? n.push({type: e.type}) : n.push({
                    type: e.type,
                    label: e.label,
                    enabled: e.enabled,
                    icon: e.icon,
                    id: e.id,
                    checked: f === e.label,
                    click: n => {
                        let a = `category=${encodeURIComponent(n.label)}`;
                        r.XLStatNS.trackEvent("download_leftpanel", "finished_tab_float_click", "", 0, 0, 0, 0, a);
                        do {
                            if ("function" != typeof i) break;
                            if ("custom" === e.id) {
                                let e = k();
                                s.MessageBox.custom("custom-task-filter", {items: JSON.stringify(e)}, {
                                    width: 506,
                                    height: 390
                                }).catch();
                                break
                            }
                            if (n.label === f) {
                                h.information("select old item");
                                break
                            }
                            if (f = n.label, "all" === e.id) {
                                i(e);
                                break
                            }
                            let a = l.DownloadKernel.FilterKeyType.ExtEqual;
                            e.taskType ? a = l.DownloadKernel.FilterKeyType.TaskTypeEqual : e.nameFilter && "" !== e.nameFilter.trim() && (a = l.DownloadKernel.FilterKeyType.NameLikeAndExtEqual), c.ThunderKernel.filterTask(a, e.nameFilter ? e.nameFilter : "", e.extFilter ? e.extFilter : "", t => {
                                h.information("task filter", t), i(e, t)
                            }, t, void 0, e.taskType)
                        } while (0)
                    }
                });
                const o = yield a.asyncRemoteCall.getCurrentWindow(),
                    u = yield(yield a.asyncRemoteCall.getMenu()).buildFromTemplate(n);
                yield d.MenuSkinNS.setStyle(u, {});
                let g = e.getBoundingClientRect(), p = Math.round(g.left), v = Math.round(g.top);
                u.popup({window: o, x: p, y: v, async: !1})
            })
        }
    }(t.CompletedFilterNS || (t.CompletedFilterNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(18), o = i(10), r = i(13), s = i(25), l = i(24), d = i(0).default.getLogger("CommonLoginHelper");
    a.default.defaults.adapter = i(21);
    t.commonLoginHelper = new class {
        sendSmsAw(e) {
            return n(this, void 0, void 0, function* () {
                let t = null;
                do {
                    let i = yield this.getCommonParmAw();
                    if (null === i || void 0 === i) break;
                    null !== e && void 0 !== e && "" !== e && (i = `${i}&creditkey=${e}`);
                    let n = null, o = "https://xluser-ssl.xunlei.com/msg/v1.1/SendSms?";
                    o = `${o}${i}`;
                    try {
                        null !== (n = yield a.default.get(o, {timeout: 1e4})) && void 0 !== n.status && 200 === n.status && void 0 !== n.data && null !== n.data && "" !== n.data && (t = JSON.stringify(n.data))
                    } catch (e) {
                        d.information("sendSmsAw:error=", e);
                        break
                    }
                } while (0);
                return t
            })
        }

        checkSmsAw(e, t) {
            return n(this, void 0, void 0, function* () {
                let i = null;
                do {
                    if (null === e || void 0 === e) {
                        d.information("checkSmsAw token有问题 token：", e);
                        break
                    }
                    if (null === t || void 0 === t) {
                        d.information("checkSmsAw code有问题 code：", t);
                        break
                    }
                    let n = yield this.getCommonParmAw();
                    if (null === n || void 0 === n) break;
                    let o = null, r = "https://xluser-ssl.xunlei.com/msg/v1.1/CheckSms?";
                    r = `${r}${n = `${n}&token=${e}&code=${t}`}`;
                    try {
                        null !== (o = yield a.default.get(r, {timeout: 1e4})) && void 0 !== o.status && 200 === o.status && void 0 !== o.data && null !== o.data && "" !== o.data && (i = JSON.stringify(o.data))
                    } catch (e) {
                        d.information("sendSmsAw:error=", e);
                        break
                    }
                } while (0);
                return i
            })
        }

        isAutoPopupLogin() {
            return n(this, void 0, void 0, function* () {
                let e = !1;
                {
                    yield s.default.isInitedAw();
                    let t = s.default.getConfigInfo("login", "loginWndAutoPopup");
                    if (void 0 === t || null === t || -1 === t) e = !1; else if (0 === t) {
                        let t = yield this.getLoginWndShowConfigAw();
                        e = this.getCurDate() !== t
                    } else 1 === t && (e = !0)
                }
                return e
            })
        }

        setLoginWndShowConfig() {
            let e = this.getCurDate();
            o.ConfigNS.setValue("LoginWndAutoShow", "Date", e)
        }

        getCommonParmAw() {
            return n(this, void 0, void 0, function* () {
                let e = null;
                do {
                    let t = yield l.LoginHelperNS.loginHelper.isLoginedAw();
                    if (!0 !== t) {
                        d.information("getCommonParmAw 没有登陆 isLogin：", t);
                        break
                    }
                    let i = yield l.LoginHelperNS.loginHelper.getUserInfoAw();
                    if (null === i || void 0 === i) {
                        d.information("getCommonParmAw userInfo有问题 userInfo:", i);
                        break
                    }
                    let n = i.sessionid;
                    if (null === n || void 0 === n || "" === n) {
                        d.information("getCommonParmAw sessionid有问题 sessionid:", n);
                        break
                    }
                    let a = i.deviceid, o = i.userid;
                    try {
                        let t = l.LoginHelperNS.loginSDKHelper.getInitData(), i = JSON.parse(t), r = i.appid,
                            s = "PC-" + i.package;
                        e = `deviceid=${a}&sessionid=${n}&userid=${o}&platformVersion=${i.platform}&appid=${r}&appName=${s}&scene=040`
                    } catch (e) {
                    }
                } while (0);
                return e
            })
        }

        getCurDate() {
            let e = "", t = new Date;
            return e = `${t.getFullYear()}${t.getMonth() + 1}${t.getDate()}`
        }

        getLoginWndShowConfigAw() {
            return n(this, void 0, void 0, function* () {
                return new Promise(e => {
                    o.ConfigNS.attachListener(r.NodeEventMesssageNS.eventConfigInitFinished, () => {
                        let t = o.ConfigNS.getValue("LoginWndAutoShow", "Date", "");
                        e(t)
                    })
                })
            })
        }
    }
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(12), o = i(73), r = i(0).default.getLogger("ConTextMenu");
    !function (e) {
        e.popContextMenu = function (e, t) {
            t && (r.information("params", t), t.isEditable ? function (e, t) {
                return n(this, void 0, void 0, function* () {
                    let e = [{
                            label: "撤销",
                            role: "undo",
                            enabled: t.editFlags.canUndo
                        }, {type: "separator"}, {label: "剪切", role: "cut", enabled: t.editFlags.canCut}, {
                            label: "复制",
                            role: "copy",
                            enabled: t.editFlags.canCopy
                        }, {label: "粘贴", role: "paste", enabled: t.editFlags.canPaste}, {
                            label: "删除",
                            role: "delete",
                            enabled: t.editFlags.canDelete
                        }, {type: "separator"}, {label: "全选", role: "selectall", enabled: t.editFlags.canSelectAll}],
                        i = yield(yield a.asyncRemoteCall.getMenu()).buildFromTemplate(e);
                    yield o.MenuSkinNS.setStyle(i, {});
                    let n = yield a.asyncRemoteCall.getCurrentWindow();
                    yield i.popup({window: n})
                })
            }(0, t).catch() : "" !== t.selectionText && function (e, t) {
                return n(this, void 0, void 0, function* () {
                    let e = [{label: "复制", role: "copy", enabled: t.editFlags.canCopy}],
                        i = yield(yield a.asyncRemoteCall.getMenu()).buildFromTemplate(e);
                    yield o.MenuSkinNS.setStyle(i, {});
                    let n = yield a.asyncRemoteCall.getCurrentWindow();
                    yield i.popup({window: n})
                })
            }(0, t).catch())
        }, e.popupAt = function (e, t, i) {
            {
                let e = i.getBoundingClientRect();
                t.x = void 0 !== t.x ? t.x : Math.round(e.left), t.y = void 0 !== t.y ? t.y : Math.round(e.bottom)
            }
            e.popup(t)
        }
    }(t.ContextMenuNS || (t.ContextMenuNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(19), o = i(0), r = i(132), s = i(14), l = i(555), d = i(5), u = i(441), c = i(7),
        h = o.default.getLogger("Thunder.Skin");
    t.default = new class extends a.EventEmitter {
        constructor() {
            super(), this.skinInfo = r.SkinHelperNS.defaultSkinInfo, this.isTemp = !1, this.lsatSkinInfo = r.SkinHelperNS.defaultSkinInfo, this.featuredSkinInfo = r.SkinHelperNS.defaultSkinInfo, this.cacheURL = `${__profilesDir}/skin-info.json`, this.userShakeURL = `${__profilesDir}/user-shake-info.json`, this.init().catch(e => {
                h.warning(e)
            })
        }

        init() {
            return n(this, void 0, void 0, function* () {
                {
                    let e;
                    try {
                        e = JSON.parse((yield d.FileSystemAWNS.readFileAW(this.cacheURL)).toString())
                    } catch (e) {
                        h.warning("解析皮肤信息失败")
                    }
                    e && (this.lsatSkinInfo = e, yield this.setSkinInfo(e)), yield u.SpringFestivalSkinNS.init(), (yield u.SpringFestivalSkinNS.canShowSkin()) && u.SpringFestivalSkinNS.getSkin(!0).then(e => n(this, void 0, void 0, function* () {
                        h.information("SpringFestival skinInfo", e), e && (yield this.setSkinInfo(e))
                    })).catch()
                }
            })
        }

        getSkinInfo() {
            return this.skinInfo
        }

        getIsTemp() {
            return this.isTemp
        }

        setSkinInfo(e, t = !1, i = !1) {
            return n(this, void 0, void 0, function* () {
                if (s.ThunderUtil.isDef(e)) {
                    this.skinInfo = e, this.isTemp = i, e.type !== r.SkinHelperNS.SkinType.Cool && (this.featuredSkinInfo = e), this.skinInfo.is_spring_festival ? this.skinInfo.colors = u.SpringFestivalSkinNS.getColor().colors : this.skinInfo.colors = l.SkinConfigNS.colorList.find(e => e.id === this.skinInfo.colorID).colors, this.emit("changeSkin", this.skinInfo, t, i), t && !e.is_spring_festival && ((yield c.client.callServerFunction("IsLogined")) || e.type === r.SkinHelperNS.SkinType.Default) && u.SpringFestivalSkinNS.disableSkin();
                    let n = yield u.SpringFestivalSkinNS.canShowSkin();
                    if (e.is_spring_festival && n && (e = this.lsatSkinInfo), s.ThunderUtil.isUndef(e)) return;
                    let a = Object.assign({}, e);
                    if (delete a.colors, !i && e.type !== r.SkinHelperNS.SkinType.Cool) try {
                        yield d.FileSystemAWNS.writeFileAW(this.cacheURL, JSON.stringify(a))
                    } catch (e) {
                        h.warning("保存皮肤信息失败")
                    }
                }
            })
        }

        getShakeInfo(e) {
            return n(this, void 0, void 0, function* () {
                let t = void 0;
                do {
                    if (!e) break;
                    if (!(yield d.FileSystemAWNS.existsAW(this.userShakeURL))) break;
                    let i = (yield d.FileSystemAWNS.readFileAW(this.userShakeURL)).toString(), n = null;
                    try {
                        n = JSON.parse(i)
                    } catch (e) {
                    }
                    t = (n = n || {})[e]
                } while (0);
                return t
            })
        }

        handleShakeSave(e, t) {
            return n(this, void 0, void 0, function* () {
                if ("" !== e) {
                    let i = "{}", n = null;
                    if (yield d.FileSystemAWNS.existsAW(this.userShakeURL)) {
                        i = (yield d.FileSystemAWNS.readFileAW(this.userShakeURL)).toString() || "{}";
                        try {
                            n = JSON.parse(i)
                        } catch (e) {
                        }
                    }
                    n = n || {}, t ? n[e] = t : delete n[e], yield d.FileSystemAWNS.writeFileAW(this.userShakeURL, JSON.stringify(n))
                }
            })
        }

        getFeaturedSkinInfo() {
            return this.featuredSkinInfo
        }

        recoverSkin() {
            return n(this, void 0, void 0, function* () {
                this.lsatSkinInfo && (u.SpringFestivalSkinNS.disableSkin(), yield this.setSkinInfo(this.lsatSkinInfo))
            })
        }
    }
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(18), o = i(0), r = i(14), s = i(5), l = i(7);
    let {isDef: d} = r.ThunderUtil;
    const u = o.default.getLogger("WallpaperManager");
    t.default = new class {
        constructor() {
            this.wallpapersURL = "https://api-xl9-ssl.xunlei.com/sl/xlppc.personalizedcenter.api/api/xskin/list", this.testPapersURL = "http://test.api-shoulei-ssl.xunlei.com/xlppc.personalizedcenter.api/api/xskin/list"
        }

        getWallpapers() {
            return n(this, void 0, void 0, function* () {
                do {
                    a.default.defaults.adapter = i(21);
                    let e = 1 === (yield l.client.callServerFunction("GetValue", "ConfigFetchInterface", "TestServer", 0)) ? this.testPapersURL : this.wallpapersURL;
                    try {
                        let t = yield a.default.get(e, {params: {page: 0, per_page: 30}});
                        if (200 === t.status && "ok" === t.data.result) {
                            this.wallpapers = t.data.list;
                            try {
                                localStorage.setItem("wallpapers", JSON.stringify(this.wallpapers))
                            } catch (e) {
                                u.warning(e)
                            }
                            break
                        }
                    } catch (e) {
                        u.warning(e)
                    }
                    if (d(this.wallpapers)) break;
                    try {
                        this.wallpapers = JSON.parse(localStorage.getItem("wallpapers"))
                    } catch (e) {
                        u.warning(e)
                    }
                } while (0);
                let e = this.wallpapers || [], t = yield this.getSpringFestivalWallpaper();
                return t && (e = [...e, t]), e
            })
        }

        getCoolWallpapers() {
            return n(this, void 0, void 0, function* () {
                do {
                    a.default.defaults.adapter = i(21);
                    let e = "http://static-xl.a.88cdn.com/json/thunderx_superskins_skins.json";
                    try {
                        let t = yield a.default.get(e, {timeout: 1e4});
                        if (200 === t.status && t.data) {
                            this.coolWallpapers = t.data;
                            try {
                                u.information("get cool wallpapers", this.coolWallpapers), localStorage.setItem("coolWallpapers", JSON.stringify(this.coolWallpapers))
                            } catch (e) {
                                u.warning(e)
                            }
                            break
                        }
                    } catch (e) {
                        u.warning(e)
                    }
                    if (d(this.coolWallpapers)) break;
                    try {
                        this.coolWallpapers = JSON.parse(localStorage.getItem("coolWallpapers"))
                    } catch (e) {
                        u.warning(e)
                    }
                } while (0);
                return this.coolWallpapers || []
            })
        }

        getCoolShakes() {
            return n(this, void 0, void 0, function* () {
                do {
                    a.default.defaults.adapter = i(21);
                    let e = "https://static-xl.a.88cdn.com/json/thunderx_superskins_effects.json";
                    try {
                        let t = yield a.default.get(e, {timeout: 1e4});
                        if (200 === t.status && t.data) {
                            this.coolShakes = t.data;
                            try {
                                u.information("get cool wallpapers", this.coolShakes), localStorage.setItem("coolShakes", JSON.stringify(this.coolShakes))
                            } catch (e) {
                                u.warning(e)
                            }
                            break
                        }
                    } catch (e) {
                        u.warning(e)
                    }
                    if (d(this.coolShakes)) break;
                    try {
                        this.coolShakes = JSON.parse(localStorage.getItem("coolShakes"))
                    } catch (e) {
                        u.warning(e)
                    }
                } while (0);
                return this.coolShakes || []
            })
        }

        removeImage(e) {
            return n(this, void 0, void 0, function* () {
                let t = `${__profilesDir}/skins/${e.id}`;
                return s.FileSystemAWNS.rmdirsAW(t)
            })
        }

        getImage(e) {
            return n(this, void 0, void 0, function* () {
                let t = `${__profilesDir}/skins/${e.id}/wallpaper.jpg`;
                return (yield s.FileSystemAWNS.existsAW(t)) ? (this.updateImage(e).catch(e => {
                    u.information("update skin preview error", e)
                }), t) : (yield this.updateImage(e), t)
            })
        }

        updateImage(e) {
            return n(this, void 0, void 0, function* () {
                a.default.defaults.adapter = i(21);
                try {
                    let t = yield a.default.get(e.skin_link, {responseType: "arraybuffer"});
                    if (d(t) && 200 === t.status && d(t.data) && (yield s.FileSystemAWNS.mkdirAW(`${__profilesDir}/skins`), yield s.FileSystemAWNS.writeFileAW(`${__profilesDir}/skins/${e.id}.zip`, t.data))) {
                        const {UnzipUtilitiesAWNS: t} = yield Promise.resolve().then(() => i(94));
                        yield t.uncompressZipFile(`${__profilesDir}/skins/${e.id}/`, `${__profilesDir}/skins/${e.id}.zip`)
                    }
                } catch (e) {
                    u.warning(e)
                }
            })
        }

        getShakeRes(e) {
            return n(this, void 0, void 0, function* () {
                let t = `${__profilesDir}/shake-skins/${e.id}/wallpaper.jpg`;
                return (yield s.FileSystemAWNS.existsAW(t)) ? (this.updateShakeRes(e).catch(), t) : (yield this.updateShakeRes(e), t)
            })
        }

        updateShakeRes(e) {
            return n(this, void 0, void 0, function* () {
                a.default.defaults.adapter = i(21);
                try {
                    let t = yield a.default.get(e.skin_link, {responseType: "arraybuffer"});
                    d(t) && 200 === t.status && d(t.data) && (yield s.FileSystemAWNS.mkdirAW(`${__profilesDir}/shake-skins`), yield s.FileSystemAWNS.mkdirAW(`${__profilesDir}/shake-skins/${e.id}`), yield s.FileSystemAWNS.writeFileAW(`${__profilesDir}/shake-skins/${e.id}/wallpaper.jpg`, t.data))
                } catch (e) {
                    u.warning(e)
                }
            })
        }

        getSpringFestivalWallpaper() {
            return n(this, void 0, void 0, function* () {
                let e = null;
                try {
                    let t = null;
                    try {
                        t = JSON.parse(localStorage.getItem("springFestivalSkinData"))
                    } catch (e) {
                        u.warning(e)
                    }
                    t && "on" === t.skinsiwtch && (e = {
                        id: 9999,
                        operator: "",
                        manual_order: 0,
                        name: "春节皮肤",
                        is_vip: !1,
                        is_dynamic: !1,
                        preview: t.skin_thumb,
                        skin_link: t.skin_link,
                        artist: "",
                        color: 11,
                        is_4k: !1,
                        transparency: 80,
                        created_at: 1546599635159,
                        updated_at: 1546654241407,
                        showNew: !1
                    })
                } catch (e) {
                }
                return e
            })
        }
    }
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(18), o = i(0), r = i(14);
    let {isDef: s} = r.ThunderUtil;
    const l = o.default.getLogger("Thunder.speedcurve-skin.skin-storage");
    t.default = new class {
        constructor() {
            this.skinURL = "http://static-xl.a.88cdn.com/json/thunderx_speedcurve_skin.json"
        }

        getSkins() {
            return n(this, void 0, void 0, function* () {
                do {
                    a.default.defaults.adapter = i(21);
                    try {
                        let e = yield a.default.get(this.skinURL);
                        if (200 === e.status && e.data) {
                            this.skins = e.data, l.information("skins", this.skins), localStorage.setItem("speedcurveSkins", JSON.stringify(this.skins));
                            break
                        }
                    } catch (e) {
                        l.warning(e)
                    }
                    if (s(this.skins)) break;
                    try {
                        this.skins = JSON.parse(localStorage.getItem("speedcurveSkins"))
                    } catch (e) {
                        l.warning(e)
                    }
                } while (0);
                return this.skins
            })
        }
    }
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(18), o = i(14), r = i(0), s = i(19), l = i(7), d = i(75),
        u = r.default.getLogger("vip-plugin-switch-config");
    let {isDef: c, isUndef: h} = o.ThunderUtil;
    !function (e) {
        const t = "http://media.info.client.xunlei.com/VipPluginSwitchConfig.json";
        let r = new s.EventEmitter;
        r.setMaxListeners(0);
        let f = void 0, g = void 0, p = void 0;

        function v(e) {
            p = e, r.emit("OnVipRenewButtonEnable", p)
        }

        function m() {
            return n(this, void 0, void 0, function* () {
                if (!f) {
                    let e = yield l.client.callServerFunction("GetThunderVersion"), t = e.lastIndexOf(".");
                    f = e.slice(0, t)
                }
                return f
            })
        }

        (function () {
            return n(this, void 0, void 0, function* () {
                u.information("init");
                let e = yield function () {
                    return n(this, void 0, void 0, function* () {
                        let e = null, n = null;
                        try {
                            a.default.defaults.adapter = i(21), a.default.defaults.timeout = 2e3, n = yield a.default.get(t)
                        } catch (e) {
                            u.warning(e)
                        }
                        return null !== n && 200 === n.status && c(n.data) && (e = n.data), e
                    })
                }();
                u.information("OnGetConfigs", e);
                do {
                    if (h(e) || h(e.VipRenewButtonEnable)) break;
                    let t = e.VipRenewButtonEnable;
                    const i = t.version, n = t.peeridSha256;
                    if (!i || !n) break;
                    let a = yield m();
                    u.information("version", a);
                    let r = !1;
                    for (let e of i) if (2 === e.length && o.ThunderUtil.versionCompare(a, e[0]) >= 0 && o.ThunderUtil.versionCompare(a, e[1]) <= 0) {
                        r = !0;
                        break
                    }
                    const s = yield l.client.callServerFunction("GetPeerID");
                    if (u.information("peerid", s), !r || !s) break;
                    let c = d.createHash("sha256");
                    c.update(s);
                    let f = c.digest("hex"), g = f[f.length - 1];
                    u.information("hex", f, "char", g), g && (g = g.toUpperCase(), n.includes(g) && h(p) && v(1))
                } while (0);
                h(p) && v(0), c(e) && c(e.ToolbarVipButtonEnable) && (g = e.ToolbarVipButtonEnable), h(g) && (g = 0), r.emit("OnToolbarVipButtonEnable", g)
            })
        })().catch(), e.getToolbarVipButtonEnable = function () {
            return n(this, void 0, void 0, function* () {
                let e = null;
                return c(g) ? (e = g, u.information("getToolbarVipButtonEnable", e)) : e = new Promise(e => n(this, void 0, void 0, function* () {
                    r.once("OnToolbarVipButtonEnable", t => {
                        u.information("getToolbarVipButtonEnable", t), e(t)
                    })
                })), e
            })
        }, e.getVipRenewButtonEnable = function () {
            return n(this, void 0, void 0, function* () {
                let e = null;
                return c(p) ? (e = p, u.information("getVipRenewButtonEnable", e)) : e = new Promise(e => n(this, void 0, void 0, function* () {
                    r.once("OnVipRenewButtonEnable", t => {
                        u.information("getVipRenewButtonEnable", t), e(t)
                    })
                })), e
            })
        }
    }(t.VipPluginSwitchConfigNS || (t.VipPluginSwitchConfigNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(98);
    !function (e) {
        class t {
            constructor() {
            }

            static getInstance() {
                return null === t.instance ? new t : t.instance
            }

            getQueue(e) {
                return null === t.queueMap && (t.queueMap = new Map), t.queueMap.has(e) || t.queueMap.set(e, new n.MsgQueueNS.Queue), t.queueMap.get(e)
            }
        }

        t.queueMap = null, t.instance = null, e.MsgQueue = t
    }(t.MsgQueueManagerNS || (t.MsgQueueManagerNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(7), o = i(0), r = i(19), s = o.default.getLogger("SyncMsgHelper");
    !function (e) {
        let t;
        !function (e) {
            e[e.Connecting = 0] = "Connecting", e[e.Connected = 1] = "Connected", e[e.Close = 2] = "Close", e[e.Error = 3] = "Error"
        }(t = e.SyncMsgState || (e.SyncMsgState = {}));
        let i = t.Close, o = null, l = null, d = void 0;

        function u() {
            return n(this, void 0, void 0, function* () {
                let e = yield a.client.isRemoteClientExist("User");
                return s.information("checkSyncMsg", e), e[0]
            })
        }

        function c() {
            return n(this, void 0, void 0, function* () {
                let e = yield a.client.callRemoteClientFunction("User", "SyncIsConnected");
                return s.information("syncIsConnected", e), e[0]
            })
        }

        e.init = function () {
            return n(this, void 0, void 0, function* () {
                if (o = new r.EventEmitter, d = a.client.attachServerEvent("SyncEvent", (e, a) => n(this, void 0, void 0, function* () {
                    let n = null;
                    try {
                        n = JSON.parse(a)
                    } catch (e) {
                        s.warning("attachSyncEvent SyncEvent error", e)
                    }
                    if (s.information("attachSyncEvent SyncEvent", e, n), n) {
                        let e = i;
                        "connect" === n.subject ? e = t.Connected : "reconnect" === n.subject ? e = t.Connecting : "failed" === n.subject && (e = t.Close), e !== i && (i = e, o.emit("SyncMsgStateChange", i, n))
                    }
                })), yield u()) {
                    let e = yield a.client.callServerFunction("GetSyncMsgState");
                    s.information("state", e);
                    let n = i;
                    switch (e) {
                        case t.Connected:
                        case t.Connecting:
                        case t.Close:
                        case t.Error:
                            n = e
                    }
                    n !== i && (i = n, o.emit("SyncMsgStateChange", i, null))
                }
                l = setInterval(() => n(this, void 0, void 0, function* () {
                    let e = yield c(), n = i;
                    e ? n = t.Connected : i !== t.Connecting && (n = t.Close), n !== i && (i = n, o.emit("SyncMsgStateChange", i, null))
                }), 5e3)
            })
        }, e.uninit = function () {
            o.removeAllListeners(), d && (a.client.detachServerEvent("SyncEvent", d), d = void 0), l && (clearInterval(l), l = null)
        }, e.checkSyncMsg = u, e.getSyncMsgState = function () {
            return i
        }, e.syncIsConnected = c, e.attachSyncMsgStateChangeEvent = function (e) {
            return o.addListener("SyncMsgStateChange", e), e
        }, e.detachSyncMsgStateChangeEvent = function (e) {
            o.removeListener("SyncMsgStateChange", e)
        }
    }(t.SyncMsgHelperNS || (t.SyncMsgHelperNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(23), o = i(16);
    !function (e) {
        let t, i;
        !function (e) {
            e[e.None = 0] = "None", e[e.Sock5 = 1] = "Sock5", e[e.Http = 2] = "Http"
        }(t = e.ProxyType || (e.ProxyType = {})), function (e) {
            e[e.Sucess = 0] = "Sucess", e[e.Fall = 1] = "Fall", e[e.AuthFall = 2] = "AuthFall", e[e.ConnectFall = 3] = "ConnectFall", e[e.Timeout = 4] = "Timeout", e[e.ParamError = 5] = "ParamError"
        }(i = e.ProxyVerifyResult || (e.ProxyVerifyResult = {})), e.verifyProxy = function (e, t, r, s, l) {
            return n(this, void 0, void 0, function* () {
                return new Promise(n => {
                    o.NativeCallModule.nativeCall.CallNativeFunction("VerifyProxy", e, t, r, s, l, (e, t) => {
                        e === a.NativeFunctionErrorCode.Success ? n(t) : n(i.Fall)
                    })
                })
            })
        }, e.setProxy = function (e, t, i, r, s) {
            return n(this, void 0, void 0, function* () {
                return new Promise(n => {
                    o.NativeCallModule.nativeCall.CallNativeFunction("SetProxy", e, t, i, r, s, (e, t) => {
                        e === a.NativeFunctionErrorCode.Success ? n(t) : n(1)
                    })
                })
            })
        }
    }(t.ProxyNS || (t.ProxyNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(6), r = i(15), s = i(3), l = i(40), d = i(55), u = i(22), c = i(36), h = i(28), f = i(12),
        g = i(49), p = i(46), v = i(62), m = i(29), y = i(37), k = i(26), T = i(16), w = i(19),
        C = o.default(a.join(__rootDir, "../bin/ThunderHelper.node")),
        S = m.DownloadKernelCategoryManager.getCategoryManager(), b = r.DownloadKernelEventManager.getEventManager(),
        I = l.DownloadKernelCategoryViewManager.getCategoryViewManager(),
        _ = g.ToastNotifyManagerNS.getToastNotifyManger();
    var A, D;
    !function (e) {
        e[e.UnKnown = -1] = "UnKnown", e[e.ShutDown = 0] = "ShutDown", e[e.Sleep = 1] = "Sleep", e[e.Exit = 2] = "Exit", e[e.StartAll = 3] = "StartAll", e[e.StopAll = 4] = "StopAll"
    }(A = t.ScheduleCompleteTaskType || (t.ScheduleCompleteTaskType = {})), function (e) {
        e.Unknow = "Unknow", e.ScheduleTaskCountChange = "ScheduleTaskCountChange"
    }(D = t.ScheduleTaskEventType || (t.ScheduleTaskEventType = {})), function (e) {
        let t = A.UnKnown, i = null, a = -1, o = -1, r = -1, l = [], m = !1, x = !1;
        const N = new w.EventEmitter;

        function E() {
            i = b.attachTaskEvent(s.DownloadKernel.TaskEventType.StatusChanged, K)
        }

        function P() {
            null !== i && (b.detachTaskEvent(s.DownloadKernel.TaskEventType.StatusChanged, i), i = null)
        }

        function M() {
            P(), t = A.UnKnown
        }

        function O(e) {
            let t = 0, i = ["关机", "睡眠", "退出迅雷", "开始全部任务", "暂停全部任务"];
            for (let n = i.length - 1; n >= 0; --n) if (i[n] === e) {
                t = n;
                break
            }
            return t
        }

        function F() {
            let e = 300;
            r = setInterval(() => {
                (function () {
                    let e = !1, t = I.getCategoryViewFromId(s.DownloadKernel.CategroyViewID.Downloading).getTasks();
                    for (let [, i]of t) {
                        let t = i.getTaskStatus();
                        do {
                            if (t === s.DownloadKernel.TaskStatus.Started || t === s.DownloadKernel.TaskStatus.StartPending || t === s.DownloadKernel.TaskStatus.StartWaiting) {
                                e = !0;
                                break
                            }
                        } while (0)
                    }
                    return e
                })() || function () {
                    let e = !1, t = S.getCurrentPrivateCategory();
                    t && (e = c.TaskOperatorNs.hasCategoryStartTask(t.getId()));
                    return e
                }() ? e = 0 : e >= 300 ? (k.NativeCallHostModule.nativeCallHost.fireNativeEvent("getCurrentTabUrl", "callbackGetCurrentTabUrl"), T.NativeCallModule.nativeCall.AttachNativeEvent("callbackGetCurrentTabUrl", t => {
                    t ? e = 0 : (m = !0, c.TaskOperatorNs.startAllPausedTask(), clearInterval(r), r = -1)
                })) : e++
            }, 1e3)
        }

        function L(e) {
            return e && (e = !1, c.TaskOperatorNs.pauseAll(s.DownloadKernel.TaskStopReason.FreeDownload), -1 !== r && (clearInterval(r), r = -1), function () {
                let e = S.getCurrentPrivateCategory();
                e && c.TaskOperatorNs.pauseCategoryAllTask(e.getId(), s.DownloadKernel.TaskStopReason.FreeDownload)
            }()), e
        }

        function B(e) {
            let t = !1;
            for (let i = 0; i < e.length; ++i) {
                let n = e[i];
                if (!n) continue;
                let a = n.getTaskStatus();
                if (a !== s.DownloadKernel.TaskStatus.Succeeded && a !== s.DownloadKernel.TaskStatus.Seeding && a !== s.DownloadKernel.TaskStatus.Failed) continue;
                let o = n.getTaskBaseInfo(), r = n.getTaskPreStatus();
                if (o.taskType !== s.DownloadKernel.TaskType.Bt || a !== s.DownloadKernel.TaskStatus.Succeeded && a !== s.DownloadKernel.TaskStatus.Seeding || r !== s.DownloadKernel.TaskStatus.Succeeded && r !== s.DownloadKernel.TaskStatus.Seeding) {
                    t = !0;
                    break
                }
            }
            return t
        }

        function U() {
            let e = !1;
            do {
                let t = I.getCategoryViewFromId(s.DownloadKernel.CategroyViewID.Downloading).getTasks(), i = !1;
                for (let [, e]of t) if (null !== e) {
                    let t = e.getTaskStatus();
                    if (t === s.DownloadKernel.TaskStatus.PreDownloading || t === s.DownloadKernel.TaskStatus.StartWaiting || t === s.DownloadKernel.TaskStatus.StartPending || t === s.DownloadKernel.TaskStatus.Started) {
                        i = !0;
                        break
                    }
                }
                if (i) break;
                e = !0
            } while (0);
            return e
        }

        function R(e) {
            return n(this, void 0, void 0, function* () {
                e === A.ShutDown ? C.shutDownMachine() : e === A.Sleep ? C.suspendMachine() : e === A.Exit ? yield d.quitPromises.run() : e === A.StartAll ? c.TaskOperatorNs.startAll() : e === A.StopAll && c.TaskOperatorNs.pauseAll(s.DownloadKernel.TaskStopReason.PauseAll)
            })
        }

        function K(...e) {
            do {
                if (!e) break;
                if (e[0] !== s.DownloadKernel.TaskEventType.StatusChanged) break;
                if (!e[1]) break;
                if (!B(e[1])) break;
                if (!U()) break;
                setTimeout(() => {
                    R(t).catch(), M()
                }, 1e4)
            } while (0)
        }

        e.getEventEmitter = function () {
            return N
        }, e.setDownloadCompleteTaskType = function (e) {
            do {
                if (e !== A.ShutDown && e !== A.Sleep && e !== A.Exit) break;
                if (t === e) break;
                M(), t = e, E();
                let i = "";
                switch (e) {
                    case A.ShutDown:
                        i = "已开启下载完成后关机";
                        break;
                    case A.Sleep:
                        i = "已开启下载完成后睡眠";
                        break;
                    case A.Exit:
                        i = "已开启下载完成后退出迅雷"
                }
                let n = _.showNotify(g.ToastNotifyManagerNS.notifyIdScheduleTaskComplete, p.ToastNotifyItemType.RedCancelNotify, i, 5e3);
                n && n.onCancel(() => {
                    M()
                })
            } while (0)
        }, e.getDownloadCompleteTaskType = function () {
            return t
        }, e.startDownloadCompleteMonitor = E, e.stopDownloadCompleteMonitor = P, e.cancelDownloadCompleteTask = M, e.showPlanTaskDlg = function () {
            u.MessageBox.custom("PlanTask", l, {width: 400, height: 132, center: !0}).catch()
        }, e.init = function () {
            return n(this, void 0, void 0, function* () {
                let e = yield f.asyncRemoteCall.getIpcMain();
                e.on(h.ThunderChannelList.channelRMCommitPlanTask, (e, t) => n(this, void 0, void 0, function* () {
                    l = t, -1 !== a && (clearInterval(a), a = -1), N.emit(D.ScheduleTaskCountChange, l.length), a = setInterval(() => {
                        for (let e = l.length - 1; e >= 0; --e) {
                            let t = l[e],
                                i = v.TimeHelperNS.convertTimeToMinutes(Number(t.hours), Number(t.minutes), Number(t.seconds));
                            if ((i -= 1) <= 0) {
                                R(O(t.operation)).catch(), l.splice(e, 1), N.emit(D.ScheduleTaskCountChange, l.length);
                                continue
                            }
                            let n = v.TimeHelperNS.convertMinuteToTime(i);
                            t.hours = n[0] + "", t.minutes = n[1] + "", t.seconds = n[2] + ""
                        }
                        l.length <= 0 && -1 !== a && (clearInterval(a), a = -1)
                    }, 1e3)
                })), e.on(h.ThunderChannelList.channelRMPerformePlanTask, (e, t) => n(this, void 0, void 0, function* () {
                    R(O(t)).catch()
                }))
            })
        }, e.getOperationIndex = O, e.getScheduleTaskCount = function () {
            return l.length
        }, e.popMessageBox = function (e) {
            x ? e() : u.MessageBox.confirm({
                title: "空闲下载",
                type: u.MessageBox.ConfirmType.Info,
                content: "当您长时间没有操作电脑时，迅雷会自动下载之前被暂停的任务",
                okText: "开启",
                cancelVisible: !1
            }, {width: 400, height: 177, center: !0}).then(t => {
                t.action === y.MessageBoxNS.Action.OK && (x = !0, e())
            }).catch()
        }, e.startFreeDownLoad = function () {
            let e = !1, t = 0;
            o = setInterval(() => {
                t = C.getFreeTime(), e ? t < 300 && (e = !1, m = L(m)) : t >= 300 && (e = !0, F())
            }, 2e3)
        }, e.closeFreeDownLoad = function () {
            -1 !== o && (clearInterval(o), o = -1), m = L(m)
        }, e.excuteTask = R
    }(t.ScheduleTaskNS || (t.ScheduleTaskNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(0), r = i(22), s = i(37), l = i(6), d = i(10), u = i(5), c = i(9), h = i(3), f = i(40),
        g = i(12), p = f.DownloadKernelCategoryViewManager.getCategoryViewManager(),
        v = l.default(a.join(__rootDir, "../bin/ThunderHelper.node")), m = o.default.getLogger("quit-create-shortcut");
    !function (e) {
        class t {
            static isAlreadyCancel() {
                return d.ConfigNS.getValue("CreateDesktopIcon", "Cancel", !1)
            }

            static popup() {
            }
        }

        class i {
            static realPop() {
                return n(this, void 0, void 0, function* () {
                    return new Promise(e => {
                        c.XLStatNS.trackEvent("core_event", "exit_popup_show"), r.MessageBox.confirm({
                            title: "当前有正在下载的任务，确定退出吗？",
                            type: r.MessageBox.ConfirmType.Warning,
                            fileName: "",
                            okText: "确定",
                            cancelText: "取消",
                            cancelVisible: !0
                        }).then(t => n(this, void 0, void 0, function* () {
                            t.action === s.MessageBoxNS.Action.OK && c.XLStatNS.trackEvent("core_event", "exit_popup_click", "", 0, 0, 0, 0, "button=ok"), e(t.action)
                        })).catch(() => {
                            e(s.MessageBoxNS.Action.Cancel)
                        })
                    })
                })
            }

            static popup() {
                return n(this, void 0, void 0, function* () {
                    let e = !0;
                    {
                        let t = p.getCategoryViewFromId(h.DownloadKernel.CategroyViewID.Downloading);
                        if (t) {
                            let i = t.getTasks();
                            for (let [, t]of i) if (t.getTaskStatus() === h.DownloadKernel.TaskStatus.Started) {
                                e = !1;
                                break
                            }
                        }
                        e || (e = (yield this.realPop()) === s.MessageBoxNS.Action.OK)
                    }
                    return e
                })
            }
        }

        e.popupCreateShortcutMessageBox = function () {
            return n(this, void 0, void 0, function* () {
                do {
                    if (yield t.popup()) break
                } while (0);
                return !0
            })
        }, e.popup = function () {
            return n(this, void 0, void 0, function* () {
                let e = !0;
                do {
                    if (yield t.popup()) break;
                    if (!(yield i.popup())) {
                        e = !1;
                        break
                    }
                } while (0);
                return e
            })
        }
    }(t.QuitMessageBoxMgrNS || (t.QuitMessageBoxMgrNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(5), r = i(58), s = i(39), l = i(63), d = i(10), u = i(0), c = i(100), h = i(9),
        f = u.default.getLogger("AdLeftBottomHelper");
    t.adLeftBottomHelper = new class extends s.default {
        constructor() {
            super(...arguments), this.positionId = 1749, this.curAllOrders = [], this.adDataPicDir = void 0
        }

        fetchOrderAw() {
            return n(this, void 0, void 0, function* () {
                let e = !1;
                do {
                    this.adDataPicDir = a.resolve(__profilesDir, "AdData/AdLeftBottom"), e = yield o.FileSystemAWNS.mkdirsAW(this.adDataPicDir);
                    let t = yield this.getshownOrderIdAw(), i = yield l.AdHelperNS.getAdDataAw(this.positionId, t, !0);
                    if (!(null !== i && void 0 !== i && null !== i.data && void 0 !== i.data && i.data.length > 0)) {
                        e = !1, f.information("获取数据失败", i);
                        break
                    }
                    if (this.curAllOrders = yield this.parseOrders(i.data), null === this.curAllOrders || void 0 === this.curAllOrders || this.curAllOrders.length <= 0) {
                        f.information("解析数据失败");
                        break
                    }
                    this.fireEvent(c.AdCommonNS.eventAdShow, c.AdCommonNS.AdName.AdLeftBottomVip, this.curAllOrders[0])
                } while (0);
                return e
            })
        }

        handleEvent(e) {
            f.information(e), "ad_show" === e ? (l.AdHelperNS.statServer(this.positionId, this.curAllOrders[0].orderId, 1).catch(), this.stat("ad_show")) : "content" === e ? (l.AdHelperNS.statServer(this.positionId, this.curAllOrders[0].orderId, 2).catch(), this.stat("ad_click", "clickid=body")) : "close" === e ? this.stat("ad_closed") : "nodisturb" === e && this.stat("ad_nodisplay_click")
        }

        setNoDisturb() {
            return n(this, void 0, void 0, function* () {
                yield l.AdHelperNS.onConfigInitAw(), d.ConfigNS.setValue("AdLeftBottom", "NoDisturb", !0)
            })
        }

        isNoDisturb() {
            return n(this, void 0, void 0, function* () {
                return yield l.AdHelperNS.onConfigInitAw(), d.ConfigNS.getValue("AdLeftBottom", "NoDisturb", !1)
            })
        }

        getshownOrderIdAw() {
            return n(this, void 0, void 0, function* () {
                let e = "";
                return yield l.AdHelperNS.onConfigInitAw(), d.ConfigNS.getValue("AdLeftBottom", "TheDate", "") === l.AdHelperNS.getCurDate() && "" !== (e = d.ConfigNS.getValue("AdLeftBottom", "shownOrders", "")) && "," === e.slice(e.length - 1) && (e = e.slice(0, e.length - 1)), e
            })
        }

        parseOrders(e) {
            return n(this, void 0, void 0, function* () {
                let t = [];
                f.information("parseOrders: adData = ", e);
                for (let i = 0; i < e.length; ++i) {
                    let n = {}, o = e[i];
                    n.orderId = o.orderId, f.information("parseOrders: curOrderId = ", o.orderId);
                    let r = o.materials;
                    if (null === r || void 0 === r || r.length <= 0) {
                        f.information("parseOrders:materials 有问题");
                        continue
                    }
                    let s = r[0];
                    if (n.materialId = s.material_id, null === s.open_type || void 0 === s.open_type) {
                        f.information("parseOrders:material.open_type 有问题");
                        continue
                    }
                    n.openType = s.open_type, n.targetUrl = s.open_url;
                    let l = s.data;
                    if (null === l || void 0 === l || l.length <= 0) {
                        f.information("parseOrders:material.data 有问题");
                        continue
                    }
                    let d = 0, u = "";
                    for (let e = 0; e < l.length; ++e) {
                        let t = l[e];
                        if (10204 === t.asset && (n.iconUrl = t.value, n.iconUrl && "" !== n.iconUrl)) {
                            if (u = a.join(this.adDataPicDir, a.basename(n.iconUrl)), !(yield this.downloadResourcesAW(n.iconUrl, u))) break;
                            ++d, n.picFile = u
                        }
                    }
                    d < 1 ? f.information("素材数据不完整：ncount = ", d, ";materialId = ", s.material_id) : t.push(n)
                }
                return t
            })
        }

        downloadResourcesAW(e, t) {
            return n(this, void 0, void 0, function* () {
                let i = !1;
                return i = yield r.AxiosNS.downloadFileAW(e, t), f.information("下载图片：result = ", i, ";savePath = ", t), i
            })
        }

        stat(e, t) {
            let i = `${this.positionId}`,
                n = `orderid=${this.curAllOrders[0].orderId},materialid=${this.curAllOrders[0].materialId}`;
            null !== t && void 0 !== t && "" !== t && (n = `${n},${t}`), f.information(e, n), n = encodeURIComponent(n), h.XLStatNS.trackEvent("xlx_ad_event", e, i, 0, 0, 0, 0, n)
        }
    }
}, function (e, t, i) {
    "use strict";
    var n = i(102);

    function a() {
        this._state = 0, this._response = {
            host: "unknown",
            alive: !1,
            output: "unknown",
            time: "unknown",
            min: "unknown",
            max: "unknown",
            avg: "unknown",
            stddev: "unknown"
        }, this._times = [], this._lines = [], this._stripRegex = /[ ]*\r?\n?$/g
    }

    a.prototype.STATES = {INIT: 0, HEADER: 1, BODY: 2, FOOTER: 3, END: 4}, a.prototype._changeState = function (e) {
        if (n.values(this.STATES).indexOf(e) < 0) throw new Error("Unknown state");
        return this._state = e, this
    }, a.prototype._processHeader = function (e) {
        throw new Error("Subclass should implement this method")
    }, a.prototype._processBody = function (e) {
        throw new Error("Subclass should implement this method")
    }, a.prototype._processFooter = function (e) {
        throw new Error("Subclass should implement this method")
    }, a.prototype.eat = function (e) {
        var t = [this.STATES.INIT, this.STATES.HEADER];
        this._lines.push(e);
        var i = e.replace(this._stripRegex, "");
        if (0 === i.length) ; else if (t.indexOf(this._state) >= 0) this._processHeader(i); else if (this._state === this.STATES.BODY) this._processBody(i); else if (this._state === this.STATES.FOOTER) this._processFooter(i); else if (this._state !== this.STATES.END) throw new Error("Unknown state");
        return this
    }, a.prototype.getResult = function () {
        var e = n.extend({}, this._response);
        if (e.output = this._lines.join("\n"), e.alive = this._times.length > 0, e.alive && (e.time = this._response.time = this._times[0]), "unknown" === e.stddev && e.alive) {
            var t = this._times.length, i = n.reduce(this._times, function (t, i) {
                return t + Math.pow(i - e.avg, 2)
            }, 0) / t;
            e.stddev = Math.round(1e3 * Math.sqrt(i)) / 1e3
        }
        return n.each(["min", "avg", "max", "stddev"], function (t) {
            var i = e[t];
            n.isNumber(i) && (e[t] = i.toFixed(3))
        }), e
    }, e.exports = a
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(74), a = i.n(n), o = i(52), r = i.n(o), s = /%[sdj%]/g, l = function () {
    };

    function d() {
        for (var e = arguments.length, t = Array(e), i = 0; i < e; i++) t[i] = arguments[i];
        var n = 1, a = t[0], o = t.length;
        if ("function" == typeof a) return a.apply(null, t.slice(1));
        if ("string" == typeof a) {
            for (var r = String(a).replace(s, function (e) {
                if ("%%" === e) return "%";
                if (n >= o) return e;
                switch (e) {
                    case"%s":
                        return String(t[n++]);
                    case"%d":
                        return Number(t[n++]);
                    case"%j":
                        try {
                            return JSON.stringify(t[n++])
                        } catch (e) {
                            return "[Circular]"
                        }
                        break;
                    default:
                        return e
                }
            }), l = t[n]; n < o; l = t[++n]) r += " " + l;
            return r
        }
        return a
    }

    function u(e, t) {
        return void 0 === e || null === e || (!("array" !== t || !Array.isArray(e) || e.length) || !(!function (e) {
            return "string" === e || "url" === e || "hex" === e || "email" === e || "pattern" === e
        }(t) || "string" != typeof e || e))
    }

    function c(e, t, i) {
        var n = 0, a = e.length;
        !function o(r) {
            if (r && r.length) i(r); else {
                var s = n;
                n += 1, s < a ? t(e[s], o) : i([])
            }
        }([])
    }

    function h(e, t, i, n) {
        if (t.first) return c(function (e) {
            var t = [];
            return Object.keys(e).forEach(function (i) {
                t.push.apply(t, e[i])
            }), t
        }(e), i, n);
        var a = t.firstFields || [];
        !0 === a && (a = Object.keys(e));
        var o = Object.keys(e), r = o.length, s = 0, l = [], d = function (e) {
            l.push.apply(l, e), ++s === r && n(l)
        };
        o.forEach(function (t) {
            var n = e[t];
            -1 !== a.indexOf(t) ? c(n, i, d) : function (e, t, i) {
                var n = [], a = 0, o = e.length;

                function r(e) {
                    n.push.apply(n, e), ++a === o && i(n)
                }

                e.forEach(function (e) {
                    t(e, r)
                })
            }(n, i, d)
        })
    }

    function f(e) {
        return function (t) {
            return t && t.message ? (t.field = t.field || e.fullField, t) : {message: t, field: t.field || e.fullField}
        }
    }

    function g(e, t) {
        if (t) for (var i in t) if (t.hasOwnProperty(i)) {
            var n = t[i];
            "object" === (void 0 === n ? "undefined" : r()(n)) && "object" === r()(e[i]) ? e[i] = a()({}, e[i], n) : e[i] = n
        }
        return e
    }

    var p = function (e, t, i, n, a, o) {
        !e.required || i.hasOwnProperty(e.field) && !u(t, o || e.type) || n.push(d(a.messages.required, e.fullField))
    };
    var v = function (e, t, i, n, a) {
        (/^\s+$/.test(t) || "" === t) && n.push(d(a.messages.whitespace, e.fullField))
    }, m = {
        email: /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
        url: new RegExp("^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$", "i"),
        hex: /^#?([a-f0-9]{6}|[a-f0-9]{3})$/i
    }, y = {
        integer: function (e) {
            return y.number(e) && parseInt(e, 10) === e
        }, float: function (e) {
            return y.number(e) && !y.integer(e)
        }, array: function (e) {
            return Array.isArray(e)
        }, regexp: function (e) {
            if (e instanceof RegExp) return !0;
            try {
                return !!new RegExp(e)
            } catch (e) {
                return !1
            }
        }, date: function (e) {
            return "function" == typeof e.getTime && "function" == typeof e.getMonth && "function" == typeof e.getYear
        }, number: function (e) {
            return !isNaN(e) && "number" == typeof e
        }, object: function (e) {
            return "object" === (void 0 === e ? "undefined" : r()(e)) && !y.array(e)
        }, method: function (e) {
            return "function" == typeof e
        }, email: function (e) {
            return "string" == typeof e && !!e.match(m.email) && e.length < 255
        }, url: function (e) {
            return "string" == typeof e && !!e.match(m.url)
        }, hex: function (e) {
            return "string" == typeof e && !!e.match(m.hex)
        }
    };
    var k = "enum";
    var T = {
        required: p, whitespace: v, type: function (e, t, i, n, a) {
            if (e.required && void 0 === t) p(e, t, i, n, a); else {
                var o = e.type;
                ["integer", "float", "array", "regexp", "object", "method", "email", "number", "date", "url", "hex"].indexOf(o) > -1 ? y[o](t) || n.push(d(a.messages.types[o], e.fullField, e.type)) : o && (void 0 === t ? "undefined" : r()(t)) !== e.type && n.push(d(a.messages.types[o], e.fullField, e.type))
            }
        }, range: function (e, t, i, n, a) {
            var o = "number" == typeof e.len, r = "number" == typeof e.min, s = "number" == typeof e.max, l = t,
                u = null, c = "number" == typeof t, h = "string" == typeof t, f = Array.isArray(t);
            if (c ? u = "number" : h ? u = "string" : f && (u = "array"), !u) return !1;
            f && (l = t.length), h && (l = t.replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g, "_").length), o ? l !== e.len && n.push(d(a.messages[u].len, e.fullField, e.len)) : r && !s && l < e.min ? n.push(d(a.messages[u].min, e.fullField, e.min)) : s && !r && l > e.max ? n.push(d(a.messages[u].max, e.fullField, e.max)) : r && s && (l < e.min || l > e.max) && n.push(d(a.messages[u].range, e.fullField, e.min, e.max))
        }, enum: function (e, t, i, n, a) {
            e[k] = Array.isArray(e[k]) ? e[k] : [], -1 === e[k].indexOf(t) && n.push(d(a.messages[k], e.fullField, e[k].join(", ")))
        }, pattern: function (e, t, i, n, a) {
            e.pattern && (e.pattern instanceof RegExp ? (e.pattern.lastIndex = 0, e.pattern.test(t) || n.push(d(a.messages.pattern.mismatch, e.fullField, t, e.pattern))) : "string" == typeof e.pattern && (new RegExp(e.pattern).test(t) || n.push(d(a.messages.pattern.mismatch, e.fullField, t, e.pattern))))
        }
    };
    var w = "enum";
    var C = function (e, t, i, n, a) {
        var o = e.type, r = [];
        if (e.required || !e.required && n.hasOwnProperty(e.field)) {
            if (u(t, o) && !e.required) return i();
            T.required(e, t, n, r, a, o), u(t, o) || T.type(e, t, n, r, a)
        }
        i(r)
    }, S = {
        string: function (e, t, i, n, a) {
            var o = [];
            if (e.required || !e.required && n.hasOwnProperty(e.field)) {
                if (u(t, "string") && !e.required) return i();
                T.required(e, t, n, o, a, "string"), u(t, "string") || (T.type(e, t, n, o, a), T.range(e, t, n, o, a), T.pattern(e, t, n, o, a), !0 === e.whitespace && T.whitespace(e, t, n, o, a))
            }
            i(o)
        }, method: function (e, t, i, n, a) {
            var o = [];
            if (e.required || !e.required && n.hasOwnProperty(e.field)) {
                if (u(t) && !e.required) return i();
                T.required(e, t, n, o, a), void 0 !== t && T.type(e, t, n, o, a)
            }
            i(o)
        }, number: function (e, t, i, n, a) {
            var o = [];
            if (e.required || !e.required && n.hasOwnProperty(e.field)) {
                if (u(t) && !e.required) return i();
                T.required(e, t, n, o, a), void 0 !== t && (T.type(e, t, n, o, a), T.range(e, t, n, o, a))
            }
            i(o)
        }, boolean: function (e, t, i, n, a) {
            var o = [];
            if (e.required || !e.required && n.hasOwnProperty(e.field)) {
                if (u(t) && !e.required) return i();
                T.required(e, t, n, o, a), void 0 !== t && T.type(e, t, n, o, a)
            }
            i(o)
        }, regexp: function (e, t, i, n, a) {
            var o = [];
            if (e.required || !e.required && n.hasOwnProperty(e.field)) {
                if (u(t) && !e.required) return i();
                T.required(e, t, n, o, a), u(t) || T.type(e, t, n, o, a)
            }
            i(o)
        }, integer: function (e, t, i, n, a) {
            var o = [];
            if (e.required || !e.required && n.hasOwnProperty(e.field)) {
                if (u(t) && !e.required) return i();
                T.required(e, t, n, o, a), void 0 !== t && (T.type(e, t, n, o, a), T.range(e, t, n, o, a))
            }
            i(o)
        }, float: function (e, t, i, n, a) {
            var o = [];
            if (e.required || !e.required && n.hasOwnProperty(e.field)) {
                if (u(t) && !e.required) return i();
                T.required(e, t, n, o, a), void 0 !== t && (T.type(e, t, n, o, a), T.range(e, t, n, o, a))
            }
            i(o)
        }, array: function (e, t, i, n, a) {
            var o = [];
            if (e.required || !e.required && n.hasOwnProperty(e.field)) {
                if (u(t, "array") && !e.required) return i();
                T.required(e, t, n, o, a, "array"), u(t, "array") || (T.type(e, t, n, o, a), T.range(e, t, n, o, a))
            }
            i(o)
        }, object: function (e, t, i, n, a) {
            var o = [];
            if (e.required || !e.required && n.hasOwnProperty(e.field)) {
                if (u(t) && !e.required) return i();
                T.required(e, t, n, o, a), void 0 !== t && T.type(e, t, n, o, a)
            }
            i(o)
        }, enum: function (e, t, i, n, a) {
            var o = [];
            if (e.required || !e.required && n.hasOwnProperty(e.field)) {
                if (u(t) && !e.required) return i();
                T.required(e, t, n, o, a), t && T[w](e, t, n, o, a)
            }
            i(o)
        }, pattern: function (e, t, i, n, a) {
            var o = [];
            if (e.required || !e.required && n.hasOwnProperty(e.field)) {
                if (u(t, "string") && !e.required) return i();
                T.required(e, t, n, o, a), u(t, "string") || T.pattern(e, t, n, o, a)
            }
            i(o)
        }, date: function (e, t, i, n, a) {
            var o = [];
            if (e.required || !e.required && n.hasOwnProperty(e.field)) {
                if (u(t) && !e.required) return i();
                if (T.required(e, t, n, o, a), !u(t)) {
                    var r = void 0;
                    r = "number" == typeof t ? new Date(t) : t, T.type(e, r, n, o, a), r && T.range(e, r.getTime(), n, o, a)
                }
            }
            i(o)
        }, url: C, hex: C, email: C, required: function (e, t, i, n, a) {
            var o = [], s = Array.isArray(t) ? "array" : void 0 === t ? "undefined" : r()(t);
            T.required(e, t, n, o, a, s), i(o)
        }
    };

    function b() {
        return {
            default: "Validation error on field %s",
            required: "%s is required",
            enum: "%s must be one of %s",
            whitespace: "%s cannot be empty",
            date: {
                format: "%s date %s is invalid for format %s",
                parse: "%s date could not be parsed, %s is invalid ",
                invalid: "%s date %s is invalid"
            },
            types: {
                string: "%s is not a %s",
                method: "%s is not a %s (function)",
                array: "%s is not an %s",
                object: "%s is not an %s",
                number: "%s is not a %s",
                date: "%s is not a %s",
                boolean: "%s is not a %s",
                integer: "%s is not an %s",
                float: "%s is not a %s",
                regexp: "%s is not a valid %s",
                email: "%s is not a valid %s",
                url: "%s is not a valid %s",
                hex: "%s is not a valid %s"
            },
            string: {
                len: "%s must be exactly %s characters",
                min: "%s must be at least %s characters",
                max: "%s cannot be longer than %s characters",
                range: "%s must be between %s and %s characters"
            },
            number: {
                len: "%s must equal %s",
                min: "%s cannot be less than %s",
                max: "%s cannot be greater than %s",
                range: "%s must be between %s and %s"
            },
            array: {
                len: "%s must be exactly %s in length",
                min: "%s cannot be less than %s in length",
                max: "%s cannot be greater than %s in length",
                range: "%s must be between %s and %s in length"
            },
            pattern: {mismatch: "%s value %s does not match pattern %s"},
            clone: function () {
                var e = JSON.parse(JSON.stringify(this));
                return e.clone = this.clone, e
            }
        }
    }

    var I = b();

    function _(e) {
        this.rules = null, this._messages = I, this.define(e)
    }

    _.prototype = {
        messages: function (e) {
            return e && (this._messages = g(b(), e)), this._messages
        }, define: function (e) {
            if (!e) throw new Error("Cannot configure a schema with no rules");
            if ("object" !== (void 0 === e ? "undefined" : r()(e)) || Array.isArray(e)) throw new Error("Rules must be an object");
            this.rules = {};
            var t = void 0, i = void 0;
            for (t in e) e.hasOwnProperty(t) && (i = e[t], this.rules[t] = Array.isArray(i) ? i : [i])
        }, validate: function (e) {
            var t = this, i = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, n = arguments[2],
                o = e, s = i, u = n;
            if ("function" == typeof s && (u = s, s = {}), this.rules && 0 !== Object.keys(this.rules).length) {
                if (s.messages) {
                    var c = this.messages();
                    c === I && (c = b()), g(c, s.messages), s.messages = c
                } else s.messages = this.messages();
                var p = void 0, v = void 0, m = {};
                (s.keys || Object.keys(this.rules)).forEach(function (i) {
                    p = t.rules[i], v = o[i], p.forEach(function (n) {
                        var r = n;
                        "function" == typeof r.transform && (o === e && (o = a()({}, o)), v = o[i] = r.transform(v)), (r = "function" == typeof r ? {validator: r} : a()({}, r)).validator = t.getValidationMethod(r), r.field = i, r.fullField = r.fullField || i, r.type = t.getType(r), r.validator && (m[i] = m[i] || [], m[i].push({
                            rule: r,
                            value: v,
                            source: o,
                            field: i
                        }))
                    })
                });
                var y = {};
                h(m, s, function (e, t) {
                    var i = e.rule,
                        n = !("object" !== i.type && "array" !== i.type || "object" !== r()(i.fields) && "object" !== r()(i.defaultField));

                    function o(e, t) {
                        return a()({}, t, {fullField: i.fullField + "." + e})
                    }

                    function u() {
                        var r = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [];
                        if (Array.isArray(r) || (r = [r]), r.length && l("async-validator:", r), r.length && i.message && (r = [].concat(i.message)), r = r.map(f(i)), s.first && r.length) return y[i.field] = 1, t(r);
                        if (n) {
                            if (i.required && !e.value) return r = i.message ? [].concat(i.message).map(f(i)) : s.error ? [s.error(i, d(s.messages.required, i.field))] : [], t(r);
                            var u = {};
                            if (i.defaultField) for (var c in e.value) e.value.hasOwnProperty(c) && (u[c] = i.defaultField);
                            for (var h in u = a()({}, u, e.rule.fields)) if (u.hasOwnProperty(h)) {
                                var g = Array.isArray(u[h]) ? u[h] : [u[h]];
                                u[h] = g.map(o.bind(null, h))
                            }
                            var p = new _(u);
                            p.messages(s.messages), e.rule.options && (e.rule.options.messages = s.messages, e.rule.options.error = s.error), p.validate(e.value, e.rule.options || s, function (e) {
                                t(e && e.length ? r.concat(e) : e)
                            })
                        } else t(r)
                    }

                    n = n && (i.required || !i.required && e.value), i.field = e.field;
                    var c = i.validator(i, e.value, u, e.source, s);
                    c && c.then && c.then(function () {
                        return u()
                    }, function (e) {
                        return u(e)
                    })
                }, function (e) {
                    !function (e) {
                        var t, i = void 0, n = void 0, a = [], o = {};
                        for (i = 0; i < e.length; i++) t = e[i], Array.isArray(t) ? a = a.concat.apply(a, t) : a.push(t);
                        if (a.length) for (i = 0; i < a.length; i++) o[n = a[i].field] = o[n] || [], o[n].push(a[i]); else a = null, o = null;
                        u(a, o)
                    }(e)
                })
            } else u && u()
        }, getType: function (e) {
            if (void 0 === e.type && e.pattern instanceof RegExp && (e.type = "pattern"), "function" != typeof e.validator && e.type && !S.hasOwnProperty(e.type)) throw new Error(d("Unknown rule type %s", e.type));
            return e.type || "string"
        }, getValidationMethod: function (e) {
            if ("function" == typeof e.validator) return e.validator;
            var t = Object.keys(e), i = t.indexOf("message");
            return -1 !== i && t.splice(i, 1), 1 === t.length && "required" === t[0] ? S.required : S[this.getType(e)] || !1
        }
    }, _.register = function (e, t) {
        if ("function" != typeof t) throw new Error("Cannot register a validator by type, validator is not a function");
        S[e] = t
    }, _.messages = I;
    t.default = _
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("div", {
            staticClass: "xly-client", attrs: {id: "app"}, on: {
                dragstart: function (e) {
                    e.preventDefault()
                }
            }
        }, [t("main-left"), this._v(" "), t("main-body")], 1)
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {
            staticClass: "xly-aside",
            class: {dragable: e.dragable}
        }, [i("login-area", {staticClass: "none-dragable"}), e._v(" "), i("div", {staticClass: "xly-aside-nav none-dragable"}, [i("ul", e._l(e.navList, function (t) {
            return i("li", {
                key: t.key,
                staticClass: "xly-aside-nav__item",
                class: e.curNav === t.key ? "is-active" : "",
                on: {
                    click: function (i) {
                        e.select(t.key)
                    }
                }
            }, [i("i", {class: t.icon}), e._v(" "), i("span", [e._v(e._s(t.content))])])
        }))]), e._v(" "), i("system-buttons", {staticClass: "none-dragable"})], 1)
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {staticClass: "xly-client__main"}, [i("main-top", {
            attrs: {
                curNav: e.curNav,
                isLogined: e.isLogined,
                settingTab: e.settingTab
            }, on: {close: e.closeSettingCenter}
        }), e._v(" "), i("div", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: !e.settingTab,
                expression: "!settingTab"
            }], staticClass: "xly-client__content"
        }, [i("download-panel", {
            staticClass: "xly-client__page xly-down",
            class: {"is-show": !e.findPageStyle && !e.panStyle}
        }), e._v(" "), i("pan-plugin-view", {
            staticClass: "xly-client__page xly-pan",
            class: {"is-show": e.panStyle}
        }), e._v(" "), i("find-page", {
            staticClass: "xly-client__page xly-findpage",
            class: {"is-show": e.findPageStyle}
        })], 1), e._v(" "), e.settingTab ? i("setting-view-container") : e._e()], 1)
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {staticClass: "xly-aside-personal"}, [i("td-avatar", {
            ref: "userAvatar",
            attrs: {src: e.curLoginHeaderUrl, alt: "头像"},
            nativeOn: {
                mouseenter: function (t) {
                    e.enter("head")
                }, click: function (t) {
                    e.clickUserHeader("head")
                }
            }
        }, [e.isLogin ? e._e() : i("i", {staticClass: "xly-icon-logo"})]), e._v(" "), i("p", {
            ref: "userNick",
            staticClass: "xly-aside-personal__user",
            class: e.strNickCss,
            on: {
                click: function (t) {
                    e.clickUserHeader("name")
                }
            }
        }, [e._v(e._s(e.userNick))]), e._v(" "), i("div", {staticClass: "xly-aside-personal__icon"}, [e.vipData ? i("vip-icon", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.isLogin,
                expression: "isLogin"
            }],
            ref: "userVip",
            staticStyle: {cursor: "pointer"},
            attrs: {vipData: e.vipData, size: "normal", disabled: 0 === e.isVip},
            nativeOn: {
                click: function (t) {
                    e.onClick("vip")
                }, mouseenter: function (t) {
                    e.enter("vip")
                }
            }
        }) : e._e(), e._v(" "), i("a", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.isLogin && !e.isCanShowOpenVipBtn && !e.overflow,
                expression: "isLogin && !isCanShowOpenVipBtn && !overflow"
            }],
            class: e.userYearIcon,
            attrs: {href: "javascript:;", visible: e.isShowYearTip, title: this.yearTipsText},
            on: {
                click: function (t) {
                    e.onClick("nian_tip")
                }
            }
        })], 1), e._v(" "), e.isLogin && 0 !== e.isVip ? i("td-button", {
            on: {
                click: function (t) {
                    e.onClick("vip-center")
                }
            }
        }, [e._v("会员中心")]) : e.isLogin && 0 === e.isVip ? i() : i()], 1)
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {
            staticClass: "xly-client__header",
            class: {dragable: e.dragable}
        }, [i("div", {
            directives: [{name: "show", rawName: "v-show", value: !e.settingTab, expression: "!settingTab"}],
            staticClass: "xly-search none-dragable"
        }, [i("td-button", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.isLogined && "pan-plugin-view" === e.curNav || "download-panel" === e.curNav,
                expression: "(isLogined && curNav === 'pan-plugin-view') || curNav === 'download-panel'"
            }], attrs: {secondary: ""}, on: {click: e.popupMenu}
        }, [i("i", {staticClass: "xly-icon-add"}), e._v("新建\n    ")]), e._v(" "), i("div", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.isPopupMenu,
                expression: "isPopupMenu"
            }],
            ref: "menuButton",
            staticClass: "xly-netdisk-menu",
            staticStyle: {top: "43px", "z-index": "99"},
            attrs: {tabindex: "0"},
            on: {blur: e.onBlur}
        }, [i("ul", [i("li", {
            staticClass: "xly-netdisk-menu__item",
            on: {click: e.uploadLocalFiles}
        }, [i("span", {staticClass: "xly-netdisk-menu__icon xly-netdisk-menu__icon--upload"}), e._v(" "), i("span", [e._v("本地上传")])]), e._v(" "), i("li", {
            staticClass: "xly-netdisk-menu__item",
            on: {click: e.addLink}
        }, [i("span", {staticClass: "xly-netdisk-menu__icon xly-netdisk-menu__icon--link"}), e._v(" "), i("span", [e._v("添加链接")])]), e._v(" "), i("li", {
            staticClass: "xly-netdisk-menu__item",
            on: {click: e.addBt}
        }, [i("span", {staticClass: "xly-netdisk-menu__icon xly-netdisk-menu__icon--bt"}), e._v(" "), i("span", [e._v("添加BT")])]), e._v(" "), i("li", {
            staticClass: "xly-netdisk-menu__item",
            on: {click: e.createFolder}
        }, [i("span", {staticClass: "xly-netdisk-menu__icon xly-netdisk-menu__icon--file"}), e._v(" "), i("span", [e._v("新建文件夹")])])])]), e._v(" "), i("find-page-main-top", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: !e.settingTab,
                expression: "!settingTab"
            }], attrs: {isFindPage: e.isFindPage}
        })], 1), e._v(" "), e.settingTab ? i("div", {
            staticClass: "xly-client__back none-dragable",
            on: {
                click: function (t) {
                    e.closeSettingCenter()
                }
            }
        }, [i("i", {staticClass: "xly-icon-back"}), e._v(" 返回\n  ")]) : e._e(), e._v(" "), i("div", {staticClass: "xly-client-operate"}, [i("a", {
            staticClass: "none-dragable",
            class: {"disable-hover": e.disableHover},
            attrs: {href: "javascript:;"},
            on: {click: e.minizeMainWindow}
        }, [i("i", {staticClass: "xly-icon-minimize"})]), e._v(" "), i("a", {attrs: {href: "javascript:;"}}, [i("i", {
            staticClass: "none-dragable",
            class: {"disable-hover": e.disableHover, "xly-icon-reduce": e.maximized, "xly-icon-maximize": !e.maximized},
            on: {click: e.toggleMaximizeMainWindow}
        })]), e._v(" "), i("a", {
            staticClass: "none-dragable",
            class: {"disable-hover": e.disableHover},
            attrs: {href: "javascript:;"},
            on: {click: e.closeMainWindow}
        }, [i("i", {staticClass: "xly-icon-close"})])])])
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this.$createElement;
        return (this._self._c || e)("div", {attrs: {id: "pan-18BE0BEB-6C82-4D16-83C8-5566BE72D176"}})
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("div", {staticClass: "xly-aside-operate"}, [t("a", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: !1,
                expression: "false"
            }], attrs: {href: "javascript:;", title: "换肤"}
        }, [t("i", {staticClass: "xly-icon-theme"})]), this._v(" "), t("a", {
            attrs: {
                href: "javascript:;",
                title: "主菜单"
            }, on: {click: this.showMenu}
        }, [t("i", {staticClass: "xly-icon-menu"})])])
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("div", {
            staticClass: "xly-browser-search",
            class: {"is-normal": !this.isFindPage}
        }, [t("address-bar-container", {staticClass: "none-dragable", attrs: {isFindPage: this.isFindPage}})], 1)
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {staticStyle: {width: "calc(100vw - 100px)"}}, [i("div", {
            staticClass: "xly-browser-tab",
            style: "" + e.browserTabStyle
        }, [i("td-browser-tab", {
            attrs: {
                tabs: e.tabs,
                sortable: "",
                "min-width": 60,
                "show-total-limit": 12,
                current: e.current,
                background: e.background,
                "tab-listeners": e.tabListeners
            },
            on: {
                "update:tabs": e.updateTabs,
                "update:current": e.updateCurrent,
                add: e.handleAdd,
                remove: e.handleRemove,
                change: e.handleChange,
                "middle-click": e.handleMiddleDown,
                "total-click": e.handleTotalClick
            },
            nativeOn: {
                click: function (t) {
                    return e.handleClick(t)
                }
            },
            scopedSlots: e._u([{
                key: "default", fn: function (t) {
                    var n = t.index, a = t.tab;
                    return [0 === n && 0 !== e.current && -1 === e.currentCategoryId ? [i("div", {
                        ref: "progress",
                        staticClass: "xlx-browser-tab__progress"
                    }, [i("span", {staticClass: "xlx-browser-tab__progress-inner"})]), e._v(" "), i("span", {staticClass: "xlx-browser-tab__text"}, [e._v("\n            " + e._s(e.titleCue) + "\n          ")])] : e._e(), e._v(" "), e.isTabLoading(n) ? i("i", {staticClass: "icon-tab-loading"}) : e._e(), e._v(" "), i("span", {
                        directives: [{
                            name: "show",
                            rawName: "v-show",
                            value: 0 !== n || 0 === e.current || -1 !== e.currentCategoryId,
                            expression: "index !== 0 || current === 0 || currentCategoryId !== -1"
                        }], attrs: {id: 0 === n ? "recommendTab" : "", tabindex: "0"}
                    }, [e._v("\n          " + e._s(a.title) + "\n        ")])]
                }
            }])
        })], 1), e._v(" "), i("div", {
            staticClass: "xly-find",
            staticStyle: {height: "calc(100vh - 74px)"}
        }, [i("home-page", {style: e.homepageShow}), e._v(" "), i("browser-view-container", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.currentTabIsChromium,
                expression: "currentTabIsChromium"
            }]
        })], 1)])
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {staticClass: "xly-down"}, [e._m(0), e._v(" "), i("div", {staticClass: "xly-client-side"}, [i("download-list-container", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: !e.showPrivateSpaceOpenPage && !e.isSearch,
                expression: "!showPrivateSpaceOpenPage && !isSearch"
            }], ref: "downloadlist", nativeOn: {
                keydown: function (t) {
                    return e.keydownShowSearchUI(t)
                }
            }
        }, [i("toast-notify")], 1), e._v(" "), e.showPrivateSpaceOpenPage ? i("private-space-open-page-container") : e._e(), e._v(" "), i("status-bar-container")], 1), e._v(" "), i("task-detail")], 1)
    }, a = [function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("div", {
            staticStyle: {
                position: "absolute",
                left: "-10000px",
                top: "142px",
                width: "540px",
                height: "28px",
                overflow: "hidden"
            }
        }, [t("div", {
            staticStyle: {
                position: "absolute",
                left: "-10000px",
                top: "142px",
                width: "540px",
                height: "28px"
            }, attrs: {id: "webview_container"}
        })])
    }];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {staticClass: "setting-center"}, [i("div", {
            ref: "settinContain",
            staticClass: "xly-setting",
            on: {scroll: e.handleScroll}
        }, [i("div", {staticClass: "xly-setting-nav"}, [i("ul", {attrs: {id: "navList"}}, e._l(e.confSchema, function (t, n) {
            return i("li", {
                key: n, staticClass: "xly-setting-nav__item", on: {
                    click: function (t) {
                        e.clickTab(n)
                    }
                }
            }, [i("a", {
                class: {"is-active": e.currenIndex === n},
                attrs: {href: "javascript:;"}
            }, [e._v(e._s(t.name))])])
        }))]), e._v(" "), i("div", {staticClass: "xly-setting-wrapper"}, e._l(e.confSchema, function (t, n) {
            return i("div", {
                key: n,
                staticClass: "xly-setting-content contain-tab",
                class: t.classes,
                staticStyle: {display: "block"}
            }, [i("h3", [e._v(e._s(t.name))]), e._v(" "), i("div", {staticClass: "xly-setting-content__box"}, [i("ul", {staticClass: "xly-setting-content__vertical"}, e._l(t.children, function (t, n) {
                return i("li", {
                    key: n,
                    class: [{"xly-setting-content__item": t.children}, t.liClasses],
                    style: t.liStyles || ""
                }, [i("generator-view", {
                    attrs: {item: t, formData: e.formData},
                    on: {input: e.handleConfChange}
                }), e._v(" "), t.children ? i("div", {staticClass: "xly-setting-content__box"}, [i("ul", {class: t.ulClasses || ""}, e._l(t.children, function (t, n) {
                    return i("li", {key: n, class: t.liClasses || ""}, [i("generator-view", {
                        attrs: {
                            item: t,
                            formData: e.formData
                        }, on: {input: e.handleConfChange}
                    })], 1)
                }))]) : e._e()], 1)
            }))])])
        }))])])
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return "" === e.component ? i("div", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.show,
                expression: "show"
            }], staticClass: "xly-down-bar", on: {mousemove: e.handleMouseMove, mouseout: e.handleMouseOut}
        }, [i("p", {staticClass: "xly-down-bar__text"}, ["fail" === e.type ? i("i", {staticClass: "td-icon-warning"}) : e._e(), e._v("\n    " + e._s(e.message) + "\n  ")]), e._v(" "), i("div", {staticClass: "xly-down-bar__option"}, [e.cancel ? i("a", {
            staticClass: "xly-down-bar__button",
            attrs: {href: "javascript:;"},
            on: {click: e.handleCancel}
        }, [e._v(e._s(e.cancelText))]) : e._e(), e._v(" "), i("a", {
            staticClass: "xly-down-bar__close",
            attrs: {href: "javascript:;", title: "关闭"},
            on: {click: e.handleClose}
        }, [i("i", {staticClass: "td-icon-close"})])])]) : i(e.component, {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.show,
                expression: "show"
            }],
            tag: "component",
            attrs: {isUp: e.isUp, data: e.showNotifyItem},
            on: {close: e.handleClose, ok: e.handleClose},
            nativeOn: {
                mousemove: function (t) {
                    return e.handleMouseMove(t)
                }, mouseout: function (t) {
                    return e.handleMouseOut(t)
                }
            }
        })
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {
            staticClass: "xlx-bar xlx-bar--ad",
            style: e.adBackground
        }, [i("p", [i("span", {staticClass: "xlx-bar__image"}, [i("img", {
            attrs: {
                src: e.iconUrl,
                alt: ""
            }
        })]), e._v(" "), i("a", {
            style: e.adPColor, attrs: {href: "javascript:;"}, on: {
                click: function (t) {
                    e.onClick("content")
                }
            }
        }, [e._v(e._s(e.content))])]), e._v(" "), i("div", {staticClass: "xlx-bar__option"}, [i("a", {
            staticClass: "xlx-bar__button",
            style: e.adOptionAStyle,
            attrs: {href: "javascript:;"},
            on: {
                click: function (t) {
                    e.onClick("btn")
                }
            }
        }, [e._v(e._s(e.btnText))]), e._v(" "), i("a", {
            staticClass: "xlx-bar__close",
            style: e.adOptionAStyle,
            attrs: {href: "javascript:;", title: "关闭"},
            on: {
                click: function (t) {
                    e.onClick("close")
                }
            }
        }, [i("i", {staticClass: "td-icon-close"})])])])
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {
            staticClass: "xlx-side-promotion",
            style: e.isSearch ? "position: absolute; bottom: 0" : ""
        }, [i("div", {staticClass: "xlx-side-promotion__option"}, [i("a", {
            attrs: {href: "javascript:;"},
            on: {
                click: function (t) {
                    e.onClick("nodisturb")
                }
            }
        }, [e._v("不再展示")]), e._v(" "), i("a", {attrs: {href: "javascript:;"}}, [i("i", {
            staticClass: "xlx-icon-close",
            on: {
                click: function (t) {
                    e.onClick("close")
                }
            }
        })])]), e._v(" "), i("a", {
            staticClass: "xlx-side-promotion__inner",
            attrs: {href: "javascript:;"},
            on: {
                click: function (t) {
                    e.onClick("content")
                }
            }
        }, [i("img", {attrs: {src: e.picFile, alt: ""}})])])
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this.$createElement;
        return (this._self._c || e)(this.item.type, {
            tag: "component",
            style: this.item.styles,
            attrs: {item: this.item, label: this.item.label, formData: this.formData, value: this.value},
            on: {input: this.handleInput}
        })
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("div", {staticStyle: {height: "100%"}}, [t("webview", {
            ref: "webview",
            staticClass: "iframe-home",
            attrs: {id: this.elementId, nodeintegration: "", src: this.homePageUrl, preload: this.preloadPath}
        })], 1)
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {
            staticClass: "xly-client-content",
            staticStyle: {position: "relative", height: "100%"}
        }, [e.isError ? i("div", {staticClass: "error-page"}, [e._m(0), e._v(" "), i("div", {staticClass: "error-button"}, [i("td-button", {
            attrs: {
                secondary: "",
                disabled: !e.canGoBack
            }, on: {click: e.goBack}
        }, [e._v("返回")]), e._v(" "), i("td-button", {on: {click: e.refresh}}, [e._v("刷新")])], 1)]) : e.isLoading ? i("Loading") : e._e()], 1)
    }, a = [function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("div", {staticClass: "error-main"}, [t("div", {staticClass: "pic-error"}), this._v(" "), t("h1", [this._v("您访问的网站飞到了外太空")]), this._v(" "), t("p")])
    }];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {staticClass: "xlx-nav"}, [e._l(e.toolbarButtons, function (t) {
            return ["xlx-icon-nav-vip" != t.id ? i("tool-bar-button-container", {
                key: t.id,
                attrs: {
                    id: t.id,
                    imgSrc: t.imgSrc,
                    redDot: t.redDot,
                    title: t.title,
                    newIcon: t.newIcon,
                    loading: t.loading,
                    tooltip: t.tooltip,
                    tooltipTitle: t.tooltipTitle,
                    tooltipSubTitle: t.tooltipSubTitle,
                    buttonClassFilter: t.filterClass,
                    click: t.onClick,
                    tooltipClose: t.onTooltipClose,
                    tooltipClick: t.onTooltipClick,
                    enter: t.onEnter
                }
            }) : 0 === e.vipButtonPluginEnable ? i("tool-bar-vip-button-container", {
                key: t.id,
                attrs: {id: t.id, title: t.title, buttonClassFilter: t.filterClass}
            }) : e._e()]
        })], 2)
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {staticClass: "xly-status"}, [i("div", {
            staticClass: "xly-plan",
            attrs: {tabindex: "0"},
            on: {
                click: function (t) {
                    t.stopPropagation(), e.handleClick("entry")
                }, blur: e.onPopUpBlur
            }
        }, [i("p", {
            staticClass: "xly-plan__text",
            class: {"is-limit": e.isLimit}
        }, [e._v(e._s(e.entryText))]), e._v(" "), i("div", {
            staticClass: "xly-plan-menu",
            style: e.popUp ? "display:block;" : "display:none"
        }, [i("ul", {staticClass: "xly-plan-menu__main"}, [i("li", {
            staticClass: "xly-plan-menu__item",
            class: {"is-limit": e.isLimit},
            on: {
                click: function (t) {
                    t.stopPropagation(), e.handleClick("limitSpeed")
                }
            }
        }, [i("div", {staticClass: "xly-plan-menu__content"}, [i("span", {staticClass: "xly-plan-menu__text"}, [e._v(e._s(e.limitSpeetMenuText))])])]), e._v(" "), e.isLimit ? i("li", {
            staticClass: "xly-plan-menu__item",
            on: {
                click: function (t) {
                    t.stopPropagation(), e.handleClick("totalSpeed")
                }
            }
        }, [e._m(0)]) : e._e()]), e._v(" "), i("ul", {staticClass: "xly-plan-menu__main"}, [i("li", {
            staticClass: "xly-plan-menu__item",
            class: {"is-chosen": e.isFreeDownload},
            on: {
                click: function (t) {
                    t.stopPropagation(), e.handleClick("freeDownload")
                }
            }
        }, [e._m(1)]), e._v(" "), i("li", {
            staticClass: "xly-plan-menu__item", on: {
                click: function (t) {
                    t.stopPropagation(), e.handleClick("scheduleTask")
                }
            }
        }, [i("div", {staticClass: "xly-plan-menu__content"}, [i("span", {staticClass: "xly-plan-menu__text"}, [e._v("计划任务")]), e._v(" "), e.scheduleTaskCount > 0 ? i("span", {staticClass: "xly-plan-menu__number"}, [e._v(e._s(e.scheduleTaskCount))]) : e._e()])])]), e._v(" "), i("ul", {staticClass: "xly-plan-menu__main"}, [i("li", {staticClass: "xly-plan-menu__item xly-plan-menu__item--option"}, [i("div", {staticClass: "xly-plan-menu__content"}, [i("i", {staticClass: "td-icon"}), e._v(" "), i("span", {staticClass: "xly-plan-menu__text"}, [e._v("下载完成后:")]), e._v(" "), i("ul", {staticClass: "xly-plan-menu__tag"}, [i("li", {
            class: {"is-chosen": 0 === e.downloadCompleteTaskType},
            on: {
                mousedown: function (t) {
                    t.stopPropagation(), e.handleClick("shutdown")
                }
            }
        }, [e._v("关机")]), e._v(" "), i("li", {
            class: {"is-chosen": 1 === e.downloadCompleteTaskType},
            on: {
                mousedown: function (t) {
                    t.stopPropagation(), e.handleClick("sleep")
                }
            }
        }, [e._v("睡眠")]), e._v(" "), i("li", {
            class: {"is-chosen": 2 === e.downloadCompleteTaskType},
            on: {
                mousedown: function (t) {
                    t.stopPropagation(), e.handleClick("exit")
                }
            }
        }, [e._v("退出")])])])])])])]), e._v(" "), i("span", {staticClass: "xly-line"}), e._v(" "), i("div", {staticClass: "xly-status-speed"}, [i("div", {staticClass: "xly-status-speed__text"}, [i("p", {on: {mouseover: e.showPop}}, [e._v(e._s(e.curSpeed))])]), e._v(" "), i("div", {staticClass: "xly-speed-pop"}, [i("ul", [i("li", {staticClass: "xly-speed-pop__item"}, [i("i", {staticClass: "xly-icon-download"}), e._v(" "), i("p", [e._v("\n            下载速度：\n            "), i("em", [e._v(e._s(e.curHoverSpeed))])])]), e._v(" "), i("li", {staticClass: "xly-speed-pop__item"}, [i("i", {staticClass: "xly-icon-upload"}), e._v(" "), i("p", [e._v("\n            上传速度：\n            "), i("em", [e._v(e._s(e.curUpSpeed))])])])]), e._v(" "), i("td-button", {
            staticClass: "td-button--other",
            on: {click: e.viewMoreData}
        }, [e._v("查看更多数据")])], 1)]), e._v(" "), e.canShowDiskBusy ? i("span", {staticClass: "xly-line"}) : e._e(), e._v(" "), e.canShowDiskBusy ? i("div", {
            staticClass: "xly-status-disk",
            on: {
                mouseenter: function (t) {
                    e.hover()
                }
            }
        }, [i("span", {staticClass: "xly-status-plan__line"}), e._v(" "), e._m(2), e._v(" "), i("div", {staticClass: "xly-status-disk__pop"}, [e._m(3), e._v(" "), i("div", {staticClass: "xly-status-disk__content"}, [i("div", {staticClass: "xly-status-disk__progress"}, [i("ul", e._l(e.diskInfo, function (t) {
            return i("li", {key: t.name}, [i("p", {staticClass: "xly-status-disk__progress-text"}, [e._v("\n                磁盘 " + e._s(t.name) + ")繁忙度：\n                "), i("span", [e._v(e._s(t.percent) + "%")])]), e._v(" "), i("td-progress", {attrs: {value: t.percent}})], 1)
        }))]), e._v(" "), i("div", {staticClass: "xly-status-disk__detail"}, [i("p", [e._v("磁盘繁忙时可能出现以下情况：")]), e._v(" "), i("ul", [i("li", [e._v("1.下载速度变慢")]), e._v(" "), i("li", [e._v("2.电脑响应变慢")]), e._v(" "), i("li", [e._v("3.下载进度卡在99.9%")]), e._v(" "), this.taskIds.length < 3 ? i("li", [e._v("您无需执行任何操作，耐心等待即可！")]) : i("li", [e._v("建议您减少同时下载的任务数量！")])])])]), e._v(" "), i("td-button", {
            staticClass: "td-button--other",
            on: {
                click: function (t) {
                    e.openTab()
                }
            }
        }, [e._v("了解磁盘繁忙原因")])], 1)]) : e._e(), e._v(" "), i("div", {
            staticClass: "xly-status-secret",
            class: {"is-open": e.isInPrivateSpace},
            on: {click: e.handlePrivateSpace}
        }, [i("i", {staticClass: "xly-img-secret"}), e._v(" "), i("p", {staticClass: "xly-status-secret__tips"}, [e._v(e._s(e.isInPrivateSpace ? "退出" : "进入") + "私人空间")])])])
    }, a = [function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("div", {staticClass: "xly-plan-menu__content"}, [t("span", {staticClass: "xly-plan-menu__text"}, [this._v("全速下载")])])
    }, function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("div", {staticClass: "xly-plan-menu__content"}, [t("span", {staticClass: "xly-plan-menu__text"}, [this._v("空闲下载")])])
    }, function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("p", {staticClass: "xly-status-disk__text"}, [t("i", {staticClass: "xly-icon-disk"})])
    }, function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("div", {staticClass: "xly-status-disk__title"}, [t("p", [t("i", {staticClass: "xly-icon-note"}), this._v("检测到磁盘过于繁忙！\n        ")])])
    }];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("div", {staticClass: "xlx-side-update"}, [t("div", {staticClass: "xlx-side-update__progress"}, [this._v(this._s(this.progress) + "%")]), this._v(" "), this._m(0)])
    }, a = [function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("p", [this._v("正在升级下载引擎"), t("span", [t("i", [this._v("...")])])])
    }];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, n = e._self._c || t;
        return n("div", {
            staticClass: "xlx-bar",
            class: e.isUp ? "xlx-bar--coin is-up" : "xlx-bar--coin"
        }, [n("p", [e._v(e._s(e.data.getMessage()))]), e._v(" "), n("div", {staticClass: "xlx-bar__option"}, [n("img", {attrs: {src: i(641)}}), e._v(" "), n("p", {staticClass: "xlx-bar__p"}, [e._v(e._s(e.coinCount))]), e._v(" "), n("a", {
            staticClass: "xlx-bar__button",
            attrs: {href: "javascript:;"},
            on: {click: e.handlePrize}
        }, [e._v("领取")]), e._v(" "), n("a", {
            staticClass: "xlx-bar__close",
            attrs: {href: "javascript:;", title: "关闭"},
            on: {click: e.handleClose}
        }, [n("i", {staticClass: "td-icon-close"})])])])
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {
            ref: "downMain",
            staticClass: "xly-down__main",
            attrs: {id: "xly-task-detail-down__main"}
        }, [1 === e.multiChosenTaskList.length && 0 !== e.curTaskId ? i("div", {staticClass: "xly-down-info"}, [i("XlHeader", {attrs: {curTaskName: e.curTaskName}}), e._v(" "), i("div", {staticClass: "xly-down-body"}, [i("XlTab", {
            attrs: {
                curTaskId: e.curTaskId,
                curUserId: e.curUserId,
                curCategoryid: e.curCategoryid
            }
        }), e._v(" "), i("XlDetail", {
            attrs: {
                curTaskId: e.curTaskId,
                curTaskStatus: e.curTaskStatus,
                curUserId: e.curUserId
            }, on: {switchNav: e.switchNav}
        }), e._v(" "), e.isBtOrGroup ? i("FileList", {
            attrs: {
                curTaskId: e.curTaskId,
                operate: e.operate,
                playingMediaIndex: e.playingMediaIndex,
                playingCurTask: e.playingCurTask
            }
        }) : e._e()], 1)], 1) : e.multiChosenTaskList.length > 1 ? i("div", {staticClass: "xly-down-detail"}, [i("MultiChosenTasks", {
            attrs: {
                taskIds: e.multiChosenTaskList,
                curCategoryid: e.curCategoryid
            }
        })], 1) : i("div", {staticClass: "xly-empty"}, [i("i", {staticClass: "xly-icon-logo"})])])
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("td-collapse", {
            staticClass: "xly-side",
            class: {"is-hover": e.isHoverClass, "is-secret": e.isInPrivateSpace},
            attrs: {value: e.currentCategoryViewId, tabindex: "0"},
            on: {change: e.handleCollapseChange}
        }, [i("td-collapse-item", {
            attrs: {
                title: e.downloadingCategoryTitle,
                value: e.categoryLastSelectList[0].category,
                tabindex: "0"
            }, nativeOn: {
                contextmenu: function (t) {
                    return e.handleDownloadingCategoryMenu(t)
                }, keydown: [function (t) {
                    return ("button" in t || 65 === t.keyCode) && t.ctrlKey ? e.selectAll(t) : null
                }, function (t) {
                    return e.handleKeyDown(t)
                }]
            }
        }, [i("template", {slot: "title"}, [i("span", {
            staticClass: "td-collapse-item__title-text",
            attrs: {slot: "title"},
            slot: "title"
        }, [e._v(e._s(e.downloadingCategoryTitle))]), e._v(" "), i("div", {
            staticClass: "xly-collapse-item__operate",
            attrs: {slot: "title"},
            slot: "title"
        }, [i("a", {
            attrs: {href: "javascript:;"},
            on: {click: e.handleDownloadingCategoryMore}
        }, [i("i", {staticClass: "xly-icon-more"})])])]), e._v(" "), 0 === e.downloadingTaskList.length ? i("div", {
            staticClass: "xly-side__empty",
            on: {
                contextmenu: function (t) {
                    return t.stopPropagation(), e.handleDownloadingBlankMenu(t)
                }
            }
        }, [i("div", {staticClass: "xly-img-empty-netdisk"}), e._v(" "), i("p", [e._v("没有正在下载任务")])]) : i("download-category", {
            ref: "downloading",
            staticStyle: {outline: "none"},
            attrs: {
                componentName: "DownloadingItemContainer",
                tasklist: e.downloadingTaskList,
                selectedTaskIds: e.downloadingSelectedIndexs,
                COMMIT_SELECT: e.UPDATE_DOWNLOADING_SELECTED_TASKS,
                COMMIT_UPDATE_TASKLIST: e.UPDATE_DOWNLOADING_TASKLIST,
                currentCategoryId: e.currentCategoryId,
                currentCategoryViewId: e.currentCategoryViewId
            },
            on: {dblclick: e.downloadingItemDbClick, contextmenu: e.handleDownloadingItemMenu},
            nativeOn: {
                contextmenu: function (t) {
                    return t.stopPropagation(), e.handleDownloadingBlankMenu(t)
                }, keydown: function (t) {
                    return e.handleDelete(t)
                }
            }
        })], 2), e._v(" "), i("td-collapse-item", {
            staticClass: "xly-side-completed",
            attrs: {title: e.completedCategoryTitle, value: e.categoryLastSelectList[1].category, tabindex: "0"},
            nativeOn: {
                contextmenu: function (t) {
                    return e.handleCompletedCategoryMenu(t)
                }, keydown: [function (t) {
                    return ("button" in t || 65 === t.keyCode) && t.ctrlKey ? e.selectAll(t) : null
                }, function (t) {
                    return e.handleKeyDown(t)
                }]
            }
        }, [i("template", {slot: "title"}, [i("span", {staticClass: "td-collapse-item__title-text"}, [e._v(e._s(e.completedCategoryTitle))]), e._v(" "), i("div", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: "全部" !== e.completedFilter,
                expression: "completedFilter !== '全部'"
            }], staticClass: "xly-collapse-item__tags"
        }, [i("span", [e._v(e._s(e.completedFilter))]), e._v(" "), i("i", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: "全部" !== e.completedFilter,
                expression: "completedFilter !== '全部'"
            }], staticClass: "xly-icon-close-small", on: {
                click: function (t) {
                    return t.stopPropagation(), e.completedListRestore(t)
                }
            }
        })]), e._v(" "), i("div", {staticClass: "xly-collapse-item__operate"}, [i("a", {
            attrs: {href: "javascript:;"},
            on: {click: e.handleCompletedCategoryMore}
        }, [i("i", {staticClass: "xly-icon-more"})])])]), e._v(" "), 0 === e.completedTaskList.length ? i("div", {
            staticClass: "xly-side__empty",
            on: {
                contextmenu: function (e) {
                    e.stopPropagation()
                }
            }
        }, [i("div", {staticClass: "xly-img-empty-netdisk"}), e._v(" "), i("p", [e._v("没有已完成任务")])]) : i("download-category", {
            ref: "completed",
            staticStyle: {outline: "none"},
            attrs: {
                componentName: "CompletedItemContainer",
                sortable: "全部" === e.completedFilter,
                tasklist: e.completedFilterTaskList,
                selectedTaskIds: e.completedSelectedTaskIndexs,
                COMMIT_SELECT: e.UPDATE_COMPLETED_SELECTED_TASKS,
                COMMIT_UPDATE_TASKLIST: e.UPDATE_COMPLETED_TASKLIST,
                currentCategoryId: e.currentCategoryId,
                currentCategoryViewId: e.currentCategoryViewId
            },
            on: {contextmenu: e.handleCompletedItemMenu},
            nativeOn: {
                contextmenu: function (e) {
                    e.stopPropagation()
                }, keydown: function (t) {
                    return e.handleDelete(t)
                }
            }
        })], 2), e._v(" "), -1 === e.currentCategoryId ? i("td-collapse-item", {
            staticClass: "xly-side-deleted",
            attrs: {title: e.recycleCategoryTitle, value: e.categoryLastSelectList[2].category, tabindex: "0"},
            nativeOn: {
                contextmenu: function (t) {
                    return e.handleRecycleCategoryMenu(t)
                }, keydown: [function (t) {
                    return ("button" in t || 65 === t.keyCode) && t.ctrlKey ? e.selectAll(t) : null
                }, function (t) {
                    return e.handleKeyDown(t)
                }]
            }
        }, [i("span", {
            staticClass: "td-collapse-item__title-text",
            attrs: {slot: "title"},
            slot: "title"
        }, [e._v(e._s(e.recycleCategoryTitle))]), e._v(" "), i("div", {
            staticClass: "xly-collapse-item__operate",
            attrs: {slot: "title"},
            slot: "title"
        }, [i("a", {
            attrs: {href: "javascript:;"},
            on: {click: e.handleRecycleCategoryMore}
        }, [i("i", {staticClass: "xly-icon-more"})])]), e._v(" "), 0 === e.recycleTaskList.length ? i("div", {
            staticClass: "xly-side__empty",
            on: {
                contextmenu: function (t) {
                    return t.stopPropagation(), e.handleRecycleBlankMenu(t)
                }
            }
        }, [i("div", {staticClass: "xly-img-empty-netdisk"}), e._v(" "), i("p", [e._v("没有回收站任务")])]) : i("download-category", {
            ref: "dustbin",
            staticStyle: {outline: "none"},
            attrs: {
                componentName: "RecycleItemContainer",
                tasklist: e.recycleTaskList,
                selectedTaskIds: e.recycleSelectedTaskIndexs,
                currentCategoryId: e.currentCategoryId,
                currentCategoryViewId: e.currentCategoryViewId,
                COMMIT_SELECT: e.UPDATE_RECYCLE_SELECTED_TASKS,
                COMMIT_UPDATE_TASKLIST: e.UPDATE_RECYCLE_TASKLIST
            },
            on: {contextmenu: e.handleRecycleItemMenu},
            nativeOn: {
                contextmenu: function (t) {
                    return t.stopPropagation(), e.handleRecycleBlankMenu(t)
                }, keydown: function (t) {
                    e.handleDelete(t, !0)
                }
            }
        })], 1) : e._e(), e._v(" "), e._t("default")], 2)
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {staticClass: "td-collapse xly-side is-secret"}, [i("div", {staticClass: "td-collapse-item is-active"}, [e._m(0), e._v(" "), i("div", {staticClass: "td-collapse-item__content"}, [i("div", {staticClass: "xly-side__empty"}, [i("div", {staticClass: "xly-img-empty-netdisk"}), e._v(" "), i("p", {staticClass: "title"}, [e._v("私人空间")]), e._v(" "), i("p", [e._v("只有自己可以查看的下载任务")]), e._v(" "), i("button", {
            staticClass: "td-button",
            on: {click: e.openPrivateSpace}
        }, [e._v("开启私人空间")])])])])])
    }, a = [function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("div", {staticClass: "td-collapse-item__title"}, [t("span", {staticClass: "td-collapse-item__title-text"}, [this._v("私人下载")]), this._v(" "), t("div", {staticClass: "xly-collapse-item__operate"}, [t("a", {attrs: {href: "javascript:;"}}, [t("i", {staticClass: "xly-icon-more"})])])])
    }];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {
            staticClass: "xlx-side-search",
            style: {height: e.hasLeftBottomAd ? "calc(100% - 68px)" : "100%"},
            attrs: {tabindex: "0"}
        }, [i("div", {staticClass: "xlx-search-record"}, [i("label", {staticClass: "td-input"}, [i("td-input", {
            ref: "input",
            attrs: {placeholder: "搜索下载记录", autofocus: ""},
            on: {
                focus: e.onInputFocus, blur: e.onInputBlur, input: e.startSearch, keydown: function (t) {
                    return ("button" in t || 65 === t.keyCode) && t.ctrlKey ? void e.$refs.input.select() : null
                }
            },
            nativeOn: {
                contextmenu: function (t) {
                    return e.handlePopInputMenu(t)
                }, keydown: function (t) {
                    return ("button" in t || 70 === t.keyCode) && t.ctrlKey ? e.keyCloseSearch(t) : null
                }
            },
            model: {
                value: e.curSearchKey, callback: function (t) {
                    e.curSearchKey = t
                }, expression: "curSearchKey"
            }
        })], 1), e._v(" "), this.inputFlag && this.curSearchKey.trim().length > 0 ? i("p", {staticClass: "xlx-search-record__result"}, [i("span", [e._v(e._s(e.resultCount))]), e._v("个结果\n    ")]) : e._e(), e._v(" "), i("a", {
            staticClass: "xlx-search-record__clear is-danger",
            attrs: {href: "javascript:;", title: ""},
            on: {click: e.clickCloseSearch}
        }, [i("i", {staticClass: "td-icon-close"})])]), e._v(" "), i("div", {staticClass: "xlx-search-list"}, [this.inputFlag && e.resultCount < 1 && this.curSearchKey.trim().length > 0 ? i("div", {staticClass: "xlx-side__empty"}, [i("p", [e._v("没有搜索到相关内容")])]) : i("div", {
            staticClass: "td-collapse",
            staticStyle: {height: "100%"},
            nativeOn: {
                keydown: function (t) {
                    return ("button" in t || 70 === t.keyCode) && t.ctrlKey ? e.keyCloseSearch(t) : null
                }
            }
        }, [e.downloadingSearchList.length > 0 ? i("div", {
            staticClass: "td-collapse-item xlx-side-downloading",
            nativeOn: {
                keydown: function (t) {
                    return ("button" in t || 70 === t.keyCode) && t.ctrlKey ? e.keyCloseSearch(t) : null
                }
            }
        }, [i("div", {staticClass: "td-collapse-item__title"}, [e._v(e._s(e.downloadingCategoryTitle))]), e._v(" "), i("div", {staticClass: "td-collapse-item__content"}, [i("download-category", {
            ref: "downloading",
            staticStyle: {outline: "none"},
            attrs: {
                componentName: "DownloadingItemContainer",
                sortable: !1,
                tasklist: e.downloadingSearchList,
                selectedTaskIds: e.currentSelSearchTaskIds,
                COMMIT_UPDATE_TASKLIST: e.UPDATE_DOWNLOADING_TASKLIST,
                COMMIT_SELECT: e.onDownloadTaskSelect,
                currentCategoryId: e.currentCategoryId,
                currentCategoryViewId: e.currentCategoryViewId,
                itemType: e.searchType,
                sharedKeyWords: e.curSearchKey,
                pulseForRename: e.pulseEventFlag
            },
            on: {dblclick: e.downloadingItemDbClick, contextmenu: e.handleDownloadingItemMenu},
            nativeOn: {
                contextmenu: function (e) {
                    e.stopPropagation()
                }, keydown: function (t) {
                    if (!("button" in t) && e._k(t.keyCode, "delete", [8, 46], t.key, ["Backspace", "Delete"])) return null;
                    e.handleDelete(!1)
                }
            }
        })], 1)]) : e._e(), e._v(" "), e.completeSearchList.length > 0 ? i("div", {
            staticClass: "td-collapse-item xlx-side-completed",
            nativeOn: {
                keydown: function (t) {
                    return ("button" in t || 70 === t.keyCode) && t.ctrlKey ? e.keyCloseSearch(t) : null
                }
            }
        }, [i("div", {staticClass: "td-collapse-item__title"}, [e._v(e._s(e.completedCategoryTitle))]), e._v(" "), i("div", {staticClass: "td-collapse-item__content"}, [i("download-category", {
            ref: "completed",
            staticStyle: {outline: "none"},
            attrs: {
                componentName: "CompletedItemContainer",
                sortable: !1,
                tasklist: e.completeSearchList,
                selectedTaskIds: e.currentSelSearchTaskIds,
                COMMIT_UPDATE_TASKLIST: e.UPDATE_COMPLETED_TASKLIST,
                COMMIT_SELECT: e.onDownloadTaskSelect,
                currentCategoryId: e.currentCategoryId,
                currentCategoryViewId: e.currentCategoryViewId,
                itemType: e.searchType,
                sharedKeyWords: e.curSearchKey,
                pulseForRename: e.pulseEventFlag
            },
            on: {contextmenu: e.handleCompletedItemMenu},
            nativeOn: {
                contextmenu: function (e) {
                    e.stopPropagation()
                }, keydown: function (t) {
                    if (!("button" in t) && e._k(t.keyCode, "delete", [8, 46], t.key, ["Backspace", "Delete"])) return null;
                    e.handleDelete(!1)
                }
            }
        })], 1)]) : e._e(), e._v(" "), e.recycleSearchList.length > 0 ? i("div", {
            staticClass: "td-collapse-item xlx-side-deleted",
            nativeOn: {
                keydown: function (t) {
                    return ("button" in t || 70 === t.keyCode) && t.ctrlKey ? e.keyCloseSearch(t) : null
                }
            }
        }, [i("div", {staticClass: "td-collapse-item__title"}, [e._v(e._s(e.recycleCategoryTitle))]), e._v(" "), i("div", {staticClass: "td-collapse-item__content"}, [i("download-category", {
            ref: "dustbin",
            staticStyle: {outline: "none"},
            attrs: {
                componentName: "RecycleItemContainer",
                sortable: !1,
                tasklist: e.recycleSearchList,
                selectedTaskIds: e.currentSelSearchTaskIds,
                currentCategoryId: e.currentCategoryId,
                currentCategoryViewId: e.currentCategoryViewId,
                itemType: e.searchType,
                sharedKeyWords: e.curSearchKey,
                pulseForRename: e.pulseEventFlag,
                COMMIT_UPDATE_TASKLIST: e.UPDATE_RECYCLE_TASKLIST,
                COMMIT_SELECT: e.onDownloadTaskSelect
            },
            on: {dblclick: e.recycleItemDbClick, contextmenu: e.handleRecycleItemMenu},
            nativeOn: {
                contextmenu: function (e) {
                    e.stopPropagation()
                }, keydown: function (t) {
                    if (!("button" in t) && e._k(t.keyCode, "delete", [8, 46], t.key, ["Backspace", "Delete"])) return null;
                    e.handleDelete(!0)
                }
            }
        })], 1)]) : e._e()])])])
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {class: e.item.outerClass}, [i("td-checkbox", {
            attrs: {value: !(0 == e.formData[e.item.name].value)},
            on: {input: e.handleInput}
        }, [e._v("\n    " + e._s(e.item.label) + "\n  ")]), e._v(" "), e._l(e.item.extEles, function (t) {
            return [i(t.type, {
                key: t.name,
                tag: "component",
                attrs: {
                    item: t,
                    classes: t.classes,
                    text: t.text,
                    formData: e.formData,
                    name: t.name,
                    disabled: !e.formData[e.item.name].value,
                    value: e.formData[t.name]
                },
                on: {input: e.handleInput}
            })]
        }), e._v(" "), e.item.tip ? i("p", {class: e.item.tipClass}, [e._v("\n    " + e._s(e.item.tip) + "\n  ")]) : e._e()], 2)
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {class: e.item.outerClass}, [e.item.listEles ? [e._l(e.item.listEles, function (t) {
            return [i("td-button", {
                key: t.name,
                class: e.classes || t.classes,
                style: t.style || "",
                attrs: {disabled: e.disabled || t.bindName && !e.formData[t.bindName].value},
                on: {
                    click: function (i) {
                        e.popDialog(t)
                    }
                }
            }, [e._v(e._s(e.text || t.text))])]
        })] : [i("td-button", {
            class: e.classes || e.item.classes,
            style: e.item.style || "",
            attrs: {disabled: e.disabled || e.item.bindName && !e.formData[e.item.bindName].value},
            on: {
                click: function (t) {
                    e.popDialog(e.item)
                }
            }
        }, [e._v(e._s(e.text || e.item.text))])], e._v(" "), e._l(e.item.extEles, function (t) {
            return [i(t.type, {
                key: t.name,
                tag: "component",
                class: t.classes,
                style: t.style || "",
                attrs: {item: t, text: t.text, formData: e.formData}
            })]
        })], 2)
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {class: e.item.classes}, [i("p", [e._v("\n    限速时间段：\n    " + e._s(e.standardNumber(e.formData["ConfigNet-ConfigNet_Custom_Time_Begin_Hour"].value)) + ":\n    " + e._s(e.standardNumber(e.formData["ConfigNet-ConfigNet_Custom_Time_Begin_Minute"].value)) + "-" + e._s(e.standardNumber(e.formData["ConfigNet-ConfigNet_Custom_Time_End_Hour"].value)) + ":\n    " + e._s(e.standardNumber(e.formData["ConfigNet-ConfigNet_Custom_Time_End_Minute"].value)) + " \n    最大下载速度: " + e._s(e.maxDownloadSpeed) + "   \n    最大上传速度: " + e._s(e.maxUploadSpeed) + "\n  ")])])
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {
            class: e.item.outerClass,
            style: e.item.style
        }, ["" !== e.label ? i("span", [e._v(e._s(e.label))]) : e._e(), e._v(" "), i("td-tooltip", {
            attrs: {
                content: e.tipContent,
                visible: e.tooltipVisible,
                placement: "top"
            }
        }, [i("select-native", {
            ref: "root",
            class: e.classes || e.item.classes,
            attrs: {
                value: e.valueData,
                options: e.optionList || e.item.option,
                placeholder: e.placeHolder || e.formData[e.item.name].value + "",
                editable: e.item.editable,
                disabled: e.disabled
            },
            on: {input: e.validate, blur: e.handleOutFocus, "choose-file": e.selectPath}
        }, ["openFile" === e.item.slotOption || "openDirectory" === e.item.slotOption || "openThunderPan" === e.item.slotOption ? i("a", {
            staticClass: "xly-select__file",
            attrs: {slot: "suffix", href: "javascript:;"},
            on: {
                click: function (t) {
                    e.handleChangePath(e.item.slotOption)
                }
            },
            slot: "suffix"
        }, [i("i", {staticClass: "xly-icon-file"})]) : e._e()])], 1)], 1)
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {
            class: e.item.outClasses,
            style: e.item.style
        }, [i("td-tooltip", {
            attrs: {
                content: e.item.toolTipsContent || "",
                visible: e.tooltipVisible,
                placement: "top"
            }
        }, [i("td-input", {
            ref: "input",
            class: e.item.classes,
            attrs: {
                label: e.label || e.item.label,
                value: e.valueData,
                placeholder: e.item.placeholder,
                disabled: e.disabled
            },
            on: {
                input: e.validate,
                change: e.handleChange,
                keydown: e.handleKeyDown,
                keyup: e.handleKeyup,
                blur: e.outFocus
            }
        })], 1), e._v(" "), e._l(e.item.extEles, function (t) {
            return [i(t.type, {
                key: t.name,
                tag: "component",
                attrs: {
                    item: t,
                    classes: t.classes,
                    text: t.text,
                    formData: e.formData,
                    disabled: e.disabled || !e.formData[e.item.name].value,
                    value: e.formData[t.name]
                },
                on: {input: e.handleInput}
            })]
        })], 2)
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("p", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: !e.item.isReleventUser || e.item.isReleventUser && "" !== e.userId,
                expression: "!item.isReleventUser || (item.isReleventUser && userId !== '')"
            }], class: e.clas, style: e.item.style || ""
        }, [e._v("\n   " + e._s(e.textContent) + "\n   "), e.item.tip ? i("span", {class: e.item.tipClass}, [e._v(e._s(e.item.tip))]) : e._e()])
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {class: e.item.outerClass}, [i("ul", {class: e.item.ulClasses}, e._l(e.item.option, function (t, n) {
            return i("li", {
                directives: [{
                    name: "show",
                    rawName: "v-show",
                    value: !e.item.isReleventUser || e.item.isReleventUser && "" !== e.userId,
                    expression: "!item.isReleventUser || (item.isReleventUser && userId !== '')"
                }], key: n, class: e.item.classes
            }, [i("td-radio", {
                attrs: {
                    name: e.item.key,
                    value: "" + e.formData[e.item.name].value,
                    label: t,
                    disabled: e.item.disableds && e.item.disableds[n]
                }, on: {input: e.handleInput}
            }, [e._v(e._s(e.item.labels[n] || e.lable))]), e._v(" "), e.item.extEles ? i(e.item.extEles[n].type, {
                tag: "component",
                attrs: {
                    text: e.item.extEles[n].text,
                    item: e.item.extEles[n],
                    label: e.item.extEles[n] && e.item.extEles[n].label,
                    classes: e.item.extEles[n].classes,
                    disabled: e.formData[e.item.name].value !== e.item.extActiveValue,
                    name: e.item.extEles[n].name,
                    value: e.formData[e.item.extEles[n].name],
                    formData: e.formData
                },
                on: {input: e.handleInput}
            }) : e._e()], 1)
        })), e._v(" "), e.item.tip ? i("p", {class: e.item.tipClass}, [e._v(e._s(e.item.tip))]) : e._e()])
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", [i("td-checkbox", {
            attrs: {value: !(0 == e.formData[e.item.name].value)},
            on: {input: e.handleInput}
        }, [e._v("\n    " + e._s(e.item.label) + "\n  ")]), e._v(" "), e._l(e.item.extEles, function (t, n) {
            return e.item.extEles ? i(t.type, {
                key: n,
                tag: "component",
                attrs: {
                    formData: e.formData,
                    placeHolder: e.formData[t.name] && e.formData[t.name].value,
                    item: t,
                    value: e.formData[t.name],
                    disabled: !(e.formData[e.item.name] && e.formData[e.item.name].value),
                    name: t.name,
                    label: t.label,
                    classes: t.classes,
                    text: t.text
                },
                on: {input: e.handleInput}
            }) : e._e()
        })], 2)
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {class: e.item.classes}, [i("td-checkbox", {
            attrs: {value: !(0 == e.formData[e.item.name].value)},
            on: {input: e.handleInput}
        }, [e._v("\n    " + e._s(e.item.label) + "\n  ")]), e._v(" "), e._l(e.item.extEles, function (t, n) {
            return e.item.extEles ? i(t.type, {
                key: n,
                tag: "component",
                attrs: {
                    formData: e.formData,
                    item: t,
                    placeHolder: e.formData[t.name] && e.formData[t.name].value,
                    disabled: !e.formData[e.item.name].value
                },
                on: {input: e.handleInput}
            }) : e._e()
        })], 2)
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("div", {class: this.item.outerClass}, [t("label", {staticClass: "td-textarea"}, [t("textarea", {
            staticClass: "td-textarea__inner",
            class: this.item.classes,
            attrs: {placeholder: this.item.placeholder},
            domProps: {value: this.formData[this.item.name].value},
            on: {change: this.handleChange}
        })])])
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {staticClass: "xly-setting-content__part"}, [i("p", {staticClass: "xly-setting-content__text"}, [e._v("代理管理")]), e._v(" "), i("div", {staticClass: "td-table td-table--border"}, [e._m(0), e._v(" "), i("div", {staticClass: "td-table__body-wrapper"}, [i("table", {staticClass: "td-table__body"}, [e._m(1), e._v(" "), i("tbody", e._l(e.proxyList, function (t, n) {
            return t.name && t.name.length > 0 ? i("tr", {
                key: n,
                class: {"is-chosen": t === e.selectedItem},
                on: {
                    click: function (i) {
                        e.selectedItem = t
                    }
                }
            }, [i("td", [i("p", {staticClass: "td-table__text"}, [e._v(e._s(t.name))])]), e._v(" "), i("td", [i("p", {staticClass: "td-table__text"}, [e._v(e._s(t.host))])]), e._v(" "), i("td", [i("p", {staticClass: "td-table__text"}, [e._v(e._s(t.port))])]), e._v(" "), i("td", [i("p", {staticClass: "td-table__text"}, [e._v(e._s(t.type))])])]) : e._e()
        }))])])]), e._v(" "), i("div", {staticClass: "xly-setting-content__button"}, [i("div", {staticClass: "botton-wrap"}, [i("a", {
            staticClass: "td-button td-button--small",
            attrs: {href: "javascript:;"},
            on: {click: e.handleAddProxy}
        }, [e._v("添加")]), e._v(" "), i("a", {
            staticClass: "td-button td-button--other td-button--small",
            class: {"is-disabled": null === e.selectedItem},
            attrs: {href: "javascript:;"},
            on: {click: e.handleModifyProxy}
        }, [e._v("修改")]), e._v(" "), i("a", {
            staticClass: "td-button td-button--other td-button--small",
            class: {"is-disabled": null === e.selectedItem},
            attrs: {href: "javascript:;"},
            on: {click: e.handleDeleteProxy}
        }, [e._v("删除")])]), e._v(" "), i("div", {staticClass: "botton-wrap"}, [i("a", {
            staticClass: "td-button td-button--other td-button--small",
            class: {"is-disabled": null === e.selectedItem},
            attrs: {href: "javascript:;"},
            on: {click: e.handleApplyProxy}
        }, [e._v("应用代理")])])])])
    }, a = [function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {staticClass: "td-table__header-wrapper"}, [i("table", {staticClass: "td-table__header"}, [i("colgroup", [i("col", {staticClass: "xly-setting__column-1"}), e._v(" "), i("col", {
            staticClass: "xly-setting__column-2",
            attrs: {width: "126"}
        }), e._v(" "), i("col", {
            staticClass: "xly-setting__column-3",
            attrs: {width: "116"}
        }), e._v(" "), i("col", {attrs: {width: "90"}})]), e._v(" "), i("thead", [i("tr", [i("th", [i("p", {staticClass: "td-table__text"}, [e._v("名称")])]), e._v(" "), i("th", [i("p", {staticClass: "td-table__text"}, [e._v("服务器")])]), e._v(" "), i("th", [i("p", {staticClass: "td-table__text"}, [e._v("端口")])]), e._v(" "), i("th", [i("p", {staticClass: "td-table__text"}, [e._v("类型")])])])])])])
    }, function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("colgroup", [t("col", {staticClass: "xly-setting__column-1"}), this._v(" "), t("col", {
            staticClass: "xly-setting__column-2",
            attrs: {width: "126"}
        }), this._v(" "), t("col", {
            staticClass: "xly-setting__column-3",
            attrs: {width: "116"}
        }), this._v(" "), t("col", {attrs: {width: "90"}})])
    }];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {staticClass: "xly-file-detail"}, [i("td-tabs", {
            staticClass: "xly-file-detail",
            attrs: {tabs: e.tabs, "active-key": e.activeKey},
            on: {
                "update:activeKey": function (t) {
                    e.activeKey = t
                }
            },
            scopedSlots: e._u([{
                key: "default", fn: function (t) {
                    var n = t.tab;
                    return [i(n.key, {
                        tag: "component",
                        attrs: {curTaskId: e.curTaskId, curUserId: e.curUserId, curCategoryid: e.curCategoryid},
                        on: {tabChange: e.onTabChange}
                    })]
                }
            }, {
                key: "title", fn: function (t) {
                    var n = t.tab;
                    return i("div", {domProps: {textContent: e._s(n.title)}})
                }
            }])
        })], 1)
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("div", {staticClass: "xly-down-header"}, [t("p", {staticClass: "xly-down-header__title"}, [this._v("\n    " + this._s(this.curTaskName) + "\n  ")])])
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {
            staticClass: "xly-file-source",
            class: {"is-show": e.showMore}
        }, [i("ul", {staticClass: "xly-file-source__items"}, [1 === e.panTaskType ? i("li", {staticClass: "xly-file-source__item"}, [i("p", {staticClass: "title"}, [e._v("云盘位置")]), e._v(" "), i("p", {staticClass: "detail"}, [e._v("登录领取2T空间，可极速播放")]), e._v(" "), i("td-button", {
            attrs: {size: "small"},
            on: {click: e.showLoginWnd}
        }, [e._v("立即领取")])], 1) : 2 === e.panTaskType ? i("li", {staticClass: "xly-file-source__item"}, [i("p", {staticClass: "title"}, [e._v("云盘位置")]), e._v(" "), i("p", {staticClass: "detail"}, [e._v("该资源无法保存到云盘")]), e._v(" "), i("td-button", {
            attrs: {
                size: "small",
                disabled: ""
            }
        }, [e._v("立即保存")])], 1) : 3 === e.panTaskType ? i("li", {staticClass: "xly-file-source__item"}, [i("p", {staticClass: "title"}, [e._v("云盘位置")]), e._v(" "), i("p", {staticClass: "detail"}, [e._v("保存到云盘，可随时查看")]), e._v(" "), i("td-button", {
            attrs: {size: "small"},
            on: {click: e.clickSave}
        }, [e._v("立即保存")])], 1) : 4 === e.panTaskType ? i("li", {staticClass: "xly-file-source__item"}, [i("p", {staticClass: "title"}, [e._v("云盘位置")]), e._v(" "), i("p", {staticClass: "detail"}, [e._v("我的云盘")]), e._v(" "), i("p", {staticClass: "warn"}, [e._v("空间不足 "), i("i", {
            staticClass: "xly-icon-refresh",
            attrs: {title: "刷新"},
            on: {click: e.refleshFreeSpace}
        })])]) : 5 === e.panTaskType ? i("li", {staticClass: "xly-file-source__item"}, [i("p", {staticClass: "title"}, [e._v("云盘位置")]), e._v(" "), i("p", {staticClass: "detail"}, [i("a", {
            staticClass: "address",
            attrs: {href: "javascript:;"},
            on: {click: e.onClickPath}
        }, [e._v(e._s(e.panTaskData.title))])]), e._v(" "), e.panFileId ? i("td-button", {
            attrs: {size: "small"},
            on: {click: e.consumePanTask}
        }, [e._v(e._s(e.isSupportPlay ? "流畅播放" : "查看"))]) : e._e(), e._v(" "), i("a", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: 100 !== e.panTaskProgress,
                expression: "panTaskProgress !== 100"
            }], staticClass: "td-button td-button--secondary td-button--small", attrs: {href: "javascript:;"}
        }, [i("td-progress", {attrs: {value: e.panTaskProgress}}), e._v(" "), i("span", [e._v("保存中" + e._s(e.panTaskProgress) + "%")])], 1)], 1) : e._e(), e._v(" "), i("li", {staticClass: "xly-file-source__item"}, [i("p", {staticClass: "title"}, [e._v("下载链接")]), e._v(" "), i("p", {staticClass: "detail"}, [e._v("\n        " + e._s(e.url || "暂无下载链接") + "\n      ")]), e._v(" "), "" !== e.url ? i("td-button", {
            staticClass: "td-button--other",
            attrs: {secondary: "", size: "small"},
            on: {
                click: function (t) {
                    e.copyLink(e.url)
                }
            }
        }, [e._v("复制链接")]) : e._e()], 1), e._v(" "), i("li", {staticClass: "xly-file-source__item"}, [i("p", {staticClass: "title"}, [e._v("网址记录")]), e._v(" "), i("p", {staticClass: "detail"}, [e._v(e._s(e.refUrl || "暂无网址记录"))]), e._v(" "), "" !== e.refUrl ? i("td-button", {
            staticClass: "td-button--other",
            attrs: {secondary: "", size: "small"},
            on: {click: e.openUrl}
        }, [e._v("打开网址")]) : e._e()], 1), e._v(" "), i("li", {staticClass: "xly-file-source__item"}, [i("p", {staticClass: "title"}, [e._v("保存目录")]), e._v(" "), i("p", {staticClass: "detail"}, [e._v(e._s(e.savePath))]), e._v(" "), i("td-button", {
            staticClass: "td-button--other",
            attrs: {secondary: "", size: "small"},
            on: {click: e.openDir}
        }, [e._v("打开目录")])], 1), e._v(" "), i("li", {staticClass: "xly-file-source__item"}, [i("p", {staticClass: "title"}, [e._v("特征码")]), e._v(" "), i("p", {staticClass: "detail"}, [e._v(e._s(e.signatureCode || "该任务暂无特征码") + " "), i("i", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.signatureCode,
                expression: "signatureCode"
            }], staticClass: "xly-icon-copy", attrs: {title: "复制"}, on: {
                click: function (t) {
                    e.copyLink(e.signatureCode, "signatureCode")
                }
            }
        }), e._v(" "), e.copyCodeSuccess ? i("span", {staticClass: "success"}, [i("i", {staticClass: "xly-icon-success"}), e._v("复制成功")]) : e._e()])]), e._v(" "), i("li", {staticClass: "xly-file-source__item"}, [i("p", {staticClass: "title"}, [e._v("创建时间")]), e._v(" "), i("p", {staticClass: "detail"}, [e._v(e._s(e.createTime))])]), e._v(" "), i("li", {staticClass: "xly-file-source__item"}, [i("p", {staticClass: "title"}, [e._v("下载历时")]), e._v(" "), i("p", {staticClass: "detail"}, [e._v(e._s(e.downloadTimeStr))])]), e._v(" "), i("li", {staticClass: "xly-file-source__item"}, [i("p", {staticClass: "title"}, [e._v("md5")]), e._v(" "), i("p", {staticClass: "detail"}, [e._v(e._s(e.md5) + " ")])]), e._v(" "), i("li", {staticClass: "xly-file-source__item"}, [i("p", {staticClass: "title"}, [e._v("注释")]), e._v(" "), i("p", {staticClass: "detail"}, [i("td-input", {
            attrs: {
                maxlength: "450",
                placeholder: "未填写"
            }, on: {blur: e.setDescription}, model: {
                value: e.description, callback: function (t) {
                    e.description = t
                }, expression: "description"
            }
        })], 1)])]), e._v(" "), i("div", {staticClass: "xly-file-source__more"}, [i("i", {
            staticClass: "xly-icon-arrow-down",
            on: {click: e.handleShow}
        })])])
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {staticClass: "xly-file-list"}, [i("td-table", {
            ref: "table",
            attrs: {
                columns: e.columns,
                data: e.tree,
                "default-checked-keys": e.defaultCheckedKeys,
                "disabled-keys": e.disabledKeys,
                checkable: "",
                "tree-enabled": "",
                "footer-enabled": ""
            },
            on: {
                "checked-change": e.onCheckedChange, checkAll: function (e) {
                }
            },
            scopedSlots: e._u([{
                key: "icon", fn: function (t) {
                    t.prop, t.value;
                    var n = t.row;
                    return [i("i", {staticClass: "xly-icon-type is-small", class: e.rowIcon(n)})]
                }
            }, {
                key: "default", fn: function (t) {
                    var n = t.prop, a = (t.value, t.row);
                    return ["name" === n ? [e._v(e._s(a.name))] : "fileSize" === n ? [e._v(e._s(e.formatSize(a.data.fileSize)))] : "progress" === n ? [a.data.errMessage ? [i("span", {
                        staticClass: "xly-file-list__status is-error",
                        attrs: {title: a.data.errMessage}
                    }, [e._v("\n            失败\n            "), i("td-tooltip", {
                        attrs: {
                            content: a.data.errMessage,
                            trigger: "hover"
                        }
                    }, [i("i", {staticClass: "xly-icon-note"})])], 1), e._v(" "), i("span", {staticClass: "xly-file-list__operate"}, [e._v("-")])] : a.data.isDelete ? [i("span", {staticClass: "xly-file-list__status"}, [e._v("已删除")]), e._v(" "), i("span", {staticClass: "xly-file-list__operate"}, [e._v("-")])] : "branch" === a.type ? [e.haveSelectItem(a) ? [a.data.isAllDownloadItemFinished && 1 === e.getProgress(a) ? [i("span", {staticClass: "xly-file-list__status"}, [e._v("完成")]), e._v(" "), i("span", {staticClass: "xly-file-list__operate"}, [e.isSupportPlay(a) ? i("i", {
                        staticClass: "xly-icon-play-small",
                        attrs: {title: "播放"},
                        on: {
                            click: function (t) {
                                e.playFile(a)
                            }
                        }
                    }) : i("i", {
                        staticClass: "xly-icon-open-small", attrs: {title: "打开文件夹"}, on: {
                            click: function (t) {
                                e.openDir(a)
                            }
                        }
                    })])] : 1 === e.getProgress(a) ? [i("span", {staticClass: "xly-file-list__status"}, [e._v("99.99%")]), e._v(" "), i("span", {staticClass: "xly-file-list__operate"}, [e.isSupportPlay(a) ? i("i", {
                        staticClass: "xly-icon-play-small",
                        attrs: {title: "播放"},
                        on: {
                            click: function (t) {
                                e.playFile(a)
                            }
                        }
                    }) : i("i", [e._v("-")])])] : [i("span", {staticClass: "xly-file-list__status"}, [e._v(e._s((100 * e.getProgress(a) || 0).toFixed(2)) + "%")]), e._v(" "), i("span", {staticClass: "xly-file-list__operate"}, [e.isSupportPlay(a) ? i("i", {
                        staticClass: "xly-icon-play-small",
                        attrs: {title: "播放"},
                        on: {
                            click: function (t) {
                                e.playFile(a)
                            }
                        }
                    }) : i("i", [e._v("-")])])]] : [i("span", {staticClass: "xly-file-list__status is-disabled"}, [e._v("不下载")]), e._v(" "), i("span", {staticClass: "xly-file-list__operate"}, [e._v("-")])]] : e.isComplete(a) ? [i("span", {staticClass: "xly-file-list__status"}, [e._v("完成")]), e._v(" "), i("span", {staticClass: "xly-file-list__operate"}, [e.playingCurTask && a.data.index === e.playingMediaIndex ? i("i", {staticClass: "xly-gif-playing"}) : e.isSupportPlay(a) ? i("i", {
                        staticClass: "xly-icon-play-small",
                        attrs: {title: "播放"},
                        on: {
                            click: function (t) {
                                e.playFile(a)
                            }
                        }
                    }) : i("i", {
                        staticClass: "xly-icon-file-small", attrs: {title: "打开文件"}, on: {
                            click: function (t) {
                                e.openFile(a)
                            }
                        }
                    })])] : e.checkedKeys.includes(a.key) ? [i("span", {staticClass: "xly-file-list__status"}, [e._v(e._s((100 * e.getProgress(a)).toFixed(2)) + "%")]), e._v(" "), i("span", {staticClass: "xly-file-list__operate"}, [e.isSupportPlay(a) ? e.playingCurTask && a.data.index === e.playingMediaIndex ? i("i", {staticClass: "xly-gif-playing"}) : i("i", {
                        staticClass: "xly-icon-play-small",
                        attrs: {title: "播放"},
                        on: {
                            click: function (t) {
                                e.playFile(a)
                            }
                        }
                    }) : i("i", [e._v("-")])])] : [i("span", {staticClass: "xly-file-list__status is-disabled"}, [e._v("不下载")]), e._v(" "), i("span", {staticClass: "xly-file-list__operate"}, [e._v("-")])]] : e._e()]
                }
            }])
        }, [i("td-button", {
            attrs: {
                slot: "footer",
                secondary: "",
                size: "small",
                disabled: !(e.selectedFailedSubFileRetryDownload || e.checkedKeys.length && e.editingSelected)
            }, on: {click: e.downloadSelected}, slot: "footer"
        }, [e._v("下载选中文件")])], 1)], 1)
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {staticClass: "xly-down-detail"}, [e.taskIds.length > 1 ? i("div", {staticClass: "xly-download-file is-more"}, [e.taskIds.length > 2 ? i("multi-chosen-item", {
            staticClass: "is-secondary",
            attrs: {taskId: e.taskIds[e.taskIds.length - 3]}
        }) : e._e(), e._v(" "), i("multi-chosen-item", {
            staticClass: "is-first",
            attrs: {taskId: e.taskIds[e.taskIds.length - 2]}
        }), e._v(" "), i("multi-chosen-item", {
            staticClass: "is-show",
            attrs: {taskId: e.taskIds[e.taskIds.length - 1]}
        })], 1) : e._e(), e._v(" "), i("div", {staticClass: "xly-down-detail__text"}, [i("p", [e._v("已选择" + e._s(e.taskIds.length) + "个项目")])]), e._v(" "), "Downloading" === e.curCategoryid ? i("div", {staticClass: "xly-down-detail__button"}, [e.hasStartedTask ? e._e() : i("button", {
            staticClass: "td-button td-button--other td-button--small",
            on: {click: e.start}
        }, [i("i", {staticClass: "xly-icon-download"}), e._v(" 全部下载")]), e._v(" "), e.hasStartedTask ? i("button", {
            staticClass: "td-button td-button--other td-button--small",
            on: {click: e.stop}
        }, [i("i", {staticClass: "xly-icon-pause"}), e._v(" 全部暂停")]) : e._e(), e._v(" "), i("button", {
            staticClass: "td-button td-button--other td-button--small",
            on: {click: e.remove}
        }, [i("i", {staticClass: "xly-icon-delete"}), e._v(" 删除")]), e._v(" "), i("button", {
            staticClass: "td-button td-button--other td-button--small",
            on: {click: e.copyLinks}
        }, [i("i", {staticClass: "xly-icon-copy"}), e._v(" 复制链接")]), e._v(" "), i("div", {staticClass: "xly-down-detail__more"}, [e._m(0), e._v(" "), i("div", {staticClass: "xly-more-drop"}, [i("ul", [i("li", {on: {click: e.move2Dir}}, [e._v("移动文件到")]), e._v(" "), i("li", {on: {click: e.copy2Dir}}, [e._v("复制文件到")])])])])]) : "Completed" === e.curCategoryid ? i("div", {staticClass: "xly-down-detail__button"}, [i("button", {
            staticClass: "td-button td-button--other td-button--small",
            on: {click: e.remove}
        }, [i("i", {staticClass: "xly-icon-delete"}), e._v(" 删除")]), e._v(" "), i("button", {
            staticClass: "td-button td-button--other td-button--small",
            on: {click: e.redownloadTask}
        }, [i("i", {staticClass: "xly-icon-download"}), e._v(" 重新下载")]), e._v(" "), i("button", {
            staticClass: "td-button td-button--other td-button--small",
            on: {click: e.copyLinks}
        }, [i("i", {staticClass: "xly-icon-copy"}), e._v(" 复制链接")]), e._v(" "), i("div", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.hasUnRemoveTask,
                expression: "hasUnRemoveTask"
            }], staticClass: "xly-down-detail__more"
        }, [e._m(1), e._v(" "), i("div", {staticClass: "xly-more-drop"}, [i("ul", [i("li", {on: {click: e.move2Dir}}, [e._v("移动文件到")]), e._v(" "), i("li", {on: {click: e.copy2Dir}}, [e._v("复制文件到")])])])])]) : "Recycle" === e.curCategoryid ? i("div", {staticClass: "xly-down-detail__button"}, [i("button", {
            staticClass: "td-button td-button--other td-button--small",
            on: {click: e.restore}
        }, [i("i", {staticClass: "xly-icon-restore"}), e._v(" 还原")]), e._v(" "), i("button", {
            staticClass: "td-button td-button--other td-button--small",
            on: {click: e.destroy}
        }, [i("i", {staticClass: "xly-icon-delete"}), e._v(" 彻底删除")]), e._v(" "), i("button", {
            staticClass: "td-button td-button--other td-button--small",
            on: {click: e.redownloadTask}
        }, [i("i", {staticClass: "xly-icon-download"}), e._v(" 重新下载")]), e._v(" "), i("button", {
            staticClass: "td-button td-button--other td-button--small",
            on: {click: e.copyLinks}
        }, [i("i", {staticClass: "xly-icon-copy"}), e._v(" 复制链接")])]) : e._e()])
    }, a = [function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("button", {staticClass: "td-button td-button--other td-button--small"}, [t("i", {staticClass: "xly-icon-more"}), this._v(" 更多")])
    }, function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("button", {staticClass: "td-button td-button--other td-button--small"}, [t("i", {staticClass: "xly-icon-more"}), this._v(" 更多")])
    }];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("td-list", {
            attrs: {
                list: e.loadedListWithKey,
                multiple: "",
                drop: "",
                sortable: e.sortable,
                sortByHandler: "",
                handleClassList: ["is-chosen", "is-active", "xly-side-operate", "xly-icon-type", "xly-file-error", "xly-file-size", "xly-file-percent", "xly-file-status", "xly-file-name"],
                "click-to-focus": e.sortable,
                "drag-selectable": "",
                "chosen-keys": e.selectedTaskIds,
                "load-more": e.loadMore,
                "scroll-speed": 6
            },
            on: {
                "update:chosenKeys": e.handleSelectChange,
                "update:list": e.handleListChange,
                "on-sorting": e.handleSorting,
                "on-sort-end": e.handleSortEnd
            },
            nativeOn: {
                scroll: function (t) {
                    return e.handleScroll(t)
                }
            },
            scopedSlots: e._u([{
                key: "default", fn: function (t) {
                    var n = t.item, a = t.index, o = t.chosen, r = t.active;
                    return [i(e.componentName, {
                        tag: "component",
                        attrs: {
                            enbaleVipPlugin: e.enbaleVipPlugin,
                            taskId: n.key,
                            itemType: e.itemType,
                            sharedKeyWords: e.sharedKeyWords,
                            pulseForRename: e.pulseForRename,
                            currentCategoryId: e.currentCategoryId,
                            currentCategoryViewId: e.currentCategoryViewId,
                            deleted: e.deleted[n.key],
                            opened: e.opened[n.key],
                            dataChecking: e.dataChecking[n.key],
                            chosen: o,
                            active: r,
                            index: a,
                            fileTransferTooltip: e.fileTransferTooltipVisible[n.key]
                        },
                        on: {
                            "update:deleted": function (t) {
                                e.$set(e.deleted, n.key, t)
                            }, "update:opened": function (t) {
                                e.$set(e.opened, n.key, t)
                            }, "update:dataChecking": function (t) {
                                e.$set(e.dataChecking, n.key, t)
                            }, "update:fileTransferTooltip": function (t) {
                                e.$set(e.fileTransferTooltipVisible, n.key, t)
                            }, dblclick: e.handleItemDbClick, "active-change": function (t) {
                                return e.handleActiveChange(t, a)
                            }, "active-nearby": e.handleActiveNearby
                        },
                        nativeOn: {
                            contextmenu: function (t) {
                                return t.stopPropagation(), e.handleContextMenu(t)
                            }
                        }
                    })]
                }
            }])
        })
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this.$createElement;
        return (this._self._c || e)("i", {class: this.classes, attrs: {title: this.text}})
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement;
        return (e._self._c || t)("td-select", e._g(e._b({
            ref: "select",
            attrs: {value: e.value, "custom-menu-enabled": ""},
            on: {"menu-show": e.handleMenuShow}
        }, "td-select", e.$attrs, !1), e.$listeners), [e._t("suffix", null, {slot: "suffix"}), e._v(" "), e._t("append", null, {slot: "append"})], 2)
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {class: e.item.outerClass}, [i("td-slider", {
            attrs: {
                value: e.sliderValue,
                marks: e.item.marks,
                scales: e.item.scales,
                disabled: e.disabled
            }, on: {input: e.handleSliderUpdate}
        }), e._v(" "), i("div", {staticClass: "xlx-dialog-setting__speed-input"}, [i("td-input", {
            ref: "input",
            staticClass: "xlx-setting__input-3",
            attrs: {value: e.value.value, disabled: e.disabled},
            on: {input: e.handleInput, blur: e.handleBlur}
        }), e._v(" "), i("popup", {
            ref: "tooltip",
            staticClass: "td-tooltip",
            attrs: {direction: "top", display: e.tooltipVisible, padding: 10},
            on: {
                "update:display": function (t) {
                    e.tooltipVisible = t
                }
            }
        }, [i("p", {staticClass: "td-tooltip__inner"}, [e._v(e._s(e.tooltip))])]), e._v(" "), i("span", {staticClass: "xlx-setting__text"}, [e._v("KB/s")])], 1)], 1)
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {staticClass: "xlx-dialog-setting__speed-time"}, [i("ul", e._l(e.data, function (t) {
            return i("li", {
                key: t.label,
                staticClass: "xlx-dialog-setting__item"
            }, [i("span", {staticClass: "xlx-dialog-setting__text"}, [e._v(e._s(t.label))]), e._v(" "), e._l(t.options, function (t) {
                return i("div", {
                    key: t.index,
                    staticClass: "xlx-dialog-setting__option"
                }, [i("select-native", {
                    staticClass: "xlx-select-size-1",
                    attrs: {
                        value: e.value[t.index].value.toString(),
                        options: "hour" === t.type ? e.hours : e.minutes,
                        disabled: e.disabled
                    },
                    on: {
                        input: function (i) {
                            return e.handleInput(i, t.index)
                        }
                    }
                }), e._v(" "), i("span", {staticClass: "xlx-dialog-setting__text"}, [e._v(e._s("hour" === t.type ? "时" : "分"))])], 1)
            })], 2)
        }))])
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {class: e.item.outerClass}, [i("ul", {class: e.item.ulClasses}, e._l(e.item.extEles, function (t, n) {
            return i("li", {key: n, class: e.item.classes}, [t ? i(t.type, {
                tag: "component",
                attrs: {
                    text: t.text,
                    item: t,
                    label: t && t.label,
                    classes: t.classes,
                    disabled: e.disabled,
                    name: t.name,
                    value: e.formData[t.name],
                    formData: e.formData
                },
                on: {input: e.handleInput}
            }) : e._e()], 1)
        })), e._v(" "), e.item.tip ? i("p", {class: e.item.tipClass}, [e._v(e._s(e.item.tip))]) : e._e()])
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {staticClass: "xlx-nav__item"}, [i("a", {
            staticClass: "xlx-nav-operate",
            class: {"is-disabled": e.disabled, "is-new": e.redDot},
            attrs: {href: "javascript:;", title: e.title},
            on: {click: e.handleClick, mouseenter: e.handleEnter}
        }, ["" === e.customClass ? i("img", {attrs: {src: e.imgSrc}}) : i("i", {class: e.customClass}), e._v(" "), e.newIcon ? i("i", {staticClass: "xlx-icon-new1"}) : e._e()]), e._v(" "), e.loading ? i("div", {
            staticClass: "connecting",
            on: {click: e.handleClick, mouseenter: e.handleEnter}
        }, [i("i", {staticClass: "xlx-icon-loading"})]) : e._e(), e._v(" "), e.tooltip ? i("div", {staticClass: "xlx-nav-tooltip"}, [i("div", {
            staticClass: "xlx-nav-tooltip__inner",
            on: {click: e.handleToolTipClick}
        }, [i("p", [e._v("\n        " + e._s(e.tooltipTitle) + "\n        "), i("br"), e._v(" "), i("span", [e._v(e._s(e.tooltipSubTitle))])])]), e._v(" "), i("a", {
            staticClass: "xlx-nav-tooltip__close",
            attrs: {href: "javascript:;"},
            on: {click: e.handleToolTipClose}
        }, [i("i", {staticClass: "td-icon-close"})])]) : e._e()])
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {staticClass: "xlx-nav__item"}, [i("a", {
            staticClass: "xlx-nav-operate",
            class: e.filterClass,
            attrs: {href: "javascript:;", title: e.handleTitle},
            on: {click: e.handleClick, mouseenter: e.handleEnter}
        }, ["" == e.vipIcon ? i("i", {class: e.id}) : i("img", {
            attrs: {src: e.vipIcon},
            on: {error: e.handleError}
        })])])
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("div", {
            ref: "playerArea",
            staticClass: "xly-preview",
            attrs: {id: "xly-task-detail-preview"}
        }, [this.loading ? t("div", {staticClass: "xly-preview__loading"}, [t("i", {staticClass: "img-icon-loading"}), this._v(" "), "Downloading" === this.curCategoryid ? t("p", [this._v("边下边播启动中...")]) : t("p", [this._v("播放启动中...")])]) : t("div", {
            staticClass: "xly-preview__play",
            on: {click: this.play}
        }, [t("i", {staticClass: "xly-icon-play-detail"})])])
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {staticClass: "xly-attribute"}, [i("div", {staticClass: "xly-attribute__chart"}, [e._m(0), e._v(" "), i("div", {staticClass: "xly-attribute__chart-text"}, [i("p", {staticClass: "title"}, [e._v("文件大小")]), e._v(" "), i("p", {staticClass: "number"}, [e._v(e._s(e.formatSize(e.fileSize)))])])]), e._v(" "), i("div", {staticClass: "xly-attribute__detail"}, [i("ul", [i("li", {staticClass: "xly-attribute__item"}, [i("span", {staticClass: "xly-attribute__tag xly-attribute__tag--natural"}), e._v(" "), i("span", {staticClass: "xly-attribute__text"}, [e._v("原始资源")]), e._v(" "), i("span", {staticClass: "xly-attribute__size"}, [e._v(e._s(e.originPercent) + "% "), i("i", {staticClass: "xly-line"}), e._v(" " + e._s(e.formatSize(e.originSize)))])]), e._v(" "), i("li", {staticClass: "xly-attribute__item"}, [i("span", {staticClass: "xly-attribute__tag xly-attribute__tag--mirror"}), e._v(" "), i("span", {staticClass: "xly-attribute__text"}, [e._v("镜像加速")]), e._v(" "), i("span", {staticClass: "xly-attribute__size"}, [e._v(e._s(e.p2sPercent) + "% "), i("i", {staticClass: "xly-line"}), e._v(" " + e._s(e.formatSize(e.p2sSize)))])]), e._v(" "), i("li", {staticClass: "xly-attribute__item"}, [i("span", {staticClass: "xly-attribute__tag xly-attribute__tag--p2p"}), e._v(" "), i("span", {staticClass: "xly-attribute__text"}, [e._v("P2P加速")]), e._v(" "), i("span", {staticClass: "xly-attribute__size"}, [e._v(e._s(e.p2pPercent) + "% "), i("i", {staticClass: "xly-line"}), e._v(" " + e._s(e.formatSize(e.p2pSize)))])]), e._v(" "), i("li", {staticClass: "xly-attribute__item"}, [i("span", {staticClass: "xly-attribute__tag xly-attribute__tag--vip"}), e._v(" "), i("span", {staticClass: "xly-attribute__text"}, [e._v("会员加速")]), e._v(" "), i("span", {staticClass: "xly-attribute__size"}, [e._v(e._s(e.offlinePercent) + "% "), i("i", {staticClass: "xly-line"}), e._v(" " + e._s(e.formatSize(e.offlineSize)))])])])])])
    }, a = [function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("div", {
            staticClass: "xly-attribute-pei",
            staticStyle: {
                "-webkit-tap-highlight-color": "transparent",
                "user-select": "none",
                background: "transparent"
            },
            attrs: {id: "chart", _echarts_instance_: "ec_1591328778127"}
        }, [t("div", {
            staticStyle: {
                position: "relative",
                overflow: "hidden",
                width: "200px",
                height: "200px",
                padding: "0px",
                margin: "0px",
                "border-width": "0px"
            }
        }, [t("canvas", {
            staticStyle: {
                position: "absolute",
                left: "0px",
                top: "0px",
                width: "200px",
                height: "200px",
                "user-select": "none",
                "-webkit-tap-highlight-color": "rgba(0, 0, 0, 0)",
                padding: "0px",
                margin: "0px",
                "border-width": "0px"
            }, attrs: {width: "200", height: "200", "data-zr-dom-id": "zr_0"}
        })])])
    }];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {
            ref: "canvasBox", staticClass: "xly-chart-curve", on: {
                mouseover: function (t) {
                    e.$emit("setShowHoverLabel", !0), e.showCurveCutLine = !0
                }, mouseleave: function (t) {
                    e.$emit("setShowHoverLabel", !1), e.showCurveCutLine = !1
                }
            }
        }, [i("div", {staticClass: "xly-chart-curve__canvas"}, [i("canvas", {
            ref: "dataChart",
            staticClass: "canvas-data",
            style: "transform: scale(" + 1 / e.scale + "); top: " + e.topMargin + "px",
            attrs: {id: "dataChart"}
        }), e._v(" "), i("div", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: 5 === e.curTaskStatus,
                expression: "curTaskStatus === 5"
            }],
            staticClass: "xly-chart-curve__line",
            class: {"is-vip": e.isVip},
            style: "left: " + e.curveLeft + "px; top: " + e.curveTop + "px"
        }), e._v(" "), i("div", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: 5 === e.curTaskStatus,
                expression: "curTaskStatus === 5"
            }],
            staticClass: "xly-chart-curve__point",
            class: {"is-vip": e.isVip},
            style: "left: " + e.curveLeft + "px; top: " + e.curveTop + "px"
        }), e._v(" "), i("div", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: 5 === e.curTaskStatus,
                expression: "curTaskStatus === 5"
            }], staticClass: "xly-chart-curve__number", style: "top: " + e.curveTop + "px"
        }, [e._v("速度：" + e._s(e.formatSize(e.downloadSpeed)) + "/s")])]), e._v(" "), i("div", {staticClass: "xly-chart-curve__operate"}, [[7, 9].includes(e.curTaskStatus) && e.curTaskErrorType ? i("div", {staticClass: "xly-chart-curve__tips"}, [i("i", {staticClass: "xly-icon-note"}), e._v(" " + e._s(e.curTaskErrorType) + "\n    ")]) : "Recycle" === e.curTaskCategoryviewId ? i("button", {
            staticClass: "td-button",
            on: {
                click: function (t) {
                    e.operate("restore")
                }
            }
        }, [i("i", {staticClass: "xly-icon-restore"}), e._v(" 还原\n    ")]) : "Completed" !== e.curTaskCategoryviewId || e.taskFileExist ? "Downloading" === e.curTaskCategoryviewId && 7 === e.curTaskStatus ? i("button", {
            staticClass: "td-button",
            on: {
                click: function (t) {
                    e.operate("continue")
                }
            }
        }, [i("i", {staticClass: "xly-icon-download"}), e._v(" 继续下载\n    ")]) : "Completed" === e.curTaskCategoryviewId && e.isSupportPlay ? i("button", {
            staticClass: "td-button",
            on: {
                click: function (t) {
                    e.operate("play")
                }
            }
        }, [i("i", {staticClass: "xly-icon-play"}), e._v(" 播放\n    ")]) : "Completed" !== e.curTaskCategoryviewId || e.isBtOrGroup ? "Completed" === e.curTaskCategoryviewId && e.isBtOrGroup ? i("button", {
            staticClass: "td-button",
            on: {
                click: function (t) {
                    e.operate("openFolder")
                }
            }
        }, [i("i", {staticClass: "xly-icon-open"}), e._v(" 打开文件夹\n    ")]) : e._e() : i("button", {
            staticClass: "td-button",
            on: {
                click: function (t) {
                    e.operate("open")
                }
            }
        }, [i("i", {staticClass: "xly-icon-open"}), e._v(" 打开文件\n    ")]) : i("div", {staticClass: "xly-chart-curve__tips"}, [i("i", {staticClass: "xly-icon-note"}), e._v(" 文件已删除\n    ")])]), e._v(" "), i("div", {staticClass: "xly-chart-curve__info"}, [i("div", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: !(e.isFast || e.showCurveCutLine && e.curTaskIsTryTask),
                expression: "!isFast && (!showCurveCutLine || !curTaskIsTryTask)"
            }], staticClass: "xly-chart-curve__data"
        }, [i("p", [e._v("下载进度"), i("span", [e._v(e._s(e.progress) + "%")])]), e._v(" "), i("i", {staticClass: "xly-line"}), e._v(" "), [8, 10].includes(e.curTaskStatus) ? i("p", [e._v("平均速度"), i("span", [e._v(" " + e._s(e.formatSize(e.avgSpeed)) + "/s ")])]) : i("p", {staticClass: "data-time"}, [e._v(e._s(e.remain))]), e._v(" "), i("i", {staticClass: "xly-line"}), e._v(" "), [8, 10].includes(e.curTaskStatus) ? i("p", [e._v("峰值速度"), i("span", [e._v(" " + e._s(e.formatSize(e.maxSpeed)) + "/s ")])]) : i("p", [e._v("资源数"), i("span", [e._v(e._s(e.srcUsing) + "/" + e._s(e.srcTotal))])])]), e._v(" "), i("div", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.isFast && (!e.showCurveCutLine || !e.curTaskIsTryTask),
                expression: "isFast && (!showCurveCutLine || !curTaskIsTryTask)"
            }], staticClass: "xly-chart-curve__fast"
        }, [i("p", [e._v("恭喜你，解锁【秒下】成就")])]), e._v(" "), i("div", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.curTaskIsTryTask && e.showCurveCutLine,
                expression: "curTaskIsTryTask && showCurveCutLine"
            }], staticClass: "xly-chart-curve__data"
        }, [i("span", {staticClass: "novip"}), i("p", [e._v("非会员")]), e._v(" "), i("i", {staticClass: "xly-line"}), e._v(" "), i("span", {staticClass: "vip"}), i("p", [e._v("白金会员")]), e._v(" "), i("i", {staticClass: "xly-line"}), e._v(" "), i("span", {staticClass: "svip"}), i("p", [e._v("超级会员")])])])])
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {staticClass: "td-media"}, [i("div", {staticClass: "td-media__object"}, [i("i", {
            staticClass: "xly-icon-type",
            class: e.iconType
        })]), e._v(" "), i("div", {staticClass: "td-media__content"}, [i("p", {staticClass: "xly-file-name"}, [e._v(e._s(e.taskName))]), e._v(" "), i("div", {staticClass: "xly-file-info"}, [i("p", {staticClass: "xly-file-size"}, [e._v(e._s(e.fileSize))]), e._v(" "), i("p", {staticClass: "xly-file-time"}, [e._v(e._s(e.displayTime))])])])])
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {
            staticClass: "xly-side-item",
            class: {"is-vip": e.isSuperVip}
        }, [i("div", {staticClass: "xly-side-wrapper"}, [i("td-media", {
            nativeOn: {
                dblclick: function (t) {
                    return t.stopPropagation(), e.handleDbClick(t)
                }, mouseover: function (t) {
                    return e.handleItemMouseHover(t)
                }, mouseout: function (t) {
                    return e.handleItemMouseOut(t)
                }
            }
        }, [i("template", {slot: "media"}, [i("i", {
            staticClass: "xly-icon-type",
            class: e.fileTypeClass,
            on: {mouseover: e.handleIconMouseHover}
        })]), e._v(" "), i("p", {
            staticClass: "xly-file-name",
            style: e.fileNameDefaultCursor,
            attrs: {title: e.titleOverFlow},
            domProps: {innerHTML: e._s(e.taskName)},
            on: {
                mouseover: function (t) {
                    return t.target !== t.currentTarget ? null : e.handleTaskNameMouseOver(t)
                }
            }
        }), e._v(" "), i("div", {staticClass: "xly-side-operate"}, [e.isForbidden ? [i("a", {
            staticClass: "xly-side-operate__button",
            attrs: {href: "javascript:;", title: "彻底删除"},
            on: {
                mousedown: function (e) {
                    e.stopPropagation()
                }, click: function (t) {
                    return t.stopPropagation(), e.handleDestroyTask(t)
                }
            }
        }, [i("i", {staticClass: "xly-icon-clear"})])] : [i("a", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.canStart,
                expression: "canStart"
            }],
            staticClass: "xly-side-operate__button",
            attrs: {href: "javascript:;", title: "下载"},
            on: {
                mousedown: function (e) {
                    e.stopPropagation()
                }, click: e.handleStartTask
            }
        }, [i("i", {staticClass: "xly-icon-download"})]), e._v(" "), i("a", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.canPause,
                expression: "canPause"
            }],
            staticClass: "xly-side-operate__button",
            attrs: {href: "javascript:;", title: "暂停"},
            on: {
                mousedown: function (e) {
                    e.stopPropagation()
                }, click: e.handlePauseTask
            }
        }, [i("i", {staticClass: "xly-icon-pause"})])]], 2), e._v(" "), i("div", {staticClass: "xly-file-info"}, [e.taskError ? [i("p", {staticClass: "xly-file-error"}, [e._v(e._s(e.errInfo))])] : e.showStartTemplate ? [i("p", {staticClass: "xly-file-size"}, [i("td-tooltip", {
            attrs: {
                content: "正在获取全部文件大小",
                offset: {x: -5},
                visible: e.isQuerying,
                placement: "bottom"
            }
        }, [i("span", {
            staticClass: "xly-file-size__total", on: {
                mouseover: function (t) {
                    e.onShowQueryTip(!0)
                }, mouseout: function (t) {
                    e.onShowQueryTip(!1)
                }
            }
        }, [e._v(e._s(e.fileSizeFormat))])])], 1), e._v(" "), i("p", {staticClass: "xly-file-time"}, [e._v(e._s(e.remain))]), e._v(" "), i("div", {staticClass: "xly-file-speed"}, [i("span", {staticClass: "xly-file-speed__total"}, [e._v(e._s(e.taskStatusSpeedInfo))]), e._v(" "), e.dataValidating ? e._e() : [e.enbaleVipPlugin ? i("ItemVipSpeedPlugin", {
            attrs: {
                taskBase: e.taskBase,
                hover: e.hover,
                startStatusPrompt: e.startStatusPrompt,
                active: e.active,
                vipSpeedInfo: e.vipSpeedInfo
            }
        }) : e._e()], e._v(" "), e.vipSpeedInfo && e.vipSpeedInfo.isHuddle ? i("span", {
            staticClass: "xly-file-together",
            attrs: {title: "抱团下载中"}
        }) : e._e(), e._v(" "), e.vipSpeedInfo && e.vipSpeedInfo.isSensitive ? i("div", {staticClass: "xly-file-speed__note"}, [i("i", {staticClass: "xly-icon-note"}), e._v(" "), i("div", {
            staticClass: "xly-file-speed__tips",
            attrs: {slot: "content"},
            slot: "content"
        }, [e._v("\n                " + e._s(e.vipSpeedInfo.sensitive && e.vipSpeedInfo.sensitive.context || "") + " \n                "), i("a", {
            attrs: {href: "javascript:;"},
            on: {
                click: function (t) {
                    return t.stopPropagation(), e.handleClickSensitive(t)
                }
            }
        }, [e._v("\n                  " + e._s(e.vipSpeedInfo.sensitive && e.vipSpeedInfo.sensitive.link || "") + "\n                ")])])]) : e._e()], 2)] : [i("p", {staticClass: "xly-file-size"}, [i("span", {staticClass: "xly-file-size__finish"}, [e._v(e._s(e.downloadSizeFormat))]), e._v(" "), i("span", {staticClass: "xly-file-size__separator"}, [e._v("/")]), e._v(" "), i("td-tooltip", {
            attrs: {
                content: "正在获取全部文件大小",
                offset: {x: -5},
                visible: e.isQuerying,
                placement: "bottom"
            }
        }, [i("span", {
            staticClass: "ly-file-size__total", on: {
                mouseover: function (t) {
                    e.onShowQueryTip(!0)
                }, mouseout: function (t) {
                    e.onShowQueryTip(!1)
                }
            }
        }, [e._v(e._s(e.fileSizeFormat))])])], 1), e._v(" "), i("p", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.percentVisible,
                expression: "percentVisible"
            }], staticClass: "xly-file-percent"
        }, [e._v(e._s(e.progressPercent))]), e._v(" "), i("p", {staticClass: "xly-file-status"}, [e._v("\n            " + e._s(e.taskStatusSpeedInfo) + "\n            "), e.enbaleVipPlugin ? i("ItemVipSpeedPlugin", {
            attrs: {
                taskBase: e.taskBase,
                hover: e.hover,
                active: e.active,
                vipSpeedInfo: e.vipSpeedInfo
            }
        }) : e._e()], 1)]], 2), e._v(" "), i("td-progress", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: !e.taskError,
                expression: "!taskError"
            }], attrs: {value: e.progress}
        })], 2), e._v(" "), i("div", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.isShowExpand,
                expression: "isShowExpand"
            }], staticClass: "xly-side-ad"
        }, [i("div", {
            staticClass: "xly-side-ad__image",
            attrs: {title: e.vipSpeedInfo && e.vipSpeedInfo.huddle && e.vipSpeedInfo.huddle.title || ""}
        }, [e.vipSpeedInfo && e.vipSpeedInfo.huddle && e.vipSpeedInfo.huddle.imgSrc ? i("img", {
            staticClass: "xly-side-ad__together",
            attrs: {src: e.vipSpeedInfo && e.vipSpeedInfo.huddle && e.vipSpeedInfo.huddle.imgSrc || ""},
            on: {
                click: function (t) {
                    return t.stopPropagation(), e.handleGroupAccelerateClick(t)
                }, mousedown: function (e) {
                    e.stopPropagation()
                }
            }
        }) : e._e()]), e._v(" "), e.enbaleVipPlugin ? i("div", {
            staticClass: "xly-plugin-vip"
        }) : e._e()])], 1)])
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {
            staticClass: "xly-side-item", on: {
                mouseenter: function (t) {
                    e.isShowShouleiFileTransfer = !0
                }, mouseleave: function (t) {
                    e.isShowShouleiFileTransfer = !1
                }
            }
        }, [i("div", {staticClass: "xly-side-wrapper"}, [i("td-media", {
            nativeOn: {
                dblclick: function (t) {
                    return e.handleDbClick(t)
                }
            }
        }, [i("i", {
            class: e.fileTypeClass,
            style: e.isInstallFileIcon ? {
                background: "url(" + e.installFileIcon + ")",
                "background-size": "100% 100%"
            } : {},
            attrs: {slot: "media"},
            slot: "media"
        }), e._v(" "), i("p", {
            staticClass: "xly-file-name",
            style: e.fileNameDefaultCursor,
            attrs: {title: e.titleOverFlow},
            domProps: {innerHTML: e._s(e.taskName)},
            on: {
                mouseover: function (t) {
                    return t.target !== t.currentTarget ? null : e.handleTaskNameMouseOver(t)
                }
            }
        }), e._v(" "), i("div", {staticClass: "xly-side-operate"}, [e.canPlay ? i("a", {
            staticClass: "xly-side-operate__button",
            attrs: {href: "javascript:;", title: "播放"},
            on: {
                mousedown: function (e) {
                    e.stopPropagation()
                }, click: function (t) {
                    return t.stopPropagation(), e.handlePlayTask(t)
                }
            }
        }, [i("i", {staticClass: "xly-icon-play"})]) : e._e(), e._v(" "), e.deleted ? i("a", {
            staticClass: "xly-side-operate__button",
            attrs: {href: "javascript:;", title: "删除任务记录"},
            on: {
                mousedown: function (e) {
                    e.stopPropagation()
                }, click: function (t) {
                    return t.stopPropagation(), e.handleDestroyTask(t)
                }
            }
        }, [i("i", {staticClass: "xly-icon-clear"})]) : e.canPlay ? e._e() : i("a", {
            staticClass: "xly-side-operate__button",
            attrs: {href: "javascript:;", title: "打开文件夹"},
            on: {
                mousedown: function (e) {
                    e.stopPropagation()
                }, click: function (t) {
                    return t.stopPropagation(), e.handleOpenFile(t)
                }
            }
        }, [i("i", {staticClass: "xly-icon-open"})])]), e._v(" "), i("div", {staticClass: "xly-file-info"}, [i("p", {staticClass: "xly-file-size"}, [i("span", {staticClass: "xly-file-size__total"}, [e._v(e._s(e.fileSizeFormat))])]), e._v(" "), i("p", {staticClass: "xly-file-time"}, [e._v(e._s(e.completeTime))]), e._v(" "), e.deleted ? i("p", {staticClass: "xly-file-status"}, [e._v("文件已移除")]) : e._e()])])], 1)])
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return i("div", {staticClass: "xly-side-item"}, [i("div", {staticClass: "xly-side-wrapper"}, [i("td-media", {
            nativeOn: {
                dblclick: function (t) {
                    return e.handleDbClick(t)
                }
            }
        }, [i("i", {
            staticClass: "xly-icon-type",
            class: e.fileTypeClass,
            style: e.isFileIcon ? {background: "url(" + e.fileIcon + ")", "background-size": "100% 100%"} : {},
            attrs: {slot: "media"},
            slot: "media"
        }), e._v(" "), i("p", {
            staticClass: "xly-file-name",
            style: e.fileNameDefaultCursor,
            attrs: {title: e.titleOverFlow},
            domProps: {innerHTML: e._s(e.taskName)},
            on: {
                mouseover: function (t) {
                    return t.target !== t.currentTarget ? null : e.handleTaskNameMouseOver(t)
                }
            }
        }), e._v(" "), i("div", {staticClass: "xly-side-operate"}, [i("a", {
            staticClass: "xly-side-operate__button",
            attrs: {href: "javascript:;", title: "还原"},
            on: {
                mousedown: function (e) {
                    e.stopPropagation()
                }, click: function (t) {
                    return t.stopPropagation(), e.handleRestore(t)
                }
            }
        }, [i("i", {staticClass: "xly-icon-restore"})])]), e._v(" "), i("div", {staticClass: "xly-file-info"}, [i("p", {staticClass: "xly-file-size"}, [i("span", {staticClass: "xly-file-size__total"}, [e._v(e._s(e.fileSizeFormat))])]), e._v(" "), i("p", {staticClass: "xly-file-time"}, [e._v(e._s(e.creationTime))])])])], 1)])
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    var n = function () {
        var e = this, t = e.$createElement, i = e._self._c || t;
        return e.isShowVipSpeed ? i("a", {
            staticClass: "xly-file-speed__vip",
            attrs: {href: "javascript:;"}
        }, [e._v(e._s(e.vipSpeed))]) : i("a", {
            directives: [{
                name: "show",
                rawName: "v-show",
                value: e.isShowVipHover,
                expression: "isShowVipHover"
            }], staticClass: "xly-file-speed__vip-link", attrs: {href: "javascript:;"}, on: {
                mousedown: function (e) {
                    e.stopPropagation()
                }, click: function (t) {
                    return t.stopPropagation(), e.clickVipLink(t)
                }
            }
        }, [e._v(e._s(e.hoverText))])
    }, a = [];
    n._withStripped = !0, i.d(t, "a", function () {
        return n
    }), i.d(t, "b", function () {
        return a
    })
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(398), a = i(19);
    t.Parser = class extends a.EventEmitter {
        constructor() {
            super(), this.decoder = new n.StringDecoder("utf8"), this.jsonBuffer = ""
        }

        encode(e) {
            return JSON.stringify(e) + "\n"
        }

        feed(e) {
            let t = this.jsonBuffer, i = 0, n = (t += this.decoder.write(e)).indexOf("\n", i);
            for (; n >= 0;) {
                const e = t.slice(i, n), a = JSON.parse(e);
                this.emit("message", a), i = n + 1, n = t.indexOf("\n", i)
            }
            this.jsonBuffer = t.slice(i)
        }
    }
}, function (e, t) {
    e.exports = require("string_decoder")
}, function (e, t, i) {
    "use strict";
    const n = i(106);
    if ("renderer" === process.type) {
        if (n.info("client running"), !global.__xdasAsyncRemoteExports) {
            let e = {};
            global.__xdasAsyncRemoteExports = e;
            let t = i(470);
            e.require = t.require, e.getCurrentWebContents = t.getCurrentWebContents, e.getCurrentWindow = t.getCurrentWindow, e.Interest = t.Interest, e.global = new Proxy({}, {get: (e, i, n) => t.getGlobal(i)}), e.electron = new Proxy({}, {get: (e, i, n) => t.getBuiltin(i)}), Object.defineProperty(e, "currentWindow", {get: () => t.getCurrentWindow()}), Object.defineProperty(e, "currentWebContents", {get: () => t.getCurrentWebContents()}), Object.defineProperty(e, "process", {get: () => t.getGlobal("process")})
        }
    } else if ("browser" === process.type && (n.info("server running"), !global.__xdasAsyncRemoteExports)) {
        let e = {};
        global.__xdasAsyncRemoteExports = e;
        const t = i(474);
        t.startServer(), e.getObjectRegistry = t.getObjectRegistry
    }
    e.exports = global.__xdasAsyncRemoteExports
}, function (e, t) {
    e.exports = require("buffer")
}, function (e, t, i) {
    "use strict";
    var n;
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        let t, i;
        !function (e) {
            e.require = "AR_BROWSER_REQUIRE", e.builtIn = "AR_BROWSER_GET_BUILTIN", e.global = "AR_BROWSER_GET_GLOBAL", e.functionCall = "AR_BROWSER_FUNCTION_CALL", e.construct = "AR_BROWSER_CONSTRUCTOR", e.memberConstruct = "AR_BROWSER_MEMBER_CONSTRUCTOR", e.memberCall = "AR_BROWSER_MEMBER_CALL", e.memberSet = "AR_BROWSER_MEMBER_SET", e.memberGet = "AR_BROWSER_MEMBER_GET", e.currentWindow = "AR_BROWSER_CURRENT_WINDOW", e.currentWebContents = "AR_BROWSER_CURRENT_WEB_CONTENTS", e.clientWebContents = "AR_BROWSER_CLIENT_WEB_CONTENTS", e.sync = "AR_BROWSER_SYNC", e.contextRelease = "AR_BROWSER_CONTEXT_RELEASE"
        }(t = e.browser || (e.browser = {})), function (e) {
            e.requireReturn = "AR_RENDERER_REQUIRE_RETURN", e.getBuiltInReturn = "AR_RENDERER_BUILTIN_RETURN", e.getGlobalReturn = "AR_RENDERER_GLOBAL_RETURN", e.functionCallReturn = "AR_RENDERER_FUNCTION_CALL_RETURN", e.memberConstructReturn = "AR_RENDERER_MEMBER_CONSTRUCTOR_RETURN", e.constructReturn = "AR_RENDERER_CONSTRUCTOR_RETURN", e.memberCallReturn = "AR_RENDERER_MEMBER_CALL_RETURN", e.memberSetReturn = "AR_RENDERER_MEMBER_SET_RETURN", e.memberGetReturn = "AR_RENDERER_MEMBER_GET_RETURN", e.currentWindowReturn = "AR_BROWSER_CURRENT_WINDOW_RETURN", e.currentWebContentsReturn = "AR_RENDERER_CURRENT_WEB_CONTENTS_RETURN", e.clientWebContentsReturn = "AR_RENDERER_CLIENT_WEB_CONTENTS_RETURN", e.syncReturn = "AR_RENDERER_SYNC_RETURN", e.callback = "AR_RENDERER_CALLBACK"
        }(i = e.renderer || (e.renderer = {}))
    }(n || (n = {})), t.default = n
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(3), a = i(31), o = i(299), r = i(75), s = i(0).default.getLogger("DownloadKernel.Category");

    class l {
        constructor(e) {
            this.categoryViews = [], this.id = e, this.parentId = -1, this.nextId = -1, this.status = 0
        }

        getCategoryViews() {
            return this.categoryViews
        }

        getCategoryViewCount() {
            return this.categoryViews.length
        }

        getCategoryViewFromId(e) {
            let t = null;
            for (let i = 0; i < this.categoryViews.length; ++i) {
                let n = this.categoryViews[i];
                if (n) {
                    if (e === n.getCategoryViewId()) {
                        t = n;
                        break
                    }
                }
            }
            return t
        }

        getId() {
            return this.id
        }

        setParentId(e) {
            e && (this.parentId = e)
        }

        getParentId() {
            return this.parentId
        }

        setNextId(e) {
            e && (this.nextId = e)
        }

        getNextId() {
            return this.nextId
        }

        setStatus(e) {
            e && (this.status = e)
        }

        getStatus() {
            return this.status
        }

        setName(e) {
            this.name = e
        }

        getName() {
            return this.name
        }

        setDescription(e) {
            this.description = e
        }

        getDescription() {
            return this.description
        }

        setDefaultPath(e) {
            this.defaultPath = e
        }

        getDefaultPath() {
            return this.defaultPath
        }

        setUserName(e) {
            this.userName = e
        }

        getUserName() {
            return this.userName
        }

        setPassword(e, t = "", i = !1, n = null) {
            if (this.password = e, "" !== this.password && "" === t) {
                let e = r.createHash("md5");
                e.update(this.password), t = e.digest("hex")
            }
            this.passwordV2 = t, i && a.ThunderKernel.setCategoryPassword(this.id, this.password, this.passwordV2, n)
        }

        getPassword() {
            return this.password
        }

        getPasswordV2() {
            return this.passwordV2
        }

        setAccountPassword(e) {
            this.accountPassword !== e && (this.accountPassword = e)
        }

        getAccountPassword() {
            return this.accountPassword
        }

        getCategoryData() {
            return {
                categoryId: this.id,
                parentId: this.parentId,
                nextId: this.nextId,
                status: this.status,
                name: this.name,
                description: this.description,
                defaultPath: this.defaultPath,
                userName: this.userName,
                password: this.password,
                passwordV2: this.passwordV2,
                accountPassword: this.accountPassword
            }
        }
    }

    t.Category = l;

    class d extends l {
        constructor(e) {
            super(e);
            let t = new o.CategoryView(e, n.DownloadKernel.CategroyViewID.Downloading),
                i = new o.CategoryView(e, n.DownloadKernel.CategroyViewID.Completed),
                a = new o.CategoryView(e, n.DownloadKernel.CategroyViewID.Recycle);
            this.categoryViews.push(t), this.categoryViews.push(i), this.categoryViews.push(a)
        }

        static createCategoryFromData(e) {
            let t = e.categoryId;
            if (void 0 === t || t < 0) return null;
            s.information("createCategoryFromData ", e);
            let i = new d(t);
            return i.setName(e.name), i.setParentId(e.parentId), i.setNextId(e.nextId), i.setStatus(e.status), i.setDescription(e.description), i.setDefaultPath(e.defaultPath), i.setUserName(e.userName), i.setPassword(e.password, e.passwordV2), i.setAccountPassword(e.accountPassword), i
        }
    }

    t.CommonCategory = d
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(18);
    !function (e) {
        let t = !1, o = [];
        e.initBtTaskTrackers = function () {
            return n(this, void 0, void 0, function* () {
                if (!t) {
                    t = !0;
                    let e = null;
                    try {
                        a.default.defaults.adapter = i(21), e = yield a.default.get("http://plugin.xl7.xunlei.com/7.9/normal/trackers.json")
                    } catch (e) {
                    }
                    if (null !== e && 200 === e.status && e.data && "" !== e.data && e.data.trackers && e.data.trackers.tracker) for (let t = 0; t < e.data.trackers.tracker.length; ++t) {
                        let i = e.data.trackers.tracker[t];
                        i && "" !== i && o.push(i)
                    }
                }
            })
        }, e.getExtraTracks = function () {
            return o
        }
    }(t.BTExtraTrackNS || (t.BTExtraTrackNS = {}))
}, function (e, t, i) {
    "use strict";
    e.exports = function (e, t) {
        return function () {
            for (var i = new Array(arguments.length), n = 0; n < i.length; n++) i[n] = arguments[n];
            return e.apply(t, i)
        }
    }
}, function (e, t, i) {
    "use strict";
    var n = i(301);
    e.exports = function (e, t, i) {
        var a = i.config.validateStatus;
        i.status && a && !a(i.status) ? t(n("Request failed with status code " + i.status, i.config, null, i.request, i)) : e(i)
    }
}, function (e, t, i) {
    "use strict";
    e.exports = function (e, t, i, n, a) {
        return e.config = t, i && (e.code = i), e.request = n, e.response = a, e
    }
}, function (e, t, i) {
    "use strict";
    var n = i(48);

    function a(e) {
        return encodeURIComponent(e).replace(/%40/gi, "@").replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]")
    }

    e.exports = function (e, t, i) {
        if (!t) return e;
        var o;
        if (i) o = i(t); else if (n.isURLSearchParams(t)) o = t.toString(); else {
            var r = [];
            n.forEach(t, function (e, t) {
                null !== e && void 0 !== e && (n.isArray(e) ? t += "[]" : e = [e], n.forEach(e, function (e) {
                    n.isDate(e) ? e = e.toISOString() : n.isObject(e) && (e = JSON.stringify(e)), r.push(a(t) + "=" + a(e))
                }))
            }), o = r.join("&")
        }
        return o && (e += (-1 === e.indexOf("?") ? "?" : "&") + o), e
    }
}, function (e, t, i) {
    var n = i(44), a = i(87), o = i(302), r = i(502), s = i(409).Writable, l = i(503)("follow-redirects"),
        d = {GET: !0, HEAD: !0, OPTIONS: !0, TRACE: !0}, u = Object.create(null);

    function c(e, t) {
        s.call(this), e.headers = e.headers || {}, this._options = e, this._redirectCount = 0, this._requestBodyLength = 0, this._requestBodyBuffers = [], t && this.on("response", t);
        var i = this;
        if (this._onNativeResponse = function (e) {
            i._processResponse(e)
        }, !e.pathname && e.path) {
            var n = e.path.indexOf("?");
            n < 0 ? e.pathname = e.path : (e.pathname = e.path.substring(0, n), e.search = e.path.substring(n))
        }
        this._performRequest()
    }

    function h(e) {
        var t = {maxRedirects: 21, maxBodyLength: 10485760}, i = {};
        return Object.keys(e).forEach(function (a) {
            var o = a + ":", s = i[o] = e[a], d = t[a] = Object.create(s);
            d.request = function (e, a) {
                return "string" == typeof e ? (e = n.parse(e)).maxRedirects = t.maxRedirects : e = Object.assign({
                    protocol: o,
                    maxRedirects: t.maxRedirects,
                    maxBodyLength: t.maxBodyLength
                }, e), e.nativeProtocols = i, r.equal(e.protocol, o, "protocol mismatch"), l("options", e), new c(e, a)
            }, d.get = function (e, t) {
                var i = d.request(e, t);
                return i.end(), i
            }
        }), t
    }

    ["abort", "aborted", "error", "socket", "timeout"].forEach(function (e) {
        u[e] = function (t) {
            this._redirectable.emit(e, t)
        }
    }), c.prototype = Object.create(s.prototype), c.prototype.write = function (e, t, i) {
        this._requestBodyLength + e.length <= this._options.maxBodyLength ? (this._requestBodyLength += e.length, this._requestBodyBuffers.push({
            data: e,
            encoding: t
        }), this._currentRequest.write(e, t, i)) : (this.emit("error", new Error("Request body larger than maxBodyLength limit")), this.abort())
    }, c.prototype.end = function (e, t, i) {
        var n = this._currentRequest;
        e ? this.write(e, t, function () {
            n.end(null, null, i)
        }) : n.end(null, null, i)
    }, c.prototype.setHeader = function (e, t) {
        this._options.headers[e] = t, this._currentRequest.setHeader(e, t)
    }, c.prototype.removeHeader = function (e) {
        delete this._options.headers[e], this._currentRequest.removeHeader(e)
    }, ["abort", "flushHeaders", "getHeader", "setNoDelay", "setSocketKeepAlive", "setTimeout"].forEach(function (e) {
        c.prototype[e] = function (t, i) {
            return this._currentRequest[e](t, i)
        }
    }), ["aborted", "connection", "socket"].forEach(function (e) {
        Object.defineProperty(c.prototype, e, {
            get: function () {
                return this._currentRequest[e]
            }
        })
    }), c.prototype._performRequest = function () {
        var e = this._options.protocol, t = this._options.nativeProtocols[e];
        if (this._options.agents) {
            var i = e.substr(0, e.length - 1);
            this._options.agent = this._options.agents[i]
        }
        var a = this._currentRequest = t.request(this._options, this._onNativeResponse);
        for (var o in this._currentUrl = n.format(this._options), a._redirectable = this, u) o && a.on(o, u[o]);
        if (this._isRedirect) {
            var r = this._requestBodyBuffers;
            !function e() {
                if (0 !== r.length) {
                    var t = r.pop();
                    a.write(t.data, t.encoding, e)
                } else a.end()
            }()
        }
    }, c.prototype._processResponse = function (e) {
        var t = e.headers.location;
        if (t && !1 !== this._options.followRedirects && e.statusCode >= 300 && e.statusCode < 400) {
            if (++this._redirectCount > this._options.maxRedirects) return void this.emit("error", new Error("Max redirects exceeded."));
            var i, a = this._options.headers;
            if (307 !== e.statusCode && !(this._options.method in d)) for (i in this._options.method = "GET", this._requestBodyBuffers = [], a) /^content-/i.test(i) && delete a[i];
            if (!this._isRedirect) for (i in a) /^host$/i.test(i) && delete a[i];
            var o = n.resolve(this._currentUrl, t);
            l("redirecting to", o), Object.assign(this._options, n.parse(o)), this._isRedirect = !0, this._performRequest()
        } else e.responseUrl = this._currentUrl, this.emit("response", e), this._requestBodyBuffers = []
    }, e.exports = h({http: a, https: o}), e.exports.wrap = h
}, function (e, t) {
    e.exports = require("stream")
}, function (e, t) {
    e.exports = require("zlib")
}, function (e, t, i) {
    "use strict";
    e.exports = function (e) {
        return !(!e || !e.__CANCEL__)
    }
}, function (e, t, i) {
    "use strict";

    function n(e) {
        this.message = e
    }

    n.prototype.toString = function () {
        return "Cancel" + (this.message ? ": " + this.message : "")
    }, n.prototype.__CANCEL__ = !0, e.exports = n
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        e.hoverWindowReadyToShow = "HoverWindowReadyToShow"
    }(t.ThunderEvent || (t.ThunderEvent = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(9), r = i(14), s = i(0), {isDef: l} = r.ThunderUtil, d = i(69), u = i(35), c = i(3), h = i(7),
        f = i(61), g = i(30), p = s.default.getLogger("statCoreEvent");

    function v(e) {
        let t = "";
        do {
            if (void 0 === e || null === e || "" === e) break;
            let i = /^(xl_thunder_pc)\|([\d\.]+)\|(\d+)\|(.*)$/.exec(e);
            if (null === i) break;
            if (null === i[4] || void 0 === i[4]) break;
            t = i[4]
        } while (0);
        return t
    }

    function m(e) {
        let t = e;
        do {
            if ("leftup" === e || "rightup" === e || "BHO_left" === e || "BHO_right" === e) {
                t = "BHO";
                break
            }
            if ("wfp" === e) {
                t = "XLWFP";
                break
            }
            if ("redown" === e) {
                t = "re_download";
                break
            }
            if ("newwindow" === e) {
                t = "newwindow_url";
                break
            }
            if ("bt_file" === e) {
                t = "Torrent";
                break
            }
        } while (0);
        return t
    }

    function y(e) {
        return n(this, void 0, void 0, function* () {
            let t = "";
            do {
                if (!e) break;
                let i = u.ThunderHelper.getDriveType(e);
                if (!i) break;
                if (i === u.ThunderHelper.DriverType.DRIVE_REMOTE) {
                    t = "share";
                    break
                }
                if (i === u.ThunderHelper.DriverType.DRIVE_REMOVABLE) {
                    t = "flash";
                    break
                }
                if (i === u.ThunderHelper.DriverType.DRIVE_FIXED) {
                    let i = yield u.ThunderHelper.getFixedDriveMediaType(e);
                    if (i === u.ThunderHelper.MediaType.HDD) {
                        t = "HD";
                        break
                    }
                    if (i === u.ThunderHelper.MediaType.SSD) {
                        t = "SSD";
                        break
                    }
                }
            } while (0);
            return t
        })
    }

    t.statCoreEvent = function (e, t, i) {
        return n(this, void 0, void 0, function* () {
            do {
                if (null === e) break;
                if (e.getTaskAttribute(c.DownloadKernel.TaskAttribute.GroupTaskId) > 0) break;
                let n = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.Origin);
                n = m(n);
                let r = v(e.getTaskAttribute(c.DownloadKernel.TaskAttribute.ProductInfo)), s = e.getId();
                const u = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.FileSize);
                let k = `broswer=${r},taskid=${s}`, T = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskType),
                    w = "";
                if (T === c.DownloadKernel.TaskType.P2sp) w = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskUrl), k = `${k},task_type=p2sp,download_info=${encodeURIComponent(w)}`; else if (T === c.DownloadKernel.TaskType.Bt) {
                    let t = e.getExtraObject().getInfoId();
                    k = `${k},task_type=bt,download_info=${t}`, w = t
                } else T === c.DownloadKernel.TaskType.Emule ? (w = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskUrl), k = `${k},task_type=emule,download_info=${encodeURIComponent(w)}`) : T === c.DownloadKernel.TaskType.Group ? k = `${k},task_type=group,download_info=` : T === c.DownloadKernel.TaskType.Magnet && (w = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskUrl), k = `${k},task_type=magnet,download_info=${encodeURIComponent(w)}`);
                let C = yield d.isVestUrl(w, "vestURL"), S = yield d.isVestUrl(w, "commonUrl"), b = "";
                C ? (b = n, n = "xl_password_vest") : S && (b = n, n = "xl_password_common");
                let I = 0;
                const _ = yield h.client.callServerFunction("IsLogined");
                let A = !1, D = 0, x = yield h.client.callServerFunction("GetUserInfo", 2);
                if (x) try {
                    x = JSON.parse(x)
                } catch (e) {
                    p.error(e.message)
                }
                x && (D = Number(x.vasType).valueOf(), A = Boolean("1" === x.isVip)), _ && A && (I = 5 === D ? 7 : l(D) && D > 2 ? 3 : 2), k = `${k = `${k},source=${n},pwd_source=${b},is_login=${_ ? 1 : 0},is_vip=${A ? 1 : 0},vip_type=${I}`},disk_type=${yield y(e.getTaskAttribute(c.DownloadKernel.TaskAttribute.SavePath))}`;
                let N = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskName), E = encodeURIComponent(N),
                    P = a.extname(N);
                "" !== (P = void 0 === P ? "" : P) && (P = P.substring(1)), f.ParseUrlFileNameNS.isUsualFileExtName(P) || (P = ""), k = `${k},filename=${E},filesize=${u},filesuffix=${P},libversion=${g.DownloadKernelManager.getDownloadSdkVersion()}`, void 0 !== i && (k = `${k},${i}`);
                let M = "core_event";
                p.information("trackEvent", M, t, k), o.XLStatNS.trackEvent(M, t, "", 0, 0, 0, 0, k)
            } while (0)
        })
    }
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(0), o = i(3), r = i(11), s = i(15), l = a.default.getLogger("magnet-listener"),
        d = r.DownloadKernelTaskManager.getTaskManager(), u = s.DownloadKernelEventManager.getEventManager();
    const c = new class {
        constructor() {
            this.listenerMap = {}
        }

        addRef(e, t) {
            this.listenerMap.hasOwnProperty(e) ? l.information("listener addRef") : (l.information("listener addRef not in map to attachTaskStatus"), this.attachTaskStatus(e));
            let i = this.listenerMap[e];
            i.callbacks.push(t), i.counter++
        }

        release(e) {
            do {
                if (!this.listenerMap.hasOwnProperty(e)) break;
                let t = this.listenerMap[e];
                t.counter--, 0 === t.counter ? (l.information("release listener to remove"), this.detachTaskStatus(t.cookie), t.cookie = -1, d.stopTask(e, o.DownloadKernel.TaskStopReason.Manual), d.deleteTask(e, !1).catch(), delete this.listenerMap[e]) : l.information("release listener remain", t.counter)
            } while (0)
        }

        fireAll(e, t, i) {
            do {
                if (!this.listenerMap.hasOwnProperty(e)) {
                    l.information("fire callback but maybe already release");
                    break
                }
                let n = this.listenerMap[e];
                if (0 === n.counter) break;
                for (let a of n.callbacks) a(e, t, i).catch(), this.release(e)
            } while (0)
        }

        attachTaskStatus(e) {
            let t = u.attachTaskEvent(o.DownloadKernel.TaskEventType.StatusChanged, (...t) => n(this, void 0, void 0, function* () {
                do {
                    if (!t) break;
                    if (t[0] !== o.DownloadKernel.TaskEventType.StatusChanged) break;
                    if (!t[1]) break;
                    let i = t[1];
                    for (let t = 0; t < i.length; ++t) {
                        let n = i[t];
                        if (!n) continue;
                        let a = n.getTaskStatus(), r = n.getTaskAttribute(o.DownloadKernel.TaskAttribute.TaskType),
                            s = n.getTaskAttribute(o.DownloadKernel.TaskAttribute.TaskId);
                        l.information("magnet channelRMNewTaskDownloadTorrent taskStatus", a, s, e), r === o.DownloadKernel.TaskType.Magnet && s === e && (a === o.DownloadKernel.TaskStatus.Succeeded || a === o.DownloadKernel.TaskStatus.Seeding ? this.fireAll(s, !0) : a === o.DownloadKernel.TaskStatus.Failed && this.fireAll(s, !1, n.getTaskAttribute(o.DownloadKernel.TaskAttribute.ErrorCode)))
                    }
                } while (0)
            }));
            l.information("attachTaskEvent StatusChanged", t);
            let i = {cookie: t, counter: 0, callbacks: []};
            this.listenerMap[e] = i
        }

        detachTaskStatus(e) {
            l.information("detachTaskEvent StatusChanged", e), u.detachTaskEvent(o.DownloadKernel.TaskEventType.StatusChanged, e)
        }
    };
    !function (e) {
        e.addRef = function (e, t) {
            return c.addRef(e, t)
        }, e.release = function (e) {
            return c.release(e)
        }
    }(t.MagnetListenerNS || (t.MagnetListenerNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(6), r = i(0), s = i(17), l = i(28), d = i(5), u = i(3), c = i(35), h = i(61), f = i(14),
        g = r.default.getLogger("ThunderNewTask"), p = o.default(a.join(__rootDir, "../bin/ThunderHelper.node"));
    let v = 5;
    !function (e) {
        let t;

        function o(e, t, i, n) {
            void 0 === i && (i = c.ThunderHelper.getTaskTypeFromUrl(e));
            let o = void 0, r = -1, s = "", l = "";
            do {
                if (i !== u.DownloadKernel.TaskType.Emule && i !== u.DownloadKernel.TaskType.P2sp) break;
                let d = h.ParseUrlFileNameNS.getNameFromUrl(e), c = a.extname(d);
                if ("" !== c && (s = c.substring(1)), i === u.DownloadKernel.TaskType.Emule) {
                    let t = h.ParseUrlFileNameNS.parseEd2kUrl(e);
                    r = t.fileSize, l = t.fileHash
                }
                o = {
                    url: e,
                    cookie: "",
                    referer: "",
                    fileName: d,
                    browser: "",
                    statClick: t = void 0 === t ? "" : t,
                    fileSize: r,
                    fileHash: l,
                    fileType: s,
                    birdkeyChars: n
                };
                break
            } while (0);
            return o
        }

        e.taskOptFileNameFixed = 2, function (e) {
            e.PreNewTask = "PreNewTaskCtrl", e.NewTask = "NewTaskCtrl", e.UrlFilter = "UrlFilterCtrl", e.Magnet = "BtCtrl"
        }(t = e.TaskCtrlType || (e.TaskCtrlType = {})), e.updateThreadCount = function (e) {
            do {
                if (isNaN(e)) break;
                if (e <= 0 || e > 10) break;
                v = e
            } while (0)
        }, e.contructTaskByUrl = function (e, t, i, n) {
            let a = o(e, t, i, n);
            g.verbose(e);
            let r = 5;
            return {
                taskType: i,
                data: a,
                setting: {
                    loginFtp: !1,
                    ftpInfo: {userName: "", password: ""},
                    onlyOrigin: !1,
                    thread: r = null !== a.thread && void 0 !== a.thread ? a.thread : v,
                    note: "",
                    openAfterDownload: !1
                },
                selected: !0
            }
        }, e.contructTaskByUrlData = function (e, t) {
            let i = void 0, n = c.ThunderHelper.getTaskTypeFromUrl(e.url);
            if (n === u.DownloadKernel.TaskType.Emule && (void 0 === e.fileHash || "" === e.fileHash)) {
                let t = h.ParseUrlFileNameNS.parseEd2kUrl(e.url);
                e.fileSize = t.fileSize, e.fileHash = t.fileHash
            }
            if (void 0 !== e.fileSize && null !== e.fileSize && 0 !== e.fileSize || (e.fileSize = -1), e.fileName || (e.fileName = h.ParseUrlFileNameNS.getNameFromUrl(e.url)), e.fileName = e.fileName.replace(/[*?/\\:|<>\"]/g, "_"), !e.fileType) {
                let t = a.extname(e.fileName);
                "" !== t && (e.fileType = t.substring(1))
            }
            if (void 0 === t || null === t) {
                let i = 5;
                t = {
                    loginFtp: !1,
                    ftpInfo: {userName: "", password: ""},
                    onlyOrigin: !1,
                    thread: i = null !== e.thread && void 0 !== e.thread ? e.thread : v,
                    note: "",
                    openAfterDownload: !1
                }
            }
            return i = {taskType: n, data: e, setting: t, selected: !0}
        }, e.getDesktopPath = function () {
            return p.getDesktopPath()
        }, e.getDocumentPath = function () {
            return p.getDocumentPath()
        }, e.queryFileExists = function (e) {
            return p.queryFileExists(e)
        }, e.isFilePathValid = function (e) {
            return p.isFilePathValid(e)
        }, e.getNewTaskDataByUrl = o, e.getDownloadResult = function (e, ...t) {
            return n(this, void 0, void 0, function* () {
                let i = {result: !1};
                do {
                    if (e.length < 3) {
                        i.message = "不合法的存储路径", i.pathError = !0;
                        break
                    }
                    if (!f.ThunderUtil.isValidPath(e)) {
                        i.message = "不合法的存储路径", i.pathError = !0;
                        break
                    }
                    if (!(yield d.FileSystemAWNS.dirExistsAW(e)) && !(yield d.FileSystemAWNS.mkdirsAW(e))) {
                        i.message = "不合法的存储路径", i.pathError = !0;
                        break
                    }
                    s.ipcRenderer.send(l.ThunderChannelList.channelRMNewTaskCreateNewTask, e, ...t), i = yield new Promise(e => {
                        s.ipcRenderer.once(l.ThunderChannelList.channelMRNewTaskCreateNewTaskResult, (t, i, n) => {
                            e({result: i, message: n})
                        })
                    })
                } while (0);
                return i
            })
        }, e.readThunderUnionConfig = function (e) {
            return n(this, void 0, void 0, function* () {
                let t = null, n = null;
                try {
                    const n = yield i(18);
                    n.defaults.adapter = i(21), t = yield n.get(e)
                } catch (e) {
                    g.information(e)
                }
                return null !== t && void 0 !== t.status && 200 === t.status && void 0 !== t.data && null !== t.data && (n = t.data), n
            })
        }
    }(t.ThunderNewtaskHelperNS || (t.ThunderNewtaskHelperNS = {}))
}, function (e, t, i) {
    (function () {
        "use strict";
        var e, n, a, o, r = {}.hasOwnProperty;
        n = i(308), e = i(516), a = i(521), o = i(421), t.defaults = n.defaults, t.processors = o, t.ValidationError = function (e) {
            function t(e) {
                this.message = e
            }

            return function (e, t) {
                for (var i in t) r.call(t, i) && (e[i] = t[i]);

                function n() {
                    this.constructor = e
                }

                n.prototype = t.prototype, e.prototype = new n, e.__super__ = t.prototype
            }(t, Error), t
        }(), t.Builder = e.Builder, t.Parser = a.Parser, t.parseString = a.parseString
    }).call(this)
}, function (e, t) {
    (function () {
        e.exports = function () {
            function e(e, t, i) {
                if (this.options = e.options, this.stringify = e.stringify, null == t) throw new Error("Missing attribute name of element " + e.name);
                if (null == i) throw new Error("Missing attribute value for attribute " + t + " of element " + e.name);
                this.name = this.stringify.attName(t), this.value = this.stringify.attValue(i)
            }

            return e.prototype.clone = function () {
                return Object.create(this)
            }, e.prototype.toString = function (e) {
                return this.options.writer.set(e).attribute(this)
            }, e
        }()
    }).call(this)
}, function (e, t) {
    (function () {
        var t = function (e, t) {
            return function () {
                return e.apply(t, arguments)
            }
        }, i = {}.hasOwnProperty;
        e.exports = function () {
            function e(e) {
                var n, a, o;
                for (n in this.assertLegalChar = t(this.assertLegalChar, this), e || (e = {}), this.noDoubleEncoding = e.noDoubleEncoding, a = e.stringify || {}) i.call(a, n) && (o = a[n], this[n] = o)
            }

            return e.prototype.eleName = function (e) {
                return e = "" + e || "", this.assertLegalChar(e)
            }, e.prototype.eleText = function (e) {
                return e = "" + e || "", this.assertLegalChar(this.elEscape(e))
            }, e.prototype.cdata = function (e) {
                return e = (e = "" + e || "").replace("]]>", "]]]]><![CDATA[>"), this.assertLegalChar(e)
            }, e.prototype.comment = function (e) {
                if ((e = "" + e || "").match(/--/)) throw new Error("Comment text cannot contain double-hypen: " + e);
                return this.assertLegalChar(e)
            }, e.prototype.raw = function (e) {
                return "" + e || ""
            }, e.prototype.attName = function (e) {
                return "" + e || ""
            }, e.prototype.attValue = function (e) {
                return e = "" + e || "", this.attEscape(e)
            }, e.prototype.insTarget = function (e) {
                return "" + e || ""
            }, e.prototype.insValue = function (e) {
                if ((e = "" + e || "").match(/\?>/)) throw new Error("Invalid processing instruction value: " + e);
                return e
            }, e.prototype.xmlVersion = function (e) {
                if (!(e = "" + e || "").match(/1\.[0-9]+/)) throw new Error("Invalid version number: " + e);
                return e
            }, e.prototype.xmlEncoding = function (e) {
                if (!(e = "" + e || "").match(/^[A-Za-z](?:[A-Za-z0-9._-])*$/)) throw new Error("Invalid encoding: " + e);
                return e
            }, e.prototype.xmlStandalone = function (e) {
                return e ? "yes" : "no"
            }, e.prototype.dtdPubID = function (e) {
                return "" + e || ""
            }, e.prototype.dtdSysID = function (e) {
                return "" + e || ""
            }, e.prototype.dtdElementValue = function (e) {
                return "" + e || ""
            }, e.prototype.dtdAttType = function (e) {
                return "" + e || ""
            }, e.prototype.dtdAttDefault = function (e) {
                return null != e ? "" + e || "" : e
            }, e.prototype.dtdEntityValue = function (e) {
                return "" + e || ""
            }, e.prototype.dtdNData = function (e) {
                return "" + e || ""
            }, e.prototype.convertAttKey = "@", e.prototype.convertPIKey = "?", e.prototype.convertTextKey = "#text", e.prototype.convertCDataKey = "#cdata", e.prototype.convertCommentKey = "#comment", e.prototype.convertRawKey = "#raw", e.prototype.assertLegalChar = function (e) {
                var t;
                if (t = e.match(/[\0\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/)) throw new Error("Invalid character in string: " + e + " at index " + t.index);
                return e
            }, e.prototype.elEscape = function (e) {
                var t;
                return t = this.noDoubleEncoding ? /(?!&\S+;)&/g : /&/g, e.replace(t, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/\r/g, "&#xD;")
            }, e.prototype.attEscape = function (e) {
                var t;
                return t = this.noDoubleEncoding ? /(?!&\S+;)&/g : /&/g, e.replace(t, "&amp;").replace(/</g, "&lt;").replace(/"/g, "&quot;").replace(/\t/g, "&#x9;").replace(/\n/g, "&#xA;").replace(/\r/g, "&#xD;")
            }, e
        }()
    }).call(this)
}, function (e, t) {
    (function () {
        var t = {}.hasOwnProperty;
        e.exports = function () {
            function e(e) {
                var i, n, a, o, r, s, l, d, u;
                for (i in e || (e = {}), this.pretty = e.pretty || !1, this.allowEmpty = null != (n = e.allowEmpty) && n, this.pretty ? (this.indent = null != (a = e.indent) ? a : "  ", this.newline = null != (o = e.newline) ? o : "\n", this.offset = null != (r = e.offset) ? r : 0, this.dontprettytextnodes = null != (s = e.dontprettytextnodes) ? s : 0) : (this.indent = "", this.newline = "", this.offset = 0, this.dontprettytextnodes = 0), this.spacebeforeslash = null != (l = e.spacebeforeslash) ? l : "", !0 === this.spacebeforeslash && (this.spacebeforeslash = " "), this.newlinedefault = this.newline, this.prettydefault = this.pretty, d = e.writer || {}) t.call(d, i) && (u = d[i], this[i] = u)
            }

            return e.prototype.set = function (e) {
                var i, n, a;
                for (i in e || (e = {}), "pretty" in e && (this.pretty = e.pretty), "allowEmpty" in e && (this.allowEmpty = e.allowEmpty), this.pretty ? (this.indent = "indent" in e ? e.indent : "  ", this.newline = "newline" in e ? e.newline : "\n", this.offset = "offset" in e ? e.offset : 0, this.dontprettytextnodes = "dontprettytextnodes" in e ? e.dontprettytextnodes : 0) : (this.indent = "", this.newline = "", this.offset = 0, this.dontprettytextnodes = 0), this.spacebeforeslash = "spacebeforeslash" in e ? e.spacebeforeslash : "", !0 === this.spacebeforeslash && (this.spacebeforeslash = " "), this.newlinedefault = this.newline, this.prettydefault = this.pretty, n = e.writer || {}) t.call(n, i) && (a = n[i], this[i] = a);
                return this
            }, e.prototype.space = function (e) {
                var t;
                return this.pretty && (t = (e || 0) + this.offset + 1) > 0 ? new Array(t).join(this.indent) : ""
            }, e
        }()
    }).call(this)
}, function (e, t) {
    (function () {
        "use strict";
        var e;
        e = new RegExp(/(?!xmlns)^.*:/), t.normalize = function (e) {
            return e.toLowerCase()
        }, t.firstCharLowerCase = function (e) {
            return e.charAt(0).toLowerCase() + e.slice(1)
        }, t.stripPrefix = function (t) {
            return t.replace(e, "")
        }, t.parseNumbers = function (e) {
            return isNaN(e) || (e = e % 1 == 0 ? parseInt(e, 10) : parseFloat(e)), e
        }, t.parseBooleans = function (e) {
            return /^(?:true|false)$/i.test(e) && (e = "true" === e.toLowerCase()), e
        }
    }).call(this)
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(12), o = i(91), r = i(10), s = i(0), l = i(16), d = i(24), u = i(9), c = i(313), h = i(13), f = i(25),
        g = i(18), p = i(528).UserHelperNS.getUserHelper(), v = s.default.getLogger("Sign"),
        m = "http://pc.xunlei.com/pages/#/sign";
    t.signObject = new class {
        constructor() {
            this.embeddedBrowserObj = null, this.title = "", this.url = m, this.width = 400, this.height = 460, this.curPopupType = "", this.lefttMargin = 0, this.rigthMargin = 0, this.topMargin = 30, this.bootomMargin = 0, this.canAutoShow = !0, this.embeddedBrowserObj = new o.EmbeddedBrowser, this.attachListener().catch()
        }

        enableAutoShow(e) {
            this.canAutoShow = e
        }

        createSignDlg(e, t) {
            return n(this, void 0, void 0, function* () {
                do {
                    if ("auto" === e && !this.canAutoShow) {
                        v.information("自动弹出已被阻止");
                        break
                    }
                    if ("auto" === e && !1 === this.isPopup()) {
                        v.information("不满足auto弹出条件");
                        break
                    }
                    let i = yield c.CommonSignFunctionNs.isAlreadySign();
                    if ("auto" === e && i) {
                        v.information("用户已经答过");
                        break
                    }
                    if (yield this.isAlreadyShowTips()) {
                        v.information("createSignDlg 正在显示tips");
                        break
                    }
                    if (!1 === (yield c.CommonSignFunctionNs.isHaveSignQuestion())) {
                        v.information("不存在答题");
                        break
                    }
                    this.curPopupType = e;
                    let n = yield a.asyncRemoteCall.getCurrentWindow();
                    if ((yield n.isMinimized()) || !1 === (yield n.isVisible())) {
                        v.information("窗口最小化或者不可见");
                        break
                    }
                    this.setDefaultValue();
                    let o = f.default.getConfigInfo("activity", "enable_sign");
                    if (null !== o && void 0 !== o && 1 === o) {
                        let e = f.default.getConfigInfo("activity", "actid");
                        if (null !== e && void 0 !== e && "" !== e) {
                            let t = yield c.CommonSignFunctionNs.actSwitch(e);
                            t.actSwitch && null !== t.width && void 0 !== t.width && null !== t.height && void 0 !== t.height && (this.width = t.width, this.height = t.height, this.url = `${this.url}?actid=${e}`)
                        }
                    }
                    "auto" === e ? (this.embeddedBrowserObj.setAutoShow(!1), this.url = `${this.url}?readyshow=1`) : (this.embeddedBrowserObj.setAutoShow(!0), this.url = `${this.url}?readyshow=0`), yield this.checkReadPack(), yield this.embeddedBrowserObj.createWnd(this.url, this.title, !1, "sign", this.width, this.height, this.lefttMargin, this.rigthMargin, this.topMargin, this.bootomMargin, t, this.onWndShowResult.bind(this))
                } while (0)
            })
        }

        onWndShowResult() {
            return n(this, void 0, void 0, function* () {
                let e = !0;
                return (yield this.isAlreadyShowTips()) ? (v.information("onWndShowResult 正在显示tips"), e = !1) : (this.writeConfig(), this.statSign("sign_popup_show").catch()), e
            })
        }

        closeDialog() {
            this.embeddedBrowserObj.closeWnd().catch()
        }

        show() {
            return n(this, void 0, void 0, function* () {
                do {
                    let e = yield a.asyncRemoteCall.getCurrentWindow();
                    if ((yield e.isMinimized()) || !1 === (yield e.isVisible())) {
                        v.information("窗口最小化或者不可见");
                        break
                    }
                    if (yield this.isAlreadyShowTips()) {
                        v.information("onWndShowResult 正在显示tips");
                        break
                    }
                    this.embeddedBrowserObj.showWnd().catch()
                } while (0)
            })
        }

        getWnd() {
            return this.embeddedBrowserObj.getWnd()
        }

        attachListener() {
            return n(this, void 0, void 0, function* () {
                l.NativeCallModule.nativeCall.AttachNativeEvent("showTipsWnd", () => {
                    v.information("showTipsWnd:"), this.embeddedBrowserObj.closeWnd().catch()
                }), (yield a.asyncRemoteCall.getIpcMain()).on(h.NodeEventMesssageNS.eventEmbeddedBrowserWndClick, (e, t, i) => {
                    if ("sign" === t) {
                        let e = "";
                        "btn_close" === i ? e = "sign_close" : "sign_nopop" === i && (e = "sign_nopop"), this.statSign("sign_detail_click", e).catch()
                    }
                })
            })
        }

        isAlreadyShowTips() {
            return n(this, void 0, void 0, function* () {
                return new Promise(e => {
                    l.NativeCallModule.nativeCall.CallNativeFunction("IsTipsWndShow", t => {
                        v.information("isAlreadyShowTips:", t), e(t)
                    })
                })
            })
        }

        setDefaultValue() {
            this.url = m;
            let e = r.ConfigNS.getValue("sign", "testUrl", "");
            e && "" !== e && (this.url = e), this.width = 400, this.height = 460
        }

        writeConfig() {
            if ("auto" === this.curPopupType) {
                let e = this.getCurDate();
                r.ConfigNS.setValue("ConfigPopUpPanel", "ShowDate", e)
            }
        }

        getCurDate() {
            let e = "", t = new Date;
            return e = `${t.getFullYear()}${t.getMonth() + 1}${t.getDate()}`
        }

        isPopup() {
            let e = !0;
            do {
                let t = this.getCurDate(), i = r.ConfigNS.getValue("ConfigPopUpPanel", "ShowDate", "");
                if (t === i) {
                    v.information("ShowDate:", i, "curDate:", t), e = !1;
                    break
                }
                let n = r.ConfigNS.getValue("ConfigPopUpPanel", "StartCount", 0),
                    a = r.ConfigNS.getValue("ConfigPopUpPanel", "ShowTime", 0),
                    o = Math.round((new Date).getTime() / 1e3);
                v.information("isPopup:", n, a, o), e = !(0 !== n && (1 === n ? o - a <= 604800 : 2 === n ? o - a <= 2592e3 : 3 !== n || o - a <= 7776e3))
            } while (0);
            return e
        }

        statSign(e, t) {
            return n(this, void 0, void 0, function* () {
                let i = "";
                if (yield d.LoginHelperNS.loginHelper.isLoginedAw()) {
                    i = "is_login=1";
                    let e = 0;
                    "0" !== (yield d.LoginHelperNS.loginHelper.getUserInfoByKeyAw("isVip", "vip_xl")) && (e = 1), i = `${i},is_vip=${e}`
                } else i = "is_login=0";
                "sign_detail_click" === e && (i = `${i},button=${t}`), v.information("statSign:", e, i), u.XLStatNS.trackEvent("business", e, "", 0, 0, 0, 0, i)
            })
        }

        checkReadPack() {
            return n(this, void 0, void 0, function* () {
                let e = !1;
                do {
                    let t = "https://msg-vip-ssl.xunlei.com/xlact/conf?actid=vip2020redpack&client=xunlei_xds&source=guess_movie";
                    yield p.parseUserInfo(), t += "&userid=" + p.userId, t += "&sessionid=" + (yield p.getSessionId());
                    let n = null;
                    try {
                        g.default.defaults.adapter = i(21), n = yield g.default.get(t, {timeout: 5e3})
                    } catch (e) {
                        v.information(e);
                        break
                    }
                    if (null !== n && void 0 !== n.status && 200 === n.status && void 0 !== n.data && null !== n.data && "" !== n.data) {
                        let t = n.data;
                        0 === t.result && t.data && t.data.valid && (this.width = Number(t.data.width), this.height = Number(t.data.height) + this.topMargin, this.url += "&redpack=" + encodeURIComponent(JSON.stringify(t.data)), e = !0)
                    }
                } while (0);
                return e || (this.url += "&redpack=" + encodeURI(JSON.stringify({valid: !1}))), e
            })
        }
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(2), a = i(311), o = i(54), r = i(6).default(n.join(__rootDir, "../bin/ThunderHelper.node"));
    !function (e) {
        function t(e, t, i, n, o, s, l) {
            let d = {x: 0, y: 0, width: 0, height: 0}, u = a.BrowserWindowNS.getDpiFactor(r, e);
            return d.x = Math.ceil(n * u), d.y = Math.ceil(s * u), d.width = Math.ceil((t - n - o) * u), d.height = Math.ceil((i - s - l) * u), d
        }

        e.resizeBrowserWindow = function (e, i, n, a, s, l, d, u = o.Uflag.SWP_SHOWWINDOW) {
            let c = !1;
            {
                let h = t(e, i, n, a, s, l, d);
                r.setWindowPos(e, o.OptionOfHWNDInAfter.HWND_TOP, Math.round(h.x), Math.round(h.y), Math.round(h.width), Math.round(h.height), u), c = !0
            }
            return c
        }, e.getBrowserWindowRect = t
    }(t.CommonFunctionNs || (t.CommonFunctionNs = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(91), o = i(16), r = i(531), s = i(10), l = i(25), d = i(9), u = i(2), c = i(6), h = i(34), f = i(0),
        g = i(4), p = f.default.getLogger("News-Popup"), v = c.default(u.join(__rootDir, "../bin/ThunderHelper.node")),
        m = "http://pc.xunlei.com/pages/#/news", y = 710, k = 612;
    t.newsPopupObject = new class {
        constructor() {
            this.embeddedBrowserObj = null, this.title = "迅雷，发现好电影", this.url = m, this.width = y, this.height = k, this.lefttMargin = 0, this.rigthMargin = 0, this.topMargin = 30, this.bootomMargin = 0, this.idIndex = 1, this.adMap = new Map, this.startMoveMousePos = {
                x: 0,
                y: 0
            }, this.startMoveWindowPos = {x: 0, y: 0}, this.embeddedBrowserObj = new a.EmbeddedBrowser
        }

        createNewsPopupDlg(e, t) {
            return n(this, void 0, void 0, function* () {
                do {
                    if (0 === l.default.getConfigInfo("newspopup", "enable")) break;
                    if (p.information("createNewsPopupDlg popupType:", e), !this.isPopup() && "auto" === e) {
                        p.information("this.isPopup() false!"), d.XLStatNS.trackEvent("setting_center", "popup_intercept");
                        break
                    }
                    this.setDefaultValue(), this.embeddedBrowserObj.setWindowTopLevel(!0), "hover" === e ? this.embeddedBrowserObj.setAutoShow(!0) : this.embeddedBrowserObj.setAutoShow(!1), yield this.embeddedBrowserObj.createWnd(this.url, this.title, !1, "news-popup", this.width, this.height, this.lefttMargin, this.rigthMargin, this.topMargin, this.bootomMargin, t, this.onWndShowResult.bind(this), null), yield this.embeddedBrowserObj.setMinimizable(!0)
                } while (0)
            })
        }

        onWndShowResult() {
            return n(this, void 0, void 0, function* () {
                let e = !0;
                if (this.writeConfig(), yield this.isAlreadyShowTips()) p.information("onWndShowResult 正在显示tips"), e = !1; else {
                    let e = this.embeddedBrowserObj.getWnd();
                    g.isNullOrUndefined(e) || (yield h.ToolsUtilitiesAWNS.setForegroundWindow(v, e))
                }
                return e
            })
        }

        getWnd() {
            return this.embeddedBrowserObj.getWnd()
        }

        writeConfig() {
            let e = this.getCurDate();
            s.ConfigNS.setValue("ConfigNewsPopUp", "NewsShowDate", e)
        }

        getCurDate() {
            let e = "", t = new Date;
            return e = `${t.getFullYear()}${t.getMonth() + 1}${t.getDate()}`
        }

        close() {
            this.embeddedBrowserObj.closeWnd().catch()
        }

        setStartMoveMousePos(e, t) {
            return n(this, void 0, void 0, function* () {
                this.startMoveMousePos.x = e, this.startMoveMousePos.y = t;
                let i = yield this.embeddedBrowserObj.getWndPosition();
                this.startMoveWindowPos.x = i[0], this.startMoveWindowPos.y = i[1]
            })
        }

        setMoveMousePos(e, t) {
            this.embeddedBrowserObj.setWndPosition(e - this.startMoveMousePos.x + this.startMoveWindowPos.x, t - this.startMoveMousePos.y + this.startMoveWindowPos.y).catch()
        }

        minimize() {
            this.embeddedBrowserObj.minimizeWnd().catch()
        }

        setSize(e, t) {
            e && t && (this.width = e, this.height = t), this.embeddedBrowserObj.setWndSize(this.width, this.height).catch()
        }

        getSize() {
            return [this.width, this.height]
        }

        show() {
            return n(this, void 0, void 0, function* () {
                do {
                    if (yield this.isAlreadyShowTips()) {
                        p.information("onWndShowResult 正在显示tips");
                        break
                    }
                    window.localStorage.setItem("NewsShowDate", this.getCurDate()), this.embeddedBrowserObj.showWnd().catch()
                } while (0)
            })
        }

        center() {
            this.embeddedBrowserObj.centerWnd().catch()
        }

        createAd(e) {
            let t = this.idIndex++, i = new r.NewsAdContainer(t);
            return this.adMap.set(t, i), p.information("createAd adType:", e, ", id:", t), t
        }

        showAd(e, t, i, n, a) {
            p.information("showAd x:", t, ", y:", i, ", width:", n, ", height:", a);
            let o = this.adMap.get(e);
            o && (o.move(t, i, n, a), o.show())
        }

        hideAd(e) {
            p.information("hideAd id:", e);
            let t = this.adMap.get(e);
            t && t.hide()
        }

        closeAd(e) {
            p.information("closeAd id:", e);
            let t = this.adMap.get(e);
            t && t.close()
        }

        isAlreadyShowTips() {
            return n(this, void 0, void 0, function* () {
                return new Promise(e => {
                    o.NativeCallModule.nativeCall.CallNativeFunction("IsTipsWndShow", t => {
                        p.information("isAlreadyShowTips:", t), e(t)
                    })
                })
            })
        }

        setDefaultValue() {
            this.url = m, this.width = y, this.height = k
        }

        isPopup() {
            let e = !0;
            do {
                if (v.IsInFullScreen()) {
                    e = !1;
                    break
                }
                let t = s.ConfigNS.getValue("ConfigMsg", "ConfigMsg_TodayRecommend", !0);
                if (p.information("todayRecommendEnable:", t), !t) {
                    e = !1;
                    break
                }
                let i = this.getCurDate(), n = s.ConfigNS.getValue("ConfigNewsPopUp", "NewsShowDate", "");
                if (i === n || i === window.localStorage.getItem("NewsShowDate")) {
                    p.information("ShowDate:", n, "curDate:", i), e = !1;
                    break
                }
                let a = s.ConfigNS.getValue("ConfigNewsPopUp", "NewsShowTime", 0);
                if (Math.round((new Date).getTime() / 1e3) - a <= 604800) {
                    e = !1;
                    break
                }
                e = !0
            } while (0);
            return e
        }
    }
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(93), r = i(18), s = i(20), l = i(5), d = i(34), u = i(13), c = i(0), h = i(417), f = i(9),
        g = i(55), p = i(3), v = i(11), m = i(15), y = i(43), k = i(17), T = i(28),
        w = v.DownloadKernelTaskManager.getTaskManager(), C = m.DownloadKernelEventManager.getEventManager(),
        S = c.default.getLogger("Thunder.plugin-loader");
    !function (e) {
        e.pluginLoader = new class {
            constructor() {
                this.plugins = null, this.currentDir = `${__rootDir}/plugins/`, this.configName = `${this.currentDir}plugin-loader-config.json`, this.unzipConfig = `${this.currentDir}plugin-unzip-config.json`, this.isUnzipConfigLoad = !1, this.unzipPlugins = {}, this.loadedPlugins = [], this.pluginStatusMap = {}, this.pluginGroupCache = {}, this.emitter = null, this.updatePlugins = null, this.updatePluginsConfig = `${this.currentDir}plugin-update-config.xml`, this.downloadPluginsStat = [], this.unzipPluginsStat = [], this.loadPluginsStat = [], this.taskStatusChangedEventTable = [], this.handlePluginIndex = 0, g.quitPromises.add(() => new Promise(e => n(this, void 0, void 0, function* () {
                    S.information("stat before quit"), this.sendPluginStat(this.downloadPluginsStat, "plugin_download"), this.downloadPluginsStat = [], this.sendPluginStat(this.unzipPluginsStat, "plugin_decompression"), this.unzipPluginsStat = [], this.sendPluginStat(this.loadPluginsStat, "plugin_load"), this.sendPluginStatEx(this.loadPluginsStat), this.loadPluginsStat = [], yield this.saveUpdatePluginsConfig(), yield this.saveUnzipConfig(), e(!0)
                })))
            }

            isPluginLoaded(e) {
                let t = !1;
                do {
                    if (-1 !== this.loadedPlugins.indexOf(e)) {
                        t = !0;
                        break
                    }
                    let i = this.getPluginStatus(e);
                    if (!i) break;
                    if ("loaded" === i.state) {
                        t = !0;
                        break
                    }
                } while (0);
                return t
            }

            setPluginLoaded(e) {
                -1 === this.loadedPlugins.indexOf(e) && (this.loadedPlugins.push(e), this.setPluginStatus(e, "loaded").catch())
            }

            clear(e, t, i) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (!e || !t || !i) break;
                        if (0 !== i.indexOf(t)) break;
                        let n = `${this.currentDir}${e}`, o = yield l.FileSystemAWNS.readdirAW(n);
                        for (let e = 0; e < o.length; e++) {
                            let i = o[e], r = a.join(n, i), s = yield l.FileSystemAWNS.lstatAW(r);
                            s && (s.isDirectory() && i !== t ? l.FileSystemAWNS.rmdirsAW(r).catch() : s.isFile() && "config.json" !== i && l.FileSystemAWNS.unlinkAW(r).catch())
                        }
                    } while (0)
                })
            }

            getPluginsCount() {
                return this.plugins ? this.plugins.data.length : 0
            }

            getPluginFromName(e) {
                if (!this.plugins) return null;
                for (let t = 0; t < this.getPluginsCount(); ++t) if (e === this.plugins.data[t].name) return this.plugins.data[t];
                return null
            }

            updateStat(e, t) {
                let i = 0;
                for (i = 0; i < e.length; ++i) if (e[i].name === t.name) {
                    e[i].version = t.version, e[i].state = t.state, e[i].errorCode = t.errorCode;
                    break
                }
                i >= e.length && e.push(t)
            }

            sendPluginStatEx(e) {
                let t = "", i = 0;
                const n = "plugin_stat";
                for (let a = 0; a < e.length; a++) e[a].outProcess && (t += `key=${e[a].name},version=${e[a].version},value=${e[a].state},errorCode=${e[a].errorCode};`, ++i >= 16 && (S.information("sendPluginStat", n, "plugin_load", t), t = encodeURIComponent(t), f.XLStatNS.trackEvent(n, "plugin_load", "", 0, 0, 0, 0, t), i = 0, t = ""));
                "" !== t && (S.information("sendPluginStat", n, "plugin_load", t), t = encodeURIComponent(t), f.XLStatNS.trackEvent(n, "plugin_load", "", 0, 0, 0, 0, t))
            }

            sendPluginStat(e, t) {
                S.information("sendPluginStat enter");
                let i = "", n = 0;
                for (let a = 0; a < e.length; ++a) i += `key=${e[a].name},version=${e[a].version},value=${e[a].state},errorCode=${e[a].errorCode};`, ++n >= 16 && (S.information("sendPluginStat", t, i), i = encodeURIComponent(i), f.XLStatNS.trackEvent("core_event", t, "", 0, 0, 0, 0, i), n = 0, i = "");
                "" !== i && (S.information("sendPluginStat", t, i), i = encodeURIComponent(i), f.XLStatNS.trackEvent("core_event", t, "", 0, 0, 0, 0, i))
            }

            saveUpdatePluginsConfig() {
                return n(this, void 0, void 0, function* () {
                    S.information("saveUpdatePluginsConfig enter", this.updatePlugins);
                    do {
                        if (null === this.updatePlugins || 0 === this.updatePlugins.data.length) break;
                        let e = (new h.Builder).buildObject(this.updatePlugins);
                        yield l.FileSystemAWNS.writeFileAW(`${this.updatePluginsConfig}`, e.toString())
                    } while (0)
                })
            }

            updateUpPlugins(e) {
                return n(this, void 0, void 0, function* () {
                    if (yield l.FileSystemAWNS.existsAW(this.currentDir + e.name + "/plugin-config-file.xml")) {
                        let t = {plugin: {name: e.name, version: e.version, md5: e.md5, success: 0}};
                        null === this.updatePlugins && (this.updatePlugins = {data: []}), this.updatePlugins.data.push(t)
                    }
                })
            }

            loadUnzipConfig() {
                return n(this, void 0, void 0, function* () {
                    S.information("loadUnzipConfig enter");
                    do {
                        if (this.isUnzipConfigLoad) break;
                        let e = yield l.FileSystemAWNS.readFileAW(`${this.unzipConfig}`);
                        if (null !== e) try {
                            this.unzipPlugins = JSON.parse(e.toString()), this.isUnzipConfigLoad = !0
                        } catch (e) {
                            S.warning(e)
                        }
                    } while (0);
                    return this.isUnzipConfigLoad
                })
            }

            saveUnzipConfig() {
                return n(this, void 0, void 0, function* () {
                    let e = void 0;
                    try {
                        e = JSON.stringify(this.unzipPlugins)
                    } catch (e) {
                        S.warning(e)
                    }
                    void 0 !== e && (S.information(e), yield l.FileSystemAWNS.writeFileAW(`${this.unzipConfig}`, e))
                })
            }

            isPluginUnzip(e) {
                return n(this, void 0, void 0, function* () {
                    let t = !1, i = e.name;
                    return null !== this.unzipPlugins && null !== this.unzipPlugins[`${i}`] && void 0 !== this.unzipPlugins[`${i}`] && this.unzipPlugins[`${i}`].md5.toUpperCase() === e.md5.toUpperCase() && (t = this.unzipPlugins[`${i}`].unzipstate), t
                })
            }

            updatePluginUnzip(e, t) {
                let i = e.name;
                null !== this.unzipPlugins && (this.unzipPlugins[`${i}`] = t)
            }

            startDownloadPlugins(e, t, a, o, s, d) {
            }

            popPluginGroups(e) {
                let t = null;
                do {
                    if (!e) break;
                    e = e.toLowerCase(), t = this.pluginGroupCache[e], delete this.pluginGroupCache[e]
                } while (0);
                return t
            }

            getPluginStatus(e) {
                let t = null;
                do {
                    if (!e) break;
                    if (e = e.toLowerCase(), this.pluginStatusMap.hasOwnProperty(e)) {
                        t = this.pluginStatusMap[e];
                        break
                    }
                    for (let i in this.pluginStatusMap) {
                        let n = this.pluginStatusMap[i];
                        if (n.name === e) {
                            t = n;
                            break
                        }
                    }
                } while (0);
                return t
            }

            setPluginStatus(e, t) {
                return n(this, void 0, void 0, function* () {
                    let i = null;
                    do {
                        let n = this.pluginStatusMap[e.toLowerCase()];
                        if (n) {
                            n.state === t || "loaded" === n.state ? i = n : (i = Object.assign({}, n, {state: t}), this.pluginStatusMap[e.toLowerCase()] = i);
                            break
                        }
                        const a = `${this.currentDir}${e}/config.json`;
                        if (yield l.FileSystemAWNS.existsAW(`${a}`)) {
                            let n = null;
                            try {
                                n = require(a)
                            } catch (e) {
                                S.warning(e)
                            }
                            if (n && n.main) {
                                let o = `${this.currentDir}${e}/${n.main}`;
                                (yield l.FileSystemAWNS.existsAW(o)) && (i = {
                                    state: t,
                                    main: o,
                                    cfgPath: a,
                                    name: n.name.toLowerCase()
                                }, this.pluginStatusMap[e.toLowerCase()] = i, "ready" === t && (n.version && n.clear && this.clear(e, n.version, n.main).catch(), n.owner ? s.server.isRemoteClientExist(n.owner) ? (S.information("owner is running", n.owner, n.name), s.server.fireClientEvent("OnPluginReady", e, n.owner, i)) : (S.information("owner cache ", n.owner, n.name), this.pluginGroupCache.hasOwnProperty(n.owner.toLowerCase()) || (this.pluginGroupCache[n.owner.toLowerCase()] = {}), this.pluginGroupCache[n.owner.toLowerCase()][e.toLowerCase()] = i) : s.server.fireClientEvent("OnPluginReady", e, n.owner, i)))
                            }
                        } else {
                            const n = `${this.currentDir}${e}/index`;
                            (yield l.FileSystemAWNS.existsAW(`${n}.js`)) && (i = {
                                state: t,
                                main: `${n}.js`,
                                name: e.toLowerCase()
                            }, this.pluginStatusMap[e.toLowerCase()] = i, "ready" === t && s.server.fireClientEvent("OnPluginReady", e, void 0, i))
                        }
                    } while (0);
                    return i
                })
            }

            loadPlugin(e) {
                return n(this, void 0, void 0, function* () {
                    S.information("loadPlugin enter");
                    let t = null;
                    const i = `${this.currentDir}${e}/index`, n = `${this.currentDir}${e}/config.json`;
                    let a = yield l.FileSystemAWNS.existsAW(`${i}.js`), r = yield l.FileSystemAWNS.existsAW(`${n}`);
                    S.information("loadPlugin outProcess", n, r);
                    let s = yield l.FileSystemAWNS.existsAW(this.currentDir + e + "/plugin-config-file.xml");
                    if (this.isPluginLoaded(e)) t = {}; else {
                        if (r) {
                            let i = null;
                            try {
                                i = require(n)
                            } catch (e) {
                                S.warning(e)
                            }
                            if (S.information("loadPlugin config", i), i && i.main) {
                                let a = `${this.currentDir}${e}/${i.main}`;
                                if (yield l.FileSystemAWNS.existsAW(a)) {
                                    let r = `${__rootDir}/out/plugin-boot.js`;
                                    if (yield l.FileSystemAWNS.existsAW(r)) {
                                        const t = o.fork(r, ["--type=xdas-plugin-process", `--xdas-plugin-config=${n}`, `--xdas-plugin-name=${e}`]);
                                        S.information("loadPlugin fork", t, e), k.ipcRenderer.send(T.ThunderChannelList.channelRMSetEnvironmentVariable, t.pid.toString(), a), t.once("exit", () => {
                                            k.ipcRenderer.send(T.ThunderChannelList.channelRMSetEnvironmentVariable, t.pid.toString())
                                        })
                                    } else {
                                        const t = o.fork(a, ["--type=xdas-plugin-process", `--xdas-plugin-name=${e}`]);
                                        S.information("loadPlugin fork", t), k.ipcRenderer.send(T.ThunderChannelList.channelRMSetEnvironmentVariable, t.pid.toString(), a), t.once("exit", () => {
                                            k.ipcRenderer.send(T.ThunderChannelList.channelRMSetEnvironmentVariable, t.pid.toString())
                                        })
                                    }
                                    t = {}, i.version && i.clear && this.clear(e, i.version, i.main).catch()
                                }
                            }
                        } else if (a) try {
                            t = require(i)
                        } catch (e) {
                            S.warning(e)
                        }
                        t && this.setPluginLoaded(e)
                    }
                    let d = this.getPluginFromName(e);
                    return d ? (t || s ? this.updateStat(this.loadPluginsStat, {
                        name: d.name,
                        version: d.version,
                        state: "success",
                        errorCode: 0,
                        outProcess: r
                    }) : this.updateStat(this.loadPluginsStat, {
                        name: d.name,
                        version: d.version,
                        state: "fail",
                        errorCode: -1,
                        outProcess: r
                    }), this.loadPluginsStat.length >= this.getPluginsCount() && (this.sendPluginStat(this.loadPluginsStat, "plugin_load"), this.sendPluginStatEx(this.loadPluginsStat), this.loadPluginsStat = []), S.information("loadPlugin leave", t), t) : t
                })
            }

            loadConfig(e, t) {
                return n(this, void 0, void 0, function* () {
                    if (S.information("loadConfig enter"), this.plugins = e, t) {
                        let t = void 0;
                        try {
                            t = JSON.stringify(e)
                        } catch (e) {
                            S.warning(e)
                        }
                        void 0 !== t && (S.information(t), yield l.FileSystemAWNS.writeFileAW(`${this.configName}`, t))
                    }
                    this.loadUnzipConfig().then(() => {
                        this.downloadPlugins()
                    }).catch()
                })
            }

            checkFile(e) {
                return n(this, void 0, void 0, function* () {
                    S.information("checkFile enter");
                    const t = `${this.currentDir}${e.name}.zip`;
                    let i = yield l.FileSystemAWNS.existsAW(t);
                    return i && (i = yield d.ToolsUtilitiesAWNS.matchFileMd5(t, e.md5)), i
                })
            }

            checkLoadPlugin(e) {
                return n(this, void 0, void 0, function* () {
                    S.information("checkLoadPlugin enter"), void 0 !== e.loadtype && (1 === e.loadtype && void 0 !== e.time && e.time >= 0 ? setTimeout(() => {
                        this.loadPlugin(e.name).catch()
                    }, 1e3 * e.time) : 2 === e.loadtype && (this.emitter && this.emitter.emit(u.NodeEventMesssageNS.eventPluginLoderPluginReady, e.name), yield this.setPluginStatus(e.name, "ready")))
                })
            }

            onDownloadPluginFinish(e, t) {
                return n(this, void 0, void 0, function* () {
                    S.information("onDownloadPluginFinish bSuccess:", e, "name:", t.name, "index:", this.handlePluginIndex);
                    const n = `${this.currentDir}${t.name}.zip`, a = `${this.currentDir}${t.name}/`;
                    let o = !1, r = !1, s = !1;
                    if (e) {
                        let e = yield l.FileSystemAWNS.existsAW(a);
                        if (e && (s = yield this.isPluginUnzip(t)), r = e, o = !s) {
                            const {UnzipUtilitiesAWNS: e} = yield Promise.resolve().then(() => i(94));
                            (r = yield e.uncompressZipFile(a, n)) ? (yield this.updateUpPlugins(t), this.updateStat(this.unzipPluginsStat, {
                                name: t.name,
                                version: t.version,
                                state: "success",
                                errorCode: 0
                            })) : this.updateStat(this.unzipPluginsStat, {
                                name: t.name,
                                version: t.version,
                                state: "fail",
                                errorCode: -1
                            })
                        }
                        if (r) {
                            let e = {version: t.version, md5: t.md5, unzipstate: !0};
                            this.updatePluginUnzip(t, e), yield this.checkLoadPlugin(t), ++this.handlePluginIndex
                        } else ++this.handlePluginIndex
                    } else ++this.handlePluginIndex;
                    this.handlePluginIndex === this.getPluginsCount() && (S.information("send stat and save config after load finish"), this.sendPluginStat(this.downloadPluginsStat, "plugin_download"), this.downloadPluginsStat = [], this.sendPluginStat(this.unzipPluginsStat, "plugin_decompression"), this.unzipPluginsStat = [], this.sendPluginStat(this.loadPluginsStat, "plugin_load"), this.loadPluginsStat = [], yield this.saveUpdatePluginsConfig(), yield this.saveUnzipConfig())
                })
            }

            checkDownloadPlugin(e) {
                return n(this, void 0, void 0, function* () {
                    if (S.information("checkDownloadPlugin enter"), yield this.checkFile(e)) yield this.onDownloadPluginFinish(!0, e); else {
                        let t = {version: e.version, md5: e.md5, unzipstate: !1};
                        this.updatePluginUnzip(e, t), yield this.downloadPlugin(e, this.onDownloadPluginFinish.bind(this))
                    }
                })
            }

            detachTakStatusChangeEvent(e) {
                null !== this.taskStatusChangedEventTable[e] && void 0 !== this.taskStatusChangedEventTable[e] && (S.information("取消监听 ", this.taskStatusChangedEventTable[e]), C.detachTaskEvent(p.DownloadKernel.TaskEventType.StatusChanged, this.taskStatusChangedEventTable[e]), this.taskStatusChangedEventTable[e] = null)
            }

            attachTaskStatusChangedEvent(e, t) {
                S.information("attachTaskStatusChangedEvent taskId: ", e), void 0 !== this.taskStatusChangedEventTable[e] && null !== this.taskStatusChangedEventTable[e] || (this.taskStatusChangedEventTable[e] = C.attachTaskEvent(p.DownloadKernel.TaskEventType.StatusChanged, (...i) => n(this, void 0, void 0, function* () {
                    let n = !1;
                    do {
                        if (!i) {
                            S.information("args is null");
                            break
                        }
                        if (i[0] !== p.DownloadKernel.TaskEventType.StatusChanged) {
                            S.information("args[0] is not StatusChanged");
                            break
                        }
                        let a = i[1];
                        if (!a) {
                            S.information("taskList is null");
                            break
                        }
                        for (let i = 0; i < a.length; ++i) {
                            let o = a[i];
                            if (!o) continue;
                            if (o.getId() !== e) continue;
                            let r = o.getTaskStatus();
                            S.information("get status ", r), r === p.DownloadKernel.TaskStatus.Succeeded ? (yield this.onDownloadPluginFinish(!0, t), this.updateStat(this.downloadPluginsStat, {
                                name: t.name,
                                version: t.version,
                                state: "success",
                                errorCode: 0
                            }), this.detachTakStatusChangeEvent(e)) : r === p.DownloadKernel.TaskStatus.Failed && (yield this.onDownloadPluginFinish(!1, t), this.updateStat(this.downloadPluginsStat, {
                                name: t.name,
                                version: t.version,
                                state: "fail",
                                errorCode: -1
                            }), this.detachTakStatusChangeEvent(e)), n = !0
                        }
                    } while (0);
                    return n
                })))
            }

            downloadPlugin(e, t) {
                return n(this, void 0, void 0, function* () {
                    S.information("downloadPlugin enter");
                    let a = !1;
                    const o = `${this.currentDir}`, s = `${this.currentDir}${e.name}.zip`, d = `${e.name}.zip`;
                    do {
                        if (void 0 !== e.url) {
                            let t = null;
                            try {
                                r.default.defaults.adapter = i(21), t = yield r.default.get(e.url, {responseType: "arraybuffer"})
                            } catch (e) {
                                break
                            }
                            if (null !== t && void 0 !== t.status && 200 === t.status && null !== t.data) {
                                if (yield l.FileSystemAWNS.writeFileAW(s, t.data)) {
                                    a = yield this.checkFile(e);
                                    break
                                }
                                break
                            }
                            break
                        }
                    } while (0);
                    a ? (t(!0, e), this.updateStat(this.downloadPluginsStat, {
                        name: e.name,
                        version: e.version,
                        state: "success",
                        errorCode: 0
                    }), yield l.FileSystemAWNS.unlinkAW(s + ".xltd"), yield l.FileSystemAWNS.unlinkAW(s + ".xltd.cfg")) : l.FileSystemAWNS.unlinkAW(s).then(() => n(this, void 0, void 0, function* () {
                        let t = {
                            taskBaseInfo: {savePath: o, taskName: d},
                            p2spTaskInfo: {url: e.url, nameFixed: 1},
                            isBackground: !0
                        }, i = yield w.createTask(p.DownloadKernel.TaskType.P2sp, t);
                        if (null !== i) {
                            let t = i.getTaskAttribute(p.DownloadKernel.TaskAttribute.TaskId);
                            this.attachTaskStatusChangedEvent(t, e), y.DownloadDispatchNS.startTask(t)
                        }
                    })).catch()
                })
            }

            downloadPlugins() {
                if (S.information("downloadPlugins enter"), null !== this.plugins && null !== this.plugins.data && void 0 !== this.plugins.data) for (let e = 0; e < this.plugins.data.length; ++e) {
                    let t = this.plugins.data[e];
                    null !== t && void 0 !== t.name && void 0 !== t.status && t.status && this.checkDownloadPlugin(t).then().catch()
                }
            }
        }
    }(t.PluginLoaderNS || (t.PluginLoaderNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(6), r = i(0), s = o.default(a.join(__rootDir, "../bin/ThunderHelper.node")),
        l = r.default.getLogger("diskimage-helper");
    !function (e) {
        e.attachVirtualDisk = function (e) {
            return n(this, void 0, void 0, function* () {
                return l.information("attachVirtualDisk imagePath:", e), new Promise(t => {
                    s.attachVirtualDisk(e, i => {
                        l.information("attachVirtualDisk imagePath:", e, "physicalPath:", i), t(i)
                    })
                })
            })
        }, e.detachVirtualDisk = function (e) {
            return n(this, void 0, void 0, function* () {
                return l.information("detachVirtualDisk imagePath:", e), new Promise(t => {
                    s.detachVirtualDisk(e, i => {
                        l.information("detachVirtualDisk imagePath:", e, "ret:", i), t(0 === i)
                    })
                })
            })
        }, e.getVirtualDiskPhysicalPath = function (e) {
            return n(this, void 0, void 0, function* () {
                return l.information("getVirtualDiskPhysicalPath imagePath:", e), new Promise(t => {
                    s.getVirtualDiskPhysicalPath(e, i => {
                        l.information("getVirtualDiskPhysicalPath imagePath:", e, "physicalPath:", i), t(i)
                    })
                })
            })
        }
    }(t.DiskImageHelperNS || (t.DiskImageHelperNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(7), o = i(20), r = i(3), s = i(15), l = i(11), d = i(0), u = i(64), c = i(55), h = i(54), f = i(71),
        g = l.DownloadKernelTaskManager.getTaskManager(), p = s.DownloadKernelEventManager.getEventManager(),
        v = d.default.getLogger("Thunder.DownloadAndPlayNodeIPC");
    !function (e) {
        let t, i, s, l, d = void 0;

        function m(e, ...t) {
            return n(this, void 0, void 0, function* () {
                let i = o.server.getRemoteClient(u.CommonIPCBase.mainRendererContext, "xmplite");
                return i ? o.server.callClientFunctionByName(i, e, ...t) : null
            })
        }

        function y(e, t, i) {
            a.client.callServerFunction("BringMainWndToTop").catch(), a.client.callServerFunction("OpenNewTab", i).catch()
        }

        function k(e, t, i) {
            f.clientProduct.updatePlayTaskId(i).catch()
        }

        function T(e, t, i) {
            v.information("setOrderDownload taskId:", i);
            do {
                let e = g.getTaskFromTaskId(i);
                if (!e) break;
                e.setDownloadStrategy(1)
            } while (0)
        }

        function w(e, t, i) {
            v.information("setDisorderDownload taskId:", i);
            do {
                let e = g.getTaskFromTaskId(i);
                if (!e) break;
                e.setDownloadStrategy(0)
            } while (0)
        }

        function C(e, t, i) {
            v.information("onStopPlay taskId:", i)
        }

        function S(e, t, i, n) {
            v.information("onPlayCompleted taskId:", i, "fileIndex", n);
            do {
                let e = g.getTaskFromTaskId(i);
                if (!e) break;
                if (e.getType() === r.DownloadKernel.TaskType.Bt) {
                    let t = e.getExtraObject().getBtFileByRealIndex(n);
                    if (t) {
                        let e = t.getBtFileAttribute(r.DownloadKernel.BtFileAttribute.Duration);
                        t.setPlayPosition(e)
                    }
                } else {
                    let t = e.getTaskAttribute(r.DownloadKernel.TaskAttribute.Duration);
                    e.setPlayPosition(t)
                }
            } while (0)
        }

        function b(e, t, i, n, a, o) {
            v.information("onUpdateDurationAndPosition taskId:", i, "fileIndex", n, "duration:", a, "position:", o);
            do {
                let e = g.getTaskFromTaskId(i);
                if (!e) break;
                if (e.getType() === r.DownloadKernel.TaskType.Bt) {
                    let t = e.getExtraObject().getBtFileByRealIndex(n);
                    t && (t.setDuration(a), t.setPlayPosition(o))
                } else e.setDuration(a), e.setPlayPosition(o)
            } while (0)
        }

        e.init = function () {
            o.server.registerFunctions({
                SetOrderDownload: T,
                SetDisorderDownload: w,
                OnStopPlay: C,
                OnPlayCompleted: S,
                OnUpdateDurationAndPosition: b,
                OpenURL: y,
                UpdatePlayTaskId: k
            }), d = p.attachTaskEvent(r.DownloadKernel.TaskEventType.StatusChanged, (...e) => {
                do {
                    if (!e) break;
                    if (e[0] !== r.DownloadKernel.TaskEventType.StatusChanged) break;
                    if (!e[1]) break;
                    e[1].forEach(e => {
                        let t = e.getTaskStatus();
                        t === r.DownloadKernel.TaskStatus.StopPending ? m("OnTaskStopPending", e.getId()).catch() : t === r.DownloadKernel.TaskStatus.Stopped ? m("OnTaskStopped", e.getId()).catch() : t === r.DownloadKernel.TaskStatus.Started ? m("OnTaskStarted", e.getId()).catch() : t === r.DownloadKernel.TaskStatus.Succeeded || t === r.DownloadKernel.TaskStatus.Seeding ? m("OnTaskSuccess", e.getId()).catch() : t === r.DownloadKernel.TaskStatus.DestroyPending ? m("OnTaskDestroyPending", e.getId()).catch() : t === r.DownloadKernel.TaskStatus.Failed && m("OnTaskFailed", e.getId()).catch()
                    })
                } while (0)
            }), t = p.attachTaskEvent(r.DownloadKernel.TaskEventType.InsertToCategoryView, (e, t, i, n) => {
                if (e !== r.DownloadKernel.TaskEventType.InsertToCategoryView) return;
                let a = [];
                for (let e = 0; e < n.length; e++) {
                    let t = n[e].getId();
                    t && a.push(t)
                }
                m("OnTaskInserted", t, i, a).catch()
            }), i = p.attachTaskEvent(r.DownloadKernel.TaskEventType.RemoveFromCategoryView, (e, t, i, n) => {
                if (e !== r.DownloadKernel.TaskEventType.RemoveFromCategoryView) return;
                let a = [];
                for (let e = 0; e < n.length; e++) {
                    let t = n[e].getId();
                    t && a.push(t)
                }
                m("OnTaskRemoved", t, i, a).catch()
            }), s = p.attachTaskEvent(r.DownloadKernel.TaskEventType.DetailChanged, (e, t, i) => {
                if (e !== r.DownloadKernel.TaskEventType.DetailChanged) return;
                let n = [];
                for (let e = 0; e < t.length; e++) {
                    let i = t[e].getId();
                    i && n.push(i)
                }
                m("OnTaskDetailChanged", n, i).catch()
            }), l = p.attachTaskEvent(r.DownloadKernel.TaskEventType.DcdnStatusChanged, (e, t) => {
                if (e !== r.DownloadKernel.TaskEventType.DcdnStatusChanged) return;
                let i = {};
                for (let e = 0; e < t.length; ++e) {
                    let n = t[e];
                    if (!n) continue;
                    let a = n.getTaskAttribute(r.DownloadKernel.TaskAttribute.TaskId),
                        o = n.getTaskChannelInfo().dcdnStatus;
                    i[a] = o
                }
                m("OnTaskDcdnStatusChanged", i).catch()
            }), c.quitPromises.addBefore(() => new Promise(e => n(this, void 0, void 0, function* () {
                v.information("callClientFunctionByName getXmpShowMode begin");
                let t = (yield o.server.callClientFunctionByName(u.CommonIPCBase.mainProcessContext, "getXmpShowMode"))[0];
                v.information("callClientFunctionByName getXmpShowMode end"), v.information("quitPromises showMode", t), t === h.XMPShowMode.EMBED_CHILD_MODE && (yield o.server.callClientFunctionByName(u.CommonIPCBase.mainProcessContext, "showPlayerWindow", h.CmdShow.SW_HIDE), v.information("callClientFunctionByName OnUnbindAndExit begin"), yield m("OnUnbindAndExit"), v.information("callClientFunctionByName OnUnbindAndExit end")), e(!0)
            })))
        }, e.uninit = function () {
            void 0 !== d && (p.detachTaskEvent(r.DownloadKernel.TaskEventType.StatusChanged, d), d = void 0), t && (p.detachTaskEvent(r.DownloadKernel.TaskEventType.InsertToCategoryView, t), t = void 0), i && (p.detachTaskEvent(r.DownloadKernel.TaskEventType.RemoveFromCategoryView, t), i = void 0), s && (p.detachTaskEvent(r.DownloadKernel.TaskEventType.DetailChanged, t), s = void 0), l && (p.detachTaskEvent(r.DownloadKernel.TaskEventType.DcdnStatusChanged, l), l = void 0)
        }, e.nofityXMP = m
    }(t.DownloadAndPlayNodeIPCNS || (t.DownloadAndPlayNodeIPCNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        let t = "";
        e.getRecommends = function () {
            return t
        }, e.setRecommends = function (e) {
            t = e
        }
    }(t.SearchConfigNS || (t.SearchConfigNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(16), o = i(26), r = i(24), s = i(538), l = i(30), d = i(15), u = i(11), c = i(3), h = i(13), f = i(0),
        g = i(4), p = i(55), v = i(2), m = i(5), y = i(34), k = f.default.getLogger("DownloadDataManager"),
        T = u.DownloadKernelTaskManager.getTaskManager(), w = d.DownloadKernelEventManager.getEventManager();
    const C = new class {
        constructor() {
            this.reportTimerId = null, this.downloadDataRecord = {}, this.initDate = "", this.initTodayDownloadSize = 0, this.initTodayUploadSize = 0, this.initDownloadSize = 0, this.initUploadSize = 0, this.initTotalBenifites = 0, this.initTotalProviders = 0, this.initMaxDownloadSpeed = 0, this.initMaxUploadSpeed = 0, this.initVipDownloadSize = 0, this.initDownloadFiles = 0, this.initVipSave = 0, this.downloadFinishFilesCur = 0, this.vipSaveCur = 0, this.curUid = "", this.downloadDataDir = v.join(__profilesDir, "DownloadData/"), this.downloadDataPath = v.join(__profilesDir, "DownloadData/UserDownloadData.dat"), this.downloadData = {
                totalDownloadSpeed: 0,
                totalUploadSpeed: 0,
                todayDownloadSize: 0,
                todayUploadSize: 0,
                totalDownloadSize: 0,
                totalUploadSize: 0,
                totalProviders: 0,
                totalBenifites: 0,
                maxDownloadSpeed: 0,
                maxUploadSpeed: 0,
                downloadFinishFiles: 0,
                vipAccPercent: 0,
                vipDonwloadSize: 0,
                vipSave: 0
            }, this.downloadDataBeforeLogin = {
                downloadSize: 0,
                uploadSize: 0,
                providers: 0,
                benifites: 0,
                vipDownloadSizePre: 0
            }, this.downloadTaskData = new Map, p.quitPromises.add(() => new Promise(e => n(this, void 0, void 0, function* () {
                this.reportDownloadData().catch(), yield this.saveDownloadData(), e(!0)
            })))
        }

        getSessionID() {
            return n(this, void 0, void 0, function* () {
                return new Promise(e => {
                    r.LoginHelperNS.loginHelper.getUserInfo("sessionid", function (t) {
                        k.information("getSessionID:sessionid = ", t), e(t)
                    })
                })
            })
        }

        init() {
            return n(this, void 0, void 0, function* () {
                k.information("init Enter");
                let e = !1;
                return (yield m.FileSystemAWNS.existsAW(`${this.downloadDataDir}`)) || (yield m.FileSystemAWNS.mkdirsAW(`${this.downloadDataDir}`)), (yield r.LoginHelperNS.loginHelper.isLoginedAw()) && (this.curUid = (yield this.getUserID()) || "", e = yield this.initDownloadData()), a.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", t => n(this, void 0, void 0, function* () {
                    k.information("onLoginSuc userId:", t), this.curUid = t, this.downloadDataBeforeLogin.downloadSize = l.DownloadKernelManager.getTotalDownloadSize(), this.downloadDataBeforeLogin.uploadSize = l.DownloadKernelManager.getTotalUploadSize(), this.downloadDataBeforeLogin.benifites = yield this.getBenifites();
                    let i = this.getProvidersAndVipDownloadSize();
                    this.downloadDataBeforeLogin.providers = i[0], this.downloadDataBeforeLogin.vipDownloadSizePre = i[1], e = yield this.initDownloadData()
                })), a.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", e => n(this, void 0, void 0, function* () {
                    k.information("onLogout userId = ", this.curUid), yield this.saveDownloadData(), this.curUid = "", this.killTimer()
                })), l.DownloadKernelManager.attachListener(h.NodeEventMesssageNS.eventGlobalDownloadSpeedChanged, e => n(this, void 0, void 0, function* () {
                    "" !== this.curUid && (this.downloadData.totalDownloadSpeed = l.DownloadKernelManager.getTotalTaskDownloadSpeed(!1), this.downloadData.maxDownloadSpeed = this.downloadData.maxDownloadSpeed > this.downloadData.totalDownloadSpeed ? this.downloadData.maxDownloadSpeed : this.downloadData.totalDownloadSpeed, yield this.updateData())
                })), l.DownloadKernelManager.attachListener(h.NodeEventMesssageNS.eventGlobalUploadSpeedChanged, e => n(this, void 0, void 0, function* () {
                    "" !== this.curUid && (this.downloadData.totalUploadSpeed = e, this.downloadData.maxUploadSpeed = this.downloadData.maxUploadSpeed > e ? this.downloadData.maxUploadSpeed : e, yield this.updateData())
                })), w.attachTaskEvent(c.DownloadKernel.TaskEventType.StatusChanged, (...e) => n(this, void 0, void 0, function* () {
                    do {
                        if ("" === this.curUid) break;
                        if (!e) break;
                        if (e[0] !== c.DownloadKernel.TaskEventType.StatusChanged) break;
                        let t = e[1];
                        if (!t) break;
                        for (let e = 0; e < t.length; ++e) {
                            let i = t[e];
                            if (i && i.getTaskStatus() === c.DownloadKernel.TaskStatus.Succeeded) {
                                let e = 0;
                                if (!i.getTaskAttribute(c.DownloadKernel.TaskAttribute.Background)) {
                                    let t = i.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskType);
                                    t === c.DownloadKernel.TaskType.Emule || t === c.DownloadKernel.TaskType.P2sp ? e = 1 : t === c.DownloadKernel.TaskType.Bt ? e = i.getExtraObject().getDownloadFile().length : t === c.DownloadKernel.TaskType.Group && (e = i.getExtraObject().getDownloadTaskCount())
                                }
                                this.downloadFinishFilesCur += e, this.calculateVipSaveTime(i)
                            }
                        }
                        yield this.updateData()
                    } while (0)
                })), e
            })
        }

        calculateVipSaveTime(e) {
            do {
                let t = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.FileSize), i = e.getTaskChannelInfo(),
                    n = i.offlineSize + i.dcdnSize;
                if (0 === n || t <= n) break;
                let a = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.DownloadingPeriod);
                a = 0 !== a ? a : 1;
                let o = Math.round(t * a / (t - n) - a);
                this.vipSaveCur += o
            } while (0)
        }

        initDownloadData() {
            return n(this, void 0, void 0, function* () {
                let e = !1;
                this.downloadFinishFilesCur = 0, this.vipSaveCur = 0, this.downloadTaskData.clear(), yield this.loadDownloadData();
                let t = yield s.getDownloadData({});
                return k.information("initDownloadData res = ", t), !t[1] && t[0] && (t[0].total_download && t[0].total_download > this.initDownloadSize && (this.initDownloadSize = t[0].total_download || 0, this.initUploadSize = t[0].total_upload || 0, this.initTotalBenifites = t[0].total_benefit || 0, this.initTotalProviders = t[0].total_provider || 0, this.initMaxDownloadSpeed = t[0].peak_downspeed || 0, this.initMaxUploadSpeed = t[0].peak_upspeed || 0, this.initVipDownloadSize = t[0].vip_download || 0, this.initVipSave = t[0].vip_save || 0, this.initDownloadFiles = t[0].download_file || 0), this.reportTimerId = setInterval(() => n(this, void 0, void 0, function* () {
                    this.reportDownloadData().catch(), yield this.saveDownloadData()
                }), 18e5), e = !0), this.downloadData.maxDownloadSpeed = this.initMaxDownloadSpeed, this.downloadData.maxUploadSpeed = this.initMaxUploadSpeed, yield this.updateData(), e
            })
        }

        reportDownloadData() {
            return n(this, void 0, void 0, function* () {
                let e = yield s.postDownloadData({
                    total_download: this.downloadData.totalDownloadSize,
                    total_upload: this.downloadData.totalUploadSize,
                    total_provider: this.downloadData.totalProviders,
                    total_benefit: this.downloadData.totalBenifites,
                    peak_downspeed: this.downloadData.maxDownloadSpeed,
                    peak_upspeed: this.downloadData.maxUploadSpeed,
                    vip_download: this.downloadData.vipDonwloadSize,
                    vip_save: this.downloadData.vipSave,
                    download_file: this.downloadData.downloadFinishFiles
                });
                k.information("reportDownloadData res = ", e)
            })
        }

        killTimer() {
            this.reportTimerId && (clearInterval(this.reportTimerId), this.reportTimerId = null)
        }

        getBenifites() {
            return n(this, void 0, void 0, function* () {
                return new Promise(e => {
                    l.DownloadKernelManager.getSumOfRemotePeerBeBenefited(t => {
                        e(t)
                    })
                })
            })
        }

        getProvidersAndVipDownloadSize() {
            let e = [0, 0], t = T.getStartTaskIDs();
            for (let e = 0; e < t.length; ++e) {
                let i = T.getTaskFromTaskId(t[e]);
                if (i && !i.getTaskAttribute(c.DownloadKernel.TaskAttribute.Background)) {
                    let n = i.getTotalAvailablePeer(), a = i.getVipDownloadSizeCur();
                    this.downloadTaskData.set(t[e], {providers: n, vipDownloadSize: a})
                }
            }
            for (let t of this.downloadTaskData.values()) e[0] += t.providers, e[1] += t.vipDownloadSize;
            return e
        }

        updateData() {
            return n(this, void 0, void 0, function* () {
                this.initDate !== this.getCurDate() && (this.initDate = this.getCurDate(), this.initTodayDownloadSize = 0, this.initTodayUploadSize = 0, this.downloadDataBeforeLogin.downloadSize = l.DownloadKernelManager.getTotalDownloadSize(), this.downloadDataBeforeLogin.uploadSize = l.DownloadKernelManager.getTotalUploadSize()), this.downloadData.todayDownloadSize = this.initTodayDownloadSize + l.DownloadKernelManager.getTotalDownloadSize() - this.downloadDataBeforeLogin.downloadSize, this.downloadData.todayUploadSize = this.initTodayUploadSize + l.DownloadKernelManager.getTotalUploadSize() - this.downloadDataBeforeLogin.uploadSize, this.downloadData.totalDownloadSize = this.initDownloadSize + l.DownloadKernelManager.getTotalDownloadSize() - this.downloadDataBeforeLogin.downloadSize, this.downloadData.totalUploadSize = this.initUploadSize + l.DownloadKernelManager.getTotalUploadSize() - this.downloadDataBeforeLogin.uploadSize, this.downloadData.totalDownloadSize = this.downloadData.totalDownloadSize > this.downloadData.todayDownloadSize ? this.downloadData.totalDownloadSize : this.downloadData.todayDownloadSize, this.downloadData.totalUploadSize = this.downloadData.totalUploadSize > this.downloadData.todayUploadSize ? this.downloadData.totalUploadSize : this.downloadData.todayUploadSize;
                let e = yield this.getBenifites();
                this.downloadData.totalBenifites = this.initTotalBenifites + e - this.downloadDataBeforeLogin.benifites;
                let t = this.getProvidersAndVipDownloadSize();
                t[0] < this.downloadDataBeforeLogin.providers && (t[0] = this.downloadDataBeforeLogin.providers), t[1] < this.downloadDataBeforeLogin.vipDownloadSizePre && (t[1] = this.downloadDataBeforeLogin.vipDownloadSizePre), this.downloadData.totalProviders = this.initTotalProviders + t[0] - this.downloadDataBeforeLogin.providers, this.downloadData.vipDonwloadSize = this.initVipDownloadSize + t[1] - this.downloadDataBeforeLogin.vipDownloadSizePre, this.downloadData.vipDonwloadSize = this.downloadData.vipDonwloadSize > this.downloadData.totalDownloadSize ? this.downloadData.totalDownloadSize : this.downloadData.vipDonwloadSize, 0 === this.downloadData.totalDownloadSize ? this.downloadData.vipAccPercent = 0 : this.downloadData.vipAccPercent = this.downloadData.vipDonwloadSize / this.downloadData.totalDownloadSize, this.downloadData.vipSave = this.initVipSave + this.vipSaveCur, this.downloadData.downloadFinishFiles = this.initDownloadFiles + this.downloadFinishFilesCur, o.NativeCallHostModule.nativeCallHost.fireNativeEvent("download-data-update", JSON.stringify(this.downloadData))
            })
        }

        getDownloadData() {
            return this.downloadData
        }

        getCurDate() {
            let e = "", t = new Date;
            return e = `${t.getFullYear()}-${t.getMonth() + 1}-${t.getDate()}`
        }

        saveDownloadData() {
            return n(this, void 0, void 0, function* () {
                try {
                    "" !== this.curUid && (this.downloadDataRecord[this.curUid] = this.downloadDataRecord[this.curUid] || {}, this.downloadDataRecord[this.curUid].DownloadData = this.downloadData, this.downloadDataRecord[this.curUid].SaveDate = this.getCurDate()), k.information("saveDownloadData downloadData = ", this.downloadDataRecord);
                    let e = JSON.stringify(this.downloadDataRecord);
                    k.information("saveDownloadData bufStr:", e);
                    let t = new Buffer(e), i = y.ToolsUtilitiesAWNS.genarateMd5("thunderx").substr(0, 16).toUpperCase(),
                        n = y.ToolsUtilitiesAWNS.encryptBuffer(t, i);
                    yield m.FileSystemAWNS.writeFileAW(this.downloadDataPath, n)
                } catch (e) {
                    k.information(e)
                }
            })
        }

        clearInitData() {
            this.initDownloadSize = 0, this.initUploadSize = 0, this.initTotalBenifites = 0, this.initTotalProviders = 0, this.initMaxDownloadSpeed = 0, this.initMaxUploadSpeed = 0, this.initVipDownloadSize = 0, this.initVipSave = 0, this.initDownloadFiles = 0, this.initTodayDownloadSize = 0, this.initTodayUploadSize = 0
        }

        loadDownloadData() {
            return n(this, void 0, void 0, function* () {
                do {
                    if (this.clearInitData(), "" === this.curUid) break;
                    let e = yield m.FileSystemAWNS.readFileAW(`${this.downloadDataPath}`);
                    if (g.isNullOrUndefined(e) || "" === e.toString()) {
                        k.information("loadDownloadData buf is null");
                        break
                    }
                    let t = "";
                    try {
                        let i = y.ToolsUtilitiesAWNS.genarateMd5("thunderx").substr(0, 16).toUpperCase();
                        if (t = y.ToolsUtilitiesAWNS.decryptBuffer(e, i).toString(), g.isNullOrUndefined(t) || "" === t) {
                            k.information("loadDownloadData bufStr is null");
                            break
                        }
                        if (this.downloadDataRecord = JSON.parse(t), "" !== this.curUid && g.isNullOrUndefined(this.downloadDataRecord[this.curUid])) {
                            this.downloadDataRecord[this.curUid] = {};
                            break
                        }
                        this.initDate = this.downloadDataRecord[this.curUid].SaveDate, this.initDownloadSize = this.downloadDataRecord[this.curUid].DownloadData.totalDownloadSize || 0, this.initUploadSize = this.downloadDataRecord[this.curUid].DownloadData.totalUploadSize || 0, this.initTotalBenifites = this.downloadDataRecord[this.curUid].DownloadData.totalBenifites || 0, this.initTotalProviders = this.downloadDataRecord[this.curUid].DownloadData.totalProviders || 0, this.initMaxDownloadSpeed = this.downloadDataRecord[this.curUid].DownloadData.maxDownloadSpeed || 0, this.initMaxUploadSpeed = this.downloadDataRecord[this.curUid].DownloadData.maxUploadSpeed || 0, this.initVipDownloadSize = this.downloadDataRecord[this.curUid].DownloadData.vipDonwloadSize || 0, this.initVipSave = this.downloadDataRecord[this.curUid].DownloadData.vipSave || 0, this.initDownloadFiles = this.downloadDataRecord[this.curUid].DownloadData.downloadFinishFiles || 0, this.downloadDataRecord[this.curUid].SaveDate !== this.getCurDate() ? (this.initTodayDownloadSize = 0, this.initTodayUploadSize = 0) : (this.initTodayDownloadSize = this.downloadDataRecord[this.curUid].DownloadData.todayDownloadSize || 0, this.initTodayUploadSize = this.downloadDataRecord[this.curUid].DownloadData.todayUploadSize || 0), k.information("loadDownloadData decryption downloadData:", this.downloadDataRecord, this.initMaxDownloadSpeed, this.initDownloadSize)
                    } catch (e) {
                        k.information("loadDownloadData exception", e)
                    }
                } while (0)
            })
        }

        getUserID() {
            return n(this, void 0, void 0, function* () {
                return new Promise(e => {
                    r.LoginHelperNS.loginHelper.getUserInfo("userid", function (t) {
                        k.information("getUserID:userid = ", t), e(t)
                    })
                })
            })
        }
    };
    t.default = C
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(65), o = i(0).default.getLogger("community");
    t.getUnreadMsgNum = function (e) {
        return a.fetchSlRes({url: "/xlppc.notification.api/v2/msg/unread", data: {}})
    }, t.getUnreadNoticeNum = function (e) {
        return a.fetchSlRes({url: "/msgcenter/pc/unread_count", data: {_h: {"Chat-Version": 4}, user_id: e}})
    }, t.getUnreadCircleMsgNum = function (e) {
        return n(this, void 0, void 0, function* () {
            return a.fetchSlRes({url: "/xlppc.notification.api/msg/unread", data: {}})
        })
    }, t.getVideoPreviewInfo = function (e, t, i, o) {
        return n(this, void 0, void 0, function* () {
            let n = {type: e, res: t};
            return i && (n.index = i), a.fetchSlRes({
                url: "/xlppc.resinfo.api/v3/queryresinfo",
                data: n,
                method: "post"
            })
        })
    }, t.isResourceLegal = function (e, t, i) {
        return n(this, void 0, void 0, function* () {
            if (!i || !t) return !1;
            if (i.length <= 0 || t.length <= 0) return !1;
            let n = yield a.fetchRequest({
                url: "http://client.filter.hub.sandai.net/filter_task?type=" + t + "&from=" + i,
                data: e,
                method: "post"
            });
            if (o.information("isResourceLegal:,res", n), !n || !n.data) return !1;
            let r = !1;
            do {
                if ("string" == typeof n.data) try {
                    n.data = JSON.parse(n.data)
                } catch (e) {
                    r = !1;
                    break
                }
                "bt" === t ? r = 0 === n.data.ret_code || 1 === n.data.ret_code || 2 === n.data.ret_code : 1 === n.data.ret_code ? r = !0 : 0 === n.data.ret_code ? n.data.result && n.data.result[0] && 0 === n.data.result[0].ret_code && (r = !0) : r = !1
            } while (0);
            return r
        })
    }, t.getUnreadMsgs = function (e, t, i, n) {
        return a.fetchSlRes({
            url: "/xlppc.notification.api/v2/msg/comments",
            data: {reset_read_status: t, cursor: i || 0, size: n || 0}
        })
    }, t.getStarsMsg = function (e, t, i, n) {
        return a.fetchSlRes({
            url: "/xlppc.notification.api/v2/msg/stars",
            data: {reset_read_status: t, cursor: i, size: n}
        })
    }, t.getUserInfo = function (e) {
        return a.fetchSlRes({url: "/user_info/pc_info", data: {uid: e}})
    }, t.getUserSessionList = function (e, t = 60) {
        return a.fetchSlRes({url: "/chitchat/sessions", data: {uid: e, limit: t}})
    }
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(4), o = i(0), r = i(5), s = i(55), l = o.default.getLogger("History");
    let d = 3e3, u = 18e4, c = 15;
    const h = `${__profilesDir}/historys.json`;
    let f = new class {
        constructor() {
            this.inited = !1, this.heartTimerId = void 0, this.count = 0, this.needSave = !1, this.quitAttached = !1, this.records = {}, this.historys = {}
        }

        get length() {
            return this.count
        }

        getDayString(e) {
            let t = "";
            do {
                if (!e) break;
                let i = new Date(e);
                t = a.format("%d/%d/%d", i.getFullYear(), i.getMonth() + 1, i.getDate())
            } while (0);
            return t
        }

        isOverLongDays(e) {
            let t = !1, i = new Date(e), n = new Date(i.getFullYear(), i.getMonth(), i.getDate(), 0, 0, 0),
                a = new Date;
            return new Date(a.getFullYear(), a.getMonth(), a.getDate(), 0, 0, 0).getTime() - n.getTime() > 24 * (c - 1) * 60 * 60 * 1e3 && (t = !0), t
        }

        init() {
            return n(this, void 0, void 0, function* () {
                do {
                    if (this.inited) break;
                    if (this.inited = !0, !(yield r.FileSystemAWNS.existsAW(h))) break;
                    let e = (yield r.FileSystemAWNS.readFileAW(h)).toString(), t = null;
                    try {
                        t = JSON.parse(e)
                    } catch (e) {
                    }
                    if (!t) break;
                    this.records = t;
                    for (let e in this.records) {
                        let t = this.records[e];
                        if (t.visits) for (let i = 0; i < t.visits.length;) {
                            let n = t.visits[i];
                            if (this.isOverLongDays(n)) {
                                l.information("history is longlong ago", e, n), t.visits.splice(0, 1), 0 === t.visits.length && delete this.records[e];
                                continue
                            }
                            let a = this.getDayString(n), o = `${e}_${a}`;
                            this.historys.hasOwnProperty(o) ? l.warning("daily url exist", this.historys[o].url, this.historys[o].accessTime) : this.count++, this.historys[o] = {
                                url: e,
                                accessTime: n,
                                name: t.name,
                                iconUrl: t.iconUrl,
                                date: a
                            }, i++
                        }
                    }
                } while (0)
            })
        }

        getAllHistory(e = !1) {
            let t = Object.values(this.historys);
            return t.sort((e, t) => t.accessTime - e.accessTime), e && t.length > 0 && (t = t.map(e => (this.records && this.records[e.url] && (e.iconUrl || (e.iconUrl = this.records[e.url].iconUrl), e.name || (e.name = this.records[e.url].name)), e))), t
        }

        stopSaveTimer() {
            this.heartTimerId && (clearTimeout(this.heartTimerId), this.heartTimerId = void 0)
        }

        startSaveTimer() {
            void 0 === this.heartTimerId && (this.heartTimerId = setTimeout(() => n(this, void 0, void 0, function* () {
                clearTimeout(this.heartTimerId), this.heartTimerId = void 0, yield this.save()
            }), u)), this.quitAttached || (this.quitAttached = !0, s.quitPromises.add(() => new Promise(e => n(this, void 0, void 0, function* () {
                this.stopSaveTimer(), yield this.save(), e(!0)
            }))))
        }

        save() {
            return n(this, void 0, void 0, function* () {
                do {
                    if (!this.needSave) {
                        l.information("save but flag is false");
                        break
                    }
                    if (this.needSave = !1, yield this.init(), this.count > d) {
                        let e = this.getAllHistory();
                        if (this.count !== e.length && l.warning("exception on save count not match historys length"), e.length > d) for (let t = d; t < e.length; t++) {
                            let i = e[t], n = this.records[i.url];
                            if (n && i) {
                                let e = n.visits.indexOf(i.accessTime);
                                -1 !== e && n.visits.splice(e, 1), 0 === n.visits.length && delete this.records[i.url];
                                let t = `${i.url}_${this.getDayString(i.accessTime)}`;
                                delete this.historys[t]
                            }
                        }
                    }
                    yield r.FileSystemAWNS.writeFileAW(h, JSON.stringify(this.records))
                } while (0)
            })
        }

        getRecentHistory() {
            return n(this, void 0, void 0, function* () {
                let e = [];
                yield this.init();
                let t = this.getAllHistory(!0);
                return e = t.length > d ? t.slice(0, d) : t
            })
        }

        clear() {
            return n(this, void 0, void 0, function* () {
                yield r.FileSystemAWNS.unlinkAW(h), this.records = {}, this.historys = {}, this.needSave = !1, this.heartTimerId && (clearTimeout(this.heartTimerId), this.heartTimerId = void 0)
            })
        }

        delete(e) {
            return n(this, void 0, void 0, function* () {
                let t = this.records[e.url];
                if (t) {
                    let i = t.visits.indexOf(e.accessTime);
                    -1 !== i && (t.visits.splice(i, 1), this.needSave = !0, this.startSaveTimer()), 0 === t.visits.length && delete this.records[e.url]
                }
                let i = `${e.url}_${this.getDayString(e.accessTime)}`;
                delete this.historys[i]
            })
        }

        update(e, t) {
            return n(this, void 0, void 0, function* () {
                yield this.init();
                do {
                    if (!e.url) {
                        l.warning("update history exception url is null");
                        break
                    }
                    let i = (new Date).getTime(), n = this.getDayString(i), a = `${e.url}_${n}`,
                        o = this.records[e.url];
                    if (o) {
                        if ("OnAddressChange" === t) {
                            o.visitCount = o.visitCount + 1, o.lastAccessTime = i;
                            let t = this.historys[a];
                            if (t) {
                                let e = o.visits.indexOf(t.accessTime);
                                -1 !== e && (l.information("delete earlier this day", t.accessTime, i), o.visits.splice(e, 1), o.visits.push(i)), t.accessTime = i
                            } else o.visits.push(i), this.historys[a] = Object.assign({
                                accessTime: i,
                                date: n
                            }, e), this.count++
                        } else {
                            let t = this.historys[a];
                            t ? this.historys[a] = Object.assign({}, t, e) : l.warning("update exception")
                        }
                        e.iconUrl && (o.iconUrl = e.iconUrl), e.name && (o.name = e.name)
                    } else {
                        if ("OnAddressChange" !== t) {
                            l.warning("try to update history but never OnAddressChange");
                            break
                        }
                        this.records[e.url] = {
                            lastAccessTime: i,
                            visits: [i],
                            visitCount: 1,
                            iconUrl: e.iconUrl,
                            name: e.name
                        }, this.historys[a] = Object.assign({accessTime: i, date: n}, e), this.count++
                    }
                    this.needSave = !0, this.startSaveTimer()
                } while (0)
            })
        }
    };
    t.historyManager = f
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(18), r = i(58), s = i(5), l = i(61), d = i(0).default.getLogger("ShouleiInstallImg"),
        u = "http://static-xl.a.88cdn.com/json/mobile-pc.json";
    let c = "";
    t.getMobileImgSrc = function () {
        return n(this, void 0, void 0, function* () {
            let e = "";
            do {
                let t = null;
                try {
                    o.default.defaults.adapter = i(21), t = yield o.default.get(u)
                } catch (e) {
                    d.warning(e)
                }
                let n = "";
                if (null !== t && void 0 !== t.status && 200 === t.status && void 0 !== t.data && null !== t.data && t.data.downloadQR && (n = t.data.downloadQR), !n) break;
                let h = l.ParseUrlFileNameNS.getNameFromUrl(n);
                if (!h) break;
                let f = a.resolve(__profilesDir, `mobile/${h}`);
                if (f === c && (yield s.FileSystemAWNS.existsAW(f))) {
                    e = f;
                    break
                }
                d.information("downloadFileAW", n, f), (yield r.AxiosNS.downloadFileAW(n, f)) && (c = f, e = f)
            } while (0);
            return e
        })
    }
}, function (e, t, i) {
    (function (e) {
        var i = 200, n = "__lodash_hash_undefined__", a = 800, o = 16, r = 9007199254740991, s = "[object Arguments]",
            l = "[object AsyncFunction]", d = "[object Function]", u = "[object GeneratorFunction]",
            c = "[object Null]", h = "[object Object]", f = "[object Proxy]", g = "[object Undefined]",
            p = /^\[object .+?Constructor\]$/, v = /^(?:0|[1-9]\d*)$/, m = {};
        m["[object Float32Array]"] = m["[object Float64Array]"] = m["[object Int8Array]"] = m["[object Int16Array]"] = m["[object Int32Array]"] = m["[object Uint8Array]"] = m["[object Uint8ClampedArray]"] = m["[object Uint16Array]"] = m["[object Uint32Array]"] = !0, m[s] = m["[object Array]"] = m["[object ArrayBuffer]"] = m["[object Boolean]"] = m["[object DataView]"] = m["[object Date]"] = m["[object Error]"] = m[d] = m["[object Map]"] = m["[object Number]"] = m[h] = m["[object RegExp]"] = m["[object Set]"] = m["[object String]"] = m["[object WeakMap]"] = !1;
        var y = "object" == typeof global && global && global.Object === Object && global,
            k = "object" == typeof self && self && self.Object === Object && self,
            T = y || k || Function("return this")(), w = "object" == typeof t && t && !t.nodeType && t,
            C = w && "object" == typeof e && e && !e.nodeType && e, S = C && C.exports === w, b = S && y.process,
            I = function () {
                try {
                    var e = C && C.require && C.require("util").types;
                    return e || b && b.binding && b.binding("util")
                } catch (e) {
                }
            }(), _ = I && I.isTypedArray;
        var A, D, x, N = Array.prototype, E = Function.prototype, P = Object.prototype, M = T["__core-js_shared__"],
            O = E.toString, F = P.hasOwnProperty,
            L = (A = /[^.]+$/.exec(M && M.keys && M.keys.IE_PROTO || "")) ? "Symbol(src)_1." + A : "", B = P.toString,
            U = O.call(Object),
            R = RegExp("^" + O.call(F).replace(/[\\^$.*+?()[\]{}|]/g, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"),
            K = S ? T.Buffer : void 0, W = T.Symbol, V = T.Uint8Array, H = K ? K.allocUnsafe : void 0,
            z = (D = Object.getPrototypeOf, x = Object, function (e) {
                return D(x(e))
            }), j = Object.create, G = P.propertyIsEnumerable, $ = N.splice, X = W ? W.toStringTag : void 0,
            q = function () {
                try {
                    var e = Te(Object, "defineProperty");
                    return e({}, "", {}), e
                } catch (e) {
                }
            }(), Y = K ? K.isBuffer : void 0, J = Math.max, Z = Date.now, Q = Te(T, "Map"), ee = Te(Object, "create"),
            te = function () {
                function e() {
                }

                return function (t) {
                    if (!Pe(t)) return {};
                    if (j) return j(t);
                    e.prototype = t;
                    var i = new e;
                    return e.prototype = void 0, i
                }
            }();

        function ie(e) {
            var t = -1, i = null == e ? 0 : e.length;
            for (this.clear(); ++t < i;) {
                var n = e[t];
                this.set(n[0], n[1])
            }
        }

        function ne(e) {
            var t = -1, i = null == e ? 0 : e.length;
            for (this.clear(); ++t < i;) {
                var n = e[t];
                this.set(n[0], n[1])
            }
        }

        function ae(e) {
            var t = -1, i = null == e ? 0 : e.length;
            for (this.clear(); ++t < i;) {
                var n = e[t];
                this.set(n[0], n[1])
            }
        }

        function oe(e) {
            var t = this.__data__ = new ne(e);
            this.size = t.size
        }

        function re(e, t) {
            var i = Ae(e), n = !i && _e(e), a = !i && !n && xe(e), o = !i && !n && !a && Oe(e), r = i || n || a || o,
                s = r ? function (e, t) {
                    for (var i = -1, n = Array(e); ++i < e;) n[i] = t(i);
                    return n
                }(e.length, String) : [], l = s.length;
            for (var d in e) !t && !F.call(e, d) || r && ("length" == d || a && ("offset" == d || "parent" == d) || o && ("buffer" == d || "byteLength" == d || "byteOffset" == d) || we(d, l)) || s.push(d);
            return s
        }

        function se(e, t, i) {
            (void 0 === i || Ie(e[t], i)) && (void 0 !== i || t in e) || ue(e, t, i)
        }

        function le(e, t, i) {
            var n = e[t];
            F.call(e, t) && Ie(n, i) && (void 0 !== i || t in e) || ue(e, t, i)
        }

        function de(e, t) {
            for (var i = e.length; i--;) if (Ie(e[i][0], t)) return i;
            return -1
        }

        function ue(e, t, i) {
            "__proto__" == t && q ? q(e, t, {configurable: !0, enumerable: !0, value: i, writable: !0}) : e[t] = i
        }

        ie.prototype.clear = function () {
            this.__data__ = ee ? ee(null) : {}, this.size = 0
        }, ie.prototype.delete = function (e) {
            var t = this.has(e) && delete this.__data__[e];
            return this.size -= t ? 1 : 0, t
        }, ie.prototype.get = function (e) {
            var t = this.__data__;
            if (ee) {
                var i = t[e];
                return i === n ? void 0 : i
            }
            return F.call(t, e) ? t[e] : void 0
        }, ie.prototype.has = function (e) {
            var t = this.__data__;
            return ee ? void 0 !== t[e] : F.call(t, e)
        }, ie.prototype.set = function (e, t) {
            var i = this.__data__;
            return this.size += this.has(e) ? 0 : 1, i[e] = ee && void 0 === t ? n : t, this
        }, ne.prototype.clear = function () {
            this.__data__ = [], this.size = 0
        }, ne.prototype.delete = function (e) {
            var t = this.__data__, i = de(t, e);
            return !(i < 0 || (i == t.length - 1 ? t.pop() : $.call(t, i, 1), --this.size, 0))
        }, ne.prototype.get = function (e) {
            var t = this.__data__, i = de(t, e);
            return i < 0 ? void 0 : t[i][1]
        }, ne.prototype.has = function (e) {
            return de(this.__data__, e) > -1
        }, ne.prototype.set = function (e, t) {
            var i = this.__data__, n = de(i, e);
            return n < 0 ? (++this.size, i.push([e, t])) : i[n][1] = t, this
        }, ae.prototype.clear = function () {
            this.size = 0, this.__data__ = {hash: new ie, map: new (Q || ne), string: new ie}
        }, ae.prototype.delete = function (e) {
            var t = ke(this, e).delete(e);
            return this.size -= t ? 1 : 0, t
        }, ae.prototype.get = function (e) {
            return ke(this, e).get(e)
        }, ae.prototype.has = function (e) {
            return ke(this, e).has(e)
        }, ae.prototype.set = function (e, t) {
            var i = ke(this, e), n = i.size;
            return i.set(e, t), this.size += i.size == n ? 0 : 1, this
        }, oe.prototype.clear = function () {
            this.__data__ = new ne, this.size = 0
        }, oe.prototype.delete = function (e) {
            var t = this.__data__, i = t.delete(e);
            return this.size = t.size, i
        }, oe.prototype.get = function (e) {
            return this.__data__.get(e)
        }, oe.prototype.has = function (e) {
            return this.__data__.has(e)
        }, oe.prototype.set = function (e, t) {
            var n = this.__data__;
            if (n instanceof ne) {
                var a = n.__data__;
                if (!Q || a.length < i - 1) return a.push([e, t]), this.size = ++n.size, this;
                n = this.__data__ = new ae(a)
            }
            return n.set(e, t), this.size = n.size, this
        };
        var ce, he = function (e, t, i) {
            for (var n = -1, a = Object(e), o = i(e), r = o.length; r--;) {
                var s = o[ce ? r : ++n];
                if (!1 === t(a[s], s, a)) break
            }
            return e
        };

        function fe(e) {
            return null == e ? void 0 === e ? g : c : X && X in Object(e) ? function (e) {
                var t = F.call(e, X), i = e[X];
                try {
                    e[X] = void 0;
                    var n = !0
                } catch (e) {
                }
                var a = B.call(e);
                n && (t ? e[X] = i : delete e[X]);
                return a
            }(e) : function (e) {
                return B.call(e)
            }(e)
        }

        function ge(e) {
            return Me(e) && fe(e) == s
        }

        function pe(e) {
            return !(!Pe(e) || L && L in e) && (Ne(e) ? R : p).test(function (e) {
                if (null != e) {
                    try {
                        return O.call(e)
                    } catch (e) {
                    }
                    try {
                        return e + ""
                    } catch (e) {
                    }
                }
                return ""
            }(e))
        }

        function ve(e) {
            if (!Pe(e)) return function (e) {
                var t = [];
                if (null != e) for (var i in Object(e)) t.push(i);
                return t
            }(e);
            var t = Ce(e), i = [];
            for (var n in e) ("constructor" != n || !t && F.call(e, n)) && i.push(n);
            return i
        }

        function me(e, t, i, n, a) {
            e !== t && he(t, function (o, r) {
                if (a || (a = new oe), Pe(o)) !function (e, t, i, n, a, o, r) {
                    var s = Se(e, i), l = Se(t, i), d = r.get(l);
                    if (d) return void se(e, i, d);
                    var u = o ? o(s, l, i + "", e, t, r) : void 0, c = void 0 === u;
                    if (c) {
                        var f = Ae(l), g = !f && xe(l), p = !f && !g && Oe(l);
                        u = l, f || g || p ? Ae(s) ? u = s : Me(T = s) && De(T) ? u = function (e, t) {
                            var i = -1, n = e.length;
                            t || (t = Array(n));
                            for (; ++i < n;) t[i] = e[i];
                            return t
                        }(s) : g ? (c = !1, u = function (e, t) {
                            if (t) return e.slice();
                            var i = e.length, n = H ? H(i) : new e.constructor(i);
                            return e.copy(n), n
                        }(l, !0)) : p ? (c = !1, v = l, m = !0 ? (y = v.buffer, k = new y.constructor(y.byteLength), new V(k).set(new V(y)), k) : v.buffer, u = new v.constructor(m, v.byteOffset, v.length)) : u = [] : function (e) {
                            if (!Me(e) || fe(e) != h) return !1;
                            var t = z(e);
                            if (null === t) return !0;
                            var i = F.call(t, "constructor") && t.constructor;
                            return "function" == typeof i && i instanceof i && O.call(i) == U
                        }(l) || _e(l) ? (u = s, _e(s) ? u = function (e) {
                            return function (e, t, i, n) {
                                var a = !i;
                                i || (i = {});
                                var o = -1, r = t.length;
                                for (; ++o < r;) {
                                    var s = t[o], l = n ? n(i[s], e[s], s, i, e) : void 0;
                                    void 0 === l && (l = e[s]), a ? ue(i, s, l) : le(i, s, l)
                                }
                                return i
                            }(e, Fe(e))
                        }(s) : Pe(s) && !Ne(s) || (u = function (e) {
                            return "function" != typeof e.constructor || Ce(e) ? {} : te(z(e))
                        }(l))) : c = !1
                    }
                    var v, m, y, k;
                    var T;
                    c && (r.set(l, u), a(u, l, n, o, r), r.delete(l));
                    se(e, i, u)
                }(e, t, r, i, me, n, a); else {
                    var s = n ? n(Se(e, r), o, r + "", e, t, a) : void 0;
                    void 0 === s && (s = o), se(e, r, s)
                }
            }, Fe)
        }

        function ye(e, t) {
            return be(function (e, t, i) {
                return t = J(void 0 === t ? e.length - 1 : t, 0), function () {
                    for (var n = arguments, a = -1, o = J(n.length - t, 0), r = Array(o); ++a < o;) r[a] = n[t + a];
                    a = -1;
                    for (var s = Array(t + 1); ++a < t;) s[a] = n[a];
                    return s[t] = i(r), function (e, t, i) {
                        switch (i.length) {
                            case 0:
                                return e.call(t);
                            case 1:
                                return e.call(t, i[0]);
                            case 2:
                                return e.call(t, i[0], i[1]);
                            case 3:
                                return e.call(t, i[0], i[1], i[2])
                        }
                        return e.apply(t, i)
                    }(e, this, s)
                }
            }(e, t, Ue), e + "")
        }

        function ke(e, t) {
            var i, n, a = e.__data__;
            return ("string" == (n = typeof (i = t)) || "number" == n || "symbol" == n || "boolean" == n ? "__proto__" !== i : null === i) ? a["string" == typeof t ? "string" : "hash"] : a.map
        }

        function Te(e, t) {
            var i = function (e, t) {
                return null == e ? void 0 : e[t]
            }(e, t);
            return pe(i) ? i : void 0
        }

        function we(e, t) {
            var i = typeof e;
            return !!(t = null == t ? r : t) && ("number" == i || "symbol" != i && v.test(e)) && e > -1 && e % 1 == 0 && e < t
        }

        function Ce(e) {
            var t = e && e.constructor;
            return e === ("function" == typeof t && t.prototype || P)
        }

        function Se(e, t) {
            if (("constructor" !== t || "function" != typeof e[t]) && "__proto__" != t) return e[t]
        }

        var be = function (e) {
            var t = 0, i = 0;
            return function () {
                var n = Z(), r = o - (n - i);
                if (i = n, r > 0) {
                    if (++t >= a) return arguments[0]
                } else t = 0;
                return e.apply(void 0, arguments)
            }
        }(q ? function (e, t) {
            return q(e, "toString", {
                configurable: !0, enumerable: !1, value: (i = t, function () {
                    return i
                }), writable: !0
            });
            var i
        } : Ue);

        function Ie(e, t) {
            return e === t || e != e && t != t
        }

        var _e = ge(function () {
            return arguments
        }()) ? ge : function (e) {
            return Me(e) && F.call(e, "callee") && !G.call(e, "callee")
        }, Ae = Array.isArray;

        function De(e) {
            return null != e && Ee(e.length) && !Ne(e)
        }

        var xe = Y || function () {
            return !1
        };

        function Ne(e) {
            if (!Pe(e)) return !1;
            var t = fe(e);
            return t == d || t == u || t == l || t == f
        }

        function Ee(e) {
            return "number" == typeof e && e > -1 && e % 1 == 0 && e <= r
        }

        function Pe(e) {
            var t = typeof e;
            return null != e && ("object" == t || "function" == t)
        }

        function Me(e) {
            return null != e && "object" == typeof e
        }

        var Oe = _ ? function (e) {
            return function (t) {
                return e(t)
            }
        }(_) : function (e) {
            return Me(e) && Ee(e.length) && !!m[fe(e)]
        };

        function Fe(e) {
            return De(e) ? re(e, !0) : ve(e)
        }

        var Le, Be = (Le = function (e, t, i) {
            me(e, t, i)
        }, ye(function (e, t) {
            var i = -1, n = t.length, a = n > 1 ? t[n - 1] : void 0, o = n > 2 ? t[2] : void 0;
            for (a = Le.length > 3 && "function" == typeof a ? (n--, a) : void 0, o && function (e, t, i) {
                if (!Pe(i)) return !1;
                var n = typeof t;
                return !!("number" == n ? De(i) && we(t, i.length) : "string" == n && t in i) && Ie(i[t], e)
            }(t[0], t[1], o) && (a = n < 3 ? void 0 : a, n = 1), e = Object(e); ++i < n;) {
                var r = t[i];
                r && Le(e, r, i, a)
            }
            return e
        }));

        function Ue(e) {
            return e
        }

        e.exports = Be
    }).call(this, i(434)(e))
}, function (e, t) {
    e.exports = function (e) {
        return e.webpackPolyfill || (e.deprecate = function () {
        }, e.paths = [], e.children || (e.children = []), Object.defineProperty(e, "loaded", {
            enumerable: !0,
            get: function () {
                return e.l
            }
        }), Object.defineProperty(e, "id", {
            enumerable: !0, get: function () {
                return e.i
            }
        }), e.webpackPolyfill = 1), e
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(547), a = i(548);
    !function (e) {
        e.getWindowPreference = function (e = !1) {
            let t = a.default(), i = {};
            return t && t.colors && "string" == typeof t.colors.colorPrimaryControl1 && (i.hoverBackgroundColor = e ? parseInt(n.ColorUtilNS.rgbaStringToHexWith0xBegin(t.colors.colorPrimaryControl1), 16) : n.ColorUtilNS.rgbaStringToHexWith0xBegin(t.colors.colorPrimaryControl1)), i
        }
    }(t.WindowPreferenceNS || (t.WindowPreferenceNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(17), o = i(12), r = i(2), s = i(4), l = i(0), d = i(34), u = i(6), c = i(26),
        h = u.default(r.join(__rootDir, "../bin/ThunderHelper.node")), f = l.default.getLogger("login-helper");
    !function (e) {
        e.tipsUIHelper = new class {
            constructor() {
                this.tipsWnd = null, this.isReadyShow = !1, this.isLoadFinish = !1, this.lastTipsWndShowState = !1
            }

            createTipsWnd(e, t, i, r, l) {
                return n(this, void 0, void 0, function* () {
                    if (f.information("create TipsWnd:", t, e, l, i, r, this.tipsWnd), null === this.tipsWnd && !s.isNullOrUndefined(e)) {
                        if (this.isLoadFinish = !1, this.isReadyShow = !1, this.lastTipsWndShowState = t, s.isNullOrUndefined(i) && (i = 460), s.isNullOrUndefined(r) && (r = 360), s.isNullOrUndefined(this.tipsWnd)) {
                            let e = yield o.asyncRemoteCall.getCurrentWindow(),
                                t = yield o.asyncRemoteCall.getBrowserWindow();
                            this.tipsWnd = yield new t({
                                width: i,
                                height: r,
                                modal: !1,
                                resizable: !1,
                                skipTaskbar: !0,
                                frame: !1,
                                center: !0,
                                parent: e,
                                show: !1,
                                webPreferences: {webSecurity: !0}
                            })
                        }
                        this.tipsWnd.on("hide", () => n(this, void 0, void 0, function* () {
                            let e = yield o.asyncRemoteCall.getCurrentWindow();
                            if (e) {
                                let t = yield e.isMinimized(), i = yield e.isVisible();
                                !t && i && e.show()
                            }
                        })), this.tipsWnd.once("ready-to-show", () => {
                            this.isReadyShow = !0, f.information("create tipswindow ready-to-show:", this.isReadyShow), this.lastTipsWndShowState && (c.NativeCallHostModule.nativeCallHost.fireNativeEvent("showTipsWnd"), this.tipsWnd.show())
                        }), this.tipsWnd.webContents.once("did-finish-load", () => {
                            this.isLoadFinish = !0, f.information("create TipsWnd did-finish-load:", this.isLoadFinish)
                        }), this.tipsWnd.on("closed", () => n(this, void 0, void 0, function* () {
                            f.information("TipsWnd closed"), this.tipsWnd = null;
                            let e = yield o.asyncRemoteCall.getCurrentWindow();
                            if (e) {
                                let t = yield e.isMinimized(), i = yield e.isVisible();
                                !t && i && e.show()
                            }
                        })), a.ipcRenderer.send("create-shadow-window", this.tipsWnd.id), this.tipsWnd.loadURL(e)
                    }
                })
            }

            closeTipsWnd() {
                f.information("closeTipsWnd"), null !== this.tipsWnd && (this.lastTipsWndShowState = !1, this.tipsWnd.close(), this.tipsWnd = null)
            }

            showOrHideTipsWnd(e, t, i, n, a) {
                if (f.information("updateTipsWnd:", e, t, i, n, this.tipsWnd), s.isNullOrUndefined(e) && (e = !1), s.isNullOrUndefined(this.tipsWnd)) {
                    if (null === t || void 0 === t || "" === t) return;
                    this.createTipsWnd(t, e, i, n, a).catch()
                } else this.lastTipsWndShowState = e, this.lastTipsWndShowState ? (c.NativeCallHostModule.nativeCallHost.fireNativeEvent("showTipsWnd"), f.information("updateLoginWnd:显示tips窗口"), this.tipsWnd.show(), d.ToolsUtilitiesAWNS.setForegroundWindow(h, this.tipsWnd).catch()) : this.tipsWnd.hide()
            }

            isMainWndShow() {
                return n(this, void 0, void 0, function* () {
                    f.information("getMainWndState");
                    let e = !0, t = yield o.asyncRemoteCall.getCurrentWindow();
                    return !(yield t.isMinimized()) && (yield t.isVisible()) || (e = !1), e
                })
            }

            isTipsWndShow() {
                f.information("getTipsWndState");
                let e = !1;
                return this.lastTipsWndShowState && (e = !0), e
            }
        }
    }(t.TipsHelperNS || (t.TipsHelperNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(0), r = i(35), s = i(3), l = i(43), d = i(41), u = i(11), c = i(15),
        h = o.default.getLogger("sdk-download"), f = c.DownloadKernelEventManager.getEventManager();
    t.sdkDownloader = new class {
        constructor() {
            this.keyMap = {}, this.listenMap = {}, this.eventCookie = void 0
        }

        createTaskBySDK(e) {
            return n(this, void 0, void 0, function* () {
                let t = !1;
                do {
                    if (!e) break;
                    let i = e.url;
                    if (!i) break;
                    let n = e.savePath;
                    if (!n) break;
                    let o = e.fileName;
                    if (!o) break;
                    let c = `${i}${n}${o}`;
                    if (this.keyMap.hasOwnProperty(c)) {
                        if (t = !0, e.onTaskFinish) {
                            let t = this.keyMap[c];
                            h.information("task is running", c, t), this.addListener(t, e.onTaskFinish)
                        }
                        break
                    }
                    let f = e.source ? e.source : "", g = {
                        taskBaseInfo: {
                            taskName: o,
                            savePath: n,
                            productInfo: d.TaskCtrlOperatorNS.constructProductInfo(e.browser),
                            origin: f
                        }, isBackground: !0
                    }, p = r.ThunderHelper.getTaskTypeFromUrl(i);
                    if (p === s.DownloadKernel.TaskType.Emule) {
                        let e = {url: i};
                        g.emuleTaskInfo = e
                    } else if (p === s.DownloadKernel.TaskType.P2sp) {
                        let e = {url: i, nameFixed: 1};
                        g.p2spTaskInfo = e
                    } else {
                        if (p !== s.DownloadKernel.TaskType.Magnet) break;
                        {
                            let e = {url: i, torrentFilePath: a.normalize(a.join(n, o))};
                            g.magnetTaskInfo = e
                        }
                    }
                    let v = yield u.DownloadKernelTaskManager.getTaskManager().createTask(p, g);
                    if (!v) break;
                    let m = v.getId();
                    t = l.DownloadDispatchNS.startTask(m, !0), h.information("sdk create task", m), t && (e.onTaskFinish && this.addListener(m, e.onTaskFinish), this.keyMap[c] = m, this.attachTaskStatus())
                } while (0);
                return t || e.onTaskFinish && e.onTaskFinish(!1), t
            })
        }

        addListener(e, t) {
            this.listenMap.hasOwnProperty(e) ? this.listenMap[e] = [...this.listenMap[e]].concat(t) : this.listenMap[e] = [].concat(t)
        }

        release(e) {
            delete this.listenMap[e];
            for (let t in this.keyMap) if (this.keyMap[t] === e) {
                delete this.keyMap[t];
                break
            }
        }

        attachTaskStatus() {
            do {
                if (this.eventCookie) break;
                this.eventCookie = f.attachTaskEvent(s.DownloadKernel.TaskEventType.StatusChanged, (...e) => n(this, void 0, void 0, function* () {
                    do {
                        if (!e) break;
                        if (e[0] !== s.DownloadKernel.TaskEventType.StatusChanged) break;
                        if (!e[1]) break;
                        let t = Object.values(this.keyMap);
                        if (!t || 0 === t.length) break;
                        let i = e[1];
                        for (let e = 0; e < i.length; ++e) {
                            let n = i[e];
                            if (!n) continue;
                            let a = n.getTaskStatus(), o = n.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskId);
                            -1 !== t.indexOf(o) && (a === s.DownloadKernel.TaskStatus.Succeeded || a === s.DownloadKernel.TaskStatus.Seeding ? (this.fireAll(o, !0, n), this.release(o)) : a === s.DownloadKernel.TaskStatus.Failed && (this.fireAll(o, !1), this.release(o)))
                        }
                        (t = Object.values(this.keyMap)) && 0 !== t.length || this.detachTaskStatus()
                    } while (0)
                }))
            } while (0)
        }

        fireAll(e, t, i) {
            do {
                if (!this.listenMap.hasOwnProperty(e)) break;
                let n = this.listenMap[e];
                if (!n || 0 === n.length) break;
                if (!t) {
                    for (let e = 0; e < n.length; e++) n[e](t);
                    break
                }
                if (!i) break;
                let o = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.SavePath),
                    r = i.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskName), l = a.normalize(a.join(o, r));
                for (let e = 0; e < n.length; e++) n[e](t, l)
            } while (0)
        }

        detachTaskStatus() {
            h.information("detachTaskStatus", this.eventCookie), void 0 !== this.eventCookie && (f.detachTaskEvent(s.DownloadKernel.TaskEventType.StatusChanged, this.eventCookie), this.eventCookie = void 0)
        }
    }
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(0), o = i(4), r = i(16), s = i(70), l = i(439), d = i(440), u = i(80), c = i(32), h = i(23), f = i(10),
        g = i(9), p = i(95), v = d.GroupAccelerateManagerNS.getManager(),
        m = l.GroupAccelerateEventManagerNS.getEventManager(), y = u.TabEventManagerNS.getEventEmitter(),
        k = a.default.getLogger("GroupAccelerate.WebManager");
    !function (e) {
        class t {
            constructor() {
                this.entryPage = "", this.pendingShowTeamInfoArray = new Array, this.taskSpeedListenerMap = new Map, this.taskStatusListenerMap = new Map, this.nextListenerCookie = 0, k.information("constructor")
            }

            init(e) {
                k.information("init", " entryPage: ", e), e && (this.entryPage = e), m.on(l.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnTaskStatusChange, (e, t, i) => {
                    k.information("init OnTaskStatusChange", " taskId: ", e, " taskStatus: ", t, " taskUniqueId: ", i), this.fireTaskStatusChangeEvent(e, t, i)
                }), m.on(l.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnTaskSpeedChange, (e, t, i, n, a) => {
                    k.information("init OnTaskSpeedChange", " taskId: ", e, " taskSpeed: ", t, " increaseSpeed: ", i, " extraStr: ", n, " taskUniqueId: ", a), this.fireTaskSpeedChangeEvent(e, t, i, n, a)
                }), y.on(u.TabEventManagerNS.EventType.RemoveTab, e => {
                    if ("组队加速" === e.tabInfo.title && "groupAccelerate" === e.tabInfo.tab.name) {
                        v.exitAllTeamNoTask();
                        for (let [t, i]of this.taskSpeedListenerMap) if (i.tab === e.tabInfo.tab) {
                            this.taskSpeedListenerMap.delete(t);
                            break
                        }
                        for (let [t, i]of this.taskStatusListenerMap) if (i.tab === e.tabInfo.tab) {
                            this.taskStatusListenerMap.delete(t);
                            break
                        }
                    }
                }), this.registerNativeFunction()
            }

            openGroupAccelerateTabByTaskId(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    k.information("openGroupAccelerateTabByTaskId", " taskId: ", e, " entry: ", t, " panel: ", i, " queryString: ", a);
                    let n = v.getTaskUniqueIdByTaskId(e);
                    k.information("openGroupAccelerateTabByTaskId", " taskUniqueId: ", n), n && "" !== n && this.openGroupAccelerateTabByTaskUniqueId(n, t, i, a).then(e => {
                        k.information("openGroupAccelerateTabByTaskId success")
                    }).catch(() => {
                        k.information("openGroupAccelerateTabByTaskId failed")
                    })
                })
            }

            openGroupAccelerateTabByTaskUniqueId(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    if (k.information("openGroupAccelerateTabByTaskUniqueId", " taskUniqueId: ", e, " entry: ", t, " panel: ", i, " queryString: ", a), !e) return void k.information("openGroupAccelerateTabByTaskUniqueId bad taskUniqueId");
                    o.isNullOrUndefined(t) && (t = ""), o.isNullOrUndefined(i) && (i = ""), o.isNullOrUndefined(a) && (a = "");
                    let n = yield s.default(!1, !0, "groupspeedup");
                    if (k.information("openGroupAccelerateTabByTaskUniqueId", " userId: ", n), n && "0" !== n) {
                        let o = Number(n);
                        if (!isNaN(o) && 0 !== o) {
                            let n = JSON.stringify({
                                title: "组队加速",
                                url: this.entryPage,
                                name: "groupAccelerate",
                                showUrl: !1
                            });
                            r.NativeCallModule.nativeCall.CallNativeFunction("GetTabIndexByTitleAndName", n, (o, s) => {
                                if (k.information("GetTabIndexByTitleAndName", n, o, s), o === h.NativeFunctionErrorCode.Success && s > -1) k.information("groupAccelerate nativeCall exists", s), r.NativeCallModule.nativeCall.CallNativeFunction("SelectTab", s), r.NativeCallModule.nativeCall.CallNativeFunction("FireEventFunction", "OnShowTeam", e, t, i, a); else {
                                    let o = {};
                                    o.taskUniqueId = e, o.entry = t, o.panel = i, o.queryString = a, this.pendingShowTeamInfoArray.push(o), k.information("openGroupAccelerateTabByTaskUniqueId do opentab"), r.NativeCallModule.nativeCall.CallNativeFunction("OpenNewTab", this.entryPage, n)
                                }
                            }), f.ConfigNS.setValue("GroupAccelerate", "unusecount", 0);
                            let o = (new Date).getTime();
                            f.ConfigNS.setValue("GroupAccelerate", "lastusetime", o), this.sendPageShowStat(e, t, i)
                        }
                    }
                })
            }

            fireTaskStatusChangeEvent(e, t, i) {
                this.taskStatusListenerMap.forEach((n, a) => {
                    n && n.tab && "nativeCallId" in n && n.callBackId && n.gcid === i && n.tab.callNativeFunctionCallback(n.nativeCallId, n.callBackId, e, t, i)
                })
            }

            fireTaskSpeedChangeEvent(e, t, i, n, a) {
                this.taskSpeedListenerMap.forEach((o, r) => {
                    o && o.tab && "nativeCallId" in o && o.callBackId && o.gcid === a && o.tab.callNativeFunctionCallback(o.nativeCallId, o.callBackId, e, t, i, n, a)
                })
            }

            registerNativeFunction() {
                let e = [{
                    functionName: "OpenGroupAccelerateTab",
                    nativeFunc: this.externalOpenGroupAccelerateTab.bind(this)
                }, {
                    functionName: "GetGroupTaskInfo",
                    nativeFunc: this.externalGetTaskInfo.bind(this)
                }, {functionName: "JoinTeam", nativeFunc: this.externalJoinTeam.bind(this)}, {
                    functionName: "ExitTeam",
                    nativeFunc: this.externalExitTeam.bind(this)
                }, {
                    functionName: "TeamPageReady",
                    nativeFunc: this.externalTeamPageReady.bind(this)
                }, {
                    functionName: "SubscribeTaskSpeed",
                    nativeFunc: this.externalSubscribeTaskSpeed.bind(this)
                }, {
                    functionName: "UnsubscribeTaskSpeed",
                    nativeFunc: this.externalUnsubscribeTaskSpeed.bind(this)
                }, {
                    functionName: "SubscribeTaskStatus",
                    nativeFunc: this.externalSubscribeTaskStatus.bind(this)
                }, {functionName: "UnsubscribeTaskStatus", nativeFunc: this.externalUnsubscribeTaskStatus.bind(this)}];
                c.NativeCallNS.registerNativeFunction(e)
            }

            externalOpenGroupAccelerateTab(e, t, i, n) {
                do {
                    if (k.information("externalOpenGroupAccelerateTab enter"), o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(i)) {
                        k.information("externalOpenGroupAccelerateTab bad external args");
                        break
                    }
                    if (o.isNullOrUndefined(n) || o.isNullOrUndefined(n[0]) || o.isNullOrUndefined(n[1]) || o.isNullOrUndefined(n[2]) || o.isNullOrUndefined(n[3])) {
                        k.information("externalOpenGroupAccelerateTab bad args"), e.callNativeFunctionCallback(t, i, h.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0], r = n[1], s = n[2], l = n[3];
                    this.openGroupAccelerateTabByTaskId(a, r, s, l).then(e => {
                        k.information("externalOpenGroupAccelerateTab success")
                    }).catch(() => {
                        k.information("externalOpenGroupAccelerateTab failed")
                    }), e.callNativeFunctionCallback(t, i, h.NativeFunctionErrorCode.Success)
                } while (0)
            }

            externalGetTaskInfo(e, t, i, n) {
                do {
                    if (k.information("externalGetTaskInfo enter"), o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(i)) {
                        k.information("externalGetTaskInfo bad external args");
                        break
                    }
                    if (o.isNullOrUndefined(n) || o.isNullOrUndefined(n[1])) {
                        k.information("externalGetTaskInfo bad args"), e.callNativeFunctionCallback(t, i, h.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0], r = n[1];
                    k.information("externalGetTaskInfo", " taskId: ", a, " taskUniqueId: ", r);
                    let s = v.getTaskInfoJson(a, r);
                    k.information("externalGetTaskInfo", " taskInfoJson: ", s), e.callNativeFunctionCallback(t, i, h.NativeFunctionErrorCode.Success, s)
                } while (0)
            }

            externalJoinTeam(e, t, i, n) {
                do {
                    if (k.information("externalJoinTeam enter"), o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(i)) {
                        k.information("externalGetTaskInfo bad external args");
                        break
                    }
                    if (o.isNullOrUndefined(n) || o.isNullOrUndefined(n[3])) {
                        e.callNativeFunctionCallback(t, i, h.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0], r = n[1], s = n[2], l = n[3], d = null;
                    try {
                        d = JSON.parse(s)
                    } catch (e) {
                        k.warning(e)
                    }
                    if (null === d) break;
                    let u = d.member_count;
                    u || (u = 0);
                    let c = d.group_name;
                    if (o.isNullOrUndefined(c) && (c = ""), k.information("externalJoinTeam", " taskId: ", a, " groupId: ", r, " opts: ", s, " taskUniqueId: ", l, " memberCount: ", u, " groupName: ", c), !r || !l) {
                        e.callNativeFunctionCallback(t, i, h.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    v.joinTeam(a, "" + r, c, u, l).catch();
                    let f = !1;
                    if ("1" !== p.DownloadModeNS.getCurrentDownloadMode()) {
                        p.DownloadModeNS.setFullDownloadMode(), f = !0;
                        let e = 0,
                            t = "taskid=" + (e = l && "" !== l ? v.getTaskIdByTaskUniqueId(l) : a) + ",gcid=" + l;
                        g.XLStatNS.trackEvent("download_pannel", "groupspeedup_fullspeed_change", "", 0, 0, 0, 0, t)
                    }
                    let m = JSON.stringify({hasChangeMode: f});
                    e.callNativeFunctionCallback(t, i, h.NativeFunctionErrorCode.Success, m)
                } while (0)
            }

            externalExitTeam(e, t, i, n) {
                do {
                    if (k.information("externalExitTeam enter"), o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(i)) break;
                    if (o.isNullOrUndefined(n) || o.isNullOrUndefined(n[0]) || o.isNullOrUndefined(n[1]) || o.isNullOrUndefined(n[2])) {
                        e.callNativeFunctionCallback(t, i, h.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0], r = n[1], s = n[2];
                    v.exitTeam(a, r, s), e.callNativeFunctionCallback(t, i, h.NativeFunctionErrorCode.Success)
                } while (0)
            }

            externalTeamPageReady(e, t, i, n) {
                do {
                    if (k.information("externalTeamPageReady enter"), o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(i)) {
                        k.information("externalGetTaskInfo bad external args");
                        break
                    }
                    for (let e of this.pendingShowTeamInfoArray) e && (k.information("externalTeamPageReady fire event", " taskUniqueId: ", e.taskUniqueId, " entry: ", e.entry, " panel: ", e.panel, " queryString: ", e.queryString), r.NativeCallModule.nativeCall.CallNativeFunction("FireEventFunction", "OnShowTeam", e.taskUniqueId, e.entry, e.panel, e.queryString));
                    this.pendingShowTeamInfoArray = [], e.callNativeFunctionCallback(t, i, h.NativeFunctionErrorCode.Success)
                } while (0)
            }

            externalSubscribeTaskSpeed(e, t, i, n) {
                do {
                    if (k.information("externalSubscribeTaskSpeed enter"), o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(i)) {
                        k.information("externalSubscribeTaskSpeed bad external args");
                        break
                    }
                    if (o.isNullOrUndefined(n) || o.isNullOrUndefined(n[0]) || o.isNullOrUndefined(n[1])) {
                        e.callNativeFunctionCallback(t, i, h.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0], r = n[1], s = {};
                    s.tab = e, s.nativeCallId = t, s.callBackId = r, s.gcid = a;
                    let l = this.nextListenerCookie;
                    this.taskSpeedListenerMap.set("" + l, s), this.nextListenerCookie += 1, e.callNativeFunctionCallback(t, i, h.NativeFunctionErrorCode.Success, l)
                } while (0)
            }

            externalUnsubscribeTaskSpeed(e, t, i, n) {
                do {
                    if (k.information("externalUnsubscribeTaskSpeed enter"), o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(i)) {
                        k.information("externalUnsubscribeTaskSpeed bad external args");
                        break
                    }
                    if (o.isNullOrUndefined(n) || o.isNullOrUndefined(n[0])) {
                        e.callNativeFunctionCallback(t, i, h.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0];
                    this.taskSpeedListenerMap.delete("" + a), e.callNativeFunctionCallback(t, i, h.NativeFunctionErrorCode.Success)
                } while (0)
            }

            externalSubscribeTaskStatus(e, t, i, n) {
                do {
                    if (k.information("externalSubscribeTaskStatus enter"), o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(i)) {
                        k.information("externalSubscribeTaskStatus bad external args");
                        break
                    }
                    if (o.isNullOrUndefined(n) || o.isNullOrUndefined(n[0]) || o.isNullOrUndefined(n[1])) {
                        e.callNativeFunctionCallback(t, i, h.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0], r = n[1], s = {};
                    s.tab = e, s.nativeCallId = t, s.callBackId = r, s.gcid = a;
                    let l = this.nextListenerCookie;
                    this.taskStatusListenerMap.set("" + l, s), this.nextListenerCookie += 1, e.callNativeFunctionCallback(t, i, h.NativeFunctionErrorCode.Success, l)
                } while (0)
            }

            externalUnsubscribeTaskStatus(e, t, i, n) {
                do {
                    if (k.information("externalUnsubscribeTaskStatus enter"), o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(i)) {
                        k.information("externalUnsubscribeTaskStatus bad external args");
                        break
                    }
                    if (o.isNullOrUndefined(n) || o.isNullOrUndefined(n[0])) {
                        e.callNativeFunctionCallback(t, i, h.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0];
                    this.taskSpeedListenerMap.delete("" + a), e.callNativeFunctionCallback(t, i, h.NativeFunctionErrorCode.Success)
                } while (0)
            }

            sendPageShowStat(e, t, i) {
                do {
                    if (!e) break;
                    if (!t || !i) break;
                    let n = "entry=" + t + ",pannel=" + i + ",gcid=" + e;
                    g.XLStatNS.trackEvent("download_pannel", "groupspeedupdetail_show", "", 0, 0, 0, 0, n)
                } while (0)
            }
        }

        e.Manager = t;
        const i = new t;
        e.getManager = function () {
            return i
        }
    }(t.GroupAccelerateWebManagerNS || (t.GroupAccelerateWebManagerNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(19);
    !function (e) {
        let t;
        !function (e) {
            e.Unknow = "Unknow", e.OnJoinTeam = "OnJoinTeam", e.OnExitTeam = "OnExitTeam", e.OnReceiveGcid = "OnReceiveGcid", e.OnTaskSpeedChange = "OnTaskSpeedChange", e.OnTaskStatusChange = "OnTaskStatusChange", e.OnTeamInfoUpdated = "OnTeamInfoUpdated", e.InsertToCategoryView = "InsertToCategoryView", e.RemoveFromCategoryView = "RemoveFromCategoryView", e.RequestTaskTeamInfoSuccess = "RequestTaskTeamInfoSuccess", e.RequestTaskTeamInfofailed = "RequestTaskTeamInfofailed"
        }(t = e.GroupAccelerateEventType || (e.GroupAccelerateEventType = {}));
        const i = new n.EventEmitter;
        e.getEventManager = function () {
            return i
        }
    }(t.GroupAccelerateEventManagerNS || (t.GroupAccelerateEventManagerNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(0), o = i(9), r = i(2), s = i(5), l = i(16), d = i(65), u = i(13), c = i(3), h = i(30), f = i(15),
        g = i(11), p = i(40), v = i(29), m = i(439), y = i(24), k = i(4),
        T = m.GroupAccelerateEventManagerNS.getEventManager(), w = g.DownloadKernelTaskManager.getTaskManager(),
        C = f.DownloadKernelEventManager.getEventManager(),
        S = p.DownloadKernelCategoryViewManager.getCategoryViewManager(),
        b = v.DownloadKernelCategoryManager.getCategoryManager(), I = a.default.getLogger("GroupAccelerate.Manager");
    !function (e) {
        class t {
            constructor() {
                this.reportInterval = 120, this.currentUserId = 0, this.currentUserLicensed = !1, this.enterGroupAccelerateTimeStamp = 0, this.enterGroupAccelerateUploadSize = 0, this.groupAcceleratingTaskNum = 0, this.insertToCategoryViewEventId = void 0, this.removeFromCategoryViewEventId = void 0, this.detailChangedEventId = void 0, this.taskStatusChangedEventId = void 0, this.taskGroupInfoMap = new Map, this.taskIdMap = new Map, this.insertToCategoryViewEventId = 0, this.removeFromCategoryViewEventId = 0, this.detailChangedEventId = 0, this.taskStatusChangedEventId = 0
            }

            init() {
                I.information("init"), l.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", e => {
                    let t = Number(e);
                    isNaN(t) || (this.currentUserId = t), this.updatePrivateSpaceCategoryViewTaskIdMap(), w.isLoadStorageTaskFinish() && this.checkTaskGroupAccelerateStatus(), this.getUserGroupAccelerateInfo().then(e => {
                        I.information("init login getUserGroupAccelerateInfo")
                    }).catch(() => {
                        I.information("init login getUserGroupAccelerateInfo failed")
                    })
                }), l.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", e => {
                    this.exitAllTeam(this.currentUserId, !1), this.currentUserId = 0, this.currentUserLicensed = !1
                }), y.LoginHelperNS.loginHelper.getUserInfo("userid", e => {
                    if (I.information("getUserID:userid = ", e), e && "" !== e) {
                        let t = Number(e);
                        isNaN(t) || (this.currentUserId = t), w.isLoadStorageTaskFinish() && this.checkTaskGroupAccelerateStatus(), this.getUserGroupAccelerateInfo().then(e => {
                            I.information("init getUserGroupAccelerateInfo")
                        }).catch(() => {
                            I.information("init getUserGroupAccelerateInfo failed")
                        })
                    }
                }), this.insertToCategoryViewEventId = C.attachTaskEvent(c.DownloadKernel.TaskEventType.InsertToCategoryView, (...e) => {
                    e && e[0] === c.DownloadKernel.TaskEventType.InsertToCategoryView && this.onInsertToCategoryView(e[1], e[2], e[3])
                }), this.removeFromCategoryViewEventId = C.attachTaskEvent(c.DownloadKernel.TaskEventType.RemoveFromCategoryView, (...e) => {
                    e && e[0] === c.DownloadKernel.TaskEventType.RemoveFromCategoryView && this.onRemoveFromCategoryView(e[1], e[2], e[3])
                }), this.detailChangedEventId = C.attachTaskEvent(c.DownloadKernel.TaskEventType.DetailChanged, (...e) => {
                    e && e[0] === c.DownloadKernel.TaskEventType.DetailChanged && this.onDetailChanged(e[1])
                }), this.taskStatusChangedEventId = C.attachTaskEvent(c.DownloadKernel.TaskEventType.StatusChanged, (...e) => {
                    e && e[0] === c.DownloadKernel.TaskEventType.StatusChanged && this.onTaskStatusChanged(e[1])
                }), setInterval(() => {
                    this.reportGroupAccelerateTaskInfo()
                }, 1e3 * this.reportInterval), h.DownloadKernelManager.attachOnceListener(u.NodeEventMesssageNS.eventDownloadKernelInitEnd, () => {
                    this.updateTaskIdMap(), this.checkTaskGroupAccelerateStatus()
                })
            }

            uninit() {
                void 0 !== this.insertToCategoryViewEventId && (C.detachTaskEvent(c.DownloadKernel.TaskEventType.InsertToCategoryView, this.insertToCategoryViewEventId), this.insertToCategoryViewEventId = void 0), void 0 !== this.removeFromCategoryViewEventId && (C.detachTaskEvent(c.DownloadKernel.TaskEventType.RemoveFromCategoryView, this.removeFromCategoryViewEventId), this.removeFromCategoryViewEventId = void 0), void 0 !== this.detailChangedEventId && (C.detachTaskEvent(c.DownloadKernel.TaskEventType.DetailChanged, this.detailChangedEventId), this.detailChangedEventId = void 0), void 0 !== this.taskStatusChangedEventId && (C.detachTaskEvent(c.DownloadKernel.TaskEventType.StatusChanged, this.taskStatusChangedEventId), this.taskStatusChangedEventId = void 0), this.taskGroupInfoMap.clear(), this.taskIdMap.clear()
            }

            canEnterGroupAccelerate(e) {
                I.information("canEnterGroupAccelerate", " taskId: ", e);
                let t = !1;
                do {
                    if (!e) break;
                    let i = w.getTaskFromTaskId(e);
                    if (!i) break;
                    let n = this.getTaskUniqueIdByTask(i);
                    if (!n || "" === n) break;
                    let a = i.getTaskStatus();
                    if (!a || a === c.DownloadKernel.TaskStatus.Failed) break;
                    t = !0
                } while (0);
                return t
            }

            isEnterGroupAccelerate(e) {
                I.information("canEnterGroupAccelerate", " taskId: ", e);
                let t = !1;
                do {
                    if (!e) break;
                    let i = w.getTaskFromTaskId(e);
                    if (!i) break;
                    let n = this.getTaskUniqueIdByTask(i);
                    if (!n || "" === n) break;
                    let a = i.getTaskStatus();
                    if (!a || a === c.DownloadKernel.TaskStatus.Failed) break;
                    let o = this.getTaskGroupInfo(n);
                    o && o.taskId === e && (t = !0)
                } while (0);
                return t
            }

            joinTeam(e, t, i, a, o) {
                return n(this, void 0, void 0, function* () {
                    I.information("joinTeam", " taskId: ", e, " groupId:", t, " groupName:", i, " memberCount: ", a, " taskUniqueId: ", o);
                    let n = 0;
                    n = "" !== o ? this.taskIdMap.get(o) : e || 0, I.information("joinTeam", " realTaskId: ", n);
                    do {
                        let e = this.taskGroupInfoMap.get(o);
                        if (e && e.taskId) {
                            I.information("joinTeam Alert! taskGroupInfo.taskId:", e.taskId);
                            break
                        }
                        if ((e = {}).groupId = Number(t), e.memberCount = a, e.groupName = i, e.taskId = n, e.currentIncreaseSize = 0, w.getTaskFromTaskId(n)) {
                            e.previousSpeed = this.getTaskAverageSpeed(n), (yield this.getIsVip()) ? this.setTaskPriority(n, 999) : this.setTaskPriority(n, 700), T.emit(m.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnJoinTeam, n, o), 0 === this.groupAcceleratingTaskNum && (this.enterGroupAccelerateTimeStamp = (new Date).getTime(), this.enterGroupAccelerateUploadSize = h.DownloadKernelManager.getTotalUploadSize()), this.groupAcceleratingTaskNum += 1, I.information("joinTeam", " this.enterGroupAccelerateTimeStamp: ", this.enterGroupAccelerateTimeStamp), I.information("joinTeam", " this.enterGroupAccelerateUploadSize: ", this.enterGroupAccelerateUploadSize), I.information("joinTeam", " this.groupAcceleratingTaskNum: ", this.groupAcceleratingTaskNum)
                        } else e.previousSpeed = 0;
                        this.taskGroupInfoMap.set(o, e), I.information("joinTeam", " this.taskGroupInfoMap.size: ", this.taskGroupInfoMap.size), this.saveGroupAccelerateInfo().then(e => {
                            I.information("joinTeam saveGroupAccelerateInfo")
                        }).catch(() => {
                            I.information("joinTeam saveGroupAccelerateInfo failed")
                        })
                    } while (0)
                })
            }

            exitTeam(e, t, i) {
                if (I.information("exitTeam", " taskId: ", e, " groupId: ", t, " taskUniqueId: ", i), "" !== i) {
                    let e = this.taskGroupInfoMap.get(i);
                    if (e) {
                        I.information("exitTeam", " taskGroupInfo.taskId: ", e.taskId);
                        let t = e.taskId;
                        this.taskGroupInfoMap.delete(i), this.setTaskPriority(t, 0), this.saveGroupAccelerateInfo().then(e => {
                            I.information("exitTeam saveGroupAccelerateInfo")
                        }).catch(() => {
                            I.information("exitTeam saveGroupAccelerateInfo failed")
                        }), this.groupAcceleratingTaskNum -= 1, 0 === this.groupAcceleratingTaskNum && (this.enterGroupAccelerateTimeStamp = 0, this.enterGroupAccelerateUploadSize = 0), I.information("exitTeam", " this.enterGroupAccelerateTimeStamp: ", this.enterGroupAccelerateTimeStamp), I.information("exitTeam", " this.enterGroupAccelerateUploadSize: ", this.enterGroupAccelerateUploadSize), I.information("exitTeam", " this.groupAcceleratingTaskNum: ", this.groupAcceleratingTaskNum), T.emit(m.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnExitTeam, t, i)
                    } else I.information("exitTeam bad taskGroupInfo")
                } else I.information("exitTeam bad taskUniqueId")
            }

            getTaskGroupInfo(e) {
                I.information("getTaskGroupInfo", " taskUniqueId: ", e);
                let t = null;
                return "" !== e && (t = this.taskGroupInfoMap.get(e)), t
            }

            exitAllTeamNoTask() {
                I.information("exitAllTeamNoTask"), this.taskGroupInfoMap.forEach((e, t) => {
                    e.taskId || (this.sendExitTeamCommand("" + e.groupId), this.taskGroupInfoMap.delete(t))
                }), this.saveGroupAccelerateInfo().then(e => {
                    I.information("exitAllTeamNoTask saveGroupAccelerateInfo")
                }).catch(() => {
                    I.information("exitAllTeamNoTask saveGroupAccelerateInfo failed")
                })
            }

            sendExitTeamCommand(e) {
                do {
                    I.information("sendExitTeamCommand", " taskUniqueId: ", e);
                    let t = this.taskGroupInfoMap.get(e);
                    if (!t) break;
                    d.fetchSlRes({
                        url: "/group_accel/exit",
                        data: {uid: this.currentUserId, group_id: t.groupId},
                        method: "post"
                    }).then(t => {
                        this.taskGroupInfoMap.delete(e), this.saveGroupAccelerateInfo().then(e => {
                            I.information("sendExitTeamCommand saveGroupAccelerateInfo")
                        }).catch(() => {
                            I.information("sendExitTeamCommand saveGroupAccelerateInfo failed")
                        })
                    }).catch(() => {
                    })
                } while (0)
            }

            isUserLicensed() {
                return this.currentUserLicensed
            }

            getTaskInfoJson(e, t) {
                I.information("getTaskInfoJson", " taskId: ", e, " taskUniqueId: ", t);
                let i = void 0;
                "" !== t && (i = this.taskIdMap.get(t)), I.information("getTaskInfoJson", " realTaskId: ", i), void 0 !== i && (e = i), I.information("getTaskInfoJson now", " taskId: ", e);
                let n = "null";
                do {
                    if (!e) {
                        n = "null";
                        break
                    }
                    let a = w.getTaskFromTaskId(i);
                    if (a) {
                        let e = {};
                        e.status = "" + a.getTaskBaseInfo().taskStatus, e.taskID = "" + i, e.type = "" + a.getTaskBaseInfo().taskType, e.name = a.getTaskBaseInfo().taskName, e.gcid = t;
                        let o = "", s = a.getTaskBaseInfo().taskType, l = e.name;
                        s !== c.DownloadKernel.TaskType.P2sp && s !== c.DownloadKernel.TaskType.Emule || (o = r.extname(l)) && (o = o.substring(1)), e.suffix = o, e.url = a.getTaskBaseInfo().url, e.size = a.getTaskBaseInfo().fileSize, e.progress = e.size > 0 ? 100 * a.getTaskBaseInfo().downloadSize / e.size : 0, I.information("taskInfoTable.progress:", e.progress), e.progress > 100 && (e.progress = 100);
                        let d = this.taskGroupInfoMap.get(t);
                        e.uploaded = d ? this.getUploadedSize() : 0, n = JSON.stringify(e)
                    } else n = "null"
                } while (0);
                return I.information("getTaskInfoJson", " taskInfoJson: ", n), n
            }

            updateTaskAccelerateInfo(e) {
                I.information("updateTaskAccelerateInfo", " taskId: ", e);
                do {
                    if (!e) break;
                    let t = this.getTaskUniqueIdByTaskId(e);
                    if (I.information("updateTaskAccelerateInfo", " taskUniqueId: ", t), !t || "" === t) break;
                    d.fetchSlRes({
                        url: "/group_accel/belong_batch",
                        data: {uid: this.currentUserId, tasks: [t]},
                        method: "post"
                    }).then(e => {
                        if (I.information("updateTaskAccelerateInfo fetchSlRes success res.data: ", e.data), "ok" === e.data.result && e.data.data) {
                            let t = e.data.data;
                            for (let e = 0; e < t.length; e++) {
                                let i = t[e].group_id, n = t[e].member_count, a = t[e].group_name, o = t[e].task,
                                    r = t[e].belong_status;
                                I.information("updateTaskAccelerateInfo data[", e, "]:", t[e]);
                                let s = this.taskGroupInfoMap.get(o);
                                s && (I.information("updateTaskAccelerateInfo has group"), 0 !== r ? (s.memberCount = n, s.groupName = a) : setTimeout(() => {
                                    this.exitTeam(s.taskId, i, o)
                                }, 100))
                            }
                            T.emit(m.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnTeamInfoUpdated)
                        }
                    }).catch(() => {
                    })
                } while (0)
            }

            requestTaskTeamInfo(e) {
                do {
                    if (!e || "" === e) break;
                    I.information("requestTaskTeamInfo", " taskUniqueId: ", e), d.fetchSlRes({
                        url: "/group_accel/motorcade_list",
                        data: {task: e},
                        method: "get"
                    }).then(t => {
                        t && T.emit(m.GroupAccelerateEventManagerNS.GroupAccelerateEventType.RequestTaskTeamInfoSuccess, e, t.data)
                    }).catch(() => {
                        T.emit(m.GroupAccelerateEventManagerNS.GroupAccelerateEventType.RequestTaskTeamInfofailed, e)
                    })
                } while (0)
            }

            getTaskUniqueIdByTaskId(e) {
                I.information("getTaskUniqueIdByTaskId", " taskId: ", e);
                let t = "";
                if (e) {
                    let i = w.getTaskFromTaskId(e);
                    i && (t = this.getTaskUniqueIdByTask(i))
                }
                return I.information("getTaskUniqueIdByTaskId", " uniqueId: ", t), t
            }

            getTaskUniqueIdByTask(e) {
                let t = "";
                if (e) {
                    switch (e.getTaskBaseInfo().taskType) {
                        case c.DownloadKernel.TaskType.Bt:
                            let i = e.getExtraObject().getInfoId();
                            I.information("getTaskUniqueIdByTaskBase bt task infoId:", i), t = i;
                            break;
                        case c.DownloadKernel.TaskType.P2sp:
                        case c.DownloadKernel.TaskType.Emule:
                            let n = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.Gcid);
                            I.information("getTaskUniqueIdByTaskBase p2sp or emule task gcid: ", n), t = n
                    }
                }
                return I.information("getTaskUniqueIdByTaskId", " uniqueId: ", t), t
            }

            getTaskStatus(e) {
                I.information("getTaskStatus", " taskId: ", e);
                let t = c.DownloadKernel.TaskStatus.Unkown;
                if (e) {
                    let i = w.getTaskFromTaskId(e);
                    i && (t = i.getTaskStatus())
                }
                return I.information("getTaskStatus", " taskStatus: ", t), t
            }

            getTaskIdByTaskUniqueId(e) {
                I.information("getTaskIdByTaskUniqueId", " taskUniqueId: ", e);
                let t = 0;
                return e && "" !== e && ((t = this.taskIdMap.get(e)) || (t = 0)), I.information("getTaskIdByTaskUniqueId", " taskId: ", t), t
            }

            addTaskToExistingTeam(e) {
                do {
                    if (!e) break;
                    let t = e.getTaskBaseInfo().taskId;
                    if (!t) break;
                    I.information("addTaskToExistingTeam", " taskId: ", t);
                    let i = this.getTaskUniqueIdByTask(e);
                    if ("" !== i) {
                        I.information("addTaskToExistingTeam", " taskUniqueId: ", i), this.taskIdMap.set(i, t);
                        let e = this.taskGroupInfoMap.get(i);
                        e && (I.information("addTaskToExistingTeam has taskGroupInfo, taskGroupInfo.taskId:", e.taskId), e.taskId || (I.information("addTaskToExistingTeam do joinTeam"), this.joinTeam(t, "" + e.groupId, e.groupName, e.memberCount, i).catch()))
                    }
                    let n = e.getTaskStatus();
                    T.emit(m.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnTaskStatusChange, t, n, i)
                } while (0)
            }

            exitAllTeam(e, t = !0) {
                if (I.information("exitAllTeam", " userId: ", e), !e) return;
                let i = new Map;
                for (let [e, t]of this.taskGroupInfoMap) this.setTaskPriority(t.taskId, 0), i.set(e, t);
                this.groupAcceleratingTaskNum = 0, this.enterGroupAccelerateTimeStamp = 0, t ? this.sendExitAllTeamCommand(e).then(e => {
                    I.information("exitAllTeam success"), this.saveGroupAccelerateInfo().then(e => {
                        I.information("exitAllTeam saveGroupAccelerateInfo")
                    }).catch(() => {
                        I.information("exitAllTeam saveGroupAccelerateInfo failed")
                    }), i.forEach((e, t) => {
                        T.emit(m.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnExitTeam, e.taskId, t)
                    })
                }).catch(() => {
                    I.information("exitAllTeam failed")
                }) : i.forEach((e, t) => {
                    T.emit(m.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnExitTeam, e.taskId, t)
                }), this.taskGroupInfoMap.clear()
            }

            updateCategoryViewTaskIdMap(e) {
                let t = e.getTasks();
                if (t) {
                    I.information("updateCategoryViewTaskIdMap tasks.size:", t.size);
                    for (let [, e]of t) if (e) {
                        let t = e.getTaskBaseInfo().taskId, i = this.getTaskUniqueIdByTask(e);
                        I.information("updateCategoryViewTaskIdMap", " taskId: ", t, " taskUniqueId: ", i), t && "" !== i && this.taskIdMap.set(i, t)
                    } else I.information("updateCategoryViewTaskIdMap bad task")
                }
            }

            updatePrivateSpaceCategoryViewTaskIdMap() {
                let e = [c.DownloadKernel.CategroyViewID.Downloading, c.DownloadKernel.CategroyViewID.Completed];
                for (let t of e) {
                    let e = b.getCurrentPrivateCategory();
                    if (e) {
                        let i = e.getCategoryViewFromId(t);
                        this.updateCategoryViewTaskIdMap(i)
                    }
                }
            }

            updateTaskIdMap() {
                I.information("updateTaskIdMap enter");
                let e = [c.DownloadKernel.CategroyViewID.Downloading, c.DownloadKernel.CategroyViewID.Completed];
                for (let t of e) {
                    I.information("updateTaskIdMap categroyViewID", t);
                    let e = S.getCategoryViewFromId(t);
                    this.updateCategoryViewTaskIdMap(e)
                }
                this.updatePrivateSpaceCategoryViewTaskIdMap()
            }

            onDetailChanged(e) {
                do {
                    if (!e) break;
                    I.information("onDetailChanged number of taskList:", e.length);
                    for (let t = 0; t < e.length; ++t) {
                        let i = e[t];
                        if (!i) continue;
                        let n = i.getTaskBaseInfo(), a = n.taskId;
                        if (!a) continue;
                        let o = this.getTaskUniqueIdByTask(i);
                        if (!o || "" === o) continue;
                        I.information("onDetailChanged", " taskId: ", a);
                        let r = this.taskIdMap.get(o);
                        I.information("onDetailChanged", " taskUniqueId: ", o, ", taskIdRecord:", r), r || (this.addTaskToExistingTeam(i), T.emit(m.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnReceiveGcid, a, o));
                        let s = i.getDownloadSpeed(), l = this.getIncreaseSpeedInfo(a), d = l.increaseSpeed, u = {};
                        u.uploaded = this.getUploadedSize(), u.progress = n.fileSize > 0 ? 100 * n.downloadSize / n.fileSize : 0, u.progress > 100 && (u.progress = 100), u.increased = l.increaseSize;
                        let c = JSON.stringify(u);
                        I.information("onDetailChanged", " taskSpeed: ", s, " increaseSpeed: ", d, " extraInfoStr: ", c), T.emit(m.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnTaskSpeedChange, a, s, d, c, o)
                    }
                } while (0)
            }

            onTaskStatusChanged(e) {
                for (let t = 0; t < e.length; ++t) {
                    let i = e[t];
                    if (!i) continue;
                    let n = i.getId(), a = i.getTaskStatus();
                    i.getTaskPreStatus() === c.DownloadKernel.TaskStatus.StartPending && a === c.DownloadKernel.TaskStatus.Started && this.addTaskToExistingTeam(i);
                    let o = this.getTaskUniqueIdByTask(i);
                    if (!o || "" === o) continue;
                    let r = a;
                    if (I.information("onTaskStatusChanged", " taskId: ", n), I.information("onTaskStatusChanged", " taskUniqueId: ", o), I.information("onTaskStatusChanged", " status: ", r), T.emit(m.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnTaskStatusChange, n, r, o), a === c.DownloadKernel.TaskStatus.DestroyPending) {
                        I.information("onTaskStatusChanged delete taskInfoMap taskUniqueId:", o), this.taskIdMap.delete(o);
                        let e = this.taskGroupInfoMap.get(o);
                        e && e.taskId === n && (e.taskId = 0)
                    }
                    a !== c.DownloadKernel.TaskStatus.Succeeded && a !== c.DownloadKernel.TaskStatus.Seeding || this.sendFileCompleteStat(n)
                }
            }

            onInsertToCategoryView(e, t, i) {
                if (i) if (t === c.DownloadKernel.CategroyViewID.Downloading) {
                    I.information("onInsertToCategoryView Downloading number of taskList:", i.length);
                    for (let e = 0; e < i.length; ++e) {
                        let t = i[e];
                        if (!t) continue;
                        let n = t.getId(), a = this.getTaskUniqueIdByTask(t);
                        a && "" !== a && (I.information("onInsertToCategoryView taskId: ", n, "taskUniqueId: ", a), this.taskIdMap.get(a) || this.addTaskToExistingTeam(t))
                    }
                } else if (t === c.DownloadKernel.CategroyViewID.Recycle) {
                    I.information("onInsertToCategoryView Recycle number of taskList:", i.length);
                    for (let e = 0; e < i.length; ++e) {
                        let t = i[e];
                        if (!t) continue;
                        let n = t.getId(), a = this.getTaskUniqueIdByTask(t);
                        a && "" !== a && (I.information("onInsertToCategoryView", " taskId: ", n), I.information("onInsertToCategoryView", " taskUniqueId: ", a), T.emit(m.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnTaskStatusChange, n, 20, a))
                    }
                }
            }

            onRemoveFromCategoryView(e, t, i) {
                if (t === c.DownloadKernel.CategroyViewID.Recycle) do {
                    if (!i) break;
                    I.information("onRemoveFromCategoryView number of taskList:", i.length);
                    for (let e = 0; e < i.length; ++e) {
                        let t = i[e];
                        if (!t) continue;
                        let n = t.getId(), a = t.getTaskStatus(), o = this.getTaskUniqueIdByTask(t);
                        if (!o || "" === o) continue;
                        let r = a;
                        I.information("onRemoveFromCategoryView", " taskId: ", n), I.information("onRemoveFromCategoryView", " taskUniqueId: ", o), I.information("onRemoveFromCategoryView", " status: ", r), T.emit(m.GroupAccelerateEventManagerNS.GroupAccelerateEventType.OnTaskStatusChange, n, r, o)
                    }
                } while (0)
            }

            reportGroupAccelerateTaskInfo() {
                do {
                    if (!this.currentUserId || 0 === this.currentUserId) break;
                    I.information("reportGroupAccelerateTaskInfo", " currentUserId: ", this.currentUserId);
                    let e = new Array;
                    if (this.taskGroupInfoMap.forEach((t, i) => {
                        let n = {};
                        n.group_id = t.groupId, I.information("reportGroupAccelerateTaskInfo", " groupId: ", t.groupId), n.uid = this.currentUserId;
                        let a = t.taskId;
                        if (a) {
                            let e = w.getTaskFromTaskId(a);
                            if (e) {
                                let t = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.DownloadSize),
                                    i = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.FileSize);
                                n.rate = Math.round(1e3 * t / i) / 10, n.ul_total = this.getUploadedSize(), n.ul_time = (new Date).getTime() - this.enterGroupAccelerateTimeStamp, n.dl_speed = this.getTaskAverageSpeed(a)
                            } else n.rate = 0, n.ul_total = 0, n.ul_time = 0, n.dl_speed = 0
                        } else n.rate = 0, n.ul_total = 0, n.ul_time = 0, n.dl_speed = 0;
                        I.information("reportGroupAccelerateTaskInfo", " group_id: ", n.group_id), I.information("reportGroupAccelerateTaskInfo", " rate: ", n.rate), I.information("reportGroupAccelerateTaskInfo", " ul_total: ", n.ul_total), I.information("reportGroupAccelerateTaskInfo", " ul_time: ", n.ul_time), I.information("reportGroupAccelerateTaskInfo", " dl_speed: ", n.dl_speed), e.push(n)
                    }), e.length <= 0) break;
                    d.fetchSlRes({url: "/group_accel/report_batch", data: {data: e}, method: "post"}).then(e => {
                    }).catch(() => {
                    })
                } while (0)
            }

            checkTaskGroupAccelerateStatus() {
                I.information("checkTaskGroupAccelerateStatus this.currentUserId:", this.currentUserId), this.currentUserId && 0 !== this.currentUserId && this.loadGroupAccelerateInfo().then(e => {
                    do {
                        if (!e || e.size <= 0) {
                            I.information("checkTaskGroupAccelerateStatus bad taskGroupInfoMapTemp");
                            break
                        }
                        let t = [];
                        if (e.forEach((e, i) => {
                            let n = e.taskId;
                            if (I.information("checkTaskGroupAccelerateStatus", " taskUniqueId: ", i, " taskId: ", n), n) {
                                w.getTaskFromTaskId(n) && i && "" !== i && (I.information("checkTaskGroupAccelerateStatus has task"), t.push(i))
                            }
                        }), t.length <= 0) break;
                        d.fetchSlRes({
                            url: "/group_accel/belong_batch",
                            data: {uid: this.currentUserId, tasks: t},
                            method: "post"
                        }).then(t => {
                            if (I.information("checkTaskGroupAccelerateStatus fetchSlRes success res.data: ", t.data), "ok" === t.data.result && t.data.data) {
                                let i = t.data.data;
                                for (let t = 0; t < i.length; t++) if (I.information("checkTaskGroupAccelerateStatus data[", t, "]:", i[t]), 1 === i[t].belong_status) {
                                    let n = i[t].group_id, a = i[t].member_count, o = i[t].group_name, r = i[t].task;
                                    e.forEach((e, t) => {
                                        if (e.groupId === n && t === r) {
                                            this.joinTeam(e.taskId, "" + n, o, a, t).catch();
                                            let i = this.taskGroupInfoMap.get(t);
                                            i && (i.memberCount = a, i.groupName = o)
                                        }
                                    })
                                }
                            }
                        }).catch(() => {
                            I.information("checkTaskGroupAccelerateStatus", " fetchSlRes failed")
                        })
                    } while (0)
                }).catch(() => {
                })
            }

            sendExitAllTeamCommand(e) {
                return n(this, void 0, void 0, function* () {
                    let t = !1;
                    do {
                        if (!e) break;
                        let i = new Array;
                        this.taskGroupInfoMap.forEach((e, t) => {
                            i.push(e.groupId), I.information("sendExitAllTeamCommand", " groupId: ", e.groupId)
                        }), 0 === i.length && (I.information("sendExitAllTeamCommand no group"), t = !0), d.fetchSlRes({
                            url: "/group_accel/exit_batch",
                            data: {uid: this.currentUserId, group_ids: i},
                            method: "post"
                        }).then(e => {
                            I.information("sendExitAllTeamCommand success"), t = !0
                        }).catch(() => {
                            I.information("sendExitAllTeamCommand failed"), t = !1
                        })
                    } while (0);
                    return t
                })
            }

            getUserGroupAccelerateInfo() {
                return n(this, void 0, void 0, function* () {
                    I.information("getUserGroupAccelerateInfo this.currentUserId:", this.currentUserId), this.currentUserId && 0 !== this.currentUserId && d.fetchSlRes({
                        url: "/group_accel/user_info",
                        data: {uid: this.currentUserId},
                        method: "get"
                    }).then(e => {
                        do {
                            if (I.information("getUserGroupAccelerateInfo success ", e), !e) {
                                I.information("getUserGroupAccelerateInfo bad res"), this.currentUserLicensed = !1;
                                break
                            }
                            if (!e.data) {
                                I.information("getUserGroupAccelerateInfo bad res.data"), this.currentUserLicensed = !1;
                                break
                            }
                            if (!e.data.data) {
                                I.information("getUserGroupAccelerateInfo bad res.data"), this.currentUserLicensed = !1;
                                break
                            }
                            e.data.data.have_licence && 1 === e.data.data.have_licence ? (I.information("getUserGroupAccelerateInfo licensed"), this.currentUserLicensed = !0) : (I.information("getUserGroupAccelerateInfo not licensed"), this.currentUserLicensed = !1)
                        } while (0)
                    }).catch(() => {
                        I.information("getUserGroupAccelerateInfo fail"), this.currentUserLicensed = !1
                    })
                })
            }

            getNewPercent(e, t) {
                I.information("getNewPercent", " currentPercent: ", e, " taskType: ", t);
                let i = 0, n = 0, a = 5, o = 0;
                do {
                    if (t === c.DownloadKernel.TaskType.P2sp) i = 10, n = 40, a = 5; else if (t === c.DownloadKernel.TaskType.Bt) i = 30, n = 80, a = 10; else {
                        if (t !== c.DownloadKernel.TaskType.Emule) {
                            o = e;
                            break
                        }
                        i = 20, n = 60, a = 10
                    }
                    if (e) if (e < i || e > n) o = i + (n - i) * Math.random(); else {
                        let t = e - a;
                        t < i && (t = i);
                        let r = e + a;
                        r > n && (r = n), o = t + (r - t) * Math.random()
                    } else o = i + (n - i) * Math.random()
                } while (0);
                return I.information("getNewPercent", " newPercent: ", o), o
            }

            setTaskPriority(e, t) {
                do {
                    if (!e) break;
                    if (!t || 0 !== t && 700 !== t && 999 !== t) break;
                    let i = w.getTaskFromTaskId(e);
                    if (!i) break;
                    i.getExtraObject().setTaskPriorityLevel(-1, t), I.information("taskExtra.setTaskPriorityLevel taskId: ", e, ", index: -1, priority: ", t)
                } while (0)
            }

            getTaskAverageSpeed(e) {
                let t = w.getTaskFromTaskId(e);
                if (!t) return 0;
                let i = t.getTaskAttribute(c.DownloadKernel.TaskAttribute.DownloadingPeriod),
                    n = t.getTaskAttribute(c.DownloadKernel.TaskAttribute.DownloadSize);
                0 === i && (i = 1);
                let a = Math.round(n / i);
                return I.information("getTaskAverageSpeed taskId:", e, ", taskAverageSpeed:", a), I.information("getTaskAverageSpeed downloadSize:", n, ", downloadingPeriod:", i), a
            }

            getIncreaseSpeedInfo(e) {
                let t = {increaseSpeed: 0, increaseSize: 0};
                do {
                    if (!e) break;
                    let i = w.getTaskFromTaskId(e);
                    if (!i) break;
                    let n = this.getTaskUniqueIdByTaskId(e);
                    if (!n || "" === n) break;
                    let a = this.taskGroupInfoMap.get(n);
                    if (!a) break;
                    let o = i.getTaskBaseInfo().taskType, r = a.currentPercent, s = this.getNewPercent(r, o);
                    a.currentPercent = s;
                    let l = this.getTaskP2PSpeedInfo(e), d = Math.round(s * l.p2pSpeed / 100),
                        u = Math.round(s * l.p2pSize / 100), c = a.currentIncreaseSize;
                    c += u, a.currentIncreaseSpeed = d, a.currentIncreaseSize = c, t.increaseSpeed = d, t.increaseSize = c
                } while (0);
                return t
            }

            getTaskP2PSpeedInfo(e) {
                let t = {p2pSpeed: 0, p2pSize: 0};
                do {
                    if (!e) break;
                    let i = w.getTaskFromTaskId(e);
                    if (!i) break;
                    let n = this.getTaskUniqueIdByTask(i);
                    if (!n || "" === n) break;
                    let a = this.taskGroupInfoMap.get(n);
                    if (!a) break;
                    let o = i.getTaskBaseInfo().downloadingPeriod;
                    if (!o) break;
                    let r = i.getTaskChannelInfo();
                    if (!r) break;
                    let s = r.p2pSize - r.dcdnSize;
                    if (s < 0 && (s = 0), !a.lastDownloadingPeriod || !a.lastP2PSize) {
                        a.lastDownloadingPeriod = o, a.lastP2PSize = s;
                        break
                    }
                    let l = s - a.lastP2PSize;
                    l < 0 && (l = 0), a.lastP2PSize = s;
                    let d = o - a.lastDownloadingPeriod;
                    d < 0 && (d = 0), a.lastDownloadingPeriod = o;
                    let u = 0;
                    0 !== d && (u = Math.round(l / d));
                    let c = i.getTaskBaseInfo().downloadSpeed;
                    u > c && (u = c), t.p2pSpeed = u, t.p2pSize = l
                } while (0);
                return t
            }

            getUploadedSize() {
                let e = 0, t = h.DownloadKernelManager.getTotalUploadSize();
                return t && (e = t, this.enterGroupAccelerateUploadSize && (e -= this.enterGroupAccelerateUploadSize)), e
            }

            saveGroupAccelerateInfo() {
                return n(this, void 0, void 0, function* () {
                    if (I.information("saveGroupAccelerateInfo", " currentUserId: ", this.currentUserId), !this.currentUserId) return;
                    let e = r.join(__profilesDir, "GroupAccelerate");
                    (yield s.FileSystemAWNS.existsAW(e)) || (yield s.FileSystemAWNS.mkdirsAW(e));
                    let t = r.join(__profilesDir, "GroupAccelerate\\TaskInfoEx_" + this.currentUserId + ".txt");
                    I.information("saveGroupAccelerateInfo", " filePath: ", t), I.information("saveGroupAccelerateInfo", " this.taskGroupInfoMap.size: ", this.taskGroupInfoMap.size);
                    let i = JSON.stringify([...this.taskGroupInfoMap]);
                    I.information("saveGroupAccelerateInfo", " strData: ", i), yield s.FileSystemAWNS.writeFileAW(t, i)
                })
            }

            loadGroupAccelerateInfo() {
                return n(this, void 0, void 0, function* () {
                    if (I.information("loadGroupAccelerateInfo", " currentUserId: ", this.currentUserId), !this.currentUserId) return null;
                    let e = r.join(__profilesDir, "GroupAccelerate\\TaskInfoEx_" + this.currentUserId + ".txt");
                    I.information("loadGroupAccelerateInfo", " filePath: ", e);
                    let t = yield s.FileSystemAWNS.readFileAW(e), i = null;
                    try {
                        let e = t.toString();
                        return I.information("loadGroupAccelerateInfo", " fileStr: ", e), i = new Map(JSON.parse(e))
                    } catch (e) {
                        return null
                    }
                })
            }

            sendFileCompleteStat(e) {
                do {
                    if (!e) break;
                    let t = w.getTaskFromTaskId(e);
                    if (!t) break;
                    let i = this.getTaskUniqueIdByTask(t);
                    if (!i || "" === i) break;
                    let n = t.getTaskAttribute(c.DownloadKernel.TaskAttribute.FileSize);
                    if (!n || n < 104857600) break;
                    let a = this.taskGroupInfoMap.get(i);
                    if (!a) break;
                    let r = a.previousSpeed;
                    if (!r) break;
                    let s = "pannel=complete,taskid=" + e + ",gcid=" + i + ",previos_speed=" + r + ",stop_speed=" + this.getTaskAverageSpeed(e);
                    I.information("SendFileCompleteStat", " strExtData: ", s), o.XLStatNS.trackEvent("download_pannel", "groupspeed", "", 0, 0, 0, 0, s)
                } while (0)
            }

            getIsVip() {
                return n(this, void 0, void 0, function* () {
                    return new Promise(e => {
                        y.LoginHelperNS.loginHelper.getUserInfo("vipList", function (t) {
                            k.isArray(t) && t[0] ? e("1" === t[0].isVip) : e(!1)
                        })
                    })
                })
            }
        }

        e.Manager = t;
        const i = new t;
        e.getManager = function () {
            return i
        }
    }(t.GroupAccelerateManagerNS || (t.GroupAccelerateManagerNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(18), o = i(0), r = i(14), s = i(132), l = i(10), d = i(13), u = i(328), c = i(128),
        h = i(7), {isDef: f} = r.ThunderUtil, g = o.default.getLogger("Thunder.Skin:spring-festival-skin");
    !function (e) {
        let t = void 0, o = !1;
        const r = 1e4;
        let p = null;
        e.init = function () {
            return n(this, void 0, void 0, function* () {
                yield function () {
                    return n(this, void 0, void 0, function* () {
                        return new Promise(e => {
                            l.ConfigNS.attachListener(d.NodeEventMesssageNS.eventConfigInitFinished, () => {
                                e(!0)
                            })
                        })
                    })
                }();
                let e = null;
                try {
                    const t = "http://msg.vip.xunlei.com/xlact/conf";
                    g.information("init", "url", t);
                    let n = yield h.client.callServerFunction("GetPeerID");
                    a.default.defaults.adapter = i(21);
                    let s = yield c.VipPluginFunctionNS.getThunderVersionNumber(), l = yield a.default.get(t, {
                        params: {
                            actid: "vip2019redpack",
                            source: 3e3,
                            peerid: n,
                            inVersion: s
                        }, timeout: r
                    });
                    g.information("init res", l), 200 === l.status && f(l.data) && 0 === l.data.result && f(l.data.data) && (o = Boolean(l.data.data.is_spring_festival), e = l.data.data.skin, p = l.data.data.scroll_text)
                } catch (e) {
                    g.warning(e)
                }
                e = e || {}, localStorage.setItem("springFestivalSkinData", JSON.stringify(e))
            })
        }, e.canShowSkin = function () {
            return n(this, void 0, void 0, function* () {
                do {
                    let e = l.ConfigNS.getValue("Skin", "DisableSpringFestivalSkin", !1);
                    if (g.information("showSkin disable", e), e) {
                        t = !1;
                        break
                    }
                    t = o
                } while (0);
                return t
            })
        }, e.getSkin = function (e) {
            return n(this, void 0, void 0, function* () {
                let t = null;
                do {
                    let i = yield u.default.getSpringFestivalWallpaper();
                    if (!i) break;
                    e && (yield u.default.removeImage(i));
                    let n = yield u.default.getImage(i);
                    t = {
                        type: s.SkinHelperNS.SkinType.Wallpaper,
                        colorID: i.color,
                        image: n,
                        opacity: i.transparency / 100,
                        opacityDesc: !0,
                        skinID: i.id,
                        is_spring_festival: !0
                    }
                } while (0);
                return t
            })
        }, e.disableSkin = function () {
            !0 === t && (t = !1, l.ConfigNS.setValue("Skin", "DisableSpringFestivalSkin", !0))
        }, e.onClickLink = function () {
            let e = (new Date).toLocaleDateString();
            l.ConfigNS.setValue("Skin", "SpringFestivalLinkClickDate", e)
        }, e.canShowLink = function () {
            return n(this, void 0, void 0, function* () {
                let e = !0;
                return l.ConfigNS.getValue("Skin", "SpringFestivalLinkClickDate", "") === (new Date).toLocaleDateString() && (e = !1), e
            })
        }, e.getColor = function () {
            return {
                id: 11,
                defaultOpacity: .8,
                colors: {
                    colorAccordion: ["255,149,87", "255,64,64"],
                    colorGradientBackground: ["255,147,119", "255,64,51"],
                    colorGradientForeground: ["255,244,225", "255,239,214"],
                    colorPrimary: "236,78,78",
                    colorPrimaryControl1: "255,109,109",
                    colorPrimaryControl2: "236,78,78",
                    colorPrimaryControl3: "248,197,197",
                    colorPrimaryControl4: "251,229,229",
                    colorPrimaryGradient: ["255,136,106", "255,84,84"],
                    colorPrimaryText: "87,5,5",
                    colorSearch: "255,232,232",
                    colorSecondary: "183,68,68"
                }
            }
        }, e.getTextLink = function (e) {
            let t = null;
            return p && (t = e ? p.login : p.unlogin), t
        }
    }(t.SpringFestivalSkinNS || (t.SpringFestivalSkinNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(19), o = i(0), r = i(443), s = i(14), l = i(5), d = i(329),
        u = o.default.getLogger("Thunder.speedcurve-skin.skin-manager"), c = r.SpeedCurveSkinHelperNS.cacheDir;
    t.default = new class extends a.EventEmitter {
        constructor() {
            super(), this.skinInfo = r.SpeedCurveSkinHelperNS.defaultSkinInfo, this.cacheURL = `${c}/skin-info.json`, this.init().catch(e => {
                u.warning(e)
            })
        }

        init() {
            return n(this, void 0, void 0, function* () {
                do {
                    let e;
                    (yield l.FileSystemAWNS.existsAW(c)) || (yield l.FileSystemAWNS.mkdirAW(c));
                    try {
                        e = JSON.parse((yield l.FileSystemAWNS.readFileAW(this.cacheURL)).toString())
                    } catch (e) {
                        u.warning("解析皮肤信息失败")
                    }
                    if (s.ThunderUtil.isUndef(e)) break;
                    let t = null;
                    try {
                        t = JSON.parse(localStorage.getItem("speedcurveSkins"))
                    } catch (e) {
                        u.warning(e)
                    }
                    if (null === t && (t = (yield d.default.getSkins()) || []), e = t.find(t => t.id === e.id), s.ThunderUtil.isUndef(e)) break;
                    yield this.setSkinInfo(e)
                } while (0)
            })
        }

        getSkinInfo() {
            return this.skinInfo
        }

        setSkinInfo(e, t = !1, i = !1) {
            return n(this, void 0, void 0, function* () {
                if (s.ThunderUtil.isDef(e)) {
                    this.skinInfo = e, this.emit("changeSkin", this.skinInfo, t, i);
                    try {
                        if (!i) {
                            let t = {id: e.id, type: e.type};
                            u.information("保存皮肤", JSON.stringify(t)), yield l.FileSystemAWNS.writeFileAW(this.cacheURL, JSON.stringify(t))
                        }
                    } catch (e) {
                        u.warning("保存皮肤信息失败")
                    }
                }
            })
        }
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        let t;
        !function (e) {
            e[e.Default = 0] = "Default", e[e.Normal = 1] = "Normal", e[e.Vip = 2] = "Vip", e[e.SuperVip = 3] = "SuperVip"
        }(t = e.SkinType || (e.SkinType = {})), e.defaultSkinInfo = {
            type: t.Default,
            id: 1
        }, e.cacheDir = `${__profilesDir}/speedcurve-skin`
    }(t.SpeedCurveSkinHelperNS || (t.SpeedCurveSkinHelperNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(19), o = i(0), r = i(445), s = i(14), l = i(5),
        d = o.default.getLogger("Thunder.suspension-skin.skin-manager"), u = r.SuspensionSkinHelperNS.cacheDir;
    t.default = new class extends a.EventEmitter {
        constructor() {
            super(), this.skinInfo = r.SuspensionSkinHelperNS.defaultSkinInfo, this.init().catch(e => {
                d.warning(e)
            })
        }

        init() {
            return n(this, void 0, void 0, function* () {
                (yield l.FileSystemAWNS.existsAW(u)) || (yield l.FileSystemAWNS.mkdirAW(u)), yield this.setSkinInfo(this.skinInfo)
            })
        }

        getSkinInfo() {
            return this.skinInfo
        }

        setSkinInfo(e, t = !1, i = !1) {
            return n(this, void 0, void 0, function* () {
                s.ThunderUtil.isDef(e) && (this.skinInfo = e, this.emit("changeSkin", this.skinInfo, t, i))
            })
        }
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        let t;
        !function (e) {
            e[e.Default = 0] = "Default", e[e.Vip = 1] = "Vip"
        }(t = e.SkinType || (e.SkinType = {})), e.defaultSkinInfo = {
            type: t.Default,
            id: 1,
            name: "默认皮肤"
        }, e.vipSkinInfo = {type: t.Vip, id: 2, name: "会员皮肤"}, e.cacheDir = `${__profilesDir}/suspension-skin`
    }(t.SuspensionSkinHelperNS || (t.SuspensionSkinHelperNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(7), o = i(16), r = i(0), s = i(18), l = i(61), d = r.default.getLogger("vip-label-config");
    !function (e) {
        let t = void 0, i = void 0, r = new Map;

        function u() {
            return n(this, void 0, void 0, function* () {
                if (!t) {
                    let e = yield a.client.callServerFunction("GetThunderVersion"), i = e.lastIndexOf(".");
                    t = e.slice(0, i)
                }
                return t
            })
        }

        e.getConfig = function (e) {
            return n(this, void 0, void 0, function* () {
                let t = r.get(e);
                return t || (t = yield function (e) {
                    return n(this, void 0, void 0, function* () {
                        let t = yield u(), o = yield function () {
                                return n(this, void 0, void 0, function* () {
                                    if (!i) {
                                        let e = 0, t = yield u(), n = t.split(".");
                                        if (n && 3 === n.length) {
                                            let t = Number(n[0]).valueOf(), i = Number(n[1]).valueOf(),
                                                a = Number(n[2]).valueOf(), o = 128;
                                            e = o * Math.pow(2, 24) + t * Math.pow(2, 16) + i * Math.pow(2, 8) + a
                                        }
                                        i = e
                                    }
                                    return i
                                })
                            }(), r = e, l = yield a.client.callServerFunction("GetPeerID"),
                            c = yield a.client.callServerFunction("GetTpPeerId"), h = "",
                            f = yield a.client.callServerFunction("GetUserID");
                        if ("0" !== f) {
                            let e = yield a.client.callServerFunction("GetSessionID");
                            h = `http://advertpay.vip.xunlei.com/xlx/advertisement?iver=${o}&over=${t}&userid=${f}&sessionid=${e}&scene=${r}&deviceid=${l}&cpeerid=${c}&timestamp=${Date.now()}`
                        } else h = `http://advertpay.vip.xunlei.com/xlx/advertisement?iver=${o}&over=${t}&scene=${r}&deviceid=${l}&cpeerid=${c}&timestamp=${Date.now()}`;
                        d.information(`geturl=${h}`);
                        let g = yield function (e) {
                            return n(this, void 0, void 0, function* () {
                                let t = new Promise(t => {
                                    s.default.get(e, {timeout: 1e4}).then(e => {
                                        let i = null;
                                        d.information("response vipData:", e), null !== e && 200 === e.status && null !== e.data && 0 === e.data.result && e.data.data && (i = e.data.data), t(i)
                                    }).catch(e => {
                                        d.error("err:", e), t(null)
                                    })
                                });
                                return t
                            })
                        }(h);
                        return d.information("key", e, "configdata", g), g
                    })
                }(e), r.set(e, t)), t
            })
        }, function () {
            o.NativeCallModule.nativeCall.AttachNativeEvent("onUserInfoChange", (e, t) => n(this, void 0, void 0, function* () {
                if ("vipinfo" === e) {
                    d.information("onUserInfoChange");
                    let e = !1;
                    try {
                        let t = JSON.parse(yield a.client.callServerFunction("GetUserInfo", 2));
                        t && (e = Boolean(t.isVip))
                    } catch (e) {
                        d.warning(e)
                    }
                    e && r.clear()
                }
            })), o.NativeCallModule.nativeCall.AttachNativeEvent("onLoginStatusChange", (e, t) => {
                d.information("onLoginStatusChange", "newStatus", t), "unlogin" === t || "offline" === t ? r.clear() : "online" === t && r.clear()
            })
        }(), e.getConfigUrl = function (e, t, i, n) {
            if (i) {
                let n = l.ParseUrlFileNameNS.parseDynamicUrlPath(i.toLowerCase()),
                    a = l.ParseUrlFileNameNS.parseDynamicUrlArgs(n.args), o = Object.getOwnPropertyNames(a), r = "";
                for (let i = 0; i < o.length; ++i) {
                    let n = o[i];
                    r += "referfrom" === n && e ? `&${n}=${e}` : "aidfrom" === n && t ? `&${n}=${t}` : `&${n}=${a[n]}`
                }
                return o.indexOf("referfrom") < 0 && (r += `&referfrom=${e}`), o.indexOf("aidfrom") < 0 && (r += `&aidfrom=${t}`), `${n.pageFileName}?${r.substr(1)}`
            }
            return n ? `${n}?referfrom=${e}&aidfrom${t}` : ""
        }
    }(t.VipLableConfigNS || (t.VipLableConfigNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(17), r = i(12), s = i(331), l = i(28), d = i(6), u = i(0), c = i(558),
        h = s.MsgQueueManagerNS.MsgQueue.getInstance().getQueue("notification"),
        f = d.default(a.join(__rootDir, "../bin/ThunderHelper.node")), g = u.default.getLogger("notification");
    !function (e) {
        let t = null, i = null, a = !1, s = !1;

        function d() {
            return n(this, void 0, void 0, function* () {
                if (s) return;
                s = !0, (yield r.asyncRemoteCall.getIpcMain()).on(l.ThunderChannelList.channelMRNotificationMsg, (e, ...t) => {
                    do {
                        if (g.information("notification-event"), null === t[0] || void 0 === t[0]) break;
                        let e = t[0];
                        switch (e) {
                            case"hover":
                                g.information("msg", e, t[1]), a = t[1];
                                break;
                            case"close":
                                g.information("msg", e), p().catch()
                        }
                    } while (0)
                })
            })
        }

        function u(e) {
            return n(this, void 0, void 0, function* () {
                return new Promise(t => n(this, void 0, void 0, function* () {
                    o.ipcRenderer.once("notify-window-created", (e, i) => n(this, void 0, void 0, function* () {
                        let e = yield(yield r.asyncRemoteCall.getBrowserWindow()).fromId(i);
                        t(e)
                    })), o.ipcRenderer.send("create-notify-window", e)
                }))
            })
        }

        function p() {
            return n(this, void 0, void 0, function* () {
                try {
                    g.information("close"), t && !(yield t.isDestroyed()) && t.close()
                } catch (e) {
                    g.warning(e)
                }
            })
        }

        function v(e) {
            g.information("setTimer..."), a = !1, e = e || 1e4, i && m(), i = setInterval(() => {
                a || (e -= 1e3) <= 0 && p().catch()
            }, 1e3)
        }

        function m() {
            i && (g.information("killTimer..."), clearInterval(i), i = null)
        }

        e.notify = function (e, i) {
            return n(this, void 0, void 0, function* () {
                do {
                    if (f.IsInFullScreen()) break;
                    let o = "development" === process.env.RUN_ENV ? "http://localhost:9080/notification-renderer/" : `file:///${__dirname}/../notification-renderer/index.html`;
                    if (e.url && (o = e.url), "AdvertisementWebPageTips" !== e.type) {
                        yield d();
                        let n = yield u(e);
                        t = n, (yield r.asyncRemoteCall.getIpcMain()).once("notification-init", i => {
                            n === t && (g.information("notification-init"), i.sender.send("notification-init-reply", e))
                        }), g.information("notification...", e), t.once("ready-to-show", () => {
                            n === t && (g.information("ready-to-show..."), t.showInactive(), t.setAlwaysOnTop(!1), v(e.duration), i && i("ready-to-show"))
                        }), t.once("closed", () => {
                            n === t && (g.information("closed..."), m(), t = null, h.deQueue())
                        }), t.loadURL(o)
                    } else {
                        let s = (yield(yield r.asyncRemoteCall.getScreen()).getPrimaryDisplay()).workArea,
                            l = e.width || 300, d = e.height || 280, u = s.width - l, f = s.height - d, p = null;
                        c.default.createWebPageTipDlg(o, {
                            x: u,
                            y: f,
                            width: l,
                            height: d
                        }, null, e.title, (o, ...r) => {
                            if (g.information("callback", o, ...r), i && i(o, ...r), "webpage_loaded" === o) v(e.duration); else if ("mouse_hover" === o) a = !0; else if ("mouse_leave" === o) a = !1; else if ("webpage_load_failed" === o) ; else if ("click" === o) {
                                if (t) {
                                    t.hide();
                                    let e = t;
                                    p = setTimeout(() => n(this, void 0, void 0, function* () {
                                        (yield e.isDestroyed()) || e.close()
                                    }), 5e3)
                                }
                            } else "closed" === o && (p && (clearTimeout(p), p = null), t = null, m(), h.deQueue())
                        }).then(e => {
                            g.information("notifyWindow=", e), t = e
                        }).catch()
                    }
                } while (0)
            })
        }, e.close = p, e.getCurrentWindow = function () {
            return t
        }
    }(t.NotificationNS || (t.NotificationNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(13), o = i(10);

    class r extends o.Config {
        constructor() {
            super(), this.isInit = !0
        }

        init(e) {
            return n(this, void 0, void 0, function* () {
            })
        }

        save() {
            return n(this, void 0, void 0, function* () {
            })
        }

        saveSync() {
        }

        fireValueChangedEvent(e, t, i, n) {
            this.eventContainer.fireEvent(a.NodeEventMesssageNS.eventMemoryConfigValueChanged, e, t, i, n)
        }
    }

    t.MemoryConfig = r;
    const s = new r;
    !function (e) {
        e.getValue = function (e, t, i) {
            return s.getValue(e, t, i)
        }, e.setValue = function (e, t, i) {
            s.setValue(e, t, i)
        }, e.removeValue = function (e, t) {
            s.removeValue(e, t)
        }, e.attachListener = function (e, t) {
            s.attachListener(e, t)
        }, e.detachListener = function (e, t) {
            s.detachListener(e, t)
        }
    }(t.MemoryConfigNS || (t.MemoryConfigNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(6).default(a.join(__rootDir, "../bin/ThunderHelper.node")), r = 1;
    let s = new Map;

    function l(e, t, i, n, a) {
        o.createRegKey(e, t), o.writeRegValue(e, t, i, n, a)
    }

    function d(e) {
        do {
            if (!e || "" === e) break;
            let t = s.get(e);
            if (!t) break;
            let i = "Xunlei." + t[0] + ".6", n = a.join(__rootDir, "../../" + t[2]),
                o = a.join(__rootDir, "../../Thunder.exe"), d = "Software\\Classes\\." + e;
            l("HKEY_CURRENT_USER", d, "", i, r), l("HKEY_CURRENT_USER", d = "Software\\Classes\\" + i, "", t[1], r), l("HKEY_CURRENT_USER", d = "Software\\Classes\\" + i + "\\DefaultIcon", "", n, r), l("HKEY_CURRENT_USER", d = "Software\\Classes\\" + i + "\\Shell\\Open", "", t[3], r), l("HKEY_CURRENT_USER", d = "Software\\Classes\\" + i + "\\Shell\\Open\\command", "", '"' + o + '" "%1" -StartType:' + e, r)
        } while (0)
    }

    function u(e) {
        do {
            if (!e || "" === e) break;
            let t = s.get(e);
            if (!t) break;
            let i = "Software\\Classes\\." + e;
            o.deleteRegKey("HKEY_CURRENT_USER", i), i = "Software\\Classes\\" + t[0], o.deleteRegKey("HKEY_CURRENT_USER", i), i = "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\." + e + "\\OpenWithList", o.deleteRegKey("HKEY_CURRENT_USER", i), i = "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\." + e + "\\OpenWithProgids", o.deleteRegKey("HKEY_CURRENT_USER", i), i = "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\." + e + "\\UserChoice", o.deleteRegKey("HKEY_CURRENT_USER", i), i = "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\." + e, o.deleteRegKey("HKEY_CURRENT_USER", i), d(e), o.refreshIcon()
        } while (0)
    }

    function c(e) {
        do {
            let t = "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\." + e + "\\OpenWithList",
                i = o.readRegString("HKEY_CURRENT_USER", t, "MRUList");
            if (null === i || void 0 === i || "" === i) break;
            let n = i.substring(0, 1);
            null !== (i = o.readRegString("HKEY_CURRENT_USER", t, n)) && void 0 !== i && "" !== i && "Thunder.exe" !== i && u(e)
        } while (0)
    }

    s.set("td", ["TDFile", "迅雷临时数据文件", "XLTempFile.ico", "使用迅雷下载未完成文件"]), s.set("xltd", ["TDFile", "迅雷临时数据文件", "XLTempFile.ico", "使用迅雷下载未完成文件"]), s.set("downlist", ["LSTFile", "迅雷专有下载文件", "XLDownloadList.ico", "使用迅雷下载该任务列表文件"]), s.set("torrent", ["Bittorrent", "BT种子文件", "TorrentFile.ico", "使用迅雷下载该BT文件"]), s.set("thunderskin", ["ThunderSkin", "迅雷9皮肤文件", "thunderskin.ico", "为迅雷9应用该皮肤"]), s.set("xlb", ["XLB", "迅雷下载合集文件", "DownloadCollection.ico", "使用迅雷查看该下载合集文件"]), function (e) {
        function t(e) {
            do {
                if (!e || "" === e) break;
                let t = s.get(e);
                if (!t) break;
                let i = "Xunlei." + t[0] + ".6";
                if (o.readRegString("HKEY_CURRENT_USER", "Software\\Classes\\." + e, "") === i) break;
                o.deleteRegKey("HKEY_CURRENT_USER", "Software\\Classes\\." + e), o.deleteRegKey("HKEY_CURRENT_USER", "Software\\Classes\\" + t[0]), o.deleteRegKey("HKEY_CURRENT_USER", "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\FileExts\\." + e), d(e), o.refreshIcon()
            } while (0)
        }

        function i(e) {
            return n(this, void 0, void 0, function* () {
                let t = !1;
                do {
                    let i = '"' + a.join(__rootDir, "../../Thunder.exe") + '" "%1" -StartType:' + e;
                    if (o.queryRegValue("HKEY_CURRENT_USER", "Software\\classes\\" + e + "\\Shell\\Open\\command", "") === i) break;
                    o.deleteRegKey("HKEY_CURRENT_USER", "Software\\classes\\" + e), l("HKEY_CURRENT_USER", "Software\\classes\\" + e, "URL Protocol", "", r), l("HKEY_CURRENT_USER", "Software\\classes\\" + e + "\\Shell\\Open\\command", "", i, r), t = !0
                } while (0);
                return t
            })
        }

        e.checkAndRegisterFileType = t, e.checkAndRegisterTorrentFile = function () {
            {
                let e = a.join(__rootDir, "../../Thunder.exe"), i = "torrent",
                    n = o.readRegString("HKEY_CURRENT_USER", "Software\\Classes\\Xunlei.Bittorrent.6\\Shell\\Open\\command", "");
                n && "" !== n ? (n.includes(e) || t(i), c(i)) : t(i)
            }
        }, e.doAsynCheckAndRegisterProtocal = i, e.asynCheckAndAssociate = function () {
            return n(this, void 0, void 0, function* () {
                t("td"), t("downlist"), yield i("ed2k"), yield i("magnet"), yield i("thunder"), yield i("thunderx"), yield i("xlb")
            })
        }
    }(t.FileAssociationNS || (t.FileAssociationNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(44), a = i(87), o = i(0).default.getLogger("Thunder.shub-http.http-session"), r = i(302),
        s = i(14), {isDef: l} = s.ThunderUtil;
    var d;
    !function (e) {
        e.HTTP = "HTTP", e.HTTPS = "HTTPS"
    }(d = t.Protocol || (t.Protocol = {}));
    t.HttpSession = class {
        constructor() {
            this.mRetries = 0, this.mHost = void 0, this.mPort = void 0, this.mPath = void 0, this.mAuth = void 0, this.mAccept = void 0, this.mBody = null, this.mUrl = void 0, this.mCookie = void 0, this.mProtocol = d.HTTP, this.mTimeout = void 0, this.mCurRetries = 0
        }

        set host(e) {
            this.mHost = e
        }

        get host() {
            return this.mHost
        }

        set port(e) {
            this.mPort = e
        }

        get port() {
            let e = void 0;
            return e = l(this.mPort) ? this.mPort : this.protocol === d.HTTPS ? 443 : 80
        }

        set path(e) {
            this.mPath = e
        }

        get path() {
            return this.mPath
        }

        set url(e) {
            this.mUrl = e
        }

        get protocol() {
            return this.mProtocol
        }

        set protocol(e) {
            this.mProtocol = e
        }

        get url() {
            return this.mUrl
        }

        get cookie() {
            return this.mCookie
        }

        set cookie(e) {
            this.mCookie = e
        }

        set auth(e) {
            this.mAuth = e
        }

        get auth() {
            return this.mAuth
        }

        set accept(e) {
            this.mAccept = e
        }

        get accept() {
            return this.mAccept
        }

        set body(e) {
            this.mBody = e
        }

        get body() {
            return this.mBody
        }

        set retries(e) {
            this.mRetries = e
        }

        get retries() {
            return this.mRetries
        }

        set timeout(e) {
            this.mTimeout = e
        }

        get timeout() {
            return this.mTimeout
        }

        post(e, t) {
            do {
                let i = this.body;
                if (!i) {
                    o.information("body is empty"), t(null);
                    break
                }
                let n = this.auth, a = this.accept, r = {
                    hostname: this.host,
                    port: this.port,
                    path: this.path || "/",
                    method: "POST",
                    auth: n || void 0,
                    headers: {"Content-Length": i ? i.length : 0, Cookie: this.cookie || "", Accept: a || "*/*"}
                };
                o.verbose("option", r);
                try {
                    this.postImpl(i, r, e, i => {
                        this.mCurRetries < this.retries ? (this.mCurRetries++, o.information("mCurRetries", this.mCurRetries), this.post(e, t)) : t(i)
                    })
                } catch (e) {
                    o.warning("error ", e), t(null)
                }
            } while (0)
        }

        get(e, t) {
            let i = null;
            if (this.url) {
                let e = n.parse(this.url, !0);
                e && "https:" === e.protocol ? this.protocol = d.HTTPS : this.protocol = d.HTTP, i = this.url
            } else {
                let e = this.auth, t = this.accept;
                i = {
                    hostname: this.host,
                    port: this.port,
                    path: this.path || "/",
                    method: "GET",
                    auth: e || void 0,
                    headers: {Cookie: this.cookie || "", Accept: t || "*/*"}
                }
            }
            o.verbose("option", i);
            try {
                this.getImpl(i, e, i => {
                    this.mCurRetries < this.retries ? (this.mCurRetries++, o.information("mCurRetries", this.mCurRetries), this.get(e, t)) : t(i)
                })
            } catch (e) {
                o.warning("error ", e), t(null)
            }
        }

        postImpl(e, t, i, n) {
            let s = (this.protocol === d.HTTPS ? r : a).request(t, e => {
                let t = null;
                e.on("data", e => {
                    t = t ? Buffer.concat([t, e]) : e
                }), e.on("end", () => {
                    o.information("statusCode", e.statusCode), o.information("headers", e.headers), i({
                        statusCode: e.statusCode,
                        headers: e.headers,
                        body: t
                    })
                })
            });
            s.on("error", e => {
                n(e)
            }), s.on("timeout", () => {
                s.abort()
            }), this.timeout && s.setTimeout(this.timeout), s.write(e), s.end()
        }

        getImpl(e, t, i) {
            (this.protocol === d.HTTPS ? r : a).get(e, e => {
                let i = null;
                e.on("data", e => {
                    i = i ? Buffer.concat([i, e]) : e
                }), e.on("end", () => {
                    o.information("statusCode", e.statusCode), o.information("headers", e.headers), t({
                        statusCode: e.statusCode,
                        headers: e.headers,
                        body: i
                    })
                })
            }).on("error", e => {
                i(e)
            })
        }
    }
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(55), o = i(36), r = i(38), s = i(9), l = i(0), d = i(335), u = l.default.getLogger("MenuContextHelper");
    const c = new class {
        constructor() {
            u.information("constructor MenuContextHelper object")
        }

        exitThunderX(e) {
            return n(this, void 0, void 0, function* () {
                (yield d.QuitMessageBoxMgrNS.popup()) && (yield a.quitPromises.run())
            })
        }

        showNewTaskPanel(e) {
            u.information("trackEvent", "core_event", "create_task_click", "click_source=other"), s.XLStatNS.trackEvent("core_event", "create_task_click", "", 0, 0, 0, 0, "click_source=other"), r.ThunderNewTask.createPreNewTaskWindow(null)
        }

        importUncompleted(e) {
            o.TaskOperatorNs.importUncompleted().catch()
        }

        initAccelerator() {
            window.addEventListener("keyup", e => {
                "n" !== e.key && "N" !== e.key || !e.ctrlKey || this.showNewTaskPanel("system-menu")
            }, !0)
        }
    };
    t.default = c
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(0), r = i(5), s = i(14), l = o.default.getLogger("plugin-updater");

    class d {
        constructor(e) {
            this.dir = "", this.versionsDir = "", l.verbose("constructor", "dir", e), this.dir = e, this.versionsDir = a.join(e, "versions")
        }

        static getPluginUpdater(e) {
            return new d(e)
        }

        install(e, t) {
            return n(this, void 0, void 0, function* () {
                l.information("install", "version", e, "src", t);
                try {
                    const i = yield this.getCurVersion();
                    if (s.ThunderUtil.versionCompare(i, e) >= 0) return;
                    yield this.save(e, t), yield this.setCurVersion(e)
                } catch (e) {
                    l.warning(e)
                }
            })
        }

        active() {
            return n(this, void 0, void 0, function* () {
                l.information("active");
                try {
                    const e = yield this.getCurVersion();
                    yield this.clear(this.versionsDir, e)
                } catch (e) {
                    l.warning(e)
                }
            })
        }

        getCurFilePath() {
            return n(this, void 0, void 0, function* () {
                l.information("getCurFilePath");
                try {
                    const e = yield this.getCurVersion();
                    if (e) return a.join(this.versionsDir, e)
                } catch (e) {
                    l.warning(e)
                }
                return ""
            })
        }

        clear(e, t) {
            return n(this, void 0, void 0, function* () {
                return l.information("clear", "src", e, "exclude", t), (yield r.FileSystemAWNS.readdirAW(e)).filter(e => e !== t).map(e => r.FileSystemAWNS.rmdirsAW(a.join(this.versionsDir, e)))
            })
        }

        save(e, t) {
            return n(this, void 0, void 0, function* () {
                yield r.FileSystemAWNS.mkdirsAW(this.dir), yield r.FileSystemAWNS.mkdirsAW(this.versionsDir);
                const i = a.join(this.versionsDir, e);
                return r.FileSystemAWNS.copyDirsAW(t, i)
            })
        }

        getCurVersion() {
            return n(this, void 0, void 0, function* () {
                return (yield r.FileSystemAWNS.readFileAW(`${this.dir}/VERION.txt`)).toString()
            })
        }

        setCurVersion(e) {
            return n(this, void 0, void 0, function* () {
                return r.FileSystemAWNS.writeFileAW(`${this.dir}/VERION.txt`, e)
            })
        }
    }

    t.default = d
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(0), r = i(6), s = i(3), l = i(29), d = i(638), u = i(30), c = i(13), h = i(40), f = i(39),
        g = i(42), p = i(5), v = o.default.getLogger("DownloadKernel.Upgrade"),
        m = r.default(a.join(__rootDir, "../bin/ThunderHelper.node")),
        y = l.DownloadKernelCategoryManager.getCategoryManager(), k = d.PrivateSpaceUpgradeNS.getUpgrade(),
        T = h.DownloadKernelCategoryViewManager.getCategoryViewManager();

    class w extends f.default {
        constructor() {
            super(...arguments), this.eventUpgradeProgress = "OnUpgradeProgress", this.totalTaskCount = 0, this.upgradeTaskCount = 0
        }

        upgradeP2sp(e) {
            let t = e.getSavePath(), i = e.getTaskName();
            return v.information("upgradeP2sp savePath:", t, ", taskName:", i), new Promise(e => {
                m.asyncUpgradeP2spTask(t, i, t => {
                    e(t)
                })
            })
        }

        upgradeBt(e) {
            let t = e.getExtraObject(), i = t.getFileCount(), o = t.getSeedFilePath(), r = a.parse(o), s = r.dir,
                l = r.name + r.ext, d = e.getSavePath(), u = t.getDisplayName(), c = "";
            if (1 !== i) d = a.join(d, u); else {
                let e = t.getBtFileInfoList();
                c = e[0].fileName
            }
            return v.information("upgradeBt savePath:", d, ", taskName:", u, ", fileCount:", i, ", seedFilePath:", o, ", seedFileName:", l), new Promise(e => {
                m.asyncUpgradeBtTask(d, l, s, t => n(this, void 0, void 0, function* () {
                    if (t && 1 === i) {
                        let e = a.join(d, u);
                        (yield p.FileSystemAWNS.existsAW(e)) || (yield p.FileSystemAWNS.mkdirAW(e));
                        let t = a.join(d, c), i = a.join(e, c);
                        t += ".bt.xltd", i += ".bt.xltd", (yield p.FileSystemAWNS.existsAW(i)) || (yield p.FileSystemAWNS.renameAW(t, i));
                        let n = a.join(d, l), o = a.join(e, l);
                        (yield p.FileSystemAWNS.existsAW(o)) || (yield p.FileSystemAWNS.renameAW(n, o))
                    }
                    e(t)
                }))
            })
        }

        upgradeEmule(e) {
            let t = e.getSavePath(), i = e.getTaskName(),
                n = e.getTaskAttribute(s.DownloadKernel.TaskAttribute.TaskUrl);
            return g.Common.isThunderPrivateUrl(n) && (n = g.Common.parseThunderPrivateUrl(n)), v.information("upgradeEmule url:", n, ", savePath:", t, ", taskName:", i), new Promise(e => {
                m.asyncUpgradeEmuleTask(n, t, i, t => {
                    e(t)
                })
            })
        }

        upgradeGroup(e) {
            return new Promise(t => {
                let i = e.getExtraObject(), n = i.getSubTaskCount();
                if (n > 0) for (let e = 0; e < n; e++) {
                    let n = i.getSubTaskByIndex(e);
                    n.getType() !== s.DownloadKernel.TaskType.Group && this.upgradeCategoryViewTask(n).then(e => {
                        t(e)
                    }).catch()
                } else t(!0)
            })
        }

        upgradeCategoryViewTask(e) {
            return n(this, void 0, void 0, function* () {
                let t = e.getType();
                return t === s.DownloadKernel.TaskType.P2sp ? this.upgradeP2sp(e) : t === s.DownloadKernel.TaskType.Bt ? this.upgradeBt(e) : t === s.DownloadKernel.TaskType.Emule && this.upgradeEmule(e)
            })
        }

        upgradeCategoryView(e) {
            let t = e.getTasks();
            if (t.size <= 0) return !1;
            this.totalTaskCount += t.size, this.fireEvent(this.eventUpgradeProgress, this.totalTaskCount, this.upgradeTaskCount);
            for (let [, e]of t) {
                e.getType() === s.DownloadKernel.TaskType.Group ? this.upgradeGroup(e).then(t => {
                    this.upgradeTaskCount += 1, v.information("upgradeGroup return. this.upgradeTaskCount:", this.upgradeTaskCount, ", result:", t, ", taskName:", e.getTaskName()), this.fireEvent(this.eventUpgradeProgress, this.totalTaskCount, this.upgradeTaskCount)
                }).catch() : this.upgradeCategoryViewTask(e).then(t => {
                    this.upgradeTaskCount += 1, v.information("upgradeCategoryViewTask return. this.upgradeTaskCount:", this.upgradeTaskCount, ", result:", t, ", taskName:", e.getTaskName()), this.fireEvent(this.eventUpgradeProgress, this.totalTaskCount, this.upgradeTaskCount)
                }).catch()
            }
            return !0
        }

        init() {
            let e = a.join(__rootDir, "../bin/SDK/");
            return m.initUpgrade(e)
        }

        upgradePrivateSpace(e) {
            return k.upgradePrivateSpace(e)
        }

        startUpgrade() {
            this.totalTaskCount = 0, this.upgradeTaskCount = 0, u.DownloadKernelManager.attachListener(c.NodeEventMesssageNS.eventTaskDataBaseLoadEnd, () => {
                let e = T.getCategoryViews();
                for (let t = 0; t < e.length; t++) {
                    let i = e[t], n = i.getCategoryViewId();
                    n !== s.DownloadKernel.CategroyViewID.Downloading && n !== s.DownloadKernel.CategroyViewID.Recycle || this.upgradeCategoryView(i)
                }
                let t = y.getCategorys();
                for (let [, e]of t) {
                    let t = e.getCategoryViews();
                    for (let e = 0; e < t.length; e++) {
                        let i = t[e], n = i.getCategoryViewId();
                        n !== s.DownloadKernel.CategroyViewID.Downloading && n !== s.DownloadKernel.CategroyViewID.Recycle || this.upgradeCategoryView(i)
                    }
                }
            })
        }
    }

    t.DownloadKernelUpgrade = w, function (e) {
        const t = new w;
        e.getUpgrade = function () {
            return t
        }
    }(t.DownloadKernelUpgradeNS || (t.DownloadKernelUpgradeNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(39), r = i(34), s = i(5), l = i(63), d = i(100), u = i(10), c = i(58), h = i(0), f = i(9),
        g = i(26), p = h.default.getLogger("AdPlatform");
    var v;
    !function (e) {
        e.waiting = "waiting", e.abort = "abort", e.ready = "ready"
    }(v || (v = {}));
    t.adPlatform = new class extends o.default {
    }
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(381), a = i(236);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    i(674);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\download-category.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(3), o = i(27), r = i(13), s = i(11), l = i(42), d = s.DownloadKernelTaskManager.getTaskManager();
    !function (e) {
        let t = null, s = -1, u = null;
        e.init = function () {
            o.default.attachListener(r.NodeEventMesssageNS.eventDownloadItemActive, (e, o, r, c, h) => {
                o && e === a.DownloadKernel.CategroyViewID.Downloading ? (-1 !== s && null !== t && (clearTimeout(t), t = null), s = r, t = setTimeout(() => n(this, void 0, void 0, function* () {
                    if (-1 !== s) {
                        let e = d.getTaskFromTaskId(s);
                        if (e) {
                            let t = e.getTaskBaseInfo();
                            if (t.gcid && "" !== t.gcid) return;
                            const {QueryTaskInfoHelperNS: n} = yield Promise.resolve().then(() => i(665));
                            if (t.taskType === a.DownloadKernel.TaskType.P2sp) {
                                let i = e.getExtraObject().getDisplayUrl();
                                "" === i && (i = t.url), l.Common.isThunderPrivateUrl(i) && (i = l.Common.parseThunderPrivateUrl(i)), n.queryResInfo("url", i).then(t => {
                                    t && 200 === t.status && null !== t.data && null !== t.data.result && "ok" === t.data.result && "" !== t.data.gcid && "1111111111111111111111111111111111111111" !== t.data.gcid && (e.beginBatchSetTaskAttribute(), e.setFileSize(t.data.file_size), e.setGcid(t.data.gcid), e.commitBatchSetTaskAttribute())
                                }).catch()
                            } else if (t.taskType === a.DownloadKernel.TaskType.Emule) {
                                let i = t.url;
                                l.Common.isThunderPrivateUrl(i) && (i = l.Common.parseThunderPrivateUrl(i)), n.postRequestEd2kTaskInfoByEd2kLink(i).then(t => {
                                    t && t.gcid && "" !== t.gcid && "1111111111111111111111111111111111111111" !== t.gcid && e.setGcid(t.gcid)
                                }).catch()
                            }
                            if (t.taskType === a.DownloadKernel.TaskType.Group) {
                                let e = [], i = "", o = d.getTaskFromTaskId(t.taskId).getExtraObject(),
                                    r = o.getSubTaskCount(), s = new Map;
                                for (let t = 0; t < r; ++t) {
                                    let n = o.getSubTaskByIndex(t);
                                    if (n.getType() === a.DownloadKernel.TaskType.P2sp) {
                                        let a = n.getTaskBaseInfo();
                                        if (a.fileSize && a.fileSize > 0) continue;
                                        a.url && a.url.length > 0 && (i = a.url, l.Common.isThunderPrivateUrl(i) && (i = l.Common.parseThunderPrivateUrl(i)), e.push(i), s.set(i, t))
                                    }
                                }
                                e.length > 0 && !u && (u = t.taskId, n.asyncBatchQueryP2spTaskInfoByUrl(e, (e, t, i) => {
                                    o.setSubTaskFileSize(s.get(e), t.fileSize)
                                }, () => {
                                    u = null
                                }).catch())
                            }
                        }
                    }
                }), 100)) : s === r && (null !== t && (clearTimeout(t), t = null), s = -1)
            })
        }, e.getQueryTaskId = function () {
            return u
        }
    }(t.QueryTaskInfoNS || (t.QueryTaskInfoNS = {}))
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(367), a = i(272);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\common\\generator-view\\conf-component\\conf-speed-text.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(383), a = i(276);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\common\\components\\select-native.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    var n = i(4), a = i(93), o = i(57), r = i(744), s = i(102), l = i(460), d = i(748);
    t.probe = function (e, t) {
        var i = t || {}, u = r.defer(), c = null, h = o.platform(), f = l.createBuilder(h);
        c = a.spawn(l.getExecutablePath(h), f.getResult(e, i));
        var g = d.createParser(h);
        c.once("error", function () {
            var e = new Error(n.format("ping.probe: %s. %s", "there was an error while executing the ping program. ", "Check the path or permissions..."));
            u.reject(e)
        });
        var p = [];
        return c.stdout.on("data", function (e) {
            p.push(String(e))
        }), c.once("close", function () {
            var e = p.join("").split("\n");
            s.each(e, g.eat, g);
            var t = g.getResult();
            u.resolve(t)
        }), u.promise
    }
}, function (e, t, i) {
    "use strict";
    var n = i(102), a = i(4), o = i(745), r = i(746), s = i(747);

    function l() {
    }

    l.isLinux = function (e) {
        return ["aix", "linux"].indexOf(e) >= 0
    }, l.isMacOS = function (e) {
        return ["darwin", "freebsd"].indexOf(e) >= 0
    }, l.isWindow = function (e) {
        return e && null !== e.match(/^win/)
    }, l.isPlatformSupport = function (e) {
        return n.some([this.isWindow(e), this.isLinux(e), this.isMacOS(e)])
    }, l.getExecutablePath = function (e) {
        if (!this.isPlatformSupport(e)) throw new Error(a.format("Platform |%s| is not support", e));
        var t = null;
        return "aix" === e ? t = "/usr/sbin/ping" : l.isLinux(e) ? t = "/bin/ping" : l.isWindow(e) ? t = process.env.SystemRoot + "/system32/ping.exe" : l.isMacOS(e) && (t = "/sbin/ping"), t
    }, l.createBuilder = function (e) {
        if (!this.isPlatformSupport(e)) throw new Error(a.format("Platform |%s| is not support", e));
        var t = null;
        return l.isLinux(e) ? t = o : l.isWindow(e) ? t = s : l.isMacOS(e) && (t = r), t
    }, e.exports = l
}, function (e, t, i) {
    "use strict";
    var n = i(4), a = i(102), o = i(337);

    function r() {
        o.call(this)
    }

    n.inherits(r, o), r.prototype._processHeader = function (e) {
        var t = e.split(" ");
        this._response.host = t[1], this._response.numeric_host = t[2].slice(1, -2), this._changeState(this.STATES.BODY)
    }, r.prototype._processBody = function (e) {
        if ((e.match(/=/g) || []).length >= 3) {
            var t = /([0-9\.]+)[ ]*ms/.exec(e);
            this._times.push(parseFloat(t[1], 10))
        }
        e.indexOf("---") >= 0 && this._changeState(this.STATES.FOOTER)
    }, r.prototype._processFooter = function (e) {
        if ((e.match(/[\/]/g) || []).length >= 3) {
            var t = /([0-9\.]+)/g, i = t.exec(e), n = t.exec(e), o = t.exec(e), r = t.exec(e);
            a.all([i, n, o, r]) && (this._response.min = parseFloat(i[1], 10), this._response.avg = parseFloat(n[1], 10), this._response.max = parseFloat(o[1], 10), this._response.stddev = parseFloat(r[1], 10), this._changeState(this.STATES.END)), this._changeState(this.STATES.END)
        }
    }, e.exports = r
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = function () {
        var e = this.$createElement, t = this._self._c || e;
        return t("div", {staticClass: "xly-loading"}, [t("svg", {
            staticClass: "xly-loading__svg",
            attrs: {viewBox: "0 0 52 52"}
        }, [t("polyline", {attrs: {points: "23.5,27.6 7.5,18.6 23.5,10.6 39.5,18.6 "}}), this._v(" "), t("polyline", {attrs: {points: "23.5,27.5 39.5,18.5 39.5,36.5 23.5,44.5 "}}), this._v(" "), t("polyline", {attrs: {points: "23.5,27.5 23.5,44.5 7.5,36.5 7.5,18.5 "}}), this._v(" "), t("path", {
            staticClass: "xly-path-out",
            attrs: {d: "M23.5,44.5l-16-8v-18l16-8l16,8v18L23.5,44.5z"}
        }), this._v(" "), t("polyline", {
            staticClass: "xly-path-inner-2",
            attrs: {points: "23.5,27.5 39.5,18.5 39.5,36.5 23.5,44.5 "}
        }), this._v(" "), t("polyline", {
            staticClass: "xly-path-inner-1",
            attrs: {points: "23.5,27.6 7.5,18.6 23.5,10.6 39.5,18.6 "}
        }), this._v(" "), t("polyline", {
            staticClass: "xly-path-inner-3",
            attrs: {points: "23.5,27.5 23.5,44.5 7.5,36.5 7.5,18.5 "}
        })])])
    };
    n._withStripped = !0;
    var a = {}, o = (i(619), i(1)), r = Object(o.a)(a, n, [], !1, null, "6d2ca8de", null);
    r.options.__file = "src\\common\\components\\loading.vue";
    t.default = r.exports
}, function (e, t, i) {
    i(464), e.exports = i(465)
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(4), r = i(0), s = i(6), l = i(83), d = i(17), u = i(28),
        c = s.default(a.join(__rootDir, "../bin/ThunderHelper.node"));
    let h = "0";
    process.env.TL_ENABLE = h;
    let f = process.env.TL_OUTPUT;

    function g() {
        r.default.outputLogger = "console" === f ? r.outputLoggerConsole : function () {
            function e(e) {
                return function (...t) {
                    c.printEtwLog(e, function (...e) {
                        return e.map(e => o.inspect(e)).join(" ").replace(/%/g, "%%")
                    }(...t))
                }
            }

            return {
                [r.LogLevel.Critical]: e(r.LogLevel.Critical),
                [r.LogLevel.Error]: e(r.LogLevel.Error),
                [r.LogLevel.Warning]: e(r.LogLevel.Warning),
                [r.LogLevel.Information]: e(r.LogLevel.Information),
                [r.LogLevel.Verbose]: e(r.LogLevel.Verbose)
            }
        }()
    }

    function p() {
        return n(this, void 0, void 0, function* () {
            l.DevEnvHelperNS.isLogEnable().then(e => {
                e && "1" === h !== e && (h = e ? "1" : "0", process.env.TL_ENABLE = h)
            }).catch(), l.DevEnvHelperNS.getLogOutput().then(e => {
                e && e !== f && (f = e, g())
            }).catch()
        })
    }

    g(), p().catch(), "browser" === process.type ? d.ipcMain.on(u.ThunderChannelList.channelRMUpdateLogEnviroment, () => {
        d.BrowserWindow.getAllWindows().forEach(e => {
            e.isDestroyed() || e.webContents.send(u.ThunderChannelList.channelMRUpdateLogEnviroment)
        })
    }) : "renderer" === process.type && d.ipcRenderer.on(u.ThunderChannelList.channelMRUpdateLogEnviroment, () => {
        p().catch()
    })
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(64), o = i(298);
    o.CommonIPCRenderer.rendererCommunicator.initialize(a.CommonIPCBase.mainRendererContext), o.CommonIPCRenderer.rendererCommunicator.connect();
    let r = !1;
    const s = i(20);
    s.server.start({IsMainRendererReadyToShow: () => r});
    const l = i(7);
    l.client.start({name: a.CommonIPCBase.mainRendererContext});
    const d = i(469), u = i(16), c = i(17), h = i(2), f = i(19), g = i(107), p = i(0);
    i(477);
    const v = i(38), m = i(30), y = i(425), k = i(13), T = i(534), w = i(541), C = i(545), S = i(549), b = i(550),
        I = i(551), _ = i(552), A = i(96), D = i(554), x = i(556), N = i(557), E = i(559), P = i(26), M = i(560),
        O = i(561), F = i(562), L = i(563), B = i(564), U = i(565), R = i(566), K = i(567), W = i(568), V = i(127),
        H = i(28), z = i(36), j = i(569), G = i(88), $ = i(43), X = i(24), q = i(325), Y = i(27), J = i(10), Z = i(78),
        Q = i(570), ee = i(77), te = i(130), ie = i(55), ne = i(318), ae = i(573), oe = i(9), re = i(720), se = i(721),
        le = i(451), de = i(722), ue = i(449), ce = i(25), he = i(81), fe = i(320), ge = i(723), pe = i(22), ve = i(49),
        me = i(46), ye = i(440), ke = i(438), Te = i(452), we = i(129), Ce = i(724), Se = i(6),
        be = Se.default(h.join(__rootDir, "../bin/ThunderHelper.node")),
        Ie = Se.default(h.join(__rootDir, "../bin/WeakReferences.node")), _e = i(725), Ae = i(456), De = i(90),
        xe = i(730), Ne = i(731), Ee = i(132);
    i(732), i(734), i(306), i(735);
    const Pe = i(736), Me = i(89), Oe = i(111), Fe = i(737), Le = i(738), Be = i(739), Ue = i(751), Re = i(3),
        Ke = i(31), We = i(11);
    i(752);
    const Ve = i(753), He = i(754), ze = i(335), je = i(332), Ge = i(99), $e = i(71), Xe = i(32), qe = i(12),
        Ye = We.DownloadKernelTaskManager.getTaskManager(), Je = ye.GroupAccelerateManagerNS.getManager(),
        Ze = ke.GroupAccelerateWebManagerNS.getManager(), Qe = ve.ToastNotifyManagerNS.getToastNotifyManger();
    d.PerformanceMonitorStatNS.init("main-renderer"), c.ipcRenderer.send(H.ThunderChannelList.channelRMProcessSend, process.pid);
    const et = p.default.getLogger("Thunder.Main");
    re.ThunderToolsNS.enableDevTools().catch(e => {
        et.warning(e)
    });
    let tt = !1, it = !1, nt = "", at = !1, ot = !1;

    function rt() {
        return n(this, void 0, void 0, function* () {
            if (tt) return;
            let e = (yield qe.asyncRemoteCall.getProcess()).argv;
            for (let t = 0; t < e.length; t++) {
                let i = e[t];
                if (0 === i.indexOf("-StartType:")) nt = i.substr("-StartType:".length); else if (0 === i.indexOf("thunderx://", 0)) {
                    let e = `newthunder=${encodeURIComponent(i)}`;
                    oe.XLStatNS.trackEvent("core_operate", "newthunder_startup", "", 0, 0, 0, 0, e)
                } else "-silent" === i ? it = !0 : i.indexOf("play:true") > -1 ? at = !0 : i.indexOf("unionfile") > -1 && (ot = !0)
            }
            tt = !0
        })
    }

    rt().then(() => {
        te.default.setStartArgs(nt)
    }).catch(), ie.quitPromises.add(function () {
        return new Promise(e => n(this, void 0, void 0, function* () {
            yield de.default.saveMainWndData(), be.stopListenLocalNet(), e(!0)
        }))
    }), ie.quitPromises.add(function () {
        return new Promise(e => {
            v.ThunderNewTask.uninit(), e(!0)
        })
    }), ie.quitPromises.addBefore(function () {
        return new Promise(e => {
            z.TaskOperatorNs.pauseAll(Re.DownloadKernel.TaskStopReason.Exit), e(!0)
        })
    }), ie.quitPromises.addBefore(function () {
        return n(this, void 0, void 0, function* () {
            return je.SyncMsgHelperNS.uninit(), !0
        })
    }), ie.quitPromises.addBefore(function () {
        return n(this, void 0, void 0, function* () {
            return Ge.ShouleiListSyncNS.getMananger().uninit(), !0
        })
    }), ie.quitPromises.addAfter(function () {
        return n(this, void 0, void 0, function* () {
            return yield J.ConfigNS.save(), yield Z.BHOConfigNS.save(), !0
        })
    }), ie.quitPromises.add(function () {
        return new Promise(e => {
            e(!0)
        })
    }), ie.quitPromises.add(function () {
        return n(this, void 0, void 0, function* () {
            return s.server.fireClientEvent("main-will-quit"), !0
        })
    }), ie.quitPromises.add(function () {
        return n(this, void 0, void 0, function* () {
            return fe.MessageChannelNS.uninit(), !0
        })
    }), ie.quitPromises.add(function () {
        return n(this, void 0, void 0, function* () {
            return ne.default.uninit(), !0
        })
    }), ie.quitPromises.add(function () {
        return n(this, void 0, void 0, function* () {
            return yield Be.DownloadDetectHelperNS.uninit(), !0
        })
    }), ie.quitPromises.add(function () {
        return n(this, void 0, void 0, function* () {
            return new Promise(e => {
                if (Ke.ThunderKernel.commitAllTransaction(), Ke.ThunderKernel.stopPushStorageCommand(), 0 === Ke.ThunderKernel.getStorageWaitingCommandSize()) e(!0); else {
                    let t = 0, i = null;
                    i = setInterval(() => {
                        t++;
                        let n = Ke.ThunderKernel.getStorageWaitingCommandSize();
                        0 === n || t > 100 ? (i && (clearInterval(i), i = null), e(!0)) : et.information("WaitingCommandSize", n)
                    }, 100)
                }
            })
        })
    }), global.AsyncGetNativeCallModuleObj = function (e) {
        e(u.NativeCallModule)
    }, global.xlNativeCallModule = u.NativeCallModule, global.__xdasObjectLiftMonitor = Ie, ce.default.init().catch(e => {
        et.warning(e)
    }), he.default.init().catch(e => {
        et.warning(e)
    }), be.allowSetForegroundWindow(), T.NaviteFunctionNS.registerNativeFunction(), w.PluginFunctionNS.registerPluginFunction(), C.ConfigPluginFunctionNS.registerPluginFunction(), S.ConfigRemoteGlobalPluginFunctionNS.registerPluginFunction(), b.LoginPluginFunctionNS.registerPluginFunction(), I.TipsPluginFunctionNS.registerPluginFunction(), _.DkPluginFunctionNS.registerPluginFunction(), A.PluginFunctionUINS.registerPluginFunction(), D.SkinPluginFunctionNS.registerPluginFunction(), x.VipPluginFunctionNS.registerPluginFunction(), N.NotificationPluginFunctionNS.registerPluginFunction(), He.ScheduleTaskPluginFunctionNS.registerPluginFunction(), E.ShouleiConnectPluginFunctionNS.registerPluginFunction(), $e.clientProduct.init(), te.default.init().catch(), v.ThunderNewTask.init().catch(), g.default.config.ignoredElements = ["webview"], new g.default({
        components: {App: ae.default},
        render: e => e("app")
    }).$mount("#app"), J.ConfigNS.init(h.join(__profilesDir, "config.json")).catch(e => {
        et.warning(e)
    }), Z.BHOConfigNS.init().catch(e => {
        et.warning(e)
    }), Ce.BindConfigNS.init(), de.default.initMainRendererHelper(), F.ConfigNaviteFunctionNS.registerNativeFunction(), L.ConfigRemoteGlobalNaviteFunctionNS.registerNativeFunction(), U.SkinNaviteFunctionNS.registerNativeFunction(), ge.MessageChannelNaviteFunctionNS.init(), M.LoginNaviteFunctionNS.registerNativeFunction(), xe.TipsNaviteFunctionNS.registerNativeFunction(), W.ShouleiConnectNaviteFunctionNS.registerNativeFunction(), c.ipcRenderer.on(H.ThunderChannelList.channelMRGetConfigValue, (e, ...t) => {
        do {
            if (!t || !t[0] || !t[1]) {
                c.ipcRenderer.send(H.ThunderChannelList.channelRMGetConfigValueReject);
                break
            }
            let e = t[0], i = t[1], n = t[2], a = J.ConfigNS.getValue(e, i, n);
            c.ipcRenderer.send(H.ThunderChannelList.channelRMGetConfigValueResolve, a)
        } while (0)
    }), c.ipcRenderer.on(H.ThunderChannelList.channelMRSetConfigValue, (e, ...t) => {
        do {
            if (!t || !t[0] || !t[1]) {
                c.ipcRenderer.send(H.ThunderChannelList.channelRMSetConfigValueReject);
                break
            }
            let e = t[0], i = t[1], n = t[2];
            J.ConfigNS.setValue(e, i, n), J.ConfigNS.save().catch()
        } while (0)
    }), c.ipcRenderer.on(H.ThunderChannelList.channelMRTrayMenuClick, (e, t, i) => n(this, void 0, void 0, function* () {
        et.verbose(e), "-task:newtask" === t ? (i = void 0 === i ? "other" : i, oe.XLStatNS.trackEvent("core_event", "create_task_click", "", 0, 0, 0, 0, "click_source=" + i), et.information("trackEvent", "core_event", "create_task_click", "click_source=" + i), v.ThunderNewTask.createPreNewTaskWindow(null)) : "-task:startall" === t ? z.TaskOperatorNs.startAll() : "-task:pauseall" === t ? z.TaskOperatorNs.pauseAll(Re.DownloadKernel.TaskStopReason.PauseAll) : "-task:quitprocess" === t && (yield ze.QuitMessageBoxMgrNS.popup()) && (yield ie.quitPromises.run())
    })), c.ipcRenderer.on(H.ThunderChannelList.channelMRFileCopyResult, (e, t, i) => {
        et.information("channelMRFileCopyResult", t, i), t && Qe.showNotify(ve.ToastNotifyManagerNS.notifyIdTaskOperatorMoveTask, me.ToastNotifyItemType.GreenNotify, "复制成功", 3e3)
    }), function () {
        return n(this, void 0, void 0, function* () {
            (yield qe.asyncRemoteCall.getIpcMain()).on("onShowMessageBox", (e, t) => {
                et.verbose(e), "retryLogin" === t && pe.MessageBox.confirm({
                    title: "登录失败，请检查网络是否正常",
                    type: pe.MessageBox.ConfirmType.Warning,
                    content: "如果通过代理访问网络，请确认代理已正确设置。<br>如果是办公网络，请确认网络是否限制迅雷登录。",
                    okText: "我知道了",
                    cancelVisible: !1
                }).catch()
            })
        })
    }().catch(), window.getPluginUpdater = Te.default.getPluginUpdater, l.client.callServerFunction("GetSkinInfo").then(e => {
        et.information("GetSkinInfo", e)
    }).catch(e => {
        et.warning("GetSkinInfo Error", e)
    }), l.client.attachServerEvent("OnChangeSkin", (e, t) => {
        et.information("OnChangeSkin", t)
    }), window.setSkinInfo = (() => {
        l.client.callServerFunction("SetSkinInfo", {type: Ee.SkinHelperNS.SkinType.Color, colorID: 1}).catch(e => {
            et.warning("SetSkinInfo Error", e)
        })
    }), setTimeout(() => n(this, void 0, void 0, function* () {
        let e = J.ConfigNS.getValue("Install", "PersonalUid", "");
        if (e && "" !== e) try {
            const t = yield i(18);
            t.defaults.adapter = i(21);
            let n = "https://msg-vip-ssl.xunlei.com/individuation/Clinetreport?userid=";
            n += e, n += "&param=active_user", n += "&peer_id=" + be.getPeerID(), yield t.get(n, {responseType: "arraybuffer"})
        } catch (e) {
            et.warning(e)
        }
    }), 5e3), c.ipcRenderer.on(H.ThunderChannelList.channelMRShowOrHideWindow, (e, t, i) => {
        "show" === t ? J.ConfigNS.setValue("Consumption", "ShowMainWindowTime", i) : J.ConfigNS.setValue("Consumption", "HideMainWindowTime", i)
    }), function () {
        return n(this, void 0, void 0, function* () {
            r = !0, Xe.NativeCallNS.init(), O.DKNaviteFunctionNS.registerNativeFunction(), R.VipNaviteFunctionNS.registerNativeFunction(), B.DownloadAndPlayNaviteFunctionNS.registerNativeFunction(), K.SubtitleManagerNaviteFunctionNS.registerNativeFunction(), Ne.NotificationNaviteFunctionNS.registerNativeFunction(), _e.AdManageNS.init(), Pe.defaultNavite.registerDefaultNativeFunction(), s.server.fireClientEvent("main-renderer-ready-to-show"), le.default.initAccelerator(), m.DownloadKernelManager.init().then(() => {
                l.client.attachServerEvent("OnVipTaskInfoChanged", (e, t, i) => {
                    if (!e || "vip-download-webview" !== e.name) return;
                    if (!i) return;
                    et.information("onVipTaskInfoChanged taskId,taskInfo:", t, i);
                    let n = Ye.getTaskFromTaskId(t);
                    n && n.setAcclerating(i.enterStatus === Ue.VipDownloadDefineNS.VipTaskStatus.Acclerating)
                }), l.client.attachServerEvent("OnVipSubTaskInfoChanged", (e, t, i, n) => {
                    if (!e || "vip-download-webview" !== e.name) return;
                    if (!t) return;
                    let a = Ye.getTaskFromTaskId(t);
                    if (a && a.getType() === Re.DownloadKernel.TaskType.Group && n && i) {
                        let e = null;
                        for (let t of i) (e = Ye.getTaskFromTaskId(t)) && e.setAcclerating(n.enterStatus === Ue.VipDownloadDefineNS.VipTaskStatus.Acclerating)
                    }
                })
            }).catch(e => {
                et.warning(e)
            }), Y.default.trackWin7NewTrait(), re.ThunderToolsNS.enableDragOpenFile(!0), Q.ConfigHandlerNS.init(), ee.SettingConfigHelperNS.configBrowserHelper.init().catch(), j.TaskHelperNS.init(), $.DownloadDispatchNS.init(), G.DownloadJammedNS.init(), V.TaskDetailNS.init(), ue.FileAssociationNS.asynCheckAndAssociate().catch(), Le.fullScreenCheckBegin(), ie.quitPromises.add(Le.fullScreenCheckEnd), ne.default.init().then().catch(), Je.init(), Ze.init("http://misc-xl9-ssl.xunlei.com/acc_xdas/dist/#/"), se.ClipBoardNS.init(at && ot), Ae.QueryTaskInfoNS.init(), Ve.TaskP2spAutoRenameNS.init(), we.SubtitleManagerNS.init().catch(e => {
                et.warning(e)
            }), be.startListenLocalNet(e => {
                if (et.information("startListenLocalNet, result = ", e), "OnInternetConnectSuc" === e || "OnInternetFallLine" === e) {
                    let t = 1, i = 1;
                    "OnInternetConnectSuc" === e ? (i = 1, t = 2) : (i = 2, t = 1), et.information("返回值：0 初始化状态，1 在线状态， 2 断网状态 onInternetConnectChange:", t, i), P.NativeCallHostModule.nativeCallHost.fireNativeEvent("onInternetConnectChange", t, i)
                } else et.information("返回数据错误！")
            }), setTimeout(() => {
                fe.MessageChannelNS.init()
            }, 2e3), setTimeout(() => {
                be.startAutoUpdateWithUI()
            }, 12e4);
            let e = new f.EventEmitter;
            y.PluginLoaderNS.pluginLoader.loadPlugin("VipDownload").catch(), y.PluginLoaderNS.pluginLoader.loadPlugin("VipPluginController").catch(), yield y.PluginLoaderNS.pluginLoader.loadPlugin("User"), yield X.LoginHelperNS.loginSDKHelper.init(), yield y.PluginLoaderNS.pluginLoader.loadPlugin("ThunderXLogin"), y.PluginLoaderNS.pluginLoader.loadPlugin("ThunderPanPlugin").catch(), X.LoginHelperNS.loginHelper.isAutologin(e => n(this, void 0, void 0, function* () {
                let t = yield q.commonLoginHelper.isAutoPopupLogin();
                yield rt(), et.information("isAutologin:", e, nt, t), e || "Install" !== nt && (!t || "AutoRun" === nt || it) || setTimeout(() => {
                    let e = "other";
                    "Install" === nt ? e = "Install" : t && (e = "auto"), X.LoginHelperNS.loginHelper.showLoginDlg(e, !0), t && !it && "AutoRun" !== nt && q.commonLoginHelper.setLoginWndShowConfig()
                }, 1e3)
            })), setTimeout(() => {
                try {
                    let t = be.getPeerID(), i = be.getOSVersion(), n = h.join(__rootDir, "../../Thunder.exe"),
                        a = be.getFileVersion(n), o = be.getChannelID();
                    y.PluginLoaderNS.pluginLoader.startDownloadPlugins(t, i, "21", a, o, e)
                } catch (e) {
                }
            }, 1e4), e.on(k.NodeEventMesssageNS.eventPluginLoderPluginReady, e => n(this, void 0, void 0, function* () {
                if ("addTest4" === e) {
                    let t = yield y.PluginLoaderNS.pluginLoader.loadPlugin(e);
                    t && t.add && t.add("plugin loader")
                }
            })), setTimeout(() => {
                "LiveUD" !== nt && De.default().whetherPopUp() && Oe.popMutual.setReady(Me.PopView.BROWSER_GUIDE)
            }, 1e4), setTimeout(() => {
                Fe.EmptyWorkingSetNS.init().catch()
            }, 5e3), setTimeout(() => n(this, void 0, void 0, function* () {
                Be.DownloadDetectHelperNS.init().catch(), (yield qe.asyncRemoteCall.getCurrentObject("powerMonitor")).on("resume", () => {
                    P.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnPowerMonitorResume")
                }), yield je.SyncMsgHelperNS.init(), Ge.ShouleiListSyncNS.getMananger().init().catch()
            }), 2e3), yield rt(), "Install" !== nt && "LiveUD" !== nt || setTimeout(() => {
                J.ConfigNS.getValue("MiniXmp", "DesktopIconCreated", !1) && J.ConfigNS.setValue("MiniXmp", "DesktopIconCreated", !1), J.ConfigNS.getValue("CreateDesktopIcon", "Cancel", !1) && J.ConfigNS.setValue("CreateDesktopIcon", "Cancel", !1)
            }, 500)
        })
    }().catch(), window.addEventListener("keyup", e => n(this, void 0, void 0, function* () {
        "F2" === e.key && e.ctrlKey && c.ipcRenderer.send(H.ThunderChannelList.channelRMUpdateLogEnviroment)
    }))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(53), a = i(84), o = i(19), r = i(467), s = i(85);
    t.Server = class extends o.EventEmitter {
        constructor() {
            super(), this.server = a.createServer(e => this.handleConnection(e)), this.productId = ""
        }

        getProductId() {
            return this.productId
        }

        listen(e, t) {
            let i = s.getSockPath(t);
            this.productId = t || s.getDefaultPrex(), n.existsSync(i) && n.unlinkSync(i), this.server.listen({
                path: i,
                readableAll: !0,
                writableAll: !0
            }, e)
        }

        handleConnection(e) {
            const t = new r.Client({socket: e});
            t.on("message", e => {
                this.handleRequest(e, t)
            }), t.on("end", () => {
                this.emit("end", t)
            }), this.emit("connect", t)
        }

        handleRequest(e, t) {
            this.emit("message", e, t)
        }
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(84), a = i(19), o = i(105), r = i(397), s = i(85);
    t.Client = class extends a.EventEmitter {
        constructor(e) {
            if (e = e || {}, super(), this.inprocess = !1, this.context = void 0, e.context && (this.context = Object.assign({}, e.context), this.context.productId = e.socketPrex), e.socket) this.socket = e.socket, this.bind(); else if (global.__xdasIPCServer && global.__xdasIPCServer.getProductId().toLowerCase() === e.socketPrex.toLowerCase()) this.inprocess = !0; else {
                let t = s.getSockPath(e.socketPrex);
                this.socket = n.connect(t), this.bind()
            }
        }

        isInprocess() {
            return this.inprocess
        }

        getContext() {
            return this.context
        }

        bind() {
            const e = new r.Parser, t = this.socket;
            t.on("data", t => {
                e.feed(t)
            }), t.on("connect", () => {
                this.emit("connect")
            }), t.on("end", () => {
                o.information("socket is ended"), this.socket = null, this.emit("end")
            }), t.on("error", e => {
                o.error(e.message), this.socket = null, this.emit("error", e)
            }), e.on("message", e => {
                this.emit("message", e)
            }), this.parser = e
        }

        send(e) {
            if (this.socket) try {
                this.socket.write(this.parser.encode(e))
            } catch (e) {
                o.error(e.message)
            } else o.information("This socket has been ended by the other party")
        }
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(84), a = i(19), o = i(105), r = i(397), s = i(85);
    t.Client = class extends a.EventEmitter {
        constructor(e) {
            if (e = e || {}, super(), this.inprocess = !1, this.context = void 0, e.context && (this.context = Object.assign({}, e.context), this.context.productId = e.socketPrex), e.socket) this.socket = e.socket, this.bind(); else if (global.__xdasIPCServer && global.__xdasIPCServer.getProductId().toLowerCase() === e.socketPrex.toLowerCase()) this.inprocess = !0; else {
                let t = s.getSockPath(e.socketPrex);
                this.socket = n.connect(t), this.bind()
            }
        }

        isInprocess() {
            return this.inprocess
        }

        getContext() {
            return this.context
        }

        bind() {
            const e = new r.Parser, t = this.socket;
            t.on("data", t => {
                e.feed(t)
            }), t.on("connect", () => {
                this.emit("connect")
            }), t.on("end", () => {
                o.information("socket is ended"), this.socket = null, this.emit("end")
            }), t.on("error", e => {
                o.error(e.message), this.socket = null, this.emit("error", e)
            }), e.on("message", e => {
                this.emit("message", e)
            }), this.parser = e
        }

        send(e) {
            if (this.socket) try {
                this.socket.write(this.parser.encode(e))
            } catch (e) {
                o.error(e.message)
            } else o.information("This socket has been ended by the other party")
        }
    }
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(57), o = (i(53), i(2)), r = i(4);
    let s = null;
    const l = i(9), d = i(17), u = i(0), c = i(6), h = i(28), f = i(12), g = "xdas_profile_stat";
    let p = "", v = void 0, m = null, y = void 0, k = null,
        T = c.default(o.join(__rootDir, "../bin/ThunderHelper.node")), w = new Set;

    function C() {
        return n(this, void 0, void 0, function* () {
            return new Promise(e => n(this, void 0, void 0, function* () {
                void 0 === y && (null === k && (k = new Promise(e => {
                    e(y = function (e) {
                        let t = "";
                        if (0 === e.length && "renderer" === process.type) {
                            let e = o.normalize(decodeURIComponent(window.location.href)),
                                i = e.indexOf(process.resourcesPath);
                            i = i > -1 ? i + process.resourcesPath.length + 1 : i;
                            let n = e.length - 1, a = e.indexOf("?"), r = e.indexOf("#");
                            n = a > -1 ? Math.min(a - 1, n) : n, n = r > -1 ? Math.min(r - 1, n) : n, i > -1 && n >= i && (t = e.substr(i, n - i + 1))
                        }
                        return 0 === t.length && (t = 0 !== e.length ? e : process.type), t = t.replace(/\||,|;/g, "_")
                    }(""))
                })), y = yield k), e(y)
            }))
        })
    }

    function S(e) {
        let t = "";
        do {
            if (null === e || void 0 === e) break;
            switch (typeof e) {
                case"string":
                    t = e;
                    break;
                case"object":
                    t = r.inspect(e) || "";
                    break;
                case"number":
                case"boolean":
                    t = e.toString() || ""
            }
        } while (0);
        return t
    }

    function b(e) {
        return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")
    }

    function I(e) {
        return n(this, void 0, void 0, function* () {
            return new Promise(t => n(this, void 0, void 0, function* () {
                let n = void 0;
                null === s && (s = yield Promise.resolve().then(() => i(75)));
                let a = s.createHash("md5");
                null !== a && (n = a.update(e).digest("hex")), t(n)
            }))
        })
    }

    function _() {
        return new Promise(e => n(this, void 0, void 0, function* () {
            let t = "";
            t = void 0 === v ? "browser" === process.type ? function () {
                if (void 0 === v) {
                    let e = process.argv.length, t = process.argv;
                    for (let i = 0; i < e; i++) {
                        let e = t[i];
                        if (e.startsWith("-StartType:")) {
                            v = e.substring("-StartType:".length);
                            break
                        }
                    }
                    void 0 === v && (v = "")
                }
                return v
            }() : yield function () {
                return n(this, void 0, void 0, function* () {
                    return null === m && (m = new Promise(e => {
                        d.ipcRenderer.send(h.ThunderChannelList.channelRMGetBrowserStartType), d.ipcRenderer.once(h.ThunderChannelList.channelMRGetBrowserStartTypeResult, (t, i) => {
                            v = i, e(i), m = null
                        })
                    })), m
                })
            }() : v, e(t)
        }))
    }

    function A(e, t, i, a) {
        return n(this, void 0, void 0, function* () {
            let o = S(t), r = S(i), s = yield I(r), d = function (e) {
                let t = new RegExp(b("file:///"), "g"), i = new RegExp(b(process.resourcesPath + "\\"), "g"),
                    n = new RegExp(b(encodeURI(process.resourcesPath.replace(/\\/g, "/") + "/")), "g");
                return e.replace(t, "").replace(i, "").replace(n, "")
            }(S(a)), u = yield I(d), c = `${e}:${s}:${u}`;
            w.has(c) || (w.add(c), l.XLStatNS.trackEvent(g, "uncaught_exception", "", 0, 0, 0, 0, `type=${e},business_name=${yield C()},code=${o},message_hash=${s},message=${encodeURI(r)},stack_hash=${u},stack=${encodeURI(d)}`)), function (e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                })
            }().catch()
        })
    }

    function D(e) {
        console.error(e);
        let t = e || {};
        A("unhandledRejection", t.code, t instanceof Error ? t.message : t, t.stack).catch()
    }

    !function (e) {
        e.init = function (e) {
            p = e
        }, e.trackColdStartUpEvent = function (e) {
            return n(this, void 0, void 0, function* () {
                let t = T.iSColdStartUp() ? 1 : 0, i = a.release(), n = T.performanceMonitorReporter.getProcessUptime(),
                    o = yield _(), r = `key=${e},start_type=${o},cold_start_up=${t},os_version=${i},cost_time=${n}`;
                l.XLStatNS.trackEvent(g, "cold_start_up", "", 0, 0, 0, 0, r)
            })
        }
    }(t.PerformanceMonitorStatNS || (t.PerformanceMonitorStatNS = {})), function () {
        return n(this, void 0, void 0, function* () {
            if (process.on("uncaughtException", e => {
                console.error(e);
                let t = e || {};
                A("uncaughtException", t.code, t.message, t.stack).catch()
            }), "browser" === process.type) process.on("unhandledRejection", (e, t) => {
                D(e)
            }), d.ipcMain.on(h.ThunderChannelList.channelRMGetBrowserStartType, function (e) {
                return n(this, void 0, void 0, function* () {
                    let t = yield _();
                    e.sender.send(h.ThunderChannelList.channelMRGetBrowserStartTypeResult, t)
                })
            }); else if ("browser" !== process.type) {
                window.addEventListener("unhandledrejection", e => {
                    D(e && e.reason || {})
                });
                let e = yield f.asyncRemoteCall.getCurrentWebContents();
                null !== e && void 0 !== e && e.once("did-finish-load", () => {
                    (function () {
                        return n(this, void 0, void 0, function* () {
                            do {
                                if ("browser" === process.type) break;
                                if (null === window.performance.timing || void 0 === window.performance.timing) break;
                                let e = T.iSColdStartUp() ? 1 : 0, t = a.release(), i = window.performance.timing,
                                    n = i.loadEventEnd - i.navigationStart, o = i.fetchStart - i.navigationStart,
                                    r = i.domainLookupEnd - i.domainLookupStart, s = i.connectEnd - i.connectStart,
                                    d = i.responseStart - i.requestStart, u = i.responseEnd - i.responseStart,
                                    c = i.domComplete - i.domLoading, h = yield _();
                                l.XLStatNS.trackEvent(g, "page_load_time", "", 0, 0, 0, 0, `start_type=${h},cold_start_up=${e},os_version=${t},load_time=${n},before_fetch_time=${o},domin_lookup_time=${r},connect_time=${s},first_response_time=${d},responseTime=${u},domTime=${c},process=${p}`)
                            } while (0)
                        })
                    })().catch()
                })
            }
            u.default.hook("beforeLog", (e, t, ...i) => {
                e === u.LogLevel.Critical && l.XLStatNS.trackEvent(g, "critical_error", "", 0, 0, 0, 0, `module_name=${t},messages=${i}`)
            })
        })
    }().catch()
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(17), a = i(400), o = i(471), r = i(472), s = i(401), l = i(473), d = i(106), u = n.isPromise,
        c = n.ipcRenderer, h = process.atomBinding("v8_util"), f = new o.default, g = h.createIDWeakMap();

    class p {
        constructor(e) {
            if ("object" == typeof e ? (this.on = "object" == typeof e.on ? e.on : {}, this.once = "object" == typeof e.once ? e.once : {}) : (this.on = {}, this.once = {}), !this.check()) throw new Error("unexpected param")
        }

        check() {
            let e = !0;
            do {
                let t = Object.getOwnPropertyNames(this.on);
                if (t.forEach(t => {
                    "function" != typeof this.on[t] && (e = !1)
                }), !e) break;
                (t = Object.getOwnPropertyNames(this.once)).forEach(t => {
                    "function" != typeof this.once[t] && (e = !1)
                })
            } while (0);
            return e
        }
    }

    function v(e, t = new Set) {
        const i = e => {
            if (t.has(e)) return {type: "value", value: null};
            let n = e;
            if (Array.isArray(e)) {
                t.add(e);
                let i = {type: "array", value: v(e, t)};
                return t.delete(e), i
            }
            if (ArrayBuffer.isView(n)) return {type: "buffer", value: a.Buffer.from(e)};
            if (e instanceof Date) return {type: "date", value: e.getTime()};
            if (null != e && "object" == typeof e) {
                if (u(e)) return {
                    type: "promise", then: i(function (t, i) {
                        e.then(t, i)
                    })
                };
                if (h.getHiddenValue(e, "__remote_id__")) return {
                    type: "remote-object",
                    id: h.getHiddenValue(e, "__remote_id__")
                };
                let n = {
                    type: e instanceof p ? "interest" : "object",
                    name: e.constructor ? e.constructor.name : "",
                    members: []
                };
                t.add(e);
                for (let t in e) n.members.push({name: t, value: i(e[t])});
                return t.delete(e), n
            }
            if ("function" == typeof e) {
                return {
                    type: "function",
                    id: f.add(e),
                    location: h.getHiddenValue(e, "__remote_call_location__"),
                    length: e.length
                }
            }
            return {type: "value", value: e}
        };
        return e.map(i)
    }

    function m(e, t, i) {
        u(e) ? e.then(e => {
            t(e)
        }, e => {
            i(e)
        }) : t(e)
    }

    function y(e, t, i, n = !1) {
        const a = t => {
            if (e.hasOwnProperty(t.name) && !n) return;
            let i, a = {enumerable: t.enumerable, configurable: !0};
            if ("method" === t.type) {
                if (t.value.refId) {
                    if (g.has(t.value.refId) && (i = g.get(t.value.refId)), null == i) throw new Error("member refId pointer to null" + t.value.refId + "name: " + t.name)
                } else i = C(t.value, e, t.name);
                a.get = (() => i), a.set = (e => i = e)
            } else "get" === t.type && (a.get = (() => i), t.writable && (a.set = (e => {
                i = e
            })), i = C(t.value));
            Object.defineProperty(e, t.name, a)
        };
        if (Array.isArray(i)) {
            let e = i.length;
            for (let t = 0; t < e; t++) a(i[t])
        }
    }

    function k(e, t, i) {
        if (i) {
            let t = C(i);
            Object.setPrototypeOf(e, t)
        }
    }

    function T(e, t) {
        h.setHiddenValue(e, "__remote_id__", t)
    }

    function w(e) {
        return h.getHiddenValue(e, "__remote_id__")
    }

    function C(e, t, i) {
        const n = {
            value: () => e.value,
            array: () => e.members.map(e => C(e)),
            buffer: () => a.Buffer.from(e.value),
            promise: () => Promise.resolve({then: C(e.then)}),
            error: () => (function (e) {
                const t = (() => "error" === e.type ? new Error : {})();
                for (let i = 0; i < e.members.length; i++) {
                    let {name: n, value: a} = e.members[i];
                    t[n] = a
                }
                return t
            })(e),
            date: () => new Date(e.value),
            exception: () => {
                throw new Error(`${e.message}\n${e.stack}`)
            }
        };
        let o;
        return e.type in n ? o = n[e.type]() : e.refId ? g.has(e.refId) ? o = g.get(e.refId) : (d.warn("[metaToValue] refId point to null" + e.refId), o = "function" === e.type ? () => {
        } : {}) : e.id ? g.has(e.id) ? (y(o = g.get(e.id), e.id, e.members, !0), k(o, e.id, e.proto)) : (o = "function" === e.type ? t ? function (e, t, i) {
            if (g.has(i.id)) return g.get(i.id);
            let n = w(e), a = function (...e) {
                throw Error("never should come to a proxied function")
            };
            Object.defineProperty(a, "name", {value: t, writable: !1, enumerable: !0});
            let o = new Proxy(a, {
                apply: (e, i, a) => new Promise((e, o) => {
                    let d = w(i);
                    if (d || (d = w(i.__remoteObj_)), !d) throw Error("is this function was a bound function?");
                    let u = s.default.browser.memberCall, h = l.default(u), f = v(a);
                    c.send(u, h, d, n, t, f), r.default.add(h, t => {
                        try {
                            m(C(t), e, o)
                        } catch (e) {
                            o(e)
                        }
                    })
                }), construct: (e, i, a) => new Promise((e, a) => {
                    let o = s.default.browser.memberConstruct, d = l.default(o);
                    c.send(o, d, n, t, v(i)), r.default.add(d, t => {
                        try {
                            let i = C(t);
                            e(i)
                        } catch (e) {
                            a(e)
                        }
                    })
                })
            });
            return h.setHiddenValue(a, "__remote_id__", i.id), o
        }(t, i, e) : function (e) {
            let t = e.id;
            const i = function (...e) {
                throw new Error("Should Never com to a remoteFunction PlaceHolder")
            };
            return T(i, t), new Proxy(i, {
                apply: (e, i, n) => new Promise((e, a) => {
                    let o = s.default.browser.functionCall, d = l.default(o), u = w(i);
                    c.send(o, d, u, t, v(n)), r.default.add(d, t => {
                        try {
                            m(C(t), e, a)
                        } catch (e) {
                            a(e)
                        }
                    })
                }), construct: (e, i, n) => new Promise((e, n) => {
                    let a = s.default.browser.construct, o = l.default(a);
                    c.send(a, o, t, v(i)), r.default.add(o, t => {
                        try {
                            let i = C(t);
                            e(i)
                        } catch (e) {
                            n(e)
                        }
                    })
                })
            })
        }(e) : {}, h.setRemoteObjectFreer(o, e.id), g.set(e.id, o), h.setHiddenValue(o, "__remote_id__", e.id), function (e) {
            let t = w(e);
            Object.defineProperties(e, {
                __set: {
                    enumerable: !1, writable: !1, value: function (i, n) {
                        if ("function" == typeof n) throw new Error("set a function to a remote member is dangerous");
                        return new Promise((a, o) => {
                            let d = s.default.browser.memberSet, u = l.default(d), h = v([n]);
                            c.send(d, u, t, i, h), r.default.add(u, t => {
                                try {
                                    let r = C(t);
                                    e[i] = n, a(r)
                                } catch (e) {
                                    o(e)
                                }
                            })
                        })
                    }
                }, __get: {
                    enumerable: !1, writable: !1, value: function (i) {
                        return new Promise((n, a) => {
                            let o = s.default.browser.memberGet, d = l.default(o);
                            c.send(o, d, t, i), r.default.add(d, t => {
                                try {
                                    const o = C(t);
                                    e[i] = o, n(o)
                                } catch (e) {
                                    a(e)
                                }
                            })
                        })
                    }
                }, __sync: {
                    enumerable: !1, writable: !1, value: function () {
                        return new Promise((e, i) => {
                            let n = s.default.browser.sync, a = l.default(n);
                            c.send(n, a, t), r.default.add(a, n => {
                                try {
                                    if (n.id !== t) throw Error("SYNC_RETURN: remote id not match");
                                    let a = C(n);
                                    e(a)
                                } catch (e) {
                                    i(e)
                                }
                            })
                        })
                    }
                }
            })
        }(o), y(o, e.id, e.members), k(o, e.id, e.proto), Object.defineProperty(o.constructor, "name", {value: e.name}), e.extendedMemberNames && e.extendedMemberNames.forEach((e, t) => {
            let i = o[e], n = o.__proto__;
            for (; n;) {
                if (Object.prototype.hasOwnProperty.call(n, e)) {
                    delete n[e];
                    break
                }
                n = n.__proto__
            }
            Object.defineProperty(o, e, {value: i, enumerable: !1, writable: !1, configurable: !0})
        })) : d.error("no id of meta:", e), o
    }

    t.Interest = p;

    class S {
        constructor(...e) {
            if (this.__resolved_ = !1, this.__promise_ = null, this.__remoteObj_ = null, this.__what_ = "", this.__name_ = "", "string" === typeof arguments[0]) {
                let e = arguments[0], t = arguments[1];
                this.__what_ = e, this.__name_ = t || e, this.__resolved_ = !1, this.__remoteObj_ = null, this.__promise_ = new Promise((i, n) => {
                    let a = this.getChannel(e), o = l.default(a);
                    c.send(a, o, t), r.default.add(o, e => {
                        try {
                            let t = C(e);
                            this.__remoteObj_ = t, this.__resolved_ = !0, i(t)
                        } catch (e) {
                            n(e)
                        }
                    })
                })
            } else this.__remoteObj_ = arguments[0], this.__resolved_ = !0, this.__promise_ = null
        }

        getChannel(e) {
            let t = "";
            switch (e) {
                case"module":
                    t = s.default.browser.require;
                    break;
                case"builtin":
                    t = s.default.browser.builtIn;
                    break;
                case"global":
                    t = s.default.browser.global;
                    break;
                case"current_window":
                    t = s.default.browser.currentWindow;
                    break;
                case"current_web_contents":
                    t = s.default.browser.currentWebContents;
                    break;
                case"client_web_contents":
                    t = s.default.browser.clientWebContents
            }
            return t
        }

        __resolve() {
            let e = this.__promise_;
            if (null !== e) ; else {
                if (!this.__resolved_) throw Error("missing the promise for ayncnomously get remote object");
                e = new Promise((e, t) => {
                    e(this.__remoteObj_)
                }), this.__promise_ = e
            }
            return e
        }

        __isResolved() {
            return this.__resolved_
        }
    }

    function b(e, t, i) {
        try {
            r.default.invoke(t, i).remove(t)
        } finally {
            r.default.remove(t)
        }
    }

    c.on(s.default.renderer.requireReturn, b), c.on(s.default.renderer.getBuiltInReturn, b), c.on(s.default.renderer.getGlobalReturn, b), c.on(s.default.renderer.currentWindowReturn, b), c.on(s.default.renderer.currentWebContentsReturn, b), c.on(s.default.renderer.functionCallReturn, b), c.on(s.default.renderer.constructReturn, b), c.on(s.default.renderer.memberCallReturn, b), c.on(s.default.renderer.memberSetReturn, b), c.on(s.default.renderer.memberGetReturn, b), c.on(s.default.renderer.memberConstructReturn, b), c.on(s.default.renderer.callback, (e, t, i) => {
        f.apply(t, C(i))
    }), c.on(s.default.renderer.syncReturn, b), c.on("ELECTRON_RENDERER_RELEASE_CALLBACK", (e, t) => {
        d.info("[RELEASE_CALLBACK]: callbackId:", t), f.remove(t)
    }), process.on("exit", () => {
        c.send(s.default.browser.contextRelease)
    });
    const I = ["__resolve", "__isResolved"], _ = ["__promise_", "__resolved_", "__remoteObj_", "__name_", "__what_"],
        A = e => {
            if (!e.__isResolved()) throw Error("Can not access the property of a remote module which has not Resolved yet.")
        };

    function D(e) {
        const t = function () {
        };
        Object.defineProperty(t, "name", {value: e.__name_}), Object.defineProperty(t, "what", {
            enumerable: !1,
            value: e.__what_
        });
        let i = new Proxy(t, {
            getPrototypeOf: t => (A(e), Reflect.getPrototypeOf(e.__remoteObj_)),
            setPrototypeOf: (e, t) => {
                throw new Error("changing prototype of remote object is forbidden")
            },
            isExtensible: t => (A(e), Reflect.isExtensible(e.__remoteObj_)),
            preventExtensions: t => (A(e), Reflect.preventExtensions(e)),
            getOwnPropertyDescriptor: (t, i) => (A(e), Reflect.getOwnPropertyDescriptor(e.__remoteObj_, i)),
            has: (t, i) => (A(e), Reflect.has(e.__remoteObj_, i)),
            deleteProperty: (t, i) => (A(t), Reflect.deleteProperty(e.__remoteObj_, i)),
            defineProperty: (t, i, n) => (A(e), Reflect.defineProperty(e.__remoteObj_, i, n)),
            get: (t, i, n) => {
                if ("string" == typeof i) {
                    if (String.prototype.includes.call(_, i)) {
                        return e[i]
                    }
                    if (String.prototype.includes.call(I, i)) {
                        return e[i]
                    }
                }
                return A(e), Reflect.get(e.__remoteObj_, i)
            },
            set: (t, i, n, a) => (A(e), Reflect.set(e.__remoteObj_, i, n, a)),
            ownKeys: t => (A(e), Reflect.ownKeys(e.__remoteObj_)),
            apply: (t, i, n) => {
                A(e), Reflect.apply(e.__remoteObj_, i, n)
            },
            construct: (t, i, n) => {
                if (A(e), "function" != typeof e.__remoteObj_) throw Error("operator new ONLY used for function");
                return new Promise((t, n) => {
                    let a = s.default.browser.construct, o = l.default(a),
                        d = h.getHiddenValue(e.__remoteObj_, "__remote_id__");
                    c.send(a, o, d, v(i)), r.default.add(o, e => {
                        try {
                            t(C(e))
                        } catch (e) {
                            n(e)
                        }
                    })
                })
            }
        });
        return e.__promise_.then(e => {
            let t = typeof e;
            if ("function" === t || "object" === t) {
                let t = w(e);
                t && T(i, t)
            }
        }), i
    }

    t.remoteRequire = function (e) {
        return D(new S("module", e))
    }, t.getBuiltin = function (e) {
        return D(new S("builtin", e))
    }, t.getGlobal = function (e) {
        return D(new S("global", e))
    }, t.getCurrentWindow = function () {
        return D(new S("current_window"))
    }, t.getCurrentWebContents = function () {
        return D(new S("current_web_contents"))
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = process.atomBinding("v8_util");
    t.default = class {
        constructor() {
            this.nextId = 0, this.callbacks = {}
        }

        add(e) {
            let t = n.getHiddenValue(e, "__remote_callback_id__");
            if (null != t) return t;
            t = this.nextId -= 1;
            const i = /at (.*)/gi, a = (new Error).stack;
            let o, r = i.exec(a);
            for (; null !== r;) {
                const e = r[1];
                if (!e.includes("native") && !e.includes("electron.asar")) {
                    o = /([^/^)]*)\)?$/gi.exec(e)[1];
                    break
                }
                r = i.exec(a)
            }
            return this.callbacks[t] = e, n.setHiddenValue(e, "__remote_callback_id__", t), n.setHiddenValue(e, "__remote_call_location__", o), t
        }

        get(e) {
            return this.callbacks[e] || function () {
            }
        }

        apply(e, ...t) {
            return this.get(e).apply(global, ...t)
        }

        remove(e) {
            const t = this.callbacks[e];
            t && (n.deleteHiddenValue(t, "__remote_callback_id__"), delete this.callbacks[e])
        }
    }
}, function (e, t, i) {
    "use strict";
    var n;
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        let t = {};
        e.add = function (e, i, n) {
            t[e] = {func: i, thisArg: n}
        }, e.invoke = function (i, ...n) {
            let a = t[i];
            return a.thisArg ? a.func.apply(a.thisArg, ...n) : a.func(...n), e
        }, e.remove = function (e) {
            delete t[e]
        }
    }(n || (n = {})), t.default = n
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    let n = 0;
    t.default = function (e) {
        return e ? e.concat(".").concat(String(++n)) : String(++n)
    }
}, function (e, t, i) {
    "use strict";
    const n = i(17), a = i(475), o = i(401), r = i(476), s = i(106), l = n.isPromise, d = n.ipcMain,
        u = process.atomBinding("v8_util");
    let c = u.createDoubleIDWeakMap();
    const h = new a.default;

    function f(e, t, i, n, a, o) {
        let r, l = !1, d = null, u = !1;
        do {
            try {
                r = t[n]
            } catch (e) {
                l = !0
            }
            if (l) try {
                r = i.value[n], l = !1, i.meta.extendedMemberNames.push(n), u = !0
            } catch (e) {
                s.error(`property ${n} untouchable, even try root[name]`)
            }
            if (l) break;
            let a = Object.getOwnPropertyDescriptor(t, n);
            if (void 0 === a) {
                s.warn(`descriptor of property ${n} is undefined`);
                break
            }
            d = {
                name: n,
                enumerable: a.enumerable,
                writable: !1,
                type: "get"
            }, void 0 === a.get && "function" == typeof r ? d.type = "method" : ((a.set || a.writable) && (d.writable = !0), d.type = "get"), u ? (d.configurable = !0, d.value = v(e, r, o, !1, null)) : d.value = v(e, r, o, !1, i)
        } while (0);
        return d
    }

    function g(e, t, i, n = null) {
        let a = Object.getOwnPropertyNames(t);
        "function" == typeof t && (a = a.filter(function (e) {
            return !String.prototype.includes.call(r.propertiesOfFunction, e)
        }));
        let o = [];
        do {
            if (0 === a.length) break;
            let r = a.length;
            for (let s = 0; s < r; s++) {
                let r = f(e, t, i, a[s], 0, n);
                r && o.push(r)
            }
        } while (0);
        return o
    }

    function p(e, t, i, n = null) {
        let a = null, o = Object.getPrototypeOf(t);
        return a = null === o || o === Object.prototype || o === Function.prototype ? null : v(e, o, n, !1, i)
    }

    function v(e, t, i = null, n = !1, a = null) {
        i = null === i ? {} : i;
        const o = {type: typeof t};
        "object" === o.type && (o.type = function (e, t) {
            let i = typeof e;
            if ("object" !== i) throw new Error("incorrect arg at index 0. non-object");
            return null === e ? i = "value" : ArrayBuffer.isView(e) ? i = "buffer" : Array.isArray(e) ? i = "array" : e instanceof Error ? i = "error" : e instanceof Date ? i = "date" : l(e) ? i = "promise" : Object.prototype.hasOwnProperty.call(e, "callee") && null != e.length ? i = "array" : t && u.getHiddenValue(e, "simple") && (i = "value"), i
        }(t, n));
        do {
            if ("object" === o.type || "function" === o.type) {
                let n = h.getIdOfObject(t);
                if (n && i[n]) {
                    o.refId = n, h.add(e, t);
                    break
                }
            }
            "array" === o.type ? o.members = t.map(t => v(e, t, i)) : "object" === o.type || "function" === o.type ? (null == a && (o.extendedMemberNames = [], a = {
                value: t,
                meta: o
            }), o.name = t.constructor ? t.constructor.name : "", o.id = h.add(e, t), i[o.id] = !0, o.members = g(e, t, a, i), o.proto = p(e, t, a, i)) : "buffer" === o.type ? o.value = Buffer.from(t) : "promise" === o.type ? (t.then(function () {
            }, function () {
            }), o.then = v(e, function (e, i) {
                t.then(e, i)
            })) : "error" === o.type ? (o.members = m(t), o.members.push({
                name: "name",
                value: t.name
            })) : "date" === o.type ? o.value = t.getTime() : (o.type = "value", o.value = t)
        } while (0);
        return o
    }

    function m(e) {
        return Object.getOwnPropertyNames(e).map(t => ({name: t, value: e[t]}))
    }

    function y(e, t) {
        const i = function (t) {
            let a, r, l = 0, d = 0;
            switch (t.type) {
                case"value":
                    return t.value;
                case"remote-object":
                    return h.get(t.id);
                case"array":
                    return y(e, t.value);
                case"buffer":
                    return Buffer.from(t.value);
                case"date":
                    return new Date(t.value);
                case"promise":
                    return Promise.resolve({then: i(t.then)});
                case"object":
                case"interest": {
                    let e = {};
                    for (Object.defineProperty(e.constructor, "name", {value: t.name}), l = 0, d = (r = t.members).length; l < d; l++) e[(a = r[l]).name] = i(a.value);
                    return e
                }
                case"function": {
                    const i = e.id, a = [i, t.id];
                    if (s.info("renderer function id:" + a), c.has(a)) return c.get(a);
                    let r = function (...a) {
                        s.info("[CALLBACK] args", a);
                        let l = [...a];
                        e.isDestroyed() || i !== e.id ? function (e, t, i) {
                            let a = "Attempting to call a function in a renderer window that has been closed or released." + `\nFunction provided here: ${e.location}`;
                            if (t.length > 0 && t[0].sender && t[0].sender instanceof n.webContents.constructor) {
                                const {sender: e} = t[0], n = e.eventNames().filter(t => {
                                    let n = e.listeners(t), a = !1;
                                    return n.forEach(e => {
                                        e === i && (a = !0)
                                    }), a
                                });
                                n.length > 0 && (a += `\nRemote event names: ${n.join(", ")}`, n.forEach(t => {
                                    Object.getPrototypeOf(e).removeListener.call(e, t, i)
                                }))
                            }
                            s.warn(a)
                        }(t, l, r) : e.send(o.default.renderer.callback, t.id, v(e, l))
                    };
                    return Object.defineProperty(r, "length", {value: t.length}), u.setRemoteCallbackFreer(r, t.id, e), c.set(a, r), r
                }
                default:
                    throw new TypeError(`Unknown type: ${t.type}`)
            }
        };
        return t.map(i)
    }

    function k(e, t, i, n) {
        let a, o;
        try {
            return t.apply(i, n)
        } catch (e) {
            return o = t.name, new Error(`Could not call remote function '${a = null != o ? o : "anonymous"}'. Check that the function signature is correct. Underlying error: ${e.message}`)
        }
    }

    function T(e) {
        return {type: "exception", message: e.message, stack: e.stack || e}
    }

    function w(e) {
        const t = new Error(e);
        throw Object.defineProperty(t, "code", {value: "EBADRPC"}), Object.defineProperty(t, "errno", {value: -72}), t
    }

    var C;
    !function (e) {
        const t = (e, t, ...i) => {
            const n = e.sender;
            n.isDestroyed() ? s.warn("webcontext is destroyed, id=", n.id) : n.send(t, ...i)
        };
        e.startServer = function () {
            d.on(o.default.browser.require, (e, i, n) => {
                s.info(`[REQUIRE] module=${n} `);
                let a = process.mainModule.require(n), r = v(e.sender, a);
                t(e, o.default.renderer.requireReturn, i, r)
            }), d.on(o.default.browser.builtIn, (e, i, a) => {
                s.info(`[BUILTIN]: property=${a} `);
                let r = n[a], l = v(e.sender, r);
                s.info(`[BUILTIN]: returns remoteId:${l.id}, type: ${typeof r}`), t(e, o.default.renderer.getBuiltInReturn, i, l)
            }), d.on(o.default.browser.global, (e, i, n) => {
                s.info(`[GLOBAL]: proerty:${n} `);
                let a, r = global[n];
                a = v(e.sender, r), s.info(`[GLOBAL]: returns remoteid=${a.id}, obj=` + typeof r), t(e, o.default.renderer.getGlobalReturn, i, a)
            }), d.on(o.default.browser.currentWindow, (e, i, n) => {
                s.info(`[CURRENT_WINDOW]: property=${n} `);
                let a = e.sender.getOwnerBrowserWindow.call(e.sender), r = v(e.sender, a);
                s.info(`[CURRENT_WINDOW]: returns remoteid=${r.id}, obj=` + a), t(e, o.default.renderer.currentWindowReturn, i, r)
            }), d.on(o.default.browser.currentWebContents, (e, i, n) => {
                t(e, o.default.renderer.currentWebContentsReturn, i, v(e.sender, e.sender))
            });
            const e = (e, t) => {
                const i = (t, i) => {
                    t && Object.getOwnPropertyNames(t).forEach(n => {
                        i ? e.once(n, t[n]) : e.on(n, t[n])
                    })
                };
                t.on && i(t.on, !1), t.once && i(t.once, !0)
            };
            d.on(o.default.browser.construct, (i, n, a, r) => {
                let l, d = null;
                try {
                    s.info(`[CONSTRUCTOR]: remoteId=${a} `);
                    let u = r.length > 0 ? r[r.length - 1] : null;
                    r = y(i.sender, r);
                    let c = h.get(a);
                    null == c && w(`Cannot call constructor on missing remote object ${a}`), u && "interest" === u.type && (d = r.pop());
                    let f = new (Function.prototype.bind.apply(c, [null].concat(r)));
                    f && d && e(f, d), l = v(i.sender, f, null, !1), s.info(`[CONSTRUCTOR]: returns remoteId =${l.id} name=${c.name} `)
                } catch (e) {
                    l = T(e)
                } finally {
                    t(i, o.default.renderer.constructReturn, n, l)
                }
            }), d.on(o.default.browser.functionCall, function (e, i, n, a, r) {
                let l;
                try {
                    s.info(`[FUNCTION_CALL]: remoteId=${a}`), r = y(e.sender, r);
                    let d = h.get(a);
                    if (null == d) s.error(`Cannot call function on missing remote object ${a}`), l = v(e.sender, void 0); else {
                        let t = n ? h.get(n) : global;
                        if (t) {
                            let i = k(0, d, t, r);
                            l = v(e.sender, i)
                        } else s.error(`Cannot call function(${a}) on missing context(${n})`), l = v(e.sender, void 0)
                    }
                    s.info(`[FUNCTION_CALL]: name=${d.name}`)
                } catch (e) {
                    l = T(e)
                } finally {
                    t(e, o.default.renderer.functionCallReturn, i, l)
                }
            }), d.on(o.default.browser.memberCall, function (e, i, n, a, r, l) {
                let d;
                s.info(`[MEMBER_CALL]: thisArg=${n}, remoteId=${a}, method=${r}, args count=${l.length}`);
                try {
                    l = y(e.sender, l);
                    let u = h.get(a);
                    null == u && w(`Cannot call function '${r}' on missing remote object ${a}`);
                    let c = n ? h.get(n) : u;
                    if (c) {
                        let t = k(0, u[r], c, l);
                        d = v(e.sender, t), s.info("[MEMBER_CALL]: return=" + t)
                    } else d = v(e.sender, void 0)
                } catch (e) {
                    d = T(e)
                } finally {
                    t(e, o.default.renderer.memberCallReturn, i, d)
                }
            }), d.on(o.default.browser.memberGet, function (e, i, n, a) {
                let r;
                try {
                    s.info(`[MEMBER_GET]: remoteId=${n}, property=`, a);
                    let l = h.get(n);
                    null == l && w(`Cannot get property '${Object.toString.call(a)}' on missing remote object ${n}`);
                    let d = l[a];
                    r = v(e.sender, d)
                } catch (e) {
                    r = T(e)
                } finally {
                    t(e, o.default.renderer.memberGetReturn, i, r)
                }
            }), d.on(o.default.browser.memberSet, function (e, i, n, a, r) {
                try {
                    s.info(`[MEMBER_SET]: remoteId=${n}, property=` + a), r = y(e.sender, r);
                    let l = h.get(n);
                    null == l && w(`Cannot set property '${Object.toString.call(a)}' on missing remote object ${n}`), l[a] = r[0], t(e, o.default.renderer.memberSetReturn, i, {
                        type: "value",
                        value: !0
                    })
                } catch (n) {
                    t(e, o.default.renderer.memberSetReturn, i, T(n))
                }
            }), d.on(o.default.browser.memberConstruct, function (i, n, a, r, l) {
                let d, u = null;
                try {
                    s.info(`[MEMBER_CONSTRUCTOR]: regId=${a}, method=${r}`);
                    let c = l.length > 0 ? l[l.length - 1] : null;
                    l = y(i.sender, l);
                    let f = h.get(a);
                    null == f && w(`Cannot call constructor '${r}' on missing remote object ${a}`), c && "interest" === c.type && (u = l.pop());
                    let g = f[r], p = new (Function.prototype.bind.apply(g, [null].concat(l)));
                    p && u && e(p, u), d = v(i.sender, p)
                } catch (e) {
                    d = T(e)
                } finally {
                    t(i, o.default.renderer.memberConstructReturn, n, d)
                }
            }), d.on(o.default.browser.sync, function (e, i, n) {
                let a = h.get(n);
                t(e, o.default.renderer.syncReturn, i, v(e.sender, a))
            }), d.on("ELECTRON_BROWSER_DEREFERENCE", function (e, t) {
                let i = h.get(t);
                if (i) {
                    let n = i.name;
                    n || (n = i.constructor ? i.constructor.name : ""), h.remove(e.sender.id, t)
                } else t < 0 && s.warn("remote id reference to nothing:", t)
            }), d.on(o.default.browser.contextRelease, e => {
                h.clear(e.sender.id)
            })
        }, e.getObjectRegistry = function () {
            return h
        }
    }(C || (C = {})), e.exports = C
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(106), a = -1 * Math.pow(2, 31), o = process.atomBinding("v8_util");
    t.default = class {
        constructor() {
            this.nextId = 0, this.storage = new Map, this.owners = new Map
        }

        add(e, t) {
            const i = this.saveToStorage(t), n = e.id;
            let a = this.owners.get(n);
            return a || (a = new Set, this.owners.set(n, a), this.registerDeleteListener(e, n)), a.has(i) || (a.add(i), this.storage.get(i).count++), i
        }

        getIdOfObject(e) {
            return o.getHiddenValue(e, "__remote_id__")
        }

        get(e) {
            const t = this.storage.get(e);
            if (void 0 !== t) return t.object
        }

        remove(e, t) {
            this.dereference(t);
            let i = this.owners.get(e);
            i && i.delete(t)
        }

        clear(e) {
            let t = this.owners.get(e);
            if (t) {
                for (let e of t) this.dereference(e);
                this.owners.delete(e)
            }
        }

        getStorageSize() {
            return this.storage.size
        }

        saveToStorage(e) {
            let t = o.getHiddenValue(e, "__remote_id__");
            if (!t) {
                if ((t = --this.nextId) <= a) throw new Error("object registry id overflow");
                this.storage.set(t, {object: e, count: 0}), o.setHiddenValue(e, "__remote_id__", t)
            }
            return t
        }

        dereference(e) {
            let t = this.storage.get(e);
            null != t && (t.count -= 1, 0 === t.count && (o.deleteHiddenValue(t.object, "__remote_id__"), this.storage.delete(e)))
        }

        registerDeleteListener(e, t) {
            const i = e.getProcessId(), a = (o, r) => {
                r === i && (n.info("render-view-deleted: processid=" + i), (() => {
                    n.info("before clear. objectsRegistry capacity=" + this.storage.size, "owners size:" + this.owners.size)
                })(), e.removeListener("render-view-deleted", a), this.clear(t))
            };
            e.on("render-view-deleted", a)
        }
    }
}, function (e, t, i) {
    "use strict";
    var n;
    !function (e) {
        e.propertiesOfFunction = ["length", "name", "arguments", "caller", "prototype", "apply", "bind", "call", "toString"]
    }(n || (n = {})), e.exports = n
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(478), a = i(479), o = i(107);
    i(480);
    const r = i(481);
    i(482), i(755);
    const s = i(483), l = i(484);
    o.default.directive("visibility", n.default), o.default.directive("opacity", a.default), o.default.use(r.default), o.default.use(s), o.default.use(l.default)
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = {
        bind(e, {value: t}, i) {
            e.__vOriginalVisibility = e.style.visiblity, e.style.visibility = t ? "visible" : "hidden"
        }, update(e, {value: t, oldValue: i}, n) {
            t !== i && (e.style.visibility = t ? "visible" : "hidden")
        }, unbind(e, t, i, n, a) {
            a || (e.style.visiblity = e.__vOriginalVisibility)
        }
    };
    t.default = n
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = {
        bind(e, {value: t}, i) {
            e.__vOriginalOpacity = e.style.opacity, e.__vOriginalPointerEvents = e.style.pointerEvents, e.style.opacity = t ? "1" : "0", e.style.pointerEvents = t ? "auto" : "none"
        }, update(e, {value: t, oldValue: i}, n) {
            t !== i && (e.style.opacity = t ? "1" : "0", e.style.pointerEvents = t ? "auto" : "none")
        }, unbind(e, t, i, n, a) {
            a || (e.style.opacity = e.__vOriginalOpacity, e.style.pointerEvents = e.__vOriginalPointerEvents)
        }
    };
    t.default = n
}, function (e, t, i) {
    e.exports = i(56)(204)
}, function (e, t, i) {
    e.exports = i(56)(132)
}, function (e, t) {
    !function (e) {
        var t,
            i = '<svg><symbol id="td-icon-svg-file" viewBox="0 0 1204 1024"><path d="M180.705882 1024c-102.4 0-180.705882-78.305882-180.705882-180.705882V180.705882c0-102.4 78.305882-180.705882 180.705882-180.705882h240.941177c102.4 0 180.705882 78.305882 180.705882 180.705882h421.647059c102.4 0 180.705882 78.305882 180.705882 180.705883v481.882353c0 102.4-78.305882 180.705882-180.705882 180.705882H180.705882z" fill="#FFC25A" ></path><path d="M301.176471 361.411765h602.352941c66.258824 0 120.470588 54.211765 120.470588 120.470588v361.411765c0 66.258824-54.211765 120.470588-120.470588 120.470588H301.176471c-66.258824 0-120.470588-54.211765-120.470589-120.470588V481.882353c0-66.258824 54.211765-120.470588 120.470589-120.470588z" fill="#FFFFFF" ></path><path d="M180.705882 542.117647h843.294118c102.4 0 180.705882 78.305882 180.705882 180.705882v120.470589c0 102.4-78.305882 180.705882-180.705882 180.705882H180.705882c-102.4 0-180.705882-78.305882-180.705882-180.705882v-120.470589c0-102.4 78.305882-180.705882 180.705882-180.705882z" fill="#FFD68F" ></path></symbol></svg>',
            n = function (e, t) {
                t.firstChild ? function (e, t) {
                    t.parentNode.insertBefore(e, t)
                }(e, t.firstChild) : t.appendChild(e)
            };
        if ((t = document.getElementsByTagName("script"))[t.length - 1].getAttribute("data-injectcss") && !e.__iconfont__svg__cssinject__) {
            e.__iconfont__svg__cssinject__ = !0;
            try {
                document.write("<style>.svgfont {display: inline-block;width: 1em;height: 1em;fill: currentColor;vertical-align: -0.1em;font-size:16px;}</style>")
            } catch (e) {
                console && console.log(e)
            }
        }
        !function (t) {
            if (document.addEventListener) if (~["complete", "loaded", "interactive"].indexOf(document.readyState)) setTimeout(t, 0); else {
                var i = function () {
                    document.removeEventListener("DOMContentLoaded", i, !1), t()
                };
                document.addEventListener("DOMContentLoaded", i, !1)
            } else document.attachEvent && function (e, t) {
                var i = e.document, n = !1, a = function () {
                    n || (n = !0, t())
                }, o = function () {
                    try {
                        i.documentElement.doScroll("left")
                    } catch (e) {
                        return void setTimeout(o, 50)
                    }
                    a()
                };
                o(), i.onreadystatechange = function () {
                    "complete" == i.readyState && (i.onreadystatechange = null, a())
                }
            }(e, t)
        }(function () {
            var e, t;
            (e = document.createElement("div")).innerHTML = i, i = null, (t = e.getElementsByTagName("svg")[0]) && (t.setAttribute("aria-hidden", "true"), t.style.position = "absolute", t.style.width = 0, t.style.height = 0, t.style.overflow = "hidden", n(t, document.body))
        })
    }(window)
}, function (e, t, i) {
    e.exports = function (e) {
        function t(n) {
            if (i[n]) return i[n].exports;
            var a = i[n] = {i: n, l: !1, exports: {}};
            return e[n].call(a.exports, a, a.exports, t), a.l = !0, a.exports
        }

        var i = {};
        return t.m = e, t.c = i, t.i = function (e) {
            return e
        }, t.d = function (e, i, n) {
            t.o(e, i) || Object.defineProperty(e, i, {configurable: !1, enumerable: !0, get: n})
        }, t.n = function (e) {
            var i = e && e.__esModule ? function () {
                return e.default
            } : function () {
                return e
            };
            return t.d(i, "a", i), i
        }, t.o = function (e, t) {
            return Object.prototype.hasOwnProperty.call(e, t)
        }, t.p = "/dist/", t(t.s = 4)
    }([function (e, t) {
        e.exports = {
            inserted: function (e, t, i) {
                var n = i.context.$refs[t.arg];
                n && n.addItem({el: e, value: t.value})
            }, unbind: function (e, t, i) {
                var n = i.context.$refs[t.arg];
                n && n.removeItem({el: e, value: t.value})
            }
        }
    }, function (e, t, i) {
        var n = i(5)(i(2), i(6), null, null, null);
        e.exports = n.exports
    }, function (e, t, i) {
        "use strict";
        Object.defineProperty(t, "__esModule", {value: !0});
        var n = i(3);
        t.default = {
            name: "Popup",
            props: {
                appendToBody: {type: Boolean, default: !0},
                arrowClass: String,
                direction: {type: String, default: "bottom"},
                display: {type: Boolean, default: !1},
                padding: {type: Number, default: 0},
                trigger: {type: String, default: "hover"},
                scrollShow: {type: Boolean, default: !0}
            },
            data: function () {
                return {
                    arrowStyle: {},
                    delay: 100,
                    directionMap: {top: "height", left: "width"},
                    secondDirection: "",
                    left: 0,
                    top: 0,
                    currentElement: null,
                    willHide: !1
                }
            },
            computed: {
                directionClass: function () {
                    var e = /(top)|(bottom)|(left)|(right)/i, t = e.exec(this.direction) || [],
                        i = this.secondDirection ? e.exec(this.secondDirection)[0] : "", n = t[0] || "";
                    return "" === i ? "popup-" + n : "popup-" + i
                }, triggerEvent: function () {
                    switch (this.trigger) {
                        case"hover":
                            return "mouseenter";
                        case"focus":
                            return "focus";
                        case"click":
                            return "click"
                    }
                }, unTriggerEl: function () {
                    return "click" === this.trigger ? document : this.$el
                }, unTriggerEvent: function () {
                    switch (this.trigger) {
                        case"hover":
                            return "mouseleave";
                        case"focus":
                            return "blur";
                        case"click":
                            return "click"
                    }
                }
            },
            mounted: function () {
                this.appendToBody && document.body.appendChild(this.$el), this.$el.addEventListener(this.triggerEvent, this.handlePopupVisible), this.unTriggerEl.addEventListener(this.unTriggerEvent, this.handlePopupInvisible), this.handleResizeThrottle = i.i(n.a)(this.handleResize, 16), window.addEventListener("resize", this.handleResizeThrottle)
            },
            beforeDestroy: function () {
                this.$el.removeEventListener(this.triggerEvent, this.handlePopupVisible), this.unTriggerEl.removeEventListener(this.unTriggerEvent, this.handlePopupInvisible), window.removeEventListener("resize", this.handleResizeThrottle)
            },
            destroyed: function () {
                this.appendToBody && this.$el && document.body.hasChildNodes(this.$el) && document.body.removeChild(this.$el)
            },
            methods: {
                addItem: function (e) {
                    e.el.handleVisible = this.handleVisible.bind(this, e.value, e.el), e.el.addEventListener(this.triggerEvent, e.el.handleVisible), "click" !== this.trigger && (e.el.handleInvisible = this.handleInvisible.bind(this, e.value), e.el.addEventListener(this.unTriggerEvent, e.el.handleInvisible)), this.bindScroll(e.el)
                }, removeItem: function (e) {
                    e.el.removeEventListener(this.triggerEvent, e.el.handleVisible), "click" !== this.trigger && e.el.removeEventListener(this.unTriggerEvent, e.el.handleInvisible), this.unbindScroll(e.el)
                }, bindScroll: function (e) {
                    for (e = e.parentNode; e;) e.addEventListener("scroll", this.handleScroll), e = e.parentNode
                }, unbindScroll: function (e) {
                    for (e = e.parentNode; e;) e.removeEventListener("scroll", this.handleScroll), e = e.parentNode
                }, computePosition: function (e, t) {
                    e = e.getBoundingClientRect();
                    var i = 0, n = 0, a = (t = t.getBoundingClientRect()).top - e.height - this.padding,
                        o = t.left + t.width + this.padding, r = t.top + t.height + this.padding,
                        s = t.left - e.width - this.padding;
                    /(top)|(bottom)/i.test(this.direction) ? (i = t.left + (t.width - e.width) / 2, "bottomStart" !== this.direction && "topStart" !== this.direction || (i = t.left), "bottomEnd" !== this.direction && "topEnd" !== this.direction || (i = t.left - e.width + t.width), i < 0 ? (i = 0, this.arrowStyle = {left: (t.left + t.right) / 2 + "px"}) : i + e.width > window.innerWidth ? (i = window.innerWidth - e.width, this.arrowStyle = {left: (t.left + t.right) / 2 - i + "px"}) : this.arrowStyle = {left: (t.left + t.right) / 2 - i + "px"}, "top" === this.direction || "topStart" === this.direction || "topEnd" === this.direction ? a < 0 && r + e.height <= window.innerHeight ? (n = r, this.secondDirection = "bottom", "topStart" === this.direction && (this.secondDirection = "bottomStart", this.arrowStyle = {left: (t.left + t.right) / 2 - i + "px"}), "topEnd" === this.direction && (this.secondDirection = "bottomEnd", this.arrowStyle = {left: (t.left + t.right) / 2 - i + "px"})) : (n = a, this.secondDirection = "", this.arrowStyle = {left: (t.left + t.right) / 2 - i + "px"}) : r + e.height > window.innerHeight && a >= 0 ? (n = a, this.secondDirection = "top", "bottomStart" === this.direction && (this.secondDirection = "topStart", this.arrowStyle = {left: (t.left + t.right) / 2 - i + "px"}), "bottomEnd" === this.direction && (this.secondDirection = "topEnd", this.arrowStyle = {left: (t.left + t.right) / 2 - i + "px"})) : (n = r, this.secondDirection = "", this.arrowStyle = {left: (t.left + t.right) / 2 - i + "px"})) : /(left)|(right)/i.test(this.direction) && (n = t.top + (t.height - e.height) / 2, "leftStart" !== this.direction && "rightStart" !== this.direction || (n = t.top), "leftEnd" !== this.direction && "rightEnd" !== this.direction || (n = t.top - e.height + t.height), n < 0 ? (n = 0, this.arrowStyle = {top: (t.top + t.bottom) / 2 + "px"}) : n + e.height > window.innerHeight ? (n = window.innerHeight - e.height, this.arrowStyle = {top: (t.top + t.bottom) / 2 - n + "px"}) : this.arrowStyle = {top: (t.top + t.bottom) / 2 - n + "px"}, "left" === this.direction || "leftStart" === this.direction || "leftEnd" === this.direction ? s < 0 && o + e.width <= window.innerWidth ? (i = o, this.secondDirection = "right", "leftStart" === this.direction && (this.secondDirection = "rightStart", this.arrowStyle = {top: (t.top + t.bottom) / 2 - n + "px"}), "leftEnd" === this.direction && (this.secondDirection = "rightEnd", this.arrowStyle = {top: (t.top + t.bottom) / 2 - n + "px"})) : (i = s, this.secondDirection = "", this.arrowStyle = {top: (t.top + t.bottom) / 2 - n + "px"}) : o + e.width > window.innerWidth && s >= 0 ? (i = s, this.secondDirection = "left", "rightStart" === this.direction && (this.secondDirection = "leftStart", this.arrowStyle = {top: (t.top + t.bottom) / 2 - n + "px"}), "rightEnd" === this.direction && (this.secondDirection = "leftEnd", this.arrowStyle = {top: (t.top + t.bottom) / 2 - n + "px"})) : (i = o, this.secondDirection = "", this.arrowStyle = {top: (t.top + t.bottom) / 2 - n + "px"})), this.top = n, this.left = i
                }, handleVisible: function (e, t, i) {
                    var n = this;
                    if ("click" === this.trigger && this.display && !0 !== i) return this.handleInvisible(e);
                    this.willHide = !1, this.currentElement = t, this.currentValue = e, this.$emit("update:display", !0), this.$emit("show", e), this.$nextTick(function () {
                        setTimeout(function () {
                            n.computePosition(n.$el, n.currentElement)
                        })
                    })
                }, handleInvisible: function (e) {
                    var t = this;
                    "click" === this.trigger ? (this.$emit("update:display", !1), this.$emit("hide", e)) : (this.willHide = !0, setTimeout(function () {
                        t.willHide && (t.$emit("update:display", !1), t.$emit("hide", e))
                    }, this.delay))
                }, handleScroll: function () {
                    this.scrollShow ? this.display && this.computePosition(this.$el, this.currentElement) : (this.$emit("update:display", !1), this.$emit("hide"))
                }, handlePopupVisible: function (e) {
                    e.stopPropagation(), this.willHide = !1, this.$emit("update:display", !0), this.$emit("show", this.value)
                }, handlePopupInvisible: function (e) {
                    var t = this;
                    "click" === this.trigger && this.isClosest(e.target, this.currentElement) || ("click" === this.trigger ? (this.$emit("update:display", !1), this.$emit("hide", this.value)) : (this.willHide = !0, setTimeout(function () {
                        t.willHide && (t.$emit("update:display", !1), t.$emit("hide", t.value))
                    }, this.delay)))
                }, handleResize: function () {
                    this.display && this.handleVisible(this.value, this.currentElement, !0)
                }, show: function (e, t) {
                    this.handleVisible(t, e)
                }, hide: function () {
                    this.handleInvisible()
                }, isDirectionLine: function (e) {
                    return "top" === e || "bottom" === e ? "top" === this.direction || "bottom" === this.direction : "left" === this.direction || "right" === this.direction
                }, isClosest: function (e, t) {
                    return e !== document && (e === t || this.isClosest(e.parentNode, t))
                }
            }
        }
    }, function (e, t, i) {
        "use strict";
        t.a = function (e, t) {
            var i = this, n = 0;
            return function () {
                for (var a = arguments.length, o = Array(a), r = 0; r < a; r++) o[r] = arguments[r];
                var s = +new Date;
                s - n > t && (e.apply(i, o), n = s)
            }
        }
    }, function (e, t, i) {
        var n = i(0), a = i(1);
        a.install = function (e) {
            e.directive("popup", n), e.component(a.name, a)
        }, e.exports = a
    }, function (e, t) {
        e.exports = function (e, t, i, n, a) {
            var o, r = e = e || {}, s = typeof e.default;
            "object" !== s && "function" !== s || (o = e, r = e.default);
            var l, d = "function" == typeof r ? r.options : r;
            if (t && (d.render = t.render, d.staticRenderFns = t.staticRenderFns), n && (d._scopeId = n), a ? (l = function (e) {
                (e = e || this.$vnode && this.$vnode.ssrContext || this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) || "undefined" == typeof __VUE_SSR_CONTEXT__ || (e = __VUE_SSR_CONTEXT__), i && i.call(this, e), e && e._registeredComponents && e._registeredComponents.add(a)
            }, d._ssrRegister = l) : i && (l = i), l) {
                var u = d.functional, c = u ? d.render : d.beforeCreate;
                u ? d.render = function (e, t) {
                    return l.call(t), c(e, t)
                } : d.beforeCreate = c ? [].concat(c, l) : [l]
            }
            return {esModule: o, exports: r, options: d}
        }
    }, function (e, t) {
        e.exports = {
            render: function () {
                var e = this, t = e.$createElement, i = e._self._c || t;
                return i("div", {
                    class: e.directionClass,
                    style: {display: e.display ? "block" : "none", left: e.left + "px", top: e.top + "px"},
                    attrs: {tabindex: "999"}
                }, [e._t("default"), e._v(" "), i("span", {
                    staticClass: "popup-arrow",
                    class: e.arrowClass,
                    style: e.arrowStyle
                })], 2)
            }, staticRenderFns: []
        }
    }])
}, function (e, t, i) {
    var n;
    n = function () {
        return function (e) {
            var t = {};

            function i(n) {
                if (t[n]) return t[n].exports;
                var a = t[n] = {i: n, l: !1, exports: {}};
                return e[n].call(a.exports, a, a.exports, i), a.l = !0, a.exports
            }

            return i.m = e, i.c = t, i.i = function (e) {
                return e
            }, i.d = function (e, t, n) {
                i.o(e, t) || Object.defineProperty(e, t, {configurable: !1, enumerable: !0, get: n})
            }, i.n = function (e) {
                var t = e && e.__esModule ? function () {
                    return e.default
                } : function () {
                    return e
                };
                return i.d(t, "a", t), t
            }, i.o = function (e, t) {
                return Object.prototype.hasOwnProperty.call(e, t)
            }, i.p = "", i(i.s = 3)
        }([function (e, t, i) {
            "use strict";
            t.a = function () {
                var e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : [], t = "", i = "";
                if (!e || 0 === e.length) return {isVip: !1};
                var n = e.filter(function (e) {
                    return e && 2 === (e.vasId || e.vasID)
                })[0];
                if (i = n.vIPLevel || n.VIPLevel || 0, n) {
                    var a = {2: "", 3: "p", 5: "s"}[n.vasType] || "";
                    return t = "vip-icon-" + a + "vip" + i, {
                        isVip: "1" === n.isVIP,
                        isStop: "2" === n.isVIP,
                        isYear: "1" === n.isYear,
                        type: n.vasType,
                        level: i,
                        vipClass: t
                    }
                }
                return {isVip: !1}
            }
        }, function (e, t, i) {
            "use strict";
            var n = i(4), a = i.n(n);
            a.a.install = function (e) {
                e.component(a.a.name, a.a)
            }, t.a = a.a
        }, function (e, t, i) {
            "use strict";
            Object.defineProperty(t, "__esModule", {value: !0});
            var n = i(0);
            t.default = {
                name: "vip-icon",
                props: {
                    vipData: {type: Array, required: !0},
                    size: {type: String, default: "normal"},
                    disabled: {type: Boolean, default: !1}
                },
                computed: {
                    vipInfo: function () {
                        return i.i(n.a)(this.vipData)
                    }, vipClass: function () {
                        var e = this.vipInfo.vipClass;
                        return "small" === this.size && (e += " is-small"), (this.vipInfo.isStop || "0" === this.vipInfo.level || this.disabled) && (e += " is-disabled"), e
                    }
                }
            }
        }, function (e, t, i) {
            "use strict";
            Object.defineProperty(t, "__esModule", {value: !0});
            var n = i(1), a = i(0);
            i.d(t, "vipInfo", function () {
                return a.a
            });
            /**
             * vip
             * (c) 2018 shijianan
             * @license MIT
             */
            var o = {
                install: function (e, t) {
                    e.use(n.a), e.prototype.$vipInfo = function (e) {
                        return i.i(a.a)(e)
                    }
                }
            };
            t.default = o
        }, function (e, t, i) {
            var n = i(5)(i(2), i(6), null, null, null);
            n.options.__file = "/Users/nancy/Desktop/work/@xunlei/vip/src/vip-icon/VipIcon.vue", n.esModule && Object.keys(n.esModule).some(function (e) {
                return "default" !== e && "__" !== e.substr(0, 2)
            }) && console.error("named exports are not supported in *.vue files."), n.options.functional && console.error("[vue-loader] VipIcon.vue: functional components are not supported with templates, they should use render functions."), e.exports = n.exports
        }, function (e, t) {
            e.exports = function (e, t, i, n, a) {
                var o, r = e = e || {}, s = typeof e.default;
                "object" !== s && "function" !== s || (o = e, r = e.default);
                var l, d = "function" == typeof r ? r.options : r;
                if (t && (d.render = t.render, d.staticRenderFns = t.staticRenderFns), n && (d._scopeId = n), a ? (l = function (e) {
                    (e = e || this.$vnode && this.$vnode.ssrContext || this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) || "undefined" == typeof __VUE_SSR_CONTEXT__ || (e = __VUE_SSR_CONTEXT__), i && i.call(this, e), e && e._registeredComponents && e._registeredComponents.add(a)
                }, d._ssrRegister = l) : i && (l = i), l) {
                    var u = d.functional, c = u ? d.render : d.beforeCreate;
                    u ? d.render = function (e, t) {
                        return l.call(t), c(e, t)
                    } : d.beforeCreate = c ? [].concat(c, l) : [l]
                }
                return {esModule: o, exports: r, options: d}
            }
        }, function (e, t, i) {
            e.exports = {
                render: function () {
                    var e = this.$createElement;
                    return (this._self._c || e)("i", {class: this.vipClass})
                }, staticRenderFns: []
            }, e.exports.render._withStripped = !0
        }])
    }, e.exports = n()
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(0), r = i(4), s = i(5), l = i(3), d = i(31), u = i(486), c = i(488), h = i(490), f = i(491),
        g = i(86), p = i(15), v = i(42), m = i(29), y = i(403), k = i(45), T = i(6), w = i(47), C = i(51),
        S = o.default.getLogger("DownloadKernel.Task"), b = p.DownloadKernelEventManager.getEventManager(),
        I = m.DownloadKernelCategoryManager.getCategoryManager(),
        _ = T.default(a.join(__rootDir, "../bin/ThunderHelper.node"));
    var A;
    !function (e) {
        e[e.None = 0] = "None", e[e.Create = 1] = "Create", e[e.StartPending = 2] = "StartPending", e[e.Downloading = 3] = "Downloading", e[e.StopPending = 4] = "StopPending", e[e.Pause = 5] = "Pause", e[e.CompletePending = 6] = "CompletePending", e[e.Complete = 7] = "Complete", e[e.Error = 8] = "Error", e[e.ErrorStopPending = 9] = "ErrorStopPending"
    }(A || (A = {}));
    t.Task = class {
        constructor() {
            this.taskId = 0, this.virtualTaskId = 0, this.isBackground = !1, this.taskType = l.DownloadKernel.TaskType.Unkown, this.preStatus = l.DownloadKernel.TaskStatus.Stopped, this.taskStatus = l.DownloadKernel.TaskStatus.Stopped, this.taskExtra = null, this.speed = 0, this.vipSpeed = 0, this.downloadSizeList = [], this.vipSizeList = [], this.startTime = 0, this.downloadingPeriod = 0, this.dispatchStrategy = void 0, this.freeFromSchedule = void 0, this.originOnlyStrategy = void 0, this.originThreadCount = void 0, this.vipCert = void 0, this.dcdnFileIndex = -1, this.taskStatusChangedReason = l.DownloadKernel.TaskStopReason.Unknown, this.batchSetTaskAttribute = !1, this.batchDetailChangedFlags = l.DownloadKernel.TaskDetailChangedFlags.UnKnown, this.detailChangedFlags = l.DownloadKernel.TaskDetailChangedFlags.UnKnown, this.nTotalAvailablePeer = 0, this.vipDownloadSizeCur = 0, this.bAcclerating = !1, this.shiftChannelSize = 0, this.resourceLegal = -1, this.serverResourceInfos = new Map, this.attribute = new Map;
            for (let e = l.DownloadKernel.TaskAttribute.NumberStrart; e < l.DownloadKernel.TaskAttribute.NumberEnd; ++e) this.attribute.set(e, 0);
            for (let e = l.DownloadKernel.TaskAttribute.BooleanStart; e < l.DownloadKernel.TaskAttribute.BooleanEnd; ++e) this.attribute.set(e, !1);
            for (let e = l.DownloadKernel.TaskAttribute.StringStart; e < l.DownloadKernel.TaskAttribute.StringEnd; ++e) this.attribute.set(e, "");
            for (let e = l.DownloadKernel.TaskAttribute.ObjectStart; e < l.DownloadKernel.TaskAttribute.ObjectEnd; ++e) this.attribute.set(e, null);
            this.attribute.set(l.DownloadKernel.TaskAttribute.CategoryId, -1), this.attribute.set(l.DownloadKernel.TaskAttribute.CategoryViewId, l.DownloadKernel.CategroyViewID.Unkown), this.attribute.set(l.DownloadKernel.TaskAttribute.TaskType, l.DownloadKernel.TaskType.Unkown), this.attribute.set(l.DownloadKernel.TaskAttribute.ErrorCode, l.DownloadKernel.TaskError.Unkown), this.attribute.set(l.DownloadKernel.TaskAttribute.NameType, 1), this.attribute.set(l.DownloadKernel.TaskAttribute.CreateTime, (new Date).getTime()), this.channelInfo = {
                originSize: 0,
                p2pSize: 0,
                p2sSize: 0,
                offlineSize: 0,
                dcdnSize: 0,
                dcdnStatus: l.DownloadKernel.DcdnStatusCode.Unkown
            }, this.historyChannelInfo = {originSize: 0, p2pSize: 0, p2sSize: 0, offlineSize: 0, dcdnSize: 0}
        }

        getId() {
            return this.taskId
        }

        getType() {
            return this.taskType
        }

        reName(e) {
            return n(this, void 0, void 0, function* () {
                do {
                    if (!e || "" === e) break;
                    let t = this.attribute.get(l.DownloadKernel.TaskAttribute.TaskName);
                    if (t === e) break;
                    let i = !1;
                    if (this.taskStatus === l.DownloadKernel.TaskStatus.Succeeded || this.taskStatus === l.DownloadKernel.TaskStatus.Seeding) {
                        if (!(yield k.SingleBtTaskNS.isSingleBtTask(this)) && this.taskType !== l.DownloadKernel.TaskType.Group) {
                            let i = this.attribute.get(l.DownloadKernel.TaskAttribute.SavePath), n = a.join(i, t),
                                o = a.join(i, e), r = yield s.FileSystemAWNS.existsAW(n);
                            r && (o = v.Common.getMaxFilePath(o), yield s.FileSystemAWNS.renameAW(n, o), (r = yield s.FileSystemAWNS.existsAW(o)) && (e = a.basename(o)))
                        }
                        i = !0
                    } else this.taskStatus === l.DownloadKernel.TaskStatus.StandBy ? i = !0 : this.taskStatus === l.DownloadKernel.TaskStatus.Started && this.taskType === l.DownloadKernel.TaskType.P2sp && d.ThunderKernel.renameP2spTaskFile(this.virtualTaskId, e);
                    i && (this.setTaskAttribute(l.DownloadKernel.TaskAttribute.TaskName, e), this.fireTaskEvent(l.DownloadKernel.TaskEventType.TaskRenamed))
                } while (0)
            })
        }

        setUserRead(e) {
            0 !== e && (e = 1), e !== this.attribute.get(l.DownloadKernel.TaskAttribute.UserRead) && (this.attribute.set(l.DownloadKernel.TaskAttribute.UserRead, e), this.saveTaskInfo(this.taskId, g.StatementType.SetTaskUserRead, g.ValueType.ValueInt, e), this.fireTaskDetailChanged(l.DownloadKernel.TaskDetailChangedFlags.UserRead))
        }

        getUserRead() {
            return this.attribute.get(l.DownloadKernel.TaskAttribute.UserRead)
        }

        setDescription(e) {
            let t = this.attribute.get(l.DownloadKernel.TaskAttribute.Description);
            e && t !== e && (this.attribute.set(l.DownloadKernel.TaskAttribute.Description, e), this.saveTaskInfo(this.taskId, g.StatementType.SetTaskDescription, g.ValueType.ValueString, e), this.fireTaskEvent(l.DownloadKernel.TaskEventType.TaskDescriptionChanged))
        }

        setOriginThreadCount(e) {
            this.taskType === l.DownloadKernel.TaskType.P2sp && this.getExtraObject().setOriginThreadCount(e)
        }

        setOriginOnlyStrategy(e) {
            if (this.taskType === l.DownloadKernel.TaskType.P2sp) {
                let t = this.getExtraObject();
                e ? (t.setUseOriginOnly(1), this.originOnlyStrategy = 1) : (t.setUseOriginOnly(0), this.originOnlyStrategy = 0)
            }
        }

        getOriginOnlyStrategy() {
            let e = !1;
            return this.taskType === l.DownloadKernel.TaskType.P2sp && 1 === this.getExtraObject().getUseOriginOnly() && (e = !0), e
        }

        setDispatchStrategy(e) {
            this.dispatchStrategy = e
        }

        setDownloadStrategy(e) {
            d.ThunderKernel.setDownloadStrategy(this.virtualTaskId, e)
        }

        setFreeFromSchedule(e) {
            this.freeFromSchedule !== e && (this.freeFromSchedule = e)
        }

        setOpenOnComplete(e) {
            this.attribute.set(l.DownloadKernel.TaskAttribute.OpenOnComplete, e), this.saveTaskInfo(this.taskId, g.StatementType.SetTaskOpenOnCompelete, g.ValueType.ValueInt, e)
        }

        setTaskMovingState(e) {
            this.attribute.get(l.DownloadKernel.TaskAttribute.Moving) !== e && (this.attribute.set(l.DownloadKernel.TaskAttribute.Moving, e), this.fireTaskEvent(l.DownloadKernel.TaskEventType.TaskMovingStateChange))
        }

        getExtraObject() {
            return this.taskExtra
        }

        getTaskStatus() {
            return this.taskStatus
        }

        getTaskPreStatus() {
            return this.preStatus
        }

        getDownloadSpeed() {
            return this.speed
        }

        getVipSpeed() {
            let e = this.vipSpeed;
            return this.vipSpeed > this.speed && (e = this.speed), e
        }

        getTotalAvailablePeer() {
            return this.nTotalAvailablePeer
        }

        getVipDownloadSizeCur() {
            return this.vipDownloadSizeCur
        }

        setAcclerating(e) {
            this.bAcclerating = e
        }

        getAcclerating() {
            return this.bAcclerating
        }

        getShiftChannelSize() {
            return this.shiftChannelSize
        }

        getTaskAttribute(e) {
            return this.attribute.get(e)
        }

        getIsBackground() {
            return !0 === this.isBackground
        }

        getTaskChannelInfo() {
            let e = {};
            return e.originSize = this.historyChannelInfo.originSize + this.channelInfo.originSize, e.p2pSize = this.historyChannelInfo.p2pSize + this.channelInfo.p2pSize, e.p2sSize = this.historyChannelInfo.p2sSize + this.channelInfo.p2sSize, e.offlineSize = this.historyChannelInfo.offlineSize + this.channelInfo.offlineSize, e.dcdnSize = this.historyChannelInfo.dcdnSize + this.channelInfo.dcdnSize, e.dcdnStatus = this.channelInfo.dcdnStatus, e.dcdnResult = this.channelInfo.dcdnResult, e.enableDcdn = this.channelInfo.enableDcdn, e
        }

        getTaskBaseInfo() {
            let e = {};
            return e.taskId = this.taskId, e.taskType = this.taskType, e.downloadSpeed = this.speed, this.vipSpeed > this.speed ? e.vipSpeed = this.speed : e.vipSpeed = this.vipSpeed, e.taskStatus = this.getTaskStatus(), e.isMoving = this.attribute.get(l.DownloadKernel.TaskAttribute.Moving), e.savePath = this.attribute.get(l.DownloadKernel.TaskAttribute.SavePath), e.createTime = this.attribute.get(l.DownloadKernel.TaskAttribute.CreateTime), e.url = this.attribute.get(l.DownloadKernel.TaskAttribute.TaskUrl), e.refUrl = this.attribute.get(l.DownloadKernel.TaskAttribute.RefUrl), e.cid = this.attribute.get(l.DownloadKernel.TaskAttribute.Cid), e.gcid = this.attribute.get(l.DownloadKernel.TaskAttribute.Gcid), e.taskName = this.attribute.get(l.DownloadKernel.TaskAttribute.TaskName), e.description = this.attribute.get(l.DownloadKernel.TaskAttribute.Description), e.nameType = this.attribute.get(l.DownloadKernel.TaskAttribute.NameType), e.categoryId = this.attribute.get(l.DownloadKernel.TaskAttribute.CategoryId), e.userRead = this.attribute.get(l.DownloadKernel.TaskAttribute.UserRead), e.openOnComplete = this.attribute.get(l.DownloadKernel.TaskAttribute.OpenOnComplete), e.ownerProduct = this.attribute.get(l.DownloadKernel.TaskAttribute.OwnerProduct), e.downloadingPeriod = this.attribute.get(l.DownloadKernel.TaskAttribute.DownloadingPeriod), e.errorCode = this.attribute.get(l.DownloadKernel.TaskAttribute.ErrorCode), e.groupTaskId = this.attribute.get(l.DownloadKernel.TaskAttribute.GroupTaskId), e.downloadSubTask = this.attribute.get(l.DownloadKernel.TaskAttribute.DownloadSubTask), e.productInfo = this.attribute.get(l.DownloadKernel.TaskAttribute.ProductInfo), e.origin = this.attribute.get(l.DownloadKernel.TaskAttribute.Origin), e.fileCreated = this.attribute.get(l.DownloadKernel.TaskAttribute.FileCreated), e.recycleTime = this.attribute.get(l.DownloadKernel.TaskAttribute.RecycleTime), e.forbidden = this.attribute.get(l.DownloadKernel.TaskAttribute.Forbidden), e.fileSize = this.attribute.get(l.DownloadKernel.TaskAttribute.FileSize), e.receiveSize = this.attribute.get(l.DownloadKernel.TaskAttribute.ReceivedSize), e.downloadSize = this.attribute.get(l.DownloadKernel.TaskAttribute.DownloadSize), e.srcTotal = this.attribute.get(l.DownloadKernel.TaskAttribute.SrcTotal), e.srcUsing = this.attribute.get(l.DownloadKernel.TaskAttribute.SrcUsing), e.completionTime = this.attribute.get(l.DownloadKernel.TaskAttribute.CompletionTime), e.nTotalAvailablePeer = this.getTotalAvailablePeer(), e.isBackground = this.getIsBackground(), e.playPosition = this.attribute.get(l.DownloadKernel.TaskAttribute.PlayPosition), e.duration = this.attribute.get(l.DownloadKernel.TaskAttribute.Duration), e.channelInfo = this.getTaskChannelInfo(), e.realDownloadSize = this.attribute.get(l.DownloadKernel.TaskAttribute.RealDownloadSize) || 0, e.validDownloadSize = this.attribute.get(l.DownloadKernel.TaskAttribute.ValidDownloadSize) || 0, e
        }

        isSupportPlay() {
            let e = !1;
            if (this.taskStatus === l.DownloadKernel.TaskStatus.Failed) {
                let t = this.attribute.get(l.DownloadKernel.TaskAttribute.ErrorCode);
                e = !(t && t > 700) && this.isVideoFile()
            } else e = this.isVideoFile();
            return e
        }

        setResourceLegalStatus(e) {
            this.resourceLegal = e
        }

        getResourceLegalStatus() {
            return this.resourceLegal
        }

        getVideoFileCount() {
            let e = 0;
            if (this.taskType === l.DownloadKernel.TaskType.P2sp || this.taskType === l.DownloadKernel.TaskType.Emule) e = this.isVideoFile() ? 1 : 0; else if (this.taskType === l.DownloadKernel.TaskType.Bt) {
                let t = this.getExtraObject();
                if (t.getDownloadFile().length <= 0) e = 0; else {
                    let i = !1, n = t.getBtFileList();
                    for (let [, t]of n) {
                        let n = t.getBtFileAttribute(l.DownloadKernel.BtFileAttribute.Download),
                            a = t.getBtFileAttribute(l.DownloadKernel.BtFileAttribute.FileName);
                        1 === n && (i = w.TaskUtilHelper.isVideoFileExt(a)) && e++
                    }
                }
            } else if (this.taskType === l.DownloadKernel.TaskType.Group) {
                let t = this.getExtraObject();
                if (null !== t && void 0 !== t) {
                    let i = !1, n = t.getSubTaskCount();
                    for (let a = 0; a < n; ++a) {
                        let n = t.getSubTaskByIndex(a), o = n.getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskName);
                        1 === n.getTaskAttribute(l.DownloadKernel.TaskAttribute.DownloadSubTask) && (i = w.TaskUtilHelper.isVideoFileExt(o)) && e++
                    }
                }
            }
            return e
        }

        isFreeFromSchedule() {
            return this.freeFromSchedule
        }

        getPlayUrl(e) {
            return n(this, void 0, void 0, function* () {
                return new Promise(t => {
                    this.virtualTaskId && this.virtualTaskId > 0 ? d.ThunderKernel.queryPlayInfo(this.virtualTaskId, e, (i, n) => {
                        e === i && t(n)
                    }) : t(void 0)
                })
            })
        }

        enableDcdnWithVipCert(e, t = -1) {
            if (S.information("enableDcdnWithVipCert", this.taskId, e, t), this.vipCert = e, this.dcdnFileIndex = t, this.taskType === l.DownloadKernel.TaskType.Group) {
                let i = this.getExtraObject(), n = i.getSubTaskCount();
                for (let a = 0; a < n; ++a) {
                    let n = i.getSubTaskByIndex(a);
                    n && n.enableDcdnWithVipCert(e, t)
                }
            } else this.virtualTaskId && this.virtualTaskId > 0 && d.ThunderKernel.enableDcdnWithVipCert(this.virtualTaskId, t, e)
        }

        updateDcdnWithVipCert(e, t = -1) {
            if (S.information("updateDcdnWithVipCert", this.taskId, e, t), this.vipCert = e, this.dcdnFileIndex = t, this.taskType === l.DownloadKernel.TaskType.Group) {
                let i = this.getExtraObject(), n = i.getSubTaskCount();
                for (let a = 0; a < n; ++a) {
                    let n = i.getSubTaskByIndex(a);
                    n && n.updateDcdnWithVipCert(e, t)
                }
            } else this.virtualTaskId && this.virtualTaskId > 0 && d.ThunderKernel.updateDcdnWithVipCert(this.virtualTaskId, t, e)
        }

        disableDcdnWithVipCert(e = -1) {
            if (S.information("updateDcdnWithVipCert", this.taskId, e), this.vipCert = void 0, this.dcdnFileIndex = -1, this.taskType === l.DownloadKernel.TaskType.Group) {
                let t = this.getExtraObject(), i = t.getSubTaskCount();
                for (let n = 0; n < i; ++n) {
                    let i = t.getSubTaskByIndex(n);
                    i && i.disableDcdnWithVipCert(e)
                }
            } else this.virtualTaskId && this.virtualTaskId > 0 && d.ThunderKernel.disableDcdnWithVipCert(this.virtualTaskId, e)
        }

        start(e) {
            S.information("start this.taskStatus:", this.taskStatus, ", this.taskType:", this.taskType);
            let t = !1;
            return (this.taskStatus === l.DownloadKernel.TaskStatus.Stopped || this.taskStatus === l.DownloadKernel.TaskStatus.StartWaiting || this.taskStatus === l.DownloadKernel.TaskStatus.Failed || this.taskStatus === l.DownloadKernel.TaskStatus.Unkown || e) && (this.taskType === l.DownloadKernel.TaskType.Group ? (t = this.getExtraObject().start(e)) && (t = this.updateTaskStatus(l.DownloadKernel.TaskStatus.StartPending)) : (this.createDownloadSdkTask().catch(), t = this.updateTaskStatus(l.DownloadKernel.TaskStatus.StartPending))), e && (t = !0), t
        }

        startWaiting() {
            S.information("startWaiting this.taskStatus:", this.taskStatus);
            let e = !1;
            return this.taskStatus !== l.DownloadKernel.TaskStatus.Stopped && this.taskStatus !== l.DownloadKernel.TaskStatus.Failed && this.taskStatus !== l.DownloadKernel.TaskStatus.Unkown || (e = this.updateTaskStatus(l.DownloadKernel.TaskStatus.StartWaiting)), e
        }

        stop(e) {
            S.information("stop reason", e);
            let t = !1;
            if (this.taskStatus === l.DownloadKernel.TaskStatus.StartWaiting) t = this.updateTaskStatus(l.DownloadKernel.TaskStatus.Stopped); else if (this.taskType === l.DownloadKernel.TaskType.Group) {
                let i = this.getExtraObject();
                if (t = i.stop(e)) {
                    let e = i.getTaskStatus();
                    e !== l.DownloadKernel.TaskStatus.Succeeded && e !== l.DownloadKernel.TaskStatus.Seeding && e !== l.DownloadKernel.TaskStatus.Stopped && (t = this.updateTaskStatus(l.DownloadKernel.TaskStatus.StopPending))
                }
            } else this.taskStatus !== l.DownloadKernel.TaskStatus.Succeeded && this.taskStatus !== l.DownloadKernel.TaskStatus.Seeding && this.taskStatus !== l.DownloadKernel.TaskStatus.Stopped && this.taskStatus !== l.DownloadKernel.TaskStatus.Failed && (this.virtualTaskId && this.virtualTaskId > 0 ? (t = this.updateTaskStatus(l.DownloadKernel.TaskStatus.StopPending), d.ThunderKernel.setTaskExtStat(this.virtualTaskId, -1, "stopreason", String(e)), d.ThunderKernel.stopTask(this.virtualTaskId)) : t = this.updateTaskStatus(l.DownloadKernel.TaskStatus.Stopped));
            return t && this.setStopReason(e), t
        }

        deleteFile() {
            return n(this, void 0, void 0, function* () {
                S.information("delete");
                let e = !1;
                return e = this.taskType === l.DownloadKernel.TaskType.Group ? yield this.getExtraObject().deleteFile() : yield this.destroy()
            })
        }

        commit() {
        }

        updateTaskStatus(e) {
            let t = !1;
            return this.taskStatus !== e && (this.taskStatus === l.DownloadKernel.TaskStatus.StartPending ? e === l.DownloadKernel.TaskStatus.Stopped || (this.preStatus = this.taskStatus, this.taskStatus = e, t = !0) : this.taskStatus === l.DownloadKernel.TaskStatus.StopPending ? e === l.DownloadKernel.TaskStatus.Started || (this.preStatus = this.taskStatus, this.taskStatus = e, t = !0) : (this.taskStatus === l.DownloadKernel.TaskStatus.Succeeded || this.taskStatus === l.DownloadKernel.TaskStatus.Seeding) && e !== l.DownloadKernel.TaskStatus.Stopped && e !== l.DownloadKernel.TaskStatus.DestroyPending || (this.preStatus = this.taskStatus, this.taskStatus = e, t = !0)), e !== l.DownloadKernel.TaskStatus.Started && (this.speed = 0, this.vipSpeed = 0, this.downloadSizeList = [], this.vipSizeList = []), t && (this.startTime = 0, this.downloadingPeriod = this.attribute.get(l.DownloadKernel.TaskAttribute.DownloadingPeriod), this.taskStatus !== l.DownloadKernel.TaskStatus.DestroyPending && this.saveTaskInfo(this.taskId, g.StatementType.SetTaskStatus, g.ValueType.ValueInt, this.taskStatus)), t
        }

        createP2spTask(e, t, i, n) {
            return this.taskId = d.ThunderKernel.createTaskId(), this.taskType = l.DownloadKernel.TaskType.P2sp, this.attribute.set(l.DownloadKernel.TaskAttribute.TaskId, this.taskId), this.attribute.set(l.DownloadKernel.TaskAttribute.TaskType, this.taskType), this.attribute.set(l.DownloadKernel.TaskAttribute.TaskUrl, i.url), this.attribute.set(l.DownloadKernel.TaskAttribute.RefUrl, i.refUrl), this.attribute.set(l.DownloadKernel.TaskAttribute.Origin, i.origin), this.attribute.set(l.DownloadKernel.TaskAttribute.Cookie, i.cookie), this.attribute.set(l.DownloadKernel.TaskAttribute.SavePath, t.savePath), this.attribute.set(l.DownloadKernel.TaskAttribute.TaskName, t.taskName), this.attribute.set(l.DownloadKernel.TaskAttribute.Description, t.description), this.attribute.set(l.DownloadKernel.TaskAttribute.OpenOnComplete, t.openOnComplete), t.productInfo && this.attribute.set(l.DownloadKernel.TaskAttribute.ProductInfo, t.productInfo), t.origin && this.attribute.set(l.DownloadKernel.TaskAttribute.Origin, t.origin), t.groupTaskId && this.attribute.set(l.DownloadKernel.TaskAttribute.GroupTaskId, t.groupTaskId), 1 === i.downloadSubTask && this.attribute.set(l.DownloadKernel.TaskAttribute.DownloadSubTask, 1), r.isNumber(n) && this.attribute.set(l.DownloadKernel.TaskAttribute.CategoryId, n), t.fileSize && this.attribute.set(l.DownloadKernel.TaskAttribute.FileSize, t.fileSize), t.gcid && this.attribute.set(l.DownloadKernel.TaskAttribute.Gcid, t.gcid), t.cid && this.attribute.set(l.DownloadKernel.TaskAttribute.Cid, t.cid), e ? (this.isBackground = e, this.attribute.set(l.DownloadKernel.TaskAttribute.Background, e)) : this.insertStorageTaskBase(), this.taskExtra = new u.P2spTask(this, !e, i.useOriginResourceOnly, i.originResourceThreadCount, i.nameFixed || 0), this.taskId
        }

        createBtTask(e, t, i, o) {
            return n(this, void 0, void 0, function* () {
                this.taskId = d.ThunderKernel.createTaskId(), this.taskType = l.DownloadKernel.TaskType.Bt, t.taskName || (t.taskName = i.displayName), this.attribute.set(l.DownloadKernel.TaskAttribute.TaskId, this.taskId), this.attribute.set(l.DownloadKernel.TaskAttribute.TaskType, this.taskType), this.attribute.set(l.DownloadKernel.TaskAttribute.TaskUrl, i.originUrl), this.attribute.set(l.DownloadKernel.TaskAttribute.RefUrl, i.refUrl), this.attribute.set(l.DownloadKernel.TaskAttribute.SavePath, t.savePath), this.attribute.set(l.DownloadKernel.TaskAttribute.TaskName, t.taskName), this.attribute.set(l.DownloadKernel.TaskAttribute.Description, t.description), this.attribute.set(l.DownloadKernel.TaskAttribute.OpenOnComplete, t.openOnComplete), t.productInfo && this.attribute.set(l.DownloadKernel.TaskAttribute.ProductInfo, t.productInfo), t.origin && this.attribute.set(l.DownloadKernel.TaskAttribute.Origin, t.origin), r.isNumber(o) && this.attribute.set(l.DownloadKernel.TaskAttribute.CategoryId, o);
                let n = a.join(__profilesDir, "Torrents"), u = yield s.FileSystemAWNS.existsAW(n);
                u || (yield s.FileSystemAWNS.mkdirsAW(n));
                let h = i.infoId + ".torrent", f = a.join(n, h);
                yield s.FileSystemAWNS.copyFileAW(i.seedFile, f), (u = yield s.FileSystemAWNS.existsAW(f)) && (i.seedFile = f), e ? (this.isBackground = e, this.attribute.set(l.DownloadKernel.TaskAttribute.Background, e)) : this.insertStorageTaskBase(), this.taskExtra = new c.BtTask(this, !e, i);
                let g = this.getExtraObject().getFileSize();
                this.attribute.set(l.DownloadKernel.TaskAttribute.FileSize, g), this.saveAttribute(l.DownloadKernel.TaskAttribute.FileSize, g)
            })
        }

        createEmuleTask(e, t, i, n) {
            if (this.taskId = d.ThunderKernel.createTaskId(), this.taskType = l.DownloadKernel.TaskType.Emule, this.attribute.set(l.DownloadKernel.TaskAttribute.TaskId, this.taskId), this.attribute.set(l.DownloadKernel.TaskAttribute.TaskType, this.taskType), this.attribute.set(l.DownloadKernel.TaskAttribute.TaskUrl, i.url), this.attribute.set(l.DownloadKernel.TaskAttribute.Origin, i.origin), this.attribute.set(l.DownloadKernel.TaskAttribute.SavePath, t.savePath), this.attribute.set(l.DownloadKernel.TaskAttribute.TaskName, t.taskName), this.attribute.set(l.DownloadKernel.TaskAttribute.Description, t.description), this.attribute.set(l.DownloadKernel.TaskAttribute.OpenOnComplete, t.openOnComplete), t.productInfo && this.attribute.set(l.DownloadKernel.TaskAttribute.ProductInfo, t.productInfo), t.origin && this.attribute.set(l.DownloadKernel.TaskAttribute.Origin, t.origin), t.groupTaskId && this.attribute.set(l.DownloadKernel.TaskAttribute.GroupTaskId, t.groupTaskId), 1 === i.downloadSubTask && this.attribute.set(l.DownloadKernel.TaskAttribute.DownloadSubTask, 1), r.isNumber(n) && this.attribute.set(l.DownloadKernel.TaskAttribute.CategoryId, n), t.fileSize) this.attribute.set(l.DownloadKernel.TaskAttribute.FileSize, t.fileSize); else {
                let e = v.Common.parseEd2kUrl(i.url);
                e && e.fileSize && this.attribute.set(l.DownloadKernel.TaskAttribute.FileSize, e.fileSize)
            }
            return t.gcid && this.attribute.set(l.DownloadKernel.TaskAttribute.Gcid, t.gcid), t.cid && this.attribute.set(l.DownloadKernel.TaskAttribute.Cid, t.cid), e ? (this.isBackground = e, this.attribute.set(l.DownloadKernel.TaskAttribute.Background, e)) : this.insertStorageTaskBase(), this.taskExtra = new h.EmuleTask(this, !e), this.taskId
        }

        createGroupTask(e, t, i, n) {
            this.taskId = d.ThunderKernel.createTaskId(), this.taskType = l.DownloadKernel.TaskType.Group, this.attribute.set(l.DownloadKernel.TaskAttribute.TaskId, this.taskId), this.attribute.set(l.DownloadKernel.TaskAttribute.TaskType, this.taskType), this.attribute.set(l.DownloadKernel.TaskAttribute.SavePath, t.savePath), this.attribute.set(l.DownloadKernel.TaskAttribute.TaskName, t.taskName), this.attribute.set(l.DownloadKernel.TaskAttribute.Description, t.description), this.attribute.set(l.DownloadKernel.TaskAttribute.OpenOnComplete, t.openOnComplete), t.productInfo && this.attribute.set(l.DownloadKernel.TaskAttribute.ProductInfo, t.productInfo), t.origin && this.attribute.set(l.DownloadKernel.TaskAttribute.Origin, t.origin), r.isNumber(n) && this.attribute.set(l.DownloadKernel.TaskAttribute.CategoryId, n);
            let a = 0;
            for (let e = 0; e < i.subTaskList.length; ++e) {
                let t = i.subTaskList[e].taskBaseInfo.fileSize;
                t && (a += t)
            }
            return a && this.attribute.set(l.DownloadKernel.TaskAttribute.FileSize, a), e ? (this.isBackground = e, this.attribute.set(l.DownloadKernel.TaskAttribute.Background, e)) : this.insertStorageTaskBase(), this.taskExtra = new f.GroupTask(this, !e), this.taskId
        }

        createMagnetTask(e, t, i, n) {
            return this.taskId = d.ThunderKernel.createTaskId(), this.taskType = l.DownloadKernel.TaskType.Magnet, this.attribute.set(l.DownloadKernel.TaskAttribute.TaskId, this.taskId), this.attribute.set(l.DownloadKernel.TaskAttribute.TaskType, this.taskType), this.attribute.set(l.DownloadKernel.TaskAttribute.TaskUrl, i.url), this.attribute.set(l.DownloadKernel.TaskAttribute.SavePath, i.torrentFilePath), this.attribute.set(l.DownloadKernel.TaskAttribute.Description, t.description), this.attribute.set(l.DownloadKernel.TaskAttribute.OpenOnComplete, t.openOnComplete), t.productInfo && this.attribute.set(l.DownloadKernel.TaskAttribute.ProductInfo, t.productInfo), t.origin && this.attribute.set(l.DownloadKernel.TaskAttribute.Origin, t.origin), r.isNumber(n) && this.attribute.set(l.DownloadKernel.TaskAttribute.CategoryId, n), e ? (this.isBackground = e, this.attribute.set(l.DownloadKernel.TaskAttribute.Background, e)) : this.insertStorageTaskBase(), this.taskId
        }

        loadStorageP2spTask(e) {
            this.setTaskBaseInfo(e), this.taskExtra = new u.P2spTask(this, !1, 0, 5, 0)
        }

        loadStorageBtTask(e) {
            this.setTaskBaseInfo(e), this.taskExtra = new c.BtTask(this, !1, null), this.taskExtra.loadBtTask(e => {
                if (e) {
                    let t = this.attribute.get(l.DownloadKernel.TaskAttribute.TaskName);
                    void 0 !== t && "" !== t || void 0 !== e.displayName && this.attribute.set(l.DownloadKernel.TaskAttribute.TaskName, e.displayName)
                }
                b.fireTaskEvent(l.DownloadKernel.TaskEventType.BtSubFileLoaded, this.taskId, []), b.fireTaskEvent(l.DownloadKernel.TaskEventType.BtSubFileDetailChanged, this.taskId, [])
            })
        }

        loadStorageBtTaskAW(e) {
            return new Promise(t => n(this, void 0, void 0, function* () {
                this.setTaskBaseInfo(e), this.taskExtra = new c.BtTask(this, !1, null), this.getExtraObject().loadBtTask(e => {
                    if (e) {
                        let t = this.attribute.get(l.DownloadKernel.TaskAttribute.TaskName);
                        void 0 !== t && "" !== t || void 0 !== e.displayName && this.attribute.set(l.DownloadKernel.TaskAttribute.TaskName, e.displayName)
                    }
                    b.fireTaskEvent(l.DownloadKernel.TaskEventType.BtSubFileDetailChanged, this.taskId, []), t()
                })
            }))
        }

        loadStorageEmuleTask(e) {
            this.setTaskBaseInfo(e), this.taskExtra = new h.EmuleTask(this, !1)
        }

        loadStorageGroupTask(e) {
            this.setTaskBaseInfo(e), this.taskExtra = new f.GroupTask(this, !1)
        }

        updateTaskSavePath(e) {
            this.setTaskAttribute(l.DownloadKernel.TaskAttribute.SavePath, e)
        }

        updateTaskRelativePath(e) {
            this.setTaskAttribute(l.DownloadKernel.TaskAttribute.RelativePath, e)
        }

        updateTaskName(e) {
            this.setTaskAttribute(l.DownloadKernel.TaskAttribute.TaskName, e)
        }

        updateDownloadSubTask(e) {
            return this.setTaskAttribute(l.DownloadKernel.TaskAttribute.DownloadSubTask, e)
        }

        queryTaskInfo(e, t, i) {
            let n = !1;
            switch (this.taskType) {
                case l.DownloadKernel.TaskType.P2sp:
                    n = this.queryP2spTaskInfo(e, t, i);
                    break;
                case l.DownloadKernel.TaskType.Bt:
                    n = this.queryBtTaskInfo(e, t, i);
                    break;
                case l.DownloadKernel.TaskType.Emule:
                    n = this.queryEmuleTaskInfo(e, t, i);
                    break;
                case l.DownloadKernel.TaskType.Group:
                    n = this.queryGroupTaskInfo(e, t, i);
                    break;
                case l.DownloadKernel.TaskType.Magnet:
                    n = this.queryMagnetTaskInfo(e, t, i)
            }
            return n
        }

        updateTaskInfo(e, t, i) {
            let n = 0, a = l.DownloadKernel.TaskDetailChangedFlags.UnKnown, o = 0, r = 0;
            if (this.attribute.get(l.DownloadKernel.TaskAttribute.ErrorCode) === l.DownloadKernel.TaskError.DownloadSDKCrash) return n;
            if (0 === e.virtualId) return a |= e.taskError, this.updateTaskStatus(l.DownloadKernel.TaskStatus.Failed), n |= 1, t(this), n |= 2, this.detailChangedFlags = a, i(this, a), n;
            if (void 0 !== e.originalName && "" !== e.originalName && this.setTaskAttribute(l.DownloadKernel.TaskAttribute.OriginName, e.originalName) && (a |= l.DownloadKernel.TaskDetailChangedFlags.OriginName), void 0 !== e.httpContentType && "" !== e.httpContentType && this.setTaskAttribute(l.DownloadKernel.TaskAttribute.HTTPContentType, e.httpContentType) && (a |= l.DownloadKernel.TaskDetailChangedFlags.HTTPContentType), void 0 !== e.finalName && "" !== e.finalName && this.setTaskAttribute(l.DownloadKernel.TaskAttribute.TaskName, e.finalName) && (a |= l.DownloadKernel.TaskDetailChangedFlags.TaskName), a |= this.updateDownloadSpeed(e.downloadSize), e.downloadSize) {
                let t = this.getTaskAttribute(l.DownloadKernel.TaskAttribute.DownloadSize);
                this.getTaskAttribute(l.DownloadKernel.TaskAttribute.FileSize) === e.fileSize && t > e.downloadSize || (o = e.downloadSize - t, this.setTaskAttribute(l.DownloadKernel.TaskAttribute.DownloadSize, e.downloadSize) && (a |= l.DownloadKernel.TaskDetailChangedFlags.DownloadSize))
            }
            if (this.setTaskAttribute(l.DownloadKernel.TaskAttribute.RealDownloadSize, e.downloadSize), "number" == typeof e.validDownloadSize) {
                let t = this.getTaskAttribute(l.DownloadKernel.TaskAttribute.ValidDownloadSize);
                r = e.validDownloadSize - t, t !== e.validDownloadSize && (this.setTaskAttribute(l.DownloadKernel.TaskAttribute.ValidDownloadSize, e.validDownloadSize), a |= l.DownloadKernel.TaskDetailChangedFlags.ValidDownloadSize)
            } else if ("number" == typeof e.downloadSize) {
                let t = this.getTaskAttribute(l.DownloadKernel.TaskAttribute.ValidDownloadSize);
                r = e.downloadSize - t, S.error("use download size to set valid size", this.getId()), this.setTaskAttribute(l.DownloadKernel.TaskAttribute.ValidDownloadSize, e.downloadSize)
            } else {
                let e = this.getTaskAttribute(l.DownloadKernel.TaskAttribute.ValidDownloadSize);
                e ? S.error("use old valid size. ", e, this.getId()) : (this.setTaskAttribute(l.DownloadKernel.TaskAttribute.ValidDownloadSize, 0), S.error("no download size and valid size, set it to 0", this.getId()))
            }
            e.receivedSize && this.setTaskAttribute(l.DownloadKernel.TaskAttribute.ReceivedSize, e.receivedSize) && (a |= l.DownloadKernel.TaskDetailChangedFlags.ReceivedSize), e.fileSize && this.setTaskAttribute(l.DownloadKernel.TaskAttribute.FileSize, e.fileSize) && (a |= l.DownloadKernel.TaskDetailChangedFlags.FileSize), this.setTaskAttribute(l.DownloadKernel.TaskAttribute.ErrorCode, e.taskError) && (a |= l.DownloadKernel.TaskDetailChangedFlags.ErrorCode), e.cid && "" !== e.cid && this.updateCid(e.cid) && (a |= l.DownloadKernel.TaskDetailChangedFlags.Cid), e.gcid && "" !== e.gcid && this.updateGcid(e.gcid) && (a |= l.DownloadKernel.TaskDetailChangedFlags.Gcid), "number" == typeof e.srcTotal && this.setTaskAttribute(l.DownloadKernel.TaskAttribute.SrcTotal, e.srcTotal) && (a |= l.DownloadKernel.TaskDetailChangedFlags.SrcTotal), "number" == typeof e.srcUsing && this.setTaskAttribute(l.DownloadKernel.TaskAttribute.SrcUsing, e.srcUsing) && (a |= l.DownloadKernel.TaskDetailChangedFlags.SrcUsing), e.taskStatus !== A.Error || e.taskError !== l.DownloadKernel.TaskError.FileCreate ? this.setTaskAttribute(l.DownloadKernel.TaskAttribute.FileCreated, 1) : this.setTaskAttribute(l.DownloadKernel.TaskAttribute.FileCreated, 0);
            let s = this.changeToDownloadKernelTaskStatus(e.taskStatus), d = this.updateTaskStatus(s),
                u = e.channelInfo;
            return u && this.updateChannelInfo(u, r, o) && (a |= l.DownloadKernel.TaskDetailChangedFlags.ChannelInfo), d && (n |= 1, t(this)), this.detailChangedFlags = a, a !== l.DownloadKernel.TaskDetailChangedFlags.UnKnown && (n |= 2, i(this, a)), "number" == typeof e.totalAvailablePeer && (this.nTotalAvailablePeer = e.totalAvailablePeer), n
        }

        updateCid(e) {
            let t = !1, i = this.attribute.get(l.DownloadKernel.TaskAttribute.Cid);
            return i && "" !== i || (i !== e && (this.saveAttribute(l.DownloadKernel.TaskAttribute.Cid, e), t = !0), "0000000000000000000000000000000000000000" === e ? this.attribute.set(l.DownloadKernel.TaskAttribute.Cid, "") : this.attribute.set(l.DownloadKernel.TaskAttribute.Cid, e)), t
        }

        updateGcid(e) {
            let t = !1, i = this.attribute.get(l.DownloadKernel.TaskAttribute.Gcid);
            return i && "" !== i || (i !== e && (this.saveAttribute(l.DownloadKernel.TaskAttribute.Gcid, e), t = !0), "0000000000000000000000000000000000000000" === e ? this.attribute.set(l.DownloadKernel.TaskAttribute.Gcid, "") : this.attribute.set(l.DownloadKernel.TaskAttribute.Gcid, e)), t
        }

        onFinish() {
            let e = this.updateTaskStatus(l.DownloadKernel.TaskStatus.Succeeded);
            return this.setTaskAttribute(l.DownloadKernel.TaskAttribute.CompletionTime, (new Date).getTime()), this.virtualTaskId > 0 && (d.ThunderKernel.deleteTask(this.virtualTaskId), this.virtualTaskId = 0, this.attribute.set(l.DownloadKernel.TaskAttribute.VirtualId, this.virtualTaskId)), e
        }

        onStop() {
            let e = this.updateTaskStatus(l.DownloadKernel.TaskStatus.Stopped);
            return this.virtualTaskId > 0 && (d.ThunderKernel.deleteTask(this.virtualTaskId), this.virtualTaskId = 0, this.attribute.set(l.DownloadKernel.TaskAttribute.VirtualId, this.virtualTaskId)), e
        }

        onFail() {
            let e = this.updateTaskStatus(l.DownloadKernel.TaskStatus.Failed);
            return this.virtualTaskId > 0 && (d.ThunderKernel.deleteTask(this.virtualTaskId), this.virtualTaskId = 0, this.attribute.set(l.DownloadKernel.TaskAttribute.VirtualId, this.virtualTaskId)), e
        }

        moveToRecycle() {
            let e = (new Date).getTime();
            return this.setTaskAttribute(l.DownloadKernel.TaskAttribute.RecycleTime, e)
        }

        recover() {
            return this.setTaskAttribute(l.DownloadKernel.TaskAttribute.RecycleTime, 0)
        }

        destroy() {
            return n(this, void 0, void 0, function* () {
                let e = !1;
                switch (this.taskType) {
                    case l.DownloadKernel.TaskType.P2sp:
                        e = yield this.deleteP2spTaskFile();
                        break;
                    case l.DownloadKernel.TaskType.Bt:
                        e = yield this.deleteBtTaskFile();
                        break;
                    case l.DownloadKernel.TaskType.Emule:
                        e = yield this.deleteEmuleTaskFile();
                        break;
                    case l.DownloadKernel.TaskType.Group:
                        e = yield this.deleteGroupTaskFile()
                }
                return e
            })
        }

        setSavePath(e) {
            this.taskStatus !== l.DownloadKernel.TaskStatus.StartPending && this.taskStatus !== l.DownloadKernel.TaskStatus.Started && this.setTaskAttribute(l.DownloadKernel.TaskAttribute.SavePath, e)
        }

        setCategoryViewId(e) {
            this.attribute.set(l.DownloadKernel.TaskAttribute.CategoryViewId, e)
        }

        getIsPrivate() {
            let e = this.attribute.get(l.DownloadKernel.TaskAttribute.CategoryId);
            return !!(void 0 !== e && e > -1 && I.isPrivateCategory(e))
        }

        getUserName() {
            let e = this.attribute.get(l.DownloadKernel.TaskAttribute.CategoryId);
            if (void 0 !== e && e > -1) {
                let t = I.getCategoryFromId(e);
                if (t) return t.getUserName()
            }
            return ""
        }

        setCategoryId(e) {
            this.isBackground || (this.setTaskAttribute(l.DownloadKernel.TaskAttribute.CategoryId, e), d.ThunderKernel.setCategoryId(e, this.taskId))
        }

        getTaskName() {
            return this.attribute.get(l.DownloadKernel.TaskAttribute.TaskName)
        }

        getSavePath() {
            return this.attribute.get(l.DownloadKernel.TaskAttribute.SavePath)
        }

        fireTaskDetailChanged(e) {
            this.detailChangedFlags = e;
            let t = this.attribute.get(l.DownloadKernel.TaskAttribute.GroupTaskId);
            if (t > 0) {
                let e = new Map;
                e.set(t, [this]), b.fireTaskEvent(l.DownloadKernel.TaskEventType.GroupTaskSubFileDetailChanged, e)
            } else this.fireTaskEvent(l.DownloadKernel.TaskEventType.DetailChanged, e)
        }

        getVirtualTaskId() {
            return this.virtualTaskId
        }

        setStopReason(e) {
            this.taskStatusChangedReason = e
        }

        getStopReason() {
            return this.taskStatusChangedReason
        }

        internalSetTaskSpeed(e, t) {
            let i = !1;
            return e = Math.round(e), t = Math.round(t), this.speed !== e && (i = !0, this.speed = e), this.vipSpeed !== t && (i = !0, this.vipSpeed = t), i
        }

        internalSetFileSize(e) {
            return this.setTaskAttribute(l.DownloadKernel.TaskAttribute.FileSize, e)
        }

        internalSetGcid(e) {
            return this.setTaskAttribute(l.DownloadKernel.TaskAttribute.Gcid, e)
        }

        internalSetDownloadingPeriod(e) {
            return this.setTaskAttribute(l.DownloadKernel.TaskAttribute.DownloadingPeriod, e)
        }

        internalSetDownloadSize(e) {
            return this.setTaskAttribute(l.DownloadKernel.TaskAttribute.DownloadSize, e)
        }

        internalSetReceivedSize(e) {
            return this.setTaskAttribute(l.DownloadKernel.TaskAttribute.ReceivedSize, e)
        }

        internalSetSrcUsing(e) {
            return this.setTaskAttribute(l.DownloadKernel.TaskAttribute.SrcUsing, e)
        }

        internalSetSrcTotal(e) {
            return this.setTaskAttribute(l.DownloadKernel.TaskAttribute.SrcTotal, e)
        }

        internalSetFileIndex(e) {
            return this.setTaskAttribute(l.DownloadKernel.TaskAttribute.FileIndex, e)
        }

        internalSetTaskChannelInfo(e) {
            return (this.channelInfo.originSize !== e.originSize || this.channelInfo.p2sSize !== e.p2sSize || this.channelInfo.p2pSize !== e.p2pSize || this.channelInfo.offlineSize !== e.offlineSize || this.channelInfo.dcdnSize !== e.dcdnSize || this.channelInfo.dcdnStatus !== e.dcdnStatus) && (this.channelInfo = e, this.taskType === l.DownloadKernel.TaskType.Group && (this.historyChannelInfo = {
                originSize: 0,
                p2pSize: 0,
                p2sSize: 0,
                offlineSize: 0,
                dcdnSize: 0
            }), d.ThunderKernel.saveTaskChannelInfo(this.taskId, e.originSize, e.p2pSize, e.p2sSize, e.offlineSize, e.dcdnSize), !0)
        }

        internalSetTotalDownloadSize(e) {
            return this.setTaskAttribute(l.DownloadKernel.TaskAttribute.TotalDownloadSize, e)
        }

        setFileSize(e) {
            let t = this.internalSetFileSize(e);
            return t && (this.batchSetTaskAttribute ? this.batchDetailChangedFlags |= l.DownloadKernel.TaskDetailChangedFlags.FileSize : this.fireTaskDetailChanged(l.DownloadKernel.TaskDetailChangedFlags.FileSize)), t
        }

        setGcid(e) {
            S.error("setGcid", e);
            let t = this.internalSetGcid(e);
            return t && (this.batchSetTaskAttribute ? this.batchDetailChangedFlags |= l.DownloadKernel.TaskDetailChangedFlags.Gcid : this.fireTaskDetailChanged(l.DownloadKernel.TaskDetailChangedFlags.Gcid)), t
        }

        setDownloadingPeriod(e) {
            let t = this.setTaskAttribute(l.DownloadKernel.TaskAttribute.DownloadingPeriod, e);
            return t && (this.batchSetTaskAttribute ? this.batchDetailChangedFlags |= l.DownloadKernel.TaskDetailChangedFlags.DownloadingPeriod : this.fireTaskDetailChanged(l.DownloadKernel.TaskDetailChangedFlags.DownloadingPeriod)), t
        }

        setDownloadSize(e) {
            let t = this.setTaskAttribute(l.DownloadKernel.TaskAttribute.DownloadSize, e);
            return t && (this.batchSetTaskAttribute ? this.batchDetailChangedFlags |= l.DownloadKernel.TaskDetailChangedFlags.DownloadSize : this.fireTaskDetailChanged(l.DownloadKernel.TaskDetailChangedFlags.DownloadSize)), t
        }

        setPlayPosition(e) {
            let t = this.setTaskAttribute(l.DownloadKernel.TaskAttribute.PlayPosition, e);
            return t && (this.batchSetTaskAttribute ? this.batchDetailChangedFlags |= l.DownloadKernel.TaskDetailChangedFlags.PlayPosition : this.fireTaskDetailChanged(l.DownloadKernel.TaskDetailChangedFlags.PlayPosition)), t
        }

        setDuration(e) {
            let t = this.setTaskAttribute(l.DownloadKernel.TaskAttribute.Duration, e);
            return t && (this.batchSetTaskAttribute ? this.batchDetailChangedFlags |= l.DownloadKernel.TaskDetailChangedFlags.Duration : this.fireTaskDetailChanged(l.DownloadKernel.TaskDetailChangedFlags.Duration)), t
        }

        addServer(e, t) {
            S.information("addServer fileIndex:", e, "serverResourceInfo:", t);
            let i = this.serverResourceInfos.get(e);
            i ? (S.information("update serverinfo", i, t), Object.assign(i, t)) : this.serverResourceInfos.set(e, t), this.virtualTaskId && this.virtualTaskId > 0 && d.ThunderKernel.addServer(this.virtualTaskId, e, t)
        }

        discardServer(e, t) {
            this.serverResourceInfos.delete(e), this.virtualTaskId && this.virtualTaskId > 0 && d.ThunderKernel.discardServer(this.virtualTaskId, e, t)
        }

        setReceivedSize(e) {
            let t = this.setTaskAttribute(l.DownloadKernel.TaskAttribute.ReceivedSize, e);
            return t && (this.batchSetTaskAttribute ? this.batchDetailChangedFlags |= l.DownloadKernel.TaskDetailChangedFlags.ReceivedSize : this.fireTaskDetailChanged(l.DownloadKernel.TaskDetailChangedFlags.ReceivedSize)), t
        }

        setSrcUsing(e) {
            let t = this.setTaskAttribute(l.DownloadKernel.TaskAttribute.SrcUsing, e);
            return t && (this.batchSetTaskAttribute ? this.batchDetailChangedFlags |= l.DownloadKernel.TaskDetailChangedFlags.SrcUsing : this.fireTaskDetailChanged(l.DownloadKernel.TaskDetailChangedFlags.SrcUsing)), t
        }

        setSrcTotal(e) {
            let t = this.setTaskAttribute(l.DownloadKernel.TaskAttribute.SrcTotal, e);
            return t && (this.batchSetTaskAttribute ? this.batchDetailChangedFlags |= l.DownloadKernel.TaskDetailChangedFlags.SrcTotal : this.fireTaskDetailChanged(l.DownloadKernel.TaskDetailChangedFlags.SrcTotal)), t
        }

        beginBatchSetTaskAttribute() {
            S.information("beginBatchSetTaskAttribute taskId:", this.taskId), this.batchSetTaskAttribute = !0
        }

        commitBatchSetTaskAttribute() {
            if (this.batchSetTaskAttribute && (this.batchSetTaskAttribute = !1, S.information("commitBatchSetTaskAttribute taskId:", this.taskId), this.batchDetailChangedFlags !== l.DownloadKernel.TaskDetailChangedFlags.UnKnown)) {
                let e = this.batchDetailChangedFlags;
                this.batchDetailChangedFlags = l.DownloadKernel.TaskDetailChangedFlags.UnKnown, this.fireTaskDetailChanged(e)
            }
        }

        createDownloadSdkTask() {
            return n(this, void 0, void 0, function* () {
                switch (this.taskType) {
                    case l.DownloadKernel.TaskType.P2sp: {
                        let e = this.attribute.get(l.DownloadKernel.TaskAttribute.TaskUrl),
                            t = this.attribute.get(l.DownloadKernel.TaskAttribute.RefUrl),
                            i = this.attribute.get(l.DownloadKernel.TaskAttribute.Cookie),
                            n = this.attribute.get(l.DownloadKernel.TaskAttribute.SavePath),
                            a = this.attribute.get(l.DownloadKernel.TaskAttribute.TaskName);
                        this.virtualTaskId = d.ThunderKernel.createP2spTask(e, t, i, n, a), S.information("createP2spTask virtualTaskId:", this.virtualTaskId, ", url:", e, ", refUrl: ", t, ", cookie:", i, ", savePath:", n, ", fileName:", a)
                    }
                        break;
                    case l.DownloadKernel.TaskType.Bt: {
                        let e = this.getExtraObject(), t = this.attribute.get(l.DownloadKernel.TaskAttribute.SavePath),
                            i = this.attribute.get(l.DownloadKernel.TaskAttribute.TaskName);
                        (yield k.SingleBtTaskNS.isSingleBtTask(this)) || 1 === e.getFileCount() && (yield k.SingleBtTaskNS.getCorrectSingleBtFolder(this)) || (t = a.join(t, i)), e.isBtFileLoadEnd() || (yield this.loadStorageBtTaskAW(this.getTaskBaseInfo()));
                        let n = e.getSeedFilePath();
                        if (!(yield s.FileSystemAWNS.existsAW(n))) {
                            this.attribute.set(l.DownloadKernel.TaskAttribute.ErrorCode, l.DownloadKernel.TaskError.torrentFileNotExist);
                            break
                        }
                        let o = e.getDownloadFile();
                        this.virtualTaskId = d.ThunderKernel.createBtTask(n, t, o), S.information("createBtTask virtualTaskId:", this.virtualTaskId, ", torrentFilePath:", n, ", savePath: ", t, ", downloadIndexs:", o)
                    }
                        break;
                    case l.DownloadKernel.TaskType.Emule: {
                        let e = this.attribute.get(l.DownloadKernel.TaskAttribute.TaskUrl),
                            t = this.attribute.get(l.DownloadKernel.TaskAttribute.SavePath),
                            i = this.attribute.get(l.DownloadKernel.TaskAttribute.TaskName);
                        this.virtualTaskId = d.ThunderKernel.createEmuleTask(e, t, i), S.information("createEmuleTask virtualTaskId:", this.virtualTaskId, ", url:", e, ", savePath: ", t, ", fileName:", i)
                    }
                        break;
                    case l.DownloadKernel.TaskType.Magnet: {
                        let e = this.attribute.get(l.DownloadKernel.TaskAttribute.TaskUrl),
                            t = this.attribute.get(l.DownloadKernel.TaskAttribute.SavePath);
                        this.virtualTaskId = d.ThunderKernel.createMagnetTask(e, t), S.information("createMagnetTask virtualTaskId:", this.virtualTaskId, ", url:", e, ", savePath: ", t)
                    }
                }
                return S.information("createDownloadSdkTask virtualTaskId:", this.virtualTaskId), this.attribute.set(l.DownloadKernel.TaskAttribute.VirtualId, this.virtualTaskId), this.setStartInfo(), this.virtualTaskId
            })
        }

        setStatusAndErrorCode(e, t) {
            this.taskStatus = e, this.attribute.set(l.DownloadKernel.TaskAttribute.ErrorCode, t)
        }

        setStartInfo() {
            if (this.virtualTaskId && this.virtualTaskId > 0) {
                if (this.taskType === l.DownloadKernel.TaskType.P2sp) {
                    let e = this.getExtraObject(), t = e.getThreadCount();
                    void 0 !== this.originOnlyStrategy && e.setUseOriginOnly(this.originOnlyStrategy), 1 === this.originOnlyStrategy ? d.ThunderKernel.setTaskStrategy(this.virtualTaskId, 1) : void 0 !== this.dispatchStrategy && d.ThunderKernel.setTaskStrategy(this.virtualTaskId, this.dispatchStrategy), void 0 !== this.originThreadCount ? d.ThunderKernel.setTaskThreadCount(this.virtualTaskId, this.originThreadCount) : d.ThunderKernel.setTaskThreadCount(this.virtualTaskId, t)
                } else if (void 0 !== this.dispatchStrategy && d.ThunderKernel.setTaskStrategy(this.virtualTaskId, this.dispatchStrategy), this.taskType === l.DownloadKernel.TaskType.Bt) {
                    let e = y.BTExtraTrackNS.getExtraTracks();
                    e.length > 0 && d.ThunderKernel.setBTExtraTrackers(this.virtualTaskId, e)
                }
                this.setTaskExtInfoBeforeStart(), this.addHttpHeaderFieldBeforeStart(), this.taskExtra && this.taskExtra.setTaskPriorityLevel(-1), this.serverResourceInfos.forEach((e, t) => {
                    d.ThunderKernel.addServer(this.virtualTaskId, t, e)
                }), d.ThunderKernel.startTask(this.virtualTaskId), void 0 !== this.vipCert && d.ThunderKernel.enableDcdnWithVipCert(this.virtualTaskId, this.dcdnFileIndex, this.vipCert)
            } else S.error("setStartInfo failed! virtualTaskId:", this.virtualTaskId)
        }

        queryP2spTaskInfo(e, t, i) {
            let n = !1;
            return this.virtualTaskId && this.virtualTaskId > 0 && (n = d.ThunderKernel.queryTaskInfo(this.virtualTaskId, n => {
                null !== n && this.updateTaskInfo(n, e, t), i()
            })), n
        }

        queryBtTaskInfo(e, t, i) {
            let n = !1;
            if (this.virtualTaskId && this.virtualTaskId > 0) n = d.ThunderKernel.queryBtTaskInfo(this.virtualTaskId, n => {
                null !== n && (this.updateTaskInfo(n, e, t), this.getExtraObject().updateSubFileInfo(n.fileLists)), i()
            }); else if (0 === this.virtualTaskId && this.attribute.get(l.DownloadKernel.TaskAttribute.ErrorCode) === l.DownloadKernel.TaskError.torrentFileNotExist) {
                let n = {virtualId: 0, taskError: l.DownloadKernel.TaskError.torrentFileNotExist};
                this.updateTaskInfo(n, e, t), i()
            }
            return n
        }

        queryEmuleTaskInfo(e, t, i) {
            let n = !1;
            return this.virtualTaskId && this.virtualTaskId > 0 && (n = d.ThunderKernel.queryTaskInfo(this.virtualTaskId, n => {
                null !== n && this.updateTaskInfo(n, e, t), i()
            })), n
        }

        queryGroupTaskInfo(e, t, i) {
            let n = !1;
            return this.taskExtra && (n = this.getExtraObject().querySubTaskInfo(e, t, i)), n
        }

        queryMagnetTaskInfo(e, t, i) {
            let n = !1;
            return this.virtualTaskId && this.virtualTaskId > 0 && (n = d.ThunderKernel.queryTaskInfo(this.virtualTaskId, n => {
                null !== n && this.updateTaskInfo(n, e, t), i()
            })), n
        }

        setTaskBaseInfo(e) {
            e && (this.taskId = e.taskId, this.taskType = e.taskType, this.taskStatus = e.taskStatus, this.attribute.set(l.DownloadKernel.TaskAttribute.TaskId, e.taskId), this.attribute.set(l.DownloadKernel.TaskAttribute.TaskType, e.taskType), this.attribute.set(l.DownloadKernel.TaskAttribute.FileCreated, e.fileCreated), this.attribute.set(l.DownloadKernel.TaskAttribute.RecycleTime, e.recycleTime), this.attribute.set(l.DownloadKernel.TaskAttribute.Forbidden, e.forbidden), this.attribute.set(l.DownloadKernel.TaskAttribute.FileSize, e.fileSize), this.attribute.set(l.DownloadKernel.TaskAttribute.ReceivedSize, e.receiveSize), this.attribute.set(l.DownloadKernel.TaskAttribute.DownloadSize, e.downloadSize), this.attribute.set(l.DownloadKernel.TaskAttribute.CreateTime, e.createTime), this.attribute.set(l.DownloadKernel.TaskAttribute.CompletionTime, e.completionTime), this.attribute.set(l.DownloadKernel.TaskAttribute.DownloadingPeriod, e.downloadingPeriod), this.attribute.set(l.DownloadKernel.TaskAttribute.ErrorCode, e.errorCode), this.attribute.set(l.DownloadKernel.TaskAttribute.NameType, e.nameType), this.attribute.set(l.DownloadKernel.TaskAttribute.CategoryId, e.categoryId), this.attribute.set(l.DownloadKernel.TaskAttribute.UserRead, e.userRead), this.attribute.set(l.DownloadKernel.TaskAttribute.OpenOnComplete, e.openOnComplete), this.attribute.set(l.DownloadKernel.TaskAttribute.OwnerProduct, e.ownerProduct), this.attribute.set(l.DownloadKernel.TaskAttribute.DownloadSubTask, e.downloadSubTask), this.attribute.set(l.DownloadKernel.TaskAttribute.GroupTaskId, e.groupTaskId), this.attribute.set(l.DownloadKernel.TaskAttribute.TaskName, e.taskName), this.attribute.set(l.DownloadKernel.TaskAttribute.SavePath, e.savePath), this.attribute.set(l.DownloadKernel.TaskAttribute.TaskUrl, e.url), this.attribute.set(l.DownloadKernel.TaskAttribute.RefUrl, e.refUrl), this.attribute.set(l.DownloadKernel.TaskAttribute.Description, e.description), this.attribute.set(l.DownloadKernel.TaskAttribute.ProductInfo, e.productInfo), this.attribute.set(l.DownloadKernel.TaskAttribute.Origin, e.origin), this.attribute.set(l.DownloadKernel.TaskAttribute.UserData, e.userData), this.attribute.set(l.DownloadKernel.TaskAttribute.PlayPosition, e.playPosition), this.attribute.set(l.DownloadKernel.TaskAttribute.Duration, e.duration), "0000000000000000000000000000000000000000" === e.cid ? this.attribute.set(l.DownloadKernel.TaskAttribute.Cid, "") : this.attribute.set(l.DownloadKernel.TaskAttribute.Cid, e.cid), "0000000000000000000000000000000000000000" === e.gcid ? this.attribute.set(l.DownloadKernel.TaskAttribute.Gcid, "") : this.attribute.set(l.DownloadKernel.TaskAttribute.Gcid, e.gcid), e.channelInfo && (this.historyChannelInfo = e.channelInfo))
        }

        setTaskAttribute(e, t) {
            let i = !1;
            return this.getTaskAttribute(e) !== t && void 0 !== t && (this.attribute.set(e, t), i = !0, this.saveAttribute(e, t)), i
        }

        updateDownloadSpeed(e) {
            let t = l.DownloadKernel.TaskDetailChangedFlags.UnKnown;
            if (e) {
                let i = e - this.getTaskAttribute(l.DownloadKernel.TaskAttribute.DownloadSize);
                (0 === e || i < 0) && (i = 0);
                let n = this.calculateDownloadSpeed(i);
                (n = Math.round(n)) !== this.speed && (this.speed = n, t |= l.DownloadKernel.TaskDetailChangedFlags.TaskSpeed)
            }
            if (this.taskStatus === l.DownloadKernel.TaskStatus.Started) if (0 === this.startTime) this.startTime = (new Date).getTime(); else {
                let e = ((new Date).getTime() - this.startTime) / 1e3, i = this.downloadingPeriod + Math.round(e);
                this.saveAttribute(l.DownloadKernel.TaskAttribute.DownloadingPeriod, i), this.attribute.set(l.DownloadKernel.TaskAttribute.DownloadingPeriod, i), this.attribute.get(l.DownloadKernel.TaskAttribute.GroupTaskId) < 1 && (t |= l.DownloadKernel.TaskDetailChangedFlags.DownloadingPeriod)
            }
            return t
        }

        saveAttribute(e, t) {
            switch (e) {
                case l.DownloadKernel.TaskAttribute.TaskName:
                    this.saveTaskInfo(this.taskId, g.StatementType.SetTaskName, g.ValueType.ValueString, t);
                    break;
                case l.DownloadKernel.TaskAttribute.SavePath:
                    this.saveTaskInfo(this.taskId, g.StatementType.SetTaskSavePath, g.ValueType.ValueString, t);
                    break;
                case l.DownloadKernel.TaskAttribute.ReceivedSize:
                    this.saveTaskInfo(this.taskId, g.StatementType.SetTaskReceiveSize, g.ValueType.ValueBigint, t);
                    break;
                case l.DownloadKernel.TaskAttribute.DownloadSize:
                    this.saveTaskInfo(this.taskId, g.StatementType.SetTaskDownloadSize, g.ValueType.ValueBigint, t);
                    break;
                case l.DownloadKernel.TaskAttribute.FileSize:
                    this.saveTaskInfo(this.taskId, g.StatementType.SetTaskFileSize, g.ValueType.ValueBigint, t);
                    break;
                case l.DownloadKernel.TaskAttribute.RecycleTime:
                    this.saveTaskInfo(this.taskId, g.StatementType.SetTaskRemovingToRecycleTime, g.ValueType.ValueBigint, t);
                    break;
                case l.DownloadKernel.TaskAttribute.FileCreated:
                    this.saveTaskInfo(this.taskId, g.StatementType.SetTaskFileCreated, g.ValueType.ValueInt, t);
                    break;
                case l.DownloadKernel.TaskAttribute.CompletionTime:
                    this.saveTaskInfo(this.taskId, g.StatementType.SetTaskCompletionTime, g.ValueType.ValueBigint, t);
                    break;
                case l.DownloadKernel.TaskAttribute.DownloadingPeriod:
                    this.saveTaskInfo(this.taskId, g.StatementType.SetTaskDownloadingPeriod, g.ValueType.ValueBigint, t);
                    break;
                case l.DownloadKernel.TaskAttribute.ErrorCode:
                    this.saveTaskInfo(this.taskId, g.StatementType.SetTaskFailureErrorCode, g.ValueType.ValueInt, t);
                    break;
                case l.DownloadKernel.TaskAttribute.Cid:
                    this.saveTaskInfo(this.taskId, g.StatementType.SetTaskCid, g.ValueType.ValueBlob, t);
                    break;
                case l.DownloadKernel.TaskAttribute.Gcid:
                    this.saveTaskInfo(this.taskId, g.StatementType.SetTaskGcid, g.ValueType.ValueBlob, t);
                    break;
                case l.DownloadKernel.TaskAttribute.DownloadSubTask:
                    this.saveTaskInfo(this.taskId, g.StatementType.SetTaskDownload, g.ValueType.ValueInt, t);
                    break;
                case l.DownloadKernel.TaskAttribute.PlayPosition:
                    this.saveTaskInfo(this.taskId, g.StatementType.SetTaskPlayPosition, g.ValueType.ValueInt, t);
                    break;
                case l.DownloadKernel.TaskAttribute.Duration:
                    this.saveTaskInfo(this.taskId, g.StatementType.SetTaskDuration, g.ValueType.ValueInt, t);
                    break;
                case l.DownloadKernel.TaskAttribute.YunTaskId:
                    this.saveTaskInfo(this.taskId, g.StatementType.SetYunTaskId, g.ValueType.ValueString, t)
            }
        }

        insertStorageTaskBase() {
            let e = this.getTaskBaseInfo();
            d.ThunderKernel.insertTaskBase(e)
        }

        deleteStorageTask() {
            d.ThunderKernel.deleteStorageTask(this.taskId, g.StatementType.DestroyTaskBase);
            let e = g.StatementType.StatementBengin;
            switch (this.taskType) {
                case l.DownloadKernel.TaskType.P2sp:
                    e = g.StatementType.DestroyP2spTask;
                    break;
                case l.DownloadKernel.TaskType.Bt:
                    e = g.StatementType.DestroyBtTask, this.getExtraObject().deleteStorageBtFile();
                    break;
                case l.DownloadKernel.TaskType.Emule:
                    e = g.StatementType.DestroyEmuleTask;
                    break;
                case l.DownloadKernel.TaskType.Group:
                    e = g.StatementType.DestroyGroupTask, this.getExtraObject().deleteStorageTask();
                    break;
                case l.DownloadKernel.TaskType.Magnet:
                    e = g.StatementType.DestroyMagnetTask
            }
            e !== g.StatementType.StatementBengin && d.ThunderKernel.deleteStorageTask(this.taskId, e)
        }

        saveTaskInfo(e, t, i, n) {
            this.isBackground || d.ThunderKernel.saveTaskBaseInfo(e, t, i, n)
        }

        shiftChannelInfo(e, t) {
            e.p2pSize += t, e.dcdnSize -= t, e.dcdnSize < 0 && (e.dcdnSize = 0, e.offlineSize -= t - e.dcdnSize, e.offlineSize = e.offlineSize > 0 ? e.offlineSize : 0)
        }

        updateChannelInfo(e, t = 0, i = 0) {
            let n = !1;
            if (this.shiftChannelInfo(e, this.shiftChannelSize), 0 === i || 0 === t) return !1;
            if ((this.channelInfo.originSize !== e.originSize || this.channelInfo.p2sSize !== e.p2sSize || this.channelInfo.p2pSize !== e.p2pSize || this.channelInfo.offlineSize !== e.offlineSize || this.channelInfo.dcdnSize !== e.dcdnSize || this.channelInfo.dcdnStatus !== e.dcdnStatus) && (n = !0, e.offlineSize > 0 || e.dcdnSize > 0)) {
                let t = e.offlineSize - this.channelInfo.offlineSize + (e.dcdnSize - this.channelInfo.dcdnSize);
                t > 0 && !this.bAcclerating && (this.shiftChannelInfo(e, t), this.shiftChannelSize += t), (t < 0 || !this.bAcclerating) && (t = 0), this.vipDownloadSizeCur += t;
                let i = this.calculateVipSpeed(t);
                i = Math.round(i), this.vipSpeed !== i && (this.vipSpeed = i)
            }
            let a = !1, o = e.dcdnStatus;
            if (this.channelInfo.dcdnStatus !== o && (a = !0), this.taskStatus === l.DownloadKernel.TaskStatus.Stopped || this.taskStatus === l.DownloadKernel.TaskStatus.Succeeded || this.taskStatus === l.DownloadKernel.TaskStatus.Seeding) {
                this.channelInfo = {
                    originSize: 0,
                    p2pSize: 0,
                    p2sSize: 0,
                    offlineSize: 0,
                    dcdnSize: 0
                }, this.shiftChannelSize = 0;
                let t = this.historyChannelInfo.originSize + e.originSize,
                    i = this.historyChannelInfo.p2pSize + e.p2pSize, n = this.historyChannelInfo.p2sSize + e.p2sSize,
                    a = this.historyChannelInfo.offlineSize + e.offlineSize,
                    o = this.historyChannelInfo.dcdnSize + e.dcdnSize;
                this.historyChannelInfo = {originSize: t, p2pSize: i, p2sSize: n, offlineSize: a, dcdnSize: o}
            } else this.channelInfo = e;
            return n && this.saveChannelInfo(), a && this.fireTaskEvent(l.DownloadKernel.TaskEventType.DcdnStatusChanged), n
        }

        saveChannelInfo() {
            let e = this.getTaskChannelInfo();
            d.ThunderKernel.saveTaskChannelInfo(this.taskId, e.originSize, e.p2pSize, e.p2sSize, e.offlineSize, e.dcdnSize)
        }

        shareDeleteFile(e) {
            return n(this, void 0, void 0, function* () {
                return new Promise(t => {
                    0 !== _.asynDeleteFile(e, (e, i) => {
                        t(e)
                    }) && t(!1)
                })
            })
        }

        deleteP2spTaskFile() {
            return n(this, void 0, void 0, function* () {
                let e = !0, t = this.attribute.get(l.DownloadKernel.TaskAttribute.SavePath),
                    i = this.attribute.get(l.DownloadKernel.TaskAttribute.TaskName), n = a.join(t, i);
                if (this.taskStatus === l.DownloadKernel.TaskStatus.Succeeded || this.taskStatus === l.DownloadKernel.TaskStatus.Seeding || this.taskStatus === l.DownloadKernel.TaskStatus.DestroyPending && this.preStatus === l.DownloadKernel.TaskStatus.Succeeded || this.preStatus === l.DownloadKernel.TaskStatus.Seeding) (yield s.FileSystemAWNS.existsAW(n)) && (e = yield this.shareDeleteFile(n)); else {
                    let t = n + ".xltd", i = n + ".xltd.cfg";
                    (yield s.FileSystemAWNS.existsAW(t)) && (e = yield this.shareDeleteFile(t)), (yield s.FileSystemAWNS.existsAW(i)) && (e = (yield this.shareDeleteFile(i)) && e)
                }
                return e
            })
        }

        deleteBtTaskFile() {
            return n(this, void 0, void 0, function* () {
                function e(e, t) {
                    return n(this, void 0, void 0, function* () {
                        let i = a.normalize(a.join(t, e));
                        "\\" === (t = a.normalize(t))[t.length - 1] && (t = t.slice(0, t.length - 1));
                        let n = i;
                        for (; n !== t && (!(yield s.FileSystemAWNS.existsAW(n)) || (yield s.FileSystemAWNS.rmdirAW(n)));) n = a.dirname(n)
                    })
                }

                let t = this.attribute.get(l.DownloadKernel.TaskAttribute.SavePath),
                    i = this.attribute.get(l.DownloadKernel.TaskAttribute.TaskName),
                    o = a.join(__profilesDir, "Torrents"), r = this.getExtraObject().getInfoId(), d = r + ".xlbt.cfg",
                    u = r + ".xlbt.dat", c = r + ".torrent", h = a.join(t, i), f = a.join(o, d), g = a.join(o, u),
                    p = !0;
                if (yield k.SingleBtTaskNS.isSingleBtTask(this)) yield this.deleteSingleBtTaskFile(); else if (yield s.FileSystemAWNS.existsAW(h)) {
                    let e = a.join(h, c);
                    (yield s.FileSystemAWNS.existsAW(e)) && (p = (yield this.shareDeleteFile(e)) && p), p = (yield this.deleteBtSubFile()) && p
                } else do {
                    let i = this.getExtraObject();
                    if (1 !== i.getFileCount()) break;
                    let n = a.join(t, c);
                    (yield s.FileSystemAWNS.existsAW(n)) && (p = (yield this.shareDeleteFile(n)) && p);
                    let o = i.getBtFileList(), r = void 0, d = void 0;
                    for (let [, e]of o) {
                        r = e.getBtFileAttribute(l.DownloadKernel.BtFileAttribute.FilePath), d = e.getBtFileAttribute(l.DownloadKernel.BtFileAttribute.FileName);
                        break
                    }
                    if (!r || !d) break;
                    let u = a.join(t, r);
                    if (!(yield s.FileSystemAWNS.dirExistsAW(u))) break;
                    let h = a.join(u, d);
                    (yield s.FileSystemAWNS.existsAW(h)) ? p = (yield this.shareDeleteFile(h)) && p : (h += ".bt.xltd", (yield s.FileSystemAWNS.existsAW(h)) && (p = (yield this.shareDeleteFile(h)) && p)), yield e(r, t)
                } while (0);
                return (yield s.FileSystemAWNS.existsAW(f)) && (p = (yield this.shareDeleteFile(f)) && p), (yield s.FileSystemAWNS.existsAW(g)) && (p = (yield this.shareDeleteFile(g)) && p), p
            })
        }

        deleteBtSubFile() {
            return n(this, void 0, void 0, function* () {
                let e = !0, t = this.getExtraObject().getBtFileInfoList();
                if (t.length > 0) {
                    let i = this.attribute.get(l.DownloadKernel.TaskAttribute.SavePath),
                        n = this.attribute.get(l.DownloadKernel.TaskAttribute.TaskName), o = a.join(i, n), r = [o];
                    for (let i = 0; i < t.length; ++i) {
                        let n = t[i], l = a.join(o, n.filePath);
                        if (!(yield s.FileSystemAWNS.existsAW(l))) continue;
                        let d = a.join(l, n.fileName);
                        for ((yield s.FileSystemAWNS.existsAW(d)) ? e = (yield this.shareDeleteFile(d)) && e : (d += ".bt.xltd", (yield s.FileSystemAWNS.existsAW(d)) && (e = (yield this.shareDeleteFile(d)) && e)); l.length > o.length && !r.includes(l);) r = r.concat([l]), l = a.parse(l).dir
                    }
                    r.sort((e, t) => e.length > t.length ? -1 : e.length < t.length ? 1 : 0), S.information("task.deleteBtSubFile savePaths:", r);
                    for (let e = 0; e < r.length; ++e) {
                        let t = r[e];
                        (yield s.FileSystemAWNS.existsAW(t)) && (yield s.FileSystemAWNS.rmdirAW(t))
                    }
                }
                return e
            })
        }

        deleteEmuleTaskFile() {
            return n(this, void 0, void 0, function* () {
                let e = !0, t = this.attribute.get(l.DownloadKernel.TaskAttribute.SavePath),
                    i = this.attribute.get(l.DownloadKernel.TaskAttribute.TaskName), n = a.join(t, i);
                if (this.taskStatus === l.DownloadKernel.TaskStatus.Succeeded || this.taskStatus === l.DownloadKernel.TaskStatus.Seeding || this.taskStatus === l.DownloadKernel.TaskStatus.DestroyPending && this.preStatus === l.DownloadKernel.TaskStatus.Succeeded || this.preStatus === l.DownloadKernel.TaskStatus.Seeding) (yield s.FileSystemAWNS.existsAW(n)) && (e = yield this.shareDeleteFile(n)); else {
                    let t = n + ".emule.xltd", i = n + ".xlemule.cfg";
                    (yield s.FileSystemAWNS.existsAW(t)) && (e = yield this.shareDeleteFile(t)), (yield s.FileSystemAWNS.existsAW(i)) && (e = (yield this.shareDeleteFile(i)) && e)
                }
                return e
            })
        }

        deleteGroupTaskFile() {
            return n(this, void 0, void 0, function* () {
                return yield this.getExtraObject().destroy()
            })
        }

        deleteSingleBtTaskFile() {
            return n(this, void 0, void 0, function* () {
                let e = k.SingleBtTaskNS.getSinleBtTaskFilePath(this);
                if (this.preStatus !== l.DownloadKernel.TaskStatus.Failed && (yield s.FileSystemAWNS.existsAW(e))) yield this.shareDeleteFile(e); else {
                    let t = e + ".bt.xltd";
                    (yield s.FileSystemAWNS.existsAW(t)) ? yield this.shareDeleteFile(t) : (t = e + ".bt.td", yield this.shareDeleteFile(t))
                }
                let t = this.getExtraObject().getInfoId(), i = this.getSavePath(), n = t + ".torrent", o = a.join(i, n);
                yield this.shareDeleteFile(o)
            })
        }

        fireTaskEvent(e, ...t) {
            b.fireTaskEvent(e, [this], ...t)
        }

        getDetailChangedFlags() {
            return this.detailChangedFlags
        }

        isVideoFile() {
            let e = !1;
            do {
                let t = "";
                if (this.taskType === l.DownloadKernel.TaskType.P2sp || this.taskType === l.DownloadKernel.TaskType.Emule) t = this.attribute.get(l.DownloadKernel.TaskAttribute.TaskName), e = w.TaskUtilHelper.isVideoFileExt(t); else if (this.taskType === l.DownloadKernel.TaskType.Bt) {
                    let t = this.getExtraObject();
                    if (t.getDownloadFile().length <= 0) break;
                    let i = t.getBtFileList();
                    for (let [, t]of i) {
                        let i = t.getBtFileAttribute(l.DownloadKernel.BtFileAttribute.Download),
                            n = t.getBtFileAttribute(l.DownloadKernel.BtFileAttribute.FileName);
                        if (1 === i && (e = w.TaskUtilHelper.isVideoFileExt(n))) break
                    }
                } else if (this.taskType === l.DownloadKernel.TaskType.Group) {
                    let t = this.getExtraObject();
                    if (null !== t && void 0 !== t) {
                        let i = t.getSubTaskCount();
                        for (let n = 0; n < i; ++n) {
                            let i = t.getSubTaskByIndex(n),
                                a = i.getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskName);
                            if (1 === i.getTaskAttribute(l.DownloadKernel.TaskAttribute.DownloadSubTask) && (e = w.TaskUtilHelper.isVideoFileExt(a))) break
                        }
                    }
                }
            } while (0);
            return e
        }

        setTaskExtInfoBeforeStart() {
            if (this.virtualTaskId > 0) {
                let e = this.attribute.get(l.DownloadKernel.TaskAttribute.TaskId),
                    t = this.attribute.get(l.DownloadKernel.TaskAttribute.Origin);
                this.attribute.get(l.DownloadKernel.TaskAttribute.Background) && (t = "background");
                let i = "parentid=" + e.toString();
                i = i + ",taskorigin=" + t, d.ThunderKernel.setTaskExtInfo(this.virtualTaskId, i)
            }
        }

        addHttpHeaderFieldBeforeStart() {
            if (this.taskType === l.DownloadKernel.TaskType.P2sp && this.virtualTaskId > 0) {
                let e = "Authorization",
                    t = this.getExtraObject().getUserData(C.TaskUserDataGUID.guidHttpHeaderField, e);
                void 0 !== t && null !== t && d.ThunderKernel.addHttpHeaderField(this.virtualTaskId, e, t)
            }
        }

        calculateDownloadSpeed(e) {
            this.downloadSizeList.length > 5 && this.downloadSizeList.splice(0, 1), this.downloadSizeList.push(e);
            let t = 0;
            for (let e = 0; e < this.downloadSizeList.length; ++e) t += this.downloadSizeList[e];
            let i = t / this.downloadSizeList.length;
            return this.taskStatus !== l.DownloadKernel.TaskStatus.Started && (i = 0, this.downloadSizeList = []), i
        }

        calculateVipSpeed(e) {
            this.vipSizeList.length > 5 && this.vipSizeList.splice(0, 1), this.vipSizeList.push(e);
            let t = 0;
            for (let e = 0; e < this.vipSizeList.length; ++e) t += this.vipSizeList[e];
            let i = t / this.vipSizeList.length;
            return this.taskStatus !== l.DownloadKernel.TaskStatus.Started && (i = 0, this.vipSizeList = []), i
        }

        changeToDownloadKernelTaskStatus(e) {
            let t = this.taskStatus;
            switch (e) {
                case A.None:
                case A.Create:
                case A.StartPending:
                    break;
                case A.Downloading:
                case A.StopPending:
                case A.CompletePending:
                case A.ErrorStopPending:
                    t = l.DownloadKernel.TaskStatus.Started;
                    break;
                case A.Pause:
                    t = l.DownloadKernel.TaskStatus.Stopped;
                    break;
                case A.Complete:
                    t = l.DownloadKernel.TaskStatus.Succeeded;
                    break;
                case A.Error:
                    t = l.DownloadKernel.TaskStatus.Failed;
                    break;
                default:
                    t = l.DownloadKernel.TaskStatus.Unkown
            }
            return t
        }
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(3), a = i(31), o = i(86), r = i(108), s = i(4);
    t.P2spTask = class {
        constructor(e, t, i, l, d) {
            this.task = e, this.downloadSpeedLimit = 0, this.threadCount = l || 5, this.useOriginOnly = i || 0, s.isNumber(d) ? this.nameFixed = d : this.nameFixed = 0, this.taskId = this.task.getTaskAttribute(n.DownloadKernel.TaskAttribute.TaskId), this.cookie = this.task.getTaskAttribute(n.DownloadKernel.TaskAttribute.Cookie), this.displayUrl = this.task.getTaskAttribute(n.DownloadKernel.TaskAttribute.TaskUrl), t ? a.ThunderKernel.insertP2spTask(this.taskId, this.downloadSpeedLimit, this.nameFixed, this.useOriginOnly, this.threadCount, void 0 === this.cookie ? "" : this.cookie, this.displayUrl) : a.ThunderKernel.loadStorageTask(this.taskId, o.StatementType.LoadP2spTask, e => {
                0 !== e.taskId && (this.useOriginOnly = e.originOnly, this.threadCount = e.threadCount, this.downloadSpeedLimit = e.speedLimit, this.nameFixed = e.nameFixed, this.displayUrl = e.displayUrl, this.cookie = e.cookie, 1 === this.useOriginOnly && this.task.setDispatchStrategy(n.DownloadKernel.DispatchStrategy.DispatchStrategyOrigin))
            });
            let u = this.task.getTaskAttribute(n.DownloadKernel.TaskAttribute.UserData);
            this.userData = new r.TaskUserData(e, u)
        }

        getTask() {
            return this.task
        }

        setTaskPriorityLevel(e, t) {
            s.isNullOrUndefined(t) ? t = this.priority : this.priority = t;
            let i = this.task.getVirtualTaskId();
            i && i > 0 && !s.isNullOrUndefined(t) && a.ThunderKernel.setTaskPriorityLevel(i, e, t)
        }

        setUserData(e, t, i) {
            return this.userData.setUserData(e, t, i)
        }

        getUserData(e, t) {
            return this.userData.getUserData(e, t)
        }

        setAllUserData(e) {
            return this.userData.setAllUserData(e)
        }

        getAllUserData() {
            return this.userData.getAllUserData()
        }

        setUseOriginOnly(e) {
            e !== this.useOriginOnly && (this.useOriginOnly = e, a.ThunderKernel.setP2spTaskOriginOnly(this.taskId, e))
        }

        setOriginThreadCount(e) {
            e !== this.threadCount && (this.threadCount = e, a.ThunderKernel.setP2spTaskThreadCount(this.taskId, e))
        }

        getUseOriginOnly() {
            return this.useOriginOnly
        }

        getThreadCount() {
            return this.threadCount
        }

        getSpeedLimit() {
            return this.downloadSpeedLimit
        }

        getNameFixed() {
            return this.nameFixed
        }

        getDisplayUrl() {
            return this.displayUrl
        }

        getCookie() {
            return this.cookie
        }
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(4);
    !function (e) {
        let t;
        !function (e) {
            e[e.LowerBound = -1] = "LowerBound", e[e.Integer = 0] = "Integer", e[e.String = 1] = "String", e[e.List = 2] = "List", e[e.Map = 3] = "Map", e[e.UpperBound = 4] = "UpperBound"
        }(t = e.BencodeDataType || (e.BencodeDataType = {}));

        class i {
            constructor(e) {
                this.type = t.LowerBound, this.type = e
            }

            getType() {
                return this.type
            }
        }

        e.BencodeObject = i;

        class a extends i {
            constructor() {
                super(t.Integer), this.value = 0
            }

            getValue() {
                return this.value
            }

            setValue(e) {
                return this.value !== e && (this.value = e, !0)
            }

            decode(e) {
                if (e.length < 2 || "i" !== e[0]) return -1;
                this.value = 0;
                let t = 1;
                for ("-" === e[1] && t++; t < e.length; t++) {
                    if (!(e[t] >= "0" && e[t] <= "9")) return "e" === e[t] ? ("-" === e[1] && (this.value = -this.value), t + 1) : -1;
                    this.value = 10 * this.value + parseInt(e[t], 10)
                }
                return -1
            }

            encode(e) {
                return e += "i", e += this.value, e += "e"
            }

            toJs() {
                return this.value
            }
        }

        e.BencodeInteger = a;

        class o extends i {
            constructor() {
                super(t.String), this.value = ""
            }

            getValue() {
                return this.value
            }

            setValue(e) {
                return this.value !== e && (this.value = e, !0)
            }

            decode(e) {
                let t = 0, i = 0;
                for (; i < e.length; i++) {
                    if (!(e[i] >= "0" && e[i] <= "9")) {
                        if (":" !== e[i]) return -1;
                        break
                    }
                    t = 10 * t + parseInt(e[i], 10)
                }
                return t + i + 1 > e.length ? -1 : (this.value = e.substr(i + 1, t), t + i + 1)
            }

            encode(e) {
                return e += this.value.length, e += ":", e += this.value
            }

            toJs() {
                return this.value
            }
        }

        e.BencodeString = o;

        class r extends i {
            constructor() {
                super(t.List), this.value = []
            }

            getItemList() {
                return this.value
            }

            getValue() {
                return this.value
            }

            decode(e) {
                return 0
            }

            encode(e) {
                return e
            }

            toJs() {
                let e = [];
                for (let t = 0; t < this.value.length; ++t) e.push(this.value[t].toJs());
                return e
            }
        }

        e.BencodeList = r;

        class s extends i {
            constructor() {
                super(t.Map), this.value = new Map
            }

            getValue() {
                return this.value
            }

            getItem(e) {
                return this.value.get(e)
            }

            addMapItem(e) {
                let i = null, n = this.value.get(e);
                return n && n.getType() === t.Map ? i = n : (i = new s, this.value.set(e, i)), i
            }

            addItem(e, i) {
                let r = !1;
                if (n.isNumber(i)) {
                    let n = null, o = this.value.get(e);
                    o && o.getType() === t.Integer ? n = o : (n = new a, this.value.set(e, n)), n.setValue(i), r = !0
                } else if (n.isString(i)) {
                    let n = null, a = this.value.get(e);
                    a && a.getType() === t.String ? n = a : (n = new o, this.value.set(e, n)), n.setValue(i), r = !0
                } else if (n.isObject(i)) {
                    let n = null, a = this.value.get(e);
                    a && a.getType() === t.Map ? n = a : (n = new s, this.value.set(e, n));
                    for (let e in i) n.addItem(e);
                    r = !0
                }
                return r
            }

            removeItem(e) {
                let i = this.value.get(e);
                if (i) {
                    let n = !0;
                    if (i.getType() === t.Map) {
                        0 === i.getValue().size && (n = !0)
                    }
                    return this.value.delete(e), n
                }
                return !1
            }

            decode(e) {
                if (!e) return -1;
                let t = e.length;
                if (t < 2 || "d" !== e[0]) return -1;
                let i = 1, n = new o, r = null, l = -1, d = -1;
                for (; i < t && "e" !== e[i];) {
                    if (!((l = n.decode(e.substr(i))) >= 0)) return -1;
                    if ("i" === e[i += l]) {
                        let t = new a;
                        d = t.decode(e.substr(i)), r = t
                    } else if ("d" === e[i]) {
                        let t = new s;
                        d = t.decode(e.substr(i)), r = t
                    } else {
                        let t = new o;
                        d = t.decode(e.substr(i)), r = t
                    }
                    if (!(d >= 0)) return -1;
                    i += d, this.value.set(n.getValue(), r)
                }
                return i < t && "e" === e[i] ? i + 1 : -1
            }

            encode(e) {
                e += "d";
                let t = new o;
                return this.value.forEach(function (i, n) {
                    t.setValue(n), e = t.encode(e), e = i.encode(e)
                }), e += "e"
            }

            toJs() {
                let e = {};
                return this.value.forEach(function (t, i) {
                    e[i] = t.toJs()
                }), e
            }
        }

        e.BencodeMap = s;
        e.Bencode = class {
            constructor() {
                this.objectList = []
            }

            getItemList() {
                return this.objectList
            }

            encode(e) {
                for (let t = 0; t < this.objectList.length; t++) e = this.objectList[t].encode(e);
                return e
            }

            decode(e) {
                let t = null, i = -1, n = 0, l = e.length;
                for (; n < l; n++) (i = (t = "i" === e[n] ? new a : "l" === e[n] ? new r : "d" === e[n] ? new s : new o).decode(e.substr(n))) >= 0 && (n += i, this.objectList.push(t));
                return e
            }
        }
    }(t.BencodeMap || (t.BencodeMap = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(3), r = i(31), s = i(86), l = i(489), d = i(15), u = i(108), c = i(4), h = i(5), f = i(0),
        g = d.DownloadKernelEventManager.getEventManager(), p = f.default.getLogger("DownloadKernel.TaskBt");
    t.BtTask = class {
        constructor(e, t, i) {
            this.subError = !1, this.fileLists = new Map, this.priorityMap = new Map, this.downloadIndexLists = [], this.task = e;
            let n = this.task.getTaskAttribute(o.DownloadKernel.TaskAttribute.TaskId);
            if (i) {
                this.infoId = i.infoId, this.tracker = i.tracker, this.seedFile = i.seedFile, this.displayName = i.displayName, this.downloadIndexLists = i.fileRealIndexLists, this.loadSubFileEnd = t, t && r.ThunderKernel.insertBtTask(n, this.infoId, this.tracker, this.seedFile, this.displayName);
                let e = i.fileLists, a = r.ThunderKernel.beginTransaction();
                for (let i = 0; i < e.length; ++i) {
                    let n = e[i], a = n.realIndex, o = 0;
                    this.downloadIndexLists.indexOf(a) > -1 && (o = 1);
                    let r = new l.BtFile(this);
                    r.saveBtFileInfo(t, o, n), this.fileLists.set(a, r)
                }
                r.ThunderKernel.commitTransaction(a)
            }
            let a = this.task.getTaskAttribute(o.DownloadKernel.TaskAttribute.UserData);
            this.userData = new u.TaskUserData(e, a)
        }

        getTask() {
            return this.task
        }

        setTaskPriorityLevel(e, t) {
            c.isNullOrUndefined(t) ? t = this.priorityMap.get(e) : this.priorityMap.set(e, t);
            let i = this.task.getVirtualTaskId();
            if (i && i > 0 && !c.isNullOrUndefined(t)) if (-1 === e) for (let e = 0; e < this.downloadIndexLists.length; ++e) r.ThunderKernel.setTaskPriorityLevel(i, this.downloadIndexLists[e], t); else r.ThunderKernel.setTaskPriorityLevel(i, e, t)
        }

        setUserData(e, t, i) {
            return this.userData.setUserData(e, t, i)
        }

        getUserData(e, t) {
            return this.userData.getUserData(e, t)
        }

        getFileCount() {
            return this.fileLists.size
        }

        setAllUserData(e) {
            return this.userData.setAllUserData(e)
        }

        getAllUserData() {
            return this.userData.getAllUserData()
        }

        getBtFileByRealIndex(e) {
            return this.fileLists.get(e)
        }

        getInfoId() {
            return this.infoId
        }

        getDisplayName() {
            return this.displayName
        }

        getTrackerUrls() {
            return this.tracker
        }

        getSeedFilePath() {
            return this.seedFile
        }

        getDownloadFile() {
            return this.downloadIndexLists
        }

        getFileSize() {
            let e = 0;
            for (let t of this.fileLists) {
                let i = t[1];
                if (1 === i.getIsDownload()) {
                    let t = i.getBtFileAttribute(o.DownloadKernel.BtFileAttribute.FileSize);
                    t && (e += t)
                }
            }
            return e
        }

        setDownloadFile(e) {
            let t = 0;
            for (let i of this.fileLists) {
                let n = i[1], a = n.getFileIndex();
                if (e.indexOf(a) > -1) {
                    n.setIsDownload(1);
                    let e = n.getBtFileAttribute(o.DownloadKernel.BtFileAttribute.DownloadSize);
                    e && e > 0 && (t += e)
                } else n.setIsDownload(0)
            }
            this.downloadIndexLists = e, p.information("setDownloadFile", t), this.task.setDownloadSize(t)
        }

        getBtFileList() {
            return this.fileLists
        }

        getBtFileInfoList() {
            let e = [];
            for (let t of this.fileLists) {
                let i = t[1].getBtFileInfo();
                e.push(i)
            }
            return e
        }

        updateSubFileInfo(e) {
            if (e && e.length > 0) {
                let t = !1, i = !1, n = [];
                for (let t = 0; t < e.length; ++t) {
                    let i = e[t], a = i.realIndex, r = this.fileLists.get(a), s = this.getFileStatus(i.fileStatus),
                        l = i.errorCode;
                    0 !== l && (s = l > 700 ? o.DownloadKernel.BtFileStatus.Forbidden : o.DownloadKernel.BtFileStatus.Error, r && n.push(a)), i.fileStatus = s, r && r.updateFileInfo(i)
                }
                if (n.length > 0) {
                    let e = this.getDownloadFile();
                    for (let a = 0; a < n.length; ++a) for (let r = 0; r < e.length; ++r) if (e[r] === n[a]) {
                        this.subError || (this.subError = !0, i = !0);
                        let e = n[a], r = this.fileLists.get(e);
                        r && r.getBtFileAttribute(o.DownloadKernel.BtFileAttribute.ErrorCode) > 700 && (t = !0);
                        break
                    }
                }
                let a = this.task.getTaskAttribute(o.DownloadKernel.TaskAttribute.TaskId);
                if (g.fireTaskEvent(o.DownloadKernel.TaskEventType.BtSubFileDetailChanged, a, e), i) {
                    let e = "Error";
                    t && (e = "Forbidden"), g.fireTaskEvent(o.DownloadKernel.TaskEventType.BtSubFileForbidden, a, e)
                }
            }
        }

        deleteStorageBtFile() {
            let e = this.task.getTaskAttribute(o.DownloadKernel.TaskAttribute.TaskId);
            r.ThunderKernel.deleteStorageTask(e, s.StatementType.DestroyBtFile)
        }

        loadBtTask(e) {
            let t = this.task.getTaskAttribute(o.DownloadKernel.TaskAttribute.TaskId);
            r.ThunderKernel.loadStorageTask(t, s.StatementType.LoadBtTask, i => {
                i ? (this.infoId = i.infoId, this.tracker = i.tracker, this.seedFile = i.seedFile, this.displayName = i.displayName, r.ThunderKernel.loadStorageTask(t, s.StatementType.LoadBtFile, t => {
                    if (t) for (let e = 0; e < t.length; ++e) {
                        let i = t[e], n = new l.BtFile(this);
                        n.setFileData(i), this.fileLists.set(i.realIndex, n), 1 === i.download && this.downloadIndexLists.push(i.realIndex)
                    }
                    this.loadSubFileEnd = !0, e(i, t)
                }), this.updateSeedFile().catch()) : e(null, null)
            })
        }

        updateSeedFile() {
            return n(this, void 0, void 0, function* () {
                if (this.seedFile && !(yield h.FileSystemAWNS.existsAW(this.seedFile))) {
                    let e = a.basename(this.seedFile), t = a.join(__profilesDir, "Torrents"), i = a.join(t, e);
                    if (yield h.FileSystemAWNS.existsAW(i)) {
                        this.seedFile = i;
                        let e = this.task.getTaskAttribute(o.DownloadKernel.TaskAttribute.TaskId);
                        r.ThunderKernel.saveBtTaskSeedFile(e, i)
                    }
                }
            })
        }

        isBtFileLoadEnd() {
            return this.loadSubFileEnd
        }

        getFileStatus(e) {
            let t = o.DownloadKernel.BtFileStatus.Stopped;
            switch (e) {
                case 0:
                    break;
                case 1:
                    t = o.DownloadKernel.BtFileStatus.Stopped;
                    break;
                case 2:
                    t = o.DownloadKernel.BtFileStatus.Started;
                    break;
                case 3:
                    t = o.DownloadKernel.BtFileStatus.Complete
            }
            return t
        }
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(3), a = i(31), o = i(15), r = i(47), s = o.DownloadKernelEventManager.getEventManager();
    t.BtFile = class {
        constructor(e) {
            this.attribute = new Map;
            for (let e = n.DownloadKernel.BtFileAttribute.NumberStrart; e < n.DownloadKernel.BtFileAttribute.NumberEnd; ++e) this.attribute.set(e, 0);
            for (let e = n.DownloadKernel.BtFileAttribute.StringStart; e < n.DownloadKernel.BtFileAttribute.StringEnd; ++e) this.attribute.set(e, "");
            this.attribute.set(n.DownloadKernel.BtFileAttribute.DcdnStatus, n.DownloadKernel.DcdnStatusCode.Unkown), this.btTask = e;
            let t = this.btTask.getTask().getTaskAttribute(n.DownloadKernel.TaskAttribute.TaskId);
            this.taskId = t, this.attribute.set(n.DownloadKernel.BtFileAttribute.TaskId, t)
        }

        getBtFileAttribute(e) {
            return this.attribute.get(e)
        }

        updateFileInfo(e) {
            this.realIndex = e.realIndex, this.attribute.set(n.DownloadKernel.BtFileAttribute.FileSize, e.fileSize), this.attribute.set(n.DownloadKernel.BtFileAttribute.RealIndex, e.realIndex), this.attribute.set(n.DownloadKernel.BtFileAttribute.EnableDcdn, e.enableDcdn), this.setAttribute(n.DownloadKernel.BtFileAttribute.ErrorCode, e.errorCode) && a.ThunderKernel.setBtFileFailureErrorCode(this.realIndex, this.taskId, this.attribute.get(n.DownloadKernel.BtFileAttribute.ErrorCode)), e.relativePath && this.attribute.set(n.DownloadKernel.BtFileAttribute.RelativePath, e.relativePath), e.finalName && "" !== e.finalName && (this.attribute.set(n.DownloadKernel.BtFileAttribute.FinalName, e.finalName), this.attribute.set(n.DownloadKernel.BtFileAttribute.FileName, e.finalName));
            let t = this.setAttribute(n.DownloadKernel.BtFileAttribute.FileStatus, e.fileStatus),
                i = this.setAttribute(n.DownloadKernel.BtFileAttribute.DownloadSize, e.downloadSize);
            (t || i) && a.ThunderKernel.saveBtFileInfo(this.taskId, this.realIndex, this.attribute.get(n.DownloadKernel.BtFileAttribute.FileStatus), this.download, this.attribute.get(n.DownloadKernel.BtFileAttribute.DownloadSize)), e.cid && "" !== e.cid && e.gcid && "" !== e.gcid && this.updateCidAndGcid(e.cid, e.gcid);
            let o = this.attribute.get(n.DownloadKernel.BtFileAttribute.DcdnStatus);
            if (o !== e.dcdnStatus) {
                this.attribute.set(n.DownloadKernel.BtFileAttribute.DcdnStatus, e.dcdnStatus);
                let t = this.btTask.getTask().getId();
                s.fireTaskEvent(n.DownloadKernel.TaskEventType.BtSubFileDcdnStatusChanged, t, this.realIndex, e.dcdnStatus, o)
            }
        }

        saveBtFileInfo(e, t, i) {
            if (this.download = t, this.realIndex = i.realIndex, this.attribute.set(n.DownloadKernel.BtFileAttribute.Download, t), this.attribute.set(n.DownloadKernel.BtFileAttribute.FileSize, i.fileSize), this.attribute.set(n.DownloadKernel.BtFileAttribute.RealIndex, i.realIndex), this.attribute.set(n.DownloadKernel.BtFileAttribute.RealIndex, i.realIndex), this.attribute.set(n.DownloadKernel.BtFileAttribute.FileOffset, i.fileOffset), i.fileName && this.attribute.set(n.DownloadKernel.BtFileAttribute.FileName, i.fileName), i.filePath && this.attribute.set(n.DownloadKernel.BtFileAttribute.FilePath, i.filePath), e) {
                let e = {
                    taskId: this.taskId,
                    status: 0,
                    realIndex: i.realIndex,
                    visible: 1,
                    download: t,
                    fileSize: i.fileSize,
                    fileOffset: i.fileOffset,
                    filePath: void 0 === i.filePath ? "" : i.filePath,
                    fileName: void 0 === i.fileName ? "" : i.fileName
                };
                a.ThunderKernel.insertBtFile(this.taskId, e)
            }
        }

        getBtFileInfo() {
            let e = {};
            return e.fileSize = this.attribute.get(n.DownloadKernel.BtFileAttribute.FileSize), e.realIndex = this.attribute.get(n.DownloadKernel.BtFileAttribute.RealIndex), e.fileOffset = this.attribute.get(n.DownloadKernel.BtFileAttribute.FileOffset), e.fileName = this.attribute.get(n.DownloadKernel.BtFileAttribute.FileName), e.filePath = this.attribute.get(n.DownloadKernel.BtFileAttribute.FilePath), e
        }

        getBtDownloadFileInfo() {
            return {
                realIndex: this.attribute.get(n.DownloadKernel.BtFileAttribute.RealIndex),
                fileStatus: this.attribute.get(n.DownloadKernel.BtFileAttribute.FileStatus),
                downloadSize: this.attribute.get(n.DownloadKernel.BtFileAttribute.DownloadSize),
                fileSize: this.attribute.get(n.DownloadKernel.BtFileAttribute.FileSize),
                enableDcdn: this.attribute.get(n.DownloadKernel.BtFileAttribute.EnableDcdn),
                errorCode: this.attribute.get(n.DownloadKernel.BtFileAttribute.ErrorCode),
                dcdnStatus: this.attribute.get(n.DownloadKernel.BtFileAttribute.DcdnStatus),
                relativePath: this.attribute.get(n.DownloadKernel.BtFileAttribute.RelativePath),
                finalName: this.attribute.get(n.DownloadKernel.BtFileAttribute.FinalName),
                cid: this.attribute.get(n.DownloadKernel.BtFileAttribute.Cid),
                gcid: this.attribute.get(n.DownloadKernel.BtFileAttribute.Gcid),
                userRead: this.attribute.get(n.DownloadKernel.BtFileAttribute.UserRead),
                playPosition: this.attribute.get(n.DownloadKernel.BtFileAttribute.PlayPosition),
                duration: this.attribute.get(n.DownloadKernel.BtFileAttribute.Duration)
            }
        }

        getIsDownload() {
            return this.download
        }

        setIsDownload(e) {
            this.download !== e && (this.download = e, this.attribute.set(n.DownloadKernel.BtFileAttribute.Download, e), a.ThunderKernel.saveBtFileInfo(this.taskId, this.realIndex, this.attribute.get(n.DownloadKernel.BtFileAttribute.FileStatus), this.download, this.attribute.get(n.DownloadKernel.BtFileAttribute.DownloadSize)))
        }

        getUserRead() {
            return this.attribute.get(n.DownloadKernel.BtFileAttribute.UserRead)
        }

        setUserRead(e) {
            0 !== e && (e = 1);
            let t = !1;
            return this.attribute.get(n.DownloadKernel.BtFileAttribute.UserRead) !== e && (this.attribute.set(n.DownloadKernel.BtFileAttribute.UserRead, e), a.ThunderKernel.saveBtFileUserRead(this.taskId, this.realIndex, e), s.fireTaskEvent(n.DownloadKernel.TaskEventType.BtSubFileDetailChanged, this.taskId, [this.getBtDownloadFileInfo()]), t = !0), t
        }

        setPlayPosition(e) {
            let t = !1;
            return this.attribute.get(n.DownloadKernel.BtFileAttribute.PlayPosition) !== e && (this.attribute.set(n.DownloadKernel.BtFileAttribute.PlayPosition, e), a.ThunderKernel.setBtFilePlayPosition(this.taskId, this.realIndex, e), s.fireTaskEvent(n.DownloadKernel.TaskEventType.BtSubFileDetailChanged, this.taskId, [this.getBtDownloadFileInfo()]), t = !0), t
        }

        setDuration(e) {
            let t = !1;
            return this.attribute.get(n.DownloadKernel.BtFileAttribute.Duration) !== e && (this.attribute.set(n.DownloadKernel.BtFileAttribute.Duration, e), a.ThunderKernel.setBtFileDuration(this.taskId, this.realIndex, e), s.fireTaskEvent(n.DownloadKernel.TaskEventType.BtSubFileDetailChanged, this.taskId, [this.getBtDownloadFileInfo()]), t = !0), t
        }

        isSupportPlay() {
            let e = !1;
            if (this.attribute.get(n.DownloadKernel.BtFileAttribute.FileStatus) === n.DownloadKernel.BtFileStatus.Forbidden) e = !1; else {
                let t = this.attribute.get(n.DownloadKernel.BtFileAttribute.Download),
                    i = this.attribute.get(n.DownloadKernel.BtFileAttribute.FileName);
                1 === t && (e = r.TaskUtilHelper.isVideoFileExt(i))
            }
            return e
        }

        getFileIndex() {
            return this.realIndex
        }

        setFileData(e) {
            this.download = e.download, this.taskId = e.taskId, this.realIndex = e.realIndex, this.attribute.set(n.DownloadKernel.BtFileAttribute.TaskId, e.taskId), this.attribute.set(n.DownloadKernel.BtFileAttribute.FileSize, e.fileSize), this.attribute.set(n.DownloadKernel.BtFileAttribute.FileOffset, e.fileOffset), this.attribute.set(n.DownloadKernel.BtFileAttribute.DownloadSize, e.receivedSize), this.attribute.set(n.DownloadKernel.BtFileAttribute.RealIndex, e.realIndex), this.attribute.set(n.DownloadKernel.BtFileAttribute.FileStatus, e.status), this.attribute.set(n.DownloadKernel.BtFileAttribute.Visible, e.visible), this.attribute.set(n.DownloadKernel.BtFileAttribute.Download, e.download), e.filePath && this.attribute.set(n.DownloadKernel.BtFileAttribute.FilePath, e.filePath), e.fileName && this.attribute.set(n.DownloadKernel.BtFileAttribute.FileName, e.fileName), e.cid && this.attribute.set(n.DownloadKernel.BtFileAttribute.Cid, e.cid), e.gcid && this.attribute.set(n.DownloadKernel.BtFileAttribute.Gcid, e.gcid), e.userRead && this.attribute.set(n.DownloadKernel.BtFileAttribute.UserRead, e.userRead), e.playPosition && this.attribute.set(n.DownloadKernel.BtFileAttribute.PlayPosition, e.playPosition), e.duration && this.attribute.set(n.DownloadKernel.BtFileAttribute.Duration, e.duration), this.attribute.set(n.DownloadKernel.BtFileAttribute.ErrorCode, e.failureErrorCode)
        }

        updateCidAndGcid(e, t) {
            let i = !1, o = this.attribute.get(n.DownloadKernel.BtFileAttribute.Cid),
                r = this.attribute.get(n.DownloadKernel.BtFileAttribute.Gcid);
            o && "" !== o || ("0000000000000000000000000000000000000000" === e ? this.setAttribute(n.DownloadKernel.BtFileAttribute.Cid, "") : this.setAttribute(n.DownloadKernel.BtFileAttribute.Cid, e), o = e, i = !0), r && "" !== r || ("0000000000000000000000000000000000000000" === t ? this.setAttribute(n.DownloadKernel.BtFileAttribute.Gcid, "") : this.setAttribute(n.DownloadKernel.BtFileAttribute.Gcid, t), r = t, i = !0), i && a.ThunderKernel.saveBtFileCid(this.taskId, this.realIndex, o, r)
        }

        setAttribute(e, t) {
            let i = !1;
            return this.attribute.get(e) !== t && void 0 !== t && (this.attribute.set(e, t), i = !0), i
        }
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(42), a = i(3), o = i(31), r = i(86), s = i(108), l = i(4), d = i(2);
    t.EmuleTask = class {
        constructor(e, t) {
            if (this.task = e, this.configPath = d.join(__profilesDir, "Emule"), this.taskId = e.getTaskAttribute(a.DownloadKernel.TaskAttribute.TaskId), t) {
                let e = this.task.getTaskAttribute(a.DownloadKernel.TaskAttribute.TaskId),
                    t = this.task.getTaskAttribute(a.DownloadKernel.TaskAttribute.TaskUrl);
                n.Common.isThunderPrivateUrl(t) && (t = n.Common.parseThunderPrivateUrl(t)), this.fileHash = o.ThunderKernel.getFileHashByUrl(t), o.ThunderKernel.insertEmuleTask(e, this.fileHash, this.configPath)
            } else o.ThunderKernel.loadStorageTask(this.taskId, r.StatementType.LoadEmuleTask, e => {
                this.fileHash = e.fileHash, this.configPath = e.configPath
            });
            let i = this.task.getTaskAttribute(a.DownloadKernel.TaskAttribute.UserData);
            this.userData = new s.TaskUserData(e, i)
        }

        getTask() {
            return this.task
        }

        setTaskPriorityLevel(e, t) {
            l.isNullOrUndefined(t) ? t = this.priority : this.priority = t;
            let i = this.task.getVirtualTaskId();
            i && i > 0 && !l.isNullOrUndefined(t) && o.ThunderKernel.setTaskPriorityLevel(i, e, t)
        }

        setUserData(e, t, i) {
            return this.userData.setUserData(e, t, i)
        }

        getUserData(e, t) {
            return this.userData.getUserData(e, t)
        }

        setAllUserData(e) {
            return this.userData.setAllUserData(e)
        }

        getAllUserData() {
            return this.userData.getAllUserData()
        }

        getFileHash() {
            return this.fileHash
        }

        getConfigPath() {
            return this.configPath
        }
    }
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(5), r = i(3), s = i(31), l = i(86), d = i(15), u = i(108), c = i(0),
        h = d.DownloadKernelEventManager.getEventManager(), f = c.default.getLogger("DownloadKernel.TaskGroup");
    t.GroupTask = class {
        constructor(e, t) {
            this.startTime = 0, this.downloadingPeriod = 0, this.startTaskCount = 5, this.task = e, this.subTasks = [], this.moveTimeout = 120, this.downloadingSubCount = 5, this.subTaskOrder = "", this.taskId = this.task.getTaskAttribute(r.DownloadKernel.TaskAttribute.TaskId), t ? s.ThunderKernel.insertGroupTask(this.taskId, this.moveTimeout, this.downloadingSubCount, this.subTaskOrder) : (this.downloadingPeriod = e.getTaskAttribute(r.DownloadKernel.TaskAttribute.DownloadingPeriod), s.ThunderKernel.loadStorageTask(this.taskId, l.StatementType.LoadGroupTask, e => {
                this.moveTimeout = e.moveTimeout, this.downloadingSubCount = e.downloadingSubCount
            }));
            let i = this.task.getTaskAttribute(r.DownloadKernel.TaskAttribute.UserData);
            this.userData = new u.TaskUserData(e, i)
        }

        getTask() {
            return this.task
        }

        setTaskPriorityLevel(e, t) {
            if (-1 === e) for (let e = 0; e < this.subTasks.length; ++e) {
                let i = this.subTasks[e].getExtraObject();
                i && i.setTaskPriorityLevel(-1, t)
            } else {
                let i = this.getSubTaskByIndex(e);
                if (i) {
                    let e = i.getExtraObject();
                    e && e.setTaskPriorityLevel(-1, t)
                }
            }
        }

        setSubTaskFileSize(e, t) {
            let i = !1, n = this.subTasks[e];
            if (n && (i = n.setFileSize(t))) {
                let e = 0;
                for (let t = 0; t < this.subTasks.length; ++t) {
                    let i = this.subTasks[t];
                    if (i) {
                        if (0 === i.getTaskAttribute(r.DownloadKernel.TaskAttribute.DownloadSubTask)) continue;
                        let t = i.getTaskAttribute(r.DownloadKernel.TaskAttribute.FileSize);
                        t && (e += t)
                    }
                }
                this.task.setFileSize(e)
            }
            return i
        }

        setUserData(e, t, i) {
            return this.userData.setUserData(e, t, i)
        }

        getUserData(e, t) {
            return this.userData.getUserData(e, t)
        }

        setAllUserData(e) {
            return this.userData.setAllUserData(e)
        }

        getAllUserData() {
            return this.userData.getAllUserData()
        }

        getSubTaskCount() {
            return this.subTasks.length
        }

        getDownloadTaskCount() {
            let e = 0;
            for (let t = 0; t < this.subTasks.length; ++t) {
                let i = this.subTasks[t];
                i && 1 === i.getTaskAttribute(r.DownloadKernel.TaskAttribute.DownloadSubTask) && e++
            }
            return e
        }

        getSubTaskByIndex(e) {
            return this.subTasks[e]
        }

        addSubTask(e) {
            e && (this.subTasks.push(e), e.internalSetFileIndex(this.subTasks.length - 1))
        }

        start(e) {
            let t = !1, i = 0, n = 0;
            for (let a = 0; a < this.subTasks.length; ++a) {
                let o = this.subTasks[a];
                if (!o) continue;
                if (0 === o.getTaskAttribute(r.DownloadKernel.TaskAttribute.DownloadSubTask)) {
                    n++;
                    continue
                }
                let s = o.getTaskStatus();
                if (s !== r.DownloadKernel.TaskStatus.Succeeded && s !== r.DownloadKernel.TaskStatus.Seeding) if (s !== r.DownloadKernel.TaskStatus.Failed) {
                    if (o.start(e) && (t = !0, ++i >= this.startTaskCount)) break
                } else o.start(e) && (t = !0); else n++
            }
            return n === this.subTasks.length && (t = !0), e && (t = !0), t
        }

        stop(e) {
            let t = !1;
            for (let i = 0; i < this.subTasks.length; ++i) {
                let n = this.subTasks[i];
                if (!n) continue;
                let a = n.getTaskStatus();
                a !== r.DownloadKernel.TaskStatus.Succeeded && a !== r.DownloadKernel.TaskStatus.Seeding && n.stop(e) && (t = !0)
            }
            return t
        }

        deleteStorageTask() {
            for (let e = 0; e < this.subTasks.length; ++e) {
                let t = this.subTasks[e];
                t && t.deleteStorageTask()
            }
        }

        deleteFile() {
            return n(this, void 0, void 0, function* () {
                let e = !0;
                for (let t = 0; t < this.subTasks.length; ++t) {
                    let i = this.subTasks[t];
                    i && (e = (yield i.deleteFile()) && e)
                }
                let t = this.task.getTaskAttribute(r.DownloadKernel.TaskAttribute.SavePath), n = [t];
                for (let e = 0; e < this.subTasks.length; ++e) {
                    let i = this.subTasks[e];
                    if (i) {
                        let e = i.getTaskAttribute(r.DownloadKernel.TaskAttribute.SavePath);
                        for (; e.length > t.length && !n.includes(e);) n = n.concat([e]), e = a.parse(e).dir
                    }
                }
                n.sort((e, t) => e.length > t.length ? -1 : e.length < t.length ? 1 : 0), f.information("task.delete savePaths:", n);
                for (let t = 0; t < n.length; ++t) {
                    let i = n[t];
                    (yield o.FileSystemAWNS.existsAW(i)) && (e = (yield o.FileSystemAWNS.rmdirAW(i)) && e)
                }
                const {TaskUserDataGUID: s} = yield Promise.resolve().then(() => i(51));
                let l = this.getUserData(s.guidNotSavePath, "notSavePath");
                if (l && (t = a.normalize(t), l = a.normalize(l), 0 === t.indexOf(l))) {
                    let e = l.indexOf(":\\");
                    if (-1 !== e) {
                        let t = l.substr(0, e + ":\\".length);
                        t && o.FileSystemAWNS.deleteEmptySubDirs(l, t).catch()
                    }
                }
                return e
            })
        }

        destroy() {
            return n(this, void 0, void 0, function* () {
                let e = !0;
                for (let t = 0; t < this.subTasks.length; ++t) {
                    let i = this.subTasks[t];
                    if (i) {
                        let t = yield i.destroy();
                        e && !t && (e = !1)
                    }
                }
                return e
            })
        }

        querySubTaskInfo(e, t, i) {
            let n = !1, a = 0, o = 0, l = !1, d = [];
            for (let u = 0; u < this.subTasks.length; ++u) {
                let c = this.subTasks[u];
                if (!c) continue;
                let f = c.getTaskStatus();
                if (f === r.DownloadKernel.TaskStatus.Stopped || f === r.DownloadKernel.TaskStatus.Succeeded || f === r.DownloadKernel.TaskStatus.Seeding || f === r.DownloadKernel.TaskStatus.Failed) continue;
                let g = c.getTaskAttribute(r.DownloadKernel.TaskAttribute.VirtualId);
                g < 1 || (a++, n = s.ThunderKernel.queryTaskInfo(g, n => {
                    if (o++, null !== n) {
                        let i = c.updateTaskInfo(n, e, t);
                        1 & i && (l = !0), i > 0 && d.push(c)
                    }
                    if (a === o && (this.updateTaskDetail(), l && this.checkSubTaskStatus(), this.updateTaskStatus() && e(this.task), i(), d.length > 0)) {
                        let e = new Map;
                        e.set(this.taskId, d), h.fireTaskEvent(r.DownloadKernel.TaskEventType.GroupTaskSubFileDetailChanged, e)
                    }
                }))
            }
            return 0 === a && (this.subTasks.length > 0 && e(this.subTasks[0]), this.updateTaskDetail(), this.updateTaskStatus(), i()), n
        }

        getErrorCodes() {
            let e = [];
            do {
                if (this.task.getTaskStatus() !== r.DownloadKernel.TaskStatus.Failed) break;
                for (let t = 0; t < this.subTasks.length; ++t) {
                    let i = this.subTasks[t];
                    if (0 !== i.getTaskAttribute(r.DownloadKernel.TaskAttribute.DownloadSubTask) && i.getTaskStatus() === r.DownloadKernel.TaskStatus.Failed) {
                        let t = i.getTaskAttribute(r.DownloadKernel.TaskAttribute.ErrorCode);
                        -1 === e.indexOf(t) && e.push(t)
                    }
                }
            } while (0);
            return e
        }

        getTaskStatus() {
            let e = 0, t = 0, i = 0, n = 0, a = 0, o = 0, s = 0, l = this.task.getTaskStatus();
            if (l === r.DownloadKernel.TaskStatus.StartWaiting || l === r.DownloadKernel.TaskStatus.DestroyPending) return l;
            let d = 0;
            for (let l = 0; l < this.subTasks.length; ++l) {
                let u = this.subTasks[l], c = !1;
                if (u) {
                    if (0 === u.getTaskAttribute(r.DownloadKernel.TaskAttribute.DownloadSubTask)) {
                        d++;
                        continue
                    }
                    switch (u.getTaskStatus()) {
                        case r.DownloadKernel.TaskStatus.Unkown:
                            e++;
                            break;
                        case r.DownloadKernel.TaskStatus.Started:
                            i++, c = !0;
                            break;
                        case r.DownloadKernel.TaskStatus.StartPending:
                            n++;
                            break;
                        case r.DownloadKernel.TaskStatus.Stopped:
                            t++;
                            break;
                        case r.DownloadKernel.TaskStatus.StopPending:
                            a++;
                            break;
                        case r.DownloadKernel.TaskStatus.Succeeded:
                            o++;
                            break;
                        case r.DownloadKernel.TaskStatus.Failed:
                            s++;
                            break;
                        case r.DownloadKernel.TaskStatus.Seeding:
                            o++
                    }
                }
                if (c) break
            }
            let u = !1;
            l !== r.DownloadKernel.TaskStatus.StopPending && (i > 0 ? (l = r.DownloadKernel.TaskStatus.Started, u = !0) : n > 0 && l !== r.DownloadKernel.TaskStatus.Started && (l = r.DownloadKernel.TaskStatus.StartPending, u = !0));
            let c = this.subTasks.length - d;
            return u || (a > 0 ? l = r.DownloadKernel.TaskStatus.StopPending : e === c ? l = r.DownloadKernel.TaskStatus.Unkown : o === c ? l = r.DownloadKernel.TaskStatus.Succeeded : s === c ? l = r.DownloadKernel.TaskStatus.Failed : s + o === c ? l = r.DownloadKernel.TaskStatus.Succeeded : t > 0 && l !== r.DownloadKernel.TaskStatus.Started && (l = r.DownloadKernel.TaskStatus.Stopped)), l
        }

        setDownloadTask(e) {
            let t = 0, i = [];
            for (let n = 0; n < this.subTasks.length; ++n) {
                let a = this.subTasks[n], o = !1, s = !1;
                for (let i = 0; i < e.length; ++i) if (n === e[i]) {
                    s = a.updateDownloadSubTask(1), o = !0;
                    let e = a.getTaskAttribute(r.DownloadKernel.TaskAttribute.DownloadSize);
                    e && e > 0 && (t += e);
                    break
                }
                o || (s = a.updateDownloadSubTask(0)), s && i.push(a)
            }
            if (t && this.updateTaskDetail(), i.length > 0) {
                let e = new Map;
                e.set(this.taskId, i), h.fireTaskEvent(r.DownloadKernel.TaskEventType.GroupTaskSubFileDetailChanged, e)
            }
        }

        getTaskSizeInfo() {
            let e = {
                downloadSpeed: 0,
                vipSpeed: 0,
                fileSize: 0,
                downloadSize: 0,
                receivedSize: 0,
                usingResCount: 0,
                totalResCount: 0,
                channelInfo: {originSize: 0, p2pSize: 0, p2sSize: 0, offlineSize: 0, dcdnSize: 0}
            };
            for (let t = 0; t < this.subTasks.length; ++t) {
                let i = this.subTasks[t];
                if (i) {
                    if (0 === i.getTaskAttribute(r.DownloadKernel.TaskAttribute.DownloadSubTask)) continue;
                    let t = i.getDownloadSpeed(), n = i.getVipSpeed(),
                        a = i.getTaskAttribute(r.DownloadKernel.TaskAttribute.FileSize),
                        o = i.getTaskAttribute(r.DownloadKernel.TaskAttribute.DownloadSize),
                        s = i.getTaskAttribute(r.DownloadKernel.TaskAttribute.ReceivedSize),
                        l = i.getTaskAttribute(r.DownloadKernel.TaskAttribute.SrcUsing),
                        d = i.getTaskAttribute(r.DownloadKernel.TaskAttribute.SrcTotal), u = i.getTaskChannelInfo();
                    u && (e.channelInfo.p2pSize += u.p2pSize, e.channelInfo.p2sSize += u.p2sSize, e.channelInfo.offlineSize += u.offlineSize, e.channelInfo.originSize += u.originSize, e.channelInfo.dcdnSize += u.dcdnSize), t && (e.downloadSpeed += t), n && (e.vipSpeed += n), a && (e.fileSize += a), o && (e.downloadSize += o), s && (e.receivedSize += s), l && (e.usingResCount += l), d && (e.totalResCount += d)
                }
            }
            if (e.downloadSize) {
                let t = this.task.getTaskAttribute(r.DownloadKernel.TaskAttribute.TotalDownloadSize);
                void 0 !== t && 0 !== t && (e.downloadSpeed = e.downloadSize - t), this.task.internalSetTotalDownloadSize(e.downloadSize)
            }
            return e.downloadSpeed < 0 && (e.downloadSpeed = 0), e
        }

        updateTaskStatus() {
            let e = this.getTaskStatus();
            return this.task.updateTaskStatus(e)
        }

        checkSubTaskStatus() {
            let e = this.task.getTaskStatus();
            e !== r.DownloadKernel.TaskStatus.Stopped && e !== r.DownloadKernel.TaskStatus.StopPending && this.startWaittingTasks()
        }

        startWaittingTasks() {
            let e = 0, t = 0;
            for (let i = 0; i < this.subTasks.length; ++i) {
                let n = this.subTasks[i];
                if (!n) continue;
                if (0 === n.getTaskAttribute(r.DownloadKernel.TaskAttribute.DownloadSubTask)) continue;
                let a = n.getTaskStatus();
                a !== r.DownloadKernel.TaskStatus.Started && a !== r.DownloadKernel.TaskStatus.StartPending || (e++, t = i)
            }
            if (e < this.startTaskCount && t < this.subTasks.length) for (let i = t + 1; i < this.subTasks.length; ++i) {
                let t = this.subTasks[i];
                if (!t) continue;
                if (0 === t.getTaskAttribute(r.DownloadKernel.TaskAttribute.DownloadSubTask)) continue;
                let n = t.getTaskStatus();
                if (n !== r.DownloadKernel.TaskStatus.Succeeded && n !== r.DownloadKernel.TaskStatus.Seeding && n !== r.DownloadKernel.TaskStatus.Failed && t.start() && ++e >= this.startTaskCount) break
            }
        }

        updateTaskDetail() {
            let e = r.DownloadKernel.TaskDetailChangedFlags.UnKnown, t = this.getTaskSizeInfo();
            if (t.downloadSpeed > 0) if (0 === this.startTime) this.startTime = (new Date).getTime(), this.downloadingPeriod = this.task.getTaskAttribute(r.DownloadKernel.TaskAttribute.DownloadingPeriod); else {
                let t = ((new Date).getTime() - this.startTime) / 1e3, i = this.downloadingPeriod + Math.round(t);
                this.task.internalSetDownloadingPeriod(i) && (e |= r.DownloadKernel.TaskDetailChangedFlags.DownloadingPeriod)
            } else this.startTime = 0;
            this.task.internalSetTaskSpeed(t.downloadSpeed, t.vipSpeed) && (e |= r.DownloadKernel.TaskDetailChangedFlags.TaskSpeed), this.task.internalSetFileSize(t.fileSize) && (e |= r.DownloadKernel.TaskDetailChangedFlags.FileSize), this.task.internalSetDownloadSize(t.downloadSize) && (e |= r.DownloadKernel.TaskDetailChangedFlags.DownloadSize), this.task.internalSetReceivedSize(t.receivedSize) && (e |= r.DownloadKernel.TaskDetailChangedFlags.ReceivedSize), this.task.internalSetSrcUsing(t.usingResCount) && (e |= r.DownloadKernel.TaskDetailChangedFlags.SrcUsing), this.task.internalSetSrcTotal(t.totalResCount) && (e |= r.DownloadKernel.TaskDetailChangedFlags.SrcTotal), this.task.internalSetTaskChannelInfo(t.channelInfo) && (e |= r.DownloadKernel.TaskDetailChangedFlags.ChannelInfo), h.fireTaskEvent(r.DownloadKernel.TaskEventType.DetailChanged, [this.task], e)
        }
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(0), a = i(3), o = i(299), r = i(402), s = n.default.getLogger("DownloadKernel.PrivateCategory");

    class l extends r.Category {
        constructor(e) {
            super(e);
            let t = new o.CategoryView(e, a.DownloadKernel.CategroyViewID.Downloading),
                i = new o.CategoryView(e, a.DownloadKernel.CategroyViewID.Completed);
            this.categoryViews.push(t), this.categoryViews.push(i)
        }

        static createCategoryFromData(e) {
            let t = e.categoryId;
            if (void 0 === t || t < 0) return null;
            s.information("createCategoryFromData ", e);
            let i = new l(t);
            return i.setName(e.name), i.setParentId(e.parentId), i.setNextId(e.nextId), i.setStatus(e.status), i.setDescription(e.description), i.setDefaultPath(e.defaultPath), i.setUserName(e.userName), i.setPassword(e.password, e.passwordV2), i.setAccountPassword(e.accountPassword), i
        }
    }

    t.PrivateCategory = l
}, function (e, t, i) {
    "use strict";
    var n = i(48), a = i(404), o = i(495), r = i(300);

    function s(e) {
        var t = new o(e), i = a(o.prototype.request, t);
        return n.extend(i, o.prototype, t), n.extend(i, t), i
    }

    var l = s(r);
    l.Axios = o, l.create = function (e) {
        return s(n.merge(r, e))
    }, l.Cancel = i(412), l.CancelToken = i(512), l.isCancel = i(411), l.all = function (e) {
        return Promise.all(e)
    }, l.spread = i(513), e.exports = l, e.exports.default = l
}, function (e, t) {
    function i(e) {
        return !!e.constructor && "function" == typeof e.constructor.isBuffer && e.constructor.isBuffer(e)
    }

    /*!
 * Determine if an object is a Buffer
 *
 * @author   Feross Aboukhadijeh <https://feross.org>
 * @license  MIT
 */
    e.exports = function (e) {
        return null != e && (i(e) || function (e) {
            return "function" == typeof e.readFloatLE && "function" == typeof e.slice && i(e.slice(0, 0))
        }(e) || !!e._isBuffer)
    }
}, function (e, t, i) {
    "use strict";
    var n = i(300), a = i(48), o = i(507), r = i(508);

    function s(e) {
        this.defaults = e, this.interceptors = {request: new o, response: new o}
    }

    s.prototype.request = function (e) {
        "string" == typeof e && (e = a.merge({url: arguments[0]}, arguments[1])), (e = a.merge(n, {method: "get"}, this.defaults, e)).method = e.method.toLowerCase();
        var t = [r, void 0], i = Promise.resolve(e);
        for (this.interceptors.request.forEach(function (e) {
            t.unshift(e.fulfilled, e.rejected)
        }), this.interceptors.response.forEach(function (e) {
            t.push(e.fulfilled, e.rejected)
        }); t.length;) i = i.then(t.shift(), t.shift());
        return i
    }, a.forEach(["delete", "get", "head", "options"], function (e) {
        s.prototype[e] = function (t, i) {
            return this.request(a.merge(i || {}, {method: e, url: t}))
        }
    }), a.forEach(["post", "put", "patch"], function (e) {
        s.prototype[e] = function (t, i, n) {
            return this.request(a.merge(n || {}, {method: e, url: t, data: i}))
        }
    }), e.exports = s
}, function (e, t, i) {
    "use strict";
    var n = i(48);
    e.exports = function (e, t) {
        n.forEach(e, function (i, n) {
            n !== t && n.toUpperCase() === t.toUpperCase() && (e[t] = i, delete e[n])
        })
    }
}, function (e, t, i) {
    "use strict";
    var n = i(48), a = i(405), o = i(407), r = i(498), s = i(499), l = i(301),
        d = "undefined" != typeof window && window.btoa && window.btoa.bind(window) || i(500);
    e.exports = function (e) {
        return new Promise(function (t, u) {
            var c = e.data, h = e.headers;
            n.isFormData(c) && delete h["Content-Type"];
            var f = new XMLHttpRequest, g = "onreadystatechange", p = !1;
            if ("undefined" == typeof window || !window.XDomainRequest || "withCredentials" in f || s(e.url) || (f = new window.XDomainRequest, g = "onload", p = !0, f.onprogress = function () {
            }, f.ontimeout = function () {
            }), e.auth) {
                var v = e.auth.username || "", m = e.auth.password || "";
                h.Authorization = "Basic " + d(v + ":" + m)
            }
            if (f.open(e.method.toUpperCase(), o(e.url, e.params, e.paramsSerializer), !0), f.timeout = e.timeout, f[g] = function () {
                if (f && (4 === f.readyState || p) && (0 !== f.status || f.responseURL && 0 === f.responseURL.indexOf("file:"))) {
                    var i = "getAllResponseHeaders" in f ? r(f.getAllResponseHeaders()) : null, n = {
                        data: e.responseType && "text" !== e.responseType ? f.response : f.responseText,
                        status: 1223 === f.status ? 204 : f.status,
                        statusText: 1223 === f.status ? "No Content" : f.statusText,
                        headers: i,
                        config: e,
                        request: f
                    };
                    a(t, u, n), f = null
                }
            }, f.onerror = function () {
                u(l("Network Error", e, null, f)), f = null
            }, f.ontimeout = function () {
                u(l("timeout of " + e.timeout + "ms exceeded", e, "ECONNABORTED", f)), f = null
            }, n.isStandardBrowserEnv()) {
                var y = i(501),
                    k = (e.withCredentials || s(e.url)) && e.xsrfCookieName ? y.read(e.xsrfCookieName) : void 0;
                k && (h[e.xsrfHeaderName] = k)
            }
            if ("setRequestHeader" in f && n.forEach(h, function (e, t) {
                void 0 === c && "content-type" === t.toLowerCase() ? delete h[t] : f.setRequestHeader(t, e)
            }), e.withCredentials && (f.withCredentials = !0), e.responseType) try {
                f.responseType = e.responseType
            } catch (t) {
                if ("json" !== e.responseType) throw t
            }
            "function" == typeof e.onDownloadProgress && f.addEventListener("progress", e.onDownloadProgress), "function" == typeof e.onUploadProgress && f.upload && f.upload.addEventListener("progress", e.onUploadProgress), e.cancelToken && e.cancelToken.promise.then(function (e) {
                f && (f.abort(), u(e), f = null)
            }), void 0 === c && (c = null), f.send(c)
        })
    }
}, function (e, t, i) {
    "use strict";
    var n = i(48),
        a = ["age", "authorization", "content-length", "content-type", "etag", "expires", "from", "host", "if-modified-since", "if-unmodified-since", "last-modified", "location", "max-forwards", "proxy-authorization", "referer", "retry-after", "user-agent"];
    e.exports = function (e) {
        var t, i, o, r = {};
        return e ? (n.forEach(e.split("\n"), function (e) {
            if (o = e.indexOf(":"), t = n.trim(e.substr(0, o)).toLowerCase(), i = n.trim(e.substr(o + 1)), t) {
                if (r[t] && a.indexOf(t) >= 0) return;
                r[t] = "set-cookie" === t ? (r[t] ? r[t] : []).concat([i]) : r[t] ? r[t] + ", " + i : i
            }
        }), r) : r
    }
}, function (e, t, i) {
    "use strict";
    var n = i(48);
    e.exports = n.isStandardBrowserEnv() ? function () {
        var e, t = /(msie|trident)/i.test(navigator.userAgent), i = document.createElement("a");

        function a(e) {
            var n = e;
            return t && (i.setAttribute("href", n), n = i.href), i.setAttribute("href", n), {
                href: i.href,
                protocol: i.protocol ? i.protocol.replace(/:$/, "") : "",
                host: i.host,
                search: i.search ? i.search.replace(/^\?/, "") : "",
                hash: i.hash ? i.hash.replace(/^#/, "") : "",
                hostname: i.hostname,
                port: i.port,
                pathname: "/" === i.pathname.charAt(0) ? i.pathname : "/" + i.pathname
            }
        }

        return e = a(window.location.href), function (t) {
            var i = n.isString(t) ? a(t) : t;
            return i.protocol === e.protocol && i.host === e.host
        }
    }() : function () {
        return !0
    }
}, function (e, t, i) {
    "use strict";
    var n = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";

    function a() {
        this.message = "String contains an invalid character"
    }

    a.prototype = new Error, a.prototype.code = 5, a.prototype.name = "InvalidCharacterError", e.exports = function (e) {
        for (var t, i, o = String(e), r = "", s = 0, l = n; o.charAt(0 | s) || (l = "=", s % 1); r += l.charAt(63 & t >> 8 - s % 1 * 8)) {
            if ((i = o.charCodeAt(s += .75)) > 255) throw new a;
            t = t << 8 | i
        }
        return r
    }
}, function (e, t, i) {
    "use strict";
    var n = i(48);
    e.exports = n.isStandardBrowserEnv() ? {
        write: function (e, t, i, a, o, r) {
            var s = [];
            s.push(e + "=" + encodeURIComponent(t)), n.isNumber(i) && s.push("expires=" + new Date(i).toGMTString()), n.isString(a) && s.push("path=" + a), n.isString(o) && s.push("domain=" + o), !0 === r && s.push("secure"), document.cookie = s.join("; ")
        }, read: function (e) {
            var t = document.cookie.match(new RegExp("(^|;\\s*)(" + e + ")=([^;]*)"));
            return t ? decodeURIComponent(t[3]) : null
        }, remove: function (e) {
            this.write(e, "", Date.now() - 864e5)
        }
    } : {
        write: function () {
        }, read: function () {
            return null
        }, remove: function () {
        }
    }
}, function (e, t) {
    e.exports = require("assert")
}, function (e, t, i) {
    function n() {
        var e;
        try {
            e = t.storage.debug
        } catch (e) {
        }
        return !e && "undefined" != typeof process && "env" in process && (e = process.env.DEBUG), e
    }

    (t = e.exports = i(504)).log = function () {
        return "object" == typeof console && console.log && Function.prototype.apply.call(console.log, console, arguments)
    }, t.formatArgs = function (e) {
        var i = this.useColors;
        if (e[0] = (i ? "%c" : "") + this.namespace + (i ? " %c" : " ") + e[0] + (i ? "%c " : " ") + "+" + t.humanize(this.diff), !i) return;
        var n = "color: " + this.color;
        e.splice(1, 0, n, "color: inherit");
        var a = 0, o = 0;
        e[0].replace(/%[a-zA-Z%]/g, function (e) {
            "%%" !== e && "%c" === e && (o = ++a)
        }), e.splice(o, 0, n)
    }, t.save = function (e) {
        try {
            null == e ? t.storage.removeItem("debug") : t.storage.debug = e
        } catch (e) {
        }
    }, t.load = n, t.useColors = function () {
        if ("undefined" != typeof window && window.process && "renderer" === window.process.type) return !0;
        if ("undefined" != typeof navigator && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) return !1;
        return "undefined" != typeof document && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || "undefined" != typeof window && window.console && (window.console.firebug || window.console.exception && window.console.table) || "undefined" != typeof navigator && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || "undefined" != typeof navigator && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)
    }, t.storage = "undefined" != typeof chrome && void 0 !== chrome.storage ? chrome.storage.local : function () {
        try {
            return window.localStorage
        } catch (e) {
        }
    }(), t.colors = ["#0000CC", "#0000FF", "#0033CC", "#0033FF", "#0066CC", "#0066FF", "#0099CC", "#0099FF", "#00CC00", "#00CC33", "#00CC66", "#00CC99", "#00CCCC", "#00CCFF", "#3300CC", "#3300FF", "#3333CC", "#3333FF", "#3366CC", "#3366FF", "#3399CC", "#3399FF", "#33CC00", "#33CC33", "#33CC66", "#33CC99", "#33CCCC", "#33CCFF", "#6600CC", "#6600FF", "#6633CC", "#6633FF", "#66CC00", "#66CC33", "#9900CC", "#9900FF", "#9933CC", "#9933FF", "#99CC00", "#99CC33", "#CC0000", "#CC0033", "#CC0066", "#CC0099", "#CC00CC", "#CC00FF", "#CC3300", "#CC3333", "#CC3366", "#CC3399", "#CC33CC", "#CC33FF", "#CC6600", "#CC6633", "#CC9900", "#CC9933", "#CCCC00", "#CCCC33", "#FF0000", "#FF0033", "#FF0066", "#FF0099", "#FF00CC", "#FF00FF", "#FF3300", "#FF3333", "#FF3366", "#FF3399", "#FF33CC", "#FF33FF", "#FF6600", "#FF6633", "#FF9900", "#FF9933", "#FFCC00", "#FFCC33"], t.formatters.j = function (e) {
        try {
            return JSON.stringify(e)
        } catch (e) {
            return "[UnexpectedJSONParseError]: " + e.message
        }
    }, t.enable(n())
}, function (e, t, i) {
    function n(e) {
        var i;

        function n() {
            if (n.enabled) {
                var e = n, a = +new Date, o = a - (i || a);
                e.diff = o, e.prev = i, e.curr = a, i = a;
                for (var r = new Array(arguments.length), s = 0; s < r.length; s++) r[s] = arguments[s];
                r[0] = t.coerce(r[0]), "string" != typeof r[0] && r.unshift("%O");
                var l = 0;
                r[0] = r[0].replace(/%([a-zA-Z%])/g, function (i, n) {
                    if ("%%" === i) return i;
                    l++;
                    var a = t.formatters[n];
                    if ("function" == typeof a) {
                        var o = r[l];
                        i = a.call(e, o), r.splice(l, 1), l--
                    }
                    return i
                }), t.formatArgs.call(e, r), (n.log || t.log || console.log.bind(console)).apply(e, r)
            }
        }

        return n.namespace = e, n.enabled = t.enabled(e), n.useColors = t.useColors(), n.color = function (e) {
            var i, n = 0;
            for (i in e) n = (n << 5) - n + e.charCodeAt(i), n |= 0;
            return t.colors[Math.abs(n) % t.colors.length]
        }(e), n.destroy = a, "function" == typeof t.init && t.init(n), t.instances.push(n), n
    }

    function a() {
        var e = t.instances.indexOf(this);
        return -1 !== e && (t.instances.splice(e, 1), !0)
    }

    (t = e.exports = n.debug = n.default = n).coerce = function (e) {
        return e instanceof Error ? e.stack || e.message : e
    }, t.disable = function () {
        t.enable("")
    }, t.enable = function (e) {
        var i;
        t.save(e), t.names = [], t.skips = [];
        var n = ("string" == typeof e ? e : "").split(/[\s,]+/), a = n.length;
        for (i = 0; i < a; i++) n[i] && ("-" === (e = n[i].replace(/\*/g, ".*?"))[0] ? t.skips.push(new RegExp("^" + e.substr(1) + "$")) : t.names.push(new RegExp("^" + e + "$")));
        for (i = 0; i < t.instances.length; i++) {
            var o = t.instances[i];
            o.enabled = t.enabled(o.namespace)
        }
    }, t.enabled = function (e) {
        if ("*" === e[e.length - 1]) return !0;
        var i, n;
        for (i = 0, n = t.skips.length; i < n; i++) if (t.skips[i].test(e)) return !1;
        for (i = 0, n = t.names.length; i < n; i++) if (t.names[i].test(e)) return !0;
        return !1
    }, t.humanize = i(505), t.instances = [], t.names = [], t.skips = [], t.formatters = {}
}, function (e, t) {
    var i = 1e3, n = 60 * i, a = 60 * n, o = 24 * a, r = 365.25 * o;

    function s(e, t, i) {
        if (!(e < t)) return e < 1.5 * t ? Math.floor(e / t) + " " + i : Math.ceil(e / t) + " " + i + "s"
    }

    e.exports = function (e, t) {
        t = t || {};
        var l, d = typeof e;
        if ("string" === d && e.length > 0) return function (e) {
            if ((e = String(e)).length > 100) return;
            var t = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);
            if (!t) return;
            var s = parseFloat(t[1]);
            switch ((t[2] || "ms").toLowerCase()) {
                case"years":
                case"year":
                case"yrs":
                case"yr":
                case"y":
                    return s * r;
                case"days":
                case"day":
                case"d":
                    return s * o;
                case"hours":
                case"hour":
                case"hrs":
                case"hr":
                case"h":
                    return s * a;
                case"minutes":
                case"minute":
                case"mins":
                case"min":
                case"m":
                    return s * n;
                case"seconds":
                case"second":
                case"secs":
                case"sec":
                case"s":
                    return s * i;
                case"milliseconds":
                case"millisecond":
                case"msecs":
                case"msec":
                case"ms":
                    return s;
                default:
                    return
            }
        }(e);
        if ("number" === d && !1 === isNaN(e)) return t.long ? s(l = e, o, "day") || s(l, a, "hour") || s(l, n, "minute") || s(l, i, "second") || l + " ms" : function (e) {
            if (e >= o) return Math.round(e / o) + "d";
            if (e >= a) return Math.round(e / a) + "h";
            if (e >= n) return Math.round(e / n) + "m";
            if (e >= i) return Math.round(e / i) + "s";
            return e + "ms"
        }(e);
        throw new Error("val is not a non-empty string or a valid number. val=" + JSON.stringify(e))
    }
}, function (e) {
    e.exports = {
        _args: [["axios@0.18.0", "D:\\thunder11\\trunk\\build\\app"]],
        _from: "axios@0.18.0",
        _id: "axios@0.18.0",
        _inBundle: !1,
        _integrity: "sha1-MtU+SFHv3AoRmTts0AB4nXDAUQI=",
        _location: "/axios",
        _phantomChildren: {},
        _requested: {
            type: "version",
            registry: !0,
            raw: "axios@0.18.0",
            name: "axios",
            escapedName: "axios",
            rawSpec: "0.18.0",
            saveSpec: null,
            fetchSpec: "0.18.0"
        },
        _requiredBy: ["/", "/@types/axios", "/@xunlei/thunderx-login-main"],
        _resolved: "http://xnpm.repo.xunlei.cn/axios/-/axios-0.18.0.tgz",
        _spec: "0.18.0",
        _where: "D:\\thunder11\\trunk\\build\\app",
        author: {name: "Matt Zabriskie"},
        browser: {"./lib/adapters/http.js": "./lib/adapters/xhr.js"},
        bugs: {url: "https://github.com/axios/axios/issues"},
        bundlesize: [{path: "./dist/axios.min.js", threshold: "5kB"}],
        dependencies: {"follow-redirects": "^1.3.0", "is-buffer": "^1.1.5"},
        description: "Promise based HTTP client for the browser and node.js",
        devDependencies: {
            bundlesize: "^0.5.7",
            coveralls: "^2.11.9",
            "es6-promise": "^4.0.5",
            grunt: "^1.0.1",
            "grunt-banner": "^0.6.0",
            "grunt-cli": "^1.2.0",
            "grunt-contrib-clean": "^1.0.0",
            "grunt-contrib-nodeunit": "^1.0.0",
            "grunt-contrib-watch": "^1.0.0",
            "grunt-eslint": "^19.0.0",
            "grunt-karma": "^2.0.0",
            "grunt-ts": "^6.0.0-beta.3",
            "grunt-webpack": "^1.0.18",
            "istanbul-instrumenter-loader": "^1.0.0",
            "jasmine-core": "^2.4.1",
            karma: "^1.3.0",
            "karma-chrome-launcher": "^2.0.0",
            "karma-coverage": "^1.0.0",
            "karma-firefox-launcher": "^1.0.0",
            "karma-jasmine": "^1.0.2",
            "karma-jasmine-ajax": "^0.1.13",
            "karma-opera-launcher": "^1.0.0",
            "karma-safari-launcher": "^1.0.0",
            "karma-sauce-launcher": "^1.1.0",
            "karma-sinon": "^1.0.5",
            "karma-sourcemap-loader": "^0.3.7",
            "karma-webpack": "^1.7.0",
            "load-grunt-tasks": "^3.5.2",
            minimist: "^1.2.0",
            sinon: "^1.17.4",
            typescript: "^2.0.3",
            "url-search-params": "^0.6.1",
            webpack: "^1.13.1",
            "webpack-dev-server": "^1.14.1"
        },
        homepage: "https://github.com/axios/axios",
        keywords: ["xhr", "http", "ajax", "promise", "node"],
        license: "MIT",
        main: "index.js",
        name: "axios",
        repository: {type: "git", url: "git+https://github.com/axios/axios.git"},
        scripts: {
            build: "NODE_ENV=production grunt build",
            coveralls: "cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",
            examples: "node ./examples/server.js",
            postversion: "git push && git push --tags",
            preversion: "npm test",
            start: "node ./sandbox/server.js",
            test: "grunt test && bundlesize",
            version: "npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json"
        },
        typings: "./index.d.ts",
        version: "0.18.0"
    }
}, function (e, t, i) {
    "use strict";
    var n = i(48);

    function a() {
        this.handlers = []
    }

    a.prototype.use = function (e, t) {
        return this.handlers.push({fulfilled: e, rejected: t}), this.handlers.length - 1
    }, a.prototype.eject = function (e) {
        this.handlers[e] && (this.handlers[e] = null)
    }, a.prototype.forEach = function (e) {
        n.forEach(this.handlers, function (t) {
            null !== t && e(t)
        })
    }, e.exports = a
}, function (e, t, i) {
    "use strict";
    var n = i(48), a = i(509), o = i(411), r = i(300), s = i(510), l = i(511);

    function d(e) {
        e.cancelToken && e.cancelToken.throwIfRequested()
    }

    e.exports = function (e) {
        return d(e), e.baseURL && !s(e.url) && (e.url = l(e.baseURL, e.url)), e.headers = e.headers || {}, e.data = a(e.data, e.headers, e.transformRequest), e.headers = n.merge(e.headers.common || {}, e.headers[e.method] || {}, e.headers || {}), n.forEach(["delete", "get", "head", "post", "put", "patch", "common"], function (t) {
            delete e.headers[t]
        }), (e.adapter || r.adapter)(e).then(function (t) {
            return d(e), t.data = a(t.data, t.headers, e.transformResponse), t
        }, function (t) {
            return o(t) || (d(e), t && t.response && (t.response.data = a(t.response.data, t.response.headers, e.transformResponse))), Promise.reject(t)
        })
    }
}, function (e, t, i) {
    "use strict";
    var n = i(48);
    e.exports = function (e, t, i) {
        return n.forEach(i, function (i) {
            e = i(e, t)
        }), e
    }
}, function (e, t, i) {
    "use strict";
    e.exports = function (e) {
        return /^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)
    }
}, function (e, t, i) {
    "use strict";
    e.exports = function (e, t) {
        return t ? e.replace(/\/+$/, "") + "/" + t.replace(/^\/+/, "") : e
    }
}, function (e, t, i) {
    "use strict";
    var n = i(412);

    function a(e) {
        if ("function" != typeof e) throw new TypeError("executor must be a function.");
        var t;
        this.promise = new Promise(function (e) {
            t = e
        });
        var i = this;
        e(function (e) {
            i.reason || (i.reason = new n(e), t(i.reason))
        })
    }

    a.prototype.throwIfRequested = function () {
        if (this.reason) throw this.reason
    }, a.source = function () {
        var e;
        return {
            token: new a(function (t) {
                e = t
            }), cancel: e
        }
    }, e.exports = a
}, function (e, t, i) {
    "use strict";
    e.exports = function (e) {
        return function (t) {
            return e.apply(null, t)
        }
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = new class {
        getUserInfo(e, t) {
            let i = "string" == typeof e ? e : "", n = "function" == typeof e ? e : t;
            this.getXdasDatas("memory", "userinfo", function (e) {
                if (e) {
                    let t = "" !== i ? e[i] : e;
                    n && n(t)
                } else n && n(null)
            })
        }

        getAllUserInfo(e, t) {
            let i = "string" == typeof e ? e : "", n = "function" == typeof e ? e : t;
            this.getXdasDatas("memory", "allUserInfo", function (e) {
                if (e) {
                    let t = "" !== i ? e[i] : e;
                    n && n(t)
                } else n && n(null)
            })
        }

        logout() {
            this.saveToXdas("memory", "userinfo", JSON.stringify({userid: "", sessionid: "", loginType: "1"}))
        }

        switchAccount() {
            this.saveToXdas("memory", "userinfo", JSON.stringify({userid: "", sessionid: "", loginType: "2"}))
        }

        retryLogin() {
            this.saveToXdas("memory", "userinfo", JSON.stringify({loginType: "3"}))
        }

        saveToXdas(e, t, i) {
            global.xlNativeCallModule.nativeCall.CallNativeFunction("SaveLoginData", e, t, i, function (e, t) {
            })
        }

        isLogined(e) {
            this.getUserInfo(null, function (t) {
                t && t.userid && "" !== t.userid ? e(!0) : e(!1)
            })
        }

        isAutologin(e) {
            this.getXdasDatas("file", "users", function (t) {
                let i = t || [];
                if (0 == i.length) e(!1); else {
                    let t = i[0];
                    e(!!t.xl_autologin)
                }
            })
        }

        getXdasDatas(e, t, i) {
            global.xlNativeCallModule.nativeCall.CallNativeFunction("LoadLoginData", e, t, function (e, t) {
                let n = "" !== t ? JSON.parse(t) : null;
                i && i(n)
            })
        }

        channel(e) {
            this.saveToXdas("memory", "channel", e)
        }
    };
    t.xlQuickLogin = n
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(5), o = i(25), r = i(13), s = i(10), l = i(109), d = i(0).default.getLogger("Activity");
    t.activityObj = new class {
        constructor() {
            this.activityEnable = !1, this.activityCssPath = "", this.activityUrl = ""
        }

        getActiveConfig() {
            return n(this, void 0, void 0, function* () {
                do {
                    this.activityEnable = !1, yield o.default.isInitedAw();
                    let e = o.default.getConfigInfo("activity", "enable");
                    if (d.information("getActiveConfig activityEnable:", e), null === e || void 0 === e) break;
                    if (1 !== e) break;
                    let t = o.default.getConfigInfo("activity", "url");
                    if (null === t || void 0 === t || "" === t) {
                        d.information("活动url为空");
                        break
                    }
                    let i = `${__rootDir}/static/activity/css/xlx-login-act.css`;
                    if (yield a.FileSystemAWNS.existsAW(i)) {
                        this.activityEnable = !0, this.activityCssPath = i, this.activityUrl = t;
                        let e = {
                            priority: l.LoginOptionNS.Priority.High,
                            perpetual: !0,
                            tabUrl: this.activityUrl,
                            stat: {logfrom: "activity_vip_get"}
                        };
                        l.LoginOptionNS.loginOption.setOption(e)
                    } else d.information("活动css不存在：", i), this.activityEnable = !1, this.activityCssPath = ""
                } while (0);
                d.information("getActiveConfig:", this.activityEnable, this.activityCssPath, this.activityUrl)
            })
        }

        isHaverActivityAw(e) {
            return n(this, void 0, void 0, function* () {
                let t = !1;
                do {
                    if (null === this.activityEnable || void 0 === this.activityEnable || !1 === this.activityEnable) break;
                    if ("auto" === e) {
                        let e = yield this.getActivityTimerAw();
                        t = this.getCurDate() !== e
                    } else !0 === this.activityEnable && (t = !0)
                } while (0);
                return t
            })
        }

        getActivityInfo() {
            return {
                activityEnable: this.activityEnable,
                activityCssPath: this.activityCssPath,
                activityUrl: this.activityUrl
            }
        }

        setActivityConfig() {
            let e = this.getCurDate();
            s.ConfigNS.setValue("Activity", "Date", e)
        }

        getCurDate() {
            let e = "", t = new Date;
            return e = `${t.getFullYear()}${t.getMonth() + 1}${t.getDate()}`
        }

        getActivityTimerAw() {
            return n(this, void 0, void 0, function* () {
                return new Promise(e => {
                    s.ConfigNS.attachListener(r.NodeEventMesssageNS.eventConfigInitFinished, () => {
                        let t = s.ConfigNS.getValue("Activity", "Date", "");
                        e(t)
                    })
                })
            })
        }
    }
}, function (e, t, i) {
    (function () {
        "use strict";
        var e, n, a, o, r, s = {}.hasOwnProperty;
        e = i(517), n = i(308).defaults, o = function (e) {
            return "string" == typeof e && (e.indexOf("&") >= 0 || e.indexOf(">") >= 0 || e.indexOf("<") >= 0)
        }, r = function (e) {
            return "<![CDATA[" + a(e) + "]]>"
        }, a = function (e) {
            return e.replace("]]>", "]]]]><![CDATA[>")
        }, t.Builder = function () {
            function t(e) {
                var t, i, a;
                for (t in this.options = {}, i = n[.2]) s.call(i, t) && (a = i[t], this.options[t] = a);
                for (t in e) s.call(e, t) && (a = e[t], this.options[t] = a)
            }

            return t.prototype.buildObject = function (t) {
                var i, a, l, d, u, c;
                return i = this.options.attrkey, a = this.options.charkey, 1 === Object.keys(t).length && this.options.rootName === n[.2].rootName ? t = t[u = Object.keys(t)[0]] : u = this.options.rootName, c = this, l = function (e, t) {
                    var n, d, u, h, f, g;
                    if ("object" != typeof t) c.options.cdata && o(t) ? e.raw(r(t)) : e.txt(t); else if (Array.isArray(t)) {
                        for (h in t) if (s.call(t, h)) for (f in d = t[h]) u = d[f], e = l(e.ele(f), u).up()
                    } else for (f in t) if (s.call(t, f)) if (d = t[f], f === i) {
                        if ("object" == typeof d) for (n in d) g = d[n], e = e.att(n, g)
                    } else if (f === a) e = c.options.cdata && o(d) ? e.raw(r(d)) : e.txt(d); else if (Array.isArray(d)) for (h in d) s.call(d, h) && (e = "string" == typeof (u = d[h]) ? c.options.cdata && o(u) ? e.ele(f).raw(r(u)).up() : e.ele(f, u).up() : l(e.ele(f), u).up()); else "object" == typeof d ? e = l(e.ele(f), d).up() : "string" == typeof d && c.options.cdata && o(d) ? e = e.ele(f).raw(r(d)).up() : (null == d && (d = ""), e = e.ele(f, d.toString()).up());
                    return e
                }, d = e.create(u, this.options.xmldec, this.options.doctype, {
                    headless: this.options.headless,
                    allowSurrogateChars: this.options.allowSurrogateChars
                }), l(d, t).end(this.options.renderOpts)
            }, t
        }()
    }).call(this)
}, function (e, t, i) {
    (function () {
        var t, n, a, o, r, s, l;
        l = i(66), r = l.assign, s = l.isFunction, t = i(518), n = i(519), o = i(309), a = i(520), e.exports.create = function (e, i, n, a) {
            var o, s;
            if (null == e) throw new Error("Root element needs a name");
            return a = r({}, i, n, a), s = (o = new t(a)).element(e), a.headless || (o.declaration(a), null == a.pubID && null == a.sysID || o.doctype(a)), s
        }, e.exports.begin = function (e, i, a) {
            var o;
            return s(e) && (i = (o = [e, i])[0], a = o[1], e = {}), i ? new n(e, i, a) : new t(e)
        }, e.exports.stringWriter = function (e) {
            return new o(e)
        }, e.exports.streamWriter = function (e, t) {
            return new a(e, t)
        }
    }).call(this)
}, function (e, t, i) {
    (function () {
        var t, n, a, o, r = {}.hasOwnProperty;
        o = i(66).isPlainObject, t = i(50), a = i(419), n = i(309), e.exports = function (e) {
            function i(e) {
                i.__super__.constructor.call(this, null), e || (e = {}), e.writer || (e.writer = new n), this.options = e, this.stringify = new a(e), this.isDocument = !0
            }

            return function (e, t) {
                for (var i in t) r.call(t, i) && (e[i] = t[i]);

                function n() {
                    this.constructor = e
                }

                n.prototype = t.prototype, e.prototype = new n, e.__super__ = t.prototype
            }(i, t), i.prototype.end = function (e) {
                var t;
                return e ? o(e) && (t = e, e = this.options.writer.set(t)) : e = this.options.writer, e.document(this)
            }, i.prototype.toString = function (e) {
                return this.options.writer.set(e).document(this)
            }, i
        }()
    }).call(this)
}, function (e, t, i) {
    (function () {
        var t, n, a, o, r, s, l, d, u, c, h, f, g, p, v, m, y, k, T, w = {}.hasOwnProperty;
        T = i(66), y = T.isObject, m = T.isFunction, k = T.isPlainObject, c = i(112), n = i(113), a = i(114), f = i(121), v = i(122), h = i(123), d = i(115), u = i(116), o = i(117), s = i(118), r = i(119), l = i(120), t = i(418), p = i(419), g = i(309), e.exports = function () {
            function e(e, t, i) {
                var n;
                e || (e = {}), e.writer ? k(e.writer) && (n = e.writer, e.writer = new g(n)) : e.writer = new g(e), this.options = e, this.writer = e.writer, this.stringify = new p(e), this.onDataCallback = t || function () {
                }, this.onEndCallback = i || function () {
                }, this.currentNode = null, this.currentLevel = -1, this.openTags = {}, this.documentStarted = !1, this.documentCompleted = !1, this.root = null
            }

            return e.prototype.node = function (e, t, i) {
                var n;
                if (null == e) throw new Error("Missing node name");
                if (this.root && -1 === this.currentLevel) throw new Error("Document can only have one root node");
                return this.openCurrent(), e = e.valueOf(), null == t && (t = {}), t = t.valueOf(), y(t) || (i = (n = [t, i])[0], t = n[1]), this.currentNode = new c(this, e, t), this.currentNode.children = !1, this.currentLevel++, this.openTags[this.currentLevel] = this.currentNode, null != i && this.text(i), this
            }, e.prototype.element = function (e, t, i) {
                return this.currentNode && this.currentNode instanceof u ? this.dtdElement.apply(this, arguments) : this.node(e, t, i)
            }, e.prototype.attribute = function (e, i) {
                var n, a;
                if (!this.currentNode || this.currentNode.children) throw new Error("att() can only be used immediately after an ele() call in callback mode");
                if (null != e && (e = e.valueOf()), y(e)) for (n in e) w.call(e, n) && (a = e[n], this.attribute(n, a)); else m(i) && (i = i.apply()), this.options.skipNullAttributes && null == i || (this.currentNode.attributes[e] = new t(this, e, i));
                return this
            }, e.prototype.text = function (e) {
                var t;
                return this.openCurrent(), t = new v(this, e), this.onData(this.writer.text(t, this.currentLevel + 1)), this
            }, e.prototype.cdata = function (e) {
                var t;
                return this.openCurrent(), t = new n(this, e), this.onData(this.writer.cdata(t, this.currentLevel + 1)), this
            }, e.prototype.comment = function (e) {
                var t;
                return this.openCurrent(), t = new a(this, e), this.onData(this.writer.comment(t, this.currentLevel + 1)), this
            }, e.prototype.raw = function (e) {
                var t;
                return this.openCurrent(), t = new f(this, e), this.onData(this.writer.raw(t, this.currentLevel + 1)), this
            }, e.prototype.instruction = function (e, t) {
                var i, n, a, o, r;
                if (this.openCurrent(), null != e && (e = e.valueOf()), null != t && (t = t.valueOf()), Array.isArray(e)) for (i = 0, o = e.length; i < o; i++) n = e[i], this.instruction(n); else if (y(e)) for (n in e) w.call(e, n) && (a = e[n], this.instruction(n, a)); else m(t) && (t = t.apply()), r = new h(this, e, t), this.onData(this.writer.processingInstruction(r, this.currentLevel + 1));
                return this
            }, e.prototype.declaration = function (e, t, i) {
                var n;
                if (this.openCurrent(), this.documentStarted) throw new Error("declaration() must be the first node");
                return n = new d(this, e, t, i), this.onData(this.writer.declaration(n, this.currentLevel + 1)), this
            }, e.prototype.doctype = function (e, t, i) {
                if (this.openCurrent(), null == e) throw new Error("Missing root node name");
                if (this.root) throw new Error("dtd() must come before the root node");
                return this.currentNode = new u(this, t, i), this.currentNode.rootNodeName = e, this.currentNode.children = !1, this.currentLevel++, this.openTags[this.currentLevel] = this.currentNode, this
            }, e.prototype.dtdElement = function (e, t) {
                var i;
                return this.openCurrent(), i = new r(this, e, t), this.onData(this.writer.dtdElement(i, this.currentLevel + 1)), this
            }, e.prototype.attList = function (e, t, i, n, a) {
                var r;
                return this.openCurrent(), r = new o(this, e, t, i, n, a), this.onData(this.writer.dtdAttList(r, this.currentLevel + 1)), this
            }, e.prototype.entity = function (e, t) {
                var i;
                return this.openCurrent(), i = new s(this, !1, e, t), this.onData(this.writer.dtdEntity(i, this.currentLevel + 1)), this
            }, e.prototype.pEntity = function (e, t) {
                var i;
                return this.openCurrent(), i = new s(this, !0, e, t), this.onData(this.writer.dtdEntity(i, this.currentLevel + 1)), this
            }, e.prototype.notation = function (e, t) {
                var i;
                return this.openCurrent(), i = new l(this, e, t), this.onData(this.writer.dtdNotation(i, this.currentLevel + 1)), this
            }, e.prototype.up = function () {
                if (this.currentLevel < 0) throw new Error("The document node has no parent");
                return this.currentNode ? (this.currentNode.children ? this.closeNode(this.currentNode) : this.openNode(this.currentNode), this.currentNode = null) : this.closeNode(this.openTags[this.currentLevel]), delete this.openTags[this.currentLevel], this.currentLevel--, this
            }, e.prototype.end = function () {
                for (; this.currentLevel >= 0;) this.up();
                return this.onEnd()
            }, e.prototype.openCurrent = function () {
                if (this.currentNode) return this.currentNode.children = !0, this.openNode(this.currentNode)
            }, e.prototype.openNode = function (e) {
                if (!e.isOpen) return !this.root && 0 === this.currentLevel && e instanceof c && (this.root = e), this.onData(this.writer.openNode(e, this.currentLevel)), e.isOpen = !0
            }, e.prototype.closeNode = function (e) {
                if (!e.isClosed) return this.onData(this.writer.closeNode(e, this.currentLevel)), e.isClosed = !0
            }, e.prototype.onData = function (e) {
                return this.documentStarted = !0, this.onDataCallback(e)
            }, e.prototype.onEnd = function () {
                return this.documentCompleted = !0, this.onEndCallback()
            }, e.prototype.ele = function () {
                return this.element.apply(this, arguments)
            }, e.prototype.nod = function (e, t, i) {
                return this.node(e, t, i)
            }, e.prototype.txt = function (e) {
                return this.text(e)
            }, e.prototype.dat = function (e) {
                return this.cdata(e)
            }, e.prototype.com = function (e) {
                return this.comment(e)
            }, e.prototype.ins = function (e, t) {
                return this.instruction(e, t)
            }, e.prototype.dec = function (e, t, i) {
                return this.declaration(e, t, i)
            }, e.prototype.dtd = function (e, t, i) {
                return this.doctype(e, t, i)
            }, e.prototype.e = function (e, t, i) {
                return this.element(e, t, i)
            }, e.prototype.n = function (e, t, i) {
                return this.node(e, t, i)
            }, e.prototype.t = function (e) {
                return this.text(e)
            }, e.prototype.d = function (e) {
                return this.cdata(e)
            }, e.prototype.c = function (e) {
                return this.comment(e)
            }, e.prototype.r = function (e) {
                return this.raw(e)
            }, e.prototype.i = function (e, t) {
                return this.instruction(e, t)
            }, e.prototype.att = function () {
                return this.currentNode && this.currentNode instanceof u ? this.attList.apply(this, arguments) : this.attribute.apply(this, arguments)
            }, e.prototype.a = function () {
                return this.currentNode && this.currentNode instanceof u ? this.attList.apply(this, arguments) : this.attribute.apply(this, arguments)
            }, e.prototype.ent = function (e, t) {
                return this.entity(e, t)
            }, e.prototype.pent = function (e, t) {
                return this.pEntity(e, t)
            }, e.prototype.not = function (e, t) {
                return this.notation(e, t)
            }, e
        }()
    }).call(this)
}, function (e, t, i) {
    (function () {
        var t, n, a, o, r, s, l, d, u, c, h, f, g, p = {}.hasOwnProperty;
        l = i(115), d = i(116), t = i(113), n = i(114), u = i(112), h = i(121), f = i(122), c = i(123), a = i(117), o = i(119), r = i(118), s = i(120), g = i(420), e.exports = function (e) {
            function i(e, t) {
                i.__super__.constructor.call(this, t), this.stream = e
            }

            return function (e, t) {
                for (var i in t) p.call(t, i) && (e[i] = t[i]);

                function n() {
                    this.constructor = e
                }

                n.prototype = t.prototype, e.prototype = new n, e.__super__ = t.prototype
            }(i, g), i.prototype.document = function (e) {
                var t, i, a, o, r, s, u, h;
                for (i = 0, o = (s = e.children).length; i < o; i++) (t = s[i]).isLastRootNode = !1;
                for (e.children[e.children.length - 1].isLastRootNode = !0, h = [], a = 0, r = (u = e.children).length; a < r; a++) switch (t = u[a], !1) {
                    case!(t instanceof l):
                        h.push(this.declaration(t));
                        break;
                    case!(t instanceof d):
                        h.push(this.docType(t));
                        break;
                    case!(t instanceof n):
                        h.push(this.comment(t));
                        break;
                    case!(t instanceof c):
                        h.push(this.processingInstruction(t));
                        break;
                    default:
                        h.push(this.element(t))
                }
                return h
            }, i.prototype.attribute = function (e) {
                return this.stream.write(" " + e.name + '="' + e.value + '"')
            }, i.prototype.cdata = function (e, t) {
                return this.stream.write(this.space(t) + "<![CDATA[" + e.text + "]]>" + this.endline(e))
            }, i.prototype.comment = function (e, t) {
                return this.stream.write(this.space(t) + "\x3c!-- " + e.text + " --\x3e" + this.endline(e))
            }, i.prototype.declaration = function (e, t) {
                return this.stream.write(this.space(t)), this.stream.write('<?xml version="' + e.version + '"'), null != e.encoding && this.stream.write(' encoding="' + e.encoding + '"'), null != e.standalone && this.stream.write(' standalone="' + e.standalone + '"'), this.stream.write(this.spacebeforeslash + "?>"), this.stream.write(this.endline(e))
            }, i.prototype.docType = function (e, i) {
                var l, d, u, h;
                if (i || (i = 0), this.stream.write(this.space(i)), this.stream.write("<!DOCTYPE " + e.root().name), e.pubID && e.sysID ? this.stream.write(' PUBLIC "' + e.pubID + '" "' + e.sysID + '"') : e.sysID && this.stream.write(' SYSTEM "' + e.sysID + '"'), e.children.length > 0) {
                    for (this.stream.write(" ["), this.stream.write(this.endline(e)), d = 0, u = (h = e.children).length; d < u; d++) switch (l = h[d], !1) {
                        case!(l instanceof a):
                            this.dtdAttList(l, i + 1);
                            break;
                        case!(l instanceof o):
                            this.dtdElement(l, i + 1);
                            break;
                        case!(l instanceof r):
                            this.dtdEntity(l, i + 1);
                            break;
                        case!(l instanceof s):
                            this.dtdNotation(l, i + 1);
                            break;
                        case!(l instanceof t):
                            this.cdata(l, i + 1);
                            break;
                        case!(l instanceof n):
                            this.comment(l, i + 1);
                            break;
                        case!(l instanceof c):
                            this.processingInstruction(l, i + 1);
                            break;
                        default:
                            throw new Error("Unknown DTD node type: " + l.constructor.name)
                    }
                    this.stream.write("]")
                }
                return this.stream.write(this.spacebeforeslash + ">"), this.stream.write(this.endline(e))
            }, i.prototype.element = function (e, i) {
                var a, o, r, s, l, d, g, v;
                for (l in i || (i = 0), v = this.space(i), this.stream.write(v + "<" + e.name), d = e.attributes) p.call(d, l) && (a = d[l], this.attribute(a));
                if (0 === e.children.length || e.children.every(function (e) {
                    return "" === e.value
                })) this.allowEmpty ? this.stream.write("></" + e.name + ">") : this.stream.write(this.spacebeforeslash + "/>"); else if (this.pretty && 1 === e.children.length && null != e.children[0].value) this.stream.write(">"), this.stream.write(e.children[0].value), this.stream.write("</" + e.name + ">"); else {
                    for (this.stream.write(">" + this.newline), r = 0, s = (g = e.children).length; r < s; r++) switch (o = g[r], !1) {
                        case!(o instanceof t):
                            this.cdata(o, i + 1);
                            break;
                        case!(o instanceof n):
                            this.comment(o, i + 1);
                            break;
                        case!(o instanceof u):
                            this.element(o, i + 1);
                            break;
                        case!(o instanceof h):
                            this.raw(o, i + 1);
                            break;
                        case!(o instanceof f):
                            this.text(o, i + 1);
                            break;
                        case!(o instanceof c):
                            this.processingInstruction(o, i + 1);
                            break;
                        default:
                            throw new Error("Unknown XML node type: " + o.constructor.name)
                    }
                    this.stream.write(v + "</" + e.name + ">")
                }
                return this.stream.write(this.endline(e))
            }, i.prototype.processingInstruction = function (e, t) {
                return this.stream.write(this.space(t) + "<?" + e.target), e.value && this.stream.write(" " + e.value), this.stream.write(this.spacebeforeslash + "?>" + this.endline(e))
            }, i.prototype.raw = function (e, t) {
                return this.stream.write(this.space(t) + e.value + this.endline(e))
            }, i.prototype.text = function (e, t) {
                return this.stream.write(this.space(t) + e.value + this.endline(e))
            }, i.prototype.dtdAttList = function (e, t) {
                return this.stream.write(this.space(t) + "<!ATTLIST " + e.elementName + " " + e.attributeName + " " + e.attributeType), "#DEFAULT" !== e.defaultValueType && this.stream.write(" " + e.defaultValueType), e.defaultValue && this.stream.write(' "' + e.defaultValue + '"'), this.stream.write(this.spacebeforeslash + ">" + this.endline(e))
            }, i.prototype.dtdElement = function (e, t) {
                return this.stream.write(this.space(t) + "<!ELEMENT " + e.name + " " + e.value), this.stream.write(this.spacebeforeslash + ">" + this.endline(e))
            }, i.prototype.dtdEntity = function (e, t) {
                return this.stream.write(this.space(t) + "<!ENTITY"), e.pe && this.stream.write(" %"), this.stream.write(" " + e.name), e.value ? this.stream.write(' "' + e.value + '"') : (e.pubID && e.sysID ? this.stream.write(' PUBLIC "' + e.pubID + '" "' + e.sysID + '"') : e.sysID && this.stream.write(' SYSTEM "' + e.sysID + '"'), e.nData && this.stream.write(" NDATA " + e.nData)), this.stream.write(this.spacebeforeslash + ">" + this.endline(e))
            }, i.prototype.dtdNotation = function (e, t) {
                return this.stream.write(this.space(t) + "<!NOTATION " + e.name), e.pubID && e.sysID ? this.stream.write(' PUBLIC "' + e.pubID + '" "' + e.sysID + '"') : e.pubID ? this.stream.write(' PUBLIC "' + e.pubID + '"') : e.sysID && this.stream.write(' SYSTEM "' + e.sysID + '"'), this.stream.write(this.spacebeforeslash + ">" + this.endline(e))
            }, i.prototype.endline = function (e) {
                return e.isLastRootNode ? "" : this.newline
            }, i
        }()
    }).call(this)
}, function (e, t, i) {
    (function () {
        "use strict";
        var e, n, a, o, r, s, l, d, u = function (e, t) {
            return function () {
                return e.apply(t, arguments)
            }
        }, c = {}.hasOwnProperty;
        l = i(522), a = i(19), e = i(523), s = i(421), d = i(524).setImmediate, n = i(308).defaults, o = function (e) {
            return "object" == typeof e && null != e && 0 === Object.keys(e).length
        }, r = function (e, t, i) {
            var n, a;
            for (n = 0, a = e.length; n < a; n++) t = (0, e[n])(t, i);
            return t
        }, t.Parser = function (i) {
            function h(e) {
                var i, a, o;
                if (this.parseString = u(this.parseString, this), this.reset = u(this.reset, this), this.assignOrPush = u(this.assignOrPush, this), this.processAsync = u(this.processAsync, this), !(this instanceof t.Parser)) return new t.Parser(e);
                for (i in this.options = {}, a = n[.2]) c.call(a, i) && (o = a[i], this.options[i] = o);
                for (i in e) c.call(e, i) && (o = e[i], this.options[i] = o);
                this.options.xmlns && (this.options.xmlnskey = this.options.attrkey + "ns"), this.options.normalizeTags && (this.options.tagNameProcessors || (this.options.tagNameProcessors = []), this.options.tagNameProcessors.unshift(s.normalize)), this.reset()
            }

            return function (e, t) {
                for (var i in t) c.call(t, i) && (e[i] = t[i]);

                function n() {
                    this.constructor = e
                }

                n.prototype = t.prototype, e.prototype = new n, e.__super__ = t.prototype
            }(h, a.EventEmitter), h.prototype.processAsync = function () {
                var e, t;
                try {
                    return this.remaining.length <= this.options.chunkSize ? (e = this.remaining, this.remaining = "", this.saxParser = this.saxParser.write(e), this.saxParser.close()) : (e = this.remaining.substr(0, this.options.chunkSize), this.remaining = this.remaining.substr(this.options.chunkSize, this.remaining.length), this.saxParser = this.saxParser.write(e), d(this.processAsync))
                } catch (e) {
                    if (t = e, !this.saxParser.errThrown) return this.saxParser.errThrown = !0, this.emit(t)
                }
            }, h.prototype.assignOrPush = function (e, t, i) {
                return t in e ? (e[t] instanceof Array || (e[t] = [e[t]]), e[t].push(i)) : this.options.explicitArray ? e[t] = [i] : e[t] = i
            }, h.prototype.reset = function () {
                var e, t, i, n, a;
                return this.removeAllListeners(), this.saxParser = l.parser(this.options.strict, {
                    trim: !1,
                    normalize: !1,
                    xmlns: this.options.xmlns
                }), this.saxParser.errThrown = !1, this.saxParser.onerror = (a = this, function (e) {
                    if (a.saxParser.resume(), !a.saxParser.errThrown) return a.saxParser.errThrown = !0, a.emit("error", e)
                }), this.saxParser.onend = function (e) {
                    return function () {
                        if (!e.saxParser.ended) return e.saxParser.ended = !0, e.emit("end", e.resultObject)
                    }
                }(this), this.saxParser.ended = !1, this.EXPLICIT_CHARKEY = this.options.explicitCharkey, this.resultObject = null, n = [], e = this.options.attrkey, t = this.options.charkey, this.saxParser.onopentag = function (i) {
                    return function (a) {
                        var o, s, l, d, u;
                        if ((l = {})[t] = "", !i.options.ignoreAttrs) for (o in u = a.attributes) c.call(u, o) && (e in l || i.options.mergeAttrs || (l[e] = {}), s = i.options.attrValueProcessors ? r(i.options.attrValueProcessors, a.attributes[o], o) : a.attributes[o], d = i.options.attrNameProcessors ? r(i.options.attrNameProcessors, o) : o, i.options.mergeAttrs ? i.assignOrPush(l, d, s) : l[e][d] = s);
                        return l["#name"] = i.options.tagNameProcessors ? r(i.options.tagNameProcessors, a.name) : a.name, i.options.xmlns && (l[i.options.xmlnskey] = {
                            uri: a.uri,
                            local: a.local
                        }), n.push(l)
                    }
                }(this), this.saxParser.onclosetag = function (e) {
                    return function () {
                        var i, a, s, l, d, u, h, f, g, p;
                        if (u = n.pop(), d = u["#name"], e.options.explicitChildren && e.options.preserveChildrenOrder || delete u["#name"], !0 === u.cdata && (i = u.cdata, delete u.cdata), g = n[n.length - 1], u[t].match(/^\s*$/) && !i ? (a = u[t], delete u[t]) : (e.options.trim && (u[t] = u[t].trim()), e.options.normalize && (u[t] = u[t].replace(/\s{2,}/g, " ").trim()), u[t] = e.options.valueProcessors ? r(e.options.valueProcessors, u[t], d) : u[t], 1 === Object.keys(u).length && t in u && !e.EXPLICIT_CHARKEY && (u = u[t])), o(u) && (u = "" !== e.options.emptyTag ? e.options.emptyTag : a), null != e.options.validator && (p = "/" + function () {
                            var e, t, i;
                            for (i = [], e = 0, t = n.length; e < t; e++) l = n[e], i.push(l["#name"]);
                            return i
                        }().concat(d).join("/"), function () {
                            var t;
                            try {
                                u = e.options.validator(p, g && g[d], u)
                            } catch (i) {
                                return t = i, e.emit("error", t)
                            }
                        }()), e.options.explicitChildren && !e.options.mergeAttrs && "object" == typeof u) if (e.options.preserveChildrenOrder) {
                            if (g) {
                                for (s in g[e.options.childkey] = g[e.options.childkey] || [], h = {}, u) c.call(u, s) && (h[s] = u[s]);
                                g[e.options.childkey].push(h), delete u["#name"], 1 === Object.keys(u).length && t in u && !e.EXPLICIT_CHARKEY && (u = u[t])
                            }
                        } else l = {}, e.options.attrkey in u && (l[e.options.attrkey] = u[e.options.attrkey], delete u[e.options.attrkey]), !e.options.charsAsChildren && e.options.charkey in u && (l[e.options.charkey] = u[e.options.charkey], delete u[e.options.charkey]), Object.getOwnPropertyNames(u).length > 0 && (l[e.options.childkey] = u), u = l;
                        return n.length > 0 ? e.assignOrPush(g, d, u) : (e.options.explicitRoot && (f = u, (u = {})[d] = f), e.resultObject = u, e.saxParser.ended = !0, e.emit("end", e.resultObject))
                    }
                }(this), i = function (e) {
                    return function (i) {
                        var a, o;
                        if (o = n[n.length - 1]) return o[t] += i, e.options.explicitChildren && e.options.preserveChildrenOrder && e.options.charsAsChildren && (e.options.includeWhiteChars || "" !== i.replace(/\\n/g, "").trim()) && (o[e.options.childkey] = o[e.options.childkey] || [], (a = {"#name": "__text__"})[t] = i, e.options.normalize && (a[t] = a[t].replace(/\s{2,}/g, " ").trim()), o[e.options.childkey].push(a)), o
                    }
                }(this), this.saxParser.ontext = i, this.saxParser.oncdata = function (e) {
                    var t;
                    if (t = i(e)) return t.cdata = !0
                }
            }, h.prototype.parseString = function (t, i) {
                var n;
                null != i && "function" == typeof i && (this.on("end", function (e) {
                    return this.reset(), i(null, e)
                }), this.on("error", function (e) {
                    return this.reset(), i(e)
                }));
                try {
                    return "" === (t = t.toString()).trim() ? (this.emit("end", null), !0) : (t = e.stripBOM(t), this.options.async ? (this.remaining = t, d(this.processAsync), this.saxParser) : this.saxParser.write(t).close())
                } catch (e) {
                    if (n = e, !this.saxParser.errThrown && !this.saxParser.ended) return this.emit("error", n), this.saxParser.errThrown = !0;
                    if (this.saxParser.ended) throw n
                }
            }, h
        }(), t.parseString = function (e, i, n) {
            var a, o;
            return null != n ? ("function" == typeof n && (a = n), "object" == typeof i && (o = i)) : ("function" == typeof i && (a = i), o = {}), new t.Parser(o).parseString(e, a)
        }
    }).call(this)
}, function (e, t, i) {
    !function (e) {
        e.parser = function (e, t) {
            return new a(e, t)
        }, e.SAXParser = a, e.SAXStream = r, e.createStream = function (e, t) {
            return new r(e, t)
        }, e.MAX_BUFFER_LENGTH = 65536;
        var t,
            n = ["comment", "sgmlDecl", "textNode", "tagName", "doctype", "procInstName", "procInstBody", "entity", "attribName", "attribValue", "cdata", "script"];

        function a(t, i) {
            if (!(this instanceof a)) return new a(t, i);
            !function (e) {
                for (var t = 0, i = n.length; t < i; t++) e[n[t]] = ""
            }(this), this.q = this.c = "", this.bufferCheckPosition = e.MAX_BUFFER_LENGTH, this.opt = i || {}, this.opt.lowercase = this.opt.lowercase || this.opt.lowercasetags, this.looseCase = this.opt.lowercase ? "toLowerCase" : "toUpperCase", this.tags = [], this.closed = this.closedRoot = this.sawRoot = !1, this.tag = this.error = null, this.strict = !!t, this.noscript = !(!t && !this.opt.noscript), this.state = b.BEGIN, this.strictEntities = this.opt.strictEntities, this.ENTITIES = this.strictEntities ? Object.create(e.XML_ENTITIES) : Object.create(e.ENTITIES), this.attribList = [], this.opt.xmlns && (this.ns = Object.create(c)), this.trackPosition = !1 !== this.opt.position, this.trackPosition && (this.position = this.line = this.column = 0), _(this, "onready")
        }

        e.EVENTS = ["text", "processinginstruction", "sgmldeclaration", "doctype", "comment", "opentagstart", "attribute", "opentag", "closetag", "opencdata", "cdata", "closecdata", "error", "end", "ready", "script", "opennamespace", "closenamespace"], Object.create || (Object.create = function (e) {
            function t() {
            }

            return t.prototype = e, new t
        }), Object.keys || (Object.keys = function (e) {
            var t = [];
            for (var i in e) e.hasOwnProperty(i) && t.push(i);
            return t
        }), a.prototype = {
            end: function () {
                E(this)
            }, write: function (t) {
                if (this.error) throw this.error;
                if (this.closed) return N(this, "Cannot write after close. Assign an onready handler.");
                if (null === t) return E(this);
                "object" == typeof t && (t = t.toString());
                var i = 0, a = "";
                for (; a = K(t, i++), this.c = a, a;) switch (this.trackPosition && (this.position++, "\n" === a ? (this.line++, this.column = 0) : this.column++), this.state) {
                    case b.BEGIN:
                        if (this.state = b.BEGIN_WHITESPACE, "\ufeff" === a) continue;
                        R(this, a);
                        continue;
                    case b.BEGIN_WHITESPACE:
                        R(this, a);
                        continue;
                    case b.TEXT:
                        if (this.sawRoot && !this.closedRoot) {
                            for (var o = i - 1; a && "<" !== a && "&" !== a;) (a = K(t, i++)) && this.trackPosition && (this.position++, "\n" === a ? (this.line++, this.column = 0) : this.column++);
                            this.textNode += t.substring(o, i - 1)
                        }
                        "<" !== a || this.sawRoot && this.closedRoot && !this.strict ? (v(a) || this.sawRoot && !this.closedRoot || P(this, "Text data outside of root node."), "&" === a ? this.state = b.TEXT_ENTITY : this.textNode += a) : (this.state = b.OPEN_WAKA, this.startTagPosition = this.position);
                        continue;
                    case b.SCRIPT:
                        "<" === a ? this.state = b.SCRIPT_ENDING : this.script += a;
                        continue;
                    case b.SCRIPT_ENDING:
                        "/" === a ? this.state = b.CLOSE_TAG : (this.script += "<" + a, this.state = b.SCRIPT);
                        continue;
                    case b.OPEN_WAKA:
                        if ("!" === a) this.state = b.SGML_DECL, this.sgmlDecl = ""; else if (v(a)) ; else if (k(h, a)) this.state = b.OPEN_TAG, this.tagName = a; else if ("/" === a) this.state = b.CLOSE_TAG, this.tagName = ""; else if ("?" === a) this.state = b.PROC_INST, this.procInstName = this.procInstBody = ""; else {
                            if (P(this, "Unencoded <"), this.startTagPosition + 1 < this.position) {
                                var r = this.position - this.startTagPosition;
                                a = new Array(r).join(" ") + a
                            }
                            this.textNode += "<" + a, this.state = b.TEXT
                        }
                        continue;
                    case b.SGML_DECL:
                        (this.sgmlDecl + a).toUpperCase() === s ? (A(this, "onopencdata"), this.state = b.CDATA, this.sgmlDecl = "", this.cdata = "") : this.sgmlDecl + a === "--" ? (this.state = b.COMMENT, this.comment = "", this.sgmlDecl = "") : (this.sgmlDecl + a).toUpperCase() === l ? (this.state = b.DOCTYPE, (this.doctype || this.sawRoot) && P(this, "Inappropriately located doctype declaration"), this.doctype = "", this.sgmlDecl = "") : ">" === a ? (A(this, "onsgmldeclaration", this.sgmlDecl), this.sgmlDecl = "", this.state = b.TEXT) : m(a) ? (this.state = b.SGML_DECL_QUOTED, this.sgmlDecl += a) : this.sgmlDecl += a;
                        continue;
                    case b.SGML_DECL_QUOTED:
                        a === this.q && (this.state = b.SGML_DECL, this.q = ""), this.sgmlDecl += a;
                        continue;
                    case b.DOCTYPE:
                        ">" === a ? (this.state = b.TEXT, A(this, "ondoctype", this.doctype), this.doctype = !0) : (this.doctype += a, "[" === a ? this.state = b.DOCTYPE_DTD : m(a) && (this.state = b.DOCTYPE_QUOTED, this.q = a));
                        continue;
                    case b.DOCTYPE_QUOTED:
                        this.doctype += a, a === this.q && (this.q = "", this.state = b.DOCTYPE);
                        continue;
                    case b.DOCTYPE_DTD:
                        this.doctype += a, "]" === a ? this.state = b.DOCTYPE : m(a) && (this.state = b.DOCTYPE_DTD_QUOTED, this.q = a);
                        continue;
                    case b.DOCTYPE_DTD_QUOTED:
                        this.doctype += a, a === this.q && (this.state = b.DOCTYPE_DTD, this.q = "");
                        continue;
                    case b.COMMENT:
                        "-" === a ? this.state = b.COMMENT_ENDING : this.comment += a;
                        continue;
                    case b.COMMENT_ENDING:
                        "-" === a ? (this.state = b.COMMENT_ENDED, this.comment = x(this.opt, this.comment), this.comment && A(this, "oncomment", this.comment), this.comment = "") : (this.comment += "-" + a, this.state = b.COMMENT);
                        continue;
                    case b.COMMENT_ENDED:
                        ">" !== a ? (P(this, "Malformed comment"), this.comment += "--" + a, this.state = b.COMMENT) : this.state = b.TEXT;
                        continue;
                    case b.CDATA:
                        "]" === a ? this.state = b.CDATA_ENDING : this.cdata += a;
                        continue;
                    case b.CDATA_ENDING:
                        "]" === a ? this.state = b.CDATA_ENDING_2 : (this.cdata += "]" + a, this.state = b.CDATA);
                        continue;
                    case b.CDATA_ENDING_2:
                        ">" === a ? (this.cdata && A(this, "oncdata", this.cdata), A(this, "onclosecdata"), this.cdata = "", this.state = b.TEXT) : "]" === a ? this.cdata += "]" : (this.cdata += "]]" + a, this.state = b.CDATA);
                        continue;
                    case b.PROC_INST:
                        "?" === a ? this.state = b.PROC_INST_ENDING : v(a) ? this.state = b.PROC_INST_BODY : this.procInstName += a;
                        continue;
                    case b.PROC_INST_BODY:
                        if (!this.procInstBody && v(a)) continue;
                        "?" === a ? this.state = b.PROC_INST_ENDING : this.procInstBody += a;
                        continue;
                    case b.PROC_INST_ENDING:
                        ">" === a ? (A(this, "onprocessinginstruction", {
                            name: this.procInstName,
                            body: this.procInstBody
                        }), this.procInstName = this.procInstBody = "", this.state = b.TEXT) : (this.procInstBody += "?" + a, this.state = b.PROC_INST_BODY);
                        continue;
                    case b.OPEN_TAG:
                        k(f, a) ? this.tagName += a : (M(this), ">" === a ? L(this) : "/" === a ? this.state = b.OPEN_TAG_SLASH : (v(a) || P(this, "Invalid character in tag name"), this.state = b.ATTRIB));
                        continue;
                    case b.OPEN_TAG_SLASH:
                        ">" === a ? (L(this, !0), B(this)) : (P(this, "Forward-slash in opening tag not followed by >"), this.state = b.ATTRIB);
                        continue;
                    case b.ATTRIB:
                        if (v(a)) continue;
                        ">" === a ? L(this) : "/" === a ? this.state = b.OPEN_TAG_SLASH : k(h, a) ? (this.attribName = a, this.attribValue = "", this.state = b.ATTRIB_NAME) : P(this, "Invalid attribute name");
                        continue;
                    case b.ATTRIB_NAME:
                        "=" === a ? this.state = b.ATTRIB_VALUE : ">" === a ? (P(this, "Attribute without value"), this.attribValue = this.attribName, F(this), L(this)) : v(a) ? this.state = b.ATTRIB_NAME_SAW_WHITE : k(f, a) ? this.attribName += a : P(this, "Invalid attribute name");
                        continue;
                    case b.ATTRIB_NAME_SAW_WHITE:
                        if ("=" === a) this.state = b.ATTRIB_VALUE; else {
                            if (v(a)) continue;
                            P(this, "Attribute without value"), this.tag.attributes[this.attribName] = "", this.attribValue = "", A(this, "onattribute", {
                                name: this.attribName,
                                value: ""
                            }), this.attribName = "", ">" === a ? L(this) : k(h, a) ? (this.attribName = a, this.state = b.ATTRIB_NAME) : (P(this, "Invalid attribute name"), this.state = b.ATTRIB)
                        }
                        continue;
                    case b.ATTRIB_VALUE:
                        if (v(a)) continue;
                        m(a) ? (this.q = a, this.state = b.ATTRIB_VALUE_QUOTED) : (P(this, "Unquoted attribute value"), this.state = b.ATTRIB_VALUE_UNQUOTED, this.attribValue = a);
                        continue;
                    case b.ATTRIB_VALUE_QUOTED:
                        if (a !== this.q) {
                            "&" === a ? this.state = b.ATTRIB_VALUE_ENTITY_Q : this.attribValue += a;
                            continue
                        }
                        F(this), this.q = "", this.state = b.ATTRIB_VALUE_CLOSED;
                        continue;
                    case b.ATTRIB_VALUE_CLOSED:
                        v(a) ? this.state = b.ATTRIB : ">" === a ? L(this) : "/" === a ? this.state = b.OPEN_TAG_SLASH : k(h, a) ? (P(this, "No whitespace between attributes"), this.attribName = a, this.attribValue = "", this.state = b.ATTRIB_NAME) : P(this, "Invalid attribute name");
                        continue;
                    case b.ATTRIB_VALUE_UNQUOTED:
                        if (!y(a)) {
                            "&" === a ? this.state = b.ATTRIB_VALUE_ENTITY_U : this.attribValue += a;
                            continue
                        }
                        F(this), ">" === a ? L(this) : this.state = b.ATTRIB;
                        continue;
                    case b.CLOSE_TAG:
                        if (this.tagName) ">" === a ? B(this) : k(f, a) ? this.tagName += a : this.script ? (this.script += "</" + this.tagName, this.tagName = "", this.state = b.SCRIPT) : (v(a) || P(this, "Invalid tagname in closing tag"), this.state = b.CLOSE_TAG_SAW_WHITE); else {
                            if (v(a)) continue;
                            T(h, a) ? this.script ? (this.script += "</" + a, this.state = b.SCRIPT) : P(this, "Invalid tagname in closing tag.") : this.tagName = a
                        }
                        continue;
                    case b.CLOSE_TAG_SAW_WHITE:
                        if (v(a)) continue;
                        ">" === a ? B(this) : P(this, "Invalid characters in closing tag");
                        continue;
                    case b.TEXT_ENTITY:
                    case b.ATTRIB_VALUE_ENTITY_Q:
                    case b.ATTRIB_VALUE_ENTITY_U:
                        var d, u;
                        switch (this.state) {
                            case b.TEXT_ENTITY:
                                d = b.TEXT, u = "textNode";
                                break;
                            case b.ATTRIB_VALUE_ENTITY_Q:
                                d = b.ATTRIB_VALUE_QUOTED, u = "attribValue";
                                break;
                            case b.ATTRIB_VALUE_ENTITY_U:
                                d = b.ATTRIB_VALUE_UNQUOTED, u = "attribValue"
                        }
                        ";" === a ? (this[u] += U(this), this.entity = "", this.state = d) : k(this.entity.length ? p : g, a) ? this.entity += a : (P(this, "Invalid character in entity name"), this[u] += "&" + this.entity + a, this.entity = "", this.state = d);
                        continue;
                    default:
                        throw new Error(this, "Unknown state: " + this.state)
                }
                this.position >= this.bufferCheckPosition && function (t) {
                    for (var i = Math.max(e.MAX_BUFFER_LENGTH, 10), a = 0, o = 0, r = n.length; o < r; o++) {
                        var s = t[n[o]].length;
                        if (s > i) switch (n[o]) {
                            case"textNode":
                                D(t);
                                break;
                            case"cdata":
                                A(t, "oncdata", t.cdata), t.cdata = "";
                                break;
                            case"script":
                                A(t, "onscript", t.script), t.script = "";
                                break;
                            default:
                                N(t, "Max buffer length exceeded: " + n[o])
                        }
                        a = Math.max(a, s)
                    }
                    var l = e.MAX_BUFFER_LENGTH - a;
                    t.bufferCheckPosition = l + t.position
                }(this);
                return this
            }
            /*! http://mths.be/fromcodepoint v0.1.0 by @mathias */, resume: function () {
                return this.error = null, this
            }, close: function () {
                return this.write(null)
            }, flush: function () {
                var e;
                D(e = this), "" !== e.cdata && (A(e, "oncdata", e.cdata), e.cdata = ""), "" !== e.script && (A(e, "onscript", e.script), e.script = "")
            }
        };
        try {
            t = i(409).Stream
        } catch (e) {
            t = function () {
            }
        }
        var o = e.EVENTS.filter(function (e) {
            return "error" !== e && "end" !== e
        });

        function r(e, i) {
            if (!(this instanceof r)) return new r(e, i);
            t.apply(this), this._parser = new a(e, i), this.writable = !0, this.readable = !0;
            var n = this;
            this._parser.onend = function () {
                n.emit("end")
            }, this._parser.onerror = function (e) {
                n.emit("error", e), n._parser.error = null
            }, this._decoder = null, o.forEach(function (e) {
                Object.defineProperty(n, "on" + e, {
                    get: function () {
                        return n._parser["on" + e]
                    }, set: function (t) {
                        if (!t) return n.removeAllListeners(e), n._parser["on" + e] = t, t;
                        n.on(e, t)
                    }, enumerable: !0, configurable: !1
                })
            })
        }

        r.prototype = Object.create(t.prototype, {constructor: {value: r}}), r.prototype.write = function (e) {
            if ("function" == typeof Buffer && "function" == typeof Buffer.isBuffer && Buffer.isBuffer(e)) {
                if (!this._decoder) {
                    var t = i(398).StringDecoder;
                    this._decoder = new t("utf8")
                }
                e = this._decoder.write(e)
            }
            return this._parser.write(e.toString()), this.emit("data", e), !0
        }, r.prototype.end = function (e) {
            return e && e.length && this.write(e), this._parser.end(), !0
        }, r.prototype.on = function (e, i) {
            var n = this;
            return n._parser["on" + e] || -1 === o.indexOf(e) || (n._parser["on" + e] = function () {
                var t = 1 === arguments.length ? [arguments[0]] : Array.apply(null, arguments);
                t.splice(0, 0, e), n.emit.apply(n, t)
            }), t.prototype.on.call(n, e, i)
        };
        var s = "[CDATA[", l = "DOCTYPE", d = "http://www.w3.org/XML/1998/namespace",
            u = "http://www.w3.org/2000/xmlns/", c = {xml: d, xmlns: u},
            h = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,
            f = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,
            g = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,
            p = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;

        function v(e) {
            return " " === e || "\n" === e || "\r" === e || "\t" === e
        }

        function m(e) {
            return '"' === e || "'" === e
        }

        function y(e) {
            return ">" === e || v(e)
        }

        function k(e, t) {
            return e.test(t)
        }

        function T(e, t) {
            return !k(e, t)
        }

        var w, C, S, b = 0;
        for (var I in e.STATE = {
            BEGIN: b++,
            BEGIN_WHITESPACE: b++,
            TEXT: b++,
            TEXT_ENTITY: b++,
            OPEN_WAKA: b++,
            SGML_DECL: b++,
            SGML_DECL_QUOTED: b++,
            DOCTYPE: b++,
            DOCTYPE_QUOTED: b++,
            DOCTYPE_DTD: b++,
            DOCTYPE_DTD_QUOTED: b++,
            COMMENT_STARTING: b++,
            COMMENT: b++,
            COMMENT_ENDING: b++,
            COMMENT_ENDED: b++,
            CDATA: b++,
            CDATA_ENDING: b++,
            CDATA_ENDING_2: b++,
            PROC_INST: b++,
            PROC_INST_BODY: b++,
            PROC_INST_ENDING: b++,
            OPEN_TAG: b++,
            OPEN_TAG_SLASH: b++,
            ATTRIB: b++,
            ATTRIB_NAME: b++,
            ATTRIB_NAME_SAW_WHITE: b++,
            ATTRIB_VALUE: b++,
            ATTRIB_VALUE_QUOTED: b++,
            ATTRIB_VALUE_CLOSED: b++,
            ATTRIB_VALUE_UNQUOTED: b++,
            ATTRIB_VALUE_ENTITY_Q: b++,
            ATTRIB_VALUE_ENTITY_U: b++,
            CLOSE_TAG: b++,
            CLOSE_TAG_SAW_WHITE: b++,
            SCRIPT: b++,
            SCRIPT_ENDING: b++
        }, e.XML_ENTITIES = {amp: "&", gt: ">", lt: "<", quot: '"', apos: "'"}, e.ENTITIES = {
            amp: "&",
            gt: ">",
            lt: "<",
            quot: '"',
            apos: "'",
            AElig: 198,
            Aacute: 193,
            Acirc: 194,
            Agrave: 192,
            Aring: 197,
            Atilde: 195,
            Auml: 196,
            Ccedil: 199,
            ETH: 208,
            Eacute: 201,
            Ecirc: 202,
            Egrave: 200,
            Euml: 203,
            Iacute: 205,
            Icirc: 206,
            Igrave: 204,
            Iuml: 207,
            Ntilde: 209,
            Oacute: 211,
            Ocirc: 212,
            Ograve: 210,
            Oslash: 216,
            Otilde: 213,
            Ouml: 214,
            THORN: 222,
            Uacute: 218,
            Ucirc: 219,
            Ugrave: 217,
            Uuml: 220,
            Yacute: 221,
            aacute: 225,
            acirc: 226,
            aelig: 230,
            agrave: 224,
            aring: 229,
            atilde: 227,
            auml: 228,
            ccedil: 231,
            eacute: 233,
            ecirc: 234,
            egrave: 232,
            eth: 240,
            euml: 235,
            iacute: 237,
            icirc: 238,
            igrave: 236,
            iuml: 239,
            ntilde: 241,
            oacute: 243,
            ocirc: 244,
            ograve: 242,
            oslash: 248,
            otilde: 245,
            ouml: 246,
            szlig: 223,
            thorn: 254,
            uacute: 250,
            ucirc: 251,
            ugrave: 249,
            uuml: 252,
            yacute: 253,
            yuml: 255,
            copy: 169,
            reg: 174,
            nbsp: 160,
            iexcl: 161,
            cent: 162,
            pound: 163,
            curren: 164,
            yen: 165,
            brvbar: 166,
            sect: 167,
            uml: 168,
            ordf: 170,
            laquo: 171,
            not: 172,
            shy: 173,
            macr: 175,
            deg: 176,
            plusmn: 177,
            sup1: 185,
            sup2: 178,
            sup3: 179,
            acute: 180,
            micro: 181,
            para: 182,
            middot: 183,
            cedil: 184,
            ordm: 186,
            raquo: 187,
            frac14: 188,
            frac12: 189,
            frac34: 190,
            iquest: 191,
            times: 215,
            divide: 247,
            OElig: 338,
            oelig: 339,
            Scaron: 352,
            scaron: 353,
            Yuml: 376,
            fnof: 402,
            circ: 710,
            tilde: 732,
            Alpha: 913,
            Beta: 914,
            Gamma: 915,
            Delta: 916,
            Epsilon: 917,
            Zeta: 918,
            Eta: 919,
            Theta: 920,
            Iota: 921,
            Kappa: 922,
            Lambda: 923,
            Mu: 924,
            Nu: 925,
            Xi: 926,
            Omicron: 927,
            Pi: 928,
            Rho: 929,
            Sigma: 931,
            Tau: 932,
            Upsilon: 933,
            Phi: 934,
            Chi: 935,
            Psi: 936,
            Omega: 937,
            alpha: 945,
            beta: 946,
            gamma: 947,
            delta: 948,
            epsilon: 949,
            zeta: 950,
            eta: 951,
            theta: 952,
            iota: 953,
            kappa: 954,
            lambda: 955,
            mu: 956,
            nu: 957,
            xi: 958,
            omicron: 959,
            pi: 960,
            rho: 961,
            sigmaf: 962,
            sigma: 963,
            tau: 964,
            upsilon: 965,
            phi: 966,
            chi: 967,
            psi: 968,
            omega: 969,
            thetasym: 977,
            upsih: 978,
            piv: 982,
            ensp: 8194,
            emsp: 8195,
            thinsp: 8201,
            zwnj: 8204,
            zwj: 8205,
            lrm: 8206,
            rlm: 8207,
            ndash: 8211,
            mdash: 8212,
            lsquo: 8216,
            rsquo: 8217,
            sbquo: 8218,
            ldquo: 8220,
            rdquo: 8221,
            bdquo: 8222,
            dagger: 8224,
            Dagger: 8225,
            bull: 8226,
            hellip: 8230,
            permil: 8240,
            prime: 8242,
            Prime: 8243,
            lsaquo: 8249,
            rsaquo: 8250,
            oline: 8254,
            frasl: 8260,
            euro: 8364,
            image: 8465,
            weierp: 8472,
            real: 8476,
            trade: 8482,
            alefsym: 8501,
            larr: 8592,
            uarr: 8593,
            rarr: 8594,
            darr: 8595,
            harr: 8596,
            crarr: 8629,
            lArr: 8656,
            uArr: 8657,
            rArr: 8658,
            dArr: 8659,
            hArr: 8660,
            forall: 8704,
            part: 8706,
            exist: 8707,
            empty: 8709,
            nabla: 8711,
            isin: 8712,
            notin: 8713,
            ni: 8715,
            prod: 8719,
            sum: 8721,
            minus: 8722,
            lowast: 8727,
            radic: 8730,
            prop: 8733,
            infin: 8734,
            ang: 8736,
            and: 8743,
            or: 8744,
            cap: 8745,
            cup: 8746,
            int: 8747,
            there4: 8756,
            sim: 8764,
            cong: 8773,
            asymp: 8776,
            ne: 8800,
            equiv: 8801,
            le: 8804,
            ge: 8805,
            sub: 8834,
            sup: 8835,
            nsub: 8836,
            sube: 8838,
            supe: 8839,
            oplus: 8853,
            otimes: 8855,
            perp: 8869,
            sdot: 8901,
            lceil: 8968,
            rceil: 8969,
            lfloor: 8970,
            rfloor: 8971,
            lang: 9001,
            rang: 9002,
            loz: 9674,
            spades: 9824,
            clubs: 9827,
            hearts: 9829,
            diams: 9830
        }, Object.keys(e.ENTITIES).forEach(function (t) {
            var i = e.ENTITIES[t], n = "number" == typeof i ? String.fromCharCode(i) : i;
            e.ENTITIES[t] = n
        }), e.STATE) e.STATE[e.STATE[I]] = I;

        function _(e, t, i) {
            e[t] && e[t](i)
        }

        function A(e, t, i) {
            e.textNode && D(e), _(e, t, i)
        }

        function D(e) {
            e.textNode = x(e.opt, e.textNode), e.textNode && _(e, "ontext", e.textNode), e.textNode = ""
        }

        function x(e, t) {
            return e.trim && (t = t.trim()), e.normalize && (t = t.replace(/\s+/g, " ")), t
        }

        function N(e, t) {
            return D(e), e.trackPosition && (t += "\nLine: " + e.line + "\nColumn: " + e.column + "\nChar: " + e.c), t = new Error(t), e.error = t, _(e, "onerror", t), e
        }

        function E(e) {
            return e.sawRoot && !e.closedRoot && P(e, "Unclosed root tag"), e.state !== b.BEGIN && e.state !== b.BEGIN_WHITESPACE && e.state !== b.TEXT && N(e, "Unexpected end"), D(e), e.c = "", e.closed = !0, _(e, "onend"), a.call(e, e.strict, e.opt), e
        }

        function P(e, t) {
            if ("object" != typeof e || !(e instanceof a)) throw new Error("bad call to strictFail");
            e.strict && N(e, t)
        }

        function M(e) {
            e.strict || (e.tagName = e.tagName[e.looseCase]());
            var t = e.tags[e.tags.length - 1] || e, i = e.tag = {name: e.tagName, attributes: {}};
            e.opt.xmlns && (i.ns = t.ns), e.attribList.length = 0, A(e, "onopentagstart", i)
        }

        function O(e, t) {
            var i = e.indexOf(":") < 0 ? ["", e] : e.split(":"), n = i[0], a = i[1];
            return t && "xmlns" === e && (n = "xmlns", a = ""), {prefix: n, local: a}
        }

        function F(e) {
            if (e.strict || (e.attribName = e.attribName[e.looseCase]()), -1 !== e.attribList.indexOf(e.attribName) || e.tag.attributes.hasOwnProperty(e.attribName)) e.attribName = e.attribValue = ""; else {
                if (e.opt.xmlns) {
                    var t = O(e.attribName, !0), i = t.prefix, n = t.local;
                    if ("xmlns" === i) if ("xml" === n && e.attribValue !== d) P(e, "xml: prefix must be bound to " + d + "\nActual: " + e.attribValue); else if ("xmlns" === n && e.attribValue !== u) P(e, "xmlns: prefix must be bound to " + u + "\nActual: " + e.attribValue); else {
                        var a = e.tag, o = e.tags[e.tags.length - 1] || e;
                        a.ns === o.ns && (a.ns = Object.create(o.ns)), a.ns[n] = e.attribValue
                    }
                    e.attribList.push([e.attribName, e.attribValue])
                } else e.tag.attributes[e.attribName] = e.attribValue, A(e, "onattribute", {
                    name: e.attribName,
                    value: e.attribValue
                });
                e.attribName = e.attribValue = ""
            }
        }

        function L(e, t) {
            if (e.opt.xmlns) {
                var i = e.tag, n = O(e.tagName);
                i.prefix = n.prefix, i.local = n.local, i.uri = i.ns[n.prefix] || "", i.prefix && !i.uri && (P(e, "Unbound namespace prefix: " + JSON.stringify(e.tagName)), i.uri = n.prefix);
                var a = e.tags[e.tags.length - 1] || e;
                i.ns && a.ns !== i.ns && Object.keys(i.ns).forEach(function (t) {
                    A(e, "onopennamespace", {prefix: t, uri: i.ns[t]})
                });
                for (var o = 0, r = e.attribList.length; o < r; o++) {
                    var s = e.attribList[o], l = s[0], d = s[1], u = O(l, !0), c = u.prefix, h = u.local,
                        f = "" === c ? "" : i.ns[c] || "", g = {name: l, value: d, prefix: c, local: h, uri: f};
                    c && "xmlns" !== c && !f && (P(e, "Unbound namespace prefix: " + JSON.stringify(c)), g.uri = c), e.tag.attributes[l] = g, A(e, "onattribute", g)
                }
                e.attribList.length = 0
            }
            e.tag.isSelfClosing = !!t, e.sawRoot = !0, e.tags.push(e.tag), A(e, "onopentag", e.tag), t || (e.noscript || "script" !== e.tagName.toLowerCase() ? e.state = b.TEXT : e.state = b.SCRIPT, e.tag = null, e.tagName = ""), e.attribName = e.attribValue = "", e.attribList.length = 0
        }

        function B(e) {
            if (!e.tagName) return P(e, "Weird empty close tag."), e.textNode += "</>", void (e.state = b.TEXT);
            if (e.script) {
                if ("script" !== e.tagName) return e.script += "</" + e.tagName + ">", e.tagName = "", void (e.state = b.SCRIPT);
                A(e, "onscript", e.script), e.script = ""
            }
            var t = e.tags.length, i = e.tagName;
            e.strict || (i = i[e.looseCase]());
            for (var n = i; t--;) {
                if (e.tags[t].name === n) break;
                P(e, "Unexpected close tag")
            }
            if (t < 0) return P(e, "Unmatched closing tag: " + e.tagName), e.textNode += "</" + e.tagName + ">", void (e.state = b.TEXT);
            e.tagName = i;
            for (var a = e.tags.length; a-- > t;) {
                var o = e.tag = e.tags.pop();
                e.tagName = e.tag.name, A(e, "onclosetag", e.tagName);
                var r = {};
                for (var s in o.ns) r[s] = o.ns[s];
                var l = e.tags[e.tags.length - 1] || e;
                e.opt.xmlns && o.ns !== l.ns && Object.keys(o.ns).forEach(function (t) {
                    var i = o.ns[t];
                    A(e, "onclosenamespace", {prefix: t, uri: i})
                })
            }
            0 === t && (e.closedRoot = !0), e.tagName = e.attribValue = e.attribName = "", e.attribList.length = 0, e.state = b.TEXT
        }

        function U(e) {
            var t, i = e.entity, n = i.toLowerCase(), a = "";
            return e.ENTITIES[i] ? e.ENTITIES[i] : e.ENTITIES[n] ? e.ENTITIES[n] : ("#" === (i = n).charAt(0) && ("x" === i.charAt(1) ? (i = i.slice(2), a = (t = parseInt(i, 16)).toString(16)) : (i = i.slice(1), a = (t = parseInt(i, 10)).toString(10))), i = i.replace(/^0+/, ""), isNaN(t) || a.toLowerCase() !== i ? (P(e, "Invalid character entity"), "&" + e.entity + ";") : String.fromCodePoint(t))
        }

        function R(e, t) {
            "<" === t ? (e.state = b.OPEN_WAKA, e.startTagPosition = e.position) : v(t) || (P(e, "Non-whitespace before first tag."), e.textNode = t, e.state = b.TEXT)
        }

        function K(e, t) {
            var i = "";
            return t < e.length && (i = e.charAt(t)), i
        }

        b = e.STATE, String.fromCodePoint || (w = String.fromCharCode, C = Math.floor, S = function () {
            var e, t, i = [], n = -1, a = arguments.length;
            if (!a) return "";
            for (var o = ""; ++n < a;) {
                var r = Number(arguments[n]);
                if (!isFinite(r) || r < 0 || r > 1114111 || C(r) !== r) throw RangeError("Invalid code point: " + r);
                r <= 65535 ? i.push(r) : (e = 55296 + ((r -= 65536) >> 10), t = r % 1024 + 56320, i.push(e, t)), (n + 1 === a || i.length > 16384) && (o += w.apply(null, i), i.length = 0)
            }
            return o
        }, Object.defineProperty ? Object.defineProperty(String, "fromCodePoint", {
            value: S,
            configurable: !0,
            writable: !0
        }) : String.fromCodePoint = S)
    }(t)
}, function (e, t) {
    (function () {
        "use strict";
        t.stripBOM = function (e) {
            return "\ufeff" === e[0] ? e.substring(1) : e
        }
    }).call(this)
}, function (e, t) {
    e.exports = require("timers")
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = "\n", a = "\r\n", o = /^\s*\[(.+?)\]\s*$/, r = /^\s*([^#].*?)\s*=\s*(.*?)\s*$/;
    !function (e) {
        e.stringify = function (e) {
            let t = "";
            for (let i in e) {
                let n = e[i];
                if (!n) break;
                t += "[" + i + "]" + a;
                for (let e in n) {
                    let i = n[e];
                    if (void 0 === i || null === i) break;
                    t += e + "=" + i + a
                }
            }
            return t + n
        }, e.parse = function (e) {
            let t, i = {}, n = e.split(/\r\n|\r|\n/), a = {};
            for (let e = 0; e < n.length; ++e) {
                let s = n[e];
                (t = s.match(o)) ? i[t[1]] = a = i[t[1]] || {} : a && (t = s.match(r)) && (a[t[1]] = t[2])
            }
            return i
        }
    }(t.IniNS || (t.IniNS = {}))
}, function (e, t) {
    function i(e) {
        var t = new Error("Cannot find module '" + e + "'");
        throw t.code = "MODULE_NOT_FOUND", t
    }

    i.keys = function () {
        return []
    }, i.resolve = i, e.exports = i, i.id = 526
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        e[e.NONE = 0] = "NONE", e[e.FAILED = -2] = "FAILED", e[e.ABORTED = -3] = "ABORTED", e[e.INVALID_ARGUMENT = -4] = "INVALID_ARGUMENT", e[e.INVALID_HANDLE = -5] = "INVALID_HANDLE", e[e.FILE_NOT_FOUND = -6] = "FILE_NOT_FOUND", e[e.TIMED_OUT = -7] = "TIMED_OUT", e[e.FILE_TOO_BIG = -8] = "FILE_TOO_BIG", e[e.UNEXPECTED = -9] = "UNEXPECTED", e[e.ACCESS_DENIED = -10] = "ACCESS_DENIED", e[e.NOT_IMPLEMENTED = -11] = "NOT_IMPLEMENTED", e[e.CONNECTION_CLOSED = -100] = "CONNECTION_CLOSED", e[e.CONNECTION_RESET = -101] = "CONNECTION_RESET", e[e.CONNECTION_REFUSED = -102] = "CONNECTION_REFUSED", e[e.CONNECTION_ABORTED = -103] = "CONNECTION_ABORTED", e[e.CONNECTION_FAILED = -104] = "CONNECTION_FAILED", e[e.NAME_NOT_RESOLVED = -105] = "NAME_NOT_RESOLVED", e[e.INTERNET_DISCONNECTED = -106] = "INTERNET_DISCONNECTED", e[e.SSL_PROTOCOL_ERROR = -107] = "SSL_PROTOCOL_ERROR", e[e.ADDRESS_INVALID = -108] = "ADDRESS_INVALID", e[e.ADDRESS_UNREACHABLE = -109] = "ADDRESS_UNREACHABLE", e[e.SSL_CLIENT_AUTH_CERT_NEEDED = -110] = "SSL_CLIENT_AUTH_CERT_NEEDED", e[e.TUNNEL_CONNECTION_FAILED = -111] = "TUNNEL_CONNECTION_FAILED", e[e.NO_SSL_VERSIONS_ENABLED = -112] = "NO_SSL_VERSIONS_ENABLED", e[e.SSL_VERSION_OR_CIPHER_MISMATCH = -113] = "SSL_VERSION_OR_CIPHER_MISMATCH", e[e.SSL_RENEGOTIATION_REQUESTED = -114] = "SSL_RENEGOTIATION_REQUESTED", e[e.CERT_COMMON_NAME_INVALID = -200] = "CERT_COMMON_NAME_INVALID", e[e.CERT_BEGIN = -200] = "CERT_BEGIN", e[e.CERT_DATE_INVALID = -201] = "CERT_DATE_INVALID", e[e.CERT_AUTHORITY_INVALID = -202] = "CERT_AUTHORITY_INVALID", e[e.CERT_CONTAINS_ERRORS = -203] = "CERT_CONTAINS_ERRORS", e[e.CERT_NO_REVOCATION_MECHANISM = -204] = "CERT_NO_REVOCATION_MECHANISM", e[e.CERT_UNABLE_TO_CHECK_REVOCATION = -205] = "CERT_UNABLE_TO_CHECK_REVOCATION", e[e.CERT_REVOKED = -206] = "CERT_REVOKED", e[e.CERT_INVALID = -207] = "CERT_INVALID", e[e.CERT_WEAK_SIGNATURE_ALGORITHM = -208] = "CERT_WEAK_SIGNATURE_ALGORITHM", e[e.CERT_NON_UNIQUE_NAME = -210] = "CERT_NON_UNIQUE_NAME", e[e.CERT_WEAK_KEY = -211] = "CERT_WEAK_KEY", e[e.CERT_NAME_CONSTRAINT_VIOLATION = -212] = "CERT_NAME_CONSTRAINT_VIOLATION", e[e.CERT_VALIDITY_TOO_LONG = -213] = "CERT_VALIDITY_TOO_LONG", e[e.CERT_END = -213] = "CERT_END", e[e.INVALID_URL = -300] = "INVALID_URL", e[e.DISALLOWED_URL_SCHEME = -301] = "DISALLOWED_URL_SCHEME", e[e.UNKNOWN_URL_SCHEME = -302] = "UNKNOWN_URL_SCHEME", e[e.TOO_MANY_REDIRECTS = -310] = "TOO_MANY_REDIRECTS", e[e.UNSAFE_REDIRECT = -311] = "UNSAFE_REDIRECT", e[e.UNSAFE_PORT = -312] = "UNSAFE_PORT", e[e.INVALID_RESPONSE = -320] = "INVALID_RESPONSE", e[e.INVALID_CHUNKED_ENCODING = -321] = "INVALID_CHUNKED_ENCODING", e[e.METHOD_NOT_SUPPORTED = -322] = "METHOD_NOT_SUPPORTED", e[e.UNEXPECTED_PROXY_AUTH = -323] = "UNEXPECTED_PROXY_AUTH", e[e.EMPTY_RESPONSE = -324] = "EMPTY_RESPONSE", e[e.RESPONSE_HEADERS_TOO_BIG = -325] = "RESPONSE_HEADERS_TOO_BIG", e[e.CACHE_MISS = -400] = "CACHE_MISS", e[e.INSECURE_RESPONSE = -501] = "INSECURE_RESPONSE"
    }(t.ErrorCode || (t.ErrorCode = {})), function (e) {
        e[e.UNKNOWN = 0] = "UNKNOWN", e[e.CURRENT_TAB = 1] = "CURRENT_TAB", e[e.SINGLETON_TAB = 2] = "SINGLETON_TAB", e[e.NEW_FOREGROUND_TAB = 3] = "NEW_FOREGROUND_TAB", e[e.NEW_BACKGROUND_TAB = 4] = "NEW_BACKGROUND_TAB", e[e.NEW_POPUP = 5] = "NEW_POPUP", e[e.NEW_WINDOW = 6] = "NEW_WINDOW", e[e.SAVE_TO_DISK = 7] = "SAVE_TO_DISK", e[e.OFF_THE_RECORD = 8] = "OFF_THE_RECORD", e[e.IGNORE_ACTION = 9] = "IGNORE_ACTION"
    }(t.WindowOpenDisposition || (t.WindowOpenDisposition = {})), function (e) {
        e[e.LINK = 0] = "LINK", e[e.EXPLICIT = 1] = "EXPLICIT", e[e.AUTO_SUBFRAME = 3] = "AUTO_SUBFRAME", e[e.MANUAL_SUBFRAME = 4] = "MANUAL_SUBFRAME", e[e.FORM_SUBMIT = 7] = "FORM_SUBMIT", e[e.RELOAD = 8] = "RELOAD", e[e.SOURCE_MASK = 255] = "SOURCE_MASK", e[e.BLOCKED_FLAG = 8388608] = "BLOCKED_FLAG", e[e.FORWARD_BACK_FLAG = 16777216] = "FORWARD_BACK_FLAG", e[e.CHAIN_START_FLAG = 268435456] = "CHAIN_START_FLAG", e[e.CHAIN_END_FLAG = 536870912] = "CHAIN_END_FLAG", e[e.CLIENT_REDIRECT_FLAG = 1073741824] = "CLIENT_REDIRECT_FLAG", e[e.SERVER_REDIRECT_FLAG = 2147483648] = "SERVER_REDIRECT_FLAG", e[e.IS_REDIRECT_MASK = 3221225472] = "IS_REDIRECT_MASK", e[e.QUALIFIER_MASK = 4294967040] = "QUALIFIER_MASK"
    }(t.TransitionType || (t.TransitionType = {})), function (e) {
        e[e.NONE = 0] = "NONE", e[e.LEFT_DOWN = 16] = "LEFT_DOWN", e[e.MIDDLE_DOWN = 32] = "MIDDLE_DOWN", e[e.RIGHT_DOWN = 64] = "RIGHT_DOWN"
    }(t.MouseModifiers || (t.MouseModifiers = {})), function (e) {
        e[e.F5 = 116] = "F5", e[e.R = 82] = "R", e[e.T = 84] = "T", e[e.W = 87] = "W"
    }(t.Key || (t.Key = {})), function (e) {
        e[e.NONE = 0] = "NONE", e[e.CAPS_LOCK_ON = 1] = "CAPS_LOCK_ON", e[e.SHIFT_DOWN = 2] = "SHIFT_DOWN", e[e.CTRL_DOWN = 4] = "CTRL_DOWN", e[e.ALT_DOWN = 8] = "ALT_DOWN"
    }(t.KeyModifiers || (t.KeyModifiers = {})), function (e) {
        e[e.NONE = 0] = "NONE", e[e.PAGE = 1] = "PAGE", e[e.FRAME = 2] = "FRAME", e[e.LINK = 4] = "LINK", e[e.MEDIA = 8] = "MEDIA", e[e.SELECTION = 16] = "SELECTION", e[e.EDITABLE = 32] = "EDITABLE"
    }(t.PopupElemTypeFlag || (t.PopupElemTypeFlag = {})), function (e) {
        e[e.NONE = 0] = "NONE", e[e.IMAGE = 1] = "IMAGE", e[e.VIDEO = 2] = "VIDEO", e[e.AUDIO = 3] = "AUDIO", e[e.FILE = 4] = "FILE", e[e.PLUGIN = 5] = "PLUGIN"
    }(t.MediaElemType || (t.MediaElemType = {})), function (e) {
        e[e.NONE = 0] = "NONE", e[e.ERROR = 1] = "ERROR", e[e.PAUSED = 2] = "PAUSED", e[e.MUTED = 4] = "MUTED", e[e.LOOP = 8] = "LOOP", e[e.CAN_SAVE = 16] = "CAN_SAVE", e[e.HAS_AUDIO = 32] = "HAS_AUDIO", e[e.HAS_VIDEO = 64] = "HAS_VIDEO", e[e.CONTROL_ROOT_ELEMENT = 128] = "CONTROL_ROOT_ELEMENT", e[e.CAN_PRINT = 256] = "CAN_PRINT", e[e.CAN_ROTATE = 512] = "CAN_ROTATE"
    }(t.MediaElemStateFlag || (t.MediaElemStateFlag = {})), function (e) {
        e[e.NONE = 0] = "NONE", e[e.CAN_UNDO = 1] = "CAN_UNDO", e[e.CAN_REDO = 2] = "CAN_REDO", e[e.ESFG_CAN_CUT = 4] = "ESFG_CAN_CUT", e[e.CAN_COPY = 8] = "CAN_COPY", e[e.CAN_PASTE = 16] = "CAN_PASTE", e[e.CAN_DELETE = 32] = "CAN_DELETE", e[e.CAN_SELECT_ALL = 64] = "CAN_SELECT_ALL", e[e.CAN_TRANSLATE = 128] = "CAN_TRANSLATE"
    }(t.EditStateFlag || (t.EditStateFlag = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(7);

    class o {
        constructor() {
            this.mPeerId = void 0, this.mUserId = "0", this.mSessionId = void 0, this.mIsLogin = !1, this.mIsVip = !1, this.mVipLevel = 0, this.mVasType = 0, this.mExpireDate = "", this.mThunderVersionStr = void 0, this.mThunderVersionNumber = void 0
        }

        get expireDate() {
            return this.mExpireDate
        }

        get thunderVersionNumber() {
            return this.mThunderVersionNumber
        }

        get thunderVersionString() {
            return this.mThunderVersionStr
        }

        get vasType() {
            return this.mVasType
        }

        get vipLevel() {
            return this.mVipLevel
        }

        get userId() {
            return this.mUserId
        }

        get isLogin() {
            return this.mIsLogin
        }

        get isVip() {
            return this.mIsVip
        }

        get isPlatinumVip() {
            return this.isVip && this.mVasType > 2
        }

        get isSuperVip() {
            return this.isVip && 5 === this.mVasType
        }

        getSessionId() {
            return n(this, void 0, void 0, function* () {
                return new Promise(e => {
                    this.mSessionId ? e(this.mSessionId) : a.client.callServerFunction("GetSessionID").then(t => {
                        this.mSessionId = t, e(this.mSessionId || "0")
                    }).catch()
                })
            })
        }

        getPeerId() {
            return n(this, void 0, void 0, function* () {
                return new Promise(e => {
                    this.mPeerId ? e(this.mPeerId) : a.client.callServerFunction("GetPeerID").then(t => {
                        this.mPeerId = t, e(this.mPeerId || "")
                    }).catch()
                })
            })
        }

        getUserinfo() {
            return n(this, void 0, void 0, function* () {
                return yield a.client.callServerFunction("GetAllUserInfo")
            })
        }

        parseUserInfo() {
            return n(this, void 0, void 0, function* () {
                let e = yield this.getUserinfo();
                if (e) if (this.mIsLogin = !0, this.mUserId = e.userID || "0", e.vipList && e.vipList[0]) {
                    if (e.vipList[0].isVip) {
                        let t = Number(e.vipList[0].isVip).valueOf();
                        this.mIsVip = t > 0
                    } else this.mIsVip = !1;
                    e.vipList[0].vipLevel && (this.mVipLevel = Number(e.vipList[0].vipLevel).valueOf()), e.vipList[0].vasType && (this.mVasType = Number(e.vipList[0].vasType).valueOf()), e.vipList[0].expireDate && (this.mExpireDate = e.vipList[0].expireDate)
                } else this.mIsVip = !1
            })
        }

        loadThunderVersion() {
            a.client.callServerFunction("GetThunderVersion").then(e => {
                this.mThunderVersionStr = e, this.mThunderVersionNumber = 0;
                let t = this.mThunderVersionStr.split(".");
                if (t && 4 === t.length) {
                    let e = Number(t[0]).valueOf(), i = Number(t[1]).valueOf(), n = Number(t[2]).valueOf(), a = 128;
                    this.mThunderVersionNumber = a * Math.pow(2, 24) + e * Math.pow(2, 16) + i * Math.pow(2, 8) + n
                }
            }).catch()
        }

        onLogin() {
            return n(this, void 0, void 0, function* () {
                this.clear(), yield this.parseUserInfo()
            })
        }

        onLogout() {
            this.clear()
        }

        clear() {
            this.mUserId = "0", this.mSessionId = void 0, this.mIsVip = !1, this.mIsLogin = !1, this.mVasType = 0, this.mVipLevel = 0
        }
    }

    t.UserHelper = o, function (e) {
        const t = new o;
        e.getUserHelper = function () {
            return t
        }
    }(t.UserHelperNS || (t.UserHelperNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(422), a = i(7), o = i(4), r = i(23);
    t.signNative = new class {
        constructor() {
        }

        getNativeFunctionMap() {
            return [{functionName: "CloseDialog", nativeFunc: this.closeDialog}, {
                functionName: "ShowLoginPanel",
                nativeFunc: this.showLoginPanel
            }, {functionName: "PageReady", nativeFunc: this.pageReady}]
        }

        closeDialog(e, t, i, a) {
            n.signObject.closeDialog(), e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.Success)
        }

        showLoginPanel(e, t, i, n) {
            a.client.callServerFunction("ShowLoginDlg", "sign").catch(), e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.Success)
        }

        pageReady(e, t, i, a) {
            do {
                if (o.isNullOrUndefined(e) || o.isNullOrUndefined(t) || o.isNullOrUndefined(i)) break;
                n.signObject.show().catch(), e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.Success)
            } while (0)
        }
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(23), a = i(126);
    t.phoneAuthNative = new class {
        constructor() {
        }

        getNativeFunctionMap() {
            return [{functionName: "HideWebDlg", nativeFunc: this.hideWebDlg}]
        }

        hideWebDlg(e, t, i, o) {
            do {
                if (null === e || void 0 === e) break;
                if (null === o || void 0 === o) break;
                let r = o[0], s = o[1];
                a.phoneAuthObject.closeDialog(s, r), e.callNativeFunctionCallback(t, i, n.NativeFunctionErrorCode.Success)
            } while (0)
        }
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(2), a = i(6), o = i(0).default.getLogger("News-Popup.AdContainer"),
        r = a.default(n.join(__rootDir, "../bin/ThunderHelper.node")), s = 1125, l = 16;
    t.NewsAdContainer = class {
        constructor(e) {
            this.hwnd = 0, this.rect = null, this.id = e
        }

        getId() {
            return this.id
        }

        show() {
            o.information("show id:", this.id);
            do {
                if (!this.hwnd || !r.isWindowHandle(this.hwnd)) break;
                r.showWindow(this.hwnd, 5)
            } while (0)
        }

        hide() {
            o.information("hide id:", this.id);
            do {
                if (!this.hwnd || !r.isWindowHandle(this.hwnd)) break;
                r.showWindow(this.hwnd, 0)
            } while (0)
        }

        close() {
            o.information("close id:", this.id);
            do {
                if (!this.hwnd || !r.isWindowHandle(this.hwnd)) break;
                r.postMessage(this.hwnd, l, 0, 0)
            } while (0)
        }

        move(e, t, i, n) {
            do {
                if (this.rect = {
                    x: e,
                    y: t,
                    width: i,
                    height: n
                }, o.information("move id:", this.id, ", hwnd: ", this.hwnd, ", this.rect:", this.rect), !this.hwnd || !r.isWindowHandle(this.hwnd)) break;
                let a = (65535 & e) << 16 | 65535 & t, l = (65535 & i) << 16 | 65535 & n;
                r.postMessage(this.hwnd, s, a, l)
            } while (0)
        }

        onCreate(e) {
            this.hwnd = e
        }

        onClose() {
            this.hwnd = 0
        }
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(424), a = i(10), o = i(4), r = i(0), s = i(23), l = r.default.getLogger("NativeFunction.News-Popup");
    t.newsPopupNative = new class {
        constructor() {
        }

        getNativeFunctionMap() {
            return [{functionName: "PageReady", nativeFunc: this.pageReady}, {
                functionName: "Close",
                nativeFunc: this.close
            }, {
                functionName: "SetStartMoveMousePos",
                nativeFunc: this.setStartMoveMousePos
            }, {functionName: "SetMoveMousePos", nativeFunc: this.setMoveMousePos}, {
                functionName: "Minimize",
                nativeFunc: this.minimize
            }, {functionName: "CreateAd", nativeFunc: this.createAd}, {
                functionName: "ShowAd",
                nativeFunc: this.showAd
            }, {functionName: "HideAd", nativeFunc: this.hideAd}, {
                functionName: "CloseAd",
                nativeFunc: this.closeAd
            }, {functionName: "SetConfigValue", nativeFunc: this.setConfigValue}]
        }

        pageReady(e, t, i, a) {
            do {
                if (!e || !o.isNumber(t) || !o.isNumber(i)) break;
                if (!a || !o.isNumber(a[0]) || !o.isNumber(a[1])) {
                    e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.ParamError);
                    break
                }
                let r = a[0], l = a[1], d = n.newsPopupObject.getSize();
                d[0] === r && d[1] === l || (n.newsPopupObject.setSize(r, l), n.newsPopupObject.center()), n.newsPopupObject.show().catch(), e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success)
            } while (0)
        }

        close(e, t, i, a) {
            do {
                if (!e || !o.isNumber(t) || !o.isNumber(i)) break;
                l.information("close"), n.newsPopupObject.close(), e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success)
            } while (0)
        }

        setStartMoveMousePos(e, t, i, a) {
            do {
                if (!e || !o.isNumber(t) || !o.isNumber(i)) break;
                if (!a || !o.isNumber(a[0]) || !o.isNumber(a[1])) {
                    e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.ParamError);
                    break
                }
                let r = a[0], d = a[1];
                n.newsPopupObject.setStartMoveMousePos(r, d).catch(), l.information("setStartMoveMousePos x:", r, ", y:", d), e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success)
            } while (0)
        }

        setMoveMousePos(e, t, i, a) {
            do {
                if (!e || !o.isNumber(t) || !o.isNumber(i)) break;
                let r = a[0], d = a[1];
                n.newsPopupObject.setMoveMousePos(r, d), l.information("setMoveMousePos x:", r, ", y:", d), e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success)
            } while (0)
        }

        minimize(e, t, i, a) {
            do {
                if (!e || !o.isNumber(t) || !o.isNumber(i)) break;
                l.information("minimize"), n.newsPopupObject.minimize(), e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success)
            } while (0)
        }

        createAd(e, t, i, a) {
            do {
                if (!e || !o.isNumber(t) || !o.isNumber(i)) break;
                let r = "";
                a.length > 0 && o.isString(a[0]) && (r = a[0]);
                let d = n.newsPopupObject.createAd(r);
                l.information("createAd adType:", r, ", id:", d), e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success, d)
            } while (0)
        }

        showAd(e, t, i, a) {
            do {
                if (!e || !o.isNumber(t) || !o.isNumber(i)) break;
                if (!(a && o.isNumber(a[0]) && o.isNumber(a[1]) && o.isNumber(a[2]) && o.isNumber(a[3]) && o.isNumber(a[4]))) {
                    e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.ParamError);
                    break
                }
                let r = a[0], d = a[1], u = a[2], c = a[3], h = a[4];
                n.newsPopupObject.showAd(r, d, u, c, h), l.information("showAd id:", r, ", x:", d, ", y:", u, ", width:", c, ", height:", h), e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success)
            } while (0)
        }

        hideAd(e, t, i, a) {
            do {
                if (!e || !o.isNumber(t) || !o.isNumber(i)) break;
                if (!a || !o.isNumber(a[0])) {
                    e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.ParamError);
                    break
                }
                let r = a[0];
                n.newsPopupObject.hideAd(r), l.information("hideAd id:", r), e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success)
            } while (0)
        }

        closeAd(e, t, i, a) {
            do {
                if (!e || !o.isNumber(t) || !o.isNumber(i)) break;
                if (!a || !o.isNumber(a[0])) {
                    e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.ParamError);
                    break
                }
                let r = a[0];
                l.information("closeAd id:", r), n.newsPopupObject.closeAd(r), e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success)
            } while (0)
        }

        setConfigValue(e, t, i, n) {
            do {
                if (!e || !o.isNumber(t) || !o.isNumber(i)) break;
                if (!(n && o.isString(n[0]) && o.isString(n[1]) && o.isString(n[2]))) {
                    e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.ParamError);
                    break
                }
                let r = n[0], l = n[1], d = n[2];
                a.ConfigNS.setValue(r, l, d), e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success)
            } while (0)
        }
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(0), a = i(2), o = i(6).default(a.join(__rootDir, "../bin/ThunderHelper.node")),
        r = n.default.getLogger("HistoryDataNS");
    let s = a.resolve(__profilesDir, "mainWndData.ini"), l = 960, d = 640;
    !function (e) {
        e.getMainWndSizeHistoryData = function () {
            let e = null;
            r.information(s);
            let t = o.readINI(s, "MainBody", "ExitState"), i = o.readINI(s, "MainBody", "MainWndLastWidth"),
                n = o.readINI(s, "MainBody", "MainWndLastHeight");
            if (r.information(t, i, n), "" !== i && "" !== n) {
                let a = Number(i), o = Number(n);
                (a < l || o < d) && (a = l, o = d), (e = {}).width = a, e.height = o, e.exitState = t
            }
            return null === e && ((e = {}).exitState = "normal", e.width = l, e.height = d), e
        }, e.setExitType = function (e) {
            o.writeINI(s, "MainBody", "ExitType", e)
        }, e.getExitType = function () {
            return o.readINI(s, "MainBody", "ExitType")
        }
    }(t.HistoryDataNS || (t.HistoryDataNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(0), o = i(2), r = i(2), s = i(34), l = i(32), d = i(23), u = i(127), c = i(314), h = i(316), f = i(36),
        g = i(9), p = i(72), v = i(3), m = i(69), y = i(27), k = i(13), T = i(4), w = i(130), C = i(38), S = i(321),
        b = i(35), I = i(26), _ = i(95), A = i(60), D = i(6), x = i(90), N = i(10), E = i(5), P = i(14), M = i(124),
        O = i(126), F = i(428), L = i(322), B = i(307), U = i(429), R = i(110), K = i(58), W = i(539), V = i(22),
        H = i(11), z = i(51), j = i(540), G = i(431), $ = i(31), X = i(432), q = i(12), Y = i(7), J = i(54), Z = i(20),
        Q = i(64), ee = H.DownloadKernelTaskManager.getTaskManager(),
        te = D.default(o.join(__rootDir, "../bin/ThunderHelper.node")),
        ie = S.CommunityNaviteFunctionNS.CommunityNaviteFunction.getNativeModule(),
        ne = a.default.getLogger("NativeFunction"), ae = c.TaskInfoManagerNS.getTaskInfoManager();
    !function (e) {
        const t = new class {
            constructor() {
                this.isRegister = !1, this.isPersonalPageTrackEvent = !1
            }

            registerNativeFunction() {
                if (!this.isRegister) {
                    this.isRegister = !0;
                    let e = [{functionName: "PageReady", nativeFunc: this.pageReady}, {
                        functionName: "GetTaskInfo",
                        nativeFunc: this.getTaskInfo
                    }, {functionName: "OperateTask", nativeFunc: this.operateTask}, {
                        functionName: "ShellOpen",
                        nativeFunc: this.shellOpen
                    }, {
                        functionName: "OpenFolderWithSelectFile",
                        nativeFunc: this.openFolderWithSelectFile
                    }, {
                        functionName: "ShowOpenDialog",
                        nativeFunc: this.showOpenDialog
                    }, {functionName: "ShowSaveDialog", nativeFunc: this.showSaveDialog}, {
                        functionName: "GetFileMd5",
                        nativeFunc: this.getFileMd5
                    }, {functionName: "GetPeerID", nativeFunc: this.getPeerID}, {
                        functionName: "GetDeviceID",
                        nativeFunc: this.getDeviceID
                    }, {functionName: "GetCpuID", nativeFunc: this.getCpuID}, {
                        functionName: "GetDmideCode",
                        nativeFunc: this.getDmideCode
                    }, {
                        functionName: "GetThunderVersion",
                        nativeFunc: this.getThunderVersion
                    }, {functionName: "TrackEvent", nativeFunc: this.trackEvent}, {
                        functionName: "GetCurrentCategoryId",
                        nativeFunc: this.getCurrentCategoryId
                    }, {
                        functionName: "GetCurrentCategoryView",
                        nativeFunc: this.getCurrentCategoryView
                    }, {
                        functionName: "SelectCategoryView",
                        nativeFunc: this.switchCategoryView
                    }, {
                        functionName: "GetCurInternetState",
                        nativeFunc: this.getCurInternetState
                    }, {functionName: "DropOpenFile", nativeFunc: this.dragOpenFile}, {
                        functionName: "DropOpenUrl",
                        nativeFunc: this.dragOpenUrl
                    }, {
                        functionName: "GetCurPlatform",
                        nativeFunc: this.getCurPlatform
                    }, {
                        functionName: "CreateNewTask",
                        nativeFunc: this.createNewTask
                    }, {
                        functionName: "CreateNewTaskEx",
                        nativeFunc: this.createNewTaskEx
                    }, {
                        functionName: "FireEventFunction",
                        nativeFunc: this.fireEventFunction
                    }, {
                        functionName: "ShowCustomDownloadModeDlg",
                        nativeFunc: this.showCustomDownloadModeDlg
                    }, {
                        functionName: "GetTaskStartStatusPrompt",
                        nativeFunc: this.getTaskStartStatusPrompt
                    }, {
                        functionName: "ShowBrowserGuideDlg",
                        nativeFunc: this.showBrowserGuideDlg
                    }, {
                        functionName: "OpenURLByIEorDefault",
                        nativeFunc: this.openURLByIEorDefault
                    }, {
                        functionName: "GetDownloadDir",
                        nativeFunc: this.getDownloadDir
                    }, {
                        functionName: "ShowPersonalPage",
                        nativeFunc: this.showPersonalPage
                    }, {functionName: "ShowWebWnd", nativeFunc: this.showWebWnd}, {
                        functionName: "CreateWebWnd",
                        nativeFunc: this.createWebWnd
                    }, {
                        functionName: "RegisterWebFunction",
                        nativeFunc: this.registerWebFunction
                    }, {
                        functionName: "CallBackWebFunction",
                        nativeFunc: this.callBackWebFunction
                    }, {
                        functionName: "FireEventWebFunction",
                        nativeFunc: this.fireEventWebFunction
                    }, {
                        functionName: "IsPhoneAuth",
                        nativeFunc: this.isPhoneAuth
                    }, {
                        functionName: "GetSearchRecommends",
                        nativeFunc: this.getSearchRecommends
                    }, {
                        functionName: "SetSearchRecommends",
                        nativeFunc: this.setSearchRecommends
                    }, {
                        functionName: "GetCommonlySites",
                        nativeFunc: this.getCommonlySites
                    }, {
                        functionName: "ClearCommonlySites",
                        nativeFunc: this.clearCommonlySites
                    }, {
                        functionName: "DeleteCommonlySites",
                        nativeFunc: this.deleteCommonlySites
                    }, {
                        functionName: "TopBookmarksItem",
                        nativeFunc: this.topBookmarksItem
                    }, {
                        functionName: "EditBookmarksItemAW",
                        nativeFunc: this.editBookmarksItemAW
                    }, {
                        functionName: "GetRecentHistorys",
                        nativeFunc: this.getRecentHistorys
                    }, {
                        functionName: "ClearHistorys",
                        nativeFunc: this.clearHistorys
                    }, {
                        functionName: "DeleteHistoryItem",
                        nativeFunc: this.deleteHistoryItem
                    }, {
                        functionName: "GetBaiduDWZ",
                        nativeFunc: this.getBaiduDWZ
                    }, {
                        functionName: "GetInitDownloadData",
                        nativeFunc: this.getInitDownloadData
                    }, {functionName: "BringMainWndToTop", nativeFunc: this.bringMainWndToTop}, {
                        functionName: "Log",
                        nativeFunc: this.log
                    }, {
                        functionName: "IsFilePathExist",
                        nativeFunc: this.isFilePathExist
                    }, {
                        functionName: "GetTaskBirdKeyData",
                        nativeFunc: this.getTaskBirdKeyData
                    }, {
                        functionName: "GetShouleiShareLink",
                        nativeFunc: this.getShouleiShareLink
                    }, {
                        functionName: "GetShouleiShareLinkDlj",
                        nativeFunc: this.getShouleiShareLinkDlj
                    }, {
                        functionName: "GetShouleiShareLink2",
                        nativeFunc: this.getShouleiShareLink2
                    }, {
                        functionName: "GetShouleiShareLinkDlj2",
                        nativeFunc: this.getShouleiShareLinkDlj2
                    }, {
                        functionName: "GetShouleiFileTransferLink",
                        nativeFunc: this.getShouleiFileTransferLink
                    }, {
                        functionName: "GetShouleiFileTransferDlj",
                        nativeFunc: this.getShouleiFileTransferDlj
                    }, {
                        functionName: "GetVideoPreViews",
                        nativeFunc: this.getVideoPreViews
                    }, {
                        functionName: "CreateWebShortcut",
                        nativeFunc: this.createWebShortcut
                    }, {
                        functionName: "MessageBoxPop",
                        nativeFunc: this.messageBoxPop.bind(this)
                    }, {
                        functionName: "MessageBoxConfirm",
                        nativeFunc: this.messageBoxConfirm.bind(this)
                    }, {
                        functionName: "MessageBoxCustom",
                        nativeFunc: this.messageBoxCustom.bind(this)
                    }, {
                        functionName: "GetTaskBirdKeyOfTaskId",
                        nativeFunc: this.getTaskBirdKeyOfTaskId.bind(this)
                    }, {
                        functionName: "PromptShare",
                        nativeFunc: this.promptShare
                    }, {
                        functionName: "PopupDownloadShoulei",
                        nativeFunc: this.popupDownloadShoulei
                    }, {functionName: "SetPlayerPosition", nativeFunc: this.setPlayerPosition}];
                    l.NativeCallNS.registerNativeFunction(e)
                }
            }

            pageReady(e, t, i, n) {
                do {
                    if (T.isNullOrUndefined(e) || T.isNullOrUndefined(i)) break;
                    if (!n || !n[0]) {
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0];
                    "taskDetail" === a ? (u.TaskDetailNS.pageReady(), e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success)) : "community" === a ? (ie.emit("community.pageReady"), e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success)) : e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError)
                } while (0)
            }

            getTaskInfo(e, t, i, n) {
                do {
                    if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                    if (!n || !n[0] || !n[2]) {
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0];
                    "taskDetail" === n[2] ? ae.getHistoryTaskInfoString(a).then(n => {
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, n)
                    }).catch() : e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError)
                } while (0)
            }

            operateTask(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        if (!a || !a[0] || !a[1]) {
                            e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let n = a[0], o = a[1], r = a[2];
                        yield h.TaskOperate.operateTaskActions(n, o, r), e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success)
                    } while (0)
                })
            }

            shellOpen(e, t, i, n) {
                do {
                    if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                    if (!n || !n[0]) {
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0];
                    f.TaskOperatorNs.asyncOpenItem(a).catch(), e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success)
                } while (0)
            }

            openFolderWithSelectFile(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        if (!a || !a[0]) {
                            e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let n = a[0];
                        yield(yield q.asyncRemoteCall.getShell()).showItemInFolder(n), e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success)
                    } while (0)
                })
            }

            showOpenDialog(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        const n = yield q.asyncRemoteCall.getDialog();
                        let o = null;
                        if (a[0]) try {
                            o = JSON.parse(a[0])
                        } catch (e) {
                            ne.warning("showOpenDialog param error", a[0], e)
                        }
                        o || (o = {properties: ["openDirectory"]});
                        let r = yield q.asyncRemoteCall.getCurrentWindow();
                        n.showOpenDialog(r, o, n => {
                            e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, n ? JSON.stringify(n) : n)
                        })
                    } while (0)
                })
            }

            showSaveDialog(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        const n = yield q.asyncRemoteCall.getDialog();
                        let o = null;
                        if (a[0]) try {
                            o = JSON.parse(a[0])
                        } catch (e) {
                            ne.warning("showSaveDialog param error", a[0], e)
                        }
                        let r = yield q.asyncRemoteCall.getCurrentWindow();
                        n.showSaveDialog(r, o, n => {
                            e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, n)
                        })
                    } while (0)
                })
            }

            getFileMd5(e, t, i, n) {
                do {
                    if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                    if (!n || !n[0]) {
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0];
                    s.ToolsUtilitiesAWNS.calculateFileMd5(a).then(n => {
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, n)
                    }).catch()
                } while (0)
            }

            getPeerID(e, t, i, n) {
                ne.information(n);
                let a = te.getPeerID();
                e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, a)
            }

            getDeviceID(e, t, i, n) {
                ne.information(n);
                let a = te.getPeerID();
                e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, a)
            }

            getCpuID(e, t, i, n) {
                let a = te.getCpuID();
                e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, a)
            }

            getDmideCode(e, t, i, n) {
                let a = te.getDmideCode();
                e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, a)
            }

            getThunderVersion(e, t, i, n) {
                ne.information(n);
                let a = o.join(__rootDir, "../../Thunder.exe"), r = te.getFileVersion(a);
                e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, r)
            }

            trackEvent(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    ne.information(a);
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        if (!a || !a[0]) {
                            e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let n = a[0], o = void 0 === a[1] ? "" : a[1], r = void 0 === a[2] ? "" : a[2],
                            s = void 0 === a[3] ? 0 : a[3], l = void 0 === a[4] ? 0 : a[4],
                            u = void 0 === a[5] ? 0 : a[5], c = void 0 === a[6] ? 0 : a[6],
                            h = void 0 === a[7] ? "" : a[7], f = void 0 === a[8] ? 0 : a[8],
                            p = yield g.XLStatNS.asyncTrackEvent(n, o, r, s, l, u, c, h, f);
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, p)
                    } while (0)
                })
            }

            getCurrentCategoryId(e, t, i, n) {
                do {
                    if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                    let n = y.default.getCurrentCategoryId();
                    e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, n)
                } while (0)
            }

            getCurrentCategoryView(e, t, i, n) {
                do {
                    if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                    let n = y.default.getCurrentCategoryView();
                    e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, n)
                } while (0)
            }

            switchCategoryView(e, t, i, n) {
                do {
                    if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                    if (T.isNullOrUndefined(n) || T.isNullOrUndefined(n[0]) || T.isNullOrUndefined(n[1])) {
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0], o = n[1], r = void 0;
                    void 0 !== n[2] && (r = n[2]);
                    let s = n[3];
                    ne.information(a, o, r), y.default.fireEvent(k.NodeEventMesssageNS.eventDownloadSwitchCategory, a, o, r, s)
                } while (0)
            }

            dragOpenFile(e, t, i, n) {
                do {
                    if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                    if (T.isNullOrUndefined(n) || T.isNullOrUndefined(n[0])) {
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0];
                    if (void 0 === a || null === a || "" === a) break;
                    w.default.onCommand("path", a, "file_drag").catch()
                } while (0)
            }

            dragOpenUrl(e, t, i, n) {
                do {
                    if (void 0 === e || null === e) break;
                    if (void 0 === t || null === t) break;
                    if (void 0 === i || null === i) break;
                    let a = n[0];
                    if (void 0 === a || null === a || "" === a) break;
                    let o = b.ThunderHelper.getTaskTypeFromUrl(a);
                    o === v.DownloadKernel.TaskType.P2sp || o === v.DownloadKernel.TaskType.Emule ? C.ThunderNewTask.createPreNewTaskWindow([a], "url_drag") : o !== v.DownloadKernel.TaskType.Bt && o !== v.DownloadKernel.TaskType.Magnet || C.ThunderNewTask.createBtTaskWindow({
                        url: a,
                        type: "url"
                    }, {source: "url_drag"})
                } while (0)
            }

            getCurInternetState(e, t, i, n) {
                do {
                    if (ne.information(n), T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                    let a = te.getCurInternetState();
                    e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, a)
                } while (0)
            }

            getCurPlatform(e, t, i, n) {
                do {
                    if (ne.information(n), T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                    let a = "pc-xdas";
                    e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, a)
                } while (0)
            }

            createNewTask(e, t, i, n) {
                do {
                    if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                    let a = n[0], o = null;
                    try {
                        o = JSON.parse(a)
                    } catch (e) {
                        ne.warning(e)
                    }
                    if (ne.information("createNewTask", o), T.isNullOrUndefined(o)) break;
                    for (let e in o) {
                        let t = o[e];
                        if ("com" === t.type) {
                            let e = void 0;
                            for (let t in o) {
                                void 0 === e && (e = []), ne.information("createNewTask url", o[t].url);
                                let i = o[t].url.split("%0A");
                                if (1 === i.length && (i = o[t].url.split(/[\n\r\n]/)), ne.information("createNewTask urls", i), 1 === i.length) e.push({
                                    url: o[t].url,
                                    referer: o[t].refer,
                                    fileName: o[t].name,
                                    statClick: o[t].stat ? o[t].stat : "outline",
                                    browser: o[t].browser ? o[t].browser : "xlbrowser.exe"
                                }); else for (let n of i) e.push({
                                    url: n,
                                    referer: o[t].refer,
                                    statClick: o[t].stat ? o[t].stat : "outline",
                                    browser: o[t].browser ? o[t].browser : "xlbrowser.exe"
                                })
                            }
                            C.ThunderNewTask.createPreNewTaskWindow(e);
                            break
                        }
                        if ("bt" === t.type) {
                            let e = t.url;
                            C.ThunderNewTask.createBtTaskWindow({
                                url: e,
                                type: "url"
                            }, {
                                source: t.stat ? t.stat : "outline",
                                browser: t.browser ? t.browser : "xlbrowser.exe",
                                referer: t.refer
                            });
                            break
                        }
                        "bird" === t.type && p.URLHelperNS.isBirdKey(t.url) && m.openBirdKeyDecodeDialog(t.url, {from: t.stat || "outline"})
                    }
                } while (0)
            }

            createNewTaskEx(e, t, i, n) {
                do {
                    if (ne.information("createNewTaskEx 接口 enter 第一个参数:", n[0]), T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                    if (T.isNullOrUndefined(n[0])) break;
                    let a = null;
                    try {
                        a = JSON.parse(n[0])
                    } catch (e) {
                        break
                    }
                    let o = [];
                    for (let e in a) {
                        let t = a[e];
                        if (p.URLHelperNS.isBirdKey(t.url)) {
                            m.openBirdKeyDecodeDialog(t.url, {from: t.stat});
                            continue
                        }
                        let i = b.ThunderHelper.getTaskTypeFromUrl(t.url);
                        if (ne.information(" createNewTaskEx", t.url, " type:", i), i === v.DownloadKernel.TaskType.P2sp || i === v.DownloadKernel.TaskType.Emule) o.push({
                            url: a[e].url,
                            referer: a[e].refer,
                            fileName: a[e].name,
                            statClick: a[e].stat,
                            birdkeyChars: a[e].birdkeyChars
                        }); else if (i === v.DownloadKernel.TaskType.Bt || i === v.DownloadKernel.TaskType.Magnet) {
                            let i = t.url;
                            C.ThunderNewTask.createBtTaskWindow({
                                url: i,
                                type: "url",
                                birdkeyChars: a[e].birdkeyChars
                            }, {source: t.stat, referer: t.refer})
                        } else t.url.includes("taskGroupName") && C.ThunderNewTask.createThunderxTask(t.url, t.stat).catch()
                    }
                    o.length > 0 && C.ThunderNewTask.createPreNewTaskWindow(o)
                } while (0)
            }

            fireEventFunction(e, t, i, n) {
                do {
                    if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                    if (T.isNullOrUndefined(n) || T.isNullOrUndefined(n[0])) {
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    I.NativeCallHostModule.nativeCallHost.fireNativeEvent("onWebEvent", ...n), e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success)
                } while (0)
            }

            showCustomDownloadModeDlg(e, t, i) {
                do {
                    if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                    _.DownloadModeNS.showCustomDownloadModeDlg().catch(), e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success)
                } while (0)
            }

            showBrowserGuideDlg(e, t, i) {
                do {
                    if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                    x.default().popUpBrowserGuide(!0).catch()
                } while (0)
            }

            getTaskStartStatusPrompt(e, t, i, n) {
                do {
                    if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                    if (T.isNullOrUndefined(n) || T.isNullOrUndefined(n[0])) {
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    try {
                        let a = JSON.parse(n[0]), o = A.TaskStatusHelper.getTaskStartStatusPrompt(a);
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, o)
                    } catch (n) {
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError)
                    }
                } while (0)
            }

            openURLByIEorDefault(e, t, i, n) {
                do {
                    if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                    if (T.isNullOrUndefined(n) || T.isNullOrUndefined(n[0])) {
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = te.openURLByIEorDefault(n[0]);
                    e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, a)
                } while (0)
            }

            getDownloadDir(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        let n = "";
                        do {
                            if (N.ConfigNS.getValue("TaskDefaultSettings", "UseLastCatalog", !0) && (n = N.ConfigNS.getValue("PathAndCategory", "LastUsedPath", "")) || (n = N.ConfigNS.getValue("TaskDefaultSettings", "DefaultPath", "")), void 0 !== n && null !== n && "" !== n && (yield E.FileSystemAWNS.mkdirsAW(n))) break;
                            n = P.ThunderUtil.getDefaultDownloadDir()
                        } while (0);
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, n)
                    } while (0)
                })
            }

            showPersonalPage(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        if (T.isNullOrUndefined(a) || T.isNullOrUndefined(a[0])) {
                            e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let n = 0, o = a[0];
                        if (!this.isPersonalPageTrackEvent) {
                            this.isPersonalPageTrackEvent = !0;
                            let e = N.ConfigNS.getValue("Install", "PersonalUid", "");
                            void 0 !== e && null !== e || (e = "");
                            let t = "uid=" + e + ",start_page=" + (o ? "Individualization_home_page" : "official_home_page");
                            n = yield g.XLStatNS.asyncTrackEvent("core_event", "startup_page", "", 0, 0, 0, 0, t)
                        }
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, n)
                    } while (0)
                })
            }

            showWebWnd(e, t, i, a) {
                do {
                    if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                    if (T.isNullOrUndefined(a) || T.isNullOrUndefined(a[0])) {
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let o = a[0];
                    if (a.splice(0, 1), null !== a[10] && void 0 !== a[10]) {
                        let e = a[10];
                        a[10] = (() => n(this, void 0, void 0, function* () {
                            return new Promise(i => {
                                I.NativeCallHostModule.nativeCallHost.callJsFunctionById(t, e), i(!0)
                            })
                        }))
                    }
                    if (null !== a[11] && void 0 !== a[11]) {
                        let e = a[11];
                        a[11] = (() => n(this, void 0, void 0, function* () {
                            I.NativeCallHostModule.nativeCallHost.callJsFunctionById(t, e)
                        }))
                    }
                    M.EmbeddedBrowserManagerNs.showWebWnd(o, ...a), e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success)
                } while (0)
            }

            createWebWnd(e, t, i, a) {
                do {
                    if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                    if (T.isNullOrUndefined(a) || T.isNullOrUndefined(a[0])) {
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let o = a[0];
                    if (a.splice(0, 1), null !== a[10] && void 0 !== a[10]) {
                        let e = a[10];
                        a[10] = (() => n(this, void 0, void 0, function* () {
                            return new Promise(i => {
                                I.NativeCallHostModule.nativeCallHost.callJsFunctionById(t, e), i(!0)
                            })
                        }))
                    }
                    if (null !== a[11] && void 0 !== a[11]) {
                        let e = a[11];
                        a[11] = (() => n(this, void 0, void 0, function* () {
                            I.NativeCallHostModule.nativeCallHost.callJsFunctionById(t, e)
                        }))
                    }
                    if (null !== a[12] && void 0 !== a[12]) {
                        let e = a[12];
                        a[12] = ((i, ...a) => n(this, void 0, void 0, function* () {
                            I.NativeCallHostModule.nativeCallHost.callJsFunctionById(t, e, i, ...a)
                        }))
                    }
                    M.EmbeddedBrowserManagerNs.createWebWnd(o, ...a), e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success)
                } while (0)
            }

            registerWebFunction(e, t, i, n) {
                do {
                    if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                    if (T.isNullOrUndefined(n) || T.isNullOrUndefined(n[0])) {
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0], o = n[1], r = n[2];
                    if (null === o || void 0 === o || "" === o) {
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    if (null === r || void 0 === r) {
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    M.EmbeddedBrowserManagerNs.registerWebFunction(a, o, (...e) => {
                        I.NativeCallHostModule.nativeCallHost.callJsFunctionById(t, r, ...e)
                    }), e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success)
                } while (0)
            }

            callBackWebFunction(e, t, i, n) {
                do {
                    if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                    if (T.isNullOrUndefined(n) || T.isNullOrUndefined(n[0])) {
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0], o = n[1], r = n[2], s = n[3];
                    if (null === a || void 0 === a || "" === a) {
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    if (null === o || void 0 === o) {
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    if (null === r || void 0 === r) {
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    M.EmbeddedBrowserManagerNs.callBackWebFunction(a, o, r, s), e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success)
                } while (0)
            }

            fireEventWebFunction(e, t, i, n) {
                do {
                    if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                    if (T.isNullOrUndefined(n) || T.isNullOrUndefined(n[0])) {
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0];
                    if (null === a || void 0 === a || "" === a) {
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    n.splice(0, 1), M.EmbeddedBrowserManagerNs.fireEventWebFunction(a, ...n), e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success)
                } while (0)
            }

            isPhoneAuth(e, t, i, n) {
                do {
                    if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                    O.phoneAuthObject.isPhoneAuthAw().then(n => {
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, n)
                    }).catch()
                } while (0)
            }

            getSearchRecommends(e, t, i, n) {
                do {
                    if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                    let n = F.SearchConfigNS.getRecommends();
                    e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, n)
                } while (0)
            }

            setSearchRecommends(e, t, i, n) {
                do {
                    if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                    if (!n || !n[0]) {
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0];
                    F.SearchConfigNS.setRecommends(a), e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success)
                } while (0)
            }

            getCommonlySites(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        let n = yield L.CommonSitesMgrNS.getInstance().getMostCommonly();
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, JSON.stringify(n))
                    } while (0)
                })
            }

            clearCommonlySites(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        yield L.CommonSitesMgrNS.getInstance().clear()
                    } while (0)
                })
            }

            deleteCommonlySites(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        yield L.CommonSitesMgrNS.getInstance().delete(a[0])
                    } while (0)
                })
            }

            topBookmarksItem(e, t, i, n) {
                do {
                    if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                    if (!n || !n[0]) {
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    ie.emit("bookmarks.top", n[0]), e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success)
                } while (0)
            }

            editBookmarksItemAW(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        if (!a || !a[0]) {
                            e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let n = a[0];
                        if (!n.url || !n.title || !n.state) {
                            e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let o = yield(yield q.asyncRemoteCall.getCurrentWindow()).getBounds(),
                            r = {y: o.y + 48, x: o.x + (o.width - 400) / 2, modal: !1},
                            s = yield V.MessageBox.custom("BookMarks", {state: n.state, title: n.title}, r);
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, s), ie.emit("bookmarks.editfinish", s, n)
                    } while (0)
                })
            }

            getRecentHistorys(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        let n = yield G.historyManager.getRecentHistory();
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, JSON.stringify(n))
                    } while (0)
                })
            }

            clearHistorys(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        let n = yield G.historyManager.clear();
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, JSON.stringify(n))
                    } while (0)
                })
            }

            deleteHistoryItem(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        let n = a[0];
                        if (!n) break;
                        let o = null;
                        try {
                            o = JSON.parse(n)
                        } catch (e) {
                        }
                        if (!o) break;
                        yield G.historyManager.delete(o), e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success)
                    } while (0)
                })
            }

            getBaiduDWZ(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        if (!a || !a[0]) {
                            e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let n = a[0], o = yield B.getBaiduDWZ(n);
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, o)
                    } while (0)
                })
            }

            getShouleiShareLink(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        if (!a || !a[0]) {
                            e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let n = a[0], o = "pic";
                        T.isString(a[1]) && (o = a[1]);
                        let r = "";
                        T.isString(a[2]) && (r = a[2]);
                        let s = yield R.getShouleiShareLink(n, o, r);
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, s)
                    } while (0)
                })
            }

            getShouleiShareLinkDlj(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        if (!a || !a[0]) {
                            e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let n = a[0], o = "pic";
                        T.isString(a[1]) && (o = a[1]);
                        let r = "";
                        T.isString(a[2]) && (r = a[2]);
                        let s = yield R.getShouleiShareLinkDlj(n, o, r);
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, s)
                    } while (0)
                })
            }

            getShouleiShareLink2(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        if (!a || !a[0]) {
                            e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let n = a[0], o = a[1], r = a[2], s = a[3], l = a[4], u = a[5], c = "pic";
                        T.isString(a[6]) && (c = a[6]);
                        let h = "";
                        T.isString(a[7]) && (h = a[7]);
                        let f = yield R.getShouleiShareLink2(n, o, r, s, l, u, c, h);
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, f)
                    } while (0)
                })
            }

            getShouleiShareLinkDlj2(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        if (!a || !a[0]) {
                            e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let n = a[0], o = a[1], r = a[2], s = a[3], l = a[4], u = a[5], c = "pic";
                        T.isString(a[6]) && (c = a[6]);
                        let h = "";
                        T.isString(a[7]) && (h = a[7]);
                        let f = yield R.getShouleiShareLinkDlj2(n, o, r, s, l, u, c, h);
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, f)
                    } while (0)
                })
            }

            getShouleiFileTransferLink(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        if (!a || !a[0] || !a[1]) {
                            e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let o = a[0], r = "pic";
                        T.isString(a[1]) && (r = a[1]);
                        let s = "";
                        T.isString(a[2]) && (s = a[2]), $.ThunderKernel.getSubNetUploader((a, l) => n(this, void 0, void 0, function* () {
                            if (ne.information("getSubNetUploader result", a, l), 0 === a && l) {
                                let n = yield R.getShouleiFileTransferLink(o, l, r, s);
                                e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, n)
                            } else e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.CallFailed)
                        }))
                    } while (0)
                })
            }

            getShouleiFileTransferDlj(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        if (!a || !a[0]) {
                            e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let o = a[0], r = "pic";
                        T.isString(a[1]) && (r = a[1]);
                        let s = "";
                        T.isString(a[2]) && (s = a[2]), $.ThunderKernel.getSubNetUploader((a, l) => n(this, void 0, void 0, function* () {
                            if (ne.information("getSubNetUploader result", a, l), 0 === a && l) {
                                let n = yield R.getShouleiFileTransferDlj(o, l, r, s);
                                e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, n)
                            } else e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.CallFailed)
                        }))
                    } while (0)
                })
            }

            getVideoPreViews(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        let n = a[0], o = a[1];
                        o || (o = "picPreview");
                        let r = yield W.videoPreviewData.getVideoPreview(n);
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, r)
                    } while (0)
                })
            }

            getInitDownloadData(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        let n = JSON.stringify(U.default.getDownloadData());
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, n)
                    } while (0)
                })
            }

            bringMainWndToTop(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        let n = !1, a = yield q.asyncRemoteCall.getCurrentWindow();
                        a && ((yield a.isMinimized()) && (yield a.restore()), yield a.show(), yield s.ToolsUtilitiesAWNS.setForegroundWindow(te, a), n = !0), e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, n)
                    } while (0)
                })
            }

            log(e, t, i, n) {
                do {
                    if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                    if (!n || n.length < 3) {
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let o = n[0], r = n[1], s = null;
                    s = T.isString(o) && o.length > 0 ? a.default.getLogger(o) : ne;
                    let l = !0;
                    switch (r) {
                        case"verbose":
                            s.verbose(n.splice(2));
                            break;
                        case"information":
                            s.information(n.splice(2));
                            break;
                        case"warning":
                            s.warning(n.splice(2));
                            break;
                        case"error":
                            s.error(n.splice(2));
                            break;
                        case"critical":
                            s.critical(n.splice(2));
                            break;
                        default:
                            l = !1
                    }
                    e.callNativeFunctionCallback(t, i, l ? d.NativeFunctionErrorCode.Success : d.NativeFunctionErrorCode.ParamError)
                } while (0)
            }

            isFilePathExist(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        if (!a || !a[0] || !T.isString(a[0])) {
                            e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let n = a[0], o = yield E.FileSystemAWNS.existsAW(n);
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, o)
                    } while (0)
                })
            }

            getTaskBirdKeyData(e, t, i, n) {
                do {
                    if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                    if (!n || !n[0]) {
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0], o = h.TaskOperate.getTaskBirdKeyData(a);
                    e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, o)
                } while (0)
            }

            createWebShortcut(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    ne.information("createWebShortcut");
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        if (!a || !a[0]) {
                            e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let n = !1, s = a[0], l = null;
                        try {
                            l = JSON.parse(s)
                        } catch (e) {
                            ne.warning("error", e)
                        }
                        if (l && l.name && l.url && l.iconUrl) {
                            let n = l.name.replace(/[*?/\\:|<>\"]/g, "_"), a = yield q.asyncRemoteCall.getApp(),
                                s = r.join(yield a.getPath("desktop"), `${n}.lnk`), u = l.runParams || "";
                            ne.information("lnkPath", s), ne.information("runParams", u), ne.information("iconUrl", l.iconUrl);
                            let c = "", h = encodeURI(l.iconUrl), f = te.getRoamingAppDataPath(),
                                g = o.join(f, "XLWebPageGame/IconDir"), p = n + ".ico";
                            c = o.join(g, p);
                            let v = yield K.AxiosNS.downloadFileAW(h, c);
                            if (ne.information("downloadFileAW", v), ne.information("url", l.url), ne.information("iconPath", c), v) {
                                te.createShortcut(s, l.url, u, c, n => {
                                    ne.information("createShortcut result", n), e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, n)
                                });
                                break
                            }
                        }
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, n)
                    } while (0)
                })
            }

            messageBoxPop(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    ne.information("messageBoxPop args:", a);
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        if (!a || !a[0]) {
                            e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let n = null;
                        try {
                            n = JSON.parse(a[0])
                        } catch (n) {
                            ne.warning(n), e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let o = null;
                        if (a[1]) try {
                            o = JSON.parse(a[1])
                        } catch (e) {
                            ne.warning(e)
                        }
                        let r = yield V.MessageBox.pop(n, o);
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, JSON.stringify(r))
                    } while (0)
                })
            }

            messageBoxConfirm(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    ne.information("messageBoxConfirm args:", a);
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        if (!a || !a[0]) {
                            e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let n = null;
                        try {
                            n = JSON.parse(a[0])
                        } catch (n) {
                            ne.warning(n), e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let o = null;
                        if (a[1]) try {
                            o = JSON.parse(a[1])
                        } catch (e) {
                            ne.warning(e)
                        }
                        let r = yield V.MessageBox.confirm(n, o);
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, JSON.stringify(r))
                    } while (0)
                })
            }

            messageBoxCustom(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    ne.information("messageBoxCustom args:", a);
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        if (!a || !a[0]) {
                            e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let n = a[0], o = null;
                        try {
                            o = JSON.parse(a[1])
                        } catch (n) {
                            ne.warning(n), e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let r = null;
                        if (a[1]) try {
                            r = JSON.parse(a[2])
                        } catch (e) {
                            ne.warning(e)
                        }
                        let s = yield V.MessageBox.custom(n, o, r);
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, JSON.stringify(s))
                    } while (0)
                })
            }

            getTaskBirdKeyOfTaskId(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    ne.information("messageBoxConfirm args:", a);
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        if (!a || !a[0]) {
                            e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let n = a[0], o = ee.getTaskFromTaskId(Number(n));
                        if (!o) {
                            e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let r = void 0;
                        r = o.getExtraObject().getUserData(z.TaskUserDataGUID.guidBirdKey, "birdKey"), e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, r)
                    } while (0)
                })
            }

            promptShare(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        j.ShareToastListenerNS.addListener(a[0], a[1])
                    } while (0)
                })
            }

            setPlayerPosition(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    ne.information("native setPlayerPosition openFrom", a[8]);
                    let e = N.ConfigNS.getValue("PopBox", "AutoPop", !0),
                        t = yield Y.client.callServerFunction("getPlayTaskDetailShow");
                    do {
                        if (("backup" === a[8] || "scroll" === a[8]) && !t) break;
                        if (!e && "showDetail" === a[8]) {
                            let e = (yield Z.server.callClientFunctionByName(Q.CommonIPCBase.mainProcessContext, "getXmpShowMode"))[0];
                            if (ne.information("get xmp mode", e), e !== J.XMPShowMode.MINI_MODE && e !== J.XMPShowMode.UNKNOWN_MODE) break
                        }
                    } while (0)
                })
            }

            popupDownloadShoulei(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (T.isNullOrUndefined(e) || T.isNullOrUndefined(t) || T.isNullOrUndefined(i)) break;
                        let n = yield X.getMobileImgSrc();
                        if (!n) {
                            e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.CallFailed);
                            break
                        }
                        let o = yield V.MessageBox.custom("img-dlg", {src: n, width: 400, height: 276}, {
                            width: 400,
                            height: 276
                        });
                        if (e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, JSON.stringify(o)), !a) break
                    } while (0)
                })
            }
        };
        e.registerNativeFunction = function () {
            t.registerNativeFunction()
        }
    }(t.NaviteFunctionNS || (t.NaviteFunctionNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(39);
    const a = new class extends n.default {
    };
    t.default = a
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(2), a = i(3), o = i(30), r = i(11), s = i(15), l = i(29), d = i(40), u = i(59), c = i(10), h = i(24),
        f = i(16), g = i(320), p = i(6), v = i(7);
    !function (e) {
        e.dk = a.DownloadKernel, e.dkManager = o.DownloadKernelManager, e.taskManager = r.DownloadKernelTaskManager.getTaskManager(), e.eventManager = s.DownloadKernelEventManager.getEventManager(), e.categoryManager = l.DownloadKernelCategoryManager.getCategoryManager(), e.categoryViewManager = d.DownloadKernelCategoryViewManager.getCategoryViewManager(), e.taskUtilities = u.TaskUtilitiesAWNS, e.config = c.ConfigNS, e.logHelper = h.LoginHelperNS, e.thunderHelper = p.default(n.join(__rootDir, "../bin/ThunderHelper.node")), e.nativeCallModule = f.NativeCallModule, e.messageChannel = g.MessageChannelNS, e.thunderMsgChannel = g.MessageChannelNS.getThunderMsgChannel(), e.clientModule = v.client
    }(t.DownloadKernelTestNS || (t.DownloadKernelTestNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(0), a = i(3), o = i(15), r = i(11), s = i(29), l = i(16),
        d = r.DownloadKernelTaskManager.getTaskManager(), u = o.DownloadKernelEventManager.getEventManager(),
        c = s.DownloadKernelCategoryManager.getCategoryManager(), h = n.default.getLogger("Community.TaskManager");
    !function (e) {
        class t {
            constructor() {
                this.insertToCategoryViewEventId = void 0, this.detailChangedEventId = void 0, this.taskStatusChangedEventId = void 0, this.taskInfoMap = new Map, this.userLoginEventId = void 0, this.userLogoutEventId = void 0
            }

            init() {
                h.information("init"), this.insertToCategoryViewEventId = u.attachTaskEvent(a.DownloadKernel.TaskEventType.InsertToCategoryView, (...e) => {
                    e && e[0] === a.DownloadKernel.TaskEventType.InsertToCategoryView && this.onInsertToCategoryView(e[1], e[2], e[3])
                }), this.detailChangedEventId = u.attachTaskEvent(a.DownloadKernel.TaskEventType.DetailChanged, (...e) => {
                    e && e[0] === a.DownloadKernel.TaskEventType.DetailChanged && this.onDetailChanged(e[1], e[2])
                }), this.taskStatusChangedEventId = u.attachTaskEvent(a.DownloadKernel.TaskEventType.StatusChanged, (...e) => {
                    e && e[0] === a.DownloadKernel.TaskEventType.StatusChanged && this.onTaskStatusChanged(e[1])
                }), this.userLoginEventId = l.NativeCallModule.nativeCall.AttachNativeEvent("OnUserLogin", this.onUserLogin.bind(this)), this.userLogoutEventId = l.NativeCallModule.nativeCall.AttachNativeEvent("OnUserLogout", this.onUserLogout.bind(this))
            }

            uninit() {
                void 0 !== this.insertToCategoryViewEventId && (this.insertToCategoryViewEventId = void 0, u.detachTaskEvent(a.DownloadKernel.TaskEventType.InsertToCategoryView, this.insertToCategoryViewEventId)), void 0 !== this.detailChangedEventId && (this.detailChangedEventId = void 0, u.detachTaskEvent(a.DownloadKernel.TaskEventType.DetailChanged, this.detailChangedEventId)), void 0 !== this.taskStatusChangedEventId && (this.taskStatusChangedEventId = void 0, u.detachTaskEvent(a.DownloadKernel.TaskEventType.StatusChanged, this.taskStatusChangedEventId)), void 0 !== this.userLoginEventId && (l.NativeCallModule.nativeCall.DetachNativeEvent("OnUserLogin", this.userLoginEventId), this.userLoginEventId = void 0), void 0 !== this.userLogoutEventId && (l.NativeCallModule.nativeCall.DetachNativeEvent("OnUserLogout", this.userLogoutEventId), this.userLogoutEventId = void 0), this.taskInfoMap.clear()
            }

            getTaskNameByTaskUniqueID(e) {
                if (!e || "" === e) return "";
                let t = this.taskInfoMap.get(e);
                if (t) {
                    if (-1 === t.categoryId) return t.taskName;
                    {
                        let e = c.getCurrentPrivateCategory();
                        if (e && e.getId() === t.categoryId) return t.taskName
                    }
                }
                return ""
            }

            getTaskAverageSpeedByTaskUniqueID(e) {
                if (!e || "" === e) return 0;
                let t = 0, i = this.taskInfoMap.get(e);
                if (i) if (-1 === i.categoryId) t = this.getTaskAverageSpeed(i.taskId); else {
                    let e = c.getCurrentPrivateCategory();
                    e && e.getId() === i.categoryId && (t = this.getTaskAverageSpeed(i.taskId))
                }
                return t
            }

            getTaskInfoByTaskUniqueID(e) {
                return e && "" !== e ? this.taskInfoMap.get(e) : null
            }

            onUserLogin(e) {
                h.information("onUserLogin userId:", e);
                let t = c.getPrivateCategoryFromUserId(e);
                if (t) {
                    let e = t.getCategoryViews();
                    for (let t = 0; t < e.length; ++t) {
                        let i = [];
                        e[t].getTasks().forEach(e => {
                            i.push(e)
                        }), this.updateTaskInfo(i)
                    }
                }
            }

            onUserLogout() {
                h.information("onUserLogout");
                let e = new Map;
                this.taskInfoMap.forEach((t, i) => {
                    -1 !== t.categoryId && e.set(i, t)
                }), e.forEach((e, t) => {
                    -1 !== e.categoryId && this.taskInfoMap.delete(t)
                })
            }

            onInsertToCategoryView(e, t, i) {
                do {
                    if (!i) break;
                    h.information("onInsertToCategoryView number of taskList:", i.length), this.updateTaskInfo(i)
                } while (0)
            }

            onDetailChanged(e, t) {
                do {
                    if (!e || !t) break;
                    h.information("onDetailChanged number of taskList:", e.length, ", detailChangedFlags:", t);
                    for (let i = 0; i < e.length; ++i) {
                        let n = e[i];
                        n && ((t & a.DownloadKernel.TaskDetailChangedFlags.TaskName || t & a.DownloadKernel.TaskDetailChangedFlags.Gcid) && this.updateTaskInfo([n]))
                    }
                } while (0)
            }

            onTaskStatusChanged(e) {
                for (let t = 0; t < e.length; ++t) {
                    let i = e[t];
                    if (i && i.getTaskStatus() === a.DownloadKernel.TaskStatus.DestroyPending) {
                        let e = this.getTaskUniqueIDByTask(i);
                        e && "" !== e && (h.information("onTaskStatusChanged delete taskInfoMap uniqueId:", e), this.taskInfoMap.delete(e))
                    }
                }
            }

            updateTaskInfo(e) {
                let t = c.getCurrentPrivateCategory();
                for (let i = 0; i < e.length; ++i) {
                    let n = e[i];
                    if (!n) continue;
                    let o = n.getTaskAttribute(a.DownloadKernel.TaskAttribute.CategoryId);
                    if (-1 !== o && (!t || t.getId() !== o)) continue;
                    let r = this.getTaskUniqueIDByTask(n);
                    if (r && "" !== r) {
                        let e = this.getTaskNameByTask(n), t = n.getTaskBaseInfo().taskId,
                            i = n.getTaskAttribute(a.DownloadKernel.TaskAttribute.CategoryViewId);
                        h.information("updateTaskInfo uniqueId:", r, ", taskId:", t, ", taskName:", e, ", categoryId:", o, ", categoryViewId:", i);
                        let s = {taskId: t, taskName: e, categoryId: o, categoryViewId: i};
                        this.taskInfoMap.set(r, s)
                    }
                }
            }

            getTaskAverageSpeed(e) {
                let t = d.getTaskFromTaskId(e);
                if (!t) return 0;
                let i = t.getTaskAttribute(a.DownloadKernel.TaskAttribute.DownloadingPeriod),
                    n = t.getTaskAttribute(a.DownloadKernel.TaskAttribute.DownloadSize);
                0 === i && (i = 0);
                let o = Math.round(n / i);
                return h.information("getTaskAverageSpeed taskId:", e, ", taskAverageSpeed:", o, ", taskAverageSpeedFormat:", this.formatSize(o)), o
            }

            formatSize(e, t = 2) {
                if (!e || e < 0) return "0.0B";
                let i = 0, n = e;
                for (; n > 1024 && !(i >= 5);) n /= 1024, i += 1;
                let a = Math.pow(10, t);
                return Math.round(n * a) / a + ["B", "KB", "MB", "GB", "TB", "PB"][i]
            }

            getTaskNameByTask(e) {
                let t = e.getTaskName();
                if (!t || "" === t) {
                    if (e.getTaskBaseInfo().taskType === a.DownloadKernel.TaskType.Bt) {
                        t = e.getExtraObject().getDisplayName()
                    }
                }
                return t
            }

            getTaskUniqueIDByTask(e) {
                let t = "";
                if (!e) return t;
                switch (e.getType()) {
                    case a.DownloadKernel.TaskType.Bt:
                        let i = e.getExtraObject().getInfoId();
                        h.information("getTaskUniqueIDByTask bt task infoId:", i), t = i;
                        break;
                    case a.DownloadKernel.TaskType.P2sp:
                    case a.DownloadKernel.TaskType.Emule:
                        let n = e.getTaskAttribute(a.DownloadKernel.TaskAttribute.Gcid);
                        h.information("getTaskUniqueIDByTask p2sp or emule task gcid: ", n), t = n
                }
                return t
            }
        }

        e.TaskManager = t;
        const i = new t;
        e.getTaskManager = function () {
            return i
        }
    }(t.CommunityTaskManagerNS || (t.CommunityTaskManagerNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(7);
    t.postDownloadData = function (e) {
        return n(this, void 0, void 0, function* () {
            let t = null;
            return t = yield a.client.callRemoteClientFunction("User", "Request", "/fn/dlstatisc/1zb3oxs", {
                method: "POST",
                body: e,
                withCredentials: !0
            })
        })
    }, t.getDownloadData = function (e) {
        return n(this, void 0, void 0, function* () {
            let t = null;
            return t = yield a.client.callRemoteClientFunction("User", "Request", "/fn/dlstatisc/1zb3oxs", {
                method: "GET",
                body: e,
                withCredentials: !0
            })
        })
    }
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(3), o = i(42), r = i(11), s = i(0), l = i(430), d = i(2), u = i(5), c = i(58),
        h = i(15).DownloadKernelEventManager.getEventManager(), f = r.DownloadKernelTaskManager.getTaskManager(),
        g = s.default.getLogger("Preview-Data");
    t.videoPreviewData = new class {
        constructor() {
            this.previewDataMap = new Map, this.netRequestMap = new Map, this.previewCachePath = `${__profilesDir}/videoPreview/cache.json`, this.isSavingData = !1
        }

        init() {
            h.attachTaskEvent(a.DownloadKernel.TaskEventType.InsertToCategoryView, (e, t, i, n) => {
                if (e === a.DownloadKernel.TaskEventType.InsertToCategoryView && i === a.DownloadKernel.CategroyViewID.Recycle) if (n instanceof Array) for (let e = 0; e < n.length; e++) this.deleteTaskCache(n[e].getId()).catch(); else g.error("传递数据错误")
            })
        }

        queryResInfo(e, t) {
            return n(this, void 0, void 0, function* () {
                let i, n = "", r = "", s = void 0, d = f.getTaskFromTaskId(e);
                if (d) {
                    if (0 === d.getVideoFileCount()) return;
                    let e = d.getType();
                    if (e === a.DownloadKernel.TaskType.P2sp || e === a.DownloadKernel.TaskType.Magnet) n = "url", r = d.getTaskAttribute(a.DownloadKernel.TaskAttribute.TaskUrl); else if (e === a.DownloadKernel.TaskType.Emule) n = "emule", r = d.getTaskAttribute(a.DownloadKernel.TaskAttribute.TaskUrl); else if (e === a.DownloadKernel.TaskType.Bt) {
                        n = "bt";
                        let e = d.getExtraObject(), t = e.getBtFileList();
                        for (let [e, i]of t) if (i.isSupportPlay()) {
                            s = e;
                            break
                        }
                        r = e.getInfoId()
                    }
                }
                return o.Common.isThunderPrivateUrl(r) && (r = o.Common.parseThunderPrivateUrl(r)), (i = yield l.getVideoPreviewInfo(n, r, s, t)) && i.data && !i.error ? i && 200 === i.status && (this.netRequestMap.get(e) ? g.information("本地已有文件记载") : (this.setPreviewData(e, i), this.saveLocalData().catch())) : this.netRequestMap.set(e, !1), g.information("getVideoPreviewInfo 网络获取  index=", s, " type=", n, " res=", i, " resInfo=", r), i
            })
        }

        getRealPath(e) {
            let t = e.indexOf("file:///");
            if (-1 === t) return e;
            let i = t + "file:///".length;
            return i > e.length - 1 ? e : e.substring(i)
        }

        getVideoPreview(e, t) {
            return n(this, void 0, void 0, function* () {
                if (!e) return;
                let i, n = yield this.queryResInfo(e, t);
                n && (i = n.data), yield this.getLocalData();
                let a = this.getPreviewData(e);
                if (a) {
                    g.information("使用本地");
                    let e = a.data;
                    return e && i && (e.total_time = i.total_time, g.information("[Test] 更新时间 total_time=", i.total_time)), a
                }
                return g.information("使用网络"), n
            })
        }

        isPreviewShow(e) {
            return n(this, void 0, void 0, function* () {
                let t = yield this.getVideoPreview(e);
                if (!t) return !1;
                let i = {};
                try {
                    "object" == typeof t.data ? i = t.data : "string" == typeof t.data && (i = JSON.parse(t.data))
                } catch (e) {
                    return !1
                }
                return !!i && !!i.pictures && 0 === i.code && i.pictures instanceof Array && i.pictures.length > 0
            })
        }

        setPreviewData(e, t) {
            g.information("taskid:", e), this.previewDataMap.set(e, t)
        }

        getPreviewData(e) {
            return this.previewDataMap.get(e)
        }

        deleteTaskCache(e) {
            return n(this, void 0, void 0, function* () {
                if (!e) return void g.error("错误taskid");
                let t = `${__profilesDir}/videoPreview/${e}`;
                (yield u.FileSystemAWNS.existsAW(t)) ? (u.FileSystemAWNS.rmdirsAW(t).catch(), g.information("删除任务, taskId=", e), this.previewDataMap.delete(e), this.saveLocalData().catch()) : g.information("当前任务无缓存目录, taskId=", e)
            })
        }

        objectDeepClone(e, t) {
            if ("object" == typeof t) {
                e || (e = {});
                for (const i in t) t.hasOwnProperty(i) && (t[i] instanceof Array ? (e[i] || (e[i] = []), t[i].forEach(t => {
                    e[i].push(t)
                })) : t[i] instanceof Object ? (e[i] || (e[i] = {}), this.objectDeepClone(e[i], t[i])) : e[i] = t[i])
            }
        }

        getTimePercent(e) {
            if (e) {
                let t = new RegExp(/.*_([0-9]+)\.[a-zA-Z0-9]{1,4}?.*/), i = e.match(t);
                return i && i[1] ? parseFloat(i[1]) : void 0
            }
        }

        saveLocalData() {
            return n(this, void 0, void 0, function* () {
                g.information("saveLocalData enter"), this.isSavingData = !0;
                let e = new Map, t = `${__profilesDir}/videoPreview/`;
                (yield u.FileSystemAWNS.existsAW(t)) || (yield u.FileSystemAWNS.mkdirAW(t));
                let i, n = "";
                for (let a of this.previewDataMap.keys()) {
                    let o = {};
                    if (i = this.previewDataMap.get(a), g.information("get key=", a, " value=", i), !i) continue;
                    if (this.objectDeepClone(o, i.data), !o) continue;
                    if (!o.pictures) continue;
                    if ("object" != typeof o.pictures) continue;
                    if (o.pictures.length < 1) continue;
                    let r = {
                        "User-Agent": navigator.userAgent,
                        "Content-Type": "",
                        Accept: "image/jpeg",
                        "Accept-Encoding": "gzip, deflate",
                        "Accept-Language": "zh-CN,zh;q=0.9",
                        "Cache-Control": "no-cache",
                        Pragma: "no-cache",
                        Connection: "keep-alive"
                    }, s = "", l = ".png", h = [".jpg", ".jpeg", ".png", ".bmp", ".gif"], f = "", p = !1, v = 0;
                    n = t + a + "/";
                    let m = 0;
                    (yield u.FileSystemAWNS.existsAW(n)) || (yield u.FileSystemAWNS.mkdirAW(n));
                    let y = 0;
                    for (let e = 0; e < o.pictures.length; e++) o.pictures[e].startsWith("file:///") ? y++ : ((v = o.pictures[e].indexOf("?")) >= 0 && (f = d.extname(o.pictures[e].substring(0, v))), -1 !== h.indexOf(f) && (l = f), void 0 === (m = this.getTimePercent(o.pictures[e])) && (m = e), s = n + a + "_" + m + l, p = yield c.AxiosNS.downloadFileAW(o.pictures[e], s, r), g.information("下载文件,url=", o.pictures[e], " filePath=", s, " 结果,ret=", p), p && (o.pictures[e] = "file:///" + s, y++));
                    this.netRequestMap.set(a, 6 === y), g.information("saveMap key=", a, " data=", o), e.set(a, {
                        data: o,
                        status: i.status
                    }), o = void 0
                }
                if (g.information("saveMap size=", e.size), e.size > 0) {
                    let t = this.mapToJson(e);
                    yield u.FileSystemAWNS.writeFileAW(this.previewCachePath, t)
                }
                e.clear(), this.isSavingData = !1, g.information("saveLocalData leave")
            })
        }

        stringifyEx(e) {
            let t = [], i = JSON.stringify(e, (e, i) => {
                if ("object" == typeof i && null !== i) {
                    if (-1 !== t.indexOf(i)) return null;
                    t.push(i)
                }
                return i
            });
            return t = [], i
        }

        getLocalData() {
            return n(this, void 0, void 0, function* () {
                if (this.isSavingData) return void g.warning("正在保存数据...");
                let e, t = yield u.FileSystemAWNS.readFileAW(this.previewCachePath);
                if (t) {
                    try {
                        e = this.jsonToMap(t.toString())
                    } catch (e) {
                        g.error("获取本地缓存失败, error=", e)
                    }
                    e ? (g.information("得到缓存,map=", e), this.previewDataMap = e) : g.warning("没有缓存,map=", e)
                } else g.information("读文件失败, buf=", t, " path=", this.previewCachePath)
            })
        }

        mapToObject(e) {
            let t = Object.create(null);
            for (let [i, n]of e) 0 !== i && (t[i] = n);
            return t
        }

        mapToJson(e) {
            let t = "";
            try {
                t = JSON.stringify(this.mapToObject(e))
            } catch (e) {
                g.error("mapToJson error")
            }
            return t
        }

        objectToMap(e) {
            let t = new Map;
            for (let i of Object.keys(e)) t.set(parseInt(i, 10), e[i]);
            return t
        }

        jsonToMap(e) {
            return this.objectToMap(JSON.parse(e))
        }
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(17), a = i(9), o = i(72), r = i(35), s = i(3), l = i(46), d = i(49),
        u = d.ToastNotifyManagerNS.getToastNotifyManger(), c = 18e4;
    const h = new class {
        constructor() {
            this.currentWords = "", this.toastTimerId = void 0
        }

        getContentType(e) {
            let t = void 0;
            return r.ThunderHelper.getTaskTypeFromUrl(e) === s.DownloadKernel.TaskType.Unkown ? o.URLHelperNS.isBirdKey(e) && (t = "bird") : t = "link", t
        }

        addListener(e, t) {
            do {
                if (void 0 === e && (e = n.clipboard.readText()), !e) break;
                if (e === this.currentWords) break;
                if (void 0 === t && (t = this.getContentType(e)), void 0 === t) break;
                this.toastTimerId && (clearTimeout(this.toastTimerId), this.toastTimerId = void 0), this.currentWords = e, this.toastTimerId = setTimeout(() => {
                    clearTimeout(this.toastTimerId), this.toastTimerId = void 0;
                    let e = n.clipboard.readText();
                    e === this.currentWords && (a.XLStatNS.trackEvent("download_leftpanel", "shear_plate_toast_show", "", 0, 0, 0, 0, `content=${encodeURIComponent(e)}`), u.showNotify(d.ToastNotifyManagerNS.notifyIdTaskOperatorCopyLink, l.ToastNotifyItemType.GreenNotify, "bird" === t ? "剪贴板有一个口令哦，去粘贴～" : "剪贴板有一个链接哦，去粘贴～", 3e3))
                }, c)
            } while (0)
        }
    };
    !function (e) {
        e.addListener = function (e, t) {
            h.addListener(e, t)
        }
    }(t.ShareToastListenerNS || (t.ShareToastListenerNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(12), o = i(2), r = i(4), s = i(0), l = i(7), d = i(20), u = i(64), c = i(542), h = i(9), f = i(14),
        g = i(72), p = i(425), v = i(322), m = i(83), y = i(307), k = i(35), T = i(6), w = i(3), C = i(5), S = i(130),
        b = i(10), I = i(13), _ = i(34), A = i(69), D = i(428), x = i(416), N = i(95), E = i(23), P = i(316), M = i(36),
        O = i(126), F = i(90), L = i(38), B = i(27), U = i(60), R = i(314), K = i(29), W = i(11), V = i(124), H = i(26),
        z = i(306), j = i(32), G = i(110), $ = i(80), X = i(22), q = i(543), Y = i(111), J = i(319), Z = i(427),
        Q = i(71), ee = i(54), te = s.default.getLogger("plugin-function"),
        ie = R.TaskInfoManagerNS.getTaskInfoManager(), ne = T.default(o.join(__rootDir, "../bin/ThunderHelper.node")),
        ae = W.DownloadKernelTaskManager.getTaskManager(), oe = K.DownloadKernelCategoryManager.getCategoryManager(),
        re = q.fileMediaInfoOssMangerNS.getfileMediaInfoOssManger();
    !function (e) {
        const t = new class {
            constructor() {
                this.isRegister = !1, this.isPersonalPageTrackEvent = !1, this.clientWebExternalMap = {}, this.panRationInfo = {
                    fileId: "",
                    infos: []
                }
            }

            registerPluginFunction() {
                if (!this.isRegister) {
                    this.isRegister = !0;
                    let e = {
                        GetTaskInfo: this.getTaskInfo,
                        OperateTask: this.operateTask,
                        ShellOpen: this.shellOpen,
                        OpenFolderWithSelectFile: this.openFolderWithSelectFile,
                        ShowOpenDialog: this.showOpenDialog,
                        ShowSaveDialog: this.showSaveDialog,
                        GetFileMd5: this.getFileMd5,
                        GetPeerID: this.getPeerID,
                        GetDeviceID: this.getDeviceID,
                        GetCpuID: this.getCpuID,
                        GetDmideCode: this.getDmideCode,
                        GetThunderVersion: this.getThunderVersion,
                        TrackEvent: this.trackEvent,
                        GetCurrentCategoryId: this.getCurrentCategoryId,
                        GetCurrentTabId: this.getCurrentTabId,
                        SelectCategoryView: this.switchCategoryView,
                        GetCurInternetState: this.getCurInternetState,
                        DropOpenFile: this.dragOpenFile,
                        DropOpenUrl: this.dragOpenUrl,
                        GetCurPlatform: this.getCurPlatform,
                        CreateNewTask: this.createNewTask,
                        CreateNewTaskEx: this.createNewTaskEx,
                        AddUrls2Cloud: this.addUrls2Cloud,
                        AddBt2Cloud: this.addBt2Cloud,
                        FireEventFunction: this.fireEventFunction,
                        ShowCustomDownloadModeDlg: this.showCustomDownloadModeDlg,
                        GetTaskStartStatusPrompt: this.getTaskStartStatusPrompt,
                        ShowBrowserGuideDlg: this.showBrowserGuideDlg,
                        OpenURLByIEorDefault: this.openURLByIEorDefault,
                        OpenURLByDefault: this.openURLByDefault,
                        GetDownloadDir: this.getDownloadDir,
                        GetProfilesDir: this.getProfilesDir,
                        ShowPersonalPage: this.showPersonalPage.bind(this),
                        ShowWebWnd: this.showWebWnd,
                        CreateWebWnd: this.createWebWnd,
                        CreateWebWndEx: this.createWebWndEx,
                        CloseWebWnd: this.closeWebWnd,
                        ExistWebWnd: this.existWebWnd,
                        VisibleWebWnd: this.visibleWebWnd,
                        BringWebWndToTop: this.bringWebWndToTop,
                        EnableSignAutoShow: this.enableSignAutoShow,
                        RegisterWebFunction: this.registerWebFunction,
                        RegisterWebExternal: this.registerWebExternal.bind(this),
                        CallBackWebFunction: this.callBackWebFunction,
                        FireEventWebFunction: this.fireEventWebFunction,
                        IsPhoneAuth: this.isPhoneAuth,
                        GetSearchRecommends: this.getSearchRecommends,
                        SetSearchRecommends: this.setSearchRecommends,
                        GetBaiduDWZ: this.getBaiduDWZ,
                        GetShouleiShareLink: this.getShouleiShareLink,
                        GetShouleiShareLinkDlj: this.getShouleiShareLinkDlj,
                        GetShouleiShareLink2: this.getShouleiShareLink2,
                        GetShouleiShareLinkDlj2: this.getShouleiShareLinkDlj2,
                        GetShouleiFileTransferLink: this.getShouleiFileTransferLink,
                        GetShouleiFileTransferDlj: this.getShouleiFileTransferDlj,
                        GetShouleiFileTransferLink2: this.getShouleiFileTransferLink2,
                        GetShouleiFileTransferDlj2: this.getShouleiFileTransferDlj2,
                        Log: this.log,
                        IsDevToolsEnable: this.isDevToolsEnable,
                        IsMainWndVisible: this.isMainWndVisible,
                        IsInFullScreen: this.isInFullScreen,
                        SwitchDetail: this.switchDetail,
                        Utf8StringEncodeToBinary: this.utf8StringEncodeToBinary,
                        Utf8StringDecodeFromBinary: this.utf8StringDecodeFromBinary,
                        GetErrorCodeConfigMessage: this.getErrorCodeConfigMessage,
                        GetErrorCodeConfigData: this.getErrorCodeConfigData,
                        GetMainWndHandle: this.getMainWndHandle,
                        GetPluginStatus: this.getPluginStatus,
                        SetPluginStatus: this.setPluginStatus,
                        PopPluginGroups: this.popPluginGroups,
                        GetInitUserLoginParam: this.getInitUserLoginParam,
                        BringMainWndToTop: this.bringMainWndToTop,
                        MessageBoxPop: this.messageBoxPop,
                        MessageBoxConfirm: this.messageBoxConfirm,
                        MessageBoxCustom: this.messageBoxCustom,
                        FlashFrame: this.flashFrame,
                        SetTrayImage: this.setTrayImage,
                        FlashTray: this.flashTray,
                        GetMainWindowStates: this.getMainWindowStates,
                        ShowAniCover: this.showAniCover,
                        CloseAniCover: this.closeAniCover,
                        ClosePopMutual: this.closePopMutual,
                        PopFileSelect: this.popFileSelect,
                        PopFilesSelect: this.popFilesSelect,
                        GetMediaInfo: this.getMediaInfo,
                        CaclGcid: this.caclGcid,
                        CaclCid: this.caclCid,
                        CaclBCid: this.caclBCid,
                        GetUploadProg: this.getUploadProg,
                        UploadFileToOss: this.uploadFileToOss,
                        CancelUpload: this.cancelUpload,
                        PopFileSelectAndGetInfo: this.popFileSelectAndGetInfo,
                        PopFilesSelectAndGetInfo: this.popFilesSelectAndGetInfo,
                        ResumeUpload: this.resumeUpload,
                        PostUpload: this.postUpload,
                        PlayFileByXmp: this.playFileByXmp.bind(this),
                        PauseUpload: this.pauseUpload,
                        CreateDownloadAndPlayTask: this.createDownloadAndPlayTask,
                        CreateBtTaskWindow: this.createBtTaskWindow,
                        GetCommonlySites: this.getCommonlySites,
                        ClearCommonlySites: this.clearCommonlySites,
                        PlayBtOrGroupTask: this.playBtOrGroupTask,
                        NotifyXmpQuit: this.notifyXmpQuit,
                        GetPanRationInfos: this.getPanRationInfos.bind(this),
                        UpdatePanDivRect: this.updatePanDivRect.bind(this),
                        UpdatePanMiniRect: this.updatePanMiniRect.bind(this),
                        UpdatePosition: this.updatePosition.bind(this),
                        BackUpEmbed: this.backUpEmbed.bind(this)
                    };
                    d.server.registerFunctions(e), d.server.on("end", e => {
                        let t = [];
                        for (let i in this.clientWebExternalMap) this.clientWebExternalMap[i] === e && (delete this.clientWebExternalMap[i], t.push(i));
                        t.length > 0 && (te.information("client end to remove native function", ...t), j.NativeCallNS.unregisterNativeFunction(t))
                    })
                }
            }

            getTaskInfo(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = void 0;
                    do {
                        if (!e) break;
                        if (!i || !i[0] || !i[2]) break;
                        let n = i[0];
                        if ("taskDetail" !== i[2]) break;
                        t = yield ie.getHistoryTaskInfoString(n)
                    } while (0);
                    return t
                })
            }

            operateTask(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = !0;
                    do {
                        if (!e) break;
                        if (!i || !i[0] || !i[1]) {
                            t = !1;
                            break
                        }
                        let n = i[0], a = i[1], o = i[2];
                        yield P.TaskOperate.operateTaskActions(n, a, o)
                    } while (0);
                    return t
                })
            }

            playBtOrGroupTask(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (!e) break;
                        if (!i || !i[0]) break;
                        let t = i[0];
                        d.server.fireClientEvent("PlayBtOrGroupTask", t)
                    } while (0)
                })
            }

            notifyXmpQuit(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    Z.DownloadAndPlayNodeIPCNS.nofityXMP("OnNotifyQuit").catch()
                })
            }

            shellOpen(e, t, ...i) {
                let n = !0;
                do {
                    if (!e) break;
                    if (!i || !i[0]) {
                        n = !1;
                        break
                    }
                    let t = i[0];
                    M.TaskOperatorNs.asyncOpenItem(t).catch()
                } while (0);
                return n
            }

            openFolderWithSelectFile(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = !0;
                    do {
                        if (!e) break;
                        if (!i || !i[0]) {
                            t = !1;
                            break
                        }
                        let n = i[0];
                        t = yield(yield a.asyncRemoteCall.getShell()).showItemInFolder(n)
                    } while (0);
                    return t
                })
            }

            showOpenDialog(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    return new Promise(t => n(this, void 0, void 0, function* () {
                        do {
                            if (!e) {
                                t(void 0);
                                break
                            }
                            const n = yield a.asyncRemoteCall.getDialog();
                            let o = i[0];
                            o || (o = {properties: ["openDirectory"]});
                            let r = yield a.asyncRemoteCall.getCurrentWindow();
                            n.showOpenDialog(r, o, e => {
                                t(e)
                            })
                        } while (0)
                    }))
                })
            }

            showSaveDialog(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    return new Promise(t => n(this, void 0, void 0, function* () {
                        do {
                            if (!e) {
                                t(void 0);
                                break
                            }
                            const n = yield a.asyncRemoteCall.getDialog();
                            let o = i[0], r = yield a.asyncRemoteCall.getCurrentWindow();
                            n.showSaveDialog(r, o, e => {
                                t(e)
                            })
                        } while (0)
                    }))
                })
            }

            getFileMd5(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = "";
                    do {
                        if (!e) break;
                        if (!i || !i[0]) break;
                        let n = i[0];
                        t = yield _.ToolsUtilitiesAWNS.calculateFileMd5(n)
                    } while (0);
                    return t
                })
            }

            getPeerID(e, t, ...i) {
                return ne.getPeerID()
            }

            getDeviceID(e, t, ...i) {
                return ne.getPeerID()
            }

            getCpuID(e, t, ...i) {
                return ne.getCpuID()
            }

            getDmideCode(e, t, ...i) {
                return ne.getDmideCode()
            }

            getThunderVersion(e, t, ...i) {
                let n = o.join(__rootDir, "../../Thunder.exe");
                return ne.getFileVersion(n)
            }

            trackEvent(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = void 0;
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        if (!i || !i[0]) break;
                        let n = i[0], a = void 0 === i[1] ? "" : i[1], o = void 0 === i[2] ? "" : i[2],
                            s = void 0 === i[3] ? 0 : i[3], l = void 0 === i[4] ? 0 : i[4],
                            d = void 0 === i[5] ? 0 : i[5], u = void 0 === i[6] ? 0 : i[6],
                            c = void 0 === i[7] ? "" : i[7], f = void 0 === i[8] ? 0 : i[8];
                        t = yield h.XLStatNS.asyncTrackEvent(n, a, o, s, l, d, u, c, f)
                    } while (0);
                    return t
                })
            }

            getCurrentCategoryId(e, t, ...i) {
                let n = void 0;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    n = B.default.getCurrentCategoryId()
                } while (0);
                return n
            }

            getCurrentTabId(e, t, ...i) {
                let n = void 0;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    n = $.getCurrentTabID()
                } while (0);
                return n
            }

            switchCategoryView(e, t, ...i) {
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (r.isNullOrUndefined(i) || r.isNullOrUndefined(i[0]) || r.isNullOrUndefined(i[1])) break;
                    let t = i[0], n = i[1], a = void 0;
                    if (void 0 !== i[2]) {
                        a = i[2];
                        let e = !1, t = ae.getTaskFromTaskId(a);
                        if (t) {
                            const i = t.getTaskAttribute(w.DownloadKernel.TaskAttribute.CategoryId);
                            let n = oe.getCategoryFromId(i);
                            if (n && n.getName() === K.CategoryManager.panCategoryName && (e = !0), e) break
                        }
                    }
                    let o = i[3];
                    te.information(t, n, a), B.default.fireEvent(I.NodeEventMesssageNS.eventDownloadSwitchCategory, t, n, a, o)
                } while (0)
            }

            getCurInternetState(e, t, ...i) {
                let n = void 0;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    n = ne.getCurInternetState()
                } while (0);
                return n
            }

            dragOpenFile(e, t, ...i) {
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (r.isNullOrUndefined(i) || r.isNullOrUndefined(i[0])) break;
                    let t = i[0];
                    if (void 0 === t || null === t || "" === t) break;
                    let n = i[1];
                    S.default.onCommand("path", t, n || "file_drag").catch()
                } while (0)
            }

            dragOpenUrl(e, t, ...i) {
                do {
                    if (void 0 === e || null === e) break;
                    let t = i[0];
                    if (void 0 === t || null === t || "" === t) break;
                    let n = i[1], a = k.ThunderHelper.getTaskTypeFromUrl(t);
                    a === w.DownloadKernel.TaskType.P2sp || a === w.DownloadKernel.TaskType.Emule ? L.ThunderNewTask.createPreNewTaskWindow([t], n || "url_drag") : a !== w.DownloadKernel.TaskType.Bt && a !== w.DownloadKernel.TaskType.Magnet || L.ThunderNewTask.createBtTaskWindow({
                        url: t,
                        type: "url"
                    }, {source: n || "url_drag"})
                } while (0)
            }

            getCurPlatform(e, t, ...i) {
                let n = void 0;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    n = "pc-xdas"
                } while (0);
                return n
            }

            createNewTask(e, t, ...i) {
                do {
                    if (r.isNullOrUndefined(e)) break;
                    let t = i[0], n = null;
                    try {
                        n = JSON.parse(t)
                    } catch (e) {
                        te.warning(e)
                    }
                    if (te.information("createNewTask", n), r.isNullOrUndefined(n)) break;
                    for (let e in n) {
                        let t = n[e];
                        if ("com" === t.type) {
                            let e = void 0;
                            for (let t in n) {
                                void 0 === e && (e = []), te.information("createNewTask url", n[t].url);
                                let i = n[t].url.split("%0A");
                                if (1 === i.length && (i = n[t].url.split(/[\n\r\n]/)), te.information("createNewTask urls", i), 1 === i.length) e.push({
                                    url: n[t].url,
                                    referer: n[t].refer,
                                    fileName: n[t].name,
                                    nameFixedFlag: n[t].name ? x.ThunderNewtaskHelperNS.taskOptFileNameFixed : void 0,
                                    statClick: n[t].stat ? n[t].stat : "outline",
                                    browser: n[t].browser ? n[t].browser : "xlbrowser.exe",
                                    fileSize: n[t].fileSize ? n[t].fileSize : 0
                                }); else for (let a of i) e.push({
                                    url: a,
                                    referer: n[t].refer,
                                    statClick: n[t].stat ? n[t].stat : "outline",
                                    browser: n[t].browser ? n[t].browser : "xlbrowser.exe"
                                })
                            }
                            L.ThunderNewTask.createPreNewTaskWindow(e);
                            break
                        }
                        if ("bt" === t.type) {
                            let e = t.url;
                            L.ThunderNewTask.createBtTaskWindow({
                                url: e,
                                type: "url"
                            }, {
                                source: t.stat ? t.stat : "outline",
                                browser: t.browser ? t.browser : "xlbrowser.exe",
                                referer: t.refer
                            });
                            break
                        }
                        "bird" === t.type && g.URLHelperNS.isBirdKey(t.url) && A.openBirdKeyDecodeDialog(t.url, {from: t.stat || "outline"})
                    }
                } while (0)
            }

            createNewTaskEx(e, t, ...i) {
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (r.isNullOrUndefined(i) || r.isNullOrUndefined(i[0])) break;
                    let t = i[0], n = [];
                    for (let e in t) {
                        let i = t[e];
                        if (g.URLHelperNS.isBirdKey(i.url)) {
                            A.openBirdKeyDecodeDialog(i.url, {from: i.stat});
                            continue
                        }
                        let a = k.ThunderHelper.getTaskTypeFromUrl(i.url);
                        if (te.information("createNewTaskEx", i.url, "type:", a), a === w.DownloadKernel.TaskType.P2sp || a === w.DownloadKernel.TaskType.Emule) n.push({
                            url: t[e].url,
                            referer: t[e].refer,
                            fileName: t[e].name,
                            statClick: t[e].stat
                        }); else if (a === w.DownloadKernel.TaskType.Bt || a === w.DownloadKernel.TaskType.Magnet) {
                            let e = i.url;
                            L.ThunderNewTask.createBtTaskWindow({url: e, type: "url"}, {
                                source: i.stat,
                                referer: i.refer
                            })
                        } else i.url.includes("taskGroupName") && L.ThunderNewTask.createThunderxTask(i.url, i.stat).catch()
                    }
                    n.length > 0 && L.ThunderNewTask.createPreNewTaskWindow(n)
                } while (0)
            }

            addUrls2Cloud(e, t, ...i) {
                L.ThunderNewTask.addUrls2Cloud(i[0], i[1], i[2], i[3]).catch()
            }

            addBt2Cloud(e, t, ...i) {
                L.ThunderNewTask.addBt2Cloud(i[0], i[1], i[2]).catch()
            }

            showCustomDownloadModeDlg(e, t, ...i) {
                do {
                    if (r.isNullOrUndefined(e)) break;
                    N.DownloadModeNS.showCustomDownloadModeDlg().catch()
                } while (0)
            }

            getTaskStartStatusPrompt(e, t, ...i) {
                let n = "";
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (r.isNullOrUndefined(i) || r.isNullOrUndefined(i[0])) break;
                    let t = null;
                    try {
                        t = JSON.parse(i[0])
                    } catch (e) {
                    }
                    t && (n = U.TaskStatusHelper.getTaskStartStatusPrompt(t)), N.DownloadModeNS.showCustomDownloadModeDlg().catch()
                } while (0);
                return n
            }

            showBrowserGuideDlg(e, t, ...i) {
                do {
                    if (r.isNullOrUndefined(e)) break;
                    F.default().popUpBrowserGuide(!0).catch()
                } while (0)
            }

            openURLByIEorDefault(e, t, ...i) {
                let n = void 0;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (r.isNullOrUndefined(i) || r.isNullOrUndefined(i[0])) break;
                    n = ne.openURLByIEorDefault(i[0])
                } while (0);
                return n
            }

            openURLByDefault(e, t, ...i) {
                let n = void 0;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (r.isNullOrUndefined(i) || r.isNullOrUndefined(i[0])) break;
                    n = ne.openURLByDefault(i[0])
                } while (0);
                return n
            }

            getDownloadDir(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = "";
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        do {
                            if (b.ConfigNS.getValue("TaskDefaultSettings", "UseLastCatalog", !0) && (t = b.ConfigNS.getValue("PathAndCategory", "LastUsedPath", "")) || (t = b.ConfigNS.getValue("TaskDefaultSettings", "DefaultPath", "")), void 0 !== t && null !== t && "" !== t && (yield C.FileSystemAWNS.mkdirsAW(t))) break;
                            t = f.ThunderUtil.getDefaultDownloadDir()
                        } while (0)
                    } while (0);
                    return t
                })
            }

            getProfilesDir(e, t, ...i) {
                return __profilesDir
            }

            showPersonalPage(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = 0;
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        if (r.isNullOrUndefined(i) || r.isNullOrUndefined(i[0])) break;
                        let n = i[0];
                        if (!this.isPersonalPageTrackEvent) {
                            this.isPersonalPageTrackEvent = !0;
                            let e = b.ConfigNS.getValue("Install", "PersonalUid", "");
                            void 0 !== e && null !== e || (e = "");
                            let i = "uid=" + e + ",start_page=" + (n ? "Individualization_home_page" : "official_home_page");
                            t = yield h.XLStatNS.asyncTrackEvent("core_event", "startup_page", "", 0, 0, 0, 0, i)
                        }
                    } while (0);
                    return t
                })
            }

            showWebWnd(e, t, ...i) {
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (!i || !i[0]) break;
                    let t = i[0];
                    i.splice(0, 1), V.EmbeddedBrowserManagerNs.showWebWnd(t, ...i)
                } while (0)
            }

            createWebWnd(e, t, ...i) {
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (!i || !i[0]) break;
                    let t = i[0];
                    i.splice(0, 1), V.EmbeddedBrowserManagerNs.createWebWnd(t, ...i)
                } while (0)
            }

            createWebWndEx(e, t, ...i) {
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (!i || !i[0]) break;
                    let t = i[0];
                    if (!t || !t.business) break;
                    V.EmbeddedBrowserManagerNs.createWebWndEx(t)
                } while (0)
            }

            closeWebWnd(e, t, ...i) {
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (!i || !i[0]) break;
                    let t = i[0];
                    if ("" === t) break;
                    V.EmbeddedBrowserManagerNs.closeWebWnd(t)
                } while (0)
            }

            existWebWnd(e, t, ...i) {
                let n = !1;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (!i || !i[0]) break;
                    let t = i[0];
                    if ("" === t) break;
                    n = V.EmbeddedBrowserManagerNs.existWebWnd(t)
                } while (0);
                return n
            }

            visibleWebWnd(e, t, ...i) {
                let n = !1;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (!i || !i[0]) break;
                    let t = i[0];
                    if ("" === t) break;
                    n = V.EmbeddedBrowserManagerNs.visibleWebWnd(t, i[1])
                } while (0);
                return n
            }

            bringWebWndToTop(e, t, ...i) {
                let n = !1;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (!i || !i[0]) break;
                    let t = i[0];
                    n = V.EmbeddedBrowserManagerNs.bringWebWndToTop(t)
                } while (0);
                return n
            }

            enableSignAutoShow(e, t, ...i) {
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (!i) break;
                    let t = i[0];
                    V.EmbeddedBrowserManagerNs.enableSignAutoShow(t)
                } while (0)
            }

            registerWebFunction(e, t, ...i) {
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (!i || !i[0]) break;
                    let t = i[0], a = i[1], o = i[2];
                    if (!a) break;
                    if (!o) break;
                    V.EmbeddedBrowserManagerNs.registerWebFunction(t, a, (e, t, i, a) => n(this, void 0, void 0, function* () {
                        let n = yield o(...a);
                        e.callNativeFunctionCallback(t, i, E.NativeFunctionErrorCode.Success, n[0])
                    }))
                } while (0)
            }

            registerWebExternal(e, t, ...i) {
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (!i) break;
                    let t = i[0];
                    if (!t) break;
                    if ("object" != typeof t) break;
                    let a = [];
                    for (let i in t) {
                        if (!i) continue;
                        let o = t[i];
                        o && (j.NativeCallNS.checkNativeFunction(i) || (a.push({
                            functionName: i,
                            nativeFunc: (e, t, i, a) => n(this, void 0, void 0, function* () {
                                let n = yield o(...a);
                                e.callNativeFunctionCallback(t, i, E.NativeFunctionErrorCode.Success, n[0])
                            })
                        }), this.clientWebExternalMap[i] = e))
                    }
                    a.length > 0 && j.NativeCallNS.registerNativeFunction(a)
                } while (0)
            }

            fireEventFunction(e, t, ...i) {
                do {
                    if (!i || !i[0]) break;
                    H.NativeCallHostModule.nativeCallHost.fireNativeEvent("onWebEvent", ...i)
                } while (0)
            }

            callBackWebFunction(e, t, ...i) {
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (!i || !i[0]) break;
                    let t = i[0], n = i[1], a = i[2], o = i[3];
                    if (!t) break;
                    if (void 0 === n || null === n) break;
                    if (void 0 === a || null === a) break;
                    V.EmbeddedBrowserManagerNs.callBackWebFunction(t, n, a, o)
                } while (0)
            }

            fireEventWebFunction(e, t, ...i) {
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (!i || !i[0]) break;
                    let t = i[0];
                    i.splice(0, 1), V.EmbeddedBrowserManagerNs.fireEventWebFunction(t, ...i)
                } while (0)
            }

            isPhoneAuth(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = !1;
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        t = yield O.phoneAuthObject.isPhoneAuthAw()
                    } while (0);
                    return t
                })
            }

            getSearchRecommends(e, t, ...i) {
                let n = void 0;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    n = D.SearchConfigNS.getRecommends()
                } while (0);
                return n
            }

            setSearchRecommends(e, t, ...i) {
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (!i || !i[0]) break;
                    let t = i[0];
                    D.SearchConfigNS.setRecommends(t)
                } while (0)
            }

            getBaiduDWZ(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = void 0;
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        if (!i || !i[0]) break;
                        let n = i[0];
                        t = yield y.getBaiduDWZ(n)
                    } while (0);
                    return t
                })
            }

            getShouleiShareLink(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = void 0;
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        if (!i || !i[0]) break;
                        let n = i[0], a = "pic";
                        r.isString(i[1]) && (a = i[1]);
                        let o = "";
                        r.isString(i[2]) && (o = i[2]), t = yield G.getShouleiShareLink(n, a, o)
                    } while (0);
                    return t
                })
            }

            getShouleiShareLinkDlj(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = void 0;
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        if (!i || !i[0]) break;
                        let n = i[0], a = "pic";
                        r.isString(i[1]) && (a = i[1]);
                        let o = "";
                        r.isString(i[2]) && (o = i[2]), t = yield G.getShouleiShareLinkDlj(n, a, o)
                    } while (0);
                    return t
                })
            }

            getShouleiShareLink2(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = void 0;
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        if (!i || !i[0]) break;
                        let n = i[0], a = i[1], o = i[2], s = i[3], l = i[4], d = i[5], u = "pic";
                        r.isString(i[6]) && (u = i[6]);
                        let c = "";
                        r.isString(i[7]) && (c = i[7]), t = yield G.getShouleiShareLink2(n, a, o, s, l, d, u, c)
                    } while (0);
                    return t
                })
            }

            getShouleiShareLinkDlj2(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = void 0;
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        if (!i || !i[0]) break;
                        let n = i[0], a = i[1], o = i[2], s = i[3], l = i[4], d = i[5], u = "pic";
                        r.isString(i[6]) && (u = i[6]);
                        let c = "";
                        r.isString(i[7]) && (c = i[7]), t = yield G.getShouleiShareLinkDlj2(n, a, o, s, l, d, u, c)
                    } while (0);
                    return t
                })
            }

            getShouleiFileTransferLink(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = void 0;
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        if (!i || !i[0] || i[1]) break;
                        let n = i[0], a = i[1], o = "pic";
                        r.isString(i[2]) && (o = i[2]);
                        let s = "";
                        r.isString(i[3]) && (s = i[3]), t = yield G.getShouleiFileTransferLink(n, a, o, s)
                    } while (0);
                    return t
                })
            }

            getShouleiFileTransferDlj(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = void 0;
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        if (!i || !i[0] || !i[1]) break;
                        let n = i[0], a = i[1], o = "pic";
                        r.isString(i[2]) && (o = i[2]);
                        let s = "";
                        r.isString(i[3]) && (s = i[3]), t = yield G.getShouleiFileTransferDlj(n, a, o, s)
                    } while (0);
                    return t
                })
            }

            getShouleiFileTransferLink2(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = void 0;
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        if (!i || !i[0] || !i[6]) break;
                        let n = i[0], a = i[1], o = i[2], s = i[3], l = i[4], d = i[5], u = i[6], c = "pic";
                        r.isString(i[7]) && (c = i[7]);
                        let h = "";
                        r.isString(i[8]) && (h = i[8]), t = yield G.getShouleiFileTransferLink2(n, a, o, s, l, d, u, c, h)
                    } while (0);
                    return t
                })
            }

            getShouleiFileTransferDlj2(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = void 0;
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        if (!i || !i[0] || !i[6]) break;
                        let n = i[0], a = i[1], o = i[2], s = i[3], l = i[4], d = i[5], u = i[6], c = "pic";
                        r.isString(i[7]) && (c = i[7]);
                        let h = "";
                        r.isString(i[8]) && (h = i[8]), t = yield G.getShouleiFileTransferDlj2(n, a, o, s, l, d, u, c, h)
                    } while (0);
                    return t
                })
            }

            log(e, t, ...i) {
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (!i || i.length < 3) break;
                    let t = i[0], n = i[1], a = null;
                    switch (a = r.isString(t) && t.length > 0 ? s.default.getLogger(t) : te, n) {
                        case"verbose":
                            a.verbose(...i.splice(2));
                            break;
                        case"information":
                            a.information(...i.splice(2));
                            break;
                        case"warning":
                            a.warning(...i.splice(2));
                            break;
                        case"error":
                            a.error(...i.splice(2));
                            break;
                        case"critical":
                            a.critical(...i.splice(2))
                    }
                } while (0)
            }

            isDevToolsEnable(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    return m.DevEnvHelperNS.isDevToolsEnable()
                })
            }

            isMainWndVisible(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = !1;
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        let i = yield a.asyncRemoteCall.getCurrentWindow(), n = yield i.isMinimized(),
                            o = yield i.isVisible();
                        i && !n && o && (t = !0)
                    } while (0);
                    return t
                })
            }

            isInFullScreen(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = !1;
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        t = ne.IsInFullScreen()
                    } while (0);
                    return t
                })
            }

            switchDetail(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        if (r.isNullOrUndefined(i) || r.isNullOrUndefined(i[0])) break;
                        let t = i[0], n = i[1];
                        yield L.ThunderNewTask.selectTask(t), n && setTimeout(() => {
                            H.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnSwitchDetail", t, n)
                        }, 100)
                    } while (0)
                })
            }

            utf8StringEncodeToBinary(e, t, ...i) {
                let n = void 0;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (r.isNullOrUndefined(i) || r.isNullOrUndefined(i[0]) || r.isNullOrUndefined(i[1])) break;
                    let t = i[0], a = i[1];
                    n = ne.utf8StringEncodeToBinary(t, a)
                } while (0);
                return n
            }

            utf8StringDecodeFromBinary(e, t, ...i) {
                let n = void 0;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (r.isNullOrUndefined(i) || r.isNullOrUndefined(i[0]) || r.isNullOrUndefined(i[1])) break;
                    let t = i[0], a = i[1];
                    n = ne.utf8StringDecodeFromBinary(t, a)
                } while (0);
                return n
            }

            getErrorCodeConfigMessage(e, t, ...i) {
                let n = void 0;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (r.isNullOrUndefined(i) || r.isNullOrUndefined(i[0]) || r.isNullOrUndefined(i[1])) break;
                    let t = i[0], a = i[1];
                    n = z.default.getMessage(t, a)
                } while (0);
                return n
            }

            getErrorCodeConfigData(e, t, ...i) {
                let n = void 0;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (r.isNullOrUndefined(i) || r.isNullOrUndefined(i[0])) break;
                    let t = i[0];
                    n = z.default.getData(t)
                } while (0);
                return n
            }

            getMainWndHandle(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = void 0;
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        t = (yield(yield a.asyncRemoteCall.getCurrentWindow()).getNativeWindowHandle()).readUIntLE(0, 4)
                    } while (0);
                    return t
                })
            }

            getPluginStatus(e, t, ...i) {
                let n = null;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    let t = i[0];
                    if (!t) break;
                    n = p.PluginLoaderNS.pluginLoader.getPluginStatus(t)
                } while (0);
                return n
            }

            setPluginStatus(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = null;
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        let n = i[0];
                        if (!n) break;
                        let a = i[1];
                        if (!a) break;
                        if ("ready" !== a && "loaded" !== a) break;
                        t = yield p.PluginLoaderNS.pluginLoader.setPluginStatus(n, a)
                    } while (0);
                    return t
                })
            }

            popPluginGroups(e, t, ...i) {
                let n = null;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    let t = i[0];
                    if (!t) break;
                    n = p.PluginLoaderNS.pluginLoader.popPluginGroups(t)
                } while (0);
                return n
            }

            getInitUserLoginParam(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = null;
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        let i = yield(yield a.asyncRemoteCall.getCurrentWindow()).webContents.session.getUserAgent(),
                            n = "XW-G4v1H72tgfJym", o = "Qbaferw2knfQKqxa25EYJGtZ2_6755CMwzXBN3ctW54",
                            s = "https://xluser-ssl.xunlei.com";
                        1 === b.ConfigNS.getValue("UserLoginConfig", "TestServer", 0) && (n = "XXDfQA-ruQKfza9f", o = "jXD0dQ-nm_yybCfqj7EqUKQtp6sc5q1kzodIj96Gfq0", s = "https://xluser-ssl.xunlei.com"), t = {
                            clientId: n,
                            clientSecret: o,
                            apiOrigin: s,
                            userAgent: i
                        }
                    } while (0);
                    return t
                })
            }

            bringMainWndToTop(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        let t = yield a.asyncRemoteCall.getCurrentWindow();
                        t && ((yield t.isMinimized()) && (yield t.restore()), yield t.show(), yield _.ToolsUtilitiesAWNS.setForegroundWindow(ne, t))
                    } while (0)
                })
            }

            messageBoxPop(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    te.information("messageBoxPop args:", i);
                    let t = void 0;
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        if (!i || !i[0] || !i[1]) break;
                        let n = i[0], a = i[1];
                        if ("object" != typeof n || "object" != typeof a) break;
                        t = yield X.MessageBox.pop(n, a)
                    } while (0);
                    return t
                })
            }

            messageBoxConfirm(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    te.information("messageBoxConfirm args:", i);
                    let t = void 0;
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        if (!i || !i[0] || !i[1]) break;
                        let n = i[0], a = i[1];
                        if ("object" != typeof n || "object" != typeof a) break;
                        t = yield X.MessageBox.confirm(n, a)
                    } while (0);
                    return t
                })
            }

            messageBoxCustom(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    te.information("messageBoxPop args:", i);
                    let t = void 0;
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        if (!i || !i[0]) break;
                        let n = i[0], a = i[1] || {}, o = i[2] || {};
                        t = yield X.MessageBox.custom(n, a, o)
                    } while (0);
                    return t
                })
            }

            flashFrame(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let e = yield a.asyncRemoteCall.getCurrentWindow();
                    e && (yield e.flashFrame(!0), e.on("focus", function t() {
                        e.flashFrame(!1), i && i[0] && i[0](), e.removeListener("focus", t)
                    }))
                })
            }

            setTrayImage(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        if (!i || !i[0]) break;
                        yield d.server.callClientFunctionByName(u.CommonIPCBase.mainProcessContext, "SetTrayImage", i[0])
                    } while (0)
                })
            }

            flashTray(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        if (!i) break;
                        yield l.client.callRemoteClientFunction(u.CommonIPCBase.mainProcessContext, "FlashTray", ...i)
                    } while (0)
                })
            }

            getMainWindowStates(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    function t() {
                        let e = ne.getForegroundProcessName(), t = !1;
                        return (e.toLowerCase().indexOf("thunder.exe") > -1 || e.toLowerCase().indexOf("xlbrowser.exe") > -1) && (t = !0), t
                    }

                    let i = {};
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        let n = yield a.asyncRemoteCall.getCurrentWindow();
                        if (!n) break;
                        i = {
                            visible: yield n.isVisible(),
                            alwaysOnTop: yield n.isAlwaysOnTop(),
                            destroyed: yield n.isDestroyed(),
                            focused: yield n.isFocused(),
                            fullScreen: yield n.isFullScreen(),
                            maximized: yield n.isMaximized(),
                            minimized: yield n.isMinimized(),
                            modal: yield n.isModal(),
                            foreground: t()
                        }
                    } while (0);
                    return i
                })
            }

            showAniCover(e, t, ...i) {
                let n = void 0;
                do {
                    if (!i || !i[0]) break;
                    n = c.MatteNS.pop("MatteAni", i[0], {customClass: i[1] || "td-cover--ordinary"})
                } while (0);
                return n
            }

            closeAniCover(e, t, ...i) {
                do {
                    if (!i || !i[0]) break;
                    c.MatteNS.close("MatteAni", i[0])
                } while (0)
            }

            popFileSelect(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let e = "";
                    do {
                        if (r.isNullOrUndefined(re)) break;
                        e = yield re.popFileSelect()
                    } while (0);
                    return e
                })
            }

            popFilesSelect(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let e = [];
                    do {
                        if (r.isNullOrUndefined(re)) break;
                        e = yield re.popFileSelects()
                    } while (0);
                    return e
                })
            }

            getMediaInfo(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let e = "";
                    do {
                        if (!i || !i[0] || r.isNullOrUndefined(re)) break;
                        e = i[0]
                    } while (0);
                    return re.getMediaInfo(e)
                })
            }

            caclGcid(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let e = "";
                    do {
                        if (!i || !i[0] || r.isNullOrUndefined(re)) break;
                        e = i[0]
                    } while (0);
                    return re.caclGCid(e)
                })
            }

            caclCid(e, t, ...i) {
                let n = "";
                do {
                    if (!i || !i[0] || r.isNullOrUndefined(re)) break;
                    n = i[0]
                } while (0);
                return re.caclCid(n)
            }

            caclBCid(e, t, ...i) {
                let n = "";
                do {
                    if (!i || !i[0] || r.isNullOrUndefined(re)) break;
                    n = i[0]
                } while (0);
                return re.caclBCid(n)
            }

            uploadFileToOss(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let e = "", t = "", n = void 0;
                    do {
                        if (!i || !i[0] || !i[1] || !i[2] || r.isNullOrUndefined(re)) break;
                        if (e = i[0], t = i[1], !(n = i[2]).regin && n.endpoint) {
                            let e = n.endpoint.indexOf(".aliyuncs.com");
                            -1 !== e && (n.region = n.endpoint.slice(0, e))
                        }
                    } while (0);
                    return re.uploadFileToOss(e, t, n)
                })
            }

            getUploadProg(e, t, ...i) {
                let n = "";
                do {
                    if (!i || !i[0]) break;
                    n = i[0]
                } while (0);
                return re.getProg(n)
            }

            cancelUpload(e, t, ...i) {
                re.cancelUpload()
            }

            pauseUpload(e, t, ...i) {
                re.pauseUpload()
            }

            createDownloadAndPlayTask(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    return !!(i && i[0] && i[1]) && J.DownloadAndPlayUnionNS.createDowndAndPlayTask(i[0], i[1], i[2], !0)
                })
            }

            popFileSelectAndGetInfo(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let e = [], t = yield re.popFileSelect();
                    return C.FileSystemAWNS.existsAW(t) && e.push({
                        filePath: t,
                        fileInfo: yield re.getMediaInfo(t),
                        fileSize: yield C.FileSystemAWNS.getFileSize(t)
                    }), e
                })
            }

            popFilesSelectAndGetInfo(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let e = [], t = yield re.popFileSelects(!0);
                    for (let i of t) C.FileSystemAWNS.existsAW(i) && e.push({
                        filePath: i,
                        fileInfo: yield re.getMediaInfo(i),
                        fileSize: yield C.FileSystemAWNS.getFileSize(i)
                    });
                    return e
                })
            }

            resumeUpload(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let e = "", t = "", n = void 0;
                    do {
                        if (!i || !i[0] || !i[1] || !i[2] || r.isNullOrUndefined(re)) break;
                        if (e = i[0], t = i[1], !(n = i[2]).regin && n.endpoint) {
                            let e = n.endpoint.indexOf(".aliyuncs.com");
                            -1 !== e && (n.region = n.endpoint.slice(0, e))
                        }
                    } while (0);
                    return re.resumeUpload(e, t, n)
                })
            }

            postUpload(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let e = "", t = {}, n = "";
                    do {
                        if (!i || !i[0] || !i[1] || r.isNullOrUndefined(re)) break;
                        n = i[0], e = i[1], t = i[2]
                    } while (0);
                    return re.postUpload(n, e, t)
                })
            }

            playFileByXmp(e, t, i) {
                return n(this, void 0, void 0, function* () {
                    let e = {ret: !1, errcode: 0};
                    do {
                        if (!i || !i.playUrl || !i.fileName || r.isNullOrUndefined(re)) break;
                        if (te.information("cqm playFileByXmp xmpInfo.medias", i.medias), i.taskUrl = i.taskUrl ? i.taskUrl : "", i.cid = i.cid ? i.cid : "", i.gcid = i.gcid ? i.gcid : "", i.taskId = i.taskId ? i.taskId : -1, i.fileSize = i.fileSize ? i.fileSize : 0, i.fileDir = i.fileDir ? i.fileDir : "", i.fileIndex = i.fileIndex ? i.fileIndex : 0, i.dlnaPlay = void 0 !== i.dlnaPlay && i.dlnaPlay, i.playPosPercent = i.playPosPercent ? i.playPosPercent : 0, i.startPos = i.startPos ? i.startPos : 0, i.taskType = i.taskType ? i.taskType : 0, i.fromweb = void 0 === i.fromweb || i.fromweb, i.openFrom = i.openFrom ? i.openFrom : "xunlei11", i.panFileId = i.panFileId ? i.panFileId : null, i.playType = "dc", i.isEmbed = void 0 === i.isEmbed || i.isEmbed, i.medias && i.medias.length > 0) {
                            let e = [];
                            for (let t of i.medias) {
                                let n = {};
                                n.ratioId = t.media_id, n.rationName = t.media_name, n.iconLink = t.icon_link, n.isOrigin = t.is_origin, n.isDefault = t.is_default, n.isVisible = t.is_visible, n.priority = t.priority, n.name = t.resolution_name, t.link && (n.url = t.link.url, n.expire = t.link.expire), t.is_default && (i.playUrl = t.link.url), e.push(n)
                            }
                            this.panRationInfo.fileId = i.panFileId, this.panRationInfo.infos = e
                        }
                        e = yield M.TaskOperatorNs.playVideoByXmp(i)
                    } while (0);
                    return e
                })
            }

            getPanRationInfos(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    return i && i[0] === this.panRationInfo.fileId ? this.panRationInfo.infos : null
                })
            }

            updatePanDivRect(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let e = {x: 500, y: 99, width: 592, height: 247}, t = 0;
                    i && i[0] && (e = i[0]), i && i[1] && (t = i[1]), te.information("updatePanDivRect rect", e, "scrollTop", t), Q.clientProduct.updatePanEmbedRect(e)
                })
            }

            updatePosition(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    yield Q.clientProduct.updateXmpPosition()
                })
            }

            backUpEmbed(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    yield Q.clientProduct.updateXmpMode(ee.XMPShowMode.EMBED_CHILD_MODE);
                    let e = d.server.getRemoteClient(u.CommonIPCBase.mainRendererContext, "xmplite");
                    e && (yield d.server.callClientFunctionByName(e, "backUpToEmbed", ...i))
                })
            }

            updatePanMiniRect(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let e = yield a.asyncRemoteCall.getCurrentWindow(), t = 0, n = 0;
                    if (e) {
                        let i = yield e.getSize();
                        t = i[0], n = i[1]
                    }
                    let o = {x: t - 350 - 40, y: n - 200 - 30, width: 350, height: 200};
                    i && i[0] && (o = i[0]), Q.clientProduct.updateMiniRect(o)
                })
            }

            closePopMutual(e, t, ...i) {
                do {
                    if (!i || !i[0]) break;
                    Y.popMutual.setFinish(i[0])
                } while (0)
            }

            createBtTaskWindow(e, t, ...i) {
                do {
                    if (!i || !i[0]) break;
                    let e = i[0];
                    if (e && e.length > 0) for (let t of e) L.ThunderNewTask.createBtTaskWindow({
                        url: t.url,
                        type: "url",
                        birdkeyChars: t.birdkeyChars
                    }, {source: t.statClick || "newwindow_url", referer: t.referer})
                } while (0)
            }

            getCommonlySites(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    return yield v.CommonSitesMgrNS.getInstance().getMostCommonly()
                })
            }

            clearCommonlySites(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    yield v.CommonSitesMgrNS.getInstance().clear()
                })
            }
        };
        e.registerPluginFunction = function () {
            t.registerPluginFunction()
        }
    }(t.PluginFunctionNS || (t.PluginFunctionNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(19);
    !function (e) {
        const t = new class extends n.EventEmitter {
            constructor() {
                super(...arguments), this.index = 0
            }

            pop(e, t, i) {
                return this.index++, this.emit("matte-pop", e, t, i, this.index), this.index
            }

            close(e, t) {
                this.emit("matte-close", e, t)
            }
        };
        e.getInstance = function () {
            return t
        }, e.pop = function (e, i, n) {
            return t.pop(e, i, n)
        }, e.close = function (e, i) {
            return t.close(e, i)
        }
    }(t.MatteNS || (t.MatteNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(2), r = i(6), s = i(0), l = i(93), d = i(12), u = i(5), c = i(7), h = i(4), f = i(544),
        g = r.default(a.join(__rootDir, "../bin/ThunderHelper.node")), p = s.default.getLogger("FileMediaInfoOss");
    var v;
    !function (e) {
        e[e.UploadUnknown = 0] = "UploadUnknown", e[e.UploadSuccess = 1] = "UploadSuccess", e[e.UploadFail = 2] = "UploadFail", e[e.UploadPause = 3] = "UploadPause", e[e.UploadCancel = 4] = "UploadCancel"
    }(v || (v = {}));

    class m {
        constructor() {
            this.progress = new Map, this.inited = !1
        }

        getProg(e) {
            if ("" === e) return 0;
            let t = this.progress.get(e);
            return h.isNullOrUndefined(t) && (t = 0), t
        }

        popFileSelect() {
            return n(this, void 0, void 0, function* () {
                let e = "";
                const t = yield d.asyncRemoteCall.getDialog();
                let i = yield d.asyncRemoteCall.getCurrentWindow();
                return e = yield new Promise(e => {
                    t.showOpenDialog(i, {
                        title: "打开",
                        properties: ["openFile"],
                        filters: [{name: "All Files", extensions: ["*"]}]
                    }, t => {
                        e(t ? t[0] : "")
                    })
                })
            })
        }

        popFileSelects(e = !1) {
            return n(this, void 0, void 0, function* () {
                let e = [];
                const t = yield d.asyncRemoteCall.getDialog();
                let i = yield d.asyncRemoteCall.getCurrentWindow();
                return e = yield new Promise(e => {
                    t.showOpenDialog(i, {
                        title: "打开",
                        properties: ["multiSelections"],
                        filters: [{name: "All Files", extensions: ["*"]}]
                    }, t => {
                        e(t || [])
                    })
                })
            })
        }

        caclGCid(e) {
            return n(this, void 0, void 0, function* () {
                return yield new Promise(t => {
                    g.calculateFileGCID(e, e => {
                        p.information("getVideoMediaInfo calculateFileGCID result", e), t(e)
                    })
                })
            })
        }

        caclCid(e) {
            return n(this, void 0, void 0, function* () {
                return yield new Promise(t => {
                    g.calculateFileCID(e, e => {
                        p.information("getVideoMediaInfo calculateFileCID result", e), t(e)
                    })
                })
            })
        }

        caclBCid(e) {
            return n(this, void 0, void 0, function* () {
                let t = "";
                return p.information("caclBcid filePath ", e), t = yield new Promise(t => {
                    g.calculateFileBCID(e, e => {
                        p.information("getVideoMediaInfo calculateFileCID result", e), t(e)
                    })
                })
            })
        }

        getMediaInfo(e) {
            return n(this, void 0, void 0, function* () {
                let t = "";
                return "" !== e && (t = yield new Promise(t => {
                    g.getMediaInfo(e, e => {
                        p.information("getVideoMediaInfo result", e), t(e)
                    })
                })), t
            })
        }

        getBlockSize(e) {
            let t = 0;
            do {
                if (e <= 0) {
                    t = 0;
                    break
                }
                if (e >= 0 && e <= 128 << 20) {
                    t = 262144;
                    break
                }
                if (e > 128 << 20 && e <= 256 << 20) {
                    t = 524288;
                    break
                }
                if (e > 256 << 20 && e <= 512 << 20) {
                    t = 1048576;
                    break
                }
                t = 2097152
            } while (0);
            return t
        }

        getFileMediaInfo() {
            return n(this, void 0, void 0, function* () {
                let e = yield this.popFileSelect();
                if (!e) return null;
                let t = o.basename(e), i = o.extname(e), n = yield u.FileSystemAWNS.getFileSize(e),
                    a = this.getBlockSize(n), r = {
                        mediaName: t,
                        mediaSuffix: i,
                        mediaGcid: "",
                        mediaBcid: "",
                        mediaCid: "",
                        mediaPath: e,
                        mediaSize: n.toString(),
                        mediaBlockSize: a.toString()
                    };
                do {
                    let t = yield this.getMediaInfo(e);
                    if (!t) {
                        p.information("getVideoMediaInfo result failed");
                        break
                    }
                    Object.assign(r, this.decodeMediaInfo(t)), r.mediaCid = yield this.caclCid(e), p.information("getVideoMediaInfo mediaInfo", r), r.mediaGcid = yield this.caclGCid(e), r.mediaBcid = yield this.caclBCid(e), p.information("getVideoMediaInfo mediaInfo gcid", r)
                } while (0);
                return r
            })
        }

        getFileMediaInfos() {
            return n(this, void 0, void 0, function* () {
                let e = yield this.popFileSelects();
                if (e.length < 1) return null;
                let t = [];
                for (let i in e) {
                    let e = o.basename(i), n = o.extname(i), a = yield u.FileSystemAWNS.getFileSize(i),
                        r = this.getBlockSize(a), s = {
                            mediaName: e,
                            mediaSuffix: n,
                            mediaGcid: "",
                            mediaBcid: "",
                            mediaCid: "",
                            mediaPath: i,
                            mediaSize: a.toString(),
                            mediaBlockSize: r.toString()
                        };
                    do {
                        let e = yield this.getMediaInfo(i);
                        if (!e) {
                            p.information("getVideoMediaInfo result failed");
                            break
                        }
                        Object.assign(s, this.decodeMediaInfo(e)), s.mediaCid = yield this.caclCid(i), p.information("getVideoMediaInfo mediaInfo", s), s.mediaGcid = yield this.caclGCid(i), s.mediaBcid = yield this.caclBCid(i), t.push(s), p.information("getVideoMediaInfo mediaInfo gcid", s)
                    } while (0)
                }
                return t
            })
        }

        timeStringToNumber(e) {
            let t = e.split(" "), i = 0;
            for (let e of t) {
                let t = e.indexOf("h");
                -1 === t ? -1 === (t = e.indexOf("mn")) ? -1 === (t = e.indexOf("ms")) ? -1 === (t = e.indexOf("s")) || (i += 1e3 * Number(e.substr(0, t))) : i += Number(e.substr(0, t)) : i += 60 * Number(e.substr(0, t)) * 1e3 : i += 60 * Number(e.substr(0, t)) * 60 * 1e3
            }
            return i
        }

        decodeMediaInfo(e) {
            let t = {}, i = e.split("\r\n"), n = "";
            for (let e of i) -1 !== e.indexOf("时长 =") && (n = e.substring(e.indexOf("时长 =") + "时长 =".length, e.length - 2), t.mediaTime = this.timeStringToNumber(n).toString()), -1 !== e.indexOf("画面宽度 =") && (t.mediaWidth = e.substring(e.indexOf("画面宽度 =") + "画面宽度 =".length, e.indexOf("pixels")).replace(/\s*/g, "")), -1 !== e.indexOf("画面高度 =") && (t.mediaHeight = e.substring(e.indexOf("画面高度 =") + "画面高度 =".length, e.indexOf("pixels")).replace(/\s*/g, "")), -1 !== e.indexOf("总体码率 =") && (t.mediaVideoBit = e.substring(e.indexOf("总体码率 =") + "总体码率 =".length, e.indexOf("Kbps")).replace(/\s*/g, ""));
            return t
        }

        cancelUpload() {
            c.client.broadcastEvent("cancelUpload", !0)
        }

        pauseUpload() {
            c.client.broadcastEvent("cancelUpload", !1)
        }

        initConfig() {
            return n(this, void 0, void 0, function* () {
                this.inited || (yield f.UploadConfigNS.init(a.join(__profilesDir, "uploadConfig.json")), this.inited = !0)
            })
        }

        getValue(e, t, i) {
            return n(this, void 0, void 0, function* () {
                return yield this.initConfig(), f.UploadConfigNS.getValue(e, t, i)
            })
        }

        deleteValue(e, t) {
            return n(this, void 0, void 0, function* () {
                return yield this.initConfig(), f.UploadConfigNS.removeValue(e, t)
            })
        }

        setValue(e, t, i) {
            return n(this, void 0, void 0, function* () {
                yield this.initConfig(), f.UploadConfigNS.setValue(e, t, i)
            })
        }

        getState(e, t, i) {
            return n(this, void 0, void 0, function* () {
                let e = v.UploadUnknown, a = 0;
                return yield this.initConfig(), e = yield new Promise(e => {
                    a = c.client.attachServerEvent("cancelUpload", (a, o) => n(this, void 0, void 0, function* () {
                        o && (yield this.deleteValue(t, "checkpoint"), e(v.UploadCancel)), i.kill(), e(v.UploadPause)
                    })), i.on("message", i => n(this, void 0, void 0, function* () {
                        i.progress && this.progress.set(t, Math.floor(100 * Number(i.progress))), i.cpt && (yield this.setValue(t, "checkpoint", i.cpt)), i.result && (200 === i.result.res.status ? (this.progress.set(t, 100), e(v.UploadSuccess)) : (this.progress.delete(t), e(v.UploadFail)), p.error("uploadFileToOss result: ", i.result, i.result.res.status)), i.error && (this.progress.delete(t), p.error("uploadFileToOss error: ", i.error), e(v.UploadFail))
                    }))
                }), c.client.detachServerEvent("CancelUpload", a), c.client.broadcastEvent("UploadFileToOssState", e), e
            })
        }

        resumeUpload(e, t, i) {
            return n(this, void 0, void 0, function* () {
                if ("" !== e && "" !== t && !h.isNullOrUndefined(i)) {
                    this.progress.set(e, 0);
                    let n = `${__rootDir}/out/upload-oss.js`,
                        a = l.fork(n, ["--type=xdas-plugin-process", "--xdas-plugin-name=upload-oss"]),
                        o = yield this.getValue(t, "checkpoint", void 0);
                    a.send({filePath: e, key: t, checkpoint: o, token: i}), this.getState(e, t, a).catch()
                }
                return !0
            })
        }

        postUpload(e, t, i = {}) {
            return n(this, void 0, void 0, function* () {
                let a;
                return function (e) {
                    e[e.success = 0] = "success", e[e.fail = 1] = "fail", e[e.not_exist = 2] = "not_exist"
                }(a || (a = {})), new Promise(o => {
                    if ("" !== e && "" !== t && u.FileSystemAWNS.existsAW(t)) {
                        let r = `${__rootDir}/out/post-upload-oss`,
                            s = l.fork(r, ["--type=xdas-plugin-process", "--xdas-plugin-name=post-upload-oss"]);
                        s.send({
                            postUrl: e,
                            filePath: t,
                            params: i
                        }), s.on("message", e => n(this, void 0, void 0, function* () {
                            o(e ? a.success : a.fail)
                        }))
                    } else o(a.not_exist)
                })
            })
        }

        uploadFileToOss(e, t, i) {
            return n(this, void 0, void 0, function* () {
                if ("" !== e && "" !== t && !h.isNullOrUndefined(i)) {
                    this.progress.set(e, 0);
                    let n = `${__rootDir}/out/upload-oss.js`,
                        a = l.fork(n, ["--type=xdas-plugin-process", "--xdas-plugin-name=upload-oss"]), o = void 0;
                    a.send({filePath: e, key: t, checkpoint: o, token: i}), this.getState(e, t, a).catch()
                }
                return !0
            })
        }
    }

    t.FileMediaInfoOssManger = m, function (e) {
        const t = new m;
        e.getfileMediaInfoOssManger = function () {
            return t
        }
    }(t.fileMediaInfoOssMangerNS || (t.fileMediaInfoOssMangerNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(53), o = i(0), r = i(39), s = i(5), l = i(13), d = o.default.getLogger("UploadConfig");

    class u {
        constructor() {
            this.isInit = !1, this.configData = {}, this.configPath = void 0, this.configBakPath = void 0, this.eventContainer = new r.default, this.changed = !1, this.timer = null, this.eventContainer.setMaxListeners(0)
        }

        init(e) {
            return n(this, void 0, void 0, function* () {
                if (!this.isInit) {
                    this.configPath = e, this.configBakPath = e + ".bak";
                    let t = null, i = yield s.FileSystemAWNS.existsAW(e);
                    if (i) {
                        let i = yield s.FileSystemAWNS.readFileAW(e);
                        if (i && i.length > 0) try {
                            t = JSON.parse(i.toString())
                        } catch (e) {
                            d.warning(e)
                        }
                    }
                    if (!t) if (i = yield s.FileSystemAWNS.existsAW(this.configBakPath)) {
                        let e = yield s.FileSystemAWNS.readFileAW(this.configBakPath);
                        if (e && e.length > 0) try {
                            t = JSON.parse(e.toString())
                        } catch (e) {
                            d.warning(e)
                        }
                    } else a.openSync(this.configPath, "w+");
                    t && this.mergeConfigData(t), this.isInit = !0, this.eventContainer.fireEvent(l.NodeEventMesssageNS.eventUploadConfigInitFinished)
                }
                this.timer || (this.timer = setInterval(() => {
                    this.changed && (this.changed = !1, this.save().catch())
                }, 5e3))
            })
        }

        getValue(e, t, i) {
            let n = i;
            do {
                if (!e || "" === e) break;
                if (!t || "" === t) break;
                let a = this.configData[e];
                if (!a) {
                    let n = {};
                    n[t] = i, this.configData[e] = n;
                    break
                }
                t in a ? n = a[t] : a[t] = i
            } while (0);
            return n
        }

        setValue(e, t, i) {
            do {
                if (!e || "" === e) break;
                if (!t || "" === t) break;
                let n = void 0, a = this.configData[e];
                if (a) n = a[t], a[t] = i; else {
                    let n = {};
                    n[t] = i, this.configData[e] = n
                }
                n !== i && (this.changed = !0, this.fireValueChangedEvent(e, t, n, i))
            } while (0)
        }

        removeValue(e, t) {
            do {
                if (!e || "" === e) break;
                if (!t || "" === t) break;
                let i = void 0, n = this.configData[e];
                n && (i = n[t], n[t] = void 0), void 0 !== i && this.fireValueChangedEvent(e, t, i, void 0)
            } while (0)
        }

        isInitConfigFinished() {
            return this.isInit
        }

        save() {
            return n(this, void 0, void 0, function* () {
                if (this.isInit) {
                    let e = JSON.stringify(this.configData, void 0, 2);
                    yield s.FileSystemAWNS.writeFileAW(this.configPath, e), yield s.FileSystemAWNS.writeFileAW(this.configBakPath, e)
                }
            })
        }

        saveSync() {
            if (this.isInit) {
                let e = JSON.stringify(this.configData, void 0, 2);
                a.writeFileSync(this.configPath, e), a.writeFileSync(this.configBakPath, e)
            }
        }

        attachListener(e, t) {
            do {
                if (e === l.NodeEventMesssageNS.eventUploadConfigInitFinished) {
                    if (this.isInit) {
                        t(this.isInit);
                        break
                    }
                    this.eventContainer.attachOnceListener(e, t);
                    break
                }
                this.eventContainer.attachListener(e, t)
            } while (0)
        }

        detachListener(e, t) {
            this.eventContainer.detachListener(e, t)
        }

        mergeConfigData(e) {
            if (e) if (null === this.configData) this.configData = e; else for (let t in e) {
                let i = e[t];
                if (!i) break;
                for (let e in i) {
                    let n = i[e], a = this.configData[t];
                    if (a) a[e] = n; else {
                        let i = {};
                        i[e] = n, this.configData[t] = i
                    }
                }
            }
        }

        fireValueChangedEvent(e, t, i, n) {
            this.eventContainer.fireEvent(l.NodeEventMesssageNS.eventUploadConfigValueChanged, e, t, i, n)
        }
    }

    t.UploadConfig = u;
    const c = new u;
    !function (e) {
        e.init = function (e) {
            return n(this, void 0, void 0, function* () {
                yield c.init(e)
            })
        }, e.isInitConfigFinished = function () {
            return c.isInitConfigFinished()
        }, e.save = function () {
            return n(this, void 0, void 0, function* () {
                yield c.save()
            })
        }, e.saveSync = function () {
            c.saveSync()
        }, e.getValue = function (e, t, i) {
            return c.getValue(e, t, i)
        }, e.setValue = function (e, t, i) {
            c.setValue(e, t, i)
        }, e.removeValue = function (e, t) {
            c.removeValue(e, t)
        }, e.attachListener = function (e, t) {
            c.attachListener(e, t)
        }, e.detachListener = function (e, t) {
            c.detachListener(e, t)
        }
    }(t.UploadConfigNS || (t.UploadConfigNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(4), o = i(20), r = i(10), s = i(13), l = i(25), d = i(323), u = i(76), c = i(77), h = i(324);
    !function (e) {
        const t = new class {
            constructor() {
                this.isRegister = !1, r.ConfigNS.attachListener(s.NodeEventMesssageNS.eventConfigValueChanged, (e, t, i, n) => {
                    o.server.fireClientEvent("OnConfigValueChanged", e, t, i, n), o.server.fireClientEvent("OnConfigValueChanaged", e, t, i, n)
                }), r.ConfigNS.attachListener(s.NodeEventMesssageNS.eventConfigInitFinished, () => {
                    o.server.fireClientEvent("OnConfigInitFinished")
                })
            }

            registerPluginFunction() {
                if (!this.isRegister) {
                    this.isRegister = !0;
                    let e = {
                        Save: this.save,
                        GetValue: this.getValue,
                        SetValue: this.setValue,
                        SaveConfig: this.save,
                        GetConfigValue: this.getValue,
                        SetConfigValue: this.setValue,
                        IsConfigInitFinish: this.isConfigInitFinish,
                        WaitForConfigInitFinish: this.isConfigInitFinish,
                        GetConfigModules: this.getConfigModules,
                        IsConfigBrowserInitFinish: this.isConfigBrowserInitFinish,
                        WaitForConfigBrowserInitFinish: this.isConfigBrowserInitFinish,
                        GetInstallBrowserInfo: this.getInstallBrowserInfo,
                        AddConfigSettingItemData: this.addConfigSettingItemData,
                        RemoveConfigSettingItemData: this.removeConfigSettingItemData,
                        SaveTaskFilters: this.saveTaskFilters,
                        GetPrivateSavePath: this.getPrivateSavePath
                    };
                    o.server.registerFunctions(e)
                }
            }

            save(e, t, ...i) {
                do {
                    if (!e) break;
                    r.ConfigNS.save().catch()
                } while (0)
            }

            getValue(e, t, ...i) {
                let n = void 0;
                do {
                    if (!e) break;
                    if (a.isNullOrUndefined(i) || a.isNullOrUndefined(i[0]) || a.isNullOrUndefined(i[1])) break;
                    let t = i[0], o = i[1], s = i[2];
                    n = r.ConfigNS.getValue(t, o, s)
                } while (0);
                return n
            }

            setValue(e, t, ...i) {
                do {
                    if (!e) break;
                    if (a.isNullOrUndefined(i) || a.isNullOrUndefined(i[0]) || a.isNullOrUndefined(i[1])) break;
                    let t = i[0], n = i[1], o = i[2];
                    r.ConfigNS.setValue(t, n, o)
                } while (0)
            }

            isConfigInitFinish(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    return new Promise((t, i) => {
                        do {
                            if (!e) {
                                i(new Error("client is undefined"));
                                break
                            }
                            r.ConfigNS.attachListener(s.NodeEventMesssageNS.eventConfigInitFinished, () => {
                                t(!0)
                            })
                        } while (0)
                    })
                })
            }

            getConfigModules(e, t, ...i) {
                let n = void 0;
                do {
                    if (!e) break;
                    let t = "", a = "";
                    i && (i[0] && (t = i[0]), i[1] && (a = i[1]), n = l.default.getConfigInfo(t, a))
                } while (0);
                return n
            }

            isConfigBrowserInitFinish(e, t, ...i) {
                return new Promise((t, i) => {
                    do {
                        if (!e) {
                            i(new Error("client is undefined"));
                            break
                        }
                        c.SettingConfigHelperNS.configBrowserHelper.attachListener(s.NodeEventMesssageNS.eventConfigBrowserInitFinished, () => {
                            t(!0)
                        })
                    } while (0)
                })
            }

            getInstallBrowserInfo(e, t, ...i) {
                let n = void 0;
                do {
                    if (!e) break;
                    if (a.isNullOrUndefined(i) || a.isNullOrUndefined(i[0])) break;
                    if ("" === i[0]) break;
                    let t = i[0];
                    n = c.SettingConfigHelperNS.configBrowserHelper.getWatchBrowerByName(t)
                } while (0);
                return n
            }

            addConfigSettingItemData(e, t, ...i) {
                let n = !1;
                do {
                    if (!e) break;
                    if (a.isNullOrUndefined(i) || a.isNullOrUndefined(i[0]) || a.isNullOrUndefined(i[1])) break;
                    let t = i[0], o = i[1];
                    if ("string" == typeof i[0]) try {
                        t = JSON.parse(i[0])
                    } catch (e) {
                    }
                    if ("string" == typeof i[1]) try {
                        o = JSON.parse(i[1])
                    } catch (e) {
                    }
                    t && o && (n = d.SettingInit.addSettingItemData(t, o))
                } while (0);
                return n
            }

            removeConfigSettingItemData(e, t, ...i) {
                let n = !1;
                do {
                    if (!e) break;
                    if (a.isNullOrUndefined(i) || a.isNullOrUndefined(i[0]) || a.isNullOrUndefined(i[1])) break;
                    let t = i[0], o = i[1];
                    if ("string" == typeof i[0]) try {
                        t = JSON.parse(i[0])
                    } catch (e) {
                    }
                    if ("string" == typeof i[1]) try {
                        o = JSON.parse(i[1])
                    } catch (e) {
                    }
                    t && o && (n = d.SettingInit.removeSettingItemData(t, o))
                } while (0);
                return n
            }

            saveTaskFilters(e, t, ...i) {
                do {
                    if (!e) break;
                    if (a.isNullOrUndefined(i) || a.isNullOrUndefined(i[0])) break;
                    let t = i[0];
                    h.CompletedFilterNS.saveFilter(t, i[1]).catch()
                } while (0)
            }

            getPrivateSavePath(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = "";
                    do {
                        if (!e) break;
                        if (a.isNullOrUndefined(i) || a.isNullOrUndefined(i[0])) break;
                        let n = i[0];
                        t = yield u.PrivateSpaceHelperNS.getPrivateSavePath(n)
                    } while (0);
                    return t
                })
            }
        };
        e.registerPluginFunction = function () {
            t.registerPluginFunction()
        }
    }(t.ConfigPluginFunctionNS || (t.ConfigPluginFunctionNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(42), o = i(5), r = i(2);
    t.confAdd = new class {
        isXmpExist() {
            return n(this, void 0, void 0, function* () {
                let e = a.Common.getXmpPath();
                return o.FileSystemAWNS.existsAW(e)
            })
        }

        isXmpLiteExist() {
            return n(this, void 0, void 0, function* () {
                let e = r.join(__rootDir, "../../XMP/XMP.exe");
                return o.FileSystemAWNS.existsAW(e)
            })
        }

        updateAssociate(e, t, i) {
            return n(this, void 0, void 0, function* () {
            })
        }
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        function t(e) {
            let t = e.toString(16).toUpperCase();
            return t.length < 2 && (t = "0" + t), t
        }

        function i(e, i, n, a) {
            return "0x" + t(a) + t(e) + t(i) + t(n)
        }

        e.rgbaStringToHexWith0xBegin = function (e) {
            if (void 0 !== e) {
                let t = e.split(",");
                return i(parseInt(t[0] || "0", 10), parseInt(t[1] || "0", 10), parseInt(t[2] || "0", 10), parseInt(t[3] || "255", 10))
            }
        }, e.colorNumberToHex = t, e.rgbaToHexWith0xBegin = i
    }(t.ColorUtilNS || (t.ColorUtilNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(17), o = i(0), r = i(7), s = o.default.getLogger("GetSkinInfo");
    let l;
    (function () {
        return n(this, void 0, void 0, function* () {
            "renderer" === process.type ? (s.information("renderer process"), r.client.callServerFunction("GetSkinInfo").then(e => {
                l = e, s.information("send OnChangeSkin", e)
            }).catch(e => {
                s.warning(e)
            }), r.client.attachServerEvent("OnChangeSkin", (e, t) => {
                l = t, s.information("send OnChangeSkin", t)
            })) : "browser" === process.type && (s.information("main process"), a.ipcMain.on("OnChangeSkin", (e, t) => {
                s.information("OnChangeSkin", t), l = t
            }))
        })
    })().catch(e => {
        s.information(e)
    }), t.default = function () {
        return l
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(0), a = i(81), o = i(20), r = n.default.getLogger("ConfigRemoteGlobalPluginFunction");
    !function (e) {
        const t = new class {
            constructor() {
                this.isRegister = !1, a.default.attachListener("OnRemoteGlobalConfigLoaded", e => {
                    r.information("OnRemoteGlobalConfigLoaded ret:", e), o.server.fireClientEvent("OnRemoteGlobalConfigLoaded", e)
                }), a.default.attachListener("OnRemoteGlobalConfigUpdated", e => {
                    r.information("OnRemoteGlobalConfigUpdated ret:", e), o.server.fireClientEvent("OnRemoteGlobalConfigUpdated", e)
                })
            }

            registerPluginFunction() {
                if (!this.isRegister) {
                    this.isRegister = !0;
                    let e = {
                        GetRemoteGlobalConfigValue: this.getRemoteGlobalConfigValue,
                        IsRemoteGlobalConfigInitFinish: this.isRemoteGlobalConfigInitFinish
                    };
                    o.server.registerFunctions(e)
                }
            }

            getRemoteGlobalConfigValue(e, t, ...i) {
                let n = void 0;
                do {
                    if (!e) break;
                    if (!i || !i[0]) break;
                    let t = i[0], o = void 0;
                    i.length >= 2 && (o = i[1]);
                    let r = i[2];
                    n = a.default.getConfigValue(t, o, r)
                } while (0);
                return n
            }

            isRemoteGlobalConfigInitFinish(e, t, ...i) {
                let n = !1;
                do {
                    if (!e) break;
                    n = a.default.isInited()
                } while (0);
                return n
            }
        };
        e.registerPluginFunction = function () {
            t.registerPluginFunction()
        }
    }(t.ConfigRemoteGlobalPluginFunctionNS || (t.ConfigRemoteGlobalPluginFunctionNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(20), o = i(24), r = i(4), s = i(0), l = i(16), d = i(313), u = i(109), c = i(325),
        h = s.default.getLogger("plugin-function-Login");
    !function (e) {
        const t = new class {
            constructor() {
                this.isRegister = !1
            }

            registerPluginFunction() {
                if (!this.isRegister) {
                    this.isRegister = !0;
                    let e = {
                        GetUserID: this.getUserID,
                        GetSessionID: this.getSessionID,
                        GetLoginOption: this.getLoginOption,
                        IsLogined: this.isLogined,
                        GetAllUserInfo: this.getAllUserInfo,
                        GetUserInfo: this.getUserInfo,
                        ShowLoginDlg: this.showLoginDlg,
                        Logout: this.logout,
                        IsAlreadySign: this.isAlreadySign,
                        IsHaveSignQuestion: this.isHaveSignQuestion,
                        GetSessionIDAw: this.getSessionIDAw,
                        GetUserInfoAw: this.getUserInfoAw,
                        GetUserInfoEx: this.getUserInfoEx,
                        GetAllUserInfoAw: this.getAllUserInfoAw,
                        GetUserInfoByKeyAw: this.getUserInfoByKeyAw,
                        Login: this.login,
                        SwitchAccount: this.switchAccount,
                        IsAutoLoginAw: this.isAutoLoginAw,
                        Channel: this.channel,
                        GetVipInfo: this.getVipInfo,
                        GetLoginDeviceID: this.getLoginDeviceID,
                        SendSms: this.sendSms,
                        CheckSms: this.checkSms,
                        RetryLogIn: this.retryLogIn,
                        GetLoginInfo: this.getLoginInfo
                    };
                    a.server.registerFunctions(e), l.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", () => {
                        o.LoginHelperNS.loginHelper.getAllUserInfo(e => {
                            do {
                                if (null === e || void 0 === e) break;
                                a.server.fireClientEvent("OnLoginSuc", e)
                            } while (0)
                        })
                    }), l.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", () => {
                        a.server.fireClientEvent("OnLogout")
                    }), l.NativeCallModule.nativeCall.AttachNativeEvent("onGetUserInfoFinished", () => {
                        a.server.fireClientEvent("OnGetUserInfoFinished")
                    }), l.NativeCallModule.nativeCall.AttachNativeEvent("onUserDetailInfoChange", e => {
                        a.server.fireClientEvent("OnUserDetailInfoChange", e)
                    }), l.NativeCallModule.nativeCall.AttachNativeEvent("onLoginUpdate", (e, t) => {
                        a.server.fireClientEvent("OnLoginUpdate", e, t)
                    })
                }
            }

            getUserID(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    return new Promise(e => {
                        o.LoginHelperNS.loginHelper.getUserInfo("userid", t => {
                            h.information("getUserID:userid = ", t), null !== t && void 0 !== t && "" !== t || (t = "0"), e(t)
                        })
                    })
                })
            }

            getSessionID(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    return new Promise(e => {
                        o.LoginHelperNS.loginHelper.getUserInfo("sessionid", t => {
                            h.information("getSessionID:sessionid = ", t), e(t)
                        })
                    })
                })
            }

            getLoginOption(e, t, ...i) {
                return u.LoginOptionNS.loginOption.getOption()
            }

            getSessionIDAw(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    return o.LoginHelperNS.loginHelper.getSessionIDAw()
                })
            }

            getUserInfoAw(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    return o.LoginHelperNS.loginHelper.getUserInfoAw()
                })
            }

            getUserInfoEx(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    if (!i) return;
                    if (2 !== i.length) return;
                    let e = i[0], t = i[1];
                    o.LoginHelperNS.loginHelper.getUserInfoEx(e, e => {
                        t(e)
                    })
                })
            }

            getAllUserInfoAw(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    return o.LoginHelperNS.loginHelper.getAllUserInfoAw()
                })
            }

            getUserInfoByKeyAw(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    return o.LoginHelperNS.loginHelper.getUserInfoByKeyAw(i[0], i[1])
                })
            }

            isLogined(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    return new Promise(e => {
                        o.LoginHelperNS.loginHelper.isLogined(t => {
                            e(t)
                        })
                    })
                })
            }

            getAllUserInfo(e, t, ...i) {
                return new Promise(e => {
                    if (r.isNullOrUndefined(i) || r.isNullOrUndefined(i[0])) o.LoginHelperNS.loginHelper.getAllUserInfo(t => {
                        e(t)
                    }); else {
                        let t = i[0];
                        o.LoginHelperNS.loginHelper.getAllUserInfo(t, t => {
                            e(t)
                        })
                    }
                })
            }

            getUserInfo(e, t, ...i) {
                return h.information(i), new Promise(e => {
                    let t = 0;
                    if (r.isNullOrUndefined(i) || r.isNullOrUndefined(i[0])) t = 0; else {
                        let e = i[0];
                        t = null === e || void 0 === e || "" === e ? 0 : Number(e)
                    }
                    o.LoginHelperNS.loginHelper.getUserInfoEx(t, t => {
                        e(t)
                    })
                })
            }

            showLoginDlg(e, t, ...i) {
                let n, a = "other", s = !0;
                r.isNullOrUndefined(i) || r.isNullOrUndefined(i[0]) || (a = i[0]), r.isNullOrUndefined(i) || r.isNullOrUndefined(i[1]) || (s = i[1]), r.isNullOrUndefined(i) || r.isNullOrUndefined(i[2]) || (n = i[2]), o.LoginHelperNS.loginHelper.showLoginDlg(a, s, n)
            }

            logout(e, t, ...i) {
                o.LoginHelperNS.loginHelper.logout()
            }

            login(e, t, ...i) {
                let n;
                i && (n = i[0]), o.LoginHelperNS.loginHelper.logIn(n)
            }

            switchAccount(e, t, ...i) {
                let n;
                i && (n = i[0]), o.LoginHelperNS.loginHelper.switchAccount(n)
            }

            isAutoLoginAw(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    return new Promise(e => {
                        o.LoginHelperNS.loginHelper.isAutologin(t => {
                            e(t)
                        })
                    })
                })
            }

            channel(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                })
            }

            getVipInfo(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    return o.LoginHelperNS.loginHelper.getVipInfo()
                })
            }

            isAlreadySign(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    return d.CommonSignFunctionNs.isAlreadySign()
                })
            }

            isHaveSignQuestion(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    return d.CommonSignFunctionNs.isHaveSignQuestion()
                })
            }

            getLoginDeviceID(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    return yield o.LoginHelperNS.loginSDKHelper.getDeviceID()
                })
            }

            sendSms(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let e = "";
                    return null !== i && void 0 !== i && i.length > 0 && (e = i[0]), yield c.commonLoginHelper.sendSmsAw(e)
                })
            }

            checkSms(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let e = void 0;
                    do {
                        if (null === i || void 0 === i || i.length < 2) break;
                        let t = i[0], n = i[1];
                        e = yield c.commonLoginHelper.checkSmsAw(t, n)
                    } while (0);
                    return e
                })
            }

            retryLogIn(e, t, ...i) {
                o.LoginHelperNS.loginHelper.logIn("retryLogIn")
            }

            getLoginInfo(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    return new Promise(e => {
                        if (i[0]) {
                            let t = i[0];
                            o.LoginHelperNS.loginHelper.getUserInfo(t, function (t) {
                                e(t)
                            })
                        } else o.LoginHelperNS.loginHelper.getUserInfo(function (t) {
                            e(t)
                        })
                    })
                })
            }
        };
        e.registerPluginFunction = function () {
            t.registerPluginFunction()
        }
    }(t.LoginPluginFunctionNS || (t.LoginPluginFunctionNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(0), o = i(20), r = i(4), s = i(436), l = i(26), d = i(16),
        u = a.default.getLogger("NativeFunction.Login");
    !function (e) {
        const t = new class {
            constructor() {
                this.isRegister = !1
            }

            registerPluginFunction() {
                if (!this.isRegister) {
                    this.isRegister = !0;
                    let e = {
                        AttachCallbackEvent: this.attachCallbackEvent,
                        IsTipsWndShow: this.isTipsWndShow,
                        IsMainWndShow: this.isMainWndShow,
                        CreateTipsWnd: this.createTipsWnd,
                        CloseTipsWnd: this.closeTipsWnd,
                        ShowOrHideTipsWnd: this.showOrHideTipsWnd
                    };
                    o.server.registerFunctions(e)
                }
            }

            attachCallbackEvent(e, t, ...i) {
                do {
                    if (r.isNullOrUndefined(i) || r.isNullOrUndefined(i[0])) break;
                    let e = i[0], t = i[1];
                    d.NativeCallModule.nativeCall.AttachNativeEvent(e, (...e) => {
                        l.NativeCallHostModule.nativeCallHost.fireNativeEvent(t, ...e)
                    })
                } while (0)
            }

            createTipsWnd(e, t, ...i) {
                do {
                    if (r.isNullOrUndefined(i)) break;
                    if (r.isNullOrUndefined(i[0]) || r.isNullOrUndefined(i[1])) break;
                    let e = i[0], t = i[1], n = "", a = null, o = null;
                    r.isNullOrUndefined(i[2]) || (a = i[2]), r.isNullOrUndefined(i[3]) || (o = i[3]), r.isNullOrUndefined(i[4]) || (n = i[4]), s.TipsHelperNS.tipsUIHelper.createTipsWnd(e, t, a, o, n).catch()
                } while (0)
            }

            isTipsWndShow(e, t, ...i) {
                return s.TipsHelperNS.tipsUIHelper.isTipsWndShow()
            }

            isMainWndShow(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    return yield s.TipsHelperNS.tipsUIHelper.isMainWndShow()
                })
            }

            closeTipsWnd(e, t, ...i) {
                s.TipsHelperNS.tipsUIHelper.closeTipsWnd()
            }

            showOrHideTipsWnd(e, t, ...i) {
                u.information("showOrHideTipsWnd", ...i);
                let n = !1, a = null, o = null, l = null, d = null;
                r.isNullOrUndefined(i[0]) || (n = i[0]), r.isNullOrUndefined(i[1]) || (a = i[1]), r.isNullOrUndefined(i[2]) || (o = i[2]), r.isNullOrUndefined(i[3]) || (l = i[3]), r.isNullOrUndefined(i[4]) || (d = i[4]), s.TipsHelperNS.tipsUIHelper.showOrHideTipsWnd(n, a, o, l, d)
            }
        };
        e.registerPluginFunction = function () {
            t.registerPluginFunction()
        }
    }(t.TipsPluginFunctionNS || (t.TipsPluginFunctionNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(20), o = i(7), r = i(4), s = i(0), l = i(3), d = i(30), u = i(11), c = i(15), h = i(40), f = i(31),
        g = i(5), p = i(51), v = i(13), m = i(27), y = i(437), k = i(38), T = i(59), w = i(45), C = i(304), S = i(41),
        b = i(29), I = s.default.getLogger("DKNativeFunction"), _ = u.DownloadKernelTaskManager.getTaskManager(),
        A = c.DownloadKernelEventManager.getEventManager(),
        D = h.DownloadKernelCategoryViewManager.getCategoryViewManager(),
        x = b.DownloadKernelCategoryManager.getCategoryManager();
    !function (e) {
        const t = new class {
            constructor() {
                this.isRegister = !1, A.attachTaskEvent(l.DownloadKernel.TaskEventType.DetailChanged, (...e) => {
                    this.onTaskDetailChanged(...e)
                }), A.attachTaskEvent(l.DownloadKernel.TaskEventType.StatusChanged, (...e) => {
                    this.onTaskStatusChanged(...e)
                }), A.attachTaskEvent(l.DownloadKernel.TaskEventType.DcdnStatusChanged, (...e) => {
                    this.onTaskDcdnStatusChanged(...e)
                }), A.attachTaskEvent(l.DownloadKernel.TaskEventType.BtSubFileDetailChanged, (...e) => {
                    this.onBtSubFileDetailChanged(...e)
                }), A.attachTaskEvent(l.DownloadKernel.TaskEventType.BtSubFileLoaded, (...e) => {
                    this.onBtSubFileLoaded(...e)
                }), A.attachTaskEvent(l.DownloadKernel.TaskEventType.BtSubFileForbidden, (...e) => {
                    this.onBtSubFileForbidden(...e)
                }), A.attachTaskEvent(l.DownloadKernel.TaskEventType.BtSubFileDcdnStatusChanged, (...e) => {
                    this.onBtSubFileDcdnStatusChanged(...e)
                }), A.attachTaskEvent(l.DownloadKernel.TaskEventType.InsertToCategoryView, (...e) => {
                    this.onTaskInserted(...e)
                }), A.attachTaskEvent(l.DownloadKernel.TaskEventType.RemoveFromCategoryView, (...e) => {
                    this.onTaskRemoved(...e)
                }), A.attachTaskEvent(l.DownloadKernel.TaskEventType.TaskCategoryMovedEnd, (...e) => {
                    this.onTaskCategoryMovedEnd(...e)
                }), d.DownloadKernelManager.attachListener(v.NodeEventMesssageNS.eventGlobalDownloadSpeedChanged, (...e) => {
                    this.onGlobalDownloadSpeedChanged(...e)
                }), m.default.attachListener(v.NodeEventMesssageNS.eventDownloadItemActive, this.onDownloadItemActive.bind(this)), m.default.attachListener(v.NodeEventMesssageNS.eventDownloadItemChosen, this.onDownloadItemChosen.bind(this))
            }

            registerPluginFunction() {
                if (!this.isRegister) {
                    this.isRegister = !0;
                    let e = {
                        GetTaskBaseInfo: this.getTaskBaseInfo,
                        GetTaskBaseInfo2: this.getTaskBaseInfo2,
                        GetTaskBaseInfos: this.getTaskBaseInfos,
                        GetTaskStatus: this.getTaskStatus,
                        IsTaskExist: this.isTaskExist,
                        EnableDcdnWithVipCert: this.enableDcdnWithVipCert,
                        UpdateDcdnWithVipCert: this.updateDcdnWithVipCert,
                        DisableDcdnWithVipCert: this.disableDcdnWithVipCert,
                        GetTpPeerId: this.getPeerId,
                        ExecSqlite: this.execSqlite,
                        QuerySqlite: this.querySqlite,
                        GetCategoryViewTaskList: this.getCategoryViewTaskList,
                        GetCategoryViewTaskListForSuspensionWnd: this.getCategoryViewTaskListForSuspensionWnd,
                        IsLoadStorageTaskFinish: this.isLoadStorageTaskFinish,
                        SetTaskExtStat: this.setTaskExtStat,
                        DownloadBySDK: this.asynRequestFile,
                        QueryGlobalInfo: this.queryGlobalInfo,
                        IsFileSizeSetterWorking: this.isFileSizeSetterWorking,
                        LaunchFileAssistant: this.launchFileAssistant,
                        GetTaskProfileLog: this.getTaskProfileLog,
                        GetSubNetUploader: this.getSubNetUploader,
                        GetPrivateSpaceInfo: this.getPrivateSpaceInfo,
                        IsSingleBtTask: this.isSingleBtTask,
                        IsSupportPlay: this.isSupportPlay,
                        IsSupportInstall: this.isSupportInstall,
                        ImportTorrent: this.importTorrent,
                        GetDownloadProgress: this.getDownloadProgressPercent,
                        GetDownloadProgressNumber: this.getDownloadProgress,
                        CreateTask: this.createTask,
                        CreateBatchTask: this.createBatchTask,
                        StartTask: this.startTask,
                        StartWaitingTask: this.startWaitingTask,
                        StopTask: this.stopTask,
                        DeleteTask: this.deleteTask,
                        RemoveToRecycle: this.removeToRecycle,
                        RecoverFromRecycle: this.recoverFromRecycle,
                        BatchStartTask: this.batchStartTask,
                        BatchStartWaitingTask: this.batchStartWaitingTask,
                        BatchStopTask: this.batchStopTask,
                        BatchDeleteTask: this.batchDeleteTask,
                        BatchRemoveToRecycle: this.batchRemoveToRecycle,
                        BatchRecoverFromRecycle: this.batchRecoverFromRecycle,
                        BatchFindTaskAsync: this.batchFindTaskAsync,
                        IsCategoryLoaded: this.isCategoryLoaded,
                        GetCategoryFromUserId: this.getCategoryFromUserId,
                        GetCategoryById: this.getCategoryById,
                        GetCategoryByName: this.getCategoryByName,
                        GetCategoryTaskCount: this.getCategoryTaskCount,
                        GetCategoryTaskList: this.getCategoryTaskList,
                        AddServer: this.addServer,
                        DiscardServer: this.discardServer,
                        GetUserData: this.getUserData,
                        SetUserData: this.setUserData
                    };
                    a.server.registerFunctions(e)
                }
            }

            getTaskBaseInfo(e, t, ...i) {
                let n = void 0;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (!i || !i[0]) break;
                    let t = i[0], a = _.getTaskFromTaskId(t);
                    if (a) {
                        let e = a.getTaskBaseInfo();
                        n = JSON.stringify(e)
                    }
                } while (0);
                return n
            }

            getTaskBaseInfo2(e, t, ...i) {
                let n = null;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (!i || !i[0]) break;
                    let t = i[0], a = _.getTaskFromTaskId(t);
                    a && (n = a.getTaskBaseInfo())
                } while (0);
                return n
            }

            getTaskBaseInfos(e, t, ...i) {
                let n = [];
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (!i || !r.isArray(i[0])) break;
                    i[0].forEach(e => {
                        let t = _.getTaskFromTaskId(e);
                        if (t) {
                            let e = t.getTaskBaseInfo();
                            n.push(e)
                        }
                    })
                } while (0);
                return n
            }

            getTaskStatus(e, t, ...i) {
                let n = void 0;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (!i || !i[0]) break;
                    let t = i[0], a = _.getTaskFromTaskId(t);
                    a && (n = a.getTaskStatus())
                } while (0);
                return n
            }

            isTaskExist(e, t, ...i) {
                let n = !1;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (!i || !i[0]) break;
                    let t = i[0];
                    _.getTaskFromTaskId(t) && (n = !0)
                } while (0);
                return n
            }

            enableDcdnWithVipCert(e, t, ...i) {
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (!i || !i[0] || !i[1]) break;
                    let t = i[0], n = _.getTaskFromTaskId(t);
                    if (n) {
                        let e = -1;
                        r.isNumber(i[2]) && (e = i[2]), n.enableDcdnWithVipCert(i[1], e)
                    }
                } while (0)
            }

            updateDcdnWithVipCert(e, t, ...i) {
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (!i || !i[0] || !i[1]) break;
                    let t = i[0], n = _.getTaskFromTaskId(t);
                    if (n) {
                        let e = -1;
                        r.isNumber(i[2]) && (e = i[2]), n.updateDcdnWithVipCert(i[1], e)
                    }
                } while (0)
            }

            disableDcdnWithVipCert(e, t, ...i) {
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (!i || !i[0]) break;
                    let t = i[0], n = _.getTaskFromTaskId(t);
                    if (n) {
                        let e = -1;
                        r.isNumber(i[1]) && (e = i[1]), n.disableDcdnWithVipCert(e)
                    }
                } while (0)
            }

            getPeerId(e, t, ...i) {
                return new Promise(t => {
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        I.verbose(i), d.DownloadKernelManager.getPeerId().then(e => {
                            t(e)
                        }).catch()
                    } while (0)
                })
            }

            execSqlite(e, t, ...i) {
                return new Promise(t => {
                    do {
                        if (r.isNullOrUndefined(e)) {
                            t(-1);
                            break
                        }
                        if (!i || !i[0]) {
                            t(-2);
                            break
                        }
                        f.ThunderKernel.execSqlite(i[0], e => {
                            t(e)
                        })
                    } while (0)
                })
            }

            querySqlite(e, t, ...i) {
                return new Promise(t => {
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        if (!i || !i[0]) break;
                        f.ThunderKernel.querySqlite(i[0], e => {
                            t(e)
                        })
                    } while (0)
                })
            }

            getCategoryViewTaskList(e, t, ...i) {
                let n = [];
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (!i || !i[0]) break;
                    let t = D.getCategoryViewFromId(i[0]);
                    if (!t) break;
                    let a = t.getTasks();
                    if (a) for (let e of a) {
                        let t = e[0];
                        n.push(t)
                    }
                } while (0);
                return n
            }

            getCategoryViewTaskListForSuspensionWnd(e, t, ...i) {
                let n = void 0;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (!i || !i[0]) break;
                    let t = D.getCategoryViewFromId(i[0]);
                    if (!t) break;
                    {
                        let e = t.getTasks();
                        if (e) {
                            n = [];
                            for (let [, t]of e) {
                                let e = t.getTaskBaseInfo();
                                n.push(e)
                            }
                        }
                    }
                } while (0);
                return n
            }

            isLoadStorageTaskFinish(e, t, ...i) {
                return new Promise(e => {
                    d.DownloadKernelManager.attachListener(v.NodeEventMesssageNS.eventTaskDataBaseLoadEnd, () => {
                        e(!0)
                    })
                })
            }

            setTaskExtStat(e, t, ...i) {
                let n = void 0, a = i[0], o = _.getTaskFromTaskId(a);
                if (o) {
                    let e = i[1], t = i[2], a = i[3], r = o.getTaskAttribute(l.DownloadKernel.TaskAttribute.VirtualId);
                    n = f.ThunderKernel.setTaskExtStat(r, e, t, a)
                }
                return n
            }

            asynRequestFile(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    {
                        if (!i) throw new Error("call AsynRequestFile expected args which is undefined");
                        let e = i[0];
                        if (!e.url) throw new Error("call AsynRequestFile expected url which is undefined");
                        if (!e.savePath) throw new Error("call AsynRequestFile expected savePath which is undefined");
                        if (!e.fileName) throw new Error("call AsynRequestFile expected fileName which is undefined");
                        let t = i[1];
                        return t && (e.onTaskFinish = t), y.sdkDownloader.createTaskBySDK(e)
                    }
                })
            }

            queryGlobalInfo(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    return new Promise(e => {
                        f.ThunderKernel.queryGlobalInfo(0, t => {
                            e(t)
                        })
                    })
                })
            }

            isFileSizeSetterWorking(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    return new Promise(e => {
                        0 !== f.ThunderKernel.isFileSizeSetterWorking(t => {
                            e(t)
                        }) && e(!1)
                    })
                })
            }

            launchFileAssistant(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    return new Promise(e => {
                        let t = f.ThunderKernel.launchFileAssistant(t => {
                            e(t)
                        });
                        0 !== t && e(t)
                    })
                })
            }

            getTaskProfileLog(e, t, ...i) {
                let n = -1;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (r.isNullOrUndefined(i) || r.isNullOrUndefined(i[0]) || r.isNullOrUndefined(i[1])) break;
                    let t = i[0], a = _.getTaskFromTaskId(t);
                    if (a) {
                        let e = i[1], t = a.getTaskAttribute(l.DownloadKernel.TaskAttribute.VirtualId);
                        n = f.ThunderKernel.getTaskProfileLog(t, e, (e, t) => {
                            null !== i[2] && void 0 !== i[2] && (0, i[2])()
                        })
                    }
                } while (0);
                return n
            }

            getSubNetUploader(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = null;
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        t = yield new Promise(e => {
                            0 !== f.ThunderKernel.getSubNetUploader((t, i) => n(this, void 0, void 0, function* () {
                                I.information("getSubNetUploader result", t, i), 0 === t && e(i)
                            })) && e(null)
                        })
                    } while (0);
                    return t
                })
            }

            getPrivateSpaceInfo(e, t, ...i) {
                let n = !0, a = x.getCurrentPrivateCategory();
                if (a) {
                    let e = a.getPassword();
                    e && "" !== e && (n = !0)
                }
                return {privateOpen: n, currentCategoryId: m.default.getCurrentCategoryId()}
            }

            isSingleBtTask(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let e = i[0], t = _.getTaskFromTaskId(e);
                    return yield w.SingleBtTaskNS.isSingleBtTask(t)
                })
            }

            isSupportPlay(e, t, ...i) {
                let n = !1;
                do {
                    if (!i[0]) break;
                    let e = i[0], t = _.getTaskFromTaskId(e);
                    t && (n = t.isSupportPlay())
                } while (0);
                return n
            }

            isSupportInstall(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let e = {support: !1};
                    do {
                        if (!i[0]) break;
                        let t = i[0], n = _.getTaskFromTaskId(t);
                        if (!n) break;
                        if (n.getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskType) === l.DownloadKernel.TaskType.Group) {
                            let i = n.getExtraObject(),
                                a = i.getUserData(p.TaskUserDataGUID.guidDownloadCompleteInstall, "installFile");
                            if (a && "0" !== a) {
                                let n = S.TaskCtrlOperatorNS.getSavePathByFileName(t, a);
                                if (yield g.FileSystemAWNS.existsAW(n)) {
                                    e = {
                                        support: !0,
                                        savePath: n,
                                        runParams: i.getUserData(p.TaskUserDataGUID.guidDownloadCompleteRunParams, "runParams")
                                    };
                                    break
                                }
                            }
                        }
                    } while (0);
                    return e
                })
            }

            importTorrent(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let e = i[0], t = yield o.client.callServerFunction("ShowOpenDialog", {
                        properties: ["openFile"],
                        filters: [{name: "BT种子文件（*.torrent）", extensions: ["torrent"]}]
                    });
                    if (void 0 !== t) {
                        let i = t[0], n = yield T.TaskUtilitiesAWNS.parserBtFileInfoAW(i);
                        if (null === n) k.ThunderNewTask.createBtTaskWindow({
                            type: "file",
                            seedFile: i
                        }, {source: e}); else {
                            let t = JSON.stringify(n);
                            k.ThunderNewTask.createBtTaskWindow({data: t, type: "file", seedFile: i}, {source: e})
                        }
                    }
                    return t
                })
            }

            getDownloadProgressPercent(e, t, ...i) {
                return C.DownloadProgressNS.getDownloadProgressPercent()
            }

            getDownloadProgress(e, t, ...i) {
                return C.DownloadProgressNS.getDownloadProgress()
            }

            createTask(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = void 0;
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        if (i.length < 2 || !r.isNumber(i[0]) || !r.isObject(i[1])) {
                            I.warning("createTask failed, args invalid! (TaskType: number, newTaskInfo: INewTaskInfo) => Promise<number>", i);
                            break
                        }
                        let n = i[0], a = i[1], o = yield _.createTask(n, a);
                        if (!o) break;
                        t = o.getId()
                    } while (0);
                    return t
                })
            }

            createBatchTask(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = null;
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        if (i.length < 1 || !r.isArray(i[0])) {
                            I.warning("createBatchTask failed, args invalid! (newTaskInfos: INewTaskInfo[], groupTaskId?: number) => Promise<number[]>", i);
                            break
                        }
                        let n = i[0], a = null;
                        if (i.length >= 2 && r.isNumber(i[1])) {
                            let e = i[1];
                            a = _.getTaskFromTaskId(e)
                        }
                        let o = yield _.createBatchTask(n, a);
                        if (!o) break;
                        t = [], o.forEach(e => {
                            t.push(e.getId())
                        })
                    } while (0);
                    return t
                })
            }

            startTask(e, t, ...i) {
                let n = !1;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (i.length < 1 || !r.isNumber(i[0])) {
                        I.warning("startTask failed, args invalid! (taskId: number) => void", i);
                        break
                    }
                    let t = i[0];
                    n = _.startTask(t)
                } while (0);
                return n
            }

            startWaitingTask(e, t, ...i) {
                let n = !1;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (i.length < 1 || !r.isNumber(i[0])) {
                        I.warning("startWaitingTask failed, args invalid! (taskId: number) => boolean", i);
                        break
                    }
                    let t = i[0];
                    n = _.startWaitingTask(t)
                } while (0);
                return n
            }

            stopTask(e, t, ...i) {
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (i.length < 1 || !r.isNumber(i[0])) {
                        I.warning("stopTask failed, args invalid! (taskId: number, stopReason?: TaskStopReason) => void", i);
                        break
                    }
                    let t = i[0], n = l.DownloadKernel.TaskStopReason.Unknown;
                    i.length >= 2 && r.isNumber(i[1]) && (n = i[1]), _.stopTask(t, n)
                } while (0)
            }

            deleteTask(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = !1;
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        if (i.length < 1 || !r.isNumber(i[0]) || !r.isBoolean(i[1])) {
                            I.warning("deleteTask failed, args invalid! (taskId: number, deleteFile: boolean) => Promise<boolean>", i);
                            break
                        }
                        let n = i[0], a = i[1];
                        t = yield _.deleteTask(n, a)
                    } while (0);
                    return t
                })
            }

            removeToRecycle(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        if (i.length < 1 || !r.isNumber(i[0])) {
                            I.warning("removeToRecycle failed, args invalid! (taskId: number) => Promise<void>", i);
                            break
                        }
                        let t = i[0];
                        yield _.removeToRecycle(t)
                    } while (0)
                })
            }

            recoverFromRecycle(e, t, ...i) {
                let n = !1;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (i.length < 1 || !r.isNumber(i[0])) {
                        I.warning("recoverFromRecycle failed, args invalid! (taskId: number) => Promise<boolean>", i);
                        break
                    }
                    let t = i[0];
                    n = _.recoverFromRecycle(t)
                } while (0);
                return n
            }

            batchStartTask(e, t, ...i) {
                let n = !1;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (i.length < 1 || !r.isArray(i[0])) {
                        I.warning("batchStartTask failed, args invalid! (taskId: number) => void", i);
                        break
                    }
                    n = !0, i[0].forEach(e => {
                        n = _.startTask(e) && n
                    })
                } while (0);
                return n
            }

            batchStartWaitingTask(e, t, ...i) {
                let n = !1;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (i.length < 1 || !r.isArray(i[0])) {
                        I.warning("batchStartWaitingTask failed, args invalid! (taskIds: number[]) => boolean", i);
                        break
                    }
                    let t = i[0];
                    n = _.startWaitingTasks(t)
                } while (0);
                return n
            }

            batchStopTask(e, t, ...i) {
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (i.length < 1 || !r.isArray(i[0])) {
                        I.warning("stopTask failed, args invalid! (taskIds: number[], stopReason?: TaskStopReason) => void", i);
                        break
                    }
                    let t = i[0], n = l.DownloadKernel.TaskStopReason.Unknown;
                    i.length >= 2 && r.isNumber(i[1]) && (n = i[1]), _.batchStopTask(t, n)
                } while (0)
            }

            batchDeleteTask(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = !1;
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        if (i.length < 1 || !r.isArray(i[0]) || !r.isBoolean(i[1])) {
                            I.warning("batchDeleteTask failed, args invalid! (taskIds: number[], deleteFile: boolean) => Promise<boolean>", i);
                            break
                        }
                        let n = i[0], a = i[1];
                        t = yield _.deleteBatchTask(n, a)
                    } while (0);
                    return t
                })
            }

            batchRemoveToRecycle(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        if (i.length < 1 || !r.isArray(i[0])) {
                            I.warning("batchRemoveToRecycle failed, args invalid! (taskIds: number[]) => Promise<void>", i);
                            break
                        }
                        let t = i[0];
                        yield _.batchRemoveToRecycle(t)
                    } while (0)
                })
            }

            batchRecoverFromRecycle(e, t, ...i) {
                let n = !1;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (i.length < 1 || !r.isArray(i[0])) {
                        I.warning("batchRecoverFromRecycle failed, args invalid! (taskIds: number[]) => boolean", i);
                        break
                    }
                    let t = i[0];
                    _.batchRecoverFromRecycle(t), n = !0
                } while (0);
                return n
            }

            batchFindTaskAsync(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = [];
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        if (i.length < 1 || !r.isArray(i[0])) {
                            I.warning("batchFindTaskAsync failed, args invalid! (keyInfos: IKeyInfo[]) => Promise<ITaskBase[]>", i);
                            break
                        }
                        let n = i[0], a = yield _.batchFindTaskAsync(n);
                        if (!a) break;
                        a.forEach(e => {
                            t.push(e.getTaskBaseInfo())
                        })
                    } while (0);
                    return t
                })
            }

            isCategoryLoaded(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (r.isNullOrUndefined(e)) break;
                        yield x.init()
                    } while (0);
                    return !0
                })
            }

            getCategoryFromUserId(e, t, ...i) {
                let n = null;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (i.length < 2 || !r.isString(i[0]) || !r.isString(i[1])) {
                        I.warning("getCategoryFromUserId failed, args invalid! (categoryName: string, userId: string) => ICategoryData[]", i);
                        break
                    }
                    let t = i[0], a = i[1], o = void 0;
                    i.length >= 3 && (o = i[2]);
                    let s = x.getCategoryFromUserId(t, a, o);
                    s && (n = s.getCategoryData())
                } while (0);
                return n
            }

            getCategoryById(e, t, ...i) {
                let n = null;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (i.length < 1 || !r.isNumber(i[0])) {
                        I.warning("getCategoryById failed, args invalid! (categoryId: number) => ICategoryData", i);
                        break
                    }
                    let t = i[0], a = x.getCategoryFromId(t);
                    a && (n = a.getCategoryData())
                } while (0);
                return n
            }

            getCategoryByName(e, t, ...i) {
                let n = [];
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (i.length < 1 || !r.isString(i[0])) {
                        I.warning("getCategoryByName failed, args invalid! (categoryName: string) => ICategoryData[]", i);
                        break
                    }
                    let t = i[0], a = x.getCategoryByName(t);
                    a && a.size > 0 && a.forEach(e => {
                        n.push(e.getCategoryData())
                    })
                } while (0);
                return n
            }

            getCategoryTaskCount(e, t, ...i) {
                let n = 0;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (i.length < 2 || !r.isNumber(i[0]) || !r.isString(i[1])) {
                        I.warning("getCategoryTaskCount failed, args invalid! (categoryId: number, categoryViewId: CategoryViewID) => number", i);
                        break
                    }
                    let t = i[0], a = i[1], o = x.getCategoryFromId(t);
                    if (!o) break;
                    let s = o.getCategoryViewFromId(a);
                    if (!s) break;
                    n = s.getTaskCount()
                } while (0);
                return n
            }

            getCategoryTaskList(e, t, ...i) {
                let n = [];
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (i.length < 2 || !r.isNumber(i[0]) || !r.isString(i[1])) {
                        I.warning("getCategoryTaskList failed, args invalid! (categoryId: number, categoryViewId: CategoryViewID) => Promise<number[]>", i);
                        break
                    }
                    let t = i[0], a = i[1], o = x.getCategoryFromId(t);
                    if (!o) break;
                    let s = o.getCategoryViewFromId(a);
                    if (!s) break;
                    let l = s.getTasks();
                    if (!l) break;
                    l.forEach(e => {
                        n.push(e.getId())
                    })
                } while (0);
                return n
            }

            addServer(e, t, ...i) {
                let n = !1;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (i.length < 3 || !r.isNumber(i[0]) || !r.isNumber(i[1]) || !r.isObject(i[2])) {
                        I.warning("addServer failed, args invalid! (taskId: number, fileIndex: number, serverResourceInfo: IXLServerResourceInfo) => boolean", i);
                        break
                    }
                    let t = i[0], a = i[1], o = i[2], s = _.getTaskFromTaskId(t);
                    if (!s) break;
                    s.addServer(a, o), n = !0
                } while (0);
                return n
            }

            discardServer(e, t, ...i) {
                let n = !1;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (i.length < 3 || !r.isNumber(i[0]) || !r.isNumber(i[1]) || !r.isString(i[2])) {
                        I.warning("discardServer failed, args invalid! (taskId: number, fileIndex: number, url: string) => boolean", i);
                        break
                    }
                    let t = i[0], a = i[1], o = i[2], s = _.getTaskFromTaskId(t);
                    if (!s) break;
                    s.discardServer(a, o), n = !0
                } while (0);
                return n
            }

            getUserData(e, t, ...i) {
                let n = void 0;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (i.length < 2 || !r.isNumber(i[0]) || !r.isString(i[1])) {
                        I.warning("getUserData failed, args invalid! (taskId: number, guid: string, key?: string) => string | number | {[key: string]: any}", i);
                        break
                    }
                    let t = i[0], a = _.getTaskFromTaskId(t);
                    if (!a) break;
                    let o = i[1], s = i[2], l = a.getExtraObject().getUserData(o, s);
                    if (r.isNullOrUndefined(l)) break;
                    if (r.isNumber(l) || r.isString(l)) n = l; else if (r.isArray(l)) {
                        let e = l, t = [];
                        for (let i = 0; i < e.length; ++i) t.push(e[i].toJs());
                        n = t
                    } else if (r.isObject(l)) {
                        let e = {};
                        l.forEach(function (t, i) {
                            e[i] = t.toJs()
                        }), n = e
                    }
                } while (0);
                return n
            }

            setUserData(e, t, ...i) {
                let n = !1;
                do {
                    if (r.isNullOrUndefined(e)) break;
                    if (i.length < 3 || !r.isNumber(i[0]) || !r.isString(i[1]) || !r.isString(i[2]) || !r.isString(i[3]) && !r.isNumber(i[3]) && !r.isObject(i[3])) {
                        I.warning("setUserData failed, args invalid! (taskId: number, guid: string, key: string, value: string | number | {[key: string]: any}) => boolean", i);
                        break
                    }
                    let t = i[0], a = _.getTaskFromTaskId(t);
                    if (!a) break;
                    let o = i[1], s = i[2], l = i[3];
                    n = a.getExtraObject().setUserData(o, s, l)
                } while (0);
                return n
            }

            onTaskDetailChanged(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== l.DownloadKernel.TaskEventType.DetailChanged) break;
                    if (!e[1] || !e[2]) break;
                    let t = e[1], i = e[2], n = {};
                    for (let e = 0; e < t.length; ++e) {
                        let i = t[e];
                        if (!i) continue;
                        let a = i.getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskId), o = i.getTaskBaseInfo();
                        n[a] = o
                    }
                    a.server.fireClientEvent("OnTaskDetailChanged", JSON.stringify(n), i)
                } while (0)
            }

            onTaskStatusChanged(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== l.DownloadKernel.TaskEventType.StatusChanged) break;
                    if (!e[1]) break;
                    let t = e[1], i = {};
                    for (let e = 0; e < t.length; ++e) {
                        let n = t[e];
                        if (!n) continue;
                        let a = n.getTaskStatus();
                        i[n.getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskId)] = a
                    }
                    a.server.fireClientEvent("OnTaskStatusChanged", JSON.stringify(i))
                } while (0)
            }

            onTaskDcdnStatusChanged(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== l.DownloadKernel.TaskEventType.DcdnStatusChanged) break;
                    if (!e[1]) break;
                    let t = e[1], i = {};
                    for (let e = 0; e < t.length; ++e) {
                        let n = t[e];
                        if (!n) continue;
                        let a = n.getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskId),
                            o = n.getTaskChannelInfo().dcdnStatus;
                        i[a] = o
                    }
                    a.server.fireClientEvent("OnTaskDcdnStatusChanged", JSON.stringify(i))
                } while (0)
            }

            onBtSubFileDetailChanged(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== l.DownloadKernel.TaskEventType.BtSubFileDetailChanged) break;
                    if (!e[1] || !e[2]) break;
                    let t = e[1], i = _.getTaskFromTaskId(t);
                    if (!i) break;
                    let n = e[2], o = i.getTaskBaseInfo();
                    a.server.fireClientEvent("OnBtSubFileDetailChanged", t, JSON.stringify(n), JSON.stringify(o))
                } while (0)
            }

            onBtSubFileLoaded(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== l.DownloadKernel.TaskEventType.BtSubFileLoaded) break;
                    if (!e[1] || !e[2]) break;
                    let t = e[1], i = e[2], n = _.getTaskFromTaskId(t);
                    if (!n) break;
                    let o = n.getTaskBaseInfo();
                    a.server.fireClientEvent("OnBtSubFileLoaded", t, JSON.stringify(i), JSON.stringify(o))
                } while (0)
            }

            onBtSubFileForbidden(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== l.DownloadKernel.TaskEventType.BtSubFileForbidden) break;
                    if (!e[1] || !e[2]) break;
                    let t = e[1], i = e[2];
                    a.server.fireClientEvent("OnBtSubFileForbidden", t, i)
                } while (0)
            }

            onBtSubFileDcdnStatusChanged(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== l.DownloadKernel.TaskEventType.BtSubFileDcdnStatusChanged) break;
                    if (!e[1] || null === e[2] || void 0 === e[2] || null === e[3] || void 0 === e[3] || null === e[4] || void 0 === e[4]) break;
                    let t = e[1], i = e[2], n = e[3], o = e[4];
                    a.server.fireClientEvent("OnBtSubFileDcdnStatusChanged", t, i, n, o)
                } while (0)
            }

            onTaskInserted(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== l.DownloadKernel.TaskEventType.InsertToCategoryView) break;
                    if (void 0 === e[1] || !e[2] || !e[3]) break;
                    let t = e[1], i = e[2], n = e[3], o = [];
                    for (let e = 0; e < n.length; ++e) {
                        let t = n[e].getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskId);
                        o.push(t)
                    }
                    let r = JSON.stringify(o);
                    a.server.fireClientEvent("OnTaskInserted", t, i, r)
                } while (0)
            }

            onTaskRemoved(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== l.DownloadKernel.TaskEventType.RemoveFromCategoryView) break;
                    if (void 0 === e[1] || !e[2] || !e[3]) break;
                    let t = e[1], i = e[2], n = e[3], o = [];
                    for (let e = 0; e < n.length; ++e) {
                        let t = n[e].getTaskAttribute(l.DownloadKernel.TaskAttribute.TaskId);
                        o.push(t)
                    }
                    let r = JSON.stringify(o);
                    a.server.fireClientEvent("OnTaskRemoved", t, i, r)
                } while (0)
            }

            onTaskCategoryMovedEnd(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== l.DownloadKernel.TaskEventType.TaskCategoryMovedEnd) break;
                    if (!e[1]) break;
                    let t = e[1], i = [];
                    for (let e of t) if (e) {
                        let t = e.getTaskBaseInfo();
                        i.push(t)
                    }
                    let n = JSON.stringify(i);
                    a.server.fireClientEvent("OnTaskCategoryMovedEnd", n)
                } while (0)
            }

            onGlobalDownloadSpeedChanged(...e) {
                let t = d.DownloadKernelManager.getTotalTaskDownloadSpeed(!1, !1),
                    i = d.DownloadKernelManager.getTotalTaskVipSpeed(!1, !1);
                a.server.fireClientEvent("OnGlobalDownloadSpeedChanged", t, i)
            }

            onDownloadItemActive(e, t, i, n, o, r) {
                if (n && t) {
                    let s = n.__vue__;
                    s ? s.$nextTick(() => {
                        I.information("active fire", t, i), a.server.fireClientEvent("OnDownloadItemActive", e, t, i, o, r)
                    }) : a.server.fireClientEvent("OnDownloadItemActive", e, t, i, o, r)
                } else a.server.fireClientEvent("OnDownloadItemActive", e, t, i, o, r)
            }

            onDownloadItemChosen(e, t, i, n) {
                a.server.fireClientEvent("OnDownloadItemChosen", e, i, t, n)
            }
        };
        e.registerPluginFunction = function () {
            t.registerPluginFunction()
        }
    }(t.DkPluginFunctionNS || (t.DkPluginFunctionNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        e.contextMenuDownloadImportUncomplete = "context_menu_download_import_uncompleted", e.contextMenuDownloadFolder = "context_menu_download_folder", e.contextMenuGroupAccelerate = "context_menu_group_accelerate", e.contxtMenuSubtitleSearch = "context_menu_subtitle_search", e.contextMenuDownloadStart = "context_menu_download_start", e.contextMenuDownloadPause = "context_menu_download_pause", e.contextMenuDownloadStartAll = "context_menu_download_start_all", e.contextMenuDownloadPauseAll = "context_menu_download_pause_all", e.contextMenuDownloadDelete = "context_menu_download_delete", e.contextMenuDownloadDestroy = "context_menu_download_destroy", e.contextMenuDownloadMoveFilePrivateSpace = "context_menu_download_move_file_private_space", e.contextMenuDownloadMoveFileOutPrivateSpace = "context_menu_download_move_file_out_private_space", e.contextMenuDownloadMoveFileOther = "context_menu_download_move_file_other", e.contextMenuDownloadMoveFileLastest = "context_menu_download_move_file_lastest", e.contextMenuDownloadMoveTop = "context_menu_download_move_top", e.contextMenuDownloadMoveBottom = "context_menu_download_move_bottom", e.contextMenuDownloadMerge = "context_menu_download_merge", e.contextMenuDownloadVipAcc = "context_menu_download_vip_acc", e.contextMenuDownloadCopyLink = "context_menu_download_copy_link", e.contextMenuDownloadTorrentSaveAs = "context_menu_download_torrent_save_as", e.contextMenuDownloadCopyMagnet = "context_menu_download_copy_magnet", e.contextMenuPlayFile = "context_menu_play_file", e.contextMenuDownloadFile = "context_menu_download_file", e.contextMenuDownloadOpenAs = "context_menu_download_open_as", e.contextMenuDownloadRename = "context_menu_download_rename", e.contextMenuDownloadCopyFileLastest = "context_menu_download_copy_file_lastest", e.contextMenuDownloadCopyFileOther = "context_menu_download_copy_file_other", e.contextMenuDownloadRedownload = "context_menu_download_redownload", e.contextMenuDownloadRecover = "context_menu_download_recover", e.contextMenuDownloadClear = "context_menu_download_clear", e.contextMenuDownloadByShoulei = "context_menu_download_shoulei", e.contextMenuDownloadShare = "context_menu_download_share", e.contextMenuDownloadSelectAll = "context_menu_download_select_all", e.contextMenuDownloadDeleteNonexisting = "context_menu_download_delete_non_existing", e.contextMenuDownloadAsReadedAll = "context_menu_download_as_readed_all", e.contextMenuToolbarMoreOpenSearch = "context_menu_toolbar_more_opensearch", e.contextMenuToolbarMoreOpenHelp = "context_menu_toolbar_more_openhelp", e.contextMenuToolbarMoreDestroy = "context_menu_toolbar_more_destroy", e.contextMenuToolbarMoreConfig = "context_menu_toolbar_more_config", e.contextMenuToolbarMoreSortByDefault = "context_menu_toolbar_more_sort_default", e.contextMenuToolbarMoreSortByTime = "context_menu_toolbar_more_sort_time", e.contextMenuToolbarMoreSortByType = "context_menu_toolbar_more_sort_type", e.contextMenuToolbarMoreSortByName = "context_menu_toolbar_more_sort_name", e.contextMenuToolbarMoreSortBySize = "context_menu_toolbar_more_sort_size", e.contextMenuToolbarMoreSortByStatus = "context_menu_toolbar_more_sort_status", e.contextMenuToolbarMoreSortByProgress = "context_menu_toolbar_more_sort_progress", e.contextMenuTabChangeCategoryMyComputer = "context_menu_tab_change_category_mycomputer", e.contextMenuTabChangeCategoryPrivateSpace = "context_menu_tab_change_category_privatespace", e.contextMenuToolbarPrivateSpaceSelectAll = "context_menu_toolbar_privatespace_select_all", e.contextMenuToolbarPrivateSpaceDownloadSetting = "context_menu_toolbar_privatespace_download_setting", e.contextMenuToolbarPrivateSpacePasswwordChange = "context_menu_toolbar_privatespace_passwword_change", e.contextMenuToolbarPrivateSpaceTaskManager = "context_menu_toolbar_privatespace_download_task_manager", e.contextMenuOpenTaskPosition = "context_menu_search_openfile_position", e.contextMenuShouleiFileTransfer = "context_menu_shoulei_file_transfer", e.contextMenuPanUpload = "context_menu_pan_upload", e.contextMenuPanAddLink = "context_menu_pan_add_link", e.contextMenuPanAddBt = "context_menu_pan_add_Bt", e.contextMenuPanCreateFolder = "context_menu_pan_create_folder"
    }(t.ContextMenuIdsNS || (t.ContextMenuIdsNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(20), o = i(7), r = i(0), s = i(4), l = i(14), d = i(327), u = i(442), c = i(444), h = i(329), f = i(22),
        g = i(25), p = i(2), v = i(6), m = r.default.getLogger("SkinNaviteFunction"),
        y = v.default(p.join(__rootDir, "../bin/ThunderHelper.node"));
    !function (e) {
        const t = new class {
            constructor() {
                this.isRegister = !1, d.default.on("changeSkin", this.onChangeSkin), u.default.on("changeSkin", this.onChangeSpeedCurveSkin), c.default.on("changeSkin", this.onChangeSuspensionSkin)
            }

            registerPluginFunction() {
                if (!this.isRegister) {
                    this.isRegister = !0;
                    let e = {
                        GetSkinInfo: this.getSkinInfo,
                        SetSkinInfo: this.setSkinInfo,
                        GetSpeedCurveSkinInfo: this.getSpeedCurveSkinInfo,
                        SetSpeedCurveSkinInfo: this.setSpeedCurveSkinInfo,
                        GetAllSpeedCurveSkinInfos: this.getAllSpeedCurveSkinInfos,
                        ClickSpeedCurveIcon: this.clickSpeedCurveIcon,
                        ShowIndividuation: this.showIndividuation,
                        GetSuspensionSkinInfo: this.getSuspensionSkinInfo,
                        SetSuspensionSkinInfo: this.setSuspensionSkinInfo,
                        GetSkinInfoDetail: this.getSkinInfoDetail,
                        SetShakeInfo: this.setShakeInfo,
                        GetShakeInfo: this.getShakeInfo
                    };
                    a.server.registerFunctions(e)
                }
            }

            getSkinInfo(e, t, ...i) {
                let n = null;
                do {
                    if (s.isNullOrUndefined(e)) break;
                    n = d.default.getSkinInfo(), m.information(n)
                } while (0);
                return n
            }

            setSkinInfo(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (s.isNullOrUndefined(e)) break;
                        if (s.isNullOrUndefined(i) || s.isNullOrUndefined(i[0])) break;
                        try {
                            yield d.default.setSkinInfo(i[0], i[1], i[2])
                        } catch (e) {
                            m.error(e);
                            break
                        }
                    } while (0)
                })
            }

            onChangeSkin(e, t) {
                do {
                    if (l.ThunderUtil.isUndef(e)) break;
                    m.information(e), a.server.fireClientEvent("OnChangeSkin", e, t)
                } while (0)
            }

            getSpeedCurveSkinInfo(e, t, ...i) {
                let n = null;
                do {
                    if (s.isNullOrUndefined(e)) break;
                    n = u.default.getSkinInfo(), m.information(n)
                } while (0);
                return n
            }

            setSpeedCurveSkinInfo(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (s.isNullOrUndefined(e)) break;
                        if (s.isNullOrUndefined(i) || s.isNullOrUndefined(i[0])) break;
                        try {
                            yield u.default.setSkinInfo(i[0], i[1], i[2])
                        } catch (e) {
                            m.error(e);
                            break
                        }
                    } while (0)
                })
            }

            getAllSpeedCurveSkinInfos(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = [];
                    do {
                        if (s.isNullOrUndefined(e)) break;
                        t = yield h.default.getSkins()
                    } while (0);
                    return t
                })
            }

            clickSpeedCurveIcon(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (s.isNullOrUndefined(e)) break;
                        try {
                            yield o.client.callServerFunction("ShowIndividuation", {
                                activeKey: "skin",
                                skinActiveKey: "speedcurve"
                            })
                        } catch (e) {
                            break
                        }
                    } while (0)
                })
            }

            onChangeSpeedCurveSkin(e, t, i) {
                do {
                    if (l.ThunderUtil.isUndef(e)) break;
                    m.information("onChangeSpeedCurveSkin", e), a.server.fireClientEvent("OnChangeSpeedCurveSkin", e, t, i)
                } while (0)
            }

            onChangeSuspensionSkin(e, t, i) {
                do {
                    if (l.ThunderUtil.isUndef(e)) break;
                    m.information("onChangeSuspensionSkin", e), a.server.fireClientEvent("OnChangeSuspensionSkin", e, t, i)
                } while (0)
            }

            showIndividuation(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let t = null;
                    do {
                        if (s.isNullOrUndefined(e)) break;
                        if (s.isNullOrUndefined(i)) break;
                        try {
                            t = yield f.MessageBox.customIndividuation("Individuation", Object.assign({
                                singleton: !0,
                                version: y.getFileVersion(p.join(__rootDir, "../../Thunder.exe")),
                                dynamicSkinVersion: g.default.getConfigInfo("dynamicSkinVersion")
                            }, i[0] || {}), {modal: !1, webPreferences: {webSecurity: !1}})
                        } catch (e) {
                            break
                        }
                    } while (0);
                    return t
                })
            }

            getSuspensionSkinInfo(e, t, ...i) {
                return c.default.getSkinInfo()
            }

            setSuspensionSkinInfo(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (!i || !i[0]) break;
                        yield c.default.setSkinInfo(i[0], i[1], i[2])
                    } while (0)
                })
            }

            getSkinInfoDetail(e, t, ...i) {
                return {skinInfo: d.default.getSkinInfo(), temp: d.default.getIsTemp()}
            }

            setShakeInfo(e, t, ...i) {
                a.server.fireClientEvent("OnChangeShake", i[0], i[1])
            }

            getShakeInfo(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    return yield d.default.getShakeInfo(i[0])
                })
            }
        };
        e.registerPluginFunction = function () {
            t.registerPluginFunction()
        }
    }(t.SkinPluginFunctionNS || (t.SkinPluginFunctionNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        e.colorList = [{id: 0}, {
            id: 1,
            defaultOpacity: .9,
            colors: {
                colorPreview: "196,208,232",
                colorAccordion: ["116,137,180", "116,137,180"],
                colorGradientBackground: ["191,207,230", "227,236,246"],
                colorGradientForeground: ["255,255,255", "255,255,255"],
                colorPrimary: "116,137,180",
                colorPrimaryControl1: "120,149,209",
                colorPrimaryControl2: "116,137,180",
                colorPrimaryControl3: "212,225,225",
                colorPrimaryControl4: "240,243,250",
                colorPrimaryGradient: ["168,187,226", "105,132,177"],
                colorPrimaryText: "56,66,77",
                colorSearch: "252,252,252",
                colorSecondary: "83,95,117"
            }
        }, {
            id: 2,
            defaultOpacity: .9,
            colors: {
                colorPreview: "159,204,255",
                colorAccordion: ["51,160,255", "91,179,255"],
                colorGradientBackground: ["217,236,255", "138,204,255"],
                colorGradientForeground: ["255,255,255", "255,255,255"],
                colorPrimary: "51,160,255",
                colorPrimaryControl1: "119,182,255",
                colorPrimaryControl2: "51,160,255",
                colorPrimaryControl3: "212,231,255",
                colorPrimaryControl4: "232,240,255",
                colorPrimaryGradient: ["0,137,226", "103,189,255"],
                colorPrimaryText: "73,91,104",
                colorSearch: "252,252,252",
                colorSecondary: "103,132,154"
            }
        }, {
            id: 3,
            defaultOpacity: .9,
            colors: {
                colorPreview: "255,187,128",
                colorAccordion: ["255,149,87", "255,149,87"],
                colorGradientBackground: ["255,210,142", "255,151,119"],
                colorGradientForeground: ["255,255,255", "255,255,255"],
                colorPrimary: "255,149,87",
                colorPrimaryControl1: "255,178,110",
                colorPrimaryControl2: "255,149,87",
                colorPrimaryControl3: "229,210,194",
                colorPrimaryControl4: "242,233,226",
                colorPrimaryGradient: ["255,176,39", "255,137,33"],
                colorPrimaryText: "97,64,47",
                colorSearch: "252,252,252",
                colorSecondary: "130,99,75"
            }
        }, {
            id: 4,
            defaultOpacity: .9,
            colors: {
                colorPreview: "150,200,158",
                colorAccordion: ["93,154,103", "93,154,103"],
                colorGradientBackground: ["171,207,158", "124,188,162"],
                colorGradientForeground: ["255,255,255", "255,255,255"],
                colorPrimary: "85,123,91",
                colorPrimaryControl1: "114,152,120",
                colorPrimaryControl2: "85,123,91",
                colorPrimaryControl3: "191,210,194",
                colorPrimaryControl4: "220,232,222",
                colorPrimaryGradient: ["84,123,81", "115,165,150"],
                colorPrimaryText: "67,74,61",
                colorSearch: "252,252,252",
                colorSecondary: "97,109,86"
            }
        }, {
            id: 5,
            defaultOpacity: .5,
            colors: {
                colorPreview: "47,73,141",
                colorAccordion: ["99,177,255", "121,175,244"],
                colorGradientBackground: ["56,76,140", "41,72,143"],
                colorGradientForeground: ["97,144,251", "19,34,75"],
                colorPrimary: "230,199,138",
                colorPrimaryControl1: "204,170,122",
                colorPrimaryControl2: "220,191,132",
                colorPrimaryControl3: "185,185,185",
                colorPrimaryControl4: "233,233,233",
                colorPrimaryGradient: ["111,150,255", "156,192,255"],
                colorPrimaryText: "230,207,161",
                colorSearch: "68,124,209",
                colorSecondary: "204,184,143"
            }
        }, {
            id: 6,
            defaultOpacity: .7,
            colors: {
                colorPreview: "65,17,17",
                colorAccordion: ["214,99,99", "214,99,99"],
                colorGradientBackground: ["72,29,29", "16,7,7"],
                colorGradientForeground: ["117,57,57", "30,22,22"],
                colorPrimary: "223,77,77",
                colorPrimaryControl1: "220,96,96",
                colorPrimaryControl2: "159,51,51",
                colorPrimaryControl3: "219,193,193",
                colorPrimaryControl4: "239,224,224",
                colorPrimaryGradient: ["255,86,86", "161,70,70"],
                colorPrimaryText: "235,197,197",
                colorSearch: "88,74,74",
                colorSecondary: "184,151,151"
            }
        }, {
            id: 7,
            defaultOpacity: .3,
            colors: {
                colorPreview: "75,65,129",
                colorAccordion: ["160,185,252", "103,155,207"],
                colorGradientBackground: ["29,90,151", "105,61,191"],
                colorGradientForeground: ["163,177,204", "0,0,0"],
                colorPrimary: "128,213,255",
                colorPrimaryControl1: "118,193,230",
                colorPrimaryControl2: "161,207,230",
                colorPrimaryControl3: "205,215,235",
                colorPrimaryControl4: "228,232,240",
                colorPrimaryGradient: ["142,163,245", "120,144,222"],
                colorPrimaryText: "184,197,204",
                colorSearch: "153,153,153",
                colorSecondary: "138,184,230"
            }
        }, {
            id: 8,
            defaultOpacity: .6,
            colors: {
                colorPreview: "82,39,90",
                colorAccordion: ["170,163,204", "136,122,204"],
                colorGradientBackground: ["83,42,118", "61,46,77"],
                colorGradientForeground: ["93,82,193", "0,0,0"],
                colorPrimary: "170,153,255",
                colorPrimaryControl1: "136,122,204",
                colorPrimaryControl2: "147,132,220",
                colorPrimaryControl3: "204,194,255",
                colorPrimaryControl4: "234,230,255",
                colorPrimaryGradient: ["156,149,255", "128,128,255"],
                colorPrimaryText: "191,184,230",
                colorSearch: "166,148,255",
                colorSecondary: "153,143,204"
            }
        }, {
            id: 9,
            defaultOpacity: .3,
            colors: {
                colorPreview: "74,77,83",
                colorAccordion: ["103,155,207", "160,185,252"],
                colorGradientBackground: ["69,71,77", "15,19,26"],
                colorGradientForeground: ["179,179,179", "0,34,51"],
                colorPrimary: "204,238,255",
                colorPrimaryControl1: "143,184,204",
                colorPrimaryControl2: "161,207,230",
                colorPrimaryControl3: "205,215,235",
                colorPrimaryControl4: "228,232,240",
                colorPrimaryGradient: ["140,173,205", "103,132,162"],
                colorPrimaryText: "184,197,204",
                colorSearch: "153,153,153",
                colorSecondary: "138,184,230"
            }
        }, {
            id: 10,
            defaultOpacity: .5,
            colors: {
                colorPreview: "77,62,45",
                colorAccordion: ["204,177,122", "204,191,163"],
                colorGradientBackground: ["51,44,30", "26,22,15"],
                colorGradientForeground: ["153,122,92", "0,0,0"],
                colorPrimary: "230,199,138",
                colorPrimaryControl1: "204,170,122",
                colorPrimaryControl2: "220,191,132",
                colorPrimaryControl3: "219,212,203",
                colorPrimaryControl4: "236,230,223",
                colorPrimaryGradient: ["186,152,105", "226,197,139"],
                colorPrimaryText: "230,207,161",
                colorSearch: "105,105,105",
                colorSecondary: "204,184,143"
            }
        }]
    }(t.SkinConfigNS || (t.SkinConfigNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(20), o = i(446), r = i(330);
    !function (e) {
        const t = new class {
            constructor() {
                this.isRegister = !1
            }

            registerPluginFunction() {
                if (!this.isRegister) {
                    this.isRegister = !0;
                    let e = {
                        GetToolbarVipButtonEnable: this.getToolbarVipButtonEnable,
                        GetVipRenewButtonEnable: this.getVipRenewButtonEnable,
                        GetVipLabelConfig: this.getVipLabelConfig
                    };
                    a.server.registerFunctions(e)
                }
            }

            getToolbarVipButtonEnable(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    return r.VipPluginSwitchConfigNS.getToolbarVipButtonEnable()
                })
            }

            getVipRenewButtonEnable(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    return r.VipPluginSwitchConfigNS.getVipRenewButtonEnable()
                })
            }

            getVipLabelConfig(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let e = i[0];
                    return yield o.VipLableConfigNS.getConfig(e)
                })
            }
        };
        e.registerPluginFunction = function () {
            t.registerPluginFunction()
        }
    }(t.VipPluginFunctionNS || (t.VipPluginFunctionNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(20), o = i(14), r = i(133), s = i(0).default.getLogger("NotificationPluginFunction");
    !function (e) {
        const t = new class {
            constructor() {
                this.isRegister = !1
            }

            registerPluginFunction() {
                if (!this.isRegister) {
                    this.isRegister = !0;
                    let e = {ShowNotification: this.showNotification};
                    a.server.registerFunctions(e)
                }
            }

            showNotification(e, t, ...i) {
                return n(this, void 0, void 0, function* () {
                    let e = !1;
                    do {
                        if (o.ThunderUtil.isUndef(i) || o.ThunderUtil.isUndef(i[0])) break;
                        try {
                            let t = JSON.parse(i[0]);
                            if (s.information("showNotification", "options", t), !t) break;
                            let n = i[1], a = null;
                            s.information("notificationCallBackId", n), o.ThunderUtil.isDef(n) && (a = ((...e) => {
                                n(...e)
                            })), r.NotificationHelper.notify(t, a), e = !0
                        } catch (e) {
                            s.error("showNotification error", e);
                            break
                        }
                    } while (0);
                    return e
                })
            }
        };
        e.registerPluginFunction = function () {
            t.registerPluginFunction()
        }
    }(t.NotificationPluginFunctionNS || (t.NotificationPluginFunctionNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(12), o = i(91), r = i(0).default.getLogger("WebPageTip");
    const s = new class {
        constructor() {
            this.embeddedBrowserObj = null, this.title = "", this.url = "http://static1.ssp.xunlei.com/iframe/fx.html", this.width = 300, this.height = 280, this.lefttMargin = 0, this.rigthMargin = 0, this.topMargin = 30, this.bootomMargin = 0, this.x = 0, this.y = 0, this.callback = null, this.embeddedBrowserObj = new o.EmbeddedBrowser
        }

        createWebPageTipDlg(e, t, i, o, s) {
            return n(this, void 0, void 0, function* () {
                r.information("createWebPageTipDlg url:", e, t);
                {
                    void 0 !== e && null !== e && "" !== e && (this.url = e), this.title = o, this.width = t.width || this.width, this.height = t.height || this.height, this.x = t.x || this.x, this.y = t.y || this.y, this.callback = s;
                    let r = (e, t) => {
                        "click_close" === t ? this.callback && s("click_close") : this.callback && s(t)
                    };
                    (yield a.asyncRemoteCall.getIpcMain()).on("ad-webpagetip", r);
                    let l = !1;
                    this.embeddedBrowserObj.setBrowserEventHandler((e, ...t) => {
                        if ("OnBeforeNavigate" === e) this.callback && this.callback("webpage_loading", ...t); else if ("OnLoadEnd" === e) l || this.callback && this.callback("webpage_loaded", ...t); else if ("OnLoadError" === e) l = !0, this.callback && this.callback("webpage_load_failed", ...t); else if ("OnNewBrowserPopup" === e) return this.callback && this.callback("click", ...t), !0;
                        return !1
                    }), this.embeddedBrowserObj.setWindowTopLevel(!0), this.embeddedBrowserObj.setToolWindow(!0), yield this.embeddedBrowserObj.createWnd(this.url, this.title, !1, "ad-webpagetip", this.width, this.height, this.lefttMargin, this.rigthMargin, this.topMargin, this.bootomMargin, i, this.onWndShowResult.bind(this), () => n(this, void 0, void 0, function* () {
                        (yield a.asyncRemoteCall.getIpcMain()).removeListener("ad-webpagetip", r), this.callback && s("closed")
                    }))
                }
                return this.embeddedBrowserObj.getWnd()
            })
        }

        onWndShowResult() {
            return n(this, void 0, void 0, function* () {
                if (this.embeddedBrowserObj) {
                    let e = this.embeddedBrowserObj.getWnd();
                    e && (yield e.setBounds({x: this.x, y: this.y, width: this.width, height: this.height}))
                }
                return !0
            })
        }

        closeDialog() {
            this.embeddedBrowserObj.closeWnd().catch()
        }
    };
    t.default = s
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(20), a = i(99).ShouleiListSyncNS.getMananger();
    !function (e) {
        const t = new class {
            constructor() {
                this.isRegister = !1, a.attachEvent("OnConnectStateChanged", e => {
                    n.server.fireClientEvent("OnShouleiConnectStateChanged", e)
                })
            }

            registerPluginFunction() {
                if (!this.isRegister) {
                    this.isRegister = !0;
                    let e = {GetShouleiConnectState: this.getShouleiConnectState};
                    n.server.registerFunctions(e)
                }
            }

            getShouleiConnectState(e, t, ...i) {
                let n = "offline";
                do {
                    if (!e) break;
                    n = a.getState()
                } while (0);
                return n
            }
        };
        e.registerPluginFunction = function () {
            t.registerPluginFunction()
        }
    }(t.ShouleiConnectPluginFunctionNS || (t.ShouleiConnectPluginFunctionNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(0), o = i(32), r = i(4), s = i(26), l = i(23), d = i(313), u = i(24), c = i(109), h = i(89), f = i(111),
        g = i(325), p = a.default.getLogger("NativeFunction.Login");
    !function (e) {
        const t = new class {
            constructor() {
                this.isRegister = !1
            }

            registerNativeFunction() {
                if (!this.isRegister) {
                    this.isRegister = !0;
                    let e = [{
                        functionName: "NativeFireEvent",
                        nativeFunc: this.fireEvent
                    }, {
                        functionName: "CreateLoginWnd",
                        nativeFunc: this.createLoginWnd
                    }, {functionName: "CloseLoginWnd", nativeFunc: this.closeLoginWnd}, {
                        functionName: "UpdateLoginWnd",
                        nativeFunc: this.updateLoginWnd
                    }, {functionName: "SaveLoginData", nativeFunc: this.saveLoginData}, {
                        functionName: "LoadLoginData",
                        nativeFunc: this.loadLoginData
                    }, {functionName: "FireLoginEvent", nativeFunc: this.fireLoginEvent}, {
                        functionName: "GetUserID",
                        nativeFunc: this.getUserID
                    }, {functionName: "GetSessionID", nativeFunc: this.getSessionID}, {
                        functionName: "GetLoginOption",
                        nativeFunc: this.getLoginOption
                    }, {functionName: "ShowLoginDlg", nativeFunc: this.showLoginDlg}, {
                        functionName: "GetLoginInfo",
                        nativeFunc: this.getLoginInfo
                    }, {functionName: "GetUserInfo", nativeFunc: this.getUserInfo}, {
                        functionName: "GetAllUserInfo",
                        nativeFunc: this.getAllUserInfo
                    }, {functionName: "IsLogined", nativeFunc: this.isLogined}, {
                        functionName: "Logout",
                        nativeFunc: this.logout
                    }, {
                        functionName: "GetLoginDeviceID",
                        nativeFunc: this.getLoginDeviceID
                    }, {
                        functionName: "RetryLogIn",
                        nativeFunc: this.retryLogIn
                    }, {
                        functionName: "ShowModifierUserInfoWnd",
                        nativeFunc: this.showModifierUserInfoWnd
                    }, {
                        functionName: "GetUserHeaderByUserID",
                        nativeFunc: this.getUserHeaderByUserID
                    }, {
                        functionName: "IsAlreadySign",
                        nativeFunc: this.isAlreadySign
                    }, {
                        functionName: "IsHaveSignQuestion",
                        nativeFunc: this.isHaveSignQuestion
                    }, {functionName: "SendSms", nativeFunc: this.sendSms}, {
                        functionName: "CheckSms",
                        nativeFunc: this.checkSms
                    }];
                    o.NativeCallNS.registerNativeFunction(e)
                }
            }

            fireEvent(e, t, i, n) {
                if (r.isNullOrUndefined(n) || r.isNullOrUndefined(n[0])) return void e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.ParamError);
                let a = n[0];
                p.information("fireEvent eventName:", a), n.splice(0, 1), s.NativeCallHostModule.nativeCallHost.fireNativeEvent(a, ...n), e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.Success)
            }

            getUserID(e, t, i, n) {
                p.information("getUserID:", n), u.LoginHelperNS.loginHelper.getUserInfo("userid", function (n) {
                    p.information("getUserID:userid = ", n), null !== n && void 0 !== n && "" !== n || (n = "0"), e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.Success, n)
                })
            }

            getSessionID(e, t, i, n) {
                p.information("getSessionID:", n), u.LoginHelperNS.loginHelper.getUserInfo("sessionid", function (n) {
                    p.information("getSessionID:sessionid = ", n), e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.Success, n)
                })
            }

            getLoginOption(e, t, i, n) {
                let a = c.LoginOptionNS.loginOption.getOption(), o = void 0;
                a && (o = JSON.stringify(a)), p.information("getLoginOption:option = ", o), e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.Success, o)
            }

            showLoginDlg(e, t, i, n) {
                p.information(n);
                let a = "other", o = !0, s = null;
                if (r.isNullOrUndefined(n) || r.isNullOrUndefined(n[0]) || (a = n[0]), r.isNullOrUndefined(n) || r.isNullOrUndefined(n[1]) || (o = n[1]), !r.isNullOrUndefined(n) && !r.isNullOrUndefined(n[2])) {
                    let e = n[2];
                    try {
                        s = JSON.parse(e)
                    } catch (e) {
                        p.warning(e)
                    }
                }
                u.LoginHelperNS.loginHelper.showLoginDlg(a, o, s), e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.Success)
            }

            getLoginInfo(e, t, i, n) {
                if (r.isNullOrUndefined(n) || r.isNullOrUndefined(n[0])) u.LoginHelperNS.loginHelper.getUserInfo(function (n) {
                    e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.Success, n)
                }); else {
                    let a = n[0];
                    u.LoginHelperNS.loginHelper.getUserInfo(a, function (n) {
                        e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.Success, n)
                    })
                }
            }

            getUserInfo(e, t, i, n) {
                p.information(n), (r.isNullOrUndefined(e) || r.isNullOrUndefined(t) || r.isNullOrUndefined(i)) && e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.ParamError);
                let a = 0;
                if (r.isNullOrUndefined(n) || r.isNullOrUndefined(n[0])) a = 0; else {
                    let e = n[0];
                    a = null === e || void 0 === e || "" === e ? 0 : Number(e)
                }
                u.LoginHelperNS.loginHelper.getUserInfoEx(a, function (n) {
                    e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.Success, n)
                })
            }

            getAllUserInfo(e, t, i, n) {
                if (p.information(n), r.isNullOrUndefined(n) || r.isNullOrUndefined(n[0])) u.LoginHelperNS.loginHelper.getAllUserInfo(function (n) {
                    e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.Success, n)
                }); else {
                    let a = n[0];
                    u.LoginHelperNS.loginHelper.getAllUserInfo(a, function (n) {
                        e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.Success, n)
                    })
                }
            }

            isLogined(e, t, i, n) {
                p.information(n), (r.isNullOrUndefined(e) || r.isNullOrUndefined(t) || r.isNullOrUndefined(i)) && e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.ParamError), u.LoginHelperNS.loginHelper.isLogined(function (n) {
                    e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.Success, n)
                })
            }

            logout(e, t, i, n) {
                p.information(n), u.LoginHelperNS.loginHelper.logout(), e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.Success)
            }

            saveLoginData(e, t, i, n) {
                do {
                    if (p.information("saveLoginData", e, t, i), r.isNullOrUndefined(n) || r.isNullOrUndefined(n[0]) || r.isNullOrUndefined(n[1]) || r.isNullOrUndefined(n[2])) {
                        e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0], o = n[1], s = n[2];
                    u.LoginHelperNS.loginSDKHelper.saveData(a, o, s).then(n => {
                        e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.Success, n)
                    }).catch(() => {
                        e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.CallFailed)
                    })
                } while (0)
            }

            loadLoginData(e, t, i, n) {
                let a = null;
                do {
                    if (p.information("loadLoginData", e, t, i), r.isNullOrUndefined(n) || r.isNullOrUndefined(n[0]) || r.isNullOrUndefined(n[1])) {
                        e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let o = n[0], s = n[1];
                    a = "memory" === o && "initconfig" === s ? u.LoginHelperNS.loginSDKHelper.getInitData() : u.LoginHelperNS.loginSDKHelper.loadData(o, s), p.information("loadLoginData:data = ", a), e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.Success, a)
                } while (0)
            }

            fireLoginEvent(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (r.isNullOrUndefined(a) || !Array.isArray(a)) {
                            e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        if ("string" != typeof a[0]) {
                            e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let n = a[0], o = a[1], s = yield u.LoginHelperNS.loginSDKHelper.fireEvent(n, o);
                        e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.Success, JSON.stringify(s))
                    } while (0)
                })
            }

            createLoginWnd(e, t, i, n) {
                do {
                    if (p.information("createLoginWnd", e, t, i), r.isNullOrUndefined(e) || r.isNullOrUndefined(t) || r.isNullOrUndefined(i) || r.isNullOrUndefined(n)) {
                        p.information("createLoginWnd 失败");
                        break
                    }
                    if (r.isNullOrUndefined(n[0]) || r.isNullOrUndefined(n[1])) {
                        p.information("createLoginWnd 失败 参数错误"), e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0], o = n[1], s = "", d = null, u = null;
                    r.isNullOrUndefined(n[2]) || (s = n[2]), r.isNullOrUndefined(n[3]) || (d = n[3]), r.isNullOrUndefined(n[4]) || (u = n[4]), f.popMutual.setReady(h.PopView.LOGIN, a, o, s, d, u), e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.Success)
                } while (0)
            }

            closeLoginWnd(e, t, i, n) {
                do {
                    if (r.isNullOrUndefined(e) || r.isNullOrUndefined(t) || r.isNullOrUndefined(i) || r.isNullOrUndefined(n)) break;
                    if (r.isNullOrUndefined(n[0])) {
                        e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0];
                    u.LoginHelperNS.loginUIHelper.closeLoginWnd(a)
                } while (0)
            }

            updateLoginWnd(e, t, i, n) {
                p.information("updateLoginWnd", e, t, i);
                let a = !1, o = null, s = null, d = null, c = null;
                r.isNullOrUndefined(n[0]) || (a = n[0]), r.isNullOrUndefined(n[1]) || (o = n[1]), r.isNullOrUndefined(n[2]) || (s = n[2]), r.isNullOrUndefined(n[3]) || (d = n[3]), r.isNullOrUndefined(n[4]) || (c = n[4]), u.LoginHelperNS.loginUIHelper.updateLoginWnd(a, o, s, d, c), e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.Success)
            }

            getLoginDeviceID(e, t, i, n) {
                p.information("getDeviceID", e, t, i), u.LoginHelperNS.loginSDKHelper.getDeviceID().then(n => {
                    e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.Success, n)
                }).catch(n => {
                    e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.CallFailed, n)
                })
            }

            retryLogIn(e, t, i, n) {
                p.information("retryLogIn"), u.LoginHelperNS.loginHelper.logIn("retryLogIn"), e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.Success)
            }

            showModifierUserInfoWnd(e, t, i, n) {
                p.information("showModifierUserInfoWnd", e, t, i);
                let a = "";
                a = r.isNullOrUndefined(n) || r.isNullOrUndefined(n[0]) ? "" : n[0], u.LoginHelperNS.loginUIHelper.createModifierUserInfoWnd(a), e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.Success)
            }

            getUserHeaderByUserID(e, t, i, n) {
                if (p.information("getUserHeaderByUserID", e, t, i), r.isNullOrUndefined(n) || r.isNullOrUndefined(n[0])) return void e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.ParamError);
                let a = u.LoginHelperNS.loginHelper.getUserHeader(n[0]);
                e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.Success, a)
            }

            isAlreadySign(e, t, i, n) {
                p.information("isAlreadySign", e, t, i), d.CommonSignFunctionNs.isAlreadySign().then(n => {
                    e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.Success, n)
                }).catch()
            }

            isHaveSignQuestion(e, t, i, n) {
                p.information("isHaveSignQuestion", e, t, i), d.CommonSignFunctionNs.isHaveSignQuestion().then(n => {
                    e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.Success, n)
                }).catch()
            }

            sendSms(e, t, i, n) {
                p.information("sendSms", e, t, i);
                let a = "";
                null !== n && void 0 !== n && n.length > 0 && (a = n[0]), g.commonLoginHelper.sendSmsAw(a).then(n => {
                    e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.Success, n)
                }).catch()
            }

            checkSms(e, t, i, n) {
                p.information("checkSms", e, t, i);
                do {
                    if (null === n || void 0 === n || n.length < 2) {
                        p.information("checkSms args存在问题 args：", n), e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0], o = n[1];
                    g.commonLoginHelper.checkSmsAw(a, o).then(n => {
                        e.callNativeFunctionCallback(t, i, l.NativeFunctionErrorCode.Success, n)
                    }).catch()
                } while (0)
            }
        };
        e.registerNativeFunction = function () {
            t.registerNativeFunction()
        }
    }(t.LoginNaviteFunctionNS || (t.LoginNaviteFunctionNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(0), o = i(3), r = i(30), s = i(11), l = i(15), d = i(40), u = i(32), c = i(23), h = i(26), f = i(31),
        g = i(13), p = i(41), v = i(5), m = i(51), y = i(304), k = i(45), T = i(437), w = i(333), C = i(4),
        S = a.default.getLogger("DKNativeFunction"), b = s.DownloadKernelTaskManager.getTaskManager(),
        I = l.DownloadKernelEventManager.getEventManager(),
        _ = d.DownloadKernelCategoryViewManager.getCategoryViewManager();
    !function (e) {
        const t = new class {
            constructor() {
                this.isRegister = !1, I.attachTaskEvent(o.DownloadKernel.TaskEventType.DetailChanged, (...e) => {
                    this.onTaskDetailChanged(...e)
                }), I.attachTaskEvent(o.DownloadKernel.TaskEventType.StatusChanged, (...e) => {
                    this.onTaskStatusChanged(...e)
                }), I.attachTaskEvent(o.DownloadKernel.TaskEventType.DcdnStatusChanged, (...e) => {
                    this.onTaskDcdnStatusChanged(...e)
                }), I.attachTaskEvent(o.DownloadKernel.TaskEventType.BtSubFileDetailChanged, (...e) => {
                    this.onBtSubFileDetailChanged(...e)
                }), I.attachTaskEvent(o.DownloadKernel.TaskEventType.BtSubFileLoaded, (...e) => {
                    this.onBtSubFileLoaded(...e)
                }), I.attachTaskEvent(o.DownloadKernel.TaskEventType.BtSubFileForbidden, (...e) => {
                    this.onBtSubFileForbidden(...e)
                }), I.attachTaskEvent(o.DownloadKernel.TaskEventType.BtSubFileDcdnStatusChanged, (...e) => {
                    this.onBtSubFileDcdnStatusChanged(...e)
                }), I.attachTaskEvent(o.DownloadKernel.TaskEventType.InsertToCategoryView, (...e) => {
                    this.onTaskInserted(...e)
                }), I.attachTaskEvent(o.DownloadKernel.TaskEventType.RemoveFromCategoryView, (...e) => {
                    this.onTaskRemoved(...e)
                }), I.attachTaskEvent(o.DownloadKernel.TaskEventType.TaskCategoryMovedEnd, (...e) => {
                    this.onTaskCategoryMovedEnd(...e)
                }), r.DownloadKernelManager.attachListener(g.NodeEventMesssageNS.eventGlobalDownloadSpeedChanged, (...e) => {
                    this.onGlobalDownloadSpeedChanged(...e)
                })
            }

            registerNativeFunction() {
                if (!this.isRegister) {
                    this.isRegister = !0;
                    let e = [{
                        functionName: "GetTaskChannelInfo",
                        nativeFunc: this.getTaskChannelInfo
                    }, {
                        functionName: "GetTaskBaseInfo",
                        nativeFunc: this.getTaskBaseInfo
                    }, {
                        functionName: "GetTaskBaseInfos",
                        nativeFunc: this.getTaskBaseInfos
                    }, {
                        functionName: "GetTaskAttribute",
                        nativeFunc: this.getTaskAttribute
                    }, {functionName: "GetTaskStatus", nativeFunc: this.getTaskStatus}, {
                        functionName: "FindTask",
                        nativeFunc: this.findTask
                    }, {functionName: "IsTaskExist", nativeFunc: this.isTaskExist}, {
                        functionName: "IsSupportPlay",
                        nativeFunc: this.isSupportPlay
                    }, {
                        functionName: "GetTaskDownloadSpeed",
                        nativeFunc: this.getTaskDownloadSpeed
                    }, {
                        functionName: "EnableDcdnWithVipCert",
                        nativeFunc: this.enableDcdnWithVipCert
                    }, {
                        functionName: "UpdateDcdnWithVipCert",
                        nativeFunc: this.updateDcdnWithVipCert
                    }, {
                        functionName: "DisableDcdnWithVipCert",
                        nativeFunc: this.disableDcdnWithVipCert
                    }, {functionName: "GetTpPeerId", nativeFunc: this.getPeerId}, {
                        functionName: "ExecSqlite",
                        nativeFunc: this.execSqlite
                    }, {
                        functionName: "QuerySqlite",
                        nativeFunc: this.querySqlite
                    }, {
                        functionName: "GetCategoryViewTaskList",
                        nativeFunc: this.getCategoryViewTaskList
                    }, {
                        functionName: "GetCategoryViewTaskListForSuspensionWnd",
                        nativeFunc: this.getCategoryViewTaskListForSuspensionWnd
                    }, {
                        functionName: "IsLoadStorageTaskFinish",
                        nativeFunc: this.isLoadStorageTaskFinish
                    }, {
                        functionName: "IsSupportInstall",
                        nativeFunc: this.isSupportInstall
                    }, {
                        functionName: "GetDownloadProgress",
                        nativeFunc: this.getDownloadProgressPercent
                    }, {
                        functionName: "GetDownloadProgressNumber",
                        nativeFunc: this.getDownloadProgress
                    }, {functionName: "IsSingleBtTask", nativeFunc: this.isSingleBtTask}, {
                        functionName: "VerifyProxy",
                        nativeFunc: this.verifyProxy
                    }, {functionName: "SetProxy", nativeFunc: this.setProxy}, {
                        functionName: "SetTaskExtStat",
                        nativeFunc: this.setTaskExtStat
                    }, {
                        functionName: "DownloadBySDK",
                        nativeFunc: this.asynRequestFile
                    }, {
                        functionName: "IsFileSizeSetterWorking",
                        nativeFunc: this.isFileSizeSetterWorking
                    }, {functionName: "LaunchFileAssistant", nativeFunc: this.launchFileAssistant}];
                    u.NativeCallNS.registerNativeFunction(e)
                }
            }

            getTaskChannelInfo(e, t, i, n) {
                do {
                    if (C.isNullOrUndefined(e) || C.isNullOrUndefined(t) || C.isNullOrUndefined(i)) break;
                    if (!n || !n[0]) {
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0], o = b.getTaskFromTaskId(a);
                    if (o) {
                        let n = o.getTaskChannelInfo(), a = JSON.stringify(n);
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, a)
                    } else e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError)
                } while (0)
            }

            getTaskAttribute(e, t, i, n) {
                do {
                    if (C.isNullOrUndefined(e) || C.isNullOrUndefined(t) || C.isNullOrUndefined(i)) break;
                    if (!n || !n[0]) {
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0], o = n[1], r = b.getTaskFromTaskId(a);
                    if (r) {
                        let n = r.getTaskAttribute(o), a = JSON.stringify(n);
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, a)
                    } else e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError)
                } while (0)
            }

            getTaskBaseInfo(e, t, i, n) {
                do {
                    if (C.isNullOrUndefined(e) || C.isNullOrUndefined(t) || C.isNullOrUndefined(i)) break;
                    if (!n || !n[0]) {
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0], o = b.getTaskFromTaskId(a);
                    if (o) {
                        let n = o.getTaskBaseInfo(), a = JSON.stringify(n);
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, a)
                    } else e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError)
                } while (0)
            }

            getTaskBaseInfos(e, t, i, n) {
                do {
                    if (C.isNullOrUndefined(e) || C.isNullOrUndefined(t) || C.isNullOrUndefined(i)) break;
                    if (!n || !n[0]) {
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0], o = null;
                    try {
                        o = JSON.parse(a)
                    } catch (e) {
                        S.warning(e)
                    }
                    if (o) {
                        let n = [];
                        for (let e = 0; e < o.length; ++e) {
                            let t = b.getTaskFromTaskId(o[e]);
                            if (t) {
                                let e = t.getTaskBaseInfo();
                                n.push(e)
                            }
                        }
                        let a = JSON.stringify(n);
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, a)
                    } else e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError)
                } while (0)
            }

            getTaskDownloadSpeed(e, t, i, n) {
                do {
                    if (C.isNullOrUndefined(e) || C.isNullOrUndefined(t) || C.isNullOrUndefined(i)) break;
                    if (!n || !n[0]) {
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0], o = b.getTaskFromTaskId(a);
                    if (o) {
                        let n = o.getDownloadSpeed();
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, n)
                    } else e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError)
                } while (0)
            }

            getTaskStatus(e, t, i, n) {
                do {
                    if (C.isNullOrUndefined(e) || C.isNullOrUndefined(t) || C.isNullOrUndefined(i)) break;
                    if (!n || !n[0]) {
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0], o = b.getTaskFromTaskId(a);
                    if (o) {
                        let n = o.getTaskStatus();
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, n)
                    } else e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError)
                } while (0)
            }

            findTask(e, t, i, n) {
                do {
                    if (C.isNullOrUndefined(e) || C.isNullOrUndefined(t) || C.isNullOrUndefined(i)) break;
                    if (!n || !n[0] || !n[1]) {
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = {keyType: n[0], keyValue: n[1], keyFilter: o.DownloadKernel.KeyFilter.All};
                    b.batchFindTaskAsync([a]).then(n => {
                        if (n && n.length > 0) {
                            let a = n[0].getTaskAttribute(o.DownloadKernel.TaskAttribute.TaskId);
                            e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, !0, a)
                        } else e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, !1, 0)
                    }).catch()
                } while (0)
            }

            isTaskExist(e, t, i, n) {
                do {
                    if (C.isNullOrUndefined(e) || C.isNullOrUndefined(t) || C.isNullOrUndefined(i)) break;
                    if (!n || !n[0]) {
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0];
                    b.getTaskFromTaskId(a) ? e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, !0) : e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, !1)
                } while (0)
            }

            isSupportPlay(e, t, i, n) {
                do {
                    if (C.isNullOrUndefined(e) || C.isNullOrUndefined(t) || C.isNullOrUndefined(i)) break;
                    if (!n || !n[0]) {
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0], o = b.getTaskFromTaskId(a);
                    if (o) {
                        let n = o.isSupportPlay();
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, n)
                    } else e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, !1)
                } while (0)
            }

            enableDcdnWithVipCert(e, t, i, n) {
                do {
                    if (C.isNullOrUndefined(e) || C.isNullOrUndefined(t) || C.isNullOrUndefined(i)) break;
                    if (!n || !n[0] || !n[1]) {
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0], o = b.getTaskFromTaskId(a);
                    if (o) {
                        let a = -1;
                        C.isNumber(n[2]) && (a = n[2]), o.enableDcdnWithVipCert(n[1], a), e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success)
                    } else e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError)
                } while (0)
            }

            updateDcdnWithVipCert(e, t, i, n) {
                do {
                    if (C.isNullOrUndefined(e) || C.isNullOrUndefined(t) || C.isNullOrUndefined(i)) break;
                    if (!n || !n[0] || !n[1]) {
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0], o = b.getTaskFromTaskId(a);
                    if (o) {
                        let a = -1;
                        C.isNumber(n[2]) && (a = n[2]), o.updateDcdnWithVipCert(n[1], a), e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success)
                    } else e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError)
                } while (0)
            }

            disableDcdnWithVipCert(e, t, i, n) {
                do {
                    if (C.isNullOrUndefined(e) || C.isNullOrUndefined(t) || C.isNullOrUndefined(i)) break;
                    if (!n || !n[0]) {
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0], o = b.getTaskFromTaskId(a);
                    if (o) {
                        let a = -1;
                        C.isNumber(n[1]) && (a = n[1]), o.disableDcdnWithVipCert(a), e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success)
                    } else e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError)
                } while (0)
            }

            getPeerId(e, t, i, n) {
                do {
                    if (C.isNullOrUndefined(e) || C.isNullOrUndefined(t) || C.isNullOrUndefined(i)) break;
                    S.verbose(n), r.DownloadKernelManager.getPeerId().then(n => {
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, n)
                    }).catch()
                } while (0)
            }

            execSqlite(e, t, i, n) {
                do {
                    if (C.isNullOrUndefined(e) || C.isNullOrUndefined(t) || C.isNullOrUndefined(i)) break;
                    if (!n || !n[0]) {
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    f.ThunderKernel.execSqlite(n[0], n => {
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, n)
                    })
                } while (0)
            }

            querySqlite(e, t, i, n) {
                do {
                    if (C.isNullOrUndefined(e) || C.isNullOrUndefined(t) || C.isNullOrUndefined(i)) break;
                    if (!n || !n[0]) {
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    f.ThunderKernel.querySqlite(n[0], n => {
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, n)
                    })
                } while (0)
            }

            getCategoryViewTaskList(e, t, i, n) {
                do {
                    if (C.isNullOrUndefined(e) || C.isNullOrUndefined(t) || C.isNullOrUndefined(i)) break;
                    if (!n || !n[0]) {
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError), S.warning("getCategoryViewTaskList args", n);
                        break
                    }
                    let a = _.getCategoryViewFromId(n[0]);
                    if (a) {
                        let n = [], o = a.getTasks();
                        if (o) for (let e of o) {
                            let t = e[0];
                            n.push(t)
                        }
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, n)
                    } else e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError)
                } while (0)
            }

            getCategoryViewTaskListForSuspensionWnd(e, t, i, n) {
                do {
                    if (C.isNullOrUndefined(e) || C.isNullOrUndefined(t) || C.isNullOrUndefined(i)) break;
                    if (!n || !n[0]) {
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = _.getCategoryViewFromId(n[0]);
                    if (a) {
                        let n = a.getTasks(), o = "", r = [];
                        if (n) {
                            for (let [, e]of n) {
                                let t = e.getTaskBaseInfo();
                                r.push(t)
                            }
                            o = JSON.stringify(r)
                        }
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, o)
                    } else e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError)
                } while (0)
            }

            isLoadStorageTaskFinish(e, t, i) {
                do {
                    if (C.isNullOrUndefined(e) || C.isNullOrUndefined(t) || C.isNullOrUndefined(i)) break;
                    r.DownloadKernelManager.attachListener(g.NodeEventMesssageNS.eventTaskDataBaseLoadEnd, () => {
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, !0)
                    })
                } while (0)
            }

            onTaskDetailChanged(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== o.DownloadKernel.TaskEventType.DetailChanged) break;
                    if (!e[1] || !e[2]) break;
                    let t = e[1], i = e[2], n = {};
                    for (let e = 0; e < t.length; ++e) {
                        let i = t[e];
                        if (!i) continue;
                        let a = i.getTaskAttribute(o.DownloadKernel.TaskAttribute.TaskId), r = i.getTaskBaseInfo();
                        n[a] = r
                    }
                    h.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnTaskDetailChanged", JSON.stringify(n), i)
                } while (0)
            }

            onTaskStatusChanged(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== o.DownloadKernel.TaskEventType.StatusChanged) break;
                    if (!e[1]) break;
                    let t = e[1], i = {};
                    for (let e = 0; e < t.length; ++e) {
                        let n = t[e];
                        if (!n) continue;
                        let a = n.getTaskStatus();
                        i[n.getTaskAttribute(o.DownloadKernel.TaskAttribute.TaskId)] = a
                    }
                    h.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnTaskStatusChanged", JSON.stringify(i))
                } while (0)
            }

            onTaskDcdnStatusChanged(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== o.DownloadKernel.TaskEventType.DcdnStatusChanged) break;
                    if (!e[1]) break;
                    let t = e[1], i = {};
                    for (let e = 0; e < t.length; ++e) {
                        let n = t[e];
                        if (!n) continue;
                        let a = n.getTaskAttribute(o.DownloadKernel.TaskAttribute.TaskId),
                            r = n.getTaskChannelInfo().dcdnStatus;
                        i[a] = r
                    }
                    h.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnTaskDcdnStatusChanged", JSON.stringify(i))
                } while (0)
            }

            onBtSubFileDetailChanged(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== o.DownloadKernel.TaskEventType.BtSubFileDetailChanged) break;
                    if (!e[1] || !e[2]) break;
                    let t = e[1], i = b.getTaskFromTaskId(t);
                    if (!i) break;
                    let n = e[2], a = i.getTaskBaseInfo();
                    h.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnBtSubFileDetailChanged", t, JSON.stringify(n), JSON.stringify(a))
                } while (0)
            }

            onBtSubFileLoaded(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== o.DownloadKernel.TaskEventType.BtSubFileLoaded) break;
                    if (!e[1] || !e[2]) break;
                    let t = e[1], i = e[2], n = b.getTaskFromTaskId(t);
                    if (!n) break;
                    let a = n.getTaskBaseInfo();
                    h.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnBtSubFileLoaded", t, JSON.stringify(i), JSON.stringify(a))
                } while (0)
            }

            onBtSubFileForbidden(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== o.DownloadKernel.TaskEventType.BtSubFileForbidden) break;
                    if (!e[1] || !e[2]) break;
                    let t = e[1], i = e[2];
                    h.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnBtSubFileForbidden", t, i)
                } while (0)
            }

            onBtSubFileDcdnStatusChanged(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== o.DownloadKernel.TaskEventType.BtSubFileDcdnStatusChanged) break;
                    if (!e[1] || null === e[2] || void 0 === e[2] || null === e[3] || void 0 === e[3] || null === e[4] || void 0 === e[4]) break;
                    let t = e[1], i = e[2], n = e[3], a = e[4];
                    h.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnBtSubFileDcdnStatusChanged", t, i, n, a)
                } while (0)
            }

            onTaskInserted(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== o.DownloadKernel.TaskEventType.InsertToCategoryView) break;
                    if (void 0 === e[1] || !e[2] || !e[3]) break;
                    let t = e[1], i = e[2], n = e[3], a = [];
                    for (let e = 0; e < n.length; ++e) {
                        let t = n[e].getTaskAttribute(o.DownloadKernel.TaskAttribute.TaskId);
                        a.push(t)
                    }
                    let r = JSON.stringify(a);
                    h.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnTaskInserted", t, i, r)
                } while (0)
            }

            onTaskRemoved(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== o.DownloadKernel.TaskEventType.RemoveFromCategoryView) break;
                    if (void 0 === e[1] || !e[2] || !e[3]) break;
                    let t = e[1], i = e[2], n = e[3], a = [];
                    for (let e = 0; e < n.length; ++e) {
                        let t = n[e].getTaskAttribute(o.DownloadKernel.TaskAttribute.TaskId);
                        a.push(t)
                    }
                    let r = JSON.stringify(a);
                    h.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnTaskRemoved", t, i, r)
                } while (0)
            }

            onTaskCategoryMovedEnd(...e) {
                do {
                    if (!e) break;
                    if (e[0] !== o.DownloadKernel.TaskEventType.TaskCategoryMovedEnd) break;
                    if (!e[1]) break;
                    let t = e[1], i = [];
                    for (let e of t) if (e) {
                        let t = e.getTaskBaseInfo();
                        i.push(t)
                    }
                    let n = JSON.stringify(i);
                    h.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnTaskCategoryMovedEnd", n)
                } while (0)
            }

            onGlobalDownloadSpeedChanged(...e) {
                let t = r.DownloadKernelManager.getTotalTaskDownloadSpeed(!1, !1),
                    i = r.DownloadKernelManager.getTotalTaskVipSpeed(!1, !1);
                h.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnGlobalDownloadSpeedChanged", t, i)
            }

            isSupportInstall(e, t, i, n) {
                do {
                    if (C.isNullOrUndefined(e) || C.isNullOrUndefined(t) || C.isNullOrUndefined(i)) break;
                    if (!n || !n[0]) {
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0], r = b.getTaskFromTaskId(a);
                    if (!r) {
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    if (r.getTaskAttribute(o.DownloadKernel.TaskAttribute.TaskType) === o.DownloadKernel.TaskType.Group) {
                        let n = r.getExtraObject(),
                            o = n.getUserData(m.TaskUserDataGUID.guidDownloadCompleteInstall, "installFile");
                        if (void 0 !== o && null !== o && "" !== o && "0" !== o) {
                            let r = p.TaskCtrlOperatorNS.getSavePathByFileName(a, o);
                            v.FileSystemAWNS.existsAW(r).then(a => {
                                if (a) {
                                    let a = n.getUserData(m.TaskUserDataGUID.guidDownloadCompleteRunParams, "runParams");
                                    e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, !0, r, a)
                                } else e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, !1)
                            }).catch()
                        } else e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, !1)
                    } else e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, !1)
                } while (0)
            }

            getDownloadProgressPercent(e, t, i, n) {
                let a = y.DownloadProgressNS.getDownloadProgressPercent();
                e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, a)
            }

            getDownloadProgress(e, t, i, n) {
                let a = y.DownloadProgressNS.getDownloadProgress();
                e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, a)
            }

            isSingleBtTask(e, t, i, n) {
                let a = n[0], o = b.getTaskFromTaskId(a);
                k.SingleBtTaskNS.isSingleBtTask(o).then(n => {
                    e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, n)
                }).catch()
            }

            verifyProxy(e, t, i, n) {
                let a = n[0], o = n[1], r = n[2], s = n[3], l = n[4];
                0 !== f.ThunderKernel.verifyProxy(a, o, r, s, l, n => {
                    e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, n)
                }) && e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, w.ProxyNS.ProxyVerifyResult.ParamError)
            }

            setProxy(e, t, i, n) {
                let a = n[0], o = n[1], r = n[2], s = n[3], l = n[4], d = f.ThunderKernel.setProxy(a, o, r, s, l);
                e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, d)
            }

            setTaskExtStat(e, t, i, n) {
                let a = n[0], r = b.getTaskFromTaskId(a);
                if (r) {
                    let a = n[1], s = n[2], l = n[3], d = r.getTaskAttribute(o.DownloadKernel.TaskAttribute.VirtualId),
                        u = f.ThunderKernel.setTaskExtStat(d, a, s, l);
                    e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, u)
                } else e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError)
            }

            asynRequestFile(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (!a || !a[0]) {
                            e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let o = a[0];
                        if ("string" == typeof o) try {
                            o = JSON.parse(a[0])
                        } catch (e) {
                            S.warning(e)
                        }
                        if (!o) {
                            e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        if (!o.url) {
                            e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        if (!o.savePath) {
                            e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        if (!o.fileName) {
                            e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let r = a[1];
                        void 0 !== r && null !== r && (o.onTaskFinish = ((i, a) => n(this, void 0, void 0, function* () {
                            e.callNativeFunctionCallback(t, r, i, a)
                        })));
                        let s = yield T.sdkDownloader.createTaskBySDK(o);
                        e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, s)
                    } while (0)
                })
            }

            isFileSizeSetterWorking(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (!a) {
                            e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let n = f.ThunderKernel.isFileSizeSetterWorking(n => {
                            e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, n)
                        });
                        0 !== n && e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.CallFailed, n)
                    } while (0)
                })
            }

            launchFileAssistant(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (!a) {
                            e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let n = f.ThunderKernel.launchFileAssistant(n => {
                            e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.Success, n)
                        });
                        0 !== n && e.callNativeFunctionCallback(t, i, c.NativeFunctionErrorCode.CallFailed, n)
                    } while (0)
                })
            }
        };
        e.registerNativeFunction = function () {
            t.registerNativeFunction()
        }
    }(t.DKNaviteFunctionNS || (t.DKNaviteFunctionNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(0), a = i(13), o = i(32), r = i(23), s = i(26), l = i(10), d = i(323), u = i(25), c = i(77), h = i(4),
        f = i(17), g = i(28), p = n.default.getLogger("ConfigNaviteFunction");
    !function (e) {
        const t = new class {
            constructor() {
                this.isRegister = !1, l.ConfigNS.attachListener(a.NodeEventMesssageNS.eventConfigValueChanged, (e, t, i, n) => {
                    s.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnConfigValueChanaged", e, t, i, n), f.ipcRenderer.send(g.ThunderChannelList.channelRMConfigValueChanged, e, t, i, n)
                }), l.ConfigNS.attachListener(a.NodeEventMesssageNS.eventConfigInitFinished, () => {
                    s.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnConfigInitFinished"), f.ipcRenderer.send(g.ThunderChannelList.channelRMConfigInitFinished)
                })
            }

            registerNativeFunction() {
                if (!this.isRegister) {
                    this.isRegister = !0;
                    let e = [{functionName: "Save", nativeFunc: this.save}, {
                        functionName: "GetValue",
                        nativeFunc: this.getValue
                    }, {functionName: "SetValue", nativeFunc: this.setValue}, {
                        functionName: "SaveConfig",
                        nativeFunc: this.save
                    }, {functionName: "GetConfigValue", nativeFunc: this.getValue}, {
                        functionName: "SetConfigValue",
                        nativeFunc: this.setValue
                    }, {
                        functionName: "IsConfigInitFinish",
                        nativeFunc: this.isConfigInitFinish
                    }, {
                        functionName: "GetConfigModules",
                        nativeFunc: this.getConfigModules
                    }, {
                        functionName: "IsConfigBrowserInitFinish",
                        nativeFunc: this.isConfigBrowserInitFinish
                    }, {
                        functionName: "GetInstallBrowserInfo",
                        nativeFunc: this.getInstallBrowserInfo
                    }, {
                        functionName: "AddConfigSettingItemData",
                        nativeFunc: this.addConfigSettingItemData
                    }, {functionName: "RemoveConfigSettingItemData", nativeFunc: this.removeConfigSettingItemData}];
                    o.NativeCallNS.registerNativeFunction(e)
                }
            }

            save(e, t, i, n) {
                do {
                    if (h.isNullOrUndefined(e) || h.isNullOrUndefined(t) || h.isNullOrUndefined(i)) break;
                    p.verbose(n), l.ConfigNS.save().then(() => {
                        e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.Success)
                    }).catch()
                } while (0)
            }

            getValue(e, t, i, n) {
                do {
                    if (h.isNullOrUndefined(e) || h.isNullOrUndefined(t) || h.isNullOrUndefined(i)) break;
                    if (!n || !n[0] || !n[1]) {
                        e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0], o = n[1], s = n[2], d = l.ConfigNS.getValue(a, o, s);
                    p.information("getValue section:", a, "key:", o, "ret: ", d), e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.Success, d)
                } while (0)
            }

            setValue(e, t, i, n) {
                do {
                    if (h.isNullOrUndefined(e) || h.isNullOrUndefined(t) || h.isNullOrUndefined(i)) break;
                    if (!n || !n[0] || !n[1]) {
                        e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0], o = n[1], s = n[2];
                    l.ConfigNS.setValue(a, o, s), e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.Success)
                } while (0)
            }

            isConfigInitFinish(e, t, i) {
                do {
                    if (h.isNullOrUndefined(e) || h.isNullOrUndefined(t) || h.isNullOrUndefined(i)) break;
                    l.ConfigNS.attachListener(a.NodeEventMesssageNS.eventConfigInitFinished, () => {
                        e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.Success, !0)
                    })
                } while (0)
            }

            getConfigModules(e, t, i, n) {
                do {
                    if (h.isNullOrUndefined(e) || h.isNullOrUndefined(t) || h.isNullOrUndefined(i)) break;
                    let a = "", o = "";
                    null !== n && void 0 !== n && (null !== n[0] && void 0 !== n[0] && "" !== n[0] && (a = n[0]), null !== n[1] && void 0 !== n[1] && "" !== n[1] && (o = n[1]));
                    let s = u.default.getConfigInfo(a, o);
                    e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.Success, s)
                } while (0)
            }

            isConfigBrowserInitFinish(e, t, i) {
                do {
                    if (h.isNullOrUndefined(e) || h.isNullOrUndefined(t) || h.isNullOrUndefined(i)) break;
                    c.SettingConfigHelperNS.configBrowserHelper.attachListener(a.NodeEventMesssageNS.eventConfigBrowserInitFinished, () => {
                        e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.Success, !0)
                    })
                } while (0)
            }

            getInstallBrowserInfo(e, t, i, n) {
                do {
                    if (h.isNullOrUndefined(e) || h.isNullOrUndefined(t) || h.isNullOrUndefined(i)) break;
                    if (null === n || void 0 === n || n.length <= 0 || void 0 === n[0] || null === n[0] || "" === n[0]) {
                        e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0], o = c.SettingConfigHelperNS.configBrowserHelper.getWatchBrowerByName(a);
                    e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.Success, o)
                } while (0)
            }

            addConfigSettingItemData(e, t, i, n) {
                {
                    let a = null, o = null;
                    if (n[0] && n[1]) try {
                        a = JSON.parse(n[0]), o = JSON.parse(n[1])
                    } catch (e) {
                    }
                    if (a && o) {
                        let n = d.SettingInit.addSettingItemData(a, o);
                        e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.Success, n)
                    } else e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.ParamError)
                }
            }

            removeConfigSettingItemData(e, t, i, n) {
                {
                    let a = null, o = null;
                    if (n[0] && n[1]) try {
                        a = JSON.parse(n[0]), o = JSON.parse(n[1])
                    } catch (e) {
                    }
                    if (a && o) {
                        let n = d.SettingInit.removeSettingItemData(a, o);
                        e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.Success, n)
                    } else e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.ParamError)
                }
            }
        };
        e.registerNativeFunction = function () {
            t.registerNativeFunction()
        }
    }(t.ConfigNaviteFunctionNS || (t.ConfigNaviteFunctionNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(0), a = i(32), o = i(23), r = i(26), s = i(81), l = i(4),
        d = n.default.getLogger("ConfigRemoteGlobalNaviteFunction");
    !function (e) {
        const t = new class {
            constructor() {
                this.isRegister = !1, s.default.attachListener("OnRemoteGlobalConfigLoaded", e => {
                    d.information("OnRemoteGlobalConfigLoaded ret:", e), r.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnRemoteGlobalConfigLoaded", e)
                }), s.default.attachListener("OnRemoteGlobalConfigUpdated", e => {
                    d.information("OnRemoteGlobalConfigUpdated ret:", e), r.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnRemoteGlobalConfigUpdated", e)
                })
            }

            registerNativeFunction() {
                if (!this.isRegister) {
                    this.isRegister = !0;
                    let e = [{
                        functionName: "GetRemoteGlobalConfigValue",
                        nativeFunc: this.getRemoteGlobalConfigValue
                    }, {
                        functionName: "IsRemoteGlobalConfigInitFinish",
                        nativeFunc: this.isRemoteGlobalConfigInitFinish
                    }];
                    a.NativeCallNS.registerNativeFunction(e)
                }
            }

            getRemoteGlobalConfigValue(e, t, i, n) {
                do {
                    if (l.isNullOrUndefined(e) || l.isNullOrUndefined(t) || l.isNullOrUndefined(i)) break;
                    if (!n || !n[0]) {
                        e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0], r = void 0;
                    n.length >= 2 && (r = n[1]);
                    let u = void 0;
                    if (n.length >= 3 && (u = n[2], l.isString(u))) try {
                        u = JSON.parse(u)
                    } catch (e) {
                        d.warning(e), u = n[2]
                    }
                    let c = void 0, h = s.default.getConfigValue(a, r, u);
                    if (!l.isNullOrUndefined(h)) try {
                        c = JSON.stringify(h)
                    } catch (e) {
                        d.warning(e), c = h
                    }
                    e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.Success, c)
                } while (0)
            }

            isRemoteGlobalConfigInitFinish(e, t, i) {
                do {
                    if (l.isNullOrUndefined(e) || l.isNullOrUndefined(t) || l.isNullOrUndefined(i)) break;
                    e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.Success, s.default.isInited())
                } while (0)
            }
        };
        e.registerNativeFunction = function () {
            t.registerNativeFunction()
        }
    }(t.ConfigRemoteGlobalNaviteFunctionNS || (t.ConfigRemoteGlobalNaviteFunctionNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(32), a = i(4), o = i(318), r = i(317), s = i(23), l = i(319);
    !function (e) {
        const t = new class {
            constructor() {
                this.isRegister = !1
            }

            registerNativeFunction() {
                if (!this.isRegister) {
                    this.isRegister = !0;
                    let e = [{functionName: "InstallXmp", nativeFunc: this.installXmp}, {
                        functionName: "OpenXmp",
                        nativeFunc: this.openXmp
                    }, {
                        functionName: "CreateDownloadAndPlayTask",
                        nativeFunc: this.createDownloadAndPlayTask
                    }, {
                        functionName: "GetXmpCoreVersion",
                        nativeFunc: this.getXmpCoreVersion
                    }, {functionName: "GetXmpBuildNum", nativeFunc: this.getXmpBuildNum}, {
                        functionName: "GetXmpPath",
                        nativeFunc: this.getXmpPath
                    }, {functionName: "GetXmpReg", nativeFunc: this.getXmpReg}, {
                        functionName: "GetXmpUserDataPath",
                        nativeFunc: this.getXmpUserDataPath
                    }];
                    n.NativeCallNS.registerNativeFunction(e)
                }
            }

            installXmp(e, t, i, n) {
                a.isNullOrUndefined(e) || a.isNullOrUndefined(t) || a.isNullOrUndefined(i) || o.default.installXmp().then(() => {
                    e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success)
                }).catch()
            }

            openXmp(e, t, i, n) {
                do {
                    if (a.isNullOrUndefined(e) || a.isNullOrUndefined(t) || a.isNullOrUndefined(i)) break;
                    let r = "";
                    a.isNullOrUndefined(n) || a.isNullOrUndefined(n[0]) || (r = n[0]), o.default.openXmp(r).then(n => {
                        e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success, n)
                    }).catch()
                } while (0)
            }

            createDownloadAndPlayTask(e, t, i, n) {
                do {
                    if (a.isNullOrUndefined(e) || a.isNullOrUndefined(t) || a.isNullOrUndefined(i)) break;
                    l.DownloadAndPlayUnionNS.createDowndAndPlayTask(n[0], n[1], n[2], !0).then(n => {
                        e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success, n)
                    }).catch()
                } while (0)
            }

            getXmpCoreVersion(e, t, i, n) {
                a.isNullOrUndefined(e) || a.isNullOrUndefined(t) || a.isNullOrUndefined(i) || o.default.getXmpCoreVersion().then(n => {
                    e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success, n)
                }).catch()
            }

            getXmpBuildNum(e, t, i, n) {
                a.isNullOrUndefined(e) || a.isNullOrUndefined(t) || a.isNullOrUndefined(i) || o.default.getXmpBuildNum().then(n => {
                    e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success, n)
                }).catch()
            }

            getXmpPath(e, t, i, n) {
                if (a.isNullOrUndefined(e) || a.isNullOrUndefined(t) || a.isNullOrUndefined(i)) return;
                let o = r.DownloadAndPlayNS.getXmpPath();
                e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success, o)
            }

            getXmpReg(e, t, i, n) {
                do {
                    if (a.isNullOrUndefined(e) || a.isNullOrUndefined(t) || a.isNullOrUndefined(i)) break;
                    if (a.isNullOrUndefined(n) || a.isNullOrUndefined(n[0])) {
                        e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let o = n[0];
                    if (a.isNullOrUndefined(o) || "" === o) {
                        e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let l = r.DownloadAndPlayNS.getXmpReg(o);
                    e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success, l)
                } while (0)
            }

            getXmpUserDataPath(e, t, i, n) {
                a.isNullOrUndefined(e) || a.isNullOrUndefined(t) || a.isNullOrUndefined(i) || o.default.getXmpUserDataPath().then(n => {
                    e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success, n)
                }).catch()
            }
        };
        e.registerNativeFunction = function () {
            t.registerNativeFunction()
        }
    }(t.DownloadAndPlayNaviteFunctionNS || (t.DownloadAndPlayNaviteFunctionNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(0), o = i(32), r = i(23), s = i(14), l = i(327), d = i(442), u = i(444), c = i(26), h = i(17),
        f = i(22), g = i(7), p = i(25), v = i(2), m = i(6), y = a.default.getLogger("SkinNaviteFunction"),
        k = m.default(v.join(__rootDir, "../bin/ThunderHelper.node"));
    !function (e) {
        const t = new class {
            constructor() {
                this.isRegister = !1, l.default.on("changeSkin", this.onChangeSkin), d.default.on("changeSkin", this.onChangeSpeedCurveSkin), u.default.on("changeSkin", this.onChangeSuspensionSkin)
            }

            registerNativeFunction() {
                if (!this.isRegister) {
                    this.isRegister = !0;
                    let e = [{functionName: "GetSkinInfo", nativeFunc: this.getSkinInfo}, {
                        functionName: "SetSkinInfo",
                        nativeFunc: this.setSkinInfo
                    }, {
                        functionName: "GetSpeedCurveSkinInfo",
                        nativeFunc: this.getSpeedCurveSkinInfo
                    }, {
                        functionName: "SetSpeedCurveSkinInfo",
                        nativeFunc: this.setSpeedCurveSkinInfo
                    }, {functionName: "SetShakeInfo", nativeFunc: this.setShakeInfo}, {
                        functionName: "GetShakeInfo",
                        nativeFunc: this.getShakeInfo
                    }, {
                        functionName: "ClickSpeedCurveIcon",
                        nativeFunc: this.clickSpeedCurveIcon
                    }, {
                        functionName: "ShowIndividuation",
                        nativeFunc: this.showIndividuation
                    }, {
                        functionName: "GetSuspensionSkinInfo",
                        nativeFunc: this.getSuspensionSkinInfo
                    }, {functionName: "SetSuspensionSkinInfo", nativeFunc: this.setSuspensionSkinInfo}];
                    o.NativeCallNS.registerNativeFunction(e)
                }
            }

            getSkinInfo(e, t, i) {
                do {
                    if (s.ThunderUtil.isUndef(e) || s.ThunderUtil.isUndef(t) || s.ThunderUtil.isUndef(i)) break;
                    let n = l.default.getSkinInfo();
                    if (s.ThunderUtil.isUndef(n)) {
                        e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    y.information(n), e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.Success, n)
                } while (0)
            }

            setSkinInfo(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (s.ThunderUtil.isUndef(e) || s.ThunderUtil.isUndef(t) || s.ThunderUtil.isUndef(i)) break;
                        if (s.ThunderUtil.isUndef(a) || s.ThunderUtil.isUndef(a[0])) {
                            e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        try {
                            yield l.default.setSkinInfo(a[0], a[1], a[2])
                        } catch (n) {
                            e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.Success)
                    } while (0)
                })
            }

            onChangeSkin(e, t, i) {
                do {
                    if (s.ThunderUtil.isUndef(e)) break;
                    y.information(e), c.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnChangeSkin", e, t, i), h.ipcRenderer.send("OnChangeSkin", e)
                } while (0)
            }

            getSpeedCurveSkinInfo(e, t, i) {
                do {
                    if (s.ThunderUtil.isUndef(e) || s.ThunderUtil.isUndef(t) || s.ThunderUtil.isUndef(i)) break;
                    let n = d.default.getSkinInfo();
                    if (s.ThunderUtil.isUndef(n)) {
                        e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    y.information(n), e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.Success, n)
                } while (0)
            }

            setSpeedCurveSkinInfo(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (s.ThunderUtil.isUndef(e) || s.ThunderUtil.isUndef(t) || s.ThunderUtil.isUndef(i)) break;
                        if (s.ThunderUtil.isUndef(a) || s.ThunderUtil.isUndef(a[0])) {
                            e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        try {
                            yield d.default.setSkinInfo(a[0], a[1], a[2])
                        } catch (n) {
                            e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.Success)
                    } while (0)
                })
            }

            setShakeInfo(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (s.ThunderUtil.isUndef(e) || s.ThunderUtil.isUndef(t) || s.ThunderUtil.isUndef(i)) break;
                        if (s.ThunderUtil.isUndef(a)) {
                            e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        try {
                            c.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnChangeShake", a[0], a[1])
                        } catch (n) {
                            e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.Success)
                    } while (0)
                })
            }

            getShakeInfo(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (s.ThunderUtil.isUndef(e) || s.ThunderUtil.isUndef(t) || s.ThunderUtil.isUndef(i)) break;
                        let n = yield l.default.getShakeInfo(a[0]);
                        e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.Success, n)
                    } while (0)
                })
            }

            clickSpeedCurveIcon(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (s.ThunderUtil.isUndef(e) || s.ThunderUtil.isUndef(t) || s.ThunderUtil.isUndef(i)) break;
                        try {
                            yield g.client.callServerFunction("ShowIndividuation", {
                                activeKey: "skin",
                                skinActiveKey: "speedcurve"
                            })
                        } catch (n) {
                            e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.Success)
                    } while (0)
                })
            }

            onChangeSpeedCurveSkin(e, t, i) {
                do {
                    if (s.ThunderUtil.isUndef(e)) break;
                    y.information("onChangeSpeedCurveSkin", e), c.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnChangeSpeedCurveSkin", e, t, i)
                } while (0)
            }

            showIndividuation(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (s.ThunderUtil.isUndef(e) || s.ThunderUtil.isUndef(t) || s.ThunderUtil.isUndef(i)) break;
                        if (s.ThunderUtil.isUndef(a)) {
                            e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let n;
                        try {
                            let o = a[0];
                            "string" == typeof o && (o = JSON.parse(o)), n = yield f.MessageBox.customIndividuation("Individuation", Object.assign({
                                singleton: !0,
                                version: k.getFileVersion(v.join(__rootDir, "../../Thunder.exe")),
                                dynamicSkinVersion: p.default.getConfigInfo("dynamicSkinVersion")
                            }, o || {}), {modal: !1, alwaysOnTop: !0, webPreferences: {webSecurity: !1}})
                        } catch (n) {
                            e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.Success, n)
                    } while (0)
                })
            }

            getSuspensionSkinInfo(e, t, i) {
                do {
                    if (s.ThunderUtil.isUndef(e) || s.ThunderUtil.isUndef(t) || s.ThunderUtil.isUndef(i)) break;
                    let n = u.default.getSkinInfo();
                    if (s.ThunderUtil.isUndef(n)) {
                        e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    y.information(n), e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.Success, n)
                } while (0)
            }

            setSuspensionSkinInfo(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (s.ThunderUtil.isUndef(e) || s.ThunderUtil.isUndef(t) || s.ThunderUtil.isUndef(i)) break;
                        if (s.ThunderUtil.isUndef(a) || s.ThunderUtil.isUndef(a[0])) {
                            e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        try {
                            yield u.default.setSkinInfo(a[0], a[1], a[2])
                        } catch (n) {
                            e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        e.callNativeFunctionCallback(t, i, r.NativeFunctionErrorCode.Success)
                    } while (0)
                })
            }

            onChangeSuspensionSkin(e, t, i) {
                do {
                    if (s.ThunderUtil.isUndef(e)) break;
                    y.information("onChangeSuspensionSkin", e), c.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnChangeSuspensionSkin", e, t, i)
                } while (0)
            }
        };
        e.registerNativeFunction = function () {
            t.registerNativeFunction()
        }
    }(t.SkinNaviteFunctionNS || (t.SkinNaviteFunctionNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(32), o = i(23), r = i(14), s = i(128), l = i(446);
    !function (e) {
        const t = new class {
            constructor() {
                this.isRegister = !1
            }

            registerNativeFunction() {
                if (!this.isRegister) {
                    this.isRegister = !0;
                    let e = [{
                        functionName: "GetVipTaskInfo",
                        nativeFunc: this.getVipTaskInfo
                    }, {
                        functionName: "GetVipSubTaskInfo",
                        nativeFunc: this.getVipSubTaskInfo
                    }, {
                        functionName: "GetVipLabelConfig",
                        nativeFunc: this.getVipLabelConfig
                    }, {functionName: "ClickTryAcclerateBtn", nativeFunc: this.clickTryAcclerateBtn}];
                    a.NativeCallNS.registerNativeFunction(e)
                }
            }

            getVipTaskInfo(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (r.ThunderUtil.isUndef(e) || r.ThunderUtil.isUndef(t) || r.ThunderUtil.isUndef(i)) break;
                        if (!a || !a[0]) {
                            e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let n = void 0, l = a[0], d = yield s.VipPluginFunctionNS.getVipTaskInfo(l);
                        d && (n = JSON.stringify(d)), e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.Success, n)
                    } while (0)
                })
            }

            getVipSubTaskInfo(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (r.ThunderUtil.isUndef(e) || r.ThunderUtil.isUndef(t) || r.ThunderUtil.isUndef(i)) break;
                        if (!a || r.ThunderUtil.isUndef(a[0]) || r.ThunderUtil.isUndef(a[1])) {
                            e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let n = void 0, l = a[0], d = a[1], u = yield s.VipPluginFunctionNS.getVipSubTaskInfo(l, d);
                        u && (n = JSON.stringify(u)), e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.Success, n)
                    } while (0)
                })
            }

            getVipLabelConfig(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (r.ThunderUtil.isUndef(e) || r.ThunderUtil.isUndef(t) || r.ThunderUtil.isUndef(i)) break;
                        if (!a || r.ThunderUtil.isUndef(a[0])) {
                            e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let n = a[0], s = yield l.VipLableConfigNS.getConfig(n), d = void 0;
                        s && (d = JSON.stringify(s)), e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.Success, d)
                    } while (0)
                })
            }

            clickTryAcclerateBtn(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (r.ThunderUtil.isUndef(e) || r.ThunderUtil.isUndef(t) || r.ThunderUtil.isUndef(i)) break;
                        if (!a || !a[0]) {
                            e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let n = a[0], l = a[1];
                        yield s.VipPluginFunctionNS.clickTryAcclerateBtn(n, l), e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.Success)
                    } while (0)
                })
            }
        };
        e.registerNativeFunction = function () {
            t.registerNativeFunction()
        }
    }(t.VipNaviteFunctionNS || (t.VipNaviteFunctionNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(12), r = i(0), s = i(32), l = i(4), d = i(23), u = i(129), c = i(3), h = i(11), f = i(6),
        g = i(26), p = r.default.getLogger("NativeFunction.Login"), v = u.SubtitleManagerNS.getSubtitleManger(),
        m = h.DownloadKernelTaskManager.getTaskManager(), y = f.default(a.join(__rootDir, "../bin/ThunderHelper.node"));
    !function (e) {
        const t = new class {
            constructor() {
                this.isRegister = !1
            }

            registerNativeFunction() {
                if (!this.isRegister) {
                    this.isRegister = !0;
                    let e = [{
                        functionName: "SubtitleQuerySubtitleByCid",
                        nativeFunc: this.querySubtitleByCid
                    }, {
                        functionName: "SubtitleQuerySubtitleByName",
                        nativeFunc: this.querySubtitleByName
                    }, {
                        functionName: "SubtitleGetFileList",
                        nativeFunc: this.getFileList
                    }, {
                        functionName: "SubtitleDownload",
                        nativeFunc: this.downloadSubtitle
                    }, {functionName: "SubtitleOpen", nativeFunc: this.openSubtitle}];
                    s.NativeCallNS.registerNativeFunction(e), v.attachListener(u.SubtitleManagerNS.SubtitleEvent.DownloadSuccess, (e, t, i) => {
                        g.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnSubtitleDownloadSuccess", e, t, JSON.stringify(i))
                    }), v.attachListener(u.SubtitleManagerNS.SubtitleEvent.DownloadFail, (e, t, i) => {
                        g.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnSubtitleDownloadFail", e, t, JSON.stringify(i))
                    })
                }
            }

            querySubtitleByCid(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (l.isNullOrUndefined(e) || l.isNullOrUndefined(t) || l.isNullOrUndefined(i)) break;
                        if (!a || !a[0] || !a[1]) {
                            e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let n = a[0], o = a[1], r = yield v.querySubtitleByCid(n, o);
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, JSON.stringify(r))
                    } while (0)
                })
            }

            querySubtitleByName(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (l.isNullOrUndefined(e) || l.isNullOrUndefined(t) || l.isNullOrUndefined(i)) break;
                        if (!a || !a[0] || !a[1]) {
                            e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let n = a[0], o = a[1], r = yield v.querySubtitleByName(n, o);
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, JSON.stringify(r))
                    } while (0)
                })
            }

            getFileList(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (l.isNullOrUndefined(e) || l.isNullOrUndefined(t) || l.isNullOrUndefined(i)) break;
                        if (!a || !a[0]) {
                            e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let n = a[0], o = v.getDisaplayName(n);
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, JSON.stringify(o))
                    } while (0)
                })
            }

            downloadSubtitle(e, t, i, a) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (l.isNullOrUndefined(e) || l.isNullOrUndefined(t) || l.isNullOrUndefined(i)) break;
                        if (!(a && a[0] && a[1] && a[2])) {
                            e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let n = null;
                        try {
                            n = JSON.parse(a[0])
                        } catch (e) {
                            p.error("downloadSubtitle invalid param! JSON parse failed! e:", e)
                        }
                        if (!n) {
                            e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let o = a[1], r = a[2], s = yield v.downloadSubtitle(n, o, r);
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, s)
                    } while (0)
                })
            }

            openSubtitle(e, t, i, r) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (l.isNullOrUndefined(e) || l.isNullOrUndefined(t) || l.isNullOrUndefined(i)) break;
                        if (!r || !r[0] || !r[1]) {
                            e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.ParamError);
                            break
                        }
                        let n = r[0], s = r[1], u = m.getTaskFromTaskId(n);
                        if (!u) break;
                        let h = u.getTaskName(), f = u.getType(), g = u.getSavePath();
                        f === c.DownloadKernel.TaskType.Bt && u.getExtraObject().getDownloadFile().length > 1 && (g = a.join(g, h));
                        let p = y.shellExecute(0, "open", a.join(g, s), null, null, "SW_SHOW");
                        if (p <= 32) {
                            let e = g + "\\.";
                            yield(yield o.asyncRemoteCall.getShell()).showItemInFolder(e)
                        }
                        e.callNativeFunctionCallback(t, i, d.NativeFunctionErrorCode.Success, p)
                    } while (0)
                })
            }
        };
        e.registerNativeFunction = function () {
            t.registerNativeFunction()
        }
    }(t.SubtitleManagerNaviteFunctionNS || (t.SubtitleManagerNaviteFunctionNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(4), a = i(32), o = i(26), r = i(99), s = i(23), l = r.ShouleiListSyncNS.getMananger();
    !function (e) {
        const t = new class {
            constructor() {
                this.isRegister = !1, l.attachEvent("OnConnectStateChanged", e => {
                    o.NativeCallHostModule.nativeCallHost.fireNativeEvent("OnShouleiConnectStateChanged", e)
                })
            }

            registerNativeFunction() {
                if (!this.isRegister) {
                    this.isRegister = !0;
                    let e = [{functionName: "GetShouleiConnectState", nativeFunc: this.getShouleiConnectState}];
                    a.NativeCallNS.registerNativeFunction(e)
                }
            }

            getShouleiConnectState(e, t, i, a) {
                do {
                    if (n.isNullOrUndefined(e) || n.isNullOrUndefined(t) || n.isNullOrUndefined(i)) break;
                    e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success, l.getState())
                } while (0)
            }
        };
        e.registerNativeFunction = function () {
            t.registerNativeFunction()
        }
    }(t.ShouleiConnectNaviteFunctionNS || (t.ShouleiConnectNaviteFunctionNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(5), r = i(10), s = i(13), l = i(36), d = i(414), u = i(88), c = i(3), h = i(30), f = i(15),
        g = i(134), p = i(447), v = i(12), m = i(0), y = i(98), k = i(331), T = i(51), w = i(43), C = i(49), S = i(46),
        b = i(9), I = i(24), _ = i(40), A = i(130), D = i(6), x = i(7), N = i(41), E = i(22), P = i(37), M = i(29),
        O = D.default(a.join(__rootDir, "../bin/ThunderHelper.node")),
        F = k.MsgQueueManagerNS.MsgQueue.getInstance().getQueue("notification"),
        L = f.DownloadKernelEventManager.getEventManager(), B = m.default.getLogger("task-helper"),
        U = C.ToastNotifyManagerNS.getToastNotifyManger(), R = y.MsgQueueNS.MsgPriority.Download,
        K = _.DownloadKernelCategoryViewManager.getCategoryViewManager(),
        W = M.DownloadKernelCategoryManager.getCategoryManager();
    const V = new class {
        init() {
            this.attachConfigInitFinished(), this.attachTaskStatusChanged(), this.attachTaskCreated()
        }

        calculateSurplusTime(e) {
            let t = [9, 12, 20, 21, 22, 23], i = {surplusTime: -9999, taskTye: 2}, n = new Date, a = n.getHours(),
                o = n.getMinutes(), r = n.getSeconds(), s = 0, l = new Date(e);
            do {
                if (a >= 23) break;
                if (0 !== e && l.getTime() + 12096e5 > n.getTime()) {
                    B.information("consumptionTips is in 14day", l.getTime(), n.getTime());
                    break
                }
                if (0 === o && 0 === r) {
                    for (s = 0; s < t.length; ++s) if (a === t[s]) {
                        i.surplusTime = 0, 9 === t[s] ? i.taskTye = 0 : 20 !== t[s] && 21 !== t[s] && 22 !== t[s] || (i.taskTye = 1);
                        break
                    }
                } else {
                    for (s = 0; s < t.length && !(a < t[s]); ++s) ;
                    9 === t[s] ? i.taskTye = 0 : 20 !== t[s] && 21 !== t[s] && 22 !== t[s] || (i.taskTye = 1), i.surplusTime = 1e3 * (60 - r + 60 * (60 - o - 1) + 60 * (t[s] - a - 1) * 60)
                }
            } while (0);
            return i
        }

        attachShowConsumptionTips() {
            let e = "", t = 0;
            if (e = "task_cnt_tag=" + (t = this.getCompletedTaskInfo().totalNumber), b.XLStatNS.trackEvent("business", "downloaded_check_cnt", "", 0, 0, 0, 0, e), B.information("trackEvent", "business", "downloaded_check_cnt", e), e = "task_cnt_tag=" + (t = this.getDownloadingTaskInfo().totalNumber), b.XLStatNS.trackEvent("business", "downloading_check_cnt", "", 0, 0, 0, 0, e), B.information("trackEvent", "business", "downloading_check_cnt", e), "AutoRun" !== A.default.getStartArgs()) return;
            let i = r.ConfigNS.getValue("Consumption", "ShowMainWindowTime", 0),
                n = r.ConfigNS.getValue("Consumption", "HideMainWindowTime", 0),
                a = r.ConfigNS.getValue("Consumption", "ShowTipsTime", 0);
            do {
                if ((i > 0 || n > 0) && Math.abs(i - n) >= 2592e5) {
                    let e = {surplusTime: -1, taskTye: 1};
                    if ((e = this.calculateSurplusTime(a)).surplusTime < 0) break;
                    B.information("consumptionTips calculateSurplusTime", e.surplusTime, e.taskTye), setTimeout(() => {
                        this.onConsumptionNotifiy(e.taskTye)
                    }, e.surplusTime)
                }
            } while (0)
        }

        attachConfigInitFinished() {
            r.ConfigNS.attachListener(s.NodeEventMesssageNS.eventConfigInitFinished, () => {
                this.onConfigInitFinished(), setTimeout(() => {
                    this.attachShowConsumptionTips()
                }, 3e4)
            })
        }

        onConfigInitFinished() {
            this.attachLoadStorageTaskFinish()
        }

        attachLoadStorageTaskFinish() {
            h.DownloadKernelManager.attachListener(s.NodeEventMesssageNS.eventDownloadKernelInitEnd, () => {
                this.autoStartUnfinishTask(), setTimeout(() => {
                    this.autoDeleteNonExistTasks().catch()
                }, 1e4)
            })
        }

        autoDeleteNonExistTasks() {
            return n(this, void 0, void 0, function* () {
                if (r.ConfigNS.getValue("ConfigNormalSession", "ConfigNormal_AutoDeleteNotExistFile", !1)) {
                    let e = yield l.TaskOperatorNs.removeNonExistingTask();
                    if (e > 0) {
                        let t = "已自动删除" + e + "个文件不存在的任务";
                        B.information(t), U.showNotify(C.ToastNotifyManagerNS.notifyIdAutoDeleteNonExistTasks, S.ToastNotifyItemType.GreenNotify, t, 3e3)
                    }
                }
            })
        }

        autoStartUnfinishTask() {
            let e = r.ConfigNS.getValue("ConfigNormalSession", "ConfigNormal_MaxRunningTaskCount", 5);
            w.DownloadDispatchNS.setStartTaskCount(e), r.ConfigNS.getValue("ConfigNormalSession", "ConfigNormal_AutoStartUnFinishedTask", !1) && l.TaskOperatorNs.startAll()
        }

        statJsSdkEvent(e, t, i) {
            do {
                if (null === e) break;
                if (e.getTaskAttribute(c.DownloadKernel.TaskAttribute.GroupTaskId) > 0) break;
                if (e.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskType) !== c.DownloadKernel.TaskType.Group) break;
                if ("ThunderUnion" !== e.getTaskAttribute(c.DownloadKernel.TaskAttribute.Origin)) break;
                let n = e.getId();
                const a = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.FileSize);
                let o = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskName), r = encodeURIComponent(o),
                    s = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.Gcid), l = e.getExtraObject();
                if (null === l || void 0 === l) break;
                let d = `taskid=${n},filesize=${a},filename=${r},gcid=${s},filenum=${l.getSubTaskCount()}`;
                if ("js_grouptask_download_success" === t) {
                    if (null !== a && void 0 !== a && a >= 1048576) {
                        let t = 0, i = 0, n = 0, a = 0, o = e.getTaskChannelInfo();
                        if (null !== o && void 0 !== o) {
                            void 0 !== o.originSize && (t = this.getSizeFormat(o.originSize)), null !== o.p2sSize && void 0 !== o.p2sSize && (i = this.getSizeFormat(o.p2sSize)), null !== o.p2pSize && void 0 !== o.p2pSize && (n = this.getSizeFormat(o.p2pSize));
                            let e = 0;
                            null !== o.offlineSize && void 0 !== o.offlineSize && (e = o.offlineSize), null !== o.dcdnSize && void 0 !== o.dcdnSize && (e += o.dcdnSize), d = `${d},ysdzh=${t},jxjs=${i},P2P=${n},hyjs=${a = this.getSizeFormat(e)}`
                        }
                    }
                } else if ("js_grouptask_download_fail" === t) {
                    let t = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.ErrorCode);
                    d = 0 === t ? `${d},errorcode=${l.getErrorCodes().join(";")}` : `${d},errorcode=${t}`
                }
                void 0 !== i && (d = `${d},${i}`);
                let u = "core_operate";
                B.information("trackEvent", u, t, d), b.XLStatNS.trackEvent(u, t, "", 0, 0, 0, 0, d)
            } while (0)
        }

        getSizeFormat(e) {
            let t = 0;
            do {
                if (void 0 === e || null === e || e <= 0) break;
                t = Number((e / 1048576).toFixed(2))
            } while (0);
            return t
        }

        attachTaskCreated() {
            L.attachTaskEvent(c.DownloadKernel.TaskEventType.TaskCreated, (...e) => n(this, void 0, void 0, function* () {
                do {
                    if (!e) break;
                    if (e[0] !== c.DownloadKernel.TaskEventType.TaskCreated) break;
                    let t = e[1];
                    if (!t) break;
                    let i = yield x.client.callServerFunction("GetTpPeerId");
                    for (let e of t) {
                        let t = "location=", n = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.CategoryId);
                        if (-1 !== n) if (W.isPrivateCategory(n)) t += "private"; else {
                            let e = W.getCategoryFromId(n);
                            e && (t += e.getName())
                        } else {
                            let i = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.SavePath),
                                n = yield v.asyncRemoteCall.getApp(), a = yield n.getPath("desktop"),
                                o = yield n.getPath("documents"),
                                s = r.ConfigNS.getValue("TaskDefaultSettings", "InitPath", "");
                            "\\" === i[i.length - 1] && (i = i.slice(0, i.length - 1)), "\\" === s[s.length - 1] && (s = s.slice(0, s.length - 1)), i.toUpperCase() === a.toUpperCase() ? t += "desk" : i.toUpperCase() === o.toUpperCase() ? t += "my_file" : i.toUpperCase() === s.toUpperCase() ? t += "xl_download" : t += "other"
                        }
                        let a = e.getExtraObject();
                        if (a) {
                            let e = a.getUserData(T.TaskUserDataGUID.guidBirdKey, "birdKey");
                            if (e) {
                                let i = e.match(/[Xx]([0-9a-zA-Z])+/g);
                                i && i.length > 0 && (t += `,pass_word=${i[0]}`)
                            }
                        }
                        t += `,cpeerid=${i}`, d.statCoreEvent(e, "createtask", t).catch(), this.statJsSdkEvent(e, "js_grouptask_create", t)
                    }
                } while (0)
            }))
        }

        attachTaskStatusChanged() {
            L.attachTaskEvent(c.DownloadKernel.TaskEventType.StatusChanged, (...e) => {
                do {
                    if (!e) break;
                    if (e[0] !== c.DownloadKernel.TaskEventType.StatusChanged) break;
                    let t = e[1];
                    if (!t) break;
                    for (let e = 0; e < t.length; ++e) {
                        let i = t[e];
                        if (!i) continue;
                        let n = i.getTaskStatus();
                        if (i.getTaskAttribute(c.DownloadKernel.TaskAttribute.GroupTaskId) > 0) {
                            n === c.DownloadKernel.TaskStatus.Succeeded && this.checkOpenOnFinish(i).catch();
                            continue
                        }
                        let a = i.getTaskAttribute(c.DownloadKernel.TaskAttribute.Background);
                        if (n === c.DownloadKernel.TaskStatus.Succeeded) {
                            let e = `task_stop_type=success,errorcode=0,gcid=${i.getTaskAttribute(c.DownloadKernel.TaskAttribute.Gcid)},is_retry=${u.DownloadJammedNS.isJammedOnce(i.getId()) ? 1 : 0}`;
                            d.statCoreEvent(i, "download_task_result", e).catch();
                            let t = i.getTaskAttribute(c.DownloadKernel.TaskAttribute.CreateTime);
                            e = `downloadtime=${(i.getTaskAttribute(c.DownloadKernel.TaskAttribute.CompletionTime) - t) / 1e3}`, this.statJsSdkEvent(i, "js_grouptask_download_success", e), a || this.onTaskFinished(i).catch()
                        } else if (n === c.DownloadKernel.TaskStatus.Failed) {
                            let e = i.getTaskAttribute(c.DownloadKernel.TaskAttribute.Gcid),
                                t = `task_stop_type=fail,errorcode=${i.getTaskAttribute(c.DownloadKernel.TaskAttribute.ErrorCode)},gcid=${e},is_retry=0`;
                            d.statCoreEvent(i, "download_task_result", t).catch(), this.statJsSdkEvent(i, "js_grouptask_download_fail"), a || this.onTaskFailed(i).catch()
                        }
                    }
                } while (0)
            }), L.attachTaskEvent(c.DownloadKernel.TaskEventType.TaskDestroying, (...e) => {
                do {
                    if (!e) break;
                    if (e[0] !== c.DownloadKernel.TaskEventType.TaskDestroying) break;
                    let t = e[1];
                    if (!t) break;
                    let i = e[2];
                    for (let e = 0; e < t.length; ++e) {
                        let n = t[e];
                        if (n) {
                            if (n.getTaskAttribute(c.DownloadKernel.TaskAttribute.Background)) break;
                            n.getTaskAttribute(c.DownloadKernel.TaskAttribute.GroupTaskId) > 0 || this.onTaskDestroy(n, i).catch()
                        }
                    }
                } while (0)
            }), L.attachTaskEvent(c.DownloadKernel.TaskEventType.TaskMovedEnd, (...e) => {
                do {
                    if (!e) break;
                    if (e[0] !== c.DownloadKernel.TaskEventType.TaskMovedEnd) break;
                    let t = e[1];
                    if (!t) break;
                    for (let e = 0; e < t.length; ++e) {
                        let i = t[e];
                        if (i) {
                            if (i.getTaskAttribute(c.DownloadKernel.TaskAttribute.Background)) break;
                            i.getTaskAttribute(c.DownloadKernel.TaskAttribute.GroupTaskId) > 0 || this.onTaskMoveEnd(i).catch()
                        }
                    }
                } while (0)
            })
        }

        getTaskUrl(e) {
            let t = "", i = e.getType();
            return i === c.DownloadKernel.TaskType.Bt ? t = e.getExtraObject().getSeedFilePath() : i !== c.DownloadKernel.TaskType.Emule && i !== c.DownloadKernel.TaskType.P2sp || (t = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskUrl)), t
        }

        getDownloadFileReportedData(e) {
            let t = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.FileSize),
                i = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.Cid), n = this.getTaskUrl(e), a = 0, o = 0,
                r = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.DownloadSize),
                s = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.DownloadingPeriod),
                l = e.getTaskChannelInfo().originSize;
            B.information("getDownloadFileReportedData fileSize=", t, ";cid=", i, ";url=", n, ";recvValidSize=", r, ";period=", s, ";originalsize=", l), null !== t && void 0 !== t && null !== s && void 0 !== s && null !== l && void 0 !== l && 0 !== l && null !== r && void 0 !== r && 0 !== r ? o = Math.floor((t / l - t / r) * s) : a = 1;
            let d = JSON.stringify({
                type: "dlfile_report",
                data: {dlFileSize: t, cid: i, url: n, deadLinks: a, saveTime: o}
            });
            return B.information("getDownloadFileReportedData data=", d), d
        }

        onTaskFinished(e) {
            return n(this, void 0, void 0, function* () {
                let t = r.ConfigNS.getValue("BossKey", "BossKeyState", !1);
                const i = r.ConfigNS.getValue("ConfigMsg", "ConfigMsg_Finish", !0),
                    n = yield v.asyncRemoteCall.getCurrentWindow(), a = n.isMinimized(), o = n.isVisible(),
                    s = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskName),
                    d = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.FileSize), u = e.getTaskBaseInfo(),
                    h = u.taskType === c.DownloadKernel.TaskType.Group, f = e.getIsPrivate();
                let m = !1;
                const y = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.CategoryId);
                let k = W.getCategoryFromId(y);
                k && k.getName() === M.CategoryManager.panCategoryName && (m = !0);
                const w = null !== (yield(yield v.asyncRemoteCall.getBrowserWindow()).getFocusedWindow());
                if (I.LoginHelperNS.loginHelper.channel(this.getDownloadFileReportedData(e)), t || this.playTaskFinishedSound().catch(), this.openFinishedTask(e).catch(), h) {
                    let t = e.getExtraObject().getUserData(T.TaskUserDataGUID.guidDownloadCompleteInstall, "isImmediatelyInstall");
                    null !== t && void 0 !== t && "1" === t && l.TaskOperatorNs.executeInstallFile(e).catch(), this.createShortcut(e).catch()
                }
                if (!t && i && (a || !o || !w) && s && !f) {
                    if (h && d < 10485760) return;
                    B.information("DownloadComplete", F), F.enQueue({
                        callback: () => {
                            B.information("trackEvent", "download_leftpanel", "dl_finished_tips_show", "panel_type=mypc"), b.XLStatNS.trackEvent("download_leftpanel", "dl_finished_tips_show", "", 0, 0, 0, 0, "panel_type=mypc"), p.NotificationNS.notify({
                                type: g.Notification.TipsType.DownloadComplete,
                                data: {exData: {isPanDownload: m}, taskBase: u},
                                width: 400,
                                height: 205
                            }).catch()
                        }, name: "download", priority: R
                    }), p.NotificationNS.getCurrentWindow() ? F.getCurrentProperty() < R && p.NotificationNS.close().catch() : F.deQueue()
                }
            })
        }

        onTaskDestroy(e, t) {
            return n(this, void 0, void 0, function* () {
                do {
                    if (!t) break;
                    if (e.getTaskBaseInfo().taskType !== c.DownloadKernel.TaskType.Group) break;
                    if (e.getTaskStatus() !== c.DownloadKernel.TaskStatus.Succeeded) break;
                    let i = e.getExtraObject().getUserData(T.TaskUserDataGUID.guidCreateShortcut, "createShortcut");
                    if (!i || i.length <= 0) break;
                    let n = null;
                    try {
                        n = JSON.parse(i)
                    } catch (e) {
                        B.warning(e)
                    }
                    if (!n || !n.name || !n.targetFile) {
                        B.information("invalid createShortcut", n);
                        break
                    }
                    let r = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskId),
                        s = N.TaskCtrlOperatorNS.getSavePathByFileName(r, n.targetFile);
                    if (!(yield o.FileSystemAWNS.existsAW(s))) {
                        B.warning("targetFile not exist!", s);
                        break
                    }
                    let l = n.name.replace(/[*?/\\:|<>\"]/g, "_"), d = yield v.asyncRemoteCall.getApp(),
                        u = a.join(yield d.getPath("desktop"), `${l}.lnk`);
                    (yield o.FileSystemAWNS.existsAW(u)) && (yield o.FileSystemAWNS.unlinkAW(u))
                } while (0)
            })
        }

        onTaskMoveEnd(e) {
            return n(this, void 0, void 0, function* () {
                do {
                    if (e.getTaskBaseInfo().taskType !== c.DownloadKernel.TaskType.Group) break;
                    if (e.getTaskStatus() !== c.DownloadKernel.TaskStatus.Succeeded) break;
                    let t = e.getExtraObject().getUserData(T.TaskUserDataGUID.guidCreateShortcut, "createShortcut");
                    if (!t || t.length <= 0) break;
                    let i = null;
                    try {
                        i = JSON.parse(t)
                    } catch (e) {
                        B.warning(e)
                    }
                    if (!i || !i.name || !i.targetFile) {
                        B.information("invalid createShortcut", i);
                        break
                    }
                    let n = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskId),
                        r = N.TaskCtrlOperatorNS.getSavePathByFileName(n, i.targetFile);
                    if (!(yield o.FileSystemAWNS.existsAW(r))) {
                        B.warning("targetFile not exist!", r);
                        break
                    }
                    let s = i.name.replace(/[*?/\\:|<>\"]/g, "_"), l = yield v.asyncRemoteCall.getApp(),
                        d = a.join(yield l.getPath("desktop"), `${s}.lnk`);
                    (yield o.FileSystemAWNS.existsAW(d)) && (yield o.FileSystemAWNS.unlinkAW(d), B.information("createShortcut", i, "lnkPath", d), yield new Promise(e => {
                        O.createShortcut(d, r, i.runParams || "", r, t => {
                            B.information("createShortcut result", t), e(t)
                        })
                    }))
                } while (0)
            })
        }

        getCompletedTaskInfo() {
            let e = [], t = 0, i = K.getCategoryViewFromId(c.DownloadKernel.CategroyViewID.Completed).getTasks(),
                n = new Date;
            for (let [, a]of i) if (null !== a && a.getTaskStatus() === c.DownloadKernel.TaskStatus.Succeeded) {
                let i = a.getTaskAttribute(c.DownloadKernel.TaskAttribute.CompletionTime),
                    o = a.getTaskAttribute(c.DownloadKernel.TaskAttribute.UserRead);
                if (n.getTime() - i <= 2592e6 && 0 === o) {
                    let i = a.getTaskBaseInfo().taskName;
                    t < 3 && e.push({taskName: i, percent: ""}), t += 1
                }
            }
            return {taskList: e, totalNumber: t}
        }

        getDownloadingTaskInfo() {
            let e = [], t = 0, i = K.getCategoryViewFromId(c.DownloadKernel.CategroyViewID.Downloading).getTasks();
            for (let [, n]of i) {
                if (null !== n && n.getTaskStatus() === c.DownloadKernel.TaskStatus.Stopped) {
                    const t = n.getTaskBaseInfo();
                    let i = t.taskName, a = 0;
                    0 !== t.fileSize && (a = t.downloadSize / t.fileSize), a >= 1 && (a = .9999);
                    let o = (100 * a).toFixed(0) + "%";
                    "100%" === o && (o = "99%"), e.length < 3 && e.push({taskName: i, percent: o})
                }
                t += 1
            }
            return {taskList: e, totalNumber: t}
        }

        onConsumptionNotifiy(e) {
            let t = {taskList: [], totalNumber: 0}, i = 4, a = "downloaded_notcheck_popup_show", o = "task_cnt=";
            0 === e ? (t = this.getDownloadingTaskInfo(), a = "not_downloaded_popup_show") : 1 === e ? (t = this.getCompletedTaskInfo(), i = 3) : (t = this.getCompletedTaskInfo(), i = 3, 0 === t.totalNumber && (i = 4, a = "not_downloaded_popup_show", t = this.getDownloadingTaskInfo()));
            do {
                if (0 === t.totalNumber) break;
                o += t.totalNumber;
                let e = new Date;
                F.enQueue({
                    callback: () => {
                        B.information("trackEvent", "business", a, o), b.XLStatNS.trackEvent("business", a, "", 0, 0, 0, 0, o);
                        let s = "亲,";
                        I.LoginHelperNS.loginHelper.getAllUserInfo(a => n(this, void 0, void 0, function* () {
                            (yield x.client.callServerFunction("IsLogined")) && (s = a.nickName), B.information("consumpiton consumptionMsgType,taskInfo", i, t), p.NotificationNS.notify({
                                type: g.Notification.TipsType.ConsumptionTips,
                                data: {msgType: i, userName: s, fileCountNumber: t.totalNumber, exData: t.taskList},
                                width: 400,
                                height: 272
                            }).catch(), O.IsInFullScreen() ? this.attachShowConsumptionTips() : r.ConfigNS.setValue("Consumption", "ShowTipsTime", e.getTime())
                        }))
                    }, name: "download", priority: R
                }), p.NotificationNS.getCurrentWindow() ? F.getCurrentProperty() < R && p.NotificationNS.close().catch() : F.deQueue()
            } while (0)
        }

        showAuthorizationDlg(e) {
            do {
                if (e.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskType) !== c.DownloadKernel.TaskType.P2sp) break;
                let t = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskUrl), i = new URL(t),
                    n = i.protocol + "//" + i.host;
                E.MessageBox.custom("http-auth-login", {site: n}, {width: 450, height: 240}).then(t => {
                    if (t.action === P.MessageBoxNS.Action.OK) {
                        let i = t.args.username, n = t.args.password || "";
                        if (i) {
                            let t = "Authorization", a = "Basic " + window.btoa(`${encodeURIComponent(i)}:${n}`);
                            e.getExtraObject().setUserData(T.TaskUserDataGUID.guidHttpHeaderField, t, a), B.information("http auth", t, a);
                            let o = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskId);
                            w.DownloadDispatchNS.startTask(o)
                        }
                    }
                }).catch()
            } while (0)
        }

        onTaskFailed(e) {
            return n(this, void 0, void 0, function* () {
                let t = r.ConfigNS.getValue("BossKey", "BossKeyState", !1);
                const i = r.ConfigNS.getValue("ConfigMsg", "ConfigMsg_FailSuggest", !0),
                    n = yield v.asyncRemoteCall.getCurrentWindow(), a = n.isMinimized(), o = n.isVisible(),
                    s = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskName),
                    l = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.FileSize), d = e.getTaskBaseInfo(),
                    u = d.taskType === c.DownloadKernel.TaskType.Group, h = e.getIsPrivate(),
                    f = null !== (yield(yield v.asyncRemoteCall.getBrowserWindow()).getFocusedWindow());
                401 === e.getTaskAttribute(c.DownloadKernel.TaskAttribute.ErrorCode) && this.showAuthorizationDlg(e);
                let m = !1;
                const y = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.CategoryId);
                let k = W.getCategoryFromId(y);
                if (k && k.getName() === M.CategoryManager.panCategoryName && (m = !0), !t && i && (a || !o || !f) && s && !h) {
                    if (u && l < 10485760) return;
                    F.enQueue({
                        callback: () => {
                            B.information("trackEvent", "download_leftpanel", "dl_fail_tips_show", "panel_type=mypc"), b.XLStatNS.trackEvent("download_leftpanel", "dl_fail_tips_show", "", 0, 0, 0, 0, "panel_type=mypc"), p.NotificationNS.notify({
                                type: g.Notification.TipsType.DownloadFail,
                                data: {exData: {isPanDownload: m}, taskBase: d},
                                width: 400,
                                height: 180
                            }).catch()
                        }, name: "download", priority: R
                    }), p.NotificationNS.getCurrentWindow() ? F.getCurrentProperty() < R && p.NotificationNS.close().catch() : F.deQueue()
                }
            })
        }

        playTaskFinishedSound() {
            return n(this, void 0, void 0, function* () {
                if (r.ConfigNS.getValue("ConfigMsg", "ConfigMsg_PlayWaveWhileFinish", !0)) {
                    let e = a.join(__rootDir, "../../download-complete.wav"),
                        t = r.ConfigNS.getValue("ConfigMsg", "ConfigMsg_WavePath", e);
                    (yield o.FileSystemAWNS.existsAW(t)) ? yield new Audio(t).play() : (yield o.FileSystemAWNS.existsAW(e)) && (yield new Audio(e).play())
                }
            })
        }

        checkOpenOnFinish(e) {
            return n(this, void 0, void 0, function* () {
                let t = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskName);
                if (".torrent" === a.extname(t)) {
                    if (r.ConfigNS.getValue("BtGenericSettings", "AutoBTNewTask", !1)) {
                        let t = e.getTaskBaseInfo();
                        yield l.TaskOperatorNs.openTaskItem(t)
                    }
                } else if (1 === e.getTaskAttribute(c.DownloadKernel.TaskAttribute.OpenOnComplete)) {
                    let t = e.getTaskBaseInfo();
                    yield l.TaskOperatorNs.openTaskItem(t)
                }
            })
        }

        openFinishedTask(e) {
            return n(this, void 0, void 0, function* () {
                if (r.ConfigNS.getValue("TaskDefaultSettings", "OpenFile", !1)) {
                    let t = e.getTaskBaseInfo();
                    yield l.TaskOperatorNs.openTaskItem(t)
                } else this.checkOpenOnFinish(e).catch()
            })
        }

        createShortcut(e) {
            return n(this, void 0, void 0, function* () {
                let t = !1;
                do {
                    let i = e.getExtraObject().getUserData(T.TaskUserDataGUID.guidCreateShortcut, "createShortcut");
                    if (!i || i.length <= 0) break;
                    let n = null;
                    try {
                        n = JSON.parse(i)
                    } catch (e) {
                        B.warning(e)
                    }
                    if (!n || !n.name || !n.targetFile) {
                        B.information("invalid createShortcut", n);
                        break
                    }
                    let r = e.getTaskAttribute(c.DownloadKernel.TaskAttribute.TaskId),
                        s = N.TaskCtrlOperatorNS.getSavePathByFileName(r, n.targetFile);
                    if (!(yield o.FileSystemAWNS.existsAW(s))) {
                        B.warning("targetFile not exist!", s);
                        break
                    }
                    let l = n.name.replace(/[*?/\\:|<>\"]/g, "_"), d = yield v.asyncRemoteCall.getApp(),
                        u = a.join(yield d.getPath("desktop"), `${l}.lnk`);
                    (yield o.FileSystemAWNS.existsAW(u)) && (yield o.FileSystemAWNS.unlinkAW(u)), B.information("createShortcut", n, "lnkPath", u), t = yield new Promise(e => {
                        O.createShortcut(u, s, n.runParams || "", s, t => {
                            B.information("createShortcut result", t), e(t)
                        })
                    })
                } while (0);
                return t
            })
        }
    };
    !function (e) {
        e.init = function () {
            V.init()
        }
    }(t.TaskHelperNS || (t.TaskHelperNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(57), o = i(2), r = i(6), s = i(0), l = i(9), d = i(13), u = i(10), c = i(78), h = i(30), f = i(449),
        g = i(95), p = i(36), v = i(43), m = i(49), y = i(46), k = i(77), T = i(334), w = i(17), C = i(28), S = i(333),
        b = i(31), I = i(571), _ = i(42), A = i(25), D = i(7), x = i(5), N = s.default.getLogger("ConfigHandler"),
        E = r.default(o.join(__rootDir, "../bin/ThunderHelper.node")),
        P = m.ToastNotifyManagerNS.getToastNotifyManger();
    const M = new class {
        init() {
            this.attachConfigInitFinished(), u.ConfigNS.attachListener(d.NodeEventMesssageNS.eventConfigValueChanged, (e, t, i, n) => {
                switch (e) {
                    case"ConfigNormalSession":
                        this.onConfigNormalSessionChanged(t, i, n);
                        break;
                    case"TaskDefaultSettings":
                        this.onTaskDefaultSettingsChanged(t, i, n);
                        break;
                    case"ConfigNet":
                        this.onConfigNetChanged(t, i, n);
                        break;
                    case"ConfigMsg":
                        this.onConfigMsgChanged(t, i, n);
                        break;
                    case"Monitor":
                        this.onMonitorChanged(t, i, n);
                        break;
                    case"Proxy":
                        this.onProxyChanged(t, i, n);
                        break;
                    case"BtGenericSettings":
                        this.onBtGenericSettingsChanged(t, i, n);
                        break;
                    case"ConfigNoLimitDownload":
                        this.onConfigNoLimitDownloadChanged(t, i, n);
                        break;
                    case"Others":
                        this.onOthersChanged(t, i, n);
                        break;
                    case"IdleDownload":
                        this.onIdleDownloadChanged(t, i, n);
                        break;
                    case"EMuleGenericSettings":
                        this.onEMuleGenericSettingsChanged(t, i, n);
                        break;
                    case"MagnetGenericSettings":
                        this.onMagnetGenericSettingsChanged(t, i, n);
                        break;
                    case"BossKey":
                        this.onBossKeyChanged(t, i, n);
                        break;
                    case"DiskCache":
                        this.onDiskCacheChanged(t, i, n);
                        break;
                    case"Motitor":
                        this.onMotitorChanged(t, i, n);
                        break;
                    case"ProxySetting":
                        this.onProxySettingChanged(t, i, n)
                }
            }), c.BHOConfigNS.attachListener(d.NodeEventMesssageNS.eventBHOConfigValueChanged, (e, t, i, n) => {
                switch (e) {
                    case"Monitor":
                        this.onBHOConfigMonitorSessionChanged(t, i, n);
                        break;
                    case"EMuleGenericSettings":
                        "EMuleWatchLink" === t && this.handleWatchEmuleLink(i, n);
                        break;
                    case"MagnetGenericSettings":
                        "MagnetWatchLink" === t && this.handleWatchMagnetLink(i, n)
                }
            })
        }

        attachConfigInitFinished() {
            u.ConfigNS.attachListener(d.NodeEventMesssageNS.eventConfigInitFinished, () => {
                this.onConfigInitFinished().catch()
            })
        }

        onConfigInitFinished() {
            return n(this, void 0, void 0, function* () {
                let e = u.ConfigNS.getValue("DiskCache", "DiskCacheSelect", 256);
                h.DownloadKernelManager.setCacheSize(e);
                let t = u.ConfigNS.getValue("ConfigNormalSession", "ConfigNormal_MaxRunningTaskCount", 5);
                if (v.DownloadDispatchNS.setStartTaskCount(t), u.ConfigNS.getValue("ConfigNoLimitDownload", "TaskCountAutoAdd", !1)) {
                    let e = u.ConfigNS.getValue("ConfigNoLimitDownload", "TaskCountAutoAddRate", 100);
                    e = Number(e), !isNaN(e) && e > 0 && v.DownloadDispatchNS.setAutoAddTask(!0, e)
                }
                u.ConfigNS.getValue("ConfigNormalSession", "ConfigNormal_AutoSlowTask2Tail", !1) ? (this.handleAutoSlowTask2Tail(void 0, !0), l.XLStatNS.trackEvent("core_event", "setting_check", "", 0, 0, 0, 0, "auto_move2last=1")) : l.XLStatNS.trackEvent("core_event", "setting_check", "", 0, 0, 0, 0, "auto_move2last=0"), h.DownloadKernelManager.attachListener(d.NodeEventMesssageNS.eventDownloadKernelInitEnd, () => {
                    let e = u.ConfigNS.getValue("ConfigNet", "ConfigNet_Type", "1");
                    if (this.handleDownloadMode(void 0, e), u.ConfigNS.getValue("ConfigNoLimitDownload", "OpenNoLimitDownload", !1)) {
                        let e = u.ConfigNS.getValue("ConfigNoLimitDownload", "NoLimitDownloadFileSize", 30);
                        v.DownloadDispatchNS.setFreeFromScheduleOpen(!0, Number(e))
                    }
                    if (u.ConfigNS.getValue("TaskDefaultSettings", "MaxResourceLimit", !1)) {
                        let e = Number(u.ConfigNS.getValue("TaskDefaultSettings", "MaxResourceCount", "500"));
                        e && b.ThunderKernel.setGlobalConnectionLimit(e), l.XLStatNS.trackEvent("setting_center", "set_max_download_resources_cnt", "", 0, 0, 0, 0, `is_set=1,cnt=${e}`)
                    } else {
                        const e = 4294967295;
                        b.ThunderKernel.setGlobalConnectionLimit(e), l.XLStatNS.trackEvent("setting_center", "set_max_download_resources_cnt", "", 0, 0, 0, 0, "is_set=0")
                    }
                }), h.DownloadKernelManager.attachListener(d.NodeEventMesssageNS.eventDownloadSDKRecover, e => {
                    if (0 === e) {
                        let e = u.ConfigNS.getValue("ConfigNet", "ConfigNet_Type", "1");
                        this.handleDownloadMode(void 0, e)
                    }
                });
                let i = u.ConfigNS.getValue("ConfigNormalSession", "ConfigNormal_AutoRun", !0),
                    n = E.readRegString("HKEY_CURRENT_USER", "Software\\Microsoft\\Windows\\CurrentVersion\\Run", "Thunder");
                if (i && "" === n ? u.ConfigNS.setValue("ConfigNormalSession", "ConfigNormal_AutoRun", 0) : i || "" === n || u.ConfigNS.setValue("ConfigNormalSession", "ConfigNormal_AutoRun", 1), u.ConfigNS.getValue("ConfigNet", "ConfigNet_IdleDownload", !1) && T.ScheduleTaskNS.startFreeDownLoad(), u.ConfigNS.getValue("BtGenericSettings", "AssocTorrent", !0) && f.FileAssociationNS.checkAndRegisterTorrentFile(), 0 === u.ConfigNS.getValue("GenericSettings", "CheckCpu", 0)) {
                    u.ConfigNS.setValue("GenericSettings", "CheckCpu", 1);
                    let e = E.getCpuProcessors();
                    E.getCpuFrequency(t => {
                        let i = "0";
                        i = 1 === e ? "0" : 2 === e || 3 === e ? t < 3500 ? "0" : "1" : 4 === e && t < 3e3 ? "0" : "1", u.ConfigNS.setValue("GenericSettings", "AnimationLevel", i);
                        let n = "cpu_processors=" + e.toString();
                        n += ",cpu_frequency=", n += t.toString(), l.XLStatNS.trackEvent("xdas_client_pro", "cpu_info", "", 0, 0, 0, 0, n)
                    })
                }
                let a = u.ConfigNS.getValue("ProxySetting", "ConfigProxy_Type", "0");
                this.handleProxyTypeChanged(void 0, a), I.BHOConfigHttpServerNS.init().catch(), this.fixBHOFilterSitesForUI(), D.client.attachServerEvent("OnPlayVideo", (e, t) => {
                    t > 32 && this.handleAssociate("xmplite").catch()
                }), (yield A.default.isInitedAw()) && this.handleAssociate("xmp").catch()
            })
        }

        isXmpExist() {
            return n(this, void 0, void 0, function* () {
                let e = _.Common.getXmpPath();
                return x.FileSystemAWNS.existsAW(e)
            })
        }

        isXmpLiteExist() {
            return n(this, void 0, void 0, function* () {
                let e = o.join(__rootDir, "../../XMP/XMP.exe");
                return x.FileSystemAWNS.existsAW(e)
            })
        }

        handleAssociate(e) {
            return n(this, void 0, void 0, function* () {
                if ("1" === u.ConfigNS.getValue("DownloadAndPlay", "AlwaysAssociate", "1")) {
                    let t = _.Common.getLastAssociateExts();
                    if (!t) return void N.information("上次无关联格式");
                    let i = A.default.getConfigInfo("AssociatePlayer", "AssociateXMP"),
                        n = A.default.getConfigInfo("AssociatePlayer", "AssociateXMPLite");
                    if ("xmp" === e) {
                        if (!(yield this.isXmpExist())) return;
                        if (1 !== i) return void N.information("迅雷影音抢关联功能已关闭")
                    } else {
                        if ("xmplite" !== e) return;
                        if (!(yield this.isXmpLiteExist())) return;
                        if (yield this.isXmpExist()) return void N.information("迅雷影音安装了, 组件不抢关联");
                        if (1 !== n) return void N.information("迅雷播放组件抢关联功能已关闭")
                    }
                    let a = o.join(process.execPath, "..\\"), r = o.join(a, "XMP\\AssociateHelper.exe"), s = [];
                    s.push("--associate=" + t), s.push("--xmpdesc=" + e);
                    let l = s.join(" ");
                    N.information(`为${e}抢关联, 关联格式：${t}`), E.shellExecute(0, "open", r, l, "", "SW_HIDE")
                }
            })
        }

        fixBHOFilterSitesForUI() {
            let e = c.BHOConfigNS.getDefaultFilterSitesForUI(), t = e.replace(/\r\n/g, "||");
            t = t.replace(/\n/g, "||");
            let i = c.BHOConfigNS.getValue("Monitor", "FilterSitesForUI", t),
                n = u.ConfigNS.getValue("Monitor", "FilterSitesForUI", e);
            (n = (n = n.replace(/\r\n/g, "||")).replace(/\n/g, "||")) !== i && u.ConfigNS.setValue("Monitor", "FilterSitesForUI", i.replace(/\|\|/g, "\n"))
        }

        onConfigNormalSessionChanged(e, t, i) {
            switch (e) {
                case"ConfigNormal_AutoRun":
                    this.handleAutoRun(t, i);
                    break;
                case"ConfigNormal_AutoStartUnFinishedTask":
                    break;
                case"ConfigNormal_MaxRunningTaskCount":
                    this.handleSetMaxRunningTaskCount(t, i);
                    break;
                case"TaskCountTotalSpeed":
                    break;
                case"ConfigNormal_AutoSlowTask2Tail":
                    this.handleAutoSlowTask2Tail(t, i);
                    break;
                case"ConfigNormal_AutoDeleteNotExistFile":
                    this.handleAutoDeleteNonExistTasks(t, i).catch()
            }
        }

        onTaskDefaultSettingsChanged(e, t, i) {
            switch (e) {
                case"DefaultPath":
                case"UseLastCatalog":
                case"Win7Libraries":
                case"NewTaskStartMode":
                case"OpenFile":
                case"OpenSilenceDownload":
                    break;
                case"AwayModeEnabled":
                    this.handleAwayMode(t, i);
                    break;
                case"NewTaskDlgWithoutMainWnd":
                    this.handleNewTaskDlgWithoutMainWnd(t, i);
                    break;
                case"OrignHostThreads":
                    this.handleSetThreadCount(t, i);
                    break;
                case"MaxResourceLimit":
                    if (i) {
                        let e = Number(u.ConfigNS.getValue("TaskDefaultSettings", "MaxResourceCount", "500"));
                        e && b.ThunderKernel.setGlobalConnectionLimit(e)
                    } else {
                        const e = 4294967295;
                        b.ThunderKernel.setGlobalConnectionLimit(e)
                    }
                    break;
                case"MaxResourceCount":
                    u.ConfigNS.getValue("TaskDefaultSettings", "MaxResourceLimit", !1) && Number(i) && b.ThunderKernel.setGlobalConnectionLimit(Number(i))
            }
        }

        onConfigNetChanged(e, t, i) {
            switch (e) {
                case"ConfigNet_Type":
                    this.handleDownloadMode(t, i);
                    break;
                case"ConfigNet_Custom_DownloadSpeedChk":
                    (i = i) ? v.DownloadDispatchNS.setAutoAddTaskAvailable(!1) : v.DownloadDispatchNS.setAutoAddTaskAvailable(!0);
                    break;
                case"ConfigNet_Custom_MaxDownloadSpeed":
                case"ConfigNet_Custom_MaxUploadSpeed":
                case"ConfigNet_Custom_Time_Switch":
                case"ConfigNet_Custom_Time_Begin_Hour":
                case"ConfigNet_Custom_Time_Begin_Minute":
                case"ConfigNet_Custom_Time_End_Hour":
                case"ConfigNet_Custom_Time_End_Minute":
                    N.information("onConfigNetChanged DownloadMode handleCustomDownloadMode"), g.DownloadModeNS.handleCustomDownloadMode();
                    break;
                case"ConfigNet_OpenMirrorImageIncreaseSpeed":
                    this.handleOpenMirrorImageIncreaseSpeed(t, i);
                    break;
                case"ConfigNet_OpenXunleiP2PIncreaseSpeed":
                    this.handleOpenXunleiP2PIncreaseSpeed(t, i);
                    break;
                case"ConfigNet_IdleDownload":
                    this.handleSetFreedown(t, i)
            }
        }

        onConfigMsgChanged(e, t, i) {
            switch (e) {
                case"ConfigMsg_Finish":
                    break;
                case"ConfigMsg_PlayWaveWhileFinish":
                    this.handlePlayWaveWhileFinish(t, i);
                    break;
                case"ConfigMsg_WavePath":
                case"ConfigMsg_FailSuggest":
                    break;
                case"ConfigMsg_TodayRecommend":
                    N.information("trackEvent", "setting_center", "message_setting", "today_recommend=" + (i ? 1 : 0)), l.XLStatNS.trackEvent("setting_center", "message_setting", "", 0, 0, 0, 0, "today_recommend=" + (i ? 1 : 0))
            }
        }

        onMonitorChanged(e, t, i) {
            switch (e) {
                case"MonitorClipBoard":
                    this.handleMonitorClipBoard(t, i);
                    break;
                case"ShortcutMonitor":
                    break;
                case"WatchTraditionLink":
                    c.BHOConfigNS.setValue("Monitor", "WatchTraditionLink", i ? 1 : 0), c.BHOConfigNS.save().catch();
                    break;
                case"ConfigWatch_Bt":
                    c.BHOConfigNS.setValue("Monitor", "ConfigWatch_Bt", i ? 1 : 0), c.BHOConfigNS.save().catch();
                    break;
                case"ExtendNames":
                    if (t !== i) {
                        let e = i.trim();
                        c.BHOConfigNS.setValue("Monitor", "ExtendNames", e), c.BHOConfigNS.save().catch()
                    }
                    break;
                case"FilterSitesForUI":
                    if (t !== i) {
                        let e = i.trim();
                        e = (e = e.replace(/\r\n/g, "||")).replace(/\n/g, "||"), c.BHOConfigNS.setValue("Monitor", "FilterSitesForUI", e), c.BHOConfigNS.save().then(() => {
                            let e = E.notifyBrowserConfigChanged();
                            N.information("notifyBrowserConfigChanged notify:", e)
                        }).catch()
                    }
            }
        }

        handleSetFreedown(e, t) {
            N.verbose("handleSetMaxRunningTaskCount preValue:", e, "; newValue:", t), t && P.showNotify(m.ToastNotifyManagerNS.notifyIdScheduleTaskDownloadMode, y.ToastNotifyItemType.GreenNotify, "已开启空闲下载", 3e3)
        }

        onMotitorChanged(e, t, i) {
            N.information("onMotitorChanged:", e, t, i);
            do {
                if ("MotitorAll" === e) break;
                let t = k.SettingConfigHelperNS.configBrowserHelper.getWriteIniConfigShowBrowsers();
                c.BHOConfigNS.setValue("Monitor", "ConfigBrowsers", t), k.SettingConfigHelperNS.configBrowserHelper.savaMotiorBrowserToConfig()
            } while (0)
        }

        onProxySettingChanged(e, t, i) {
            switch (N.information("onProxySettingChanged:", e, t, i), e) {
                case"ConfigProxy_Type":
                    this.handleProxyTypeChanged(t, i);
                    break;
                case"ConnectType_Http":
                    this.handleSetProxy(t, i)
            }
        }

        onProxyChanged(e, t, i) {
            switch (e) {
                case"UseProxy":
                    this.handleUseProxy(t, i)
            }
        }

        onBtGenericSettingsChanged(e, t, i) {
            switch (e) {
                case"AutoBTNewTask":
                case"AssocTorrent":
                    break;
                case"ConfigBt_SetPortType":
                    this.handleSetPortType(t, i)
            }
        }

        onConfigNoLimitDownloadChanged(e, t, i) {
            switch (e) {
                case"TaskCountAutoAdd":
                    this.handleAutoAddTask(t, i);
                    break;
                case"TaskCountAutoAddRate":
                    u.ConfigNS.getValue("ConfigNoLimitDownload", "TaskCountAutoAdd", !1) && t !== i && v.DownloadDispatchNS.setAutoAddTask(!0, Number(i));
                    break;
                case"OpenNoLimitDownload":
                    this.handleOpenNoLimitDownload(t, i);
                    break;
                case"NoLimitDownloadFileSize":
                    u.ConfigNS.getValue("ConfigNoLimitDownload", "OpenNoLimitDownload", !1) && t !== i && v.DownloadDispatchNS.setFreeFromScheduleOpen(!0, Number(i))
            }
        }

        onOthersChanged(e, t, i) {
            switch (e) {
                case"AntiDisturb":
                    this.handleAntiDisturb(t, i)
            }
        }

        onIdleDownloadChanged(e, t, i) {
            switch (e) {
                case"isOpen":
                    this.handleOpenIdleDownload(t, i)
            }
        }

        onEMuleGenericSettingsChanged(e, t, i) {
            switch (e) {
                case"EMuleWatchLink":
                    c.BHOConfigNS.setValue("EMuleGenericSettings", "EMuleWatchLink", i ? 1 : 0), c.BHOConfigNS.save().catch()
            }
        }

        onMagnetGenericSettingsChanged(e, t, i) {
            switch (e) {
                case"MagnetWatchLink":
                    c.BHOConfigNS.setValue("MagnetGenericSettings", "MagnetWatchLink", i ? 1 : 0), c.BHOConfigNS.save().catch()
            }
        }

        onBossKeyChanged(e, t, i) {
            switch (e) {
                case"BossKeySwitch":
                    this.handleBossKeySwitch(t, i)
            }
        }

        onDiskCacheChanged(e, t, i) {
            switch (e) {
                case"DiskCacheSelect":
                    this.handleDiskCacheSelect(t, i)
            }
        }

        handleAutoRun(e, t) {
            if (N.verbose("handleAutoRun preValue:", e, "; newValue:", t), t) {
                let e = o.join(__rootDir, "../../Thunder.exe") + " -silent -StartType:AutoRun";
                E.writeRegValue("HKEY_CURRENT_USER", "Software\\Microsoft\\Windows\\CurrentVersion\\Run", "Thunder", e, 1)
            } else E.deleteRegValue("HKEY_CURRENT_USER", "Software\\Microsoft\\Windows\\CurrentVersion\\Run", "Thunder")
        }

        handleSetMaxRunningTaskCount(e, t) {
            N.verbose("handleSetMaxRunningTaskCount preValue:", e, "; newValue:", t), t && v.DownloadDispatchNS.setStartTaskCount(t)
        }

        handleAutoSlowTask2Tail(e, t) {
            v.DownloadDispatchNS.setAutoTail(t)
        }

        handleAutoDeleteNonExistTasks(e, t) {
            return n(this, void 0, void 0, function* () {
                if (t) {
                    let e = yield p.TaskOperatorNs.removeNonExistingTask();
                    if (e > 0) {
                        let t = "已自动删除" + e + "个文件不存在的任务";
                        N.information(t), P.showNotify(m.ToastNotifyManagerNS.notifyIdAutoDeleteNonExistTasks, y.ToastNotifyItemType.GreenNotify, t, 3e3)
                    }
                }
            })
        }

        handleSetThreadCount(e, t) {
            N.verbose("handleSetThreadCount preValue:", e, "; newValue:", t)
        }

        handleDownloadMode(e, t) {
            N.verbose("handleDownloadMode preValue:", e, "; newValue:", t), "1" === String(t) ? (N.information("handleDownloadMode DownloadMode setFullDownloadMode"), g.DownloadModeNS.setFullDownloadMode(), v.DownloadDispatchNS.setAutoAddTaskAvailable(!0)) : "0" === String(t) && (u.ConfigNS.getValue("ConfigNet", "ConfigNet_Custom_DownloadSpeedChk", !0) ? v.DownloadDispatchNS.setAutoAddTaskAvailable(!1) : v.DownloadDispatchNS.setAutoAddTaskAvailable(!0), N.information("handleDownloadMode DownloadMode handleCustomDownloadMode"), g.DownloadModeNS.handleCustomDownloadMode())
        }

        handleOpenMirrorImageIncreaseSpeed(e, t) {
            N.verbose("handleOpenMirrorImageIncreaseSpeed preValue:", e, "; newValue:", t), h.DownloadKernelManager.enableCommonP2sChannel(t)
        }

        handleOpenXunleiP2PIncreaseSpeed(e, t) {
            N.verbose("handleOpenXunleiP2PIncreaseSpeed preValue:", e, "; newValue:", t), h.DownloadKernelManager.enableCommonP2pChannel(t)
        }

        handleMonitorClipBoard(e, t) {
            N.verbose("handleMonitorClipBoard preValue:", e, "; newValue:", t)
        }

        handleUseProxy(e, t) {
            N.verbose("handleUseProxy preValue:", e, "; newValue:", t)
        }

        handleProxyTypeChanged(e, t) {
            N.verbose("handleUseProxy preValue:", e, "; newValue:", t);
            let i = "1", n = "null";
            if ("0" === t) void 0 !== e && b.ThunderKernel.setProxy(S.ProxyNS.ProxyType.None, "", 0, "", ""); else if ("1" === t) this.useIEProxy(), i = "0", n = "IE"; else if ("2" === t) {
                let e = u.ConfigNS.getValue("ProxySetting", "ConnectType_Http", "直接连接");
                "直接连接" !== e ? this.useCostomProxy(e) : b.ThunderKernel.setProxy(S.ProxyNS.ProxyType.None, "", 0, "", ""), i = "0", n = "custom"
            }
            let a = "download_agent=" + i;
            a = a + ",agent=" + n, N.information("trackEvent", "core_event", "download_agent_check", a), l.XLStatNS.trackEvent("core_event", "download_agent_check", "", 0, 0, 0, 0, a)
        }

        handleSetProxy(e, t) {
            this.useCostomProxy(t)
        }

        handlePlayWaveWhileFinish(e, t) {
            N.verbose("handlePlayWaveWhileFinish preValue:", e, "; newValue:", t)
        }

        handleSetPortType(e, t) {
            N.verbose("handleSetPortType preValue:", e, "; newValue:", t)
        }

        handleOpenNoLimitDownload(e, t) {
            N.verbose("handleOpenNoLimitDownload preValue:", e, "; newValue:", t);
            do {
                if (e === t) break;
                if (t) {
                    let e = u.ConfigNS.getValue("ConfigNoLimitDownload", "NoLimitDownloadFileSize", 30);
                    v.DownloadDispatchNS.setFreeFromScheduleOpen(!0, Number(e))
                } else v.DownloadDispatchNS.setFreeFromScheduleOpen(!1)
            } while (0)
        }

        handleAutoAddTask(e, t) {
            do {
                if (e === t) break;
                if (t) {
                    let e = u.ConfigNS.getValue("ConfigNoLimitDownload", "TaskCountAutoAddRate", 100);
                    v.DownloadDispatchNS.setAutoAddTask(!0, Number(e))
                } else v.DownloadDispatchNS.setAutoAddTask(!1)
            } while (0)
        }

        handleAntiDisturb(e, t) {
            N.verbose("handleAntiDisturb preValue:", e, "; newValue:", t)
        }

        handleOpenIdleDownload(e, t) {
            N.verbose("handleOpenIdleDownload preValue:", e, "; newValue:", t)
        }

        handleWatchEmuleLink(e, t) {
            N.verbose("handleWatchEmuleLink preValue:", e, "; newValue:", t);
            let i = '"' + o.join(__rootDir, "../../Thunder.exe") + '" "%1" -StartType:ed2k';
            if (N.information("emuleValue: ", i), 1 === t) E.createRegKey("HKEY_CURRENT_USER", "Software\\Classes\\ed2k\\Shell\\Open\\command"), E.writeRegValue("HKEY_CURRENT_USER", "Software\\Classes\\ed2k\\Shell\\Open\\command", "", i, 1), N.information("writeRegValue HKEY_CURRENT_USER Software\\Classes\\ed2k\\Shell\\Open\\command ", i); else {
                let e = E.readRegString("HKEY_CURRENT_USER", "Software\\Classes\\ed2k\\Shell\\Open\\command", "");
                N.information("oldEmuleValue: ", e), e === i && (E.writeRegValue("HKEY_CURRENT_USER", "Software\\Classes\\ed2k\\Shell\\Open\\command", "", "", 1), N.information("remove HKEY_CURRENT_USER Software\\Classes\\ed2k\\Shell\\Open\\command"))
            }
        }

        handleWatchMagnetLink(e, t) {
            N.verbose("handleWatchMagnetLink preValue:", e, "; newValue:", t);
            let i = '"' + o.join(__rootDir, "../../Thunder.exe") + '" "%1" -StartType:magnet';
            if (N.information("magnetValue: ", i), 1 === t) E.createRegKey("HKEY_CURRENT_USER", "Software\\Classes\\magnet\\Shell\\Open\\command"), E.writeRegValue("HKEY_CURRENT_USER", "Software\\Classes\\magnet\\Shell\\Open\\command", "", i, 1), N.information("writeRegValue HKEY_CURRENT_USER Software\\Classes\\magnet\\Shell\\Open\\command ", i); else {
                let e = E.readRegString("HKEY_CURRENT_USER", "Software\\Classes\\magnet\\Shell\\Open\\command", "");
                N.information("oldMagnetValue: ", e), e === i && (E.writeRegValue("HKEY_CURRENT_USER", "Software\\Classes\\magnet\\Shell\\Open\\command", "", "", 1), N.information("remove HKEY_CURRENT_USER Software\\Classes\\magnet\\Shell\\Open\\command"))
            }
        }

        handleBossKeySwitch(e, t) {
            N.verbose("handleBossKeySwitch preValue:", e, "; newValue:", t)
        }

        handleDiskCacheSelect(e, t) {
            N.verbose("handleBossKeySwitch preValue:", e, "; newValue:", t), h.DownloadKernelManager.setCacheSize(t)
        }

        onBHOConfigMonitorSessionChanged(e, t, i) {
            switch (c.BHOConfigNS.saveSync(), e) {
                case"ConfigBrowsers":
                case"FilterSitesForUI":
                    this.handleBHOConfigMonitorBrowserChanged(t, i)
            }
        }

        handleBHOConfigMonitorBrowserChanged(e, t) {
            E.notifyBrowserConfigChanged(), N.verbose("handleBHOConfigMonitorBrowserChanged preValue:", e, "; newValue:", t)
        }

        handleNewTaskDlgWithoutMainWnd(e, t) {
            e !== t && u.ConfigNS.saveSync()
        }

        setAwayMode(e) {
            let t = o.join(__rootDir, "../../ThunderCmd.exe");
            w.ipcRenderer.send(C.ThunderChannelList.channelRMExecute, "AwayMode", "runas", t, e, "", "SW_HIDE"), w.ipcRenderer.once(C.ThunderChannelList.channelMRExecuteResult, (t, i, n) => {
                if ("AwayMode" === i) if (n > 32) {
                    let t = !0;
                    "-CloseLeaveMode" === e && (t = !1), u.ConfigNS.setValue("TaskDefaultSettings", "AwayModeEnabled", t)
                } else {
                    let t = !1;
                    "-CloseLeaveMode" === e && (t = !0), u.ConfigNS.setValue("TaskDefaultSettings", "AwayModeEnabled", t)
                }
            })
        }

        handleAwayMode(e, t) {
            let i = t, n = a.release(), o = n.indexOf(".", 0), r = n.substring(0, o);
            if (null !== r && void 0 !== r && Number(r) >= 6) {
                let e = E.queryRegValue("HKEY_LOCAL_MACHINE", "SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Power", "AwayModeEnabled");
                N.information("设置离开模式:", i, e), i ? 1 !== e ? this.setAwayMode("-OpenLeaveMode") : u.ConfigNS.setValue("TaskDefaultSettings", "AwayModeEnabled", !0) : 1 === e ? this.setAwayMode("-CloseLeaveMode") : u.ConfigNS.setValue("TaskDefaultSettings", "AwayModeEnabled", !1)
            }
        }

        useCostomProxy(e) {
            if (N.verbose("useCostomProxy proxyName:", e), "直接连接" === e) return void b.ThunderKernel.setProxy(S.ProxyNS.ProxyType.None, "", 0, "", "");
            let t = {}, i = u.ConfigNS.getValue("ProxyList", "proxys", []);
            if (i.length > 0) for (let n = 0; n < i.length; ++n) {
                let a = i[n].split(";");
                if (a[0] === e) {
                    t.name = a[0], t.host = a[1], t.type = a[3], t.userName = a[4], t.passWord = a[5], a[2] ? t.port = Number(a[2]) ? Number(a[2]) : 80 : t.port = 80;
                    break
                }
            }
            if (t.host && t.port) {
                let e = S.ProxyNS.ProxyType.None;
                "HTTP" === t.type ? e = S.ProxyNS.ProxyType.Http : "SOCKS5" === t.type && (e = S.ProxyNS.ProxyType.Sock5), b.ThunderKernel.setProxy(e, t.host, t.port, t.userName, t.passWord)
            }
        }

        useIEProxy() {
            let e = this.getIEProxy();
            if (e.host && e.port) {
                let t = S.ProxyNS.ProxyType.None;
                "HTTP" === e.type ? t = S.ProxyNS.ProxyType.Http : "SOCKS5" === e.type && (t = S.ProxyNS.ProxyType.Sock5), b.ThunderKernel.setProxy(t, e.host, e.port, e.userName, e.passWord)
            }
        }

        getIEProxy() {
            let e = {}, t = E.getIEProxy();
            if (t && "" !== t) {
                let i = t.indexOf("http=");
                if (e.type = "HTTP", i > 0) {
                    let e = (t = t.substr(i, t.length - (i + 5))).indexOf(";");
                    e > 0 && (t = t.substr(0, t.length - e))
                } else if ((i = t.indexOf("socks=")) > 0) {
                    e.type = "SOCKS5";
                    let n = (t = t.substr(i, t.length - (i + 6))).indexOf(",");
                    n > 0 && (t = t.substr(0, t.length - n))
                }
                if (t && t.length > 0 && t.indexOf(":") > 0 && t.indexOf("=") < 0) {
                    i = t.indexOf(":");
                    let n = t.substr(0, i), a = t.substr(i + 1, t.length - (i + 1));
                    n && a && Number(a) && (e.host = n, e.port = Number(a))
                }
            }
            return e
        }
    };
    !function (e) {
        e.init = function () {
            M.init()
        }
    }(t.ConfigHandlerNS || (t.ConfigHandlerNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(87), o = i(44), r = i(572), s = i(78), l = i(4), d = i(0), u = i(10),
        c = d.default.getLogger("BHOConfigHttpServer");
    !function (e) {
        class t {
            constructor() {
                this.server = null
            }

            getBHOConfig(e, t, i, n) {
                if (t && i && l.isString(t) && l.isString(i)) {
                    let a = s.BHOConfigNS.getValue(t, i, n);
                    e.writeHead(200, {"Content-Type": "application/json"});
                    let o = {code: 0};
                    o.value = a, e.write(JSON.stringify(o))
                } else e.writeHead(400)
            }

            setBHOConfig(e, t, i, n) {
                if (t && i && l.isString(t) && l.isString(i) && !l.isNullOrUndefined(n)) {
                    c.information("setBHOConfig", t, i, n), s.BHOConfigNS.setValue(t, i, n), e.writeHead(200, {"Content-Type": "application/json"});
                    let a = {code: 0};
                    e.write(JSON.stringify(a))
                } else e.writeHead(400)
            }

            setConfig(e, t, i, n) {
                if (t && i && l.isString(t) && l.isString(i) && !l.isNullOrUndefined(n)) {
                    c.information("setConfig", t, i, n), u.ConfigNS.setValue(t, i, n), e.writeHead(200, {"Content-Type": "application/json"});
                    let a = {code: 0};
                    e.write(JSON.stringify(a))
                } else e.writeHead(400)
            }

            onRequest(e, t) {
                let i = "";
                e.on("readable", () => {
                    let t = e.read();
                    t && (i += t)
                }), e.on("end", () => {
                    let n = o.parse(e.url, !0);
                    const a = n.pathname;
                    let s = null;
                    if ("GET" === e.method) s = n.query; else if ("POST" === e.method) try {
                        s = JSON.parse(i)
                    } catch (e) {
                        s = r.parse(i)
                    }
                    c.information("onRequest end", a, s, i), "/getbhoconfig" === a ? this.getBHOConfig(t, s.section, s.key, s.default) : "/setbhoconfig" === a ? this.setBHOConfig(t, s.section, s.key, s.value) : "/setconfig" === a ? this.setConfig(t, s.section, s.key, s.value) : t.writeHead(404), t.end()
                })
            }

            init() {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (this.server) break;
                        this.server = a.createServer(this.onRequest.bind(this)), this.server.listen(5021)
                    } while (0)
                })
            }
        }

        let i = null;
        e.init = function () {
            return n(this, void 0, void 0, function* () {
                i || (i = new t), yield i.init()
            })
        }
    }(t.BHOConfigHttpServerNS || (t.BHOConfigHttpServerNS = {}))
}, function (e, t) {
    e.exports = require("querystring")
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(339), a = i(140);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    i(696), i(697), i(698), i(699), i(700), i(701), i(702), i(703), i(704), i(705), i(706), i(707), i(708), i(709), i(710), i(711), i(712), i(713), i(714), i(715), i(716), i(717), i(718), i(719);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\app.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(142);
    for (var a in n) "default" !== a && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(a);
    var o = i(1), r = Object(o.a)(n.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-left\\index-container.vue", t.default = r.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(340), a = i(144);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    i(601);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-left\\index.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(342), a = i(146);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-left\\login-area\\index.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(10), o = i(39), r = i(578), s = i(0).default.getLogger("login-prompt"), l = i(16);
    let d = new r.DataHelper;
    var u;
    !function (e) {
        e.promptDataGet = "OnpromptDataGet"
    }(u = t.LoginPromptManagerEventNS || (t.LoginPromptManagerEventNS = {}));

    class c extends o.default {
        constructor() {
            super(...arguments), this.dataList = null
        }

        init() {
            return n(this, void 0, void 0, function* () {
                s.information("init---\x3e"), this.setMaxListeners(1), this.fireEvent(u.promptDataGet, !0), s.information("1 fire prompt data get event"), (yield d.init()) && d.httpLoadDataInfo((e, t) => {
                    e && (this.dataList = t, s.information("datalist len", this.dataList.length), this.fireEvent(u.promptDataGet, !0), s.information("2 fire prompt data get event"), this.run())
                }), s.information("<---init")
            })
        }

        getPromptData() {
            return this.curShowData ? this.curShowData : null
        }

        run() {
            s.information("run---\x3e"), this.clearConfig(), this.startAttach(), this.startRun(), s.information("<---run")
        }

        getShowData(e) {
            for (let t = 0; t < this.dataList.length; t++) {
                const i = this.dataList[t];
                if (!e.includes(String(i.id))) return i
            }
            return null
        }

        updateData() {
            s.information("updateData---\x3e");
            let e = a.ConfigNS.getValue("XLLoginPrompt", "id", "");
            this.curShowData = this.getShowData(e), this.curShowData || (this.clearConfig(), this.curShowData = this.getShowData("")), s.information("cur show data", this.curShowData), e = "" === (e = a.ConfigNS.getValue("XLLoginPrompt", "id", "")) ? String(this.curShowData.id) : e + "," + this.curShowData.id, s.information("showids", e), a.ConfigNS.setValue("XLLoginPrompt", "id", e), this.fireEvent(u.promptDataGet, !0), s.information("3 fire prompt data get event"), s.information("<---updateData")
        }

        hideLoginPromptPanel() {
            s.information("hideLoginPromptPanel---\x3e")
        }

        startAttach() {
            s.information("startAttach---\x3e"), l.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", () => n(this, void 0, void 0, function* () {
                this.startRun()
            })), l.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", () => {
                this.startRun()
            }), l.NativeCallModule.nativeCall.AttachNativeEvent("OnMainWindowVisibleChange", e => {
                s.information("OnMainWindowVisibleChange returnValue", e), e && this.startRun()
            }), this.startRun(), s.information("<---startAttach")
        }

        startRun() {
            s.information("startRun---\x3e"), l.NativeCallModule.nativeCall.CallNativeFunction("IsLogined", (e, t) => {
                0 === e ? (s.information("logined", t), l.NativeCallModule.nativeCall.CallNativeFunction("IsMainWndShow", e => {
                    s.information("IsMainWndShow returnValue", e), this.updateData()
                })) : this.hideLoginPromptPanel()
            }), s.information("<---startRun")
        }

        clearConfig() {
            s.information("clearConfig---\x3e"), a.ConfigNS.setValue("XLLoginPrompt", "id", ""), s.information("<---clearConfig")
        }
    }

    t.LoginPromptManager = c, function (e) {
        let t = new c;
        e.getManager = function () {
            return t
        }, e.init = function () {
            t.init().then().catch()
        }, e.getPromptData = function () {
            return t.getPromptData()
        }
    }(t.LoginPromptManagerNS || (t.LoginPromptManagerNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(450), o = i(0).default.getLogger("login-prompt"), r = i(2), s = i(5), l = i(58);
    t.DataHelper = class extends a.HttpSession {
        constructor() {
            super(...arguments), this.dataList = [], this.adDataDir = r.resolve(__profilesDir, "LoginPrompt/")
        }

        init() {
            return n(this, void 0, void 0, function* () {
                let e = yield s.FileSystemAWNS.mkdirsAW(this.adDataDir);
                return e || o.information("初始化路径目录失败"), e
            })
        }

        httpLoadDataInfo(e) {
            o.information("httpLoadDataInfo---\x3e"), this.host = "static-xl.a.88cdn.com", this.retries = 2, this.timeout = 2e4, this.path = "/json/login_icon.json", o.information("uri:" + this.path), o.information("host:" + this.host), this.get(t => {
                if (200 === t.statusCode && t.body) {
                    let i = this.parseResponse(t.body);
                    this.downLoadResource(i, e).then().catch()
                }
            }, t => {
                o.information("error", t), e(!1, null)
            }), o.information("<---httpLoadDataInfo")
        }

        downLoadResource(e, t) {
            return n(this, void 0, void 0, function* () {
                if (o.information("downLoadResource---\x3e"), e && e.length > 0) {
                }
            })
        }

        parseResponse(e) {
            if (!e) return null;
            let t = e.toString(), i = null;
            try {
                i = JSON.parse(t)
            } catch (e) {
                o.warning(e)
            }
            return o.information("jsonstr", t), o.information("resObj", i), i || null
        }
    }
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(24), o = i(580), r = i(39), s = i(7), l = i(583), d = i(5), u = i(2),
        c = i(0).default.getLogger("vip-renewicon.manager");
    var h;
    !function (e) {
        e.userTypeChanged = "OnuserTypeChanged"
    }(h = t.UserEventNS || (t.UserEventNS = {}));

    class f extends r.default {
        constructor() {
            super(...arguments), this.cashHover = !1, this.hasCash = !1, this.isQueryCashBack = !1, this.isQueryTagsBack = !1, this.expiredRange = 7, this.userType = 0, this.vipData = null, this.aidfromMap = new Map, this.iconDataDir = u.resolve(__profilesDir, "vipicon/"), this.iconData = null, this.iconUrl = null
        }

        get $hasCash() {
            return this.hasCash
        }

        get $iconData() {
            return this.iconData
        }

        initDataDir() {
            return n(this, void 0, void 0, function* () {
                let e = yield d.FileSystemAWNS.mkdirsAW(this.iconDataDir);
                return e || c.information("初始化路径目录失败"), e
            })
        }

        init() {
            super.setMaxListeners(1), this.aidfromMap.set(6, "xfbtn_grow0_kt"), this.aidfromMap.set(7, "xfbtn_grow1_kt"), this.aidfromMap.set(8, "xfbtn_grow1_kt"), this.aidfromMap.set(9, "xfbtn_pt_mrxf"), this.aidfromMap.set(10, "xfbtn_pt_mrxf"), this.aidfromMap.set(11, "xfbtn_bj_mrxf"), this.aidfromMap.set(12, "xfbtn_bj_mrxf"), this.aidfromMap.set(13, "xfbtn_cj_mrxf"), this.aidfromMap.set(14, "xfbtn_cj_mrxf")
        }

        calculateExpireDate() {
            let e, t, i;
            e = this.vipData.expireDate.substring(0, 4), t = this.vipData.expireDate.substring(4, 6), i = this.vipData.expireDate.substring(6, 8);
            let n = new Date(e + "-" + t + "-" + i + " 00:00:00").getTime() / 1e3, a = new Date, o = a.getFullYear(),
                r = a.getMonth(), s = a.getDate(),
                l = (a = new Date(o + "-" + (r < 10 ? "0" + (r + 1) : r + 1) + "-" + (s < 10 ? "0" + s : s) + " 00:00:00")).getTime() / 1e3;
            return Math.ceil((n - l) / 86400)
        }

        updateUserVipData(e) {
            return n(this, void 0, void 0, function* () {
                c.information("updateUserData---\x3e"), c.information("vipData", e), this.clear(), yield this.querySettingInfo(), this.vipData = e, null !== this.vipData ? (c.information("expirerange", this.expiredRange), c.information("userType", this.userType), c.information("cashHover", this.cashHover), yield this.queryCashInfo(), yield this.queryUserTagInfo()) : c.information("vipData is null")
            })
        }

        onLogout() {
            this.clear(), this.fireEvent(h.userTypeChanged, this.userType)
        }

        clear() {
            this.cashHover = !1, this.vipData = null, this.expiredRange = 7, this.userType = 0, this.hasCash = !1, this.isQueryCashBack = !1, this.isQueryTagsBack = !1, this.iconUrl = null, this.iconData = null
        }

        openNewTab() {
            if (!this.iconUrl && this.mSetting) for (let e = 0; e < this.mSetting.settings.length; e++) {
                let t = this.mSetting.settings[e];
                t.id === this.userType && t.url && (this.iconUrl = t.url)
            }
            let e = this.iconUrl ? this.iconUrl : "https://pay.xunlei.com/pay.html?bizNo=baijin&referfrom=v_pc_xlx_ggong_pay_top&aidfrom=" + this.aidfromMap.get(this.userType);
            c.information("openNewTab---\x3e", e), s.client.callServerFunction("OpenNewTab", e).catch()
        }

        onIconClick() {
            if (c.information("onIconClick---\x3e"), this.openNewTab(), null === this.vipData) return void c.information("vipData is null");
            let e = new Map;
            e.set("show_type", this.userType), e.set("isvip", this.vipData.isVip), e.set("vas_type", this.vipData.vasType), e.set("referfrom", "v_pc_xlx_ggong_pay_top"), e.set("aidfrom", this.aidfromMap.get(this.userType));
            let t = {attribute1: "xufei_botton_click", extData: e};
            l.StatUtilitiesNS.trackEvent("clienttop", t), c.information("<----onIconClick")
        }

        onIconShow() {
            if (c.information("onIconShow---\x3e"), null === this.vipData) return void c.information("vipData is null");
            let e = new Map;
            e.set("show_type", this.userType), e.set("isvip", this.vipData.isVip), e.set("vas_type", this.vipData.vasType);
            let t = {attribute1: "xufei_botton_show", extData: e};
            l.StatUtilitiesNS.trackEvent("clienttop", t), c.information("<----onIconShow")
        }

        querySettingInfo() {
            return n(this, void 0, void 0, function* () {
                c.information("querySettingInfo");
                let e = new o.UserHttpSession;
                this.mSetting = yield e.querySettingInfo(), c.information("this.mSetting :", this.mSetting), this.mSetting && (1 === this.mSetting.cash_hover && (this.cashHover = !0), this.hasCash && !this.cashHover && (this.hasCash = !1), this.mSetting.expired_day > 0 && (this.expiredRange = this.mSetting.expired_day), c.information("this.mSetting :", this.mSetting), c.information("<---querySettingInfo"))
            })
        }

        checkUserType(e) {
            if (c.information("checkUserType---\x3e"), e && e.code && 1 === e.code && this.vipData) if (1 === this.vipData.isVip) {
                let t = this.calculateExpireDate();
                c.information("leftdays", t), t <= this.expiredRange && (5 === this.vipData.vasType ? 0 === e.usedToActPay ? this.userType = 14 : this.userType = 13 : 3 === this.vipData.vasType ? 0 === e.usedToActPay ? this.userType = 12 : this.userType = 11 : 2 === this.vipData.vasType && (0 === e.usedToActPay ? this.userType = 10 : this.userType = 9))
            } else 0 === e.payTimesRangeForDL ? this.userType = 6 : 0 === e.usedToActPay ? this.userType = 8 : this.userType = 7; else if (this.vipData) if (1 === this.vipData.isVip) {
                let e = this.calculateExpireDate();
                c.information("leftdays", e), e <= this.expiredRange && (5 === this.vipData.vasType ? this.userType = 14 : 3 === this.vipData.vasType ? this.userType = 12 : 2 === this.vipData.vasType && (this.userType = 10))
            } else this.userType = 6;
            c.information("usertype ", this.userType), c.information("<---checkUserType")
        }

        setIconData() {
            if (this.mSetting) for (let e = 0; e < this.mSetting.settings.length; e++) {
                let t = this.mSetting.settings[e];
                this.userType === t.id && (this.iconData = {iconUrl: t.icon_url, iconText: t.icon_text})
            }
        }

        queryUserTagInfo() {
            return n(this, void 0, void 0, function* () {
                c.information("queryUserTagInfo---\x3e");
                let e = new o.UserHttpSession, t = yield this.getUserID(), i = yield this.getSessionID();
                c.information("userId", t), c.information("sessionId", i), this.isQueryTagsBack = !1;
                let n = yield e.queryUserTags(t, i);
                c.information("response :", n), this.checkUserType(n), this.isQueryTagsBack = !0, c.information("usertype", this.userType), this.isQueryCashBack && (this.setIconData(), this.fireEvent(h.userTypeChanged, this.userType)), c.information("<---queryUserTagInfo")
            })
        }

        queryCashInfo() {
            return n(this, void 0, void 0, function* () {
                c.information("queryCashInfo---\x3e");
                let e = new o.UserHttpSession, t = yield this.getUserID(), i = yield this.getSessionID();
                c.information("userId", t), c.information("sessionId", i), this.isQueryCashBack = !1;
                let n = yield e.queryCashInfo(t, i);
                c.information("response", n), c.information("this.cashHover", this.cashHover), n && 0 === n.result && n.totalnum > 0 && this.cashHover ? this.hasCash = !0 : this.hasCash = !1, this.isQueryCashBack = !0, c.information("this.hasCash :", this.hasCash), this.isQueryTagsBack && (this.setIconData(), this.fireEvent(h.userTypeChanged, this.userType)), c.information("<---queryCashInfo")
            })
        }

        getUserID() {
            return n(this, void 0, void 0, function* () {
                return new Promise(e => {
                    a.LoginHelperNS.loginHelper.getUserInfo("userid", function (t) {
                        c.information("getUserID:userid = ", t), e(t)
                    })
                })
            })
        }

        getSessionID() {
            return n(this, void 0, void 0, function* () {
                return new Promise(e => {
                    a.LoginHelperNS.loginHelper.getUserInfo("sessionid", function (t) {
                        c.information("getSessionID:sessionid = ", t), e(t)
                    })
                })
            })
        }
    }

    t.VipRenewIconManager = f, function (e) {
        const t = new f;
        t.init(), e.getIconManager = function () {
            return t
        }
    }(t.VipRenewIconManagerNS || (t.VipRenewIconManagerNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(581), o = i(582), r = i(0).default.getLogger("vip-renewicon.http-session");
    t.UserHttpSession = class extends a.HttpSession {
        querySettingInfo() {
            return n(this, void 0, void 0, function* () {
                return r.information("querySettingInfo----\x3e"), this.host = "images.client.vip.xunlei.com", this.retries = 1, this.timeout = 5e3, this.path = "/mini/xlx/tips_300x310/ssi_html/xdsxfbtnconf.js", r.information("uri:", this.path), r.information("host:", this.host), new Promise(e => {
                    this.get(t => {
                        let i = null;
                        200 === t.statusCode && t.body && (i = o.UserHttpPackageNS.praseSettingBuffer(t.body)), e(i)
                    }, t => {
                        r.information("error", t), e(null)
                    })
                })
            })
        }

        queryCashInfo(e, t) {
            return n(this, void 0, void 0, function* () {
                return r.information("queryCashInfo"), this.host = "dynamic.vip.xunlei.com", this.retries = 1, this.timeout = 5e3, this.path = "/cashv2/userCashCount?userid=" + e + "&sessionid=" + t, r.information("host:", this.host), r.information("uri:", this.path), new Promise(e => {
                    this.get(t => {
                        let i = null;
                        200 === t.statusCode && t.body && (i = o.UserHttpPackageNS.praseCashBuffer(t.body)), e(i)
                    }, t => {
                        r.information("error", t), e(null)
                    })
                })
            })
        }

        queryUserTags(e, t) {
            return n(this, void 0, void 0, function* () {
                return r.information("queryUserTags--\x3e"), this.host = "soa.vip.xunlei.com", this.retries = 1, this.timeout = 5e3, this.path = "/xlvip.common.mooseapi/querytags?userid=" + e + "&sessionid=" + t + "&tags=isSign,payTimesRangeForDL,usedToActPay", r.information("uri:", this.path), r.information("host:", this.host), new Promise(e => {
                    this.get(t => {
                        let i = null;
                        200 === t.statusCode && t.body && (i = o.UserHttpPackageNS.praseTagBuffer(t.body)), e(i)
                    }, t => {
                        r.information("error", t), e(null)
                    })
                })
            })
        }
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(87);
    t.HttpSession = class {
        constructor() {
            this.mRetries = 0, this.mHost = void 0, this.mPort = 80, this.mPath = void 0, this.mAuth = void 0, this.mAccept = void 0, this.mBody = null, this.mUrl = void 0, this.mTimeout = void 0, this.mCurRetries = 0
        }

        set host(e) {
            this.mHost = e
        }

        get host() {
            return this.mHost
        }

        set port(e) {
            this.mPort = e
        }

        get port() {
            return this.mPort
        }

        set path(e) {
            this.mPath = e
        }

        get path() {
            return this.mPath
        }

        set url(e) {
            this.mUrl = e
        }

        get url() {
            return this.mUrl
        }

        set auth(e) {
            this.mAuth = e
        }

        get auth() {
            return this.mAuth
        }

        set accept(e) {
            this.mAccept = e
        }

        get accept() {
            return this.mAccept
        }

        set body(e) {
            this.mBody = e
        }

        get body() {
            return this.mBody
        }

        set retries(e) {
            this.mRetries = e
        }

        get retries() {
            return this.mRetries
        }

        set timeout(e) {
            this.mTimeout = e
        }

        get timeout() {
            return this.mTimeout
        }

        get(e, t) {
            let i = {hostname: this.host, port: this.port, path: this.path || "/", method: "GET"};
            this.getImpl(i, e, i => {
                this.mCurRetries < this.retries ? (this.mCurRetries++, this.get(e, t)) : t(i)
            })
        }

        getImpl(e, t, i) {
            n.get(e, e => {
                let i = null;
                e.on("data", e => {
                    i = i ? Buffer.concat([i, e]) : e
                }), e.on("end", () => {
                    t({statusCode: e.statusCode, headers: e.headers, body: i})
                })
            }).on("error", e => {
                i(e)
            })
        }
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(0).default.getLogger("vip-renewicon.http-package");
    !function (e) {
        e.praseSettingBuffer = function (e) {
            n.information("--\x3epraseSettingBuffer");
            let t = null;
            if (e) {
                let i = e.toString();
                if (i) {
                    n.information("jsonStr :", i);
                    try {
                        let e = JSON.parse(i);
                        n.information("resobj", e);
                        let a = [];
                        for (let t = 6; t <= 14; t++) if (e[t] && e[t].url) {
                            let i = e[t];
                            i.id = t, n.information("node", i), a.push(i)
                        }
                        t = {cash_hover: Number(e.cash_hover), expired_day: Number(e.expired_day), settings: a}
                    } catch (e) {
                        n.information(e), n.information("parser json error")
                    }
                }
            }
            return n.information("<--praseSettingBuffer"), t
        }, e.praseCashBuffer = function (e) {
            n.information("--\x3epraseCashBuffer");
            let t = null;
            if (e) {
                let i = e.toString();
                if (i) {
                    n.information("jsonStr :", i);
                    try {
                        let e = JSON.parse(i);
                        t = {
                            result: Number(e.result),
                            msg: e.msg,
                            totalnum: Number(e.data.total_num),
                            expirenum: Number(e.data.expire_num)
                        }
                    } catch (e) {
                        n.information("parser json error")
                    }
                }
            }
            return n.information("<--praseCashBuffer"), t
        }, e.praseTagBuffer = function (e) {
            n.information("--\x3epraseTagBuffer");
            let t = null;
            if (e) {
                let i = e.toString();
                if (i) {
                    n.information("jsonStr :", i);
                    try {
                        let e = JSON.parse(i);
                        t = {
                            code: Number(e.code),
                            msg: e.message,
                            isSign: e.result ? Number(e.result.isSign) : 0,
                            payTimesRangeForDL: e.result ? Number(e.result.payTimesRangeForDL) : 0,
                            usedToActPay: e.result ? Number(e.result.usedToActPay) : 0
                        }
                    } catch (e) {
                        n.information("parser json error")
                    }
                }
            }
            return n.information("<--praseTagBuffer"), t
        }
    }(t.UserHttpPackageNS || (t.UserHttpPackageNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(7), a = i(0).default.getLogger("vip-renewicon.stat-utilities");
    !function (e) {
        e.trackEvent = function (e, t) {
            let i = (t = t || {}).attribute1 || "", o = t.attribute2 || "", r = function (e) {
                let t = "";
                return e.forEach((e, i) => {
                    "" !== t && (t += ","), t = t + i + "=" + e
                }), t
            }(t.extData || new Map);
            a.information("key : ", e), a.information("attribute1 : ", i), a.information("attribute2 ：", o), a.information("extData ： ", r), r = encodeURIComponent(r), n.client.callServerFunction("TrackEvent", e, i, o, 0, 0, 0, 0, r).catch()
        }
    }(t.StatUtilitiesNS || (t.StatUtilitiesNS = {}))
}, function (e, t) {
    e.exports = "data:image/png;base64, "
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(148);
    for (var a in n) "default" !== a && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(a);
    var o = i(1), r = Object(o.a)(n.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-left\\system-buttons-container.vue", t.default = r.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(345), a = i(150);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    i(587);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-left\\system-buttons.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    var n = i(764);
    i.n(n).a
}, function (e, t, i) {
    e.exports = i(56)(203)
}, function (e, t, i) {
    e.exports = i(56)(182)
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(67), o = i(125), r = i(54), s = i(2), l = i(0), d = i(6), u = i(4), c = i(72), h = i(38), f = i(80),
        g = i(10), p = l.default.getLogger("Thunder.MainRenderer.stroe.Tabs"),
        v = d.default(s.join(__rootDir, "../bin/ThunderHelper.node")), m = f.TabEventManagerNS.getEventEmitter();
    let y = f.createXDASTab({title: "推荐", showUrl: !1, name: "recommend", pinned: !0});
    u.isNullOrUndefined(y) && p.error(y);
    let k = 1,
        T = ["http://misc.xl9.xunlei.com/chrome/client/view/dist/1.0/new_tab.html", "http://pc.xunlei.com/pages/#/new-tab"];
    const w = {
        tabs: [{title: y.getTitle(), tab: y, pinned: y.getPinned(), key: k++}],
        current: 0,
        curBrowserWndHandle: 0,
        hideTabs: []
    };

    function C(e, t, i) {
        do {
            if (p.information("Remove_TAb_CTRL param:", i), u.isNullOrUndefined(i) || u.isNullOrUndefined(i.index) || u.isNullOrUndefined(i.tabInfo) || u.isNullOrUndefined(i.tabInfo.tab)) {
                p.error(i);
                break
            }
            t.tabs.splice(i.index, 1), "设置中心" === i.tabInfo.title && g.ConfigNS.save().catch();
            let n = i.tabInfo.tab.getBrowser();
            if (n) {
                let e = n.getWindowHandle();
                v.isWindowHandle(e) && v.showWindow(e, r.CmdShow.SW_HIDE)
            }
            t.current === i.index && i.index > 0 ? e.commit("UPDATE_CURRENT", i.index - 1) : t.current > i.index && e.commit("UPDATE_CURRENT", t.current - 1);
            let a = t.tabs[t.current];
            (u.isNullOrUndefined(a) || u.isNullOrUndefined(a.tab)) && p.error(a);
            let s = a.tab.getBrowser();
            if (u.isNullOrUndefined(s)) {
                m.emit(f.TabEventManagerNS.EventType.RemoveTab, i);
                break
            }
            let l = s.getWindowHandle();
            if (!1 === v.isWindowHandle(l)) {
                p.error(l), m.emit(f.TabEventManagerNS.EventType.RemoveTab, i);
                break
            }
            let d = t.tabs[t.current].tab;
            d.isErrorPage || d.isLoadingPage ? v.showWindow(l, r.CmdShow.SW_HIDE) : (v.showWindow(l, r.CmdShow.SW_SHOW), o.BrowserSupportNS.resizeBrowserWindow(l).catch()), 0 !== t.curBrowserWndHandle && t.curBrowserWndHandle !== l && v.showWindow(t.curBrowserWndHandle, r.CmdShow.SW_HIDE), v.setWindowFocus(l, !0), t.curBrowserWndHandle = l, m.emit(f.TabEventManagerNS.EventType.RemoveTab, i)
        } while (0)
    }

    function S(e, t) {
        let i = null, n = null;
        for (let a = 0; a < e.length; ++a) n = e[a].tab.getBrowser(), u.isNullOrUndefined(n) || t === n && (i = e[a]);
        return i
    }

    function b(e, t, i) {
        return n(this, void 0, void 0, function* () {
            p.information("[tbc] doCreateNewTab createTabParam", i);
            let e = yield f.createNewTab(i.tabType, i.tabParam);
            p.information("[tbc] newTab", e), u.isNullOrUndefined(e) ? p.error(e) : (i.tabType === a.TabType.XDAS && (v.isWindowHandle(t.curBrowserWndHandle) && v.showWindow(t.curBrowserWndHandle, r.CmdShow.SW_HIDE), t.curBrowserWndHandle = 0), m.emit(f.TabEventManagerNS.EventType.CreateNewTab, e, i))
        })
    }

    function I(e, t, i) {
        return n(this, void 0, void 0, function* () {
            let t = i.tabInfo;
            e.commit("UPDATE_CURRENT", i.index), m.emit(f.TabEventManagerNS.EventType.SelectTab, i.index, t);
            let n = t.tab.getBrowser();
            u.isNullOrUndefined(n) || n.on("init-done", () => {
                e.commit("ON_BROWSER_CREATE", i)
            })
        })
    }

    const _ = {
        SHOW_OR_HIDE_BROWSER(e, t) {
            do {
                if (u.isNullOrUndefined(t)) break;
                if (t) {
                    let t = e.tabs[e.current];
                    if (u.isNullOrUndefined(t)) break;
                    let i = t.tab;
                    if (u.isNullOrUndefined(i)) break;
                    if (i.getTabType() === a.TabType.Chromium) {
                        let t = i.getBrowser();
                        if (u.isNullOrUndefined(t)) break;
                        let n = t.getWindowHandle();
                        if (!1 === v.isWindowHandle(n)) {
                            p.error(n);
                            break
                        }
                        let a = e.tabs[e.current].tab;
                        a.isErrorPage || a.isLoadingPage || o.BrowserSupportNS.resizeBrowserWindow(n).catch(), v.isWindowHandle(n) && (i.isErrorPage ? (v.showWindow(n, r.CmdShow.SW_HIDE), t.refresh()) : i.isLoadingPage ? v.showWindow(n, r.CmdShow.SW_HIDE) : (v.showWindow(n, r.CmdShow.SW_SHOW), v.setWindowFocus(n, !0)))
                    }
                } else v.showWindow(e.curBrowserWndHandle, r.CmdShow.SW_HIDE)
            } while (0)
        }, CREATE_NEW_TAB(e, t) {
            {
                p.information("[tbc] CREATE_NEW_TAB", t), this.commit("SELECT_NAV", "find-page", {root: !0}), t.tabType !== a.TabType.Chromium || t.tabParam.hideUI || (t.tabParam.rect = {
                    x: 0,
                    y: 0,
                    width: 0,
                    height: 0
                });
                let i = -1, n = e.tabs.concat(e.hideTabs);
                t.tabParam.name && (i = n.findIndex(e => e.tab.name === t.tabParam.name)), p.information("[tbc] CREATE_NEW_TAB tabIndex", i), -1 !== i ? (n[i].tab.hideUI || this.commit("SELECT_TAB", i), t.tabParam.url && n[i].tab.navigate(t.tabParam.url)) : b(0, e, t).catch()
            }
        }, SELECT_TAB(e, t) {
            p.information("SELECT_TAB index: " + t);
            do {
                if (u.isNullOrUndefined(t)) break;
                if (t < 0) break;
                if (t >= e.tabs.length) break;
                let i = e.tabs[t];
                if (u.isNullOrUndefined(i)) break;
                let n = {tabInfo: i, index: t}, s = n.tabInfo.tab;
                if (u.isNullOrUndefined(s)) break;
                if (s.getTabType() === a.TabType.Chromium) {
                    let t = s.getBrowser();
                    if (u.isNullOrUndefined(t)) {
                        I(this, 0, n).catch();
                        break
                    }
                    let i = t.getWindowHandle();
                    if (!1 === v.isWindowHandle(i)) {
                        p.error(i);
                        break
                    }
                    if (p.information("SELECT_TAB hwnd: " + i + " curBrowserWndHandle: " + e.curBrowserWndHandle), i === e.curBrowserWndHandle) break;
                    let a = e.tabs[n.index].tab;
                    a.isErrorPage || a.isLoadingPage || o.BrowserSupportNS.resizeBrowserWindow(i).catch(), v.isWindowHandle(i) && (s.isErrorPage ? (v.showWindow(i, r.CmdShow.SW_HIDE), t.refresh()) : s.isLoadingPage ? v.showWindow(i, r.CmdShow.SW_HIDE) : (v.showWindow(i, r.CmdShow.SW_SHOW), v.setWindowFocus(i, !0))), v.isWindowHandle(e.curBrowserWndHandle) && v.showWindow(e.curBrowserWndHandle, r.CmdShow.SW_HIDE), e.curBrowserWndHandle = i
                } else s.getTabType() === a.TabType.IE ? p.information("ie") : s.getTabType() === a.TabType.XDAS && (v.isWindowHandle(e.curBrowserWndHandle) && v.showWindow(e.curBrowserWndHandle, r.CmdShow.SW_HIDE), e.curBrowserWndHandle = 0);
                this.commit("UPDATE_CURRENT", n.index), m.emit(f.TabEventManagerNS.EventType.SelectTab, t, s)
            } while (0)
        }, ON_BIND_WND_HANDLE(e, t) {
            p.information("ON_BIND_WND_HANDLE");
            do {
                if (u.isNullOrUndefined(t) || u.isNullOrUndefined(t.hwnd)) {
                    p.error(t);
                    break
                }
                if (!1 === v.isWindowHandle(t.hwnd)) {
                    p.error(t.hwnd);
                    break
                }
                if (t.browser) {
                    let i = S(e.hideTabs, t.browser);
                    if (i && i.tab && i.tab.hideUI) {
                        v.showWindow(t.hwnd, r.CmdShow.SW_HIDE);
                        break
                    }
                }
                let i = e.tabs[e.current].tab;
                if (!i) break;
                if (i.getTabType() === a.TabType.XDAS) {
                    v.showWindow(t.hwnd, r.CmdShow.SW_HIDE);
                    break
                }
                if (i.getTabType() === a.TabType.Chromium) {
                    let e = i.getBrowser();
                    if (e && e !== t.browser) {
                        v.showWindow(t.hwnd, r.CmdShow.SW_HIDE);
                        break
                    }
                }
                if (e.curBrowserWndHandle === t.hwnd) break;
                if (v.isWindowHandle(t.hwnd) && !v.isWindowVisible(t.hwnd)) break;
                let n = e.tabs[e.current].tab;
                n.isErrorPage || n.isLoadingPage ? v.showWindow(t.hwnd, r.CmdShow.SW_HIDE) : (o.BrowserSupportNS.resizeBrowserWindow(t.hwnd).catch(), "find-page" !== this.getters.currentNav ? v.showWindow(t.hwnd, r.CmdShow.SW_HIDE) : v.showWindow(t.hwnd, r.CmdShow.SW_SHOW)), v.isWindowHandle(e.curBrowserWndHandle) && v.showWindow(e.curBrowserWndHandle, r.CmdShow.SW_HIDE), e.curBrowserWndHandle = t.hwnd
            } while (0)
        }, ON_NEW_TAB_CREATE(e, t) {
            let i = t.newTab, n = t.createTabParam, a = "index" in n.tabParam ? n.tabParam.index : e.current + 1;
            if (!i.getPinned()) {
                let t = 0;
                for (let i = 0; i < e.tabs.length; ++i) {
                    if (!e.tabs[i].tab.getPinned()) break;
                    t++
                }
                a < t && (a = t)
            }
            if (n.tabParam.hideUI) e.hideTabs.splice(0, 0, {
                title: i.getTitle(),
                tab: i,
                pinned: i.getPinned(),
                key: k++
            }); else {
                e.tabs.splice(a, 0, {
                    title: i.getTitle(),
                    tab: i,
                    pinned: i.getPinned(),
                    key: k++
                }), !1 !== n.tabParam.visible && this.commit("UPDATE_CURRENT", a), m.emit(f.TabEventManagerNS.EventType.AddTab, n)
            }
        }, ON_NEW_BROWSER_POPUP(e, t) {
            let i = e.current + 1;
            e.tabs.splice(i, 0, {
                title: t.getTitle(),
                tab: t,
                pinned: t.getPinned(),
                key: k++
            }), this.commit("UPDATE_CURRENT", i), m.emit(f.TabEventManagerNS.EventType.AddTab)
        }, ON_NEW_BROWSER_POPUP_COMPLETED(e, t) {
            p.information("ON_NEW_BROWSER_POPUP_COMPLETED");
            do {
                if (u.isNullOrUndefined(t) || u.isNullOrUndefined(t.browser)) {
                    p.error(t);
                    break
                }
                for (let i of e.tabs) {
                    if (u.isNullOrUndefined(i) || u.isNullOrUndefined(i.tab)) continue;
                    let e = i.tab.getBrowser();
                    if (!u.isNullOrUndefined(e) && e === t.browser) break
                }
            } while (0)
        }, ON_TITLE_CHANGE(e, t) {
            do {
                if (u.isNullOrUndefined(t) || u.isNullOrUndefined(t.browser) || u.isNullOrUndefined(t.title)) {
                    p.error(t);
                    break
                }
                for (let i of e.tabs) {
                    if (u.isNullOrUndefined(i) || u.isNullOrUndefined(i.tab)) continue;
                    let e = i.tab.getBrowser();
                    if (!u.isNullOrUndefined(e) && e === t.browser) {
                        i.title = t.title, i.tab.setTitle(t.title);
                        break
                    }
                }
            } while (0)
        }, ON_FAV_ICON_GET(e, t) {
            do {
                if (u.isNullOrUndefined(t) || u.isNullOrUndefined(t.browser) || u.isNullOrUndefined(t.iconUrl)) {
                    p.error(t);
                    break
                }
                for (let i of e.tabs) {
                    if (u.isNullOrUndefined(i) || u.isNullOrUndefined(i.tab)) continue;
                    let e = i.tab.getBrowser();
                    if (!u.isNullOrUndefined(e) && e === t.browser) {
                        i.tab.setIconUrl(t.iconUrl);
                        break
                    }
                }
            } while (0)
        }, ON_ORIGINAL_URL_CHANGE(e, t) {
            do {
                if (u.isNullOrUndefined(t) || u.isNullOrUndefined(t.browser) || u.isNullOrUndefined(t.originalUrl)) {
                    p.error(t);
                    break
                }
                for (let i of e.tabs) {
                    if (u.isNullOrUndefined(i) || u.isNullOrUndefined(i.tab)) continue;
                    let e = i.tab.getBrowser();
                    if (!u.isNullOrUndefined(e) && e === t.browser) {
                        i.tab.originalUrl = t.originalUrl;
                        break
                    }
                }
            } while (0)
        }, ON_LOAD_START(e, t) {
            p.information("ON_LOAD_START");
            do {
                if (u.isNullOrUndefined(t) || u.isNullOrUndefined(t.browser)) {
                    p.error(t);
                    break
                }
                for (let i of e.tabs) {
                    if (u.isNullOrUndefined(i) || u.isNullOrUndefined(i.tab)) continue;
                    let n = i.tab.getBrowser();
                    if (!u.isNullOrUndefined(n) && (n === t.browser && !0 === t.isMainFrame)) {
                        if (i.tab.state = "loading", i.tab.isErrorPage = !1, i.tab.isLoadingPage = !1, i.tab === e.tabs[e.current].tab) {
                            let t = n.getWindowHandle();
                            v.isWindowHandle(t) && (o.BrowserSupportNS.resizeBrowserWindow(t).catch(), "find-page" === this.getters.currentNav ? v.showWindow(t, r.CmdShow.SW_SHOW) : v.showWindow(t, r.CmdShow.SW_HIDE), e.curBrowserWndHandle = t)
                        }
                        break
                    }
                }
            } while (0)
        }, ON_LOAD_END(e, t) {
            p.information("ON_LOAD_END");
            do {
                if (u.isNullOrUndefined(t) || u.isNullOrUndefined(t.browser)) {
                    p.error(t);
                    break
                }
                for (let i of e.tabs) {
                    if (u.isNullOrUndefined(i) || u.isNullOrUndefined(i.tab)) continue;
                    let e = i.tab.getBrowser();
                    if (!u.isNullOrUndefined(e) && (e === t.browser && !0 === t.isMainFrame)) {
                        "error" !== i.tab.state && (i.tab.state = "loaded", i.tab.isErrorPage = !1);
                        break
                    }
                }
            } while (0)
        }, ON_LOAD_STATUS_CHANGE(e, t) {
            p.information("ON_LOAD_STATUS_CHANGE");
            do {
                if (u.isNullOrUndefined(t) || u.isNullOrUndefined(t.browser)) {
                    p.error(t);
                    break
                }
                for (let i of e.tabs) {
                    if (u.isNullOrUndefined(i) || u.isNullOrUndefined(i.tab)) continue;
                    let e = i.tab.getBrowser();
                    if (!u.isNullOrUndefined(e) && e === t.browser) {
                        i.tab.canGoBack = t.canGoBack, i.tab.canGoForward = t.canGoForward, t.isLoading && (i.tab.isErrorPage = !1);
                        break
                    }
                }
            } while (0)
        }, ON_ADDRESS_CHANGE(e, t) {
            do {
                if (u.isNullOrUndefined(t) || u.isNullOrUndefined(t.browser)) {
                    p.error(t);
                    break
                }
                for (let i of e.tabs) {
                    if (u.isNullOrUndefined(i) || u.isNullOrUndefined(i.tab)) continue;
                    let e = i.tab.getBrowser();
                    if (!u.isNullOrUndefined(e) && (e === t.browser && !0 === t.isMainFrame)) {
                        i.tab.url = t.url, i.tab.setCurUrl(t.url), "community" !== i.tab.name && (T.includes(t.url) ? i.tab.setShowUrl(!1) : i.tab.setShowUrl(!0));
                        break
                    }
                }
            } while (0)
        }, ON_LOAD_ERROR(e, t) {
            p.error("ON_LOAD_ERROR ", t.errorCode);
            do {
                if (u.isNullOrUndefined(t) || u.isNullOrUndefined(t.browser)) {
                    p.error(t);
                    break
                }
                for (let i of e.tabs) {
                    if (u.isNullOrUndefined(i) || u.isNullOrUndefined(i.tab)) continue;
                    let e = i.tab.getBrowser();
                    if (!u.isNullOrUndefined(e) && (e === t.browser && !0 === t.isMainFrame && (-105 === t.err || -21 === t.err || -106 === t.err || -118 === t.err || -7 === t.err || -101 === t.err))) {
                        i.tab.state = "error", i.tab.url = t.failedUrl, i.tab.isErrorPage = !0, i.tab.isLoadingPage = !1;
                        let n = e.getWindowHandle();
                        if (0 === n) break;
                        p.error("ON_LOAD_ERROR HIDE hwnd: ", n), v.isWindowHandle(n) && v.showWindow(n, r.CmdShow.SW_HIDE);
                        break
                    }
                }
            } while (0)
        }, ON_APP_QUIT(e) {
            p.information(e);
            for (let t of e.tabs) u.isNullOrUndefined(t) || u.isNullOrUndefined(t.tab) || t.tab.getTabType() === a.TabType.Chromium && t.tab.destroyBrowser(!0)
        }, REGISTER_NATIVE_FUNCTION(e, t) {
            do {
                if (u.isNullOrUndefined(t) || u.isNullOrUndefined(e.tabs[0]) || u.isNullOrUndefined(e.tabs[0].tab)) break;
                let i = e.tabs[0].tab.registerNativeFunction(t.functionName, t.nativeFunc);
                !1 === i && p.error(i)
            } while (0)
        }, UN_REGISTER_NATIVE_FUNCTION(e, t) {
            do {
                if (u.isNullOrUndefined(e.tabs) || u.isNullOrUndefined(e.tabs[0].tab)) break
            } while (0);
            e.tabs[0].tab.unregisterNativeFunction(t)
        }, CLOSE_TAB(e, t) {
            do {
                if (u.isNullOrUndefined(t) || u.isNullOrUndefined(t.index) || u.isNullOrUndefined(t.tabInfo) || u.isNullOrUndefined(t.tabInfo.tab)) {
                    p.error(t);
                    break
                }
                let i = t.tabInfo.tab;
                if (i.getTabType() === a.TabType.Chromium) {
                    i.destroyBrowser(!0) || C(this, e, t)
                } else C(this, e, t)
            } while (0)
        }, CLOSE_TAB_BY_NAME(e, t) {
            do {
                if (u.isNullOrUndefined(t)) {
                    p.error(t);
                    break
                }
                let i = -1;
                for (let n = 0; n < e.tabs.length; n++) if (t === e.tabs[n].tab.name) {
                    i = n;
                    break
                }
                if (-1 !== i) {
                    let t = e.tabs[i].tab, n = t.getTabType(), o = {tabInfo: e.tabs[i], index: i};
                    if (n === a.TabType.Chromium) {
                        t.destroyBrowser(!0) || C(this, e, o)
                    } else C(this, e, o)
                } else {
                    i = -1;
                    for (let n = 0; n < e.hideTabs.length; n++) if (t === e.hideTabs[n].tab.name) {
                        i = n;
                        break
                    }
                    if (-1 === i) break;
                    let n = e.hideTabs[i].tab;
                    n.getTabType() === a.TabType.Chromium && n.destroyBrowser(!0), e.hideTabs.splice(i, 1)
                }
            } while (0)
        }, Remove_TAb_CTRL(e, t) {
            C(this, e, t)
        }, ON_CHROMIUM_CALL_NATIVE_FUNCTION(e, t) {
            do {
                if (u.isNullOrUndefined(t) || u.isNullOrUndefined(t.functionName) || u.isNullOrUndefined(t.browser)) {
                    p.error(t);
                    break
                }
                for (let i of e.tabs) {
                    if (u.isNullOrUndefined(i) || u.isNullOrUndefined(i.tab)) continue;
                    let e = i.tab.getBrowser();
                    if (!u.isNullOrUndefined(e) && e === t.browser) {
                        !1 === i.tab.onJsCallNativeFunction(0, t.functionName, t.callBackId, t.args) && p.error(t)
                    }
                }
            } while (0)
        }, ON_CHROMIUM_CHECK_NATIVE_FUNCTION(e, t) {
            do {
                if (u.isNullOrUndefined(t) || u.isNullOrUndefined(t.functionName) || u.isNullOrUndefined(t.browser)) {
                    p.error(t);
                    break
                }
                for (let i of e.tabs) {
                    if (u.isNullOrUndefined(i) || u.isNullOrUndefined(i.tab)) continue;
                    let e = i.tab.getBrowser();
                    if (!u.isNullOrUndefined(e) && e === t.browser) {
                        !1 === i.tab.onJsCheckNativeFunction(0, t.functionName, t.callBackId) && p.error(t)
                    }
                }
            } while (0)
        }, ON_BROWSER_CREATE(e, t) {
            do {
                if (!t || !t.tabInfo) break;
                let i = t.tabInfo.tab;
                if (!i) break;
                if (e.tabs[e.current].tab !== i) break;
                let n = i.getBrowser();
                if (!n) break;
                let a = n.getWindowHandle();
                if (!1 === v.isWindowHandle(a)) {
                    p.error(a);
                    break
                }
                v.isWindowHandle(a) && (i.isErrorPage ? (v.showWindow(a, r.CmdShow.SW_HIDE), n.refresh()) : (v.showWindow(a, r.CmdShow.SW_SHOW), v.setWindowFocus(a, !0))), v.isWindowHandle(e.curBrowserWndHandle) && v.showWindow(e.curBrowserWndHandle, r.CmdShow.SW_HIDE), e.curBrowserWndHandle = a;
                let s = e.tabs[e.current].tab;
                s.isErrorPage || s.isLoadingPage || o.BrowserSupportNS.resizeBrowserWindow(e.curBrowserWndHandle).catch()
            } while (0)
        }, UPDATE_TAB_TITLE(e, t) {
            do {
                if (!t || !t.title || void 0 === t.index) break;
                let i = e.tabs[t.index];
                if (!i) break;
                i.title = t.title, i.tab.setTitle(t.title)
            } while (0)
        }, UPDATE_CURRENT(e, t) {
            let i = e.current;
            e.current = t, i !== e.current && (f.setCurrentTabID(e.current), m.emit(f.TabEventManagerNS.EventType.ChangeTab, e.current, e.tabs[e.current]))
        }, UPDATE_TABS(e, t) {
            e.tabs = t
        }
    }, A = {
        selectTab({commit: e}, t) {
            e("SELECT_TAB", t)
        }, closeTab({commit: e}, t) {
            e("CLOSE_TAB", t)
        }, closeTabByName({commit: e}, t) {
            e("CLOSE_TAB_BY_NAME", t)
        }, removeTabCtrl({commit: e}, t) {
            e("Remove_TAb_CTRL", t)
        }, onChromiumCallNativeFunction({commit: e}, t) {
            e("ON_CHROMIUM_CALL_NATIVE_FUNCTION", t)
        }, onChromiumCheckNativeFunction({commit: e}, t) {
            e("ON_CHROMIUM_CHECK_NATIVE_FUNCTION", t)
        }, onNewBrowserPopup({commit: e}, t) {
            return n(this, void 0, void 0, function* () {
                p.information("ON_NEW_BROWSER_POPUP");
                do {
                    if (u.isNullOrUndefined(t)) {
                        p.error(t);
                        break
                    }
                    if (yield c.URLHelperNS.isCustomProtocol(t.url)) {
                        h.ThunderNewTask.createTaskByUrl(t.url);
                        break
                    }
                    let i = {isFromPopup: !0, url: t.url}, n = a.TabType.Chromium, o = yield f.createNewTab(n, i, t.ev);
                    if (u.isNullOrUndefined(o)) {
                        p.error(o);
                        break
                    }
                    e("ON_NEW_BROWSER_POPUP", o)
                } while (0)
            })
        }, onCreateNewTab({commit: e}, t) {
            e("ON_NEW_TAB_CREATE", t)
        }
    }, D = {
        currentTab: e => {
            let t = null;
            do {
                if (u.isNullOrUndefined(e) || u.isNullOrUndefined(e.current) || u.isNullOrUndefined(e.tabs)) {
                    p.error(e);
                    break
                }
                let i = e.tabs[e.current];
                if (u.isNullOrUndefined(i) || u.isNullOrUndefined(i.tab)) break;
                t = i
            } while (0);
            return t
        }, allTabs: e => e.tabs.concat(e.hideTabs)
    };
    t.default = {state: w, mutations: _, actions: A, getters: D}
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(10), a = i(323), o = i(107), r = i(0).default.getLogger("setting-conf"), s = {
        REMOVE_CONFIG_DATA(e) {
            e.formData = {}, e.confSchema = []
        }, SET_CONFIG_DATA(e, t) {
            e.formData = Object.assign({}, e.formData, t)
        }, SET_CONF_SCHEMA(e, t) {
            e.confSchema = t
        }, ADD_SCHEMA_ITEM(e, t) {
            if (r.information("ADD_SCHEMA_ITEM", t), void 0 !== t.position[0] && void 0 !== t.position[1]) {
                let i = 0;
                i = t.direction < 0 ? e.confSchema[t.position[0]].children[t.position[1]].children.length + t.direction + 1 : t.direction, e.confSchema[t.position[0]].children[t.position[1]].children.splice(i, 0, t.schemaItem), o.default.set(e.confSchema[t.position[0]].children[t.position[1]].children, "children", e.confSchema[t.position[0]].children[t.position[1]].children)
            }
        }, ADD_FORMDATA_ITEM(e, t) {
            let i = `${t.section}-${t.key}`;
            void 0 === e.formData[i] && o.default.set(e.formData, i, t)
        }, ADD_SELECT_ITEM(e, t) {
            let i = e.formData[t.target];
            r.information("targetItem", i), i.selectItems.includes(t.from) || (i.selectItems.push(t.from), o.default.set(e.formData[t.target], "selectItems", i.selectItems))
        }, SET_CONFIG_VALUE(e, t) {
            if (void 0 !== e.formData[t.name].optionToValue) {
                let i = t.value;
                n.ConfigNS.setValue(t.section, `${t.key}`, e.formData[t.name].optionToValue[i]), "" !== t.userId && n.ConfigNS.setValue(t.section, `${t.key}${t.userId}`, e.formData[t.name].optionToValue[i])
            } else if (e.formData[t.name].type && "number" === e.formData[t.name].type) {
                let e = Number(t.value);
                n.ConfigNS.setValue(t.section, `${t.key}`, e), "" !== t.userId && n.ConfigNS.setValue(t.section, `${t.key}${t.userId}`, e)
            } else n.ConfigNS.setValue(t.section, `${t.key}`, t.value), "" !== t.userId && n.ConfigNS.setValue(t.section, `${t.key}${t.userId}`, t.value);
            void 0 !== e.formData[t.name].immediatelySave && n.ConfigNS.saveSync(), function (e, t) {
                let i = e.formData[t.name];
                void 0 !== i.selectItems && i.selectItems.map(i => {
                    let a = t.value;
                    e.formData[i].type && "number" === e.formData[i].type && (a = Number(t.value)), n.ConfigNS.setValue(e.formData[i].section, e.formData[i].key, a)
                });
                if (void 0 !== i.selectAllName) {
                    let i = e.formData[t.name].selectAllName, a = e.formData[i];
                    if (t.value) {
                        let t = !0;
                        a.selectItems.map(i => {
                            t = n.ConfigNS.getValue(e.formData[i].section, e.formData[i].key, !1) && t
                        }), t && n.ConfigNS.setValue(a.section, a.key, !0)
                    } else {
                        let e = n.ConfigNS.getValue(a.section, a.key, "");
                        e && n.ConfigNS.setValue(a.section, a.key, !1)
                    }
                }
            }(e, t)
        }, SET_FOMR_DATA(e, t) {
            let i = `${t.section}-${t.key}`;
            if (void 0 === e.formData[i]) return;
            let n = t.value;
            if (void 0 !== e.formData[i] && void 0 !== e.formData[i].optionToValue) {
                let a = e.formData[i];
                for (let e in a.optionToValue) if (a.optionToValue[e] === t.value) {
                    n = e;
                    break
                }
            } else void 0 !== e.formData[`${t.section}-${t.key}`] && (n = t.value);
            e.formData[`${t.section}-${t.key}`].value = n
        }
    }, l = {
        initSettingData({commit: e}) {
            a.SettingInit.setBaseConf();
            let t = null;
            a.SettingInit.getConfSchemaEx().then(i => {
                (i => {
                    let n = a.SettingInit.getConfFormData();
                    try {
                        t = JSON.parse(JSON.stringify(i))
                    } catch (e) {
                    }
                    null === t && (t = a.SettingInit.getConfSchema()), e("SET_CONF_SCHEMA", t), e("SET_CONFIG_DATA", n)
                })(i)
            }).catch()
        }
    };
    t.default = {state: {confSchema: [], formData: {}}, mutations: s, actions: l}
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(8), a = i(0), o = i(3), r = i(15), s = i(40), l = i(29), d = i(11), u = i(27), c = i(305),
        h = a.default.getLogger("DownloadStore"), f = d.DownloadKernelTaskManager.getTaskManager(),
        g = r.DownloadKernelEventManager.getEventManager(),
        p = s.DownloadKernelCategoryViewManager.getCategoryViewManager(),
        v = l.DownloadKernelCategoryManager.getCategoryManager(), m = {
            currentCategoryId: -1,
            currentCategoryViewId: o.DownloadKernel.CategroyViewID.Downloading,
            taskList: [{
                categoryId: -1,
                id: o.DownloadKernel.CategroyViewID.Downloading,
                tasksMap: {},
                selected: [],
                taskIds: []
            }, {
                categoryId: -1,
                id: o.DownloadKernel.CategroyViewID.Completed,
                tasksMap: {},
                selected: [],
                taskIds: []
            }, {categoryId: -1, id: o.DownloadKernel.CategroyViewID.Recycle, tasksMap: {}, selected: [], taskIds: []}],
            taskListPrivate: [{
                id: o.DownloadKernel.CategroyViewID.Downloading,
                tasksMap: {},
                selected: [],
                taskIds: []
            }, {id: o.DownloadKernel.CategroyViewID.Completed, tasksMap: {}, selected: [], taskIds: []}]
        }, y = {
            INIT_CATEGORY_TASKLIST(e) {
                h.information("INIT_CATEGORY_TASKLIST state.currentCategoryId:", e.currentCategoryId);
                let t = e.taskList;
                -1 !== e.currentCategoryId && (t = e.taskListPrivate);
                for (let i = 0; i < t.length; i++) {
                    let n = t[i], a = null;
                    if (!(a = -1 === e.currentCategoryId ? p.getCategoryViewFromId(n.id) : v.getCategoryView(e.currentCategoryId, n.id))) {
                        n.tasksMap = null, n.selected = [], n.taskIds = [], n.tasksMap = {};
                        continue
                    }
                    let o = a.getTasks();
                    t[i].tasksMap = null, t[i].tasksMap = {}, t[i].selected = [], t[i].categoryId = e.currentCategoryId;
                    let r = {};
                    for (let [e, t]of o) r[e] = t.getTaskBaseInfo();
                    let s = [...Object.values(r)];
                    s.sort(c.SortNS.getSortFuncByConfig(n.id, n.categoryId)), t[i].tasksMap = Object.assign({}, r), t[i].taskIds = s.map(e => e.taskId)
                }
                h.information("INIT_CATEGORY_TASKLIST end")
            }, SORT_CATEGORY_HISTORY(e) {
                let t = e.taskList;
                -1 !== e.currentCategoryId && (t = e.taskListPrivate);
                for (let e = 0; e < t.length; e++) {
                    let i = [...Object.values(t[e].tasksMap)];
                    i.sort(c.SortNS.getSortFuncByConfig(t[e].id, t[e].categoryId)), t[e].taskIds = i.map(e => e.taskId)
                }
            }, SORT_CATEGORY_BY_FUNCTION(e, t) {
                do {
                    if (t.index < 0 || t.index > 2) break;
                    if ("function" != typeof t.compareFn) break;
                    if (-1 === t.categoryId) {
                        let i = [...Object.values(e.taskList[t.index].tasksMap)];
                        i.sort(t.compareFn), e.taskList[t.index].taskIds = i.map(e => e.taskId)
                    } else {
                        let i = [...Object.values(e.taskListPrivate[t.index].tasksMap)];
                        i.sort(t.compareFn), e.taskListPrivate[t.index].taskIds = i.map(e => e.taskId)
                    }
                } while (0)
            }, UPDATE_CATEGORYVIEW(e, t) {
                e.currentCategoryViewId !== t && (e.currentCategoryViewId = t, u.default.setCurrentCategoryView(t))
            }, INSERT_TO_CATEGORY_VIEW(e, t) {
                h.information("insert INSERT_TO_CATEGORY_VIEW in ");
                let i = e.taskList;
                -1 !== t.categoryId && (i = e.taskListPrivate);
                for (let e = 0; e < i.length; e++) if (i[e].id === t.id) {
                    if (i[e].categoryId !== t.categoryId) break;
                    let n = [], a = {};
                    for (let e of t.tasks) a[e.taskId] = Object.assign({}, e), n.push(e.taskId);
                    i[e].tasksMap = Object.assign({}, i[e].tasksMap, a), n.length > 0 && i[e].taskIds.splice(0, 0, ...n);
                    break
                }
                h.information("insert INSERT_TO_CATEGORY_VIEW end ")
            }, REMOVE_FROM_CATEGORY_VIEW(e, t) {
                let i = e.taskList;
                -1 !== t.categoryId && (i = e.taskListPrivate);
                for (let e = 0; e < i.length; e++) if (i[e].id === t.categoryViewId) {
                    if (i[e].categoryId !== t.categoryId) break;
                    let n = Object.assign({}, i[e].tasksMap), a = Object.assign([], i[e].taskIds),
                        o = Object.assign([], i[e].selected);
                    for (let e of t.tasks) {
                        let t = e.taskId;
                        delete n[t];
                        let i = a.indexOf(t);
                        -1 !== i && a.splice(i, 1);
                        let r = o.indexOf(t);
                        -1 !== r && o.splice(r, 1)
                    }
                    i[e].tasksMap = n, i[e].taskIds = a, i[e].selected = o;
                    break
                }
            }, UPDATE_TASK_INFO(e, t) {
                do {
                    if (null === t || 0 === t.length) break;
                    for (let i of t) {
                        let t = 0;
                        e.taskList[t].tasksMap.hasOwnProperty(String(i.taskId)) ? Object.assign(e.taskList[t].tasksMap[i.taskId], i) : e.taskListPrivate[t].tasksMap.hasOwnProperty(String(i.taskId)) ? Object.assign(e.taskListPrivate[t].tasksMap[i.taskId], i) : (t = 1, e.taskList[t].tasksMap.hasOwnProperty(String(i.taskId)) ? (h.information("update task info not find in downloading", i), Object.assign(e.taskList[t].tasksMap[i.taskId], i)) : e.taskListPrivate[t].tasksMap.hasOwnProperty(String(i.taskId)) ? Object.assign(e.taskListPrivate[t].tasksMap[i.taskId], i) : (t = 2, e.taskList[t].tasksMap.hasOwnProperty(String(i.taskId)) && (h.information("update task info not find in downloading & complete", i), Object.assign(e.taskList[t].tasksMap[i.taskId], i))))
                    }
                } while (0)
            }, UPDATE_TASK_READED(e, t) {
                do {
                    if (null === t || 0 === t.length) break;
                    let i = 1;
                    for (let a of t) -1 === e.currentCategoryId ? e.taskList[i].tasksMap.hasOwnProperty(String(a.taskId)) && n.Vue.set(e.taskList[i].tasksMap, String(a.taskId), Object.assign({}, a)) : e.taskListPrivate[i].tasksMap.hasOwnProperty(String(a.taskId)) && n.Vue.set(e.taskListPrivate[i].tasksMap, String(a.taskId), Object.assign({}, a))
                } while (0)
            }, UPDATE_TASK_RENAME(e, t) {
                do {
                    if (null === t || 0 === t.length) break;
                    let i = 1;
                    for (let a of t) -1 === e.currentCategoryId ? e.taskList[i].tasksMap.hasOwnProperty(String(a.taskId)) && n.Vue.set(e.taskList[i].tasksMap, String(a.taskId), Object.assign({}, a)) : e.taskListPrivate[i].tasksMap.hasOwnProperty(String(a.taskId)) && n.Vue.set(e.taskListPrivate[i].tasksMap, String(a.taskId), Object.assign({}, a))
                } while (0)
            }, UPDATE_TASK_MOVING_STATE_CHANGE(e, t) {
                do {
                    if (null === t || 0 === t.length) break;
                    let i = 0;
                    t[0].taskStatus !== o.DownloadKernel.TaskStatus.Succeeded && t[0].taskStatus !== o.DownloadKernel.TaskStatus.Seeding || (i = 1);
                    for (let a of t) -1 === e.currentCategoryId ? e.taskList[i].tasksMap.hasOwnProperty(String(a.taskId)) && n.Vue.set(e.taskList[i].tasksMap, String(a.taskId), Object.assign({}, a)) : e.taskListPrivate[i].tasksMap.hasOwnProperty(String(a.taskId)) && n.Vue.set(e.taskListPrivate[i].tasksMap, String(a.taskId), Object.assign({}, a))
                } while (0)
            }, UPDATE_TASK_MOVED(e, t) {
                do {
                    if (null === t || 0 === t.length) break;
                    let i = 0;
                    t[0].taskStatus !== o.DownloadKernel.TaskStatus.Succeeded && t[0].taskStatus !== o.DownloadKernel.TaskStatus.Seeding || (i = 1);
                    for (let a of t) -1 === e.currentCategoryId ? e.taskList[i].tasksMap.hasOwnProperty(String(a.taskId)) && n.Vue.set(e.taskList[i].tasksMap, String(a.taskId), Object.assign({}, a)) : e.taskListPrivate[i].tasksMap.hasOwnProperty(String(a.taskId)) && n.Vue.set(e.taskListPrivate[i].tasksMap, String(a.taskId), Object.assign({}, a))
                } while (0)
            }, UPDATE_TASK_STATUS(e, t) {
                do {
                    if (!t || 0 === t.length) break;
                    h.information("update status in", t.length, t[0].taskStatus, t[0].taskId);
                    let i = 0, n = {}, a = void 0, o = t[0];
                    if (e.taskList[i].tasksMap.hasOwnProperty(String(o.taskId)) ? a = !1 : e.taskListPrivate[i].tasksMap.hasOwnProperty(String(o.taskId)) && (a = !0), void 0 === a) break;
                    for (let e of t) n[e.taskId] = e;
                    h.information("update status "), a ? e.taskListPrivate[i].tasksMap = Object.assign({}, e.taskListPrivate[i].tasksMap, n) : e.taskList[i].tasksMap = Object.assign({}, e.taskList[i].tasksMap, n), h.information("update status end")
                } while (0)
            }, UPDATE_DOWNLOADING_SELECTED_TASKS(e, t) {
                -1 === e.currentCategoryId ? e.taskList[0].selected = [...t] : e.taskListPrivate[0].selected = [...t]
            }, UPDATE_COMPLETED_SELECTED_TASKS(e, t) {
                -1 === e.currentCategoryId ? e.taskList[1].selected = [...t] : e.taskListPrivate[1].selected = [...t]
            }, UPDATE_RECYCLE_SELECTED_TASKS(e, t) {
                -1 === e.currentCategoryId && (e.taskList[2].selected = [...t])
            }, MOVE_TO_TOP(e, t) {
                do {
                    if (null === t || 0 === t.length) break;
                    let i = e.taskList[0].taskIds;
                    -1 !== e.currentCategoryId && (i = e.taskListPrivate[0].taskIds);
                    let n = [];
                    for (let e of t) {
                        let t = i.indexOf(e);
                        -1 !== t && n.push(t)
                    }
                    n.sort((e, t) => e - t);
                    let a = [];
                    for (let e = n.length - 1; e >= 0; e--) a.unshift(i.splice(n[e], 1)[0]);
                    i.splice(0, 0, ...a)
                } while (0)
            }, MOVE_TO_BOTTOM(e, t) {
                do {
                    if (null === t || 0 === t.length) break;
                    let i = e.taskList[0].taskIds;
                    -1 !== e.currentCategoryId && (i = e.taskListPrivate[0].taskIds);
                    let n = [];
                    for (let e of t) {
                        let t = i.indexOf(e);
                        -1 !== t && n.push(t)
                    }
                    n.sort((e, t) => e - t);
                    let a = [];
                    for (let e = n.length - 1; e >= 0; e--) a.unshift(i.splice(n[e], 1)[0]);
                    i.splice(i.length, 0, ...a)
                } while (0)
            }, SELECT_PRE(e) {
                let t = null, i = [], n = [];
                if (e.currentCategoryViewId === o.DownloadKernel.CategroyViewID.Downloading ? -1 === e.currentCategoryId ? 1 === e.taskList[0].selected.length && (t = e.taskList[0], n = e.taskList[0].taskIds, i = e.taskList[0].selected) : e.currentCategoryId === e.taskListPrivate[0].categoryId && (t = e.taskListPrivate[0], i = e.taskListPrivate[0].selected, n = e.taskListPrivate[0].taskIds) : e.currentCategoryViewId === o.DownloadKernel.CategroyViewID.Completed ? -1 === e.currentCategoryId ? (t = e.taskList[1], n = e.taskList[1].taskIds, i = e.taskList[1].selected) : e.currentCategoryId === e.taskListPrivate[1].categoryId && (t = e.taskListPrivate[1], n = e.taskListPrivate[1].taskIds, i = e.taskListPrivate[1].selected) : e.currentCategoryViewId === o.DownloadKernel.CategroyViewID.Recycle && -1 === e.currentCategoryId && (t = e.taskList[2], n = e.taskList[2].taskIds, i = e.taskList[2].selected), 1 === i.length) {
                    let e = i[0], a = n.indexOf(e);
                    -1 !== a && 0 !== a && (t.selected = [n[a - 1]])
                }
            }, SELECT_NEXT(e) {
                let t = null, i = [], n = [];
                if (e.currentCategoryViewId === o.DownloadKernel.CategroyViewID.Downloading ? -1 === e.currentCategoryId ? 1 === e.taskList[0].selected.length && (t = e.taskList[0], n = e.taskList[0].taskIds, i = e.taskList[0].selected) : e.currentCategoryId === e.taskListPrivate[0].categoryId && (t = e.taskListPrivate[0], i = e.taskListPrivate[0].selected, n = e.taskListPrivate[0].taskIds) : e.currentCategoryViewId === o.DownloadKernel.CategroyViewID.Completed ? -1 === e.currentCategoryId ? (t = e.taskList[1], n = e.taskList[1].taskIds, i = e.taskList[1].selected) : e.currentCategoryId === e.taskListPrivate[1].categoryId && (t = e.taskListPrivate[1], n = e.taskListPrivate[1].taskIds, i = e.taskListPrivate[1].selected) : e.currentCategoryViewId === o.DownloadKernel.CategroyViewID.Recycle && -1 === e.currentCategoryId && (t = e.taskList[2], n = e.taskList[2].taskIds, i = e.taskList[2].selected), 1 === i.length) {
                    let e = i[0], a = n.indexOf(e);
                    -1 !== a && a !== n.length - 1 && (t.selected = [n[a + 1]])
                }
            }, UPDATE_CATEGORY(e, t) {
                if (e.currentCategoryId !== t) {
                    if (e.currentCategoryId = t, -1 !== t) for (let i = 0; i < e.taskListPrivate.length; i++) e.taskListPrivate[i].categoryId = t, e.taskListPrivate[i].tasksMap = null, e.taskListPrivate[i].tasksMap = {}, e.taskListPrivate[i].taskIds = [], e.taskListPrivate[i].selected = [];
                    u.default.setCurrentCategoryId(t)
                }
            }, UPDATE_DOWNLOADING_TASKLIST(e, t) {
                if (t.length > 0) {
                    let i = 0, n = null;
                    (n = -1 === e.currentCategoryId ? e.taskList[i] : e.taskListPrivate[i]).taskIds.splice(0, t.length, ...t)
                }
            }, UPDATE_COMPLETED_TASKLIST(e, t) {
                if (t.length > 0) {
                    let i = 1, n = null;
                    (n = -1 === e.currentCategoryId ? e.taskList[i] : e.taskListPrivate[i]).taskIds.splice(0, t.length, ...t)
                }
            }, UPDATE_RECYCLE_TASKLIST(e, t) {
                t.length > 0 && -1 === e.currentCategoryId && e.taskList[2].taskIds.splice(0, t.length, ...t)
            }
        }, k = {
            attachTaskEvent({commit: e}) {
                g.attachTaskEvent(o.DownloadKernel.TaskEventType.DetailChanged, (...t) => {
                    do {
                        if (!t) break;
                        if (t[0] !== o.DownloadKernel.TaskEventType.DetailChanged) break;
                        if (!t[1]) break;
                        let i = t[1].map(e => e.getTaskBaseInfo()), n = t[2];
                        n & o.DownloadKernel.TaskDetailChangedFlags.UserRead && e("UPDATE_TASK_READED", i), n !== o.DownloadKernel.TaskDetailChangedFlags.UserRead && e("UPDATE_TASK_INFO", i)
                    } while (0)
                }), g.attachTaskEvent(o.DownloadKernel.TaskEventType.TaskMovingStateChange, (...t) => {
                    do {
                        if (!t) break;
                        if (t[0] !== o.DownloadKernel.TaskEventType.TaskMovingStateChange) break;
                        if (!t[1]) break;
                        let i = t[1].map(e => e.getTaskBaseInfo());
                        e("UPDATE_TASK_MOVING_STATE_CHANGE", i)
                    } while (0)
                }), g.attachTaskEvent(o.DownloadKernel.TaskEventType.BtSubFileDetailChanged, (...t) => {
                    do {
                        if (!t) break;
                        if (t[0] !== o.DownloadKernel.TaskEventType.BtSubFileDetailChanged) break;
                        if (!t[1] || !t[2]) break;
                        let i = t[1];
                        if (t[2].length > 0) break;
                        let n = f.getTaskFromTaskId(i);
                        if (!n) break;
                        e("UPDATE_TASK_INFO", [n.getTaskBaseInfo()])
                    } while (0)
                }), g.attachTaskEvent(o.DownloadKernel.TaskEventType.TaskRenamed, (...t) => {
                    do {
                        if (!t) break;
                        if (t[0] !== o.DownloadKernel.TaskEventType.TaskRenamed) break;
                        if (!t[1]) break;
                        let i = t[1].map(e => e.getTaskBaseInfo());
                        e("UPDATE_TASK_RENAME", i)
                    } while (0)
                }), g.attachTaskEvent(o.DownloadKernel.TaskEventType.TaskMovedEnd, (...t) => {
                    do {
                        if (!t) break;
                        if (t[0] !== o.DownloadKernel.TaskEventType.TaskMovedEnd) break;
                        if (!t[1]) break;
                        let i = t[1], n = [];
                        for (let e of i) null !== e && n.push(e.getTaskBaseInfo());
                        n.length > 0 && e("UPDATE_TASK_MOVED", n)
                    } while (0)
                }), g.attachTaskEvent(o.DownloadKernel.TaskEventType.TaskCategoryMovedEnd, (...t) => {
                    do {
                        if (!t) break;
                        if (t[0] !== o.DownloadKernel.TaskEventType.TaskCategoryMovedEnd) break;
                        if (!t[1]) break;
                        let i = t[1], n = [];
                        for (let e of i) null !== e && n.push(e.getTaskBaseInfo());
                        n.length > 0 && e("UPDATE_TASK_MOVED", n)
                    } while (0)
                }), g.attachTaskEvent(o.DownloadKernel.TaskEventType.RemoveFromCategoryView, (...t) => {
                    do {
                        if (!t) break;
                        if (t[0] !== o.DownloadKernel.TaskEventType.RemoveFromCategoryView) break;
                        if (void 0 === t[1] || !t[2] || !t[3]) break;
                        let i = t[1];
                        if (-1 === i || v.isPrivateCategory(i)) {
                            let n = t[2], a = t[3].map(e => e.getTaskBaseInfo());
                            e("REMOVE_FROM_CATEGORY_VIEW", {categoryId: i, categoryViewId: n, tasks: a})
                        }
                    } while (0)
                })
            }
        }, T = {
            currentCategoryTaskCount: e => {
                let t = 0;
                return e.currentCategoryViewId === o.DownloadKernel.CategroyViewID.Downloading ? -1 === e.currentCategoryId ? t = e.taskList[0].taskIds.length : e.currentCategoryId === e.taskListPrivate[0].categoryId && (t = e.taskListPrivate[0].taskIds.length) : e.currentCategoryViewId === o.DownloadKernel.CategroyViewID.Completed ? -1 === e.currentCategoryId ? t = e.taskList[1].taskIds.length : e.currentCategoryId === e.taskListPrivate[0].categoryId && (t = e.taskListPrivate[1].taskIds.length) : e.currentCategoryViewId === o.DownloadKernel.CategroyViewID.Recycle && -1 === e.currentCategoryId && (t = e.taskList[2].taskIds.length), t
            }, currentSelectdTaskInfos: e => {
                let t = [], i = null, n = [];
                if (e.currentCategoryViewId === o.DownloadKernel.CategroyViewID.Downloading ? -1 === e.currentCategoryId ? (i = e.taskList[0].tasksMap, n = e.taskList[0].selected) : e.currentCategoryId === e.taskListPrivate[0].categoryId && (i = e.taskListPrivate[0].tasksMap, n = e.taskListPrivate[0].selected) : e.currentCategoryViewId === o.DownloadKernel.CategroyViewID.Completed ? -1 === e.currentCategoryId ? (i = e.taskList[1].tasksMap, n = e.taskList[1].selected) : e.currentCategoryId === e.taskListPrivate[1].categoryId && (i = e.taskListPrivate[1].tasksMap, n = e.taskListPrivate[1].selected) : e.currentCategoryViewId === o.DownloadKernel.CategroyViewID.Recycle && -1 === e.currentCategoryId && (i = e.taskList[2].tasksMap, n = e.taskList[2].selected), null !== i) for (let e of n) void 0 !== i[e] && null !== i[e] ? t.push(i[e]) : h.information("selected taskbase undefined", e);
                return t
            }, downloadingSelectedIndexs: e => {
                let t = [];
                return -1 === e.currentCategoryId ? t = e.taskList[0].selected : e.currentCategoryId === e.taskListPrivate[0].categoryId && (t = e.taskListPrivate[0].selected), t
            }, completedSelectedTaskIndexs: e => {
                let t = [];
                return -1 === e.currentCategoryId ? t = e.taskList[1].selected : e.currentCategoryId === e.taskListPrivate[1].categoryId && (t = e.taskListPrivate[1].selected), t
            }, recycleSelectedTaskIndexs: e => {
                let t = [];
                return -1 === e.currentCategoryId && (t = e.taskList[2].selected), t
            }, downloadingTaskList: e => {
                let t = [];
                return -1 === e.currentCategoryId ? t = e.taskList[0].taskIds : e.currentCategoryId === e.taskListPrivate[0].categoryId && (t = e.taskListPrivate[0].taskIds), t
            }, completedTaskList: e => {
                let t = [];
                return -1 === e.currentCategoryId ? t = e.taskList[1].taskIds : e.currentCategoryId === e.taskListPrivate[1].categoryId && (t = e.taskListPrivate[1].taskIds), t
            }, recycleTaskList: e => {
                let t = [];
                return -1 === e.currentCategoryId && (t = e.taskList[2].taskIds), t
            }, downloadingOrder: e => {
                return e.taskList[0].taskIds
            }, canStartAll: e => {
                let t = !0;
                {
                    let i = e.taskList[0].tasksMap;
                    for (let e in i) {
                        if (i[e].isMoving) {
                            t = !1;
                            break
                        }
                    }
                }
                return t
            }, downloadingTaskBaseList: e => {
                let t = [], i = {};
                return -1 === e.currentCategoryId ? i = e.taskList[0].tasksMap : e.currentCategoryId === e.taskListPrivate[0].categoryId && (i = e.taskListPrivate[0].tasksMap), t = [...Object.values(i)]
            }, completedTaskBaseList: e => {
                let t = [], i = {};
                return -1 === e.currentCategoryId ? i = e.taskList[1].tasksMap : e.currentCategoryId === e.taskListPrivate[1].categoryId && (i = e.taskListPrivate[1].tasksMap), t = [...Object.values(i)]
            }, recycleTaskBaseList: e => {
                let t = [], i = {};
                return -1 === e.currentCategoryId && (i = e.taskList[2].tasksMap), t = [...Object.values(i)]
            }
        };
    t.default = {state: m, mutations: y, actions: k, getters: T}
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(8), o = i(0), r = i(3), s = i(38), l = i(60), d = i(11), u = i(36), c = i(41), h = i(40), f = i(9),
        g = i(96), p = i(97), v = i(45), m = h.DownloadKernelCategoryViewManager.getCategoryViewManager(),
        y = o.default.getLogger("download-tool-bar"), k = d.DownloadKernelTaskManager.getTaskManager();
    let T = (e, t) => {
        f.XLStatNS.trackEvent("download_leftpanel", "top_newtask_click"), f.XLStatNS.trackEvent("core_event", "create_task_click", "", 0, 0, 0, 0, "click_source=dltab_menu"), s.ThunderNewTask.createPreNewTaskWindow(null)
    }, w = () => "", C = e => {
        let t = "";
        return e.showPrivateSpaceOpenPage && (t = "is-disabled"), t
    }, S = (e, t) => {
        y.verbose(e);
        let i = t.currentCategoryViewId, n = t.currentSelectdTaskInfos;
        i === r.DownloadKernel.CategroyViewID.Downloading ? u.TaskOperatorNs.startTasks(n) : y.error("toolbar start tasks but not in downloading category")
    }, b = e => {
        let t = e.currentCategoryViewId, i = e.currentSelectdTaskInfos, n = "is-disabled";
        return !e.showPrivateSpaceOpenPage && l.TaskStatusHelper.canStartSelectedTask(t, i) && (n = ""), n
    }, I = (e, t) => {
        y.verbose(e);
        let i = t.currentCategoryViewId, n = t.currentSelectdTaskInfos;
        i === r.DownloadKernel.CategroyViewID.Downloading ? u.TaskOperatorNs.pauseTasks(n, r.DownloadKernel.TaskStopReason.Manual) : y.error("toolbar pause tasks but not in downloading category")
    }, _ = e => {
        let t = e.currentCategoryViewId, i = e.currentSelectdTaskInfos, n = "is-disabled";
        return !e.showPrivateSpaceOpenPage && l.TaskStatusHelper.canStopSelectedTask(t, i) && (n = ""), n
    }, A = (e, t) => {
        f.XLStatNS.trackEvent("download_leftpanel", "top_delete_click");
        let i = t.currentSelectdTaskInfos, n = !1;
        e.shiftKey && (n = !0), n ? u.TaskOperatorNs.destroyTasks(i) : u.TaskOperatorNs.deleteTasks(i)
    }, D = (e, t) => {
        f.XLStatNS.trackEvent("download_leftpanel", "top_delete_click");
        let i = t.currentSelectdTaskInfos;
        u.TaskOperatorNs.destroyTasks(i)
    }, x = e => {
        let t = e.currentCategoryViewId, i = e.currentSelectdTaskInfos, n = "is-disabled";
        return !e.showPrivateSpaceOpenPage && l.TaskStatusHelper.canDeleteSelectedTask(t, i) && (n = ""), n
    }, N = (e, t) => n(this, void 0, void 0, function* () {
        y.verbose(e);
        let i = t.currentCategoryViewId, n = t.currentSelectdTaskInfos;
        do {
            if (i === r.DownloadKernel.CategroyViewID.Downloading) break;
            if (1 !== n.length) break;
            let e = n[0].taskType;
            if (e === r.DownloadKernel.TaskType.Bt) {
                let e = k.getTaskFromTaskId(n[0].taskId);
                (yield v.SingleBtTaskNS.isSingleBtTask(e)) ? yield u.TaskOperatorNs.openTaskItem(n[0]) : yield u.TaskOperatorNs.openTaskFolder(n[0], !0)
            } else if (e === r.DownloadKernel.TaskType.Group) if (i === r.DownloadKernel.CategroyViewID.Completed) {
                let e = k.getTaskFromTaskId(n[0].taskId);
                (yield u.TaskOperatorNs.executeInstallFile(e)) || (yield u.TaskOperatorNs.openTaskFolder(n[0], !0))
            } else yield u.TaskOperatorNs.openTaskFolder(n[0], !0); else {
                let e = "";
                i === r.DownloadKernel.CategroyViewID.Completed ? e = "finished" : i === r.DownloadKernel.CategroyViewID.Recycle && (e = "dustbin"), yield u.TaskOperatorNs.openTaskItem(n[0], void 0, void 0, e)
            }
            i === r.DownloadKernel.CategroyViewID.Completed && u.TaskOperatorNs.markReadStatus(n, 1)
        } while (0)
    }), E = (e, t) => n(this, void 0, void 0, function* () {
        y.verbose(e);
        let i = t.currentCategoryViewId, n = t.currentSelectdTaskInfos;
        do {
            if (i === r.DownloadKernel.CategroyViewID.Downloading) break;
            if (1 !== n.length) break;
            yield u.TaskOperatorNs.openTaskFolder(n[0]), i === r.DownloadKernel.CategroyViewID.Completed && u.TaskOperatorNs.markReadStatus(n, 1)
        } while (0)
    }), P = e => n(this, void 0, void 0, function* () {
        let t = e.currentCategoryViewId, i = e.currentSelectdTaskInfos, n = e.showPrivateSpaceOpenPage,
            a = "is-disabled";
        do {
            if (n || t !== r.DownloadKernel.CategroyViewID.Completed) break;
            if (1 === i.length) {
                if (!(yield c.TaskCtrlOperatorNS.canOpenSelectedTaskFile(i[0]))) break;
                a = ""
            }
        } while (0);
        return a
    }), M = e => n(this, void 0, void 0, function* () {
        let t = e.currentCategoryViewId, i = e.currentSelectdTaskInfos, n = e.showPrivateSpaceOpenPage,
            a = "is-disabled";
        do {
            if (n || t !== r.DownloadKernel.CategroyViewID.Completed) break;
            if (1 === i.length) {
                if (!(yield c.TaskCtrlOperatorNS.canOpenSelectedTaskFolder(i[0]))) break;
                a = ""
            }
        } while (0);
        return a
    }), O = e => {
        let t = e.currentCategoryViewId, i = e.currentSelectdTaskInfos, n = e.showPrivateSpaceOpenPage;
        y.verbose(t);
        let a = "is-disabled";
        return !n && i.length > 0 && (a = ""), a
    }, F = e => {
        let t = "";
        return e.showPrivateSpaceOpenPage && (t = "is-disabled"), t
    }, L = (e, t) => n(this, void 0, void 0, function* () {
    }), B = (e, t) => {
        f.XLStatNS.trackEvent("download_leftpanel", "top_more_click"), y.information("open more"), y.verbose(e), p.downloadContextMenu.setContextInfo(t, t.currentCategoryId), p.downloadContextMenu.popMenu(p.DownloadMenuType.ToolbarMore, e).catch()
    }, U = (e, t) => {
        f.XLStatNS.trackEvent("download_leftpanel", "top_private_setting_click"), p.downloadContextMenu.setContextInfo(t, t.currentCategoryId), p.downloadContextMenu.popMenu(p.DownloadMenuType.PrivateSpaceHome, e).catch()
    };
    const R = {
        downloadingButtons: [{
            id: "xlx-icon-nav-new",
            title: "新建任务",
            onClick: T,
            filterClass: C
        }, {id: "xlx-icon-nav-down", title: "下载", onClick: S, filterClass: b}, {
            id: "xlx-icon-nav-pause",
            title: "暂停",
            onClick: I,
            filterClass: _
        }, {id: "xlx-icon-nav-delete", title: "删除任务", onClick: A, filterClass: x}, {
            id: "xlx-icon-nav-vip",
            title: "会员",
            onClick: L,
            filterClass: w
        }, {id: "xlx-icon-nav-more", title: "更多", onClick: B, filterClass: C}],
        completedButtons: [{
            id: "xlx-icon-nav-new",
            title: "新建任务",
            onClick: T,
            filterClass: C
        }, {id: "xlx-icon-nav-file", title: "打开文件", onClick: N, filterClass: P}, {
            id: "xlx-icon-nav-folder",
            title: "打开文件夹",
            onClick: E,
            filterClass: M
        }, {id: "xlx-icon-nav-delete", title: "删除任务", onClick: A, filterClass: x}, {
            id: "xlx-icon-nav-vip",
            title: "会员",
            onClick: L,
            filterClass: w
        }, {id: "xlx-icon-nav-more", title: "更多", onClick: B, filterClass: C}],
        recycleButtons: [{
            id: "xlx-icon-nav-new",
            title: "新建任务",
            onClick: T,
            filterClass: C
        }, {
            id: "xlx-icon-nav-restore", title: "还原", onClick: (e, t) => {
                f.XLStatNS.trackEvent("download_leftpanel", "top_undo_click"), y.verbose(e);
                let i = t.currentCategoryViewId, n = t.currentSelectdTaskInfos;
                i === r.DownloadKernel.CategroyViewID.Recycle && u.TaskOperatorNs.recoverTask(n)
            }, filterClass: O
        }, {
            id: "xlx-icon-nav-clear", title: "彻底删除", onClick: (e, t) => {
                y.verbose(e), f.XLStatNS.trackEvent("download_leftpanel", "top_delete_click");
                let i = t.currentCategoryViewId, n = t.currentSelectdTaskInfos;
                i === r.DownloadKernel.CategroyViewID.Recycle && u.TaskOperatorNs.destroyTasks(n)
            }, filterClass: O
        }, {
            id: "xlx-icon-nav-rubbish", title: "清空回收站", onClick: () => {
                f.XLStatNS.trackEvent("download_leftpanel", "top_clear_click"), u.TaskOperatorNs.clearRecycle()
            }, filterClass: e => {
                let t = e.showPrivateSpaceOpenPage,
                    i = m.getCategoryViewFromId(r.DownloadKernel.CategroyViewID.Recycle).getTasks().size,
                    n = "is-disabled";
                return !t && i > 0 && (n = ""), n
            }
        }, {id: "xlx-icon-nav-vip", title: "会员", onClick: L, filterClass: w}, {
            id: "xlx-icon-nav-more",
            title: "更多",
            onClick: B,
            filterClass: C
        }],
        privateDownloadingButtons: [{
            id: "xlx-icon-nav-new",
            title: "新建任务",
            onClick: T,
            filterClass: C
        }, {id: "xlx-icon-nav-down", title: "下载", onClick: S, filterClass: b}, {
            id: "xlx-icon-nav-pause",
            title: "暂停",
            onClick: I,
            filterClass: _
        }, {id: "xlx-icon-nav-delete", title: "删除任务", onClick: D, filterClass: x}, {
            id: "xlx-icon-nav-vip",
            title: "会员",
            onClick: L,
            filterClass: w
        }, {id: "xlx-icon-nav-home", title: "私人空间设置", onClick: U, filterClass: F}],
        privateCompletedButtons: [{
            id: "xlx-icon-nav-new",
            title: "新建任务",
            onClick: T,
            filterClass: C
        }, {id: "xlx-icon-nav-file", title: "打开文件", onClick: N, filterClass: P}, {
            id: "xlx-icon-nav-folder",
            title: "打开文件夹",
            onClick: E,
            filterClass: M
        }, {id: "xlx-icon-nav-delete", title: "删除任务", onClick: D, filterClass: x}, {
            id: "xlx-icon-nav-vip",
            title: "会员",
            onClick: L,
            filterClass: w
        }, {id: "xlx-icon-nav-home", title: "私人空间设置", onClick: U, filterClass: F}]
    };

    function K(e, t) {
        let i = !1;
        for (let n of e) if (n.id === t.id) {
            i = !0;
            break
        }
        t.position || (t.position = e.length), t.position < 0 && (t.position = e.length + 1 + t.position), i || e.splice(t.position, 0, t)
    }

    function W(e, t) {
        for (let i = 0; i < e.length; i++) {
            if (e[i].id === t.id) {
                let n = Object.assign({}, e[i], t);
                a.Vue.set(e, String(i), Object.assign({}, n));
                break
            }
        }
    }

    function V(e, t) {
        for (let i = 0; i < e.length; i++) {
            if (e[i].id === t) {
                a.Vue.delete(e, String(i));
                break
            }
        }
    }

    const H = {
        ADD_BUTTON(e, t) {
            K(e.downloadingButtons, t), K(e.completedButtons, t), K(e.recycleButtons, t), K(e.privateDownloadingButtons, t), K(e.privateCompletedButtons, t)
        }, UPDATE_BUTTON(e, t) {
            W(e.downloadingButtons, t), W(e.completedButtons, t), W(e.recycleButtons, t), W(e.privateDownloadingButtons, t), W(e.privateCompletedButtons, t)
        }, REMOVE_BUTTON(e, t) {
            V(e.downloadingButtons, t), V(e.completedButtons, t), V(e.recycleButtons, t), V(e.privateDownloadingButtons, t), V(e.privateCompletedButtons, t)
        }
    }, z = {
        attachToolbarEvent({commit: e}) {
            g.PluginFunctionUINS.on("add_toolbar_button", t => {
                e("ADD_BUTTON", t)
            }), g.PluginFunctionUINS.on("update_toolbar_button", t => {
                e("UPDATE_BUTTON", t)
            }), g.PluginFunctionUINS.on("remove_toolbar_button", t => {
                e("REMOVE_BUTTON", t)
            })
        }
    };
    t.default = {state: R, mutations: H, actions: z, getters: {}}
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = {
        UPDATE_VIP_SPEED_STATUS(e, t) {
            do {
                if (!t) break;
                let i = Object.assign({}, e.vipSpeedMap);
                for (let n in t) {
                    let a = t[n];
                    if (a) if (i.hasOwnProperty(String(n))) {
                        let e = i[n];
                        i[n] = Object.assign({}, e, a)
                    } else e.defaultStatus ? i[n] = Object.assign({}, e.defaultStatus, a) : i[n] = a; else delete i[n]
                }
                e.vipSpeedMap = Object.assign({}, i)
            } while (0)
        }, UPDATE_DEFAULT_SPEED_STATUS(e, t) {
            e.defaultStatus ? e.defaultStatus = Object.assign({}, e.defaultStatus, t) : e.defaultStatus = Object.assign({}, t)
        }
    };
    t.default = {state: {defaultStatus: null, vipSpeedMap: {}}, mutations: n}
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = {
        ON_MOUNTED(e, t) {
            e.homePageUrl = t
        }
    };
    t.default = {state: {homePageUrl: ""}, mutations: n, actions: {}}
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(0), a = i(430), o = n.default.getLogger("CommunityStore");
    o.verbose("enter");
    const r = {
        SET_UNREAD_NUMS(e, t) {
            e.unreadNums = Object.assign({}, e.unreadNums, t)
        }, SET_SHOW_MESSAGE_BUTTON(e, t) {
            e.showMessageButton = t
        }, SET_UNREAD_MESSAGES(e, t) {
            e.messages = t
        }, SET_UNREAD_STARS(e, t) {
            e.stars = t
        }, ADD_UNREAD_MESSAGES(e, t) {
            e.messages = e.messages.concat(t)
        }, ADD_UNREAD_STARS(e, t) {
            e.stars = e.stars.concat(t)
        }, SET_CHAT_MSGS(e, t) {
            o.information("SET_CHAT_MSGS", Object.assign({}, e.chatMsgs)), e.chatMsgs = e.chatMsgs.concat(t)
        }, RESET_CHATS_NUM(e) {
            e.chatMsgs = []
        }, SET_USERS_INFO(e, t) {
            e.chatUsersInfo[t.uid || "0"] = t, o.information(" state.chatUsersInfo", e.chatUsersInfo), e.chatUserId = t.uid || 0
        }, SET_CHATS_NUM(e, t) {
            e.unreadNums.chat = t
        }, SET_CIRCLE_NUM(e, t) {
            e.unreadNums.circle = t
        }, SET_MINE_ID(e, t) {
            e.mineId = t
        }
    }, s = {
        getUnreadNums: ({commit: e, state: t, rootState: i}, n) => (o.information("getUnreadNums"), a.getUnreadMsgNum(n).then(t => {
            t.error || "ok" !== t.data.result || (o.information("获取未读数消息", t), e("SET_UNREAD_NUMS", {
                star: t.data.data.unread_like_msg_cnt,
                comment: t.data.data.unread_reply_msg_cnt,
                chat: t.data.data.chitchat
            }))
        }).catch(e => {
            o.information("getUnreadNums error")
        })),
        getUnreadCircleMsgNum: ({commit: e, state: t, rootState: i}, n) => a.getUnreadCircleMsgNum(n).then(t => {
            o.information("获取圈子未读消息数", t), t.error || "ok" !== t.data.result || e("SET_UNREAD_NUMS", {circle: t.data.unread_reply_msg_count + t.data.unread_like_msg_count})
        }).catch(e => {
            o.information("getUnreadCircleMsgNum error")
        }),
        getUnreadNoticeNum: ({commit: e, state: t, rootState: i}, n) => (o.information("getUnreadNoticeNum"), a.getUnreadNoticeNum(n).then(t => {
            o.information("获取未读系统通知数", t), t.error || "ok" !== t.data.result || e("SET_UNREAD_NUMS", {notice: t.data.count})
        }).catch(e => {
            o.information("getUnreadNoticeNum error")
        })),
        getUserInfo: ({commit: e, state: t, rootState: i}, n) => (o.information("getUserInfo", n), void 0 !== t.chatUsersInfo[n] ? (o.information("用户信息已存在"), Promise.resolve({data: {result: "ok"}})) : a.getUserInfo(n).then(t => (o.information("getUserInfo....", t), t.error || "ok" !== t.data.result || (o.information("getUserInfo....", t.data.user_info), e("SET_USERS_INFO", t.data.user_info)), t)).catch(e => {
            o.information("getUserInfo error")
        })),
        getUserSessionList: ({commit: e, state: t, rootState: i}, n) => a.getUserSessionList(n).then(i => {
            if (o.information("获取用户会话列表", i), !i.error && "ok" === i.data.result) {
                let a = 0, r = [];
                o.information("getUserSessionList userId: ", n, ", sessions:", i.data.sessions);
                for (let e = 0; e < i.data.sessions.length; e++) o.information("mineId--", t.mineId), i.data.sessions[e].user_id === t.mineId || r.includes(i.data.sessions[e].record.sender) || (a += i.data.sessions[e].unread, r.push(i.data.sessions[e].record.sender));
                a > 0 && e("SET_CHATS_NUM", a), o.information("私信未读数 chatNum", a)
            }
        }).catch(e => {
            o.information("getUserSessionList error")
        })
    }, l = {
        totalUnread(e, t, i) {
            let {star: n, comment: a, notice: o, chat: r, circle: s} = e.unreadNums;
            return n + a + o + r + s
        },
        UnreadMsgsLen: (e, t, i) => (o.information("UnreadMsgsLen", e.messages.length + e.stars.length + e.chatMsgs.length), e.messages.length + e.stars.length + e.chatMsgs.length),
        chatUnread: (e, t, i) => e.unreadNums.chat
    };
    t.default = {
        state: {
            unreadNums: {star: 0, comment: 0, notice: 0, chat: 0, circle: 0},
            showMessageButton: !0,
            messages: [],
            stars: [],
            chatUserId: 0,
            chatMsgs: [],
            chatUsersInfo: {},
            mineId: 0
        }, mutations: r, actions: s, getters: l
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = {
        SHOW_PRIVATE_SPACE_OPEN_PAGE(e, t) {
            e.showPrivateSpaceOpenPage = t
        }
    };
    t.default = {state: {showPrivateSpaceOpenPage: !1}, mutations: n, actions: {}, getters: {}}
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = {
        SHOW_UPGRADE_TASK(e, t) {
            e.showUpgradeTask !== t && (e.showUpgradeTask = t)
        }
    };
    t.default = {state: {showUpgradeTask: !1}, mutations: n, actions: {}, getters: {}}
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(53), a = i(2), o = i(10), r = i(8), s = i(0).default.getLogger("book-marks-store"), l = i(68),
        d = a.join(__profilesDir, "XLBrowserApp", "bookmarks"), u = 1, c = {
            ADD_BOOK_MARKS_ITEM(e, t) {
                e.bookMarks = Object.assign({}, e.bookMarks, t);
                let i = JSON.stringify(e.bookMarks);
                o.ConfigNS.setValue("book-marks-section", "book-marks-key", i)
            }, REMOVE_BOOK_MARKS_ITEM(e, t) {
                if (s.information("REMOVE_BOOK_MARKS_ITEM", t), void 0 !== e.bookMarks[t]) {
                    s.information("delete state.bookMarks", e.bookMarks), r.Vue.delete(e.bookMarks, t);
                    let i = JSON.stringify(e.bookMarks);
                    o.ConfigNS.setValue("book-marks-section", "book-marks-key", i)
                }
            }, SET_BOOK_MARKS_STATE(e, t) {
                e.bookMarks = t
            }, UPDATE_BOOK_MARKS_ICONURL(e, t) {
                for (let i in e.bookMarks) {
                    let n = e.bookMarks[i];
                    if (n.url === t.url) {
                        n.iconUrl = t.iconUrl;
                        let i = JSON.stringify(e.bookMarks);
                        o.ConfigNS.setValue("book-marks-section", "book-marks-key", i);
                        break
                    }
                }
            }, SET_BOOK_MARKS_ITEM_TOP(e, t) {
                for (let i in e.bookMarks) {
                    let n = e.bookMarks[i];
                    if (n.url === t.url) {
                        t.top ? (n.top = !0, n.toptime = (new Date).getTime()) : (delete n.top, delete n.toptime);
                        let i = JSON.stringify(e.bookMarks);
                        o.ConfigNS.setValue("book-marks-section", "book-marks-key", i);
                        break
                    }
                }
            }
        }, h = {
            initBookMarks: ({commit: e, state: t, rootState: i}) => new Promise((e, t) => {
                let i = o.ConfigNS.getValue("book-marks-section", "book-marks-key", "/");
                if ("/" !== i) try {
                    let n = JSON.parse(i);
                    e(n)
                } catch (e) {
                    t(new Error("JSON parse book marks error"))
                } else n.readFile(`${d}`, "utf8", (i, n) => {
                    if (i) s.information("读取书签文件出错,书签路径..", d), t(new Error("read book marks file error")); else try {
                        let t = function (e) {
                            if (void 0 === l(e, "roots", "bookmarkbar", "itemlist")) return {};
                            let t = l(e, "roots", "bookmarkbar", "itemlist");
                            s.information("bookMarkItemList", t);
                            let i = {};
                            for (let e = 0; e < t.length; e++) l(t[e], "bmType") === u && void 0 === i[l(t[e], "url")] ? i[l(t[e], "url")] = {
                                url: l(t[e], "url"),
                                name: l(t[e], "name"),
                                iconUrl: l(t[e], "iconUrl") || ""
                            } : f(t[e], i);
                            return i
                        }(JSON.parse(n)), i = JSON.stringify(t);
                        o.ConfigNS.setValue("book-marks-section", "book-marks-key", i), e(t)
                    } catch (e) {
                        s.information("book marks data parse error")
                    }
                })
            }).then(t => {
                e("SET_BOOK_MARKS_STATE", t)
            }).catch(e => {
                s.information("初始化书签数据失败")
            })
        };

    function f(e, t) {
        let i = l(e, "itemlist");
        for (let e = 0; e < i.length; e++) l(i[e], "bmType") === u && void 0 === t[l(t[e], "url")] ? t[l(i[e], "url")] = {
            url: l(i[e], "url"),
            name: l(i[e], "name")
        } : f(i[e], t)
    }

    t.default = {state: {bookMarks: {}}, mutations: c, actions: h}
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(0), a = i(18), o = n.default.getLogger("groupStore"), r = {
        SET_GROUP_DATA(e, t) {
            e.all = t
        }
    }, s = {
        getGroupData({commit: e, state: t, rootState: n}) {
            try {
                return a.default.defaults.adapter = i(21), a.default.get("http://static-xl.a.88cdn.com/json/group_data.json").then(t => {
                    o.information(t), null !== t && void 0 !== t.status && 200 === t.status && void 0 !== t.data && null !== t.data && e("SET_GROUP_DATA", t.data)
                }).catch(e => {
                    o.information("getGroupData Error", e)
                })
            } catch (e) {
                return e
            }
        }
    };
    t.default = {state: {all: {}}, mutations: r, actions: s}
}, function (e, t, i) {
    "use strict";
    var n = i(766);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(152);
    for (var a in n) "default" !== a && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(a);
    var o = i(1), r = Object(o.a)(n.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-body\\index-container.vue", t.default = r.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(341), a = i(154);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    i(695);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\index.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(343), a = i(156);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    i(609);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\search-view\\index.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(346), a = i(158);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    i(608);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\find-page\\address-bar\\index.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(160);
    for (var a in n) "default" !== a && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(a);
    var o = i(1), r = Object(o.a)(n.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-body\\find-page\\address-bar\\address-bar-container.vue", t.default = r.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(354), a = i(162);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\find-page\\address-bar\\address-bar.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    var n = i(770);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(772);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(164);
    for (var a in n) "default" !== a && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(a);
    var o = i(1), r = Object(o.a)(n.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-body\\find-page\\index-container.vue", t.default = r.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(347), a = i(166);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\find-page\\index.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(168);
    for (var a in n) "default" !== a && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(a);
    var o = i(1), r = Object(o.a)(n.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-body\\find-page\\home-page\\index-container.vue", t.default = r.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(355), a = i(170);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    i(614);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, "02fe07d9", null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\find-page\\home-page\\index.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    var n = i(776);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(0), o = i(2), r = a.default.getLogger("Thunder.renderer.contextmenu"), s = i(4), l = i(5), d = i(17),
        u = i(6), c = i(81), h = i(92), f = i(7), g = i(42), p = i(38), v = i(3), m = i(35), y = i(12),
        k = u.default(o.join(__rootDir, "../bin/ThunderHelper.node")),
        T = ".asf;.avi;.exe;.iso;.mp3;.mp4;.mkv;.mpeg;.mpg;.mpga;.ra;.rar;||.rm;.rmvb;.tar;.wma;.wmp;.wmv;.mov;.zip;.3gp;.chm;.mdf;",
        w = ["http://", "https://", "ftp://"], C = ["thunder://", "thunders://", "ed2k://", "magnet:"];

    function S(e) {
        let t = !1;
        if (e) for (let i = 0; i < w.length; ++i) {
            let n = w[i];
            if (0 === e.indexOf(n)) {
                t = !0;
                break
            }
        }
        return t
    }

    function b(e) {
        let t = !1;
        if (e) for (let i = 0; i < C.length; ++i) {
            let n = C[i];
            if (0 === e.indexOf(n)) {
                t = !0;
                break
            }
        }
        return t
    }

    function I(e) {
        let t = [], i = e;
        if (g.Common.isThunderPrivateUrl(i) && (i = g.Common.parseThunderPrivateUrl(i)), function (e) {
            let t = !1;
            do {
                if (!e) break;
                if (S(e)) {
                    let i = o.extname(e);
                    if (!i || i.length <= 0) break;
                    i += ";", T.indexOf(i) > -1 && (t = !0)
                } else b(e) && (t = !0)
            } while (0);
            return t
        }(i)) {
            let n = m.ThunderHelper.getTaskTypeFromUrl(i);
            if (n === v.DownloadKernel.TaskType.P2sp || n === v.DownloadKernel.TaskType.Emule) t.push(e); else if (n === v.DownloadKernel.TaskType.Magnet || n === v.DownloadKernel.TaskType.Bt) return p.ThunderNewTask.createBtTaskWindow({
                url: e,
                type: "url"
            }, {browser: "xlbrowser.exe"}), !0
        }
        return t.length > 0 && (p.ThunderNewTask.createPreNewTaskWindow(t), !0)
    }

    function _(e, t) {
        return n(this, void 0, void 0, function* () {
            let n = null, a = !1;
            try {
                n = yield(yield i(18)).get(e)
            } catch (e) {
            }
            return null !== n && void 0 !== n.status && 200 === n.status && null !== n.data && (a = yield l.FileSystemAWNS.writeFileAW(t, n.data)), a
        })
    }

    function A(e) {
        do {
            if (s.isNullOrUndefined(e)) break;
            let t = e;
            !1 === x(e) && (t = (t = c.default.getConfigValue("search", "search_engine_url", "https://www.baidu.com/s?tn=48021271_21_hao_pg&wd=$word$")).replace("$word$", e)), f.client.callServerFunction("openNewTab", t).catch()
        } while (0)
    }

    t.contextMenuPage = [{
        label: "返回", onclick: function (e, t) {
            r.information("goBack"), e.goBack()
        }, onadded: (e, t, i, n) => {
            e.isBackwardEnable() || i.setEnable(t, !1)
        }
    }, {
        label: "前进", onclick: function (e, t) {
            e.goForward()
        }, onadded: (e, t, i, n) => {
            e.isForwardEnable() || i.setEnable(t, !1)
        }
    }, {
        label: "重新加载", onclick: function (e, t) {
            e.refresh()
        }
    }, {
        label: "另存为", onclick: function (e, t) {
            return n(this, void 0, void 0, function* () {
                if (I(t.linkURL)) return;
                let e = yield y.asyncRemoteCall.getCurrentWindow(), i = yield y.asyncRemoteCall.getDialog();
                i.showSaveDialog(e, {
                    defaultPath: "新建网页.html",
                    filters: [{name: "网页 HTML（*.html）", extensions: ["html"]}]
                }, e => {
                    if (void 0 === e || "" === e) return;
                    let i = o.extname(e);
                    ".html" !== i.toLowerCase() && (e += ".html"), setTimeout(() => {
                        _(t.pageURL, e).catch()
                    }, 0)
                })
            })
        }
    }, {
        label: "查看网页源代码", onclick: function (e, t) {
            f.client.callServerFunction("OpenNewTab", "view-source:" + t.pageURL).catch()
        }
    }], t.contextMenuDownloadableLink = [{label: "在新标签页打开链接", onclick: N}, {
        label: "链接另存为",
        onclick: E
    }, {
        label: "复制链接地址", onclick: function (e, t) {
            k.copyTextToClipBoard(t.linkURL)
        }
    }], t.contextMenuMedia = [{
        label: "在新标签页中打开图片", onclick: function (e, t) {
            A(t.sourceURL)
        }
    }, {
        label: "图片另存为", onclick: function (e, t) {
            return n(this, void 0, void 0, function* () {
                let e = o.basename(t.sourceURL), a = o.extname(e);
                "" === e && (e = function () {
                    let e = "";
                    for (let t = 1; t <= 32; t++) {
                        let i = Math.floor(16 * Math.random()).toString(16);
                        e += i, 8 !== t && 12 !== t && 16 !== t && 20 !== t || (e += "-")
                    }
                    return e
                }() + a);
                let r = void 0;
                r = "" !== a ? {
                    defaultPath: e,
                    filters: [{name: "图片（*" + a + "）", extensions: [a]}, {name: "所有文件", extensions: ["*"]}]
                } : {defaultPath: e, filters: [{name: "所有文件", extensions: ["*"]}]};
                let s = yield y.asyncRemoteCall.getCurrentWindow(), d = yield y.asyncRemoteCall.getDialog();
                d.showSaveDialog(s, r, e => {
                    void 0 !== e && "" !== e && setTimeout(() => {
                        (function (e, t) {
                            return n(this, void 0, void 0, function* () {
                                let n = null, a = !1;
                                try {
                                    n = yield(yield i(18)).get(e, {responseType: "arraybuffer"})
                                } catch (e) {
                                }
                                return null !== n && void 0 !== n.status && 200 === n.status && null !== n.data && (a = yield l.FileSystemAWNS.writeFileAW(t, n.data)), a
                            })
                        })(t.sourceURL, e).catch()
                    }, 0)
                })
            })
        }
    }, {
        label: "复制图片", onclick: function (e, t) {
            setTimeout(() => {
                (function (e) {
                    return n(this, void 0, void 0, function* () {
                        let t = null, n = !1;
                        try {
                            t = yield(yield i(18)).get(e, {responseType: "arraybuffer"})
                        } catch (e) {
                            return !1
                        }
                        if (null !== t && void 0 !== t.status && 200 === t.status && null !== t.data) {
                            let e = "data:" + t.headers["content-type"] + ";base64," + new Buffer(t.data).toString("base64"),
                                a = i(17).nativeImage.createFromDataURL(e);
                            d.clipboard.clear(), d.clipboard.writeImage(a), n = !0
                        }
                        return n
                    })
                })(t.sourceURL).catch()
            }, 0)
        }
    }, {
        label: "复制图片地址", onclick: function (e, t) {
            k.copyTextToClipBoard(t.sourceURL)
        }
    }], t.contextMenuSelection = [{
        label: "复制", onclick: function (e, t) {
            e.editCopy()
        }
    }, {
        label: "用百度搜索", onclick: function (e, t) {
            let i = c.default.getConfigValue("search", "search_engine_url", "https://www.baidu.com/s?tn=48021271_21_hao_pg&wd=$word$");
            i = i.replace("$word$", t.selectionText), f.client.callServerFunction("OpenNewTab", i).catch()
        }
    }], t.contextMenuEditable = [{
        label: "撤销", onclick: function (e, t) {
            e.editUndo()
        }
    }, {
        label: "剪切", onclick: function (e, t) {
            e.editCut()
        }
    }, {
        label: "复制", onclick: function (e, t) {
            e.editCopy()
        }
    }, {
        label: "粘贴", onclick: function (e, t) {
            e.editPaste()
        }
    }, {
        label: "删除", onclick: function (e, t) {
            e.editDelete()
        }
    }, {
        label: "全选", onclick: function (e, t) {
            e.editSelectAll()
        }
    }], t.contextMenuLink = [{label: "在新标签页打开链接", onclick: N}, {label: "链接另存为", onclick: E}, {
        label: "复制链接地址",
        onclick: function (e, t) {
            k.copyTextToClipBoard(t.linkURL), I(t.linkURL) && r.information(t.linkURL)
        }
    }];
    let D = {
        page: t.contextMenuPage,
        selection: t.contextMenuSelection,
        edit: t.contextMenuEditable,
        link: t.contextMenuLink,
        media: t.contextMenuMedia
    };

    function x(e) {
        let t = !1;
        do {
            let i = e.trim();
            if (s.isNullOrUndefined(i)) break;
            if (t = /([\w-]+\.)+[\w-]+(\/[\w- .\/?%&=]*)?/.test(i)) {
                t = 1 === k.isPingHostValid(i)
            }
        } while (0);
        return t
    }

    function N(e, t) {
        I(t.linkURL) ? r.information(t.linkURL) : A(t.linkURL)
    }

    function E(e, t) {
        return n(this, void 0, void 0, function* () {
            let e = yield y.asyncRemoteCall.getCurrentWindow();
            (yield y.asyncRemoteCall.getDialog()).showSaveDialog(e, {
                defaultPath: "新建网页.html",
                filters: [{name: "网页 HTML（*.html）", extensions: ["html"]}]
            }, e => {
                if (void 0 === e || "" === e) return;
                ".html" !== o.extname(e).toLowerCase() && (e += ".html"), setTimeout(() => {
                    _(t.linkURL, e).catch()
                }, 0)
            })
        })
    }

    t.registerContextMenu = function (e) {
        e && (e.on("before-context-menu", (e, t, i, n) => {
            let a = e.target, o = [];
            n.elemTypeFlag & h.PopupElemTypeFlag.EDITABLE ? o.push(...D.edit) : (n.elemTypeFlag & h.PopupElemTypeFlag.MEDIA && o.push(...D.media), n.elemTypeFlag & h.PopupElemTypeFlag.LINK && o.push(...D.link), n.elemTypeFlag & h.PopupElemTypeFlag.SELECTION && o.push(...D.selection)), n.elemTypeFlag & h.PopupElemTypeFlag.PAGE && 0 === o.length && o.push(...D.page);
            let r = new Map;
            o.forEach((t, a) => {
                if ("separate" === t.type) i.addSeparator(); else {
                    let a = i.addItem(t.label);
                    t.onadded && t.onadded(e.target, a, i, n), r.set(a, t)
                }
            }), a.curRegistryMap = r, a.curMenuParam = n
        }), e.on("context-menu-command", (e, t, i) => {
            let n = e.target, a = n.curRegistryMap, o = n.curMenuParam;
            n.curRegistryMap = null, n.curMenuParam = null;
            let s = a.get(i);
            null !== s ? s.onclick(e.target, o) : r.error("unknown menu command", i, a)
        }))
    }
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), t.unread = function (e) {
        return e > 99 ? "..." : e ? String(e) : ""
    }
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(172);
    for (var a in n) "default" !== a && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(a);
    var o = i(1), r = Object(o.a)(n.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-body\\find-page\\browser-view\\browser-view-container.vue", t.default = r.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(356), a = i(174);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    i(620);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\find-page\\browser-view\\browser-view.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    var n = i(778);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(780);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(344), a = i(176);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    i(622);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\pan-view.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    var n = i(783);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(178);
    for (var a in n) "default" !== a && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(a);
    var o = i(1), r = Object(o.a)(n.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\index-container.vue", t.default = r.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(348), a = i(180);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\index.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(182);
    for (var a in n) "default" !== a && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(a);
    var o = i(1), r = Object(o.a)(n.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\tool-bar\\tool-bar-container.vue", t.default = r.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(357), a = i(184);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\tool-bar\\tool-bar.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(186);
    for (var a in n) "default" !== a && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(a);
    var o = i(1), r = Object(o.a)(n.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\tool-bar\\tool-bar-button-container.vue", t.default = r.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(387), a = i(188);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\tool-bar\\tool-bar-button.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(190);
    for (var a in n) "default" !== a && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(a);
    var o = i(1), r = Object(o.a)(n.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\tool-bar\\tool-bar-vip-button-container.vue", t.default = r.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(388), a = i(192);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\tool-bar\\tool-bar-vip-button.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(16), o = i(9), r = i(18), s = i(2), l = i(5), d = i(58),
        u = i(0).default.getLogger("DownloadPanel.ToolBarVipButton");

    class c {
        constructor() {
            this.mPeerId = void 0, this.mUserId = "0", this.mSessionId = void 0, this.mIsLogin = !1, this.mIsVip = !1, this.mVipLevel = 0, this.mVasType = 0, this.mVipData = null
        }

        get vasType() {
            return this.mVasType
        }

        get vipLevel() {
            return this.mVipLevel
        }

        get userId() {
            return this.mUserId
        }

        get isLogin() {
            return this.mIsLogin
        }

        get isVip() {
            return this.mIsVip
        }

        get isPlatinumVip() {
            return this.isVip && this.mVasType > 2
        }

        get isSuperVip() {
            return this.isVip && 5 === this.mVasType
        }

        get vipData() {
            return this.mVipData
        }

        getSessionId() {
            return n(this, void 0, void 0, function* () {
                return new Promise(e => {
                    this.mSessionId ? e(this.mSessionId) : a.NativeCallModule.nativeCall ? a.NativeCallModule.nativeCall.CallNativeFunction("GetSessionID", (t, i) => {
                        0 === t && (this.mSessionId = i), e(this.mSessionId || "0")
                    }) : e(this.mSessionId || "0")
                })
            })
        }

        getPeerId() {
            return n(this, void 0, void 0, function* () {
                return new Promise(e => {
                    this.mPeerId ? e(this.mPeerId) : a.NativeCallModule.nativeCall ? a.NativeCallModule.nativeCall.CallNativeFunction("GetPeerID", (t, i) => {
                        0 === t && i && "" !== i && (this.mPeerId = i), e(this.mPeerId || "")
                    }) : e(this.mPeerId || "")
                })
            })
        }

        getUserinfo() {
            return n(this, void 0, void 0, function* () {
                return new Promise(e => {
                    let t = null;
                    a.NativeCallModule.nativeCall ? a.NativeCallModule.nativeCall.CallNativeFunction("GetAllUserInfo", (i, n) => {
                        0 === i && (t = n), e(t)
                    }) : e(t)
                })
            })
        }

        parseUserInfo() {
            return n(this, void 0, void 0, function* () {
                let e = yield this.getUserinfo();
                if (e) if (this.mIsLogin = !0, this.mUserId = e.userID || "0", e.vipList && e.vipList[0]) {
                    if (e.vipList[0].isVip) {
                        let t = Number(e.vipList[0].isVip).valueOf();
                        this.mIsVip = t > 0
                    } else this.mIsVip = !1;
                    e.vipList[0].vipLevel && (this.mVipLevel = Number(e.vipList[0].vipLevel).valueOf()), e.vipList[0].vasType && (this.mVasType = Number(e.vipList[0].vasType).valueOf()), this.mVipData = e.vipList[0]
                } else this.mIsVip = !1
            })
        }

        onLogin() {
            return n(this, void 0, void 0, function* () {
                this.clear(), yield this.parseUserInfo()
            })
        }

        onLogout() {
            this.clear()
        }

        clear() {
            this.mUserId = "0", this.mSessionId = void 0, this.mIsVip = !1, this.mIsLogin = !1, this.mVasType = 0, this.mVipLevel = 0
        }
    }

    t.UserHelper = c;
    t.VipIconMgr = class {
        constructor(e) {
            this.mVueObj = null, this.mVipIconData = null, this.mModel = "b", this.mUserHelper = null, this.mUsedDLVipCache = null, this.mUpdateType = "", this.mIsFirstLoad = !0, this.mVueObj = e, this.mUserHelper = new c
        }

        init() {
            return n(this, void 0, void 0, function* () {
                try {
                    r.default.defaults.adapter = i(21), r.default.get("http://act.vip.xunlei.com/vip/2018/ssi/vipiconData.js", {timeout: 1e4}).then(e => n(this, void 0, void 0, function* () {
                        if (a.NativeCallModule.nativeCall && null !== e && 200 === e.status && null !== e.data && "string" == typeof e.data.atestuids) {
                            this.mVipIconData = e.data.btpl;
                            let t = yield this.mUserHelper.getPeerId();
                            u.information(`init: peerid=${t},ipData.data.atestuids=${e.data.atestuids}`), "" !== t && 16 === t.length && -1 !== e.data.atestuids.toLowerCase().indexOf(t.toLowerCase()[11]) && (this.mVipIconData = e.data.atpl, this.mModel = "a"), this.attachUserEvents(), this.updateUI().catch()
                        } else this.sendStat("download_leftpanel", "top_vipicon_show")
                    })).catch(e => {
                        u.warning(e)
                    })
                } catch (e) {
                    u.information(e)
                }
            })
        }

        sendStat(e, t, i = "") {
            let n = 0;
            this.mUserHelper.isLogin && (n = 5 === this.mUserHelper.vasType ? 5 : this.mUserHelper.vasType > 2 ? 3 : 2);
            let a = "";
            "newuser" === this.mUpdateType ? a = "new" : "inner15" === this.mUpdateType ? a = "expire_1_15" : "out15" === this.mUpdateType && (a = "expire_15+");
            let r = `is_red=${this.mVueObj.hasRedPoint ? 1 : 0},is_login=${this.mUserHelper.isLogin ? 1 : 0},is_vip=${this.mUserHelper.isVip ? 1 : 0},user_type=${a},vip_type=${n},test_type=${this.mModel}`;
            "" !== i && (r = `${r},${i}`), u.information(`sendStat: event=${e}, attr1=${t}, statExtData=${r}`), r = encodeURIComponent(r), o.XLStatNS.trackEvent(e, t, "", 0, 0, 0, 0, r)
        }

        updateUIDefault() {
            this.mVueObj.cfgType = "", this.mVueObj.hasRedPoint = !1, this.mVueObj.clickUrl = "https://vip.xunlei.com/index.html?referfrom=v_pc_xlx_ggong_taskbar_vip", this.mVueObj.vipIcon = "", this.mVueObj.hoverTitle = ""
        }

        updateUI() {
            return n(this, void 0, void 0, function* () {
                if (yield this.isLogin()) if (yield this.mUserHelper.onLogin(), this.mUserHelper.isVip) {
                    let e = "vip", t = "LastLink_PlatinumVip_" + String(this.mUserHelper.userId);
                    this.mUserHelper.isSuperVip && (e = "super", t = "LastLink_SuperVip_" + String(this.mUserHelper.userId)), this.updateUIPrivate(e, t)
                } else {
                    null === this.mUsedDLVipCache && (this.mUsedDLVipCache = {});
                    let e = () => {
                        if (0 === this.mUsedDLVipCache[this.mUserHelper.userId] || 2 === this.mUsedDLVipCache[this.mUserHelper.userId]) this.updateUIPrivate("newuser", "LastLink_Newuser_" + String(this.mUserHelper.userId)); else {
                            let e = "inner15", t = "LastLink_Inner15_" + String(this.mUserHelper.userId);
                            15 < this.calculateExpireDate() && (e = "out15", t = "LastLink_Out15_" + String(this.mUserHelper.userId)), this.updateUIPrivate(e, t)
                        }
                    };
                    if (void 0 === this.mUsedDLVipCache[this.mUserHelper.userId]) try {
                        let t = yield this.mUserHelper.getSessionId();
                        this.queryUsedToBeDLVip(this.mUserHelper.userId, t).then(t => {
                            null !== t && 200 === t.status && null !== t.data && 1 === t.data.code && null !== t.data.result && void 0 !== t.data.result.usedToBeDLVip ? (this.mUsedDLVipCache[this.mUserHelper.userId] = Number(t.data.result.usedToBeDLVip).valueOf(), e()) : this.updateUIDefault()
                        }).catch(e => {
                            u.warning(e), this.updateUIDefault()
                        })
                    } catch (e) {
                        u.information(e), this.updateUIDefault()
                    } else e()
                } else this.mIsFirstLoad ? (this.mIsFirstLoad = !1, setTimeout(() => n(this, void 0, void 0, function* () {
                    (yield this.isLogin()) || this.updateUIPrivate("visitor", "LastLink_UnLogin")
                }), 3e3)) : this.updateUIPrivate("visitor", "LastLink_UnLogin")
            })
        }

        calculateExpireDate() {
            if (!this.mUserHelper.vipData || !this.mUserHelper.vipData.expireDate) return 0;
            let e, t, i;
            e = this.mUserHelper.vipData.expireDate.substring(0, 4), t = this.mUserHelper.vipData.expireDate.substring(4, 6), i = this.mUserHelper.vipData.expireDate.substring(6, 8);
            let n = new Date(e + "-" + t + "-" + i + " 00:00:00").getTime() / 1e3, a = new Date(Date.now()),
                o = a.getFullYear(), r = a.getMonth(), s = a.getDate(),
                l = (a = new Date(o + "-" + (r < 10 ? "0" + (r + 1) : r + 1) + "-" + (s < 10 ? "0" + s : s) + " 00:00:00")).getTime() / 1e3;
            return Math.ceil((l - n) / 86400)
        }

        updateUIPrivate(e, t) {
            u.information(`updateUIPrivate: updateType=${e}, cfgType=${t}`), this.mUpdateType = e;
            let i = Date.now(), o = i;
            this.mVipIconData && this.mVipIconData[e] && this.mVipIconData[e].online && (o = new Date(this.mVipIconData[e].online).getTime());
            let r = i;
            this.mVipIconData && this.mVipIconData[e] && this.mVipIconData[e].offline && (r = new Date(this.mVipIconData[e].offline).getTime()), u.information("updateUIPrivate, curDate=" + String(i) + ", onlineDate=" + String(o) + ", offlineDate=" + String(r)), o >= i || i >= r || a.NativeCallModule.nativeCall.CallNativeFunction("GetValue", "ToolBarButtonVipIcon", t, "", (i, a) => n(this, void 0, void 0, function* () {
                let n = "";
                0 === i && (n = a);
                let o = this.mVueObj.clickUrl;
                this.mVipIconData && this.mVipIconData[e] && ("string" == typeof this.mVipIconData[e].xdslink && "" !== this.mVipIconData[e].xdslink ? o = this.mVipIconData[e].xdslink.trim() : "string" == typeof this.mVipIconData[e].link && "" !== this.mVipIconData[e].link && (o = this.mVipIconData[e].link.trim()));
                let r = "";
                r = "newuser" === this.mUpdateType ? "v_pc_xlx_ggong_taskbar_new" : "inner15" === this.mUpdateType ? "v_pc_xlx_ggong_taskbar_expire1" : "out15" === this.mUpdateType ? "v_pc_xlx_ggong_taskbar_over15" : "super" === this.mUpdateType ? "v_pc_xlx_ggong_taskbar_vip" : "vip" === this.mUpdateType ? "v_pc_xlx_ggong_taskbar_vip" : "v_pc_xlx_ggong_taskbar_nolog", r += "_", r += this.mModel, -1 === o.toLowerCase().indexOf("referfrom") && (o = -1 === o.indexOf("?") ? `${o}?referfrom=${r}` : `${o}&referfrom=${r}`), this.mVueObj.clickUrl = o, this.mVueObj.cfgType = t, this.mVueObj.hasRedPoint = n !== o;
                let c = "";
                this.mVipIconData && this.mVipIconData[e] && this.mVipIconData[e].xdsicon && (c = this.mVipIconData[e].xdsicon);
                let h = s.resolve(__profilesDir, "VipDownload/vipicon");
                if ((yield l.FileSystemAWNS.mkdirsAW(h)) && "" !== c) {
                    let e = s.basename(c), t = s.join(h, e), i = c, n = String(1e6 * Math.random()).valueOf();
                    i.indexOf("?") >= 0 ? i += "&rd=" + n : i += "?rd=" + n, d.AxiosNS.downloadFileAW(i, t).then(i => {
                        u.information("下载图片：result = ", i, ";fileName = ", e), this.mVueObj.vipIcon = i ? "file://" + t : ""
                    }).catch(e => {
                        u.warning(e), this.mVueObj.vipIcon = ""
                    })
                } else this.mVueObj.vipIcon = "";
                let f = "";
                this.mVipIconData && this.mVipIconData[e] && this.mVipIconData[e].hover && (f = this.mVipIconData[e].hover), "" !== f && (this.mVueObj.hoverTitle = f), this.sendStat("download_leftpanel", "top_vipicon_show")
            }))
        }

        queryUsedToBeDLVip(e, t) {
            return n(this, void 0, void 0, function* () {
                try {
                    let n = `http://soa.vip.xunlei.com/xlvip.common.mooseapi/querytags?userid=${e}&sessionid=${t}&tags=usedToBeDLVip&platform=xlx`;
                    return r.default.defaults.adapter = i(21), r.default.get(n, {timeout: 1e4})
                } catch (e) {
                    return e
                }
            })
        }

        isLogin() {
            return n(this, void 0, void 0, function* () {
                return new Promise(e => {
                    let t = null;
                    a.NativeCallModule.nativeCall ? a.NativeCallModule.nativeCall.CallNativeFunction("IsLogined", (i, n) => {
                        0 === i && (t = n), e(t)
                    }) : e(t)
                })
            })
        }

        attachUserEvents() {
            a.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", () => n(this, void 0, void 0, function* () {
                this.updateUI().catch()
            })), a.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", () => {
                this.mUserHelper.onLogout(), this.updateUI().catch()
            }), a.NativeCallModule.nativeCall.AttachNativeEvent("onUserInfoChange", (e, t) => n(this, void 0, void 0, function* () {
                yield this.onUserInfoChange(e, t)
            })), a.NativeCallModule.nativeCall.AttachNativeEvent("onLoginStatusChange", (e, t) => {
                this.onLoginStatusChange(t)
            })
        }

        onUserInfoChange(e, t) {
            return n(this, void 0, void 0, function* () {
                u.information("vipicon --\x3eonUserInfoChange"), "vipinfo" === e && this.updateUI().catch(), u.information("<--onUserInfoChange")
            })
        }

        onLoginStatusChange(e) {
            u.information("vipicon --\x3eonLoginStatusChange", "newStatus", e), "offline" === e && (this.mUserHelper.onLogout(), this.updateUI().catch()), u.information("<--onLoginStatusChange")
        }
    }
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(194);
    for (var a in n) "default" !== a && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(a);
    var o = i(1), r = Object(o.a)(n.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\status-bar-container.vue", t.default = r.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(358), a = i(196);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\status-bar.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(10), a = i(30), o = i(55);
    !function (e) {
        let t = 0, i = 0, r = "", s = 0, l = 0;

        function d() {
            let e = new Date;
            return e.getFullYear() + "." + (e.getMonth() + 1) + "." + e.getDate()
        }

        function u() {
            let e = !0;
            return d() === r && (e = !1), e
        }

        function c() {
            return n.ConfigNS.getValue("FlowMonitor", "DownloadSize", 0)
        }

        function h() {
            return n.ConfigNS.getValue("FlowMonitor", "UploadSize", 0)
        }

        function f(e, t) {
            n.ConfigNS.setValue("FlowMonitor", "DownloadSize", e), n.ConfigNS.setValue("FlowMonitor", "UploadSize", t), n.ConfigNS.setValue("FlowMonitor", "Date", d())
        }

        e.isDateChange = u, e.getDownloadSizeFromFile = c, e.getUploadSizeFromFile = h, e.setFlowData = f, e.startMonitor = function () {
            t = c(), i = h(), r = n.ConfigNS.getValue("FlowMonitor", "Date", ""), u() && (t = 0, i = 0, f(0, 0)), s = t, l = i, o.quitPromises.add(function () {
                return new Promise(e => {
                    f(s, l), n.ConfigNS.save().catch(), e(!0)
                })
            })
        }, e.getTodayDownloadSize = function () {
            let e = a.DownloadKernelManager.getTotalDownloadSize();
            return s = t + e
        }, e.getTodayUploadSize = function () {
            let e = a.DownloadKernelManager.getTotalUploadSize();
            return l = i + e
        }, e.getCurrentDownloadSpeed = function () {
            return a.DownloadKernelManager.getTotalTaskDownloadSpeed(!1)
        }, e.getCurrentVipSpeed = function () {
            return a.DownloadKernelManager.getTotalTaskVipSpeed(!1)
        }
    }(t.FlowMonitorNS || (t.FlowMonitorNS = {}))
}, function (e) {
    e.exports = {urls: [{url: "www.iqiyi.com"}, {url: "v.qq.com"}, {url: "www.youku.com"}, {url: "www.bilibili.com"}, {url: "www.pptv.com"}, {url: "www.youtube.com"}, {url: "tv.sohu.com"}, {url: "v.ifeng.com/film"}, {url: "www.mgtv.com"}, {url: "www.56.com"}, {url: "www.cctv.com"}, {url: "www.pps.tv"}, {url: "tv.sohu.com"}, {url: "www.tvb.com"}, {url: "www.wasu.cn"}, {url: "www.baomihua.com"}, {url: "www.1905.com"}, {url: "v.163.com"}, {url: "www.v1.cn"}, {url: "www.6.cn"}, {url: "www.tvbs.com.tw"}, {url: "www.tangdou.com"}, {url: "www.pipi.cn"}, {url: "www.360kan.com"}, {url: "www.le.com"}, {url: "v.baidu.com"}, {url: "www.tudou.com"}, {url: "www.douyu.com"}, {url: "www.huya.com"}, {url: "www.panda.tv"}, {url: "www.longzhu.com"}, {url: "www.zhanqi.tv"}, {url: "www.yy.com"}, {url: "www.huajiao.com"}]}
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(198);
    for (var a in n) "default" !== a && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(a);
    var o = i(1), r = Object(o.a)(n.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\upgrade-task-container.vue", t.default = r.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(359), a = i(200);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\upgrade-task.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(0), o = i(3), r = i(11), s = i(29), l = i(59), d = i(10), u = i(4),
        c = a.default.getLogger("PrivateSpace.Upgrade"), h = r.DownloadKernelTaskManager.getTaskManager(),
        f = s.DownloadKernelCategoryManager.getCategoryManager();

    class g {
        insertTaskToNewPrivateSpace(e, t, i) {
            return n(this, void 0, void 0, function* () {
                let n = !1, a = yield l.TaskUtilitiesAWNS.batchFindTaskAW([i]);
                return (!a || a.length <= 0) && (c.information("insertTaskToNewPrivateSpace taskId:", t.getId(), ", findInfo:", i), n = h.moveCategoryTask(t.getId(), e.getId())), n
            })
        }

        getOldPrivateSpaceTaskList() {
            let e = [], t = f.getCategorys();
            for (let [, i]of t) {
                let t = i.getName(), n = i.getUserName();
                if (t === s.CategoryManager.privateCategoryName && "0" === n) {
                    let t = i.getCategoryViews();
                    for (let i = 0; i < t.length; i++) {
                        let n = t[i].getTasks();
                        for (let [, t]of n) e.push(t)
                    }
                }
            }
            return e
        }

        insertTaskListToNewPrivateSpace(e) {
            return n(this, void 0, void 0, function* () {
                let t = !1, i = this.getOldPrivateSpaceTaskList();
                for (let n = 0; n < i.length; n++) {
                    let a = i[n], r = a.getType();
                    if (c.information("addTaskListToNewPrivateSpace taskType:", r), r === o.DownloadKernel.TaskType.P2sp) {
                        let i = a.getTaskAttribute(o.DownloadKernel.TaskAttribute.TaskUrl),
                            n = {taskType: o.DownloadKernel.TaskType.P2sp, value: i};
                        t = yield this.insertTaskToNewPrivateSpace(e, a, n)
                    } else if (r === o.DownloadKernel.TaskType.Bt) {
                        let i = a.getExtraObject().getInfoId(), n = {taskType: o.DownloadKernel.TaskType.Bt, value: i};
                        t = yield this.insertTaskToNewPrivateSpace(e, a, n)
                    } else if (r === o.DownloadKernel.TaskType.Emule) {
                        let i = a.getExtraObject().getFileHash(),
                            n = {taskType: o.DownloadKernel.TaskType.Emule, value: i};
                        t = yield this.insertTaskToNewPrivateSpace(e, a, n)
                    }
                }
                return t
            })
        }

        upgradePrivateSpace(e) {
            let t = !1, i = d.ConfigNS.getValue("TaskUpgrading", "UpgradedUsers", "");
            if (u.isString(i) || (i = ""), -1 === i.indexOf(e + ", ")) {
                let n = f.getPrivateCategoryFromUserId(e);
                n && (this.insertTaskListToNewPrivateSpace(n).catch(), i += e + ", ", d.ConfigNS.setValue("TaskUpgrading", "UpgradedUsers", i), t = !0)
            }
            return t
        }
    }

    t.PrivateSpaceUpgrade = g, function (e) {
        const t = new g;
        e.getUpgrade = function () {
            return t
        }
    }(t.PrivateSpaceUpgradeNS || (t.PrivateSpaceUpgradeNS = {}))
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(350), a = i(202);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\toast-notify\\toast-notify.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(360), a = i(204);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\toast-notify\\get-coin-prize-toast.vue", t.default = s.exports
}, function (e, t) {
    e.exports = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjQ4MkYyN0JBRUY0MTExRTk4Mzc1QUU4RDFCMDQ0RTQwIiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjQ4MkYyN0JCRUY0MTExRTk4Mzc1QUU4RDFCMDQ0RTQwIj4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6NDgyRjI3QjhFRjQxMTFFOTgzNzVBRThEMUIwNDRFNDAiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6NDgyRjI3QjlFRjQxMTFFOTgzNzVBRThEMUIwNDRFNDAiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz5iXSX2AAACVUlEQVR42myTTWsTURSG35lMJt9NM0nEFmrAggs3Iv6BgnvXIvgTqrgQuhR00Z2L/gFBENfuBf9BcVOhtGLEarQ1Md+TySTj+87pokUvc+HOPe9zz8e9x0mSZwB8oPcZmP4Gqiu30Z/cR9a7C8dtQSNZtjGP36NafIv+YB+FOlC7TkMED/qQA9xMAXG8i2G4TcBB9wyYRymPrN9AeeUObU+p2aN2h8wUWMJJ4kfAcFZCNHqDOLyHHqM4/QFMxkA8twO8LFAsAc01eqZ3L/8OfvkBKrmxi2QA9E+ep3DnBGgfGeQzrYxnU2sN2aSRVgxZF1FyC7nSE/zpAt++GLB5E9jYVO42tdaebNJIK4asi97kYRrqaUfVsrCVQnAFqJ/PoGl7aUqJabUm68HPbKHbY84jy1UCrcORedYIWa/x0GzSyD5m6kFjy4WTaSGKrOIKN89irbdSLbzzGmh/bYO2oh0irRiyHi4ON0PjDPjFcP2sVT1RyD+5HxrouJcRJIt2WuUs5yKmR4J15rzaNLEODRr8b1hE0kgrhixvYfEBpRXec5mFiS3EaG6RpK9Q/6EVTWlJI60Ysi5qxddpYZpX7eRwwvs+BI4/0duCk+DRAfD1GJhNTSOtGLIufOcjZuOXWA1YvGsM26GXyELV1Wkul7YnmzTSiiH7n6fMR3LWsauSRxDK5S3sBj3XgktP2UmSFxQV+JwPC+h/34Vf3KZ3B6PBxWYCm0lXmiCa7KG6voPqDZ4+VSuqcCzYcsE/7zEq+VdpOweNf9u5kmc7R/vUGkP2rwADAETFIyCc0imDAAAAAElFTkSuQmCC"
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(351), a = i(206);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\ad-platform\\ad-platform.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(352), a = i(208);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\ad-platform\\ad-left-bottom.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(210);
    for (var a in n) "default" !== a && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(a);
    var o = i(1), r = Object(o.a)(n.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\task-detail\\index-container.vue", t.default = r.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(361), a = i(212);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    i(660);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, "109c4717", null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\task-detail\\index.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(7), o = i(0), r = i(19), s = o.default.getLogger("[Thunder][CrossProduct]");
    t.crossClient = new class extends r.EventEmitter {
        constructor() {
            super(), this.connected = !1, this.contectState = -1
        }

        connect(e, t) {
            s.information(`连接:${e} 中...`), 0 !== this.contectState && (this.connected || (this.contectState = 0, this.productName = e, a.client.start(void 0, e, "" !== e, (e, ...i) => {
                let n = this.connected;
                "connect" === e ? (this.connected = !0, s.information("连接成功..."), this.startRetry(!1)) : (this.connected = !1, this.startRetry(!0)), this.contectState = 1, t && t(this.connected), this.connected !== n && this.emit(this.connected ? "OnClientConencted" : "OnClientDisconnected", this.productName)
            })))
        }

        crossProductCall(e, ...t) {
            return n(this, void 0, void 0, function* () {
                if (this.connected) return a.client.crossCallServerFunction(this.productName, e, ...t)
            })
        }

        corssAttachProductEvent(e, t) {
            return n(this, void 0, void 0, function* () {
                if (this.connected) return a.client.crossAttachServerEvent(this.productName, e, t)
            })
        }

        isConnected() {
            return this.connected
        }

        startRetry(e) {
            e ? this.timer || (this.timer = setInterval(() => {
                this.connect(this.productName)
            }, 2e3)) : this.timer && (clearInterval(this.timer), this.timer = void 0)
        }
    }
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(376), a = i(214);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\task-detail\\pages\\XlTab.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(389), a = i(216);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\task-detail\\components\\tabs\\Preview.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(390), a = i(218);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\task-detail\\components\\tabs\\Attribute.vue", t.default = s.exports
}, function (e, t, i) {
    !function (e) {
        "use strict";
        var t, i = 2311, n = function () {
                return i++
            }, a = "object" == typeof wx && "function" == typeof wx.getSystemInfoSync ? {
                browser: {},
                os: {},
                node: !1,
                wxa: !0,
                canvasSupported: !0,
                svgSupported: !1,
                touchEventsSupported: !0,
                domSupported: !1
            } : "undefined" == typeof document && "undefined" != typeof self ? {
                browser: {},
                os: {},
                node: !1,
                worker: !0,
                canvasSupported: !0,
                domSupported: !1
            } : "undefined" == typeof navigator ? {
                browser: {},
                os: {},
                node: !0,
                worker: !1,
                canvasSupported: !0,
                svgSupported: !0,
                domSupported: !1
            } : function (e) {
                var t = {}, i = e.match(/Firefox\/([\d.]+)/),
                    n = e.match(/MSIE\s([\d.]+)/) || e.match(/Trident\/.+?rv:(([\d.]+))/), a = e.match(/Edge\/([\d.]+)/),
                    o = /micromessenger/i.test(e);
                return i && (t.firefox = !0, t.version = i[1]), n && (t.ie = !0, t.version = n[1]), a && (t.edge = !0, t.version = a[1]), o && (t.weChat = !0), {
                    browser: t,
                    os: {},
                    node: !1,
                    canvasSupported: !!document.createElement("canvas").getContext,
                    svgSupported: "undefined" != typeof SVGRect,
                    touchEventsSupported: "ontouchstart" in window && !t.ie && !t.edge,
                    pointerEventsSupported: "onpointerdown" in window && (t.edge || t.ie && 11 <= t.version),
                    domSupported: "undefined" != typeof document
                }
            }(navigator.userAgent), o = {
                "[object Function]": 1,
                "[object RegExp]": 1,
                "[object Date]": 1,
                "[object Error]": 1,
                "[object CanvasGradient]": 1,
                "[object CanvasPattern]": 1,
                "[object Image]": 1,
                "[object Canvas]": 1
            }, r = {
                "[object Int8Array]": 1,
                "[object Uint8Array]": 1,
                "[object Uint8ClampedArray]": 1,
                "[object Int16Array]": 1,
                "[object Uint16Array]": 1,
                "[object Int32Array]": 1,
                "[object Uint32Array]": 1,
                "[object Float32Array]": 1,
                "[object Float64Array]": 1
            }, s = Object.prototype.toString, l = Array.prototype, d = l.forEach, u = l.filter, c = l.slice, h = l.map,
            f = l.reduce, g = {};

        function p(e, i) {
            "createCanvas" === e && (t = null), g[e] = i
        }

        function v(e) {
            if (null == e || "object" != typeof e) return e;
            var t = e, i = s.call(e);
            if ("[object Array]" === i) {
                if (!J(e)) {
                    t = [];
                    for (var n = 0, a = e.length; n < a; n++) t[n] = v(e[n])
                }
            } else if (r[i]) {
                if (!J(e)) {
                    var l = e.constructor;
                    if (e.constructor.from) t = l.from(e); else for (t = new l(e.length), n = 0, a = e.length; n < a; n++) t[n] = v(e[n])
                }
            } else if (!o[i] && !J(e) && !K(e)) for (var d in t = {}, e) e.hasOwnProperty(d) && (t[d] = v(e[d]));
            return t
        }

        function m(e, t, i) {
            if (!B(t) || !B(e)) return i ? v(t) : e;
            for (var n in t) if (t.hasOwnProperty(n)) {
                var a = e[n], o = t[n];
                !B(o) || !B(a) || O(o) || O(a) || K(o) || K(a) || U(o) || U(a) || J(o) || J(a) ? !i && n in e || (e[n] = v(t[n])) : m(a, o, i)
            }
            return e
        }

        function y(e, t) {
            for (var i = e[0], n = 1, a = e.length; n < a; n++) i = m(i, e[n], t);
            return i
        }

        function k(e, t) {
            for (var i in t) t.hasOwnProperty(i) && (e[i] = t[i]);
            return e
        }

        function T(e, t, i) {
            for (var n in t) t.hasOwnProperty(n) && (i ? null != t[n] : null == e[n]) && (e[n] = t[n]);
            return e
        }

        function w() {
            return g.createCanvas()
        }

        function C() {
            return t = t || w().getContext("2d")
        }

        function S(e, t) {
            if (e) {
                if (e.indexOf) return e.indexOf(t);
                for (var i = 0, n = e.length; i < n; i++) if (e[i] === t) return i
            }
            return -1
        }

        function b(e, t) {
            var i = e.prototype;

            function n() {
            }

            for (var a in n.prototype = t.prototype, e.prototype = new n, i) i.hasOwnProperty(a) && (e.prototype[a] = i[a]);
            (e.prototype.constructor = e).superClass = t
        }

        function I(e, t, i) {
            T(e = "prototype" in e ? e.prototype : e, t = "prototype" in t ? t.prototype : t, i)
        }

        function _(e) {
            if (e) return "string" != typeof e && "number" == typeof e.length
        }

        function A(e, t, i) {
            if (e && t) if (e.forEach && e.forEach === d) e.forEach(t, i); else if (e.length === +e.length) for (var n = 0, a = e.length; n < a; n++) t.call(i, e[n], n, e); else for (var o in e) e.hasOwnProperty(o) && t.call(i, e[o], o, e)
        }

        function D(e, t, i) {
            if (e && t) {
                if (e.map && e.map === h) return e.map(t, i);
                for (var n = [], a = 0, o = e.length; a < o; a++) n.push(t.call(i, e[a], a, e));
                return n
            }
        }

        function x(e, t, i, n) {
            if (e && t) {
                if (e.reduce && e.reduce === f) return e.reduce(t, i, n);
                for (var a = 0, o = e.length; a < o; a++) i = t.call(n, i, e[a], a, e);
                return i
            }
        }

        function N(e, t, i) {
            if (e && t) {
                if (e.filter && e.filter === u) return e.filter(t, i);
                for (var n = [], a = 0, o = e.length; a < o; a++) t.call(i, e[a], a, e) && n.push(e[a]);
                return n
            }
        }

        function E(e, t, i) {
            if (e && t) for (var n = 0, a = e.length; n < a; n++) if (t.call(i, e[n], n, e)) return e[n]
        }

        function P(e, t) {
            var i = c.call(arguments, 2);
            return function () {
                return e.apply(t, i.concat(c.call(arguments)))
            }
        }

        function M(e) {
            var t = c.call(arguments, 1);
            return function () {
                return e.apply(this, t.concat(c.call(arguments)))
            }
        }

        function O(e) {
            return "[object Array]" === s.call(e)
        }

        function F(e) {
            return "function" == typeof e
        }

        function L(e) {
            return "[object String]" === s.call(e)
        }

        function B(e) {
            var t = typeof e;
            return "function" == t || !!e && "object" == t
        }

        function U(e) {
            return !!o[s.call(e)]
        }

        function R(e) {
            return !!r[s.call(e)]
        }

        function K(e) {
            return "object" == typeof e && "number" == typeof e.nodeType && "object" == typeof e.ownerDocument
        }

        function W(e) {
            return e != e
        }

        function V(e) {
            for (var t = 0, i = arguments.length; t < i; t++) if (null != arguments[t]) return arguments[t]
        }

        function H(e, t) {
            return null != e ? e : t
        }

        function z(e, t, i) {
            return null != e ? e : null != t ? t : i
        }

        function j() {
            return Function.call.apply(c, arguments)
        }

        function G(e) {
            if ("number" == typeof e) return [e, e, e, e];
            var t = e.length;
            return 2 === t ? [e[0], e[1], e[0], e[1]] : 3 === t ? [e[0], e[1], e[2], e[1]] : e
        }

        function $(e, t) {
            if (!e) throw new Error(t)
        }

        function X(e) {
            return null == e ? null : "function" == typeof e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "")
        }

        g.createCanvas = function () {
            return document.createElement("canvas")
        };
        var q = "__ec_primitive__";

        function Y(e) {
            e[q] = !0
        }

        function J(e) {
            return e[q]
        }

        function Z(e) {
            var t = O(e);
            this.data = {};
            var i = this;

            function n(e, n) {
                t ? i.set(e, n) : i.set(n, e)
            }

            e instanceof Z ? e.each(n) : e && A(e, n)
        }

        function Q(e) {
            return new Z(e)
        }

        function ee(e, t) {
            for (var i = new e.constructor(e.length + t.length), n = 0; n < e.length; n++) i[n] = e[n];
            var a = e.length;
            for (n = 0; n < t.length; n++) i[n + a] = t[n];
            return i
        }

        function te() {
        }

        Z.prototype = {
            constructor: Z, get: function (e) {
                return this.data.hasOwnProperty(e) ? this.data[e] : null
            }, set: function (e, t) {
                return this.data[e] = t
            }, each: function (e, t) {
                for (var i in void 0 !== t && (e = P(e, t)), this.data) this.data.hasOwnProperty(i) && e(this.data[i], i)
            }, removeKey: function (e) {
                delete this.data[e]
            }
        };
        var ie = (Object.freeze || Object)({
            $override: p,
            clone: v,
            merge: m,
            mergeAll: y,
            extend: k,
            defaults: T,
            createCanvas: w,
            getContext: C,
            indexOf: S,
            inherits: b,
            mixin: I,
            isArrayLike: _,
            each: A,
            map: D,
            reduce: x,
            filter: N,
            find: E,
            bind: P,
            curry: M,
            isArray: O,
            isFunction: F,
            isString: L,
            isObject: B,
            isBuiltInObject: U,
            isTypedArray: R,
            isDom: K,
            eqNaN: W,
            retrieve: V,
            retrieve2: H,
            retrieve3: z,
            slice: j,
            normalizeCssArray: G,
            assert: $,
            trim: X,
            setAsPrimitive: Y,
            isPrimitive: J,
            createHashMap: Q,
            concatArray: ee,
            noop: te
        }), ne = "undefined" == typeof Float32Array ? Array : Float32Array;

        function ae(e, t) {
            var i = new ne(2);
            return null == e && (e = 0), null == t && (t = 0), i[0] = e, i[1] = t, i
        }

        function oe(e, t) {
            return e[0] = t[0], e[1] = t[1], e
        }

        function re(e) {
            var t = new ne(2);
            return t[0] = e[0], t[1] = e[1], t
        }

        function se(e, t, i) {
            return e[0] = t, e[1] = i, e
        }

        function le(e, t, i) {
            return e[0] = t[0] + i[0], e[1] = t[1] + i[1], e
        }

        function de(e, t, i, n) {
            return e[0] = t[0] + i[0] * n, e[1] = t[1] + i[1] * n, e
        }

        function ue(e, t, i) {
            return e[0] = t[0] - i[0], e[1] = t[1] - i[1], e
        }

        function ce(e) {
            return Math.sqrt(fe(e))
        }

        var he = ce;

        function fe(e) {
            return e[0] * e[0] + e[1] * e[1]
        }

        var ge = fe;

        function pe(e, t, i) {
            return e[0] = t[0] * i, e[1] = t[1] * i, e
        }

        function ve(e, t) {
            var i = ce(t);
            return 0 === i ? (e[0] = 0, e[1] = 0) : (e[0] = t[0] / i, e[1] = t[1] / i), e
        }

        function me(e, t) {
            return Math.sqrt((e[0] - t[0]) * (e[0] - t[0]) + (e[1] - t[1]) * (e[1] - t[1]))
        }

        var ye = me;

        function ke(e, t) {
            return (e[0] - t[0]) * (e[0] - t[0]) + (e[1] - t[1]) * (e[1] - t[1])
        }

        var Te = ke;

        function we(e, t, i, n) {
            return e[0] = t[0] + n * (i[0] - t[0]), e[1] = t[1] + n * (i[1] - t[1]), e
        }

        function Ce(e, t, i) {
            var n = t[0], a = t[1];
            return e[0] = i[0] * n + i[2] * a + i[4], e[1] = i[1] * n + i[3] * a + i[5], e
        }

        function Se(e, t, i) {
            return e[0] = Math.min(t[0], i[0]), e[1] = Math.min(t[1], i[1]), e
        }

        function be(e, t, i) {
            return e[0] = Math.max(t[0], i[0]), e[1] = Math.max(t[1], i[1]), e
        }

        var Ie = (Object.freeze || Object)({
            create: ae,
            copy: oe,
            clone: re,
            set: se,
            add: le,
            scaleAndAdd: de,
            sub: ue,
            len: ce,
            length: he,
            lenSquare: fe,
            lengthSquare: ge,
            mul: function (e, t, i) {
                return e[0] = t[0] * i[0], e[1] = t[1] * i[1], e
            },
            div: function (e, t, i) {
                return e[0] = t[0] / i[0], e[1] = t[1] / i[1], e
            },
            dot: function (e, t) {
                return e[0] * t[0] + e[1] * t[1]
            },
            scale: pe,
            normalize: ve,
            distance: me,
            dist: ye,
            distanceSquare: ke,
            distSquare: Te,
            negate: function (e, t) {
                return e[0] = -t[0], e[1] = -t[1], e
            },
            lerp: we,
            applyTransform: Ce,
            min: Se,
            max: be
        });

        function _e() {
            this.on("mousedown", this._dragStart, this), this.on("mousemove", this._drag, this), this.on("mouseup", this._dragEnd, this)
        }

        function Ae(e, t) {
            return {target: e, topTarget: t && t.topTarget}
        }

        _e.prototype = {
            constructor: _e, _dragStart: function (e) {
                for (var t = e.target; t && !t.draggable;) t = t.parent;
                t && ((this._draggingTarget = t).dragging = !0, this._x = e.offsetX, this._y = e.offsetY, this.dispatchToElement(Ae(t, e), "dragstart", e.event))
            }, _drag: function (e) {
                var t = this._draggingTarget;
                if (t) {
                    var i = e.offsetX, n = e.offsetY, a = i - this._x, o = n - this._y;
                    this._x = i, this._y = n, t.drift(a, o, e), this.dispatchToElement(Ae(t, e), "drag", e.event);
                    var r = this.findHover(i, n, t).target, s = this._dropTarget;
                    t !== (this._dropTarget = r) && (s && r !== s && this.dispatchToElement(Ae(s, e), "dragleave", e.event), r && r !== s && this.dispatchToElement(Ae(r, e), "dragenter", e.event))
                }
            }, _dragEnd: function (e) {
                var t = this._draggingTarget;
                t && (t.dragging = !1), this.dispatchToElement(Ae(t, e), "dragend", e.event), this._dropTarget && this.dispatchToElement(Ae(this._dropTarget, e), "drop", e.event), this._draggingTarget = null, this._dropTarget = null
            }
        };
        var De = Array.prototype.slice, xe = function (e) {
            this._$handlers = {}, this._$eventProcessor = e
        };

        function Ne(e, t, i, n, a, o) {
            var r = e._$handlers;
            if ("function" == typeof i && (a = n, n = i, i = null), !n || !t) return e;
            i = function (e, t) {
                var i = e._$eventProcessor;
                return null != t && i && i.normalizeQuery && (t = i.normalizeQuery(t)), t
            }(e, i), r[t] || (r[t] = []);
            for (var s = 0; s < r[t].length; s++) if (r[t][s].h === n) return e;
            var l = {h: n, one: o, query: i, ctx: a || e, callAtLast: n.zrEventfulCallAtLast}, d = r[t].length - 1,
                u = r[t][d];
            return u && u.callAtLast ? r[t].splice(d, 0, l) : r[t].push(l), e
        }

        xe.prototype = {
            constructor: xe, one: function (e, t, i, n) {
                return Ne(this, e, t, i, n, !0)
            }, on: function (e, t, i, n) {
                return Ne(this, e, t, i, n, !1)
            }, isSilent: function (e) {
                var t = this._$handlers;
                return !t[e] || !t[e].length
            }, off: function (e, t) {
                var i = this._$handlers;
                if (!e) return this._$handlers = {}, this;
                if (t) {
                    if (i[e]) {
                        for (var n = [], a = 0, o = i[e].length; a < o; a++) i[e][a].h !== t && n.push(i[e][a]);
                        i[e] = n
                    }
                    i[e] && 0 === i[e].length && delete i[e]
                } else delete i[e];
                return this
            }, trigger: function (e) {
                var t = this._$handlers[e], i = this._$eventProcessor;
                if (t) {
                    var n = arguments, a = n.length;
                    3 < a && (n = De.call(n, 1));
                    for (var o = t.length, r = 0; r < o;) {
                        var s = t[r];
                        if (i && i.filter && null != s.query && !i.filter(e, s.query)) r++; else {
                            switch (a) {
                                case 1:
                                    s.h.call(s.ctx);
                                    break;
                                case 2:
                                    s.h.call(s.ctx, n[1]);
                                    break;
                                case 3:
                                    s.h.call(s.ctx, n[1], n[2]);
                                    break;
                                default:
                                    s.h.apply(s.ctx, n)
                            }
                            s.one ? (t.splice(r, 1), o--) : r++
                        }
                    }
                }
                return i && i.afterTrigger && i.afterTrigger(e), this
            }, triggerWithContext: function (e) {
                var t = this._$handlers[e], i = this._$eventProcessor;
                if (t) {
                    var n = arguments, a = n.length;
                    4 < a && (n = De.call(n, 1, n.length - 1));
                    for (var o = n[n.length - 1], r = t.length, s = 0; s < r;) {
                        var l = t[s];
                        if (i && i.filter && null != l.query && !i.filter(e, l.query)) s++; else {
                            switch (a) {
                                case 1:
                                    l.h.call(o);
                                    break;
                                case 2:
                                    l.h.call(o, n[1]);
                                    break;
                                case 3:
                                    l.h.call(o, n[1], n[2]);
                                    break;
                                default:
                                    l.h.apply(o, n)
                            }
                            l.one ? (t.splice(s, 1), r--) : s++
                        }
                    }
                }
                return i && i.afterTrigger && i.afterTrigger(e), this
            }
        };
        var Ee = Math.log(2);

        function Pe(e, t, i, n, a, o) {
            var r = n + "-" + a, s = e.length;
            if (o.hasOwnProperty(r)) return o[r];
            if (1 === t) {
                var l = Math.round(Math.log((1 << s) - 1 & ~a) / Ee);
                return e[i][l]
            }
            for (var d = n | 1 << i, u = i + 1; n & 1 << u;) u++;
            for (var c = 0, h = 0, f = 0; h < s; h++) {
                var g = 1 << h;
                g & a || (c += (f % 2 ? -1 : 1) * e[i][h] * Pe(e, t - 1, u, d, a | g, o), f++)
            }
            return o[r] = c
        }

        function Me(e, t) {
            var i = [[e[0], e[1], 1, 0, 0, 0, -t[0] * e[0], -t[0] * e[1]], [0, 0, 0, e[0], e[1], 1, -t[1] * e[0], -t[1] * e[1]], [e[2], e[3], 1, 0, 0, 0, -t[2] * e[2], -t[2] * e[3]], [0, 0, 0, e[2], e[3], 1, -t[3] * e[2], -t[3] * e[3]], [e[4], e[5], 1, 0, 0, 0, -t[4] * e[4], -t[4] * e[5]], [0, 0, 0, e[4], e[5], 1, -t[5] * e[4], -t[5] * e[5]], [e[6], e[7], 1, 0, 0, 0, -t[6] * e[6], -t[6] * e[7]], [0, 0, 0, e[6], e[7], 1, -t[7] * e[6], -t[7] * e[7]]],
                n = {}, a = Pe(i, 8, 0, 0, 0, n);
            if (0 !== a) {
                for (var o = [], r = 0; r < 8; r++) for (var s = 0; s < 8; s++) null == o[s] && (o[s] = 0), o[s] += ((r + s) % 2 ? -1 : 1) * Pe(i, 7, 0 === r ? 1 : 0, 1 << r, 1 << s, n) / a * t[r];
                return function (e, t, i) {
                    var n = t * o[6] + i * o[7] + 1;
                    e[0] = (t * o[0] + i * o[1] + o[2]) / n, e[1] = (t * o[3] + i * o[4] + o[5]) / n
                }
            }
        }

        var Oe = "___zrEVENTSAVED", Fe = [];

        function Le(e, t, i, n, o) {
            if (t.getBoundingClientRect && a.domSupported && !Be(t)) {
                var r = t[Oe] || (t[Oe] = {}), s = function (e, t, i) {
                    for (var n = i ? "invTrans" : "trans", a = t[n], o = t.srcCoords, r = !0, s = [], l = [], d = 0; d < 4; d++) {
                        var u = e[d].getBoundingClientRect(), c = 2 * d, h = u.left, f = u.top;
                        s.push(h, f), r = r && o && h === o[c] && f === o[1 + c], l.push(e[d].offsetLeft, e[d].offsetTop)
                    }
                    return r && a ? a : (t.srcCoords = s, t[n] = i ? Me(l, s) : Me(s, l))
                }(function (e, t) {
                    var i = t.markers;
                    if (i) return i;
                    i = t.markers = [];
                    for (var n = ["left", "right"], a = ["top", "bottom"], o = 0; o < 4; o++) {
                        var r = document.createElement("div"), s = r.style, l = o % 2, d = (o >> 1) % 2;
                        s.cssText = ["position: absolute", "visibility: hidden", "padding: 0", "margin: 0", "border-width: 0", "user-select: none", "width:0", "height:0", n[l] + ":0", a[d] + ":0", n[1 - l] + ":auto", a[1 - d] + ":auto", ""].join("!important;"), e.appendChild(r), i.push(r)
                    }
                    return i
                }(t, r), r, o);
                if (s) return s(e, i, n), !0
            }
            return !1
        }

        function Be(e) {
            return "CANVAS" === e.nodeName.toUpperCase()
        }

        var Ue = "undefined" != typeof window && !!window.addEventListener,
            Re = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, Ke = [];

        function We(e, t, i, n) {
            return i = i || {}, n || !a.canvasSupported ? Ve(e, t, i) : a.browser.firefox && null != t.layerX && t.layerX !== t.offsetX ? (i.zrX = t.layerX, i.zrY = t.layerY) : null != t.offsetX ? (i.zrX = t.offsetX, i.zrY = t.offsetY) : Ve(e, t, i), i
        }

        function Ve(e, t, i) {
            if (a.domSupported && e.getBoundingClientRect) {
                var n = t.clientX, o = t.clientY;
                if (Be(e)) {
                    var r = e.getBoundingClientRect();
                    return i.zrX = n - r.left, void (i.zrY = o - r.top)
                }
                if (Le(Ke, e, n, o)) return i.zrX = Ke[0], void (i.zrY = Ke[1])
            }
            i.zrX = i.zrY = 0
        }

        function He(e) {
            return e || window.event
        }

        function ze(e, t, i) {
            if (null != (t = He(t)).zrX) return t;
            var n = t.type;
            if (n && 0 <= n.indexOf("touch")) {
                var a = "touchend" !== n ? t.targetTouches[0] : t.changedTouches[0];
                a && We(e, a, t, i)
            } else We(e, t, t, i), t.zrDelta = t.wheelDelta ? t.wheelDelta / 120 : -(t.detail || 0) / 3;
            var o = t.button;
            return null == t.which && void 0 !== o && Re.test(t.type) && (t.which = 1 & o ? 1 : 2 & o ? 3 : 4 & o ? 2 : 0), t
        }

        function je(e, t, i, n) {
            Ue ? e.addEventListener(t, i, n) : e.attachEvent("on" + t, i)
        }

        var Ge = Ue ? function (e) {
            e.preventDefault(), e.stopPropagation(), e.cancelBubble = !0
        } : function (e) {
            e.returnValue = !1, e.cancelBubble = !0
        };

        function $e(e) {
            return 2 === e.which || 3 === e.which
        }

        function Xe() {
            this._track = []
        }

        function qe(e) {
            var t = e[1][0] - e[0][0], i = e[1][1] - e[0][1];
            return Math.sqrt(t * t + i * i)
        }

        Xe.prototype = {
            constructor: Xe, recognize: function (e, t, i) {
                return this._doTrack(e, t, i), this._recognize(e)
            }, clear: function () {
                return this._track.length = 0, this
            }, _doTrack: function (e, t, i) {
                var n = e.touches;
                if (n) {
                    for (var a = {points: [], touches: [], target: t, event: e}, o = 0, r = n.length; o < r; o++) {
                        var s = n[o], l = We(i, s, {});
                        a.points.push([l.zrX, l.zrY]), a.touches.push(s)
                    }
                    this._track.push(a)
                }
            }, _recognize: function (e) {
                for (var t in Ye) if (Ye.hasOwnProperty(t)) {
                    var i = Ye[t](this._track, e);
                    if (i) return i
                }
            }
        };
        var Ye = {
            pinch: function (e, t) {
                var i = e.length;
                if (i) {
                    var n = (e[i - 1] || {}).points, a = (e[i - 2] || {}).points || n;
                    if (a && 1 < a.length && n && 1 < n.length) {
                        var o = qe(n) / qe(a);
                        isFinite(o) || (o = 1), t.pinchScale = o;
                        var r = function (e) {
                            return [(e[0][0] + e[1][0]) / 2, (e[0][1] + e[1][1]) / 2]
                        }(n);
                        return t.pinchX = r[0], t.pinchY = r[1], {type: "pinch", target: e[0].target, event: t}
                    }
                }
            }
        }, Je = "silent";

        function Ze() {
            Ge(this.event)
        }

        function Qe() {
        }

        function et(e, t, i, n) {
            xe.call(this), this.storage = e, this.painter = t, this.painterRoot = n, i = i || new Qe, this.proxy = null, this._hovered = {}, this._lastTouchMoment, this._lastX, this._lastY, this._gestureMgr, _e.call(this), this.setHandlerProxy(i)
        }

        Qe.prototype.dispose = function () {
        };
        var tt = ["click", "dblclick", "mousewheel", "mouseout", "mouseup", "mousedown", "mousemove", "contextmenu"];

        function it(e, t, i) {
            if (e[e.rectHover ? "rectContain" : "contain"](t, i)) {
                for (var n, a = e; a;) {
                    if (a.clipPath && !a.clipPath.contain(t, i)) return !1;
                    a.silent && (n = !0), a = a.parent
                }
                return !n || Je
            }
            return !1
        }

        function nt(e, t, i) {
            var n = e.painter;
            return t < 0 || t > n.getWidth() || i < 0 || i > n.getHeight()
        }

        et.prototype = {
            constructor: et, setHandlerProxy: function (e) {
                this.proxy && this.proxy.dispose(), e && (A(tt, function (t) {
                    e.on && e.on(t, this[t], this)
                }, this), e.handler = this), this.proxy = e
            }, mousemove: function (e) {
                var t = e.zrX, i = e.zrY, n = nt(this, t, i), a = this._hovered, o = a.target;
                o && !o.__zr && (o = (a = this.findHover(a.x, a.y)).target);
                var r = this._hovered = n ? {x: t, y: i} : this.findHover(t, i), s = r.target, l = this.proxy;
                l.setCursor && l.setCursor(s ? s.cursor : "default"), o && s !== o && this.dispatchToElement(a, "mouseout", e), this.dispatchToElement(r, "mousemove", e), s && s !== o && this.dispatchToElement(r, "mouseover", e)
            }, mouseout: function (e) {
                var t = e.zrEventControl, i = e.zrIsToLocalDOM;
                "only_globalout" !== t && this.dispatchToElement(this._hovered, "mouseout", e), "no_globalout" !== t && (i || this.trigger("globalout", {
                    type: "globalout",
                    event: e
                }))
            }, resize: function (e) {
                this._hovered = {}
            }, dispatch: function (e, t) {
                var i = this[e];
                i && i.call(this, t)
            }, dispose: function () {
                this.proxy.dispose(), this.storage = this.proxy = this.painter = null
            }, setCursorStyle: function (e) {
                var t = this.proxy;
                t.setCursor && t.setCursor(e)
            }, dispatchToElement: function (e, t, i) {
                var n = (e = e || {}).target;
                if (!n || !n.silent) {
                    for (var a = "on" + t, o = function (e, t, i) {
                        return {
                            type: e,
                            event: i,
                            target: t.target,
                            topTarget: t.topTarget,
                            cancelBubble: !1,
                            offsetX: i.zrX,
                            offsetY: i.zrY,
                            gestureEvent: i.gestureEvent,
                            pinchX: i.pinchX,
                            pinchY: i.pinchY,
                            pinchScale: i.pinchScale,
                            wheelDelta: i.zrDelta,
                            zrByTouch: i.zrByTouch,
                            which: i.which,
                            stop: Ze
                        }
                    }(t, e, i); n && (n[a] && (o.cancelBubble = n[a].call(n, o)), n.trigger(t, o), n = n.parent, !o.cancelBubble);) ;
                    o.cancelBubble || (this.trigger(t, o), this.painter && this.painter.eachOtherLayer(function (e) {
                        "function" == typeof e[a] && e[a].call(e, o), e.trigger && e.trigger(t, o)
                    }))
                }
            }, findHover: function (e, t, i) {
                for (var n = this.storage.getDisplayList(), a = {x: e, y: t}, o = n.length - 1; 0 <= o; o--) {
                    var r;
                    if (n[o] !== i && !n[o].ignore && (r = it(n[o], e, t)) && (a.topTarget || (a.topTarget = n[o]), r !== Je)) {
                        a.target = n[o];
                        break
                    }
                }
                return a
            }, processGesture: function (e, t) {
                this._gestureMgr || (this._gestureMgr = new Xe);
                var i = this._gestureMgr;
                "start" === t && i.clear();
                var n = i.recognize(e, this.findHover(e.zrX, e.zrY, null).target, this.proxy.dom);
                if ("end" === t && i.clear(), n) {
                    var a = n.type;
                    e.gestureEvent = a, this.dispatchToElement({target: n.target}, a, n.event)
                }
            }
        }, A(["click", "mousedown", "mouseup", "mousewheel", "dblclick", "contextmenu"], function (e) {
            et.prototype[e] = function (t) {
                var i, n, a = t.zrX, o = t.zrY, r = nt(this, a, o);
                if ("mouseup" === e && r || (n = (i = this.findHover(a, o)).target), "mousedown" === e) this._downEl = n, this._downPoint = [t.zrX, t.zrY], this._upEl = n; else if ("mouseup" === e) this._upEl = n; else if ("click" === e) {
                    if (this._downEl !== this._upEl || !this._downPoint || 4 < ye(this._downPoint, [t.zrX, t.zrY])) return;
                    this._downPoint = null
                }
                this.dispatchToElement(i, e, t)
            }
        }), I(et, xe), I(et, _e);
        var at = "undefined" == typeof Float32Array ? Array : Float32Array;

        function ot() {
            var e = new at(6);
            return rt(e), e
        }

        function rt(e) {
            return e[0] = 1, e[1] = 0, e[2] = 0, e[3] = 1, e[4] = 0, e[5] = 0, e
        }

        function st(e, t) {
            return e[0] = t[0], e[1] = t[1], e[2] = t[2], e[3] = t[3], e[4] = t[4], e[5] = t[5], e
        }

        function lt(e, t, i) {
            var n = t[0] * i[0] + t[2] * i[1], a = t[1] * i[0] + t[3] * i[1], o = t[0] * i[2] + t[2] * i[3],
                r = t[1] * i[2] + t[3] * i[3], s = t[0] * i[4] + t[2] * i[5] + t[4],
                l = t[1] * i[4] + t[3] * i[5] + t[5];
            return e[0] = n, e[1] = a, e[2] = o, e[3] = r, e[4] = s, e[5] = l, e
        }

        function dt(e, t, i) {
            return e[0] = t[0], e[1] = t[1], e[2] = t[2], e[3] = t[3], e[4] = t[4] + i[0], e[5] = t[5] + i[1], e
        }

        function ut(e, t, i) {
            var n = t[0], a = t[2], o = t[4], r = t[1], s = t[3], l = t[5], d = Math.sin(i), u = Math.cos(i);
            return e[0] = n * u + r * d, e[1] = -n * d + r * u, e[2] = a * u + s * d, e[3] = -a * d + u * s, e[4] = u * o + d * l, e[5] = u * l - d * o, e
        }

        function ct(e, t, i) {
            var n = i[0], a = i[1];
            return e[0] = t[0] * n, e[1] = t[1] * a, e[2] = t[2] * n, e[3] = t[3] * a, e[4] = t[4] * n, e[5] = t[5] * a, e
        }

        function ht(e, t) {
            var i = t[0], n = t[2], a = t[4], o = t[1], r = t[3], s = t[5], l = i * r - o * n;
            return l ? (l = 1 / l, e[0] = r * l, e[1] = -o * l, e[2] = -n * l, e[3] = i * l, e[4] = (n * s - r * a) * l, e[5] = (o * a - i * s) * l, e) : null
        }

        function ft(e) {
            var t = ot();
            return st(t, e), t
        }

        var gt = (Object.freeze || Object)({
            create: ot,
            identity: rt,
            copy: st,
            mul: lt,
            translate: dt,
            rotate: ut,
            scale: ct,
            invert: ht,
            clone: ft
        }), pt = rt;

        function vt(e) {
            return 5e-5 < e || e < -5e-5
        }

        var mt = function (e) {
            (e = e || {}).position || (this.position = [0, 0]), null == e.rotation && (this.rotation = 0), e.scale || (this.scale = [1, 1]), this.origin = this.origin || null
        }, yt = mt.prototype;
        yt.transform = null, yt.needLocalTransform = function () {
            return vt(this.rotation) || vt(this.position[0]) || vt(this.position[1]) || vt(this.scale[0] - 1) || vt(this.scale[1] - 1)
        };
        var kt = [];
        yt.updateTransform = function () {
            var e = this.parent, t = e && e.transform, i = this.needLocalTransform(), n = this.transform;
            if (i || t) {
                n = n || ot(), i ? this.getLocalTransform(n) : pt(n), t && (i ? lt(n, e.transform, n) : st(n, e.transform)), this.transform = n;
                var a = this.globalScaleRatio;
                if (null != a && 1 !== a) {
                    this.getGlobalScale(kt);
                    var o = kt[0] < 0 ? -1 : 1, r = kt[1] < 0 ? -1 : 1, s = ((kt[0] - o) * a + o) / kt[0] || 0,
                        l = ((kt[1] - r) * a + r) / kt[1] || 0;
                    n[0] *= s, n[1] *= s, n[2] *= l, n[3] *= l
                }
                this.invTransform = this.invTransform || ot(), ht(this.invTransform, n)
            } else n && pt(n)
        }, yt.getLocalTransform = function (e) {
            return mt.getLocalTransform(this, e)
        }, yt.setTransform = function (e) {
            var t = this.transform, i = e.dpr || 1;
            t ? e.setTransform(i * t[0], i * t[1], i * t[2], i * t[3], i * t[4], i * t[5]) : e.setTransform(i, 0, 0, i, 0, 0)
        }, yt.restoreTransform = function (e) {
            var t = e.dpr || 1;
            e.setTransform(t, 0, 0, t, 0, 0)
        };
        var Tt = [], wt = ot();
        yt.setLocalTransform = function (e) {
            if (e) {
                var t = e[0] * e[0] + e[1] * e[1], i = e[2] * e[2] + e[3] * e[3], n = this.position, a = this.scale;
                vt(t - 1) && (t = Math.sqrt(t)), vt(i - 1) && (i = Math.sqrt(i)), e[0] < 0 && (t = -t), e[3] < 0 && (i = -i), n[0] = e[4], n[1] = e[5], a[0] = t, a[1] = i, this.rotation = Math.atan2(-e[1] / i, e[0] / t)
            }
        }, yt.decomposeTransform = function () {
            if (this.transform) {
                var e = this.parent, t = this.transform;
                e && e.transform && (lt(Tt, e.invTransform, t), t = Tt);
                var i = this.origin;
                i && (i[0] || i[1]) && (wt[4] = i[0], wt[5] = i[1], lt(Tt, t, wt), Tt[4] -= i[0], Tt[5] -= i[1], t = Tt), this.setLocalTransform(t)
            }
        }, yt.getGlobalScale = function (e) {
            var t = this.transform;
            return e = e || [], t ? (e[0] = Math.sqrt(t[0] * t[0] + t[1] * t[1]), e[1] = Math.sqrt(t[2] * t[2] + t[3] * t[3]), t[0] < 0 && (e[0] = -e[0]), t[3] < 0 && (e[1] = -e[1])) : (e[0] = 1, e[1] = 1), e
        }, yt.transformCoordToLocal = function (e, t) {
            var i = [e, t], n = this.invTransform;
            return n && Ce(i, i, n), i
        }, yt.transformCoordToGlobal = function (e, t) {
            var i = [e, t], n = this.transform;
            return n && Ce(i, i, n), i
        }, mt.getLocalTransform = function (e, t) {
            pt(t = t || []);
            var i = e.origin, n = e.scale || [1, 1], a = e.rotation || 0, o = e.position || [0, 0];
            return i && (t[4] -= i[0], t[5] -= i[1]), ct(t, t, n), a && ut(t, t, a), i && (t[4] += i[0], t[5] += i[1]), t[4] += o[0], t[5] += o[1], t
        };
        var Ct = {
            linear: function (e) {
                return e
            }, quadraticIn: function (e) {
                return e * e
            }, quadraticOut: function (e) {
                return e * (2 - e)
            }, quadraticInOut: function (e) {
                return (e *= 2) < 1 ? .5 * e * e : -.5 * (--e * (e - 2) - 1)
            }, cubicIn: function (e) {
                return e * e * e
            }, cubicOut: function (e) {
                return --e * e * e + 1
            }, cubicInOut: function (e) {
                return (e *= 2) < 1 ? .5 * e * e * e : .5 * ((e -= 2) * e * e + 2)
            }, quarticIn: function (e) {
                return e * e * e * e
            }, quarticOut: function (e) {
                return 1 - --e * e * e * e
            }, quarticInOut: function (e) {
                return (e *= 2) < 1 ? .5 * e * e * e * e : -.5 * ((e -= 2) * e * e * e - 2)
            }, quinticIn: function (e) {
                return e * e * e * e * e
            }, quinticOut: function (e) {
                return --e * e * e * e * e + 1
            }, quinticInOut: function (e) {
                return (e *= 2) < 1 ? .5 * e * e * e * e * e : .5 * ((e -= 2) * e * e * e * e + 2)
            }, sinusoidalIn: function (e) {
                return 1 - Math.cos(e * Math.PI / 2)
            }, sinusoidalOut: function (e) {
                return Math.sin(e * Math.PI / 2)
            }, sinusoidalInOut: function (e) {
                return .5 * (1 - Math.cos(Math.PI * e))
            }, exponentialIn: function (e) {
                return 0 === e ? 0 : Math.pow(1024, e - 1)
            }, exponentialOut: function (e) {
                return 1 === e ? 1 : 1 - Math.pow(2, -10 * e)
            }, exponentialInOut: function (e) {
                return 0 === e ? 0 : 1 === e ? 1 : (e *= 2) < 1 ? .5 * Math.pow(1024, e - 1) : .5 * (2 - Math.pow(2, -10 * (e - 1)))
            }, circularIn: function (e) {
                return 1 - Math.sqrt(1 - e * e)
            }, circularOut: function (e) {
                return Math.sqrt(1 - --e * e)
            }, circularInOut: function (e) {
                return (e *= 2) < 1 ? -.5 * (Math.sqrt(1 - e * e) - 1) : .5 * (Math.sqrt(1 - (e -= 2) * e) + 1)
            }, elasticIn: function (e) {
                var t, i = .1;
                return 0 === e ? 0 : 1 === e ? 1 : (t = !i || i < 1 ? (i = 1, .1) : .4 * Math.asin(1 / i) / (2 * Math.PI), -i * Math.pow(2, 10 * (e -= 1)) * Math.sin((e - t) * (2 * Math.PI) / .4))
            }, elasticOut: function (e) {
                var t, i = .1;
                return 0 === e ? 0 : 1 === e ? 1 : (t = !i || i < 1 ? (i = 1, .1) : .4 * Math.asin(1 / i) / (2 * Math.PI), i * Math.pow(2, -10 * e) * Math.sin((e - t) * (2 * Math.PI) / .4) + 1)
            }, elasticInOut: function (e) {
                var t, i = .1;
                return 0 === e ? 0 : 1 === e ? 1 : (t = !i || i < 1 ? (i = 1, .1) : .4 * Math.asin(1 / i) / (2 * Math.PI), (e *= 2) < 1 ? i * Math.pow(2, 10 * (e -= 1)) * Math.sin((e - t) * (2 * Math.PI) / .4) * -.5 : i * Math.pow(2, -10 * (e -= 1)) * Math.sin((e - t) * (2 * Math.PI) / .4) * .5 + 1)
            }, backIn: function (e) {
                return e * e * (2.70158 * e - 1.70158)
            }, backOut: function (e) {
                return --e * e * (2.70158 * e + 1.70158) + 1
            }, backInOut: function (e) {
                var t = 2.5949095;
                return (e *= 2) < 1 ? e * e * ((1 + t) * e - t) * .5 : .5 * ((e -= 2) * e * ((1 + t) * e + t) + 2)
            }, bounceIn: function (e) {
                return 1 - Ct.bounceOut(1 - e)
            }, bounceOut: function (e) {
                return e < 1 / 2.75 ? 7.5625 * e * e : e < 2 / 2.75 ? 7.5625 * (e -= 1.5 / 2.75) * e + .75 : e < 2.5 / 2.75 ? 7.5625 * (e -= 2.25 / 2.75) * e + .9375 : 7.5625 * (e -= 2.625 / 2.75) * e + .984375
            }, bounceInOut: function (e) {
                return e < .5 ? .5 * Ct.bounceIn(2 * e) : .5 * Ct.bounceOut(2 * e - 1) + .5
            }
        };

        function St(e) {
            this._target = e.target, this._life = e.life || 1e3, this._delay = e.delay || 0, this._initialized = !1, this.loop = null != e.loop && e.loop, this.gap = e.gap || 0, this.easing = e.easing || "Linear", this.onframe = e.onframe, this.ondestroy = e.ondestroy, this.onrestart = e.onrestart, this._pausedTime = 0, this._paused = !1
        }

        function bt() {
            this.head = null, this.tail = null, this._len = 0
        }

        St.prototype = {
            constructor: St, step: function (e, t) {
                if (this._initialized || (this._startTime = e + this._delay, this._initialized = !0), this._paused) this._pausedTime += t; else {
                    var i = (e - this._startTime - this._pausedTime) / this._life;
                    if (!(i < 0)) {
                        i = Math.min(i, 1);
                        var n = this.easing, a = "string" == typeof n ? Ct[n] : n,
                            o = "function" == typeof a ? a(i) : i;
                        return this.fire("frame", o), 1 === i ? this.loop ? (this.restart(e), "restart") : (this._needsRemove = !0, "destroy") : null
                    }
                }
            }, restart: function (e) {
                var t = (e - this._startTime - this._pausedTime) % this._life;
                this._startTime = e - t + this.gap, this._pausedTime = 0, this._needsRemove = !1
            }, fire: function (e, t) {
                this[e = "on" + e] && this[e](this._target, t)
            }, pause: function () {
                this._paused = !0
            }, resume: function () {
                this._paused = !1
            }
        };
        var It = bt.prototype;

        function _t(e) {
            this._list = new bt, this._map = {}, this._maxSize = e || 10, this._lastRemovedEntry = null
        }

        It.insert = function (e) {
            var t = new At(e);
            return this.insertEntry(t), t
        }, It.insertEntry = function (e) {
            this.head ? ((this.tail.next = e).prev = this.tail, e.next = null, this.tail = e) : this.head = this.tail = e, this._len++
        }, It.remove = function (e) {
            var t = e.prev, i = e.next;
            t ? t.next = i : this.head = i, i ? i.prev = t : this.tail = t, e.next = e.prev = null, this._len--
        }, It.len = function () {
            return this._len
        }, It.clear = function () {
            this.head = this.tail = null, this._len = 0
        };
        var At = function (e) {
            this.value = e, this.next, this.prev
        }, Dt = _t.prototype;
        Dt.put = function (e, t) {
            var i = this._list, n = this._map, a = null;
            if (null == n[e]) {
                var o = i.len(), r = this._lastRemovedEntry;
                if (o >= this._maxSize && 0 < o) {
                    var s = i.head;
                    i.remove(s), delete n[s.key], a = s.value, this._lastRemovedEntry = s
                }
                r ? r.value = t : r = new At(t), r.key = e, i.insertEntry(r), n[e] = r
            }
            return a
        }, Dt.get = function (e) {
            var t = this._map[e], i = this._list;
            if (null != t) return t !== i.tail && (i.remove(t), i.insertEntry(t)), t.value
        }, Dt.clear = function () {
            this._list.clear(), this._map = {}
        };
        var xt = {
            transparent: [0, 0, 0, 0],
            aliceblue: [240, 248, 255, 1],
            antiquewhite: [250, 235, 215, 1],
            aqua: [0, 255, 255, 1],
            aquamarine: [127, 255, 212, 1],
            azure: [240, 255, 255, 1],
            beige: [245, 245, 220, 1],
            bisque: [255, 228, 196, 1],
            black: [0, 0, 0, 1],
            blanchedalmond: [255, 235, 205, 1],
            blue: [0, 0, 255, 1],
            blueviolet: [138, 43, 226, 1],
            brown: [165, 42, 42, 1],
            burlywood: [222, 184, 135, 1],
            cadetblue: [95, 158, 160, 1],
            chartreuse: [127, 255, 0, 1],
            chocolate: [210, 105, 30, 1],
            coral: [255, 127, 80, 1],
            cornflowerblue: [100, 149, 237, 1],
            cornsilk: [255, 248, 220, 1],
            crimson: [220, 20, 60, 1],
            cyan: [0, 255, 255, 1],
            darkblue: [0, 0, 139, 1],
            darkcyan: [0, 139, 139, 1],
            darkgoldenrod: [184, 134, 11, 1],
            darkgray: [169, 169, 169, 1],
            darkgreen: [0, 100, 0, 1],
            darkgrey: [169, 169, 169, 1],
            darkkhaki: [189, 183, 107, 1],
            darkmagenta: [139, 0, 139, 1],
            darkolivegreen: [85, 107, 47, 1],
            darkorange: [255, 140, 0, 1],
            darkorchid: [153, 50, 204, 1],
            darkred: [139, 0, 0, 1],
            darksalmon: [233, 150, 122, 1],
            darkseagreen: [143, 188, 143, 1],
            darkslateblue: [72, 61, 139, 1],
            darkslategray: [47, 79, 79, 1],
            darkslategrey: [47, 79, 79, 1],
            darkturquoise: [0, 206, 209, 1],
            darkviolet: [148, 0, 211, 1],
            deeppink: [255, 20, 147, 1],
            deepskyblue: [0, 191, 255, 1],
            dimgray: [105, 105, 105, 1],
            dimgrey: [105, 105, 105, 1],
            dodgerblue: [30, 144, 255, 1],
            firebrick: [178, 34, 34, 1],
            floralwhite: [255, 250, 240, 1],
            forestgreen: [34, 139, 34, 1],
            fuchsia: [255, 0, 255, 1],
            gainsboro: [220, 220, 220, 1],
            ghostwhite: [248, 248, 255, 1],
            gold: [255, 215, 0, 1],
            goldenrod: [218, 165, 32, 1],
            gray: [128, 128, 128, 1],
            green: [0, 128, 0, 1],
            greenyellow: [173, 255, 47, 1],
            grey: [128, 128, 128, 1],
            honeydew: [240, 255, 240, 1],
            hotpink: [255, 105, 180, 1],
            indianred: [205, 92, 92, 1],
            indigo: [75, 0, 130, 1],
            ivory: [255, 255, 240, 1],
            khaki: [240, 230, 140, 1],
            lavender: [230, 230, 250, 1],
            lavenderblush: [255, 240, 245, 1],
            lawngreen: [124, 252, 0, 1],
            lemonchiffon: [255, 250, 205, 1],
            lightblue: [173, 216, 230, 1],
            lightcoral: [240, 128, 128, 1],
            lightcyan: [224, 255, 255, 1],
            lightgoldenrodyellow: [250, 250, 210, 1],
            lightgray: [211, 211, 211, 1],
            lightgreen: [144, 238, 144, 1],
            lightgrey: [211, 211, 211, 1],
            lightpink: [255, 182, 193, 1],
            lightsalmon: [255, 160, 122, 1],
            lightseagreen: [32, 178, 170, 1],
            lightskyblue: [135, 206, 250, 1],
            lightslategray: [119, 136, 153, 1],
            lightslategrey: [119, 136, 153, 1],
            lightsteelblue: [176, 196, 222, 1],
            lightyellow: [255, 255, 224, 1],
            lime: [0, 255, 0, 1],
            limegreen: [50, 205, 50, 1],
            linen: [250, 240, 230, 1],
            magenta: [255, 0, 255, 1],
            maroon: [128, 0, 0, 1],
            mediumaquamarine: [102, 205, 170, 1],
            mediumblue: [0, 0, 205, 1],
            mediumorchid: [186, 85, 211, 1],
            mediumpurple: [147, 112, 219, 1],
            mediumseagreen: [60, 179, 113, 1],
            mediumslateblue: [123, 104, 238, 1],
            mediumspringgreen: [0, 250, 154, 1],
            mediumturquoise: [72, 209, 204, 1],
            mediumvioletred: [199, 21, 133, 1],
            midnightblue: [25, 25, 112, 1],
            mintcream: [245, 255, 250, 1],
            mistyrose: [255, 228, 225, 1],
            moccasin: [255, 228, 181, 1],
            navajowhite: [255, 222, 173, 1],
            navy: [0, 0, 128, 1],
            oldlace: [253, 245, 230, 1],
            olive: [128, 128, 0, 1],
            olivedrab: [107, 142, 35, 1],
            orange: [255, 165, 0, 1],
            orangered: [255, 69, 0, 1],
            orchid: [218, 112, 214, 1],
            palegoldenrod: [238, 232, 170, 1],
            palegreen: [152, 251, 152, 1],
            paleturquoise: [175, 238, 238, 1],
            palevioletred: [219, 112, 147, 1],
            papayawhip: [255, 239, 213, 1],
            peachpuff: [255, 218, 185, 1],
            peru: [205, 133, 63, 1],
            pink: [255, 192, 203, 1],
            plum: [221, 160, 221, 1],
            powderblue: [176, 224, 230, 1],
            purple: [128, 0, 128, 1],
            red: [255, 0, 0, 1],
            rosybrown: [188, 143, 143, 1],
            royalblue: [65, 105, 225, 1],
            saddlebrown: [139, 69, 19, 1],
            salmon: [250, 128, 114, 1],
            sandybrown: [244, 164, 96, 1],
            seagreen: [46, 139, 87, 1],
            seashell: [255, 245, 238, 1],
            sienna: [160, 82, 45, 1],
            silver: [192, 192, 192, 1],
            skyblue: [135, 206, 235, 1],
            slateblue: [106, 90, 205, 1],
            slategray: [112, 128, 144, 1],
            slategrey: [112, 128, 144, 1],
            snow: [255, 250, 250, 1],
            springgreen: [0, 255, 127, 1],
            steelblue: [70, 130, 180, 1],
            tan: [210, 180, 140, 1],
            teal: [0, 128, 128, 1],
            thistle: [216, 191, 216, 1],
            tomato: [255, 99, 71, 1],
            turquoise: [64, 224, 208, 1],
            violet: [238, 130, 238, 1],
            wheat: [245, 222, 179, 1],
            white: [255, 255, 255, 1],
            whitesmoke: [245, 245, 245, 1],
            yellow: [255, 255, 0, 1],
            yellowgreen: [154, 205, 50, 1]
        };

        function Nt(e) {
            return (e = Math.round(e)) < 0 ? 0 : 255 < e ? 255 : e
        }

        function Et(e) {
            return e < 0 ? 0 : 1 < e ? 1 : e
        }

        function Pt(e) {
            return e.length && "%" === e.charAt(e.length - 1) ? Nt(parseFloat(e) / 100 * 255) : Nt(parseInt(e, 10))
        }

        function Mt(e) {
            return e.length && "%" === e.charAt(e.length - 1) ? Et(parseFloat(e) / 100) : Et(parseFloat(e))
        }

        function Ot(e, t, i) {
            return i < 0 ? i += 1 : 1 < i && (i -= 1), 6 * i < 1 ? e + (t - e) * i * 6 : 2 * i < 1 ? t : 3 * i < 2 ? e + (t - e) * (2 / 3 - i) * 6 : e
        }

        function Ft(e, t, i) {
            return e + (t - e) * i
        }

        function Lt(e, t, i, n, a) {
            return e[0] = t, e[1] = i, e[2] = n, e[3] = a, e
        }

        function Bt(e, t) {
            return e[0] = t[0], e[1] = t[1], e[2] = t[2], e[3] = t[3], e
        }

        var Ut = new _t(20), Rt = null;

        function Kt(e, t) {
            Rt && Bt(Rt, t), Rt = Ut.put(e, Rt || t.slice())
        }

        function Wt(e, t) {
            if (e) {
                t = t || [];
                var i = Ut.get(e);
                if (i) return Bt(t, i);
                var n, a = (e += "").replace(/ /g, "").toLowerCase();
                if (a in xt) return Bt(t, xt[a]), Kt(e, t), t;
                if ("#" === a.charAt(0)) return 4 === a.length ? 0 <= (n = parseInt(a.substr(1), 16)) && n <= 4095 ? (Lt(t, (3840 & n) >> 4 | (3840 & n) >> 8, 240 & n | (240 & n) >> 4, 15 & n | (15 & n) << 4, 1), Kt(e, t), t) : void Lt(t, 0, 0, 0, 1) : 7 === a.length ? 0 <= (n = parseInt(a.substr(1), 16)) && n <= 16777215 ? (Lt(t, (16711680 & n) >> 16, (65280 & n) >> 8, 255 & n, 1), Kt(e, t), t) : void Lt(t, 0, 0, 0, 1) : void 0;
                var o = a.indexOf("("), r = a.indexOf(")");
                if (-1 !== o && r + 1 === a.length) {
                    var s = a.substr(0, o), l = a.substr(o + 1, r - (o + 1)).split(","), d = 1;
                    switch (s) {
                        case"rgba":
                            if (4 !== l.length) return void Lt(t, 0, 0, 0, 1);
                            d = Mt(l.pop());
                        case"rgb":
                            return 3 !== l.length ? void Lt(t, 0, 0, 0, 1) : (Lt(t, Pt(l[0]), Pt(l[1]), Pt(l[2]), d), Kt(e, t), t);
                        case"hsla":
                            return 4 !== l.length ? void Lt(t, 0, 0, 0, 1) : (l[3] = Mt(l[3]), Vt(l, t), Kt(e, t), t);
                        case"hsl":
                            return 3 !== l.length ? void Lt(t, 0, 0, 0, 1) : (Vt(l, t), Kt(e, t), t);
                        default:
                            return
                    }
                }
                Lt(t, 0, 0, 0, 1)
            }
        }

        function Vt(e, t) {
            var i = (parseFloat(e[0]) % 360 + 360) % 360 / 360, n = Mt(e[1]), a = Mt(e[2]),
                o = a <= .5 ? a * (n + 1) : a + n - a * n, r = 2 * a - o;
            return Lt(t = t || [], Nt(255 * Ot(r, o, i + 1 / 3)), Nt(255 * Ot(r, o, i)), Nt(255 * Ot(r, o, i - 1 / 3)), 1), 4 === e.length && (t[3] = e[3]), t
        }

        function Ht(e, t) {
            var i = Wt(e);
            if (i) {
                for (var n = 0; n < 3; n++) i[n] = t < 0 ? i[n] * (1 - t) | 0 : (255 - i[n]) * t + i[n] | 0, 255 < i[n] ? i[n] = 255 : e[n] < 0 && (i[n] = 0);
                return Jt(i, 4 === i.length ? "rgba" : "rgb")
            }
        }

        function zt(e) {
            var t = Wt(e);
            if (t) return ((1 << 24) + (t[0] << 16) + (t[1] << 8) + +t[2]).toString(16).slice(1)
        }

        function jt(e, t, i) {
            if (t && t.length && 0 <= e && e <= 1) {
                i = i || [];
                var n = e * (t.length - 1), a = Math.floor(n), o = Math.ceil(n), r = t[a], s = t[o], l = n - a;
                return i[0] = Nt(Ft(r[0], s[0], l)), i[1] = Nt(Ft(r[1], s[1], l)), i[2] = Nt(Ft(r[2], s[2], l)), i[3] = Et(Ft(r[3], s[3], l)), i
            }
        }

        var Gt = jt;

        function $t(e, t, i) {
            if (t && t.length && 0 <= e && e <= 1) {
                var n = e * (t.length - 1), a = Math.floor(n), o = Math.ceil(n), r = Wt(t[a]), s = Wt(t[o]), l = n - a,
                    d = Jt([Nt(Ft(r[0], s[0], l)), Nt(Ft(r[1], s[1], l)), Nt(Ft(r[2], s[2], l)), Et(Ft(r[3], s[3], l))], "rgba");
                return i ? {color: d, leftIndex: a, rightIndex: o, value: n} : d
            }
        }

        var Xt = $t;

        function qt(e, t, i, n) {
            if (e = Wt(e)) return e = function (e) {
                if (e) {
                    var t, i, n = e[0] / 255, a = e[1] / 255, o = e[2] / 255, r = Math.min(n, a, o),
                        s = Math.max(n, a, o), l = s - r, d = (s + r) / 2;
                    if (0 == l) i = t = 0; else {
                        i = d < .5 ? l / (s + r) : l / (2 - s - r);
                        var u = ((s - n) / 6 + l / 2) / l, c = ((s - a) / 6 + l / 2) / l, h = ((s - o) / 6 + l / 2) / l;
                        n === s ? t = h - c : a === s ? t = 1 / 3 + u - h : o === s && (t = 2 / 3 + c - u), t < 0 && (t += 1), 1 < t && (t -= 1)
                    }
                    var f = [360 * t, i, d];
                    return null != e[3] && f.push(e[3]), f
                }
            }(e), null != t && (e[0] = function (e) {
                return (e = Math.round(e)) < 0 ? 0 : 360 < e ? 360 : e
            }(t)), null != i && (e[1] = Mt(i)), null != n && (e[2] = Mt(n)), Jt(Vt(e), "rgba")
        }

        function Yt(e, t) {
            if ((e = Wt(e)) && null != t) return e[3] = Et(t), Jt(e, "rgba")
        }

        function Jt(e, t) {
            if (e && e.length) {
                var i = e[0] + "," + e[1] + "," + e[2];
                return "rgba" !== t && "hsva" !== t && "hsla" !== t || (i += "," + e[3]), t + "(" + i + ")"
            }
        }

        var Zt = (Object.freeze || Object)({
            parse: Wt,
            lift: Ht,
            toHex: zt,
            fastLerp: jt,
            fastMapToColor: Gt,
            lerp: $t,
            mapToColor: Xt,
            modifyHSL: qt,
            modifyAlpha: Yt,
            stringify: Jt
        }), Qt = Array.prototype.slice;

        function ei(e, t) {
            return e[t]
        }

        function ti(e, t, i) {
            e[t] = i
        }

        function ii(e, t, i) {
            return (t - e) * i + e
        }

        function ni(e, t, i) {
            return .5 < i ? t : e
        }

        function ai(e, t, i, n, a) {
            var o = e.length;
            if (1 === a) for (var r = 0; r < o; r++) n[r] = ii(e[r], t[r], i); else {
                var s = o && e[0].length;
                for (r = 0; r < o; r++) for (var l = 0; l < s; l++) n[r][l] = ii(e[r][l], t[r][l], i)
            }
        }

        function oi(e, t, i) {
            var n = e.length, a = t.length;
            if (n !== a) if (a < n) e.length = a; else for (var o = n; o < a; o++) e.push(1 === i ? t[o] : Qt.call(t[o]));
            var r = e[0] && e[0].length;
            for (o = 0; o < e.length; o++) if (1 === i) isNaN(e[o]) && (e[o] = t[o]); else for (var s = 0; s < r; s++) isNaN(e[o][s]) && (e[o][s] = t[o][s])
        }

        function ri(e, t, i) {
            if (e === t) return !0;
            var n = e.length;
            if (n !== t.length) return !1;
            if (1 === i) {
                for (var a = 0; a < n; a++) if (e[a] !== t[a]) return !1
            } else {
                var o = e[0].length;
                for (a = 0; a < n; a++) for (var r = 0; r < o; r++) if (e[a][r] !== t[a][r]) return !1
            }
            return !0
        }

        function si(e, t, i, n, a, o, r, s, l) {
            var d = e.length;
            if (1 === l) for (var u = 0; u < d; u++) s[u] = li(e[u], t[u], i[u], n[u], a, o, r); else {
                var c = e[0].length;
                for (u = 0; u < d; u++) for (var h = 0; h < c; h++) s[u][h] = li(e[u][h], t[u][h], i[u][h], n[u][h], a, o, r)
            }
        }

        function li(e, t, i, n, a, o, r) {
            var s = .5 * (i - e), l = .5 * (n - t);
            return (2 * (t - i) + s + l) * r + (-3 * (t - i) - 2 * s - l) * o + s * a + t
        }

        function di(e) {
            if (_(e)) {
                var t = e.length;
                if (_(e[0])) {
                    for (var i = [], n = 0; n < t; n++) i.push(Qt.call(e[n]));
                    return i
                }
                return Qt.call(e)
            }
            return e
        }

        function ui(e) {
            return e[0] = Math.floor(e[0]), e[1] = Math.floor(e[1]), e[2] = Math.floor(e[2]), "rgba(" + e.join(",") + ")"
        }

        function ci(e, t, i, n, a, o) {
            var r = e._getter, s = e._setter, l = "spline" === t, d = n.length;
            if (d) {
                var u, c = _(n[0].value), h = !1, f = !1, g = c ? function (e) {
                    var t = e[e.length - 1].value;
                    return _(t && t[0]) ? 2 : 1
                }(n) : 0;
                n.sort(function (e, t) {
                    return e.time - t.time
                }), u = n[d - 1].time;
                for (var p = [], v = [], m = n[0].value, y = !0, k = 0; k < d; k++) {
                    p.push(n[k].time / u);
                    var T = n[k].value;
                    if (c && ri(T, m, g) || !c && T === m || (y = !1), "string" == typeof (m = T)) {
                        var w = Wt(T);
                        w ? (T = w, h = !0) : f = !0
                    }
                    v.push(T)
                }
                if (o || !y) {
                    var C = v[d - 1];
                    for (k = 0; k < d - 1; k++) c ? oi(v[k], C, g) : !isNaN(v[k]) || isNaN(C) || f || h || (v[k] = C);
                    c && oi(r(e._target, a), C, g);
                    var S, b, I, A, D, x = 0, N = 0;
                    if (h) var E = [0, 0, 0, 0];
                    var P = new St({
                        target: e._target,
                        life: u,
                        loop: e._loop,
                        delay: e._delay,
                        onframe: function (e, t) {
                            var i;
                            if (t < 0) i = 0; else if (t < N) {
                                for (i = Math.min(x + 1, d - 1); 0 <= i && !(p[i] <= t); i--) ;
                                i = Math.min(i, d - 2)
                            } else {
                                for (i = x; i < d && !(p[i] > t); i++) ;
                                i = Math.min(i - 1, d - 2)
                            }
                            N = t;
                            var n = p[(x = i) + 1] - p[i];
                            if (0 != n) if (S = (t - p[i]) / n, l) if (I = v[i], b = v[0 === i ? i : i - 1], A = v[d - 2 < i ? d - 1 : i + 1], D = v[d - 3 < i ? d - 1 : i + 2], c) si(b, I, A, D, S, S * S, S * S * S, r(e, a), g); else {
                                if (h) o = si(b, I, A, D, S, S * S, S * S * S, E, 1), o = ui(E); else {
                                    if (f) return ni(I, A, S);
                                    o = li(b, I, A, D, S, S * S, S * S * S)
                                }
                                s(e, a, o)
                            } else if (c) ai(v[i], v[i + 1], S, r(e, a), g); else {
                                var o;
                                if (h) ai(v[i], v[i + 1], S, E, 1), o = ui(E); else {
                                    if (f) return ni(v[i], v[i + 1], S);
                                    o = ii(v[i], v[i + 1], S)
                                }
                                s(e, a, o)
                            }
                        },
                        ondestroy: i
                    });
                    return t && "spline" !== t && (P.easing = t), P
                }
            }
        }

        function hi(e, t, i, n) {
            this._tracks = {}, this._target = e, this._loop = t || !1, this._getter = i || ei, this._setter = n || ti, this._clipCount = 0, this._delay = 0, this._doneList = [], this._onframeList = [], this._clipList = []
        }

        hi.prototype = {
            when: function (e, t) {
                var i = this._tracks;
                for (var n in t) if (t.hasOwnProperty(n)) {
                    if (!i[n]) {
                        i[n] = [];
                        var a = this._getter(this._target, n);
                        if (null == a) continue;
                        0 !== e && i[n].push({time: 0, value: di(a)})
                    }
                    i[n].push({time: e, value: t[n]})
                }
                return this
            }, during: function (e) {
                return this._onframeList.push(e), this
            }, pause: function () {
                for (var e = 0; e < this._clipList.length; e++) this._clipList[e].pause();
                this._paused = !0
            }, resume: function () {
                for (var e = 0; e < this._clipList.length; e++) this._clipList[e].resume();
                this._paused = !1
            }, isPaused: function () {
                return !!this._paused
            }, _doneCallback: function () {
                this._tracks = {}, this._clipList.length = 0;
                for (var e = this._doneList, t = e.length, i = 0; i < t; i++) e[i].call(this)
            }, start: function (e, t) {
                function i() {
                    --o || a._doneCallback()
                }

                var n, a = this, o = 0;
                for (var r in this._tracks) if (this._tracks.hasOwnProperty(r)) {
                    var s = ci(this, e, i, this._tracks[r], r, t);
                    s && (this._clipList.push(s), o++, this.animation && this.animation.addClip(s), n = s)
                }
                if (n) {
                    var l = n.onframe;
                    n.onframe = function (e, t) {
                        l(e, t);
                        for (var i = 0; i < a._onframeList.length; i++) a._onframeList[i](e, t)
                    }
                }
                return o || this._doneCallback(), this
            }, stop: function (e) {
                for (var t = this._clipList, i = this.animation, n = 0; n < t.length; n++) {
                    var a = t[n];
                    e && a.onframe(this._target, 1), i && i.removeClip(a)
                }
                t.length = 0
            }, delay: function (e) {
                return this._delay = e, this
            }, done: function (e) {
                return e && this._doneList.push(e), this
            }, getClips: function () {
                return this._clipList
            }
        };
        var fi = 1;
        "undefined" != typeof window && (fi = Math.max(window.devicePixelRatio || 1, 1));
        var gi = fi;

        function pi() {
            this.animators = []
        }

        var vi = function () {
        };

        function mi(e, t, i, n, a, o, r, s) {
            L(n) ? (o = a, a = n, n = 0) : F(a) ? (o = a, a = "linear", n = 0) : F(n) ? (o = n, n = 0) : i = F(i) ? (o = i, 500) : i || 500, e.stopAnimation(), function e(t, i, n, a, o, r, s) {
                var l = {}, d = 0;
                for (var u in a) a.hasOwnProperty(u) && (null != n[u] ? B(a[u]) && !_(a[u]) ? e(t, i ? i + "." + u : u, n[u], a[u], o, r, s) : (s ? (l[u] = n[u], yi(t, i, u, a[u])) : l[u] = a[u], d++) : null == a[u] || s || yi(t, i, u, a[u]));
                0 < d && t.animate(i, !1).when(null == o ? 500 : o, l).delay(r || 0)
            }(e, "", e, t, i, n, s);
            var l = e.animators.slice(), d = l.length;

            function u() {
                --d || o && o()
            }

            d || o && o();
            for (var c = 0; c < l.length; c++) l[c].done(u).start(a, r)
        }

        function yi(e, t, i, n) {
            if (t) {
                var a = {};
                a[t] = {}, a[t][i] = n, e.attr(a)
            } else e.attr(i, n)
        }

        pi.prototype = {
            constructor: pi, animate: function (e, t) {
                var i, n = !1, a = this, o = this.__zr;
                if (e) {
                    var r = e.split("."), s = a;
                    n = "shape" === r[0];
                    for (var l = 0, d = r.length; l < d; l++) s = s && s[r[l]];
                    s && (i = s)
                } else i = a;
                if (i) {
                    var u = a.animators, c = new hi(i, t);
                    return c.during(function (e) {
                        a.dirty(n)
                    }).done(function () {
                        u.splice(S(u, c), 1)
                    }), u.push(c), o && o.animation.addAnimator(c), c
                }
                vi('Property "' + e + '" is not existed in element ' + a.id)
            }, stopAnimation: function (e) {
                for (var t = this.animators, i = t.length, n = 0; n < i; n++) t[n].stop(e);
                return t.length = 0, this
            }, animateTo: function (e, t, i, n, a, o) {
                mi(this, e, t, i, n, a, o)
            }, animateFrom: function (e, t, i, n, a, o) {
                mi(this, e, t, i, n, a, o, !0)
            }
        };
        var ki = function (e) {
            mt.call(this, e), xe.call(this, e), pi.call(this, e), this.id = e.id || n()
        };
        ki.prototype = {
            type: "element",
            name: "",
            __zr: null,
            ignore: !1,
            clipPath: null,
            isGroup: !1,
            drift: function (e, t) {
                switch (this.draggable) {
                    case"horizontal":
                        t = 0;
                        break;
                    case"vertical":
                        e = 0
                }
                var i = this.transform;
                (i = i || (this.transform = [1, 0, 0, 1, 0, 0]))[4] += e, i[5] += t, this.decomposeTransform(), this.dirty(!1)
            },
            beforeUpdate: function () {
            },
            afterUpdate: function () {
            },
            update: function () {
                this.updateTransform()
            },
            traverse: function (e, t) {
            },
            attrKV: function (e, t) {
                if ("position" === e || "scale" === e || "origin" === e) {
                    if (t) {
                        var i = this[e];
                        (i = i || (this[e] = []))[0] = t[0], i[1] = t[1]
                    }
                } else this[e] = t
            },
            hide: function () {
                this.ignore = !0, this.__zr && this.__zr.refresh()
            },
            show: function () {
                this.ignore = !1, this.__zr && this.__zr.refresh()
            },
            attr: function (e, t) {
                if ("string" == typeof e) this.attrKV(e, t); else if (B(e)) for (var i in e) e.hasOwnProperty(i) && this.attrKV(i, e[i]);
                return this.dirty(!1), this
            },
            setClipPath: function (e) {
                var t = this.__zr;
                t && e.addSelfToZr(t), this.clipPath && this.clipPath !== e && this.removeClipPath(), (this.clipPath = e).__zr = t, (e.__clipTarget = this).dirty(!1)
            },
            removeClipPath: function () {
                var e = this.clipPath;
                e && (e.__zr && e.removeSelfFromZr(e.__zr), e.__zr = null, e.__clipTarget = null, this.clipPath = null, this.dirty(!1))
            },
            addSelfToZr: function (e) {
                this.__zr = e;
                var t = this.animators;
                if (t) for (var i = 0; i < t.length; i++) e.animation.addAnimator(t[i]);
                this.clipPath && this.clipPath.addSelfToZr(e)
            },
            removeSelfFromZr: function (e) {
                this.__zr = null;
                var t = this.animators;
                if (t) for (var i = 0; i < t.length; i++) e.animation.removeAnimator(t[i]);
                this.clipPath && this.clipPath.removeSelfFromZr(e)
            }
        }, I(ki, pi), I(ki, mt), I(ki, xe);
        var Ti, wi, Ci, Si, bi = Ce, Ii = Math.min, _i = Math.max;

        function Ai(e, t, i, n) {
            i < 0 && (e += i, i = -i), n < 0 && (t += n, n = -n), this.x = e, this.y = t, this.width = i, this.height = n
        }

        Ai.prototype = {
            constructor: Ai, union: function (e) {
                var t = Ii(e.x, this.x), i = Ii(e.y, this.y);
                this.width = _i(e.x + e.width, this.x + this.width) - t, this.height = _i(e.y + e.height, this.y + this.height) - i, this.x = t, this.y = i
            }, applyTransform: (Ti = [], wi = [], Ci = [], Si = [], function (e) {
                if (e) {
                    Ti[0] = Ci[0] = this.x, Ti[1] = Si[1] = this.y, wi[0] = Si[0] = this.x + this.width, wi[1] = Ci[1] = this.y + this.height, bi(Ti, Ti, e), bi(wi, wi, e), bi(Ci, Ci, e), bi(Si, Si, e), this.x = Ii(Ti[0], wi[0], Ci[0], Si[0]), this.y = Ii(Ti[1], wi[1], Ci[1], Si[1]);
                    var t = _i(Ti[0], wi[0], Ci[0], Si[0]), i = _i(Ti[1], wi[1], Ci[1], Si[1]);
                    this.width = t - this.x, this.height = i - this.y
                }
            }), calculateTransform: function (e) {
                var t = e.width / this.width, i = e.height / this.height, n = ot();
                return dt(n, n, [-this.x, -this.y]), ct(n, n, [t, i]), dt(n, n, [e.x, e.y]), n
            }, intersect: function (e) {
                if (!e) return !1;
                e instanceof Ai || (e = Ai.create(e));
                var t = this, i = t.x, n = t.x + t.width, a = t.y, o = t.y + t.height, r = e.x, s = e.x + e.width,
                    l = e.y, d = e.y + e.height;
                return !(n < r || s < i || o < l || d < a)
            }, contain: function (e, t) {
                var i = this;
                return e >= i.x && e <= i.x + i.width && t >= i.y && t <= i.y + i.height
            }, clone: function () {
                return new Ai(this.x, this.y, this.width, this.height)
            }, copy: function (e) {
                this.x = e.x, this.y = e.y, this.width = e.width, this.height = e.height
            }, plain: function () {
                return {x: this.x, y: this.y, width: this.width, height: this.height}
            }
        }, Ai.create = function (e) {
            return new Ai(e.x, e.y, e.width, e.height)
        };
        var Di = function (e) {
            for (var t in e = e || {}, ki.call(this, e), e) e.hasOwnProperty(t) && (this[t] = e[t]);
            this._children = [], this.__storage = null, this.__dirty = !0
        };
        Di.prototype = {
            constructor: Di, isGroup: !0, type: "group", silent: !1, children: function () {
                return this._children.slice()
            }, childAt: function (e) {
                return this._children[e]
            }, childOfName: function (e) {
                for (var t = this._children, i = 0; i < t.length; i++) if (t[i].name === e) return t[i]
            }, childCount: function () {
                return this._children.length
            }, add: function (e) {
                return e && e !== this && e.parent !== this && (this._children.push(e), this._doAdd(e)), this
            }, addBefore: function (e, t) {
                if (e && e !== this && e.parent !== this && t && t.parent === this) {
                    var i = this._children, n = i.indexOf(t);
                    0 <= n && (i.splice(n, 0, e), this._doAdd(e))
                }
                return this
            }, _doAdd: function (e) {
                e.parent && e.parent.remove(e);
                var t = (e.parent = this).__storage, i = this.__zr;
                t && t !== e.__storage && (t.addToStorage(e), e instanceof Di && e.addChildrenToStorage(t)), i && i.refresh()
            }, remove: function (e) {
                var t = this.__zr, i = this.__storage, n = this._children, a = S(n, e);
                return a < 0 || (n.splice(a, 1), e.parent = null, i && (i.delFromStorage(e), e instanceof Di && e.delChildrenFromStorage(i)), t && t.refresh()), this
            }, removeAll: function () {
                var e, t, i = this._children, n = this.__storage;
                for (t = 0; t < i.length; t++) e = i[t], n && (n.delFromStorage(e), e instanceof Di && e.delChildrenFromStorage(n)), e.parent = null;
                return i.length = 0, this
            }, eachChild: function (e, t) {
                for (var i = this._children, n = 0; n < i.length; n++) {
                    var a = i[n];
                    e.call(t, a, n)
                }
                return this
            }, traverse: function (e, t) {
                for (var i = 0; i < this._children.length; i++) {
                    var n = this._children[i];
                    e.call(t, n), "group" === n.type && n.traverse(e, t)
                }
                return this
            }, addChildrenToStorage: function (e) {
                for (var t = 0; t < this._children.length; t++) {
                    var i = this._children[t];
                    e.addToStorage(i), i instanceof Di && i.addChildrenToStorage(e)
                }
            }, delChildrenFromStorage: function (e) {
                for (var t = 0; t < this._children.length; t++) {
                    var i = this._children[t];
                    e.delFromStorage(i), i instanceof Di && i.delChildrenFromStorage(e)
                }
            }, dirty: function () {
                return this.__dirty = !0, this.__zr && this.__zr.refresh(), this
            }, getBoundingRect: function (e) {
                for (var t = null, i = new Ai(0, 0, 0, 0), n = e || this._children, a = [], o = 0; o < n.length; o++) {
                    var r = n[o];
                    if (!r.ignore && !r.invisible) {
                        var s = r.getBoundingRect(), l = r.getLocalTransform(a);
                        l ? (i.copy(s), i.applyTransform(l), (t = t || i.clone()).union(i)) : (t = t || s.clone()).union(s)
                    }
                }
                return t || i
            }
        }, b(Di, ki);
        var xi = 32, Ni = 7;

        function Ei(e, t, i, n) {
            var a = t + 1;
            if (a === i) return 1;
            if (n(e[a++], e[t]) < 0) {
                for (; a < i && n(e[a], e[a - 1]) < 0;) a++;
                !function (e, t, i) {
                    for (i--; t < i;) {
                        var n = e[t];
                        e[t++] = e[i], e[i--] = n
                    }
                }(e, t, a)
            } else for (; a < i && 0 <= n(e[a], e[a - 1]);) a++;
            return a - t
        }

        function Pi(e, t, i, n, a) {
            for (n === t && n++; n < i; n++) {
                for (var o, r = e[n], s = t, l = n; s < l;) a(r, e[o = s + l >>> 1]) < 0 ? l = o : s = 1 + o;
                var d = n - s;
                switch (d) {
                    case 3:
                        e[s + 3] = e[s + 2];
                    case 2:
                        e[s + 2] = e[s + 1];
                    case 1:
                        e[s + 1] = e[s];
                        break;
                    default:
                        for (; 0 < d;) e[s + d] = e[s + d - 1], d--
                }
                e[s] = r
            }
        }

        function Mi(e, t, i, n, a, o) {
            var r = 0, s = 0, l = 1;
            if (0 < o(e, t[i + a])) {
                for (s = n - a; l < s && 0 < o(e, t[i + a + l]);) (l = 1 + ((r = l) << 1)) <= 0 && (l = s);
                s < l && (l = s), r += a, l += a
            } else {
                for (s = a + 1; l < s && o(e, t[i + a - l]) <= 0;) (l = 1 + ((r = l) << 1)) <= 0 && (l = s);
                s < l && (l = s);
                var d = r;
                r = a - l, l = a - d
            }
            for (r++; r < l;) {
                var u = r + (l - r >>> 1);
                0 < o(e, t[i + u]) ? r = u + 1 : l = u
            }
            return l
        }

        function Oi(e, t, i, n, a, o) {
            var r = 0, s = 0, l = 1;
            if (o(e, t[i + a]) < 0) {
                for (s = a + 1; l < s && o(e, t[i + a - l]) < 0;) (l = 1 + ((r = l) << 1)) <= 0 && (l = s);
                s < l && (l = s);
                var d = r;
                r = a - l, l = a - d
            } else {
                for (s = n - a; l < s && 0 <= o(e, t[i + a + l]);) (l = 1 + ((r = l) << 1)) <= 0 && (l = s);
                s < l && (l = s), r += a, l += a
            }
            for (r++; r < l;) {
                var u = r + (l - r >>> 1);
                o(e, t[i + u]) < 0 ? l = u : r = u + 1
            }
            return l
        }

        function Fi(e, t, i, n) {
            i = i || 0;
            var a = (n = n || e.length) - i;
            if (!(a < 2)) {
                var o = 0;
                if (a < xi) Pi(e, i, n, i + (o = Ei(e, i, n, t)), t); else {
                    var r = new function (e, t) {
                        var i, n, a = Ni, o = 0, r = [];

                        function s(s) {
                            var l = i[s], d = n[s], u = i[s + 1], c = n[s + 1];
                            n[s] = d + c, s === o - 3 && (i[s + 1] = i[s + 2], n[s + 1] = n[s + 2]), o--;
                            var h = Oi(e[u], e, l, d, 0, t);
                            l += h, 0 != (d -= h) && 0 !== (c = Mi(e[l + d - 1], e, u, c, c - 1, t)) && (d <= c ? function (i, n, o, s) {
                                var l = 0;
                                for (l = 0; l < n; l++) r[l] = e[i + l];
                                var d = 0, u = o, c = i;
                                if (e[c++] = e[u++], 0 != --s) {
                                    if (1 === n) {
                                        for (l = 0; l < s; l++) e[c + l] = e[u + l];
                                        return e[c + s] = r[d]
                                    }
                                    for (var h, f, g, p = a; ;) {
                                        f = h = 0, g = !1;
                                        do {
                                            if (t(e[u], r[d]) < 0) {
                                                if (e[c++] = e[u++], f++, (h = 0) == --s) {
                                                    g = !0;
                                                    break
                                                }
                                            } else if (e[c++] = r[d++], h++, f = 0, 1 == --n) {
                                                g = !0;
                                                break
                                            }
                                        } while ((h | f) < p);
                                        if (g) break;
                                        do {
                                            if (0 !== (h = Oi(e[u], r, d, n, 0, t))) {
                                                for (l = 0; l < h; l++) e[c + l] = r[d + l];
                                                if (c += h, d += h, (n -= h) <= 1) {
                                                    g = !0;
                                                    break
                                                }
                                            }
                                            if (e[c++] = e[u++], 0 == --s) {
                                                g = !0;
                                                break
                                            }
                                            if (0 !== (f = Mi(r[d], e, u, s, 0, t))) {
                                                for (l = 0; l < f; l++) e[c + l] = e[u + l];
                                                if (c += f, u += f, 0 == (s -= f)) {
                                                    g = !0;
                                                    break
                                                }
                                            }
                                            if (e[c++] = r[d++], 1 == --n) {
                                                g = !0;
                                                break
                                            }
                                            p--
                                        } while (Ni <= h || Ni <= f);
                                        if (g) break;
                                        p < 0 && (p = 0), p += 2
                                    }
                                    if ((a = p) < 1 && (a = 1), 1 === n) {
                                        for (l = 0; l < s; l++) e[c + l] = e[u + l];
                                        e[c + s] = r[d]
                                    } else {
                                        if (0 === n) throw new Error;
                                        for (l = 0; l < n; l++) e[c + l] = r[d + l]
                                    }
                                } else for (l = 0; l < n; l++) e[c + l] = r[d + l]
                            }(l, d, u, c) : function (i, n, o, s) {
                                var l = 0;
                                for (l = 0; l < s; l++) r[l] = e[o + l];
                                var d = i + n - 1, u = s - 1, c = o + s - 1, h = 0, f = 0;
                                if (e[c--] = e[d--], 0 != --n) {
                                    if (1 === s) {
                                        for (f = 1 + (c -= n), h = 1 + (d -= n), l = n - 1; 0 <= l; l--) e[f + l] = e[h + l];
                                        return e[c] = r[u]
                                    }
                                    for (var g = a; ;) {
                                        var p = 0, v = 0, m = !1;
                                        do {
                                            if (t(r[u], e[d]) < 0) {
                                                if (e[c--] = e[d--], p++, (v = 0) == --n) {
                                                    m = !0;
                                                    break
                                                }
                                            } else if (e[c--] = r[u--], v++, p = 0, 1 == --s) {
                                                m = !0;
                                                break
                                            }
                                        } while ((p | v) < g);
                                        if (m) break;
                                        do {
                                            if (0 != (p = n - Oi(r[u], e, i, n, n - 1, t))) {
                                                for (n -= p, f = 1 + (c -= p), h = 1 + (d -= p), l = p - 1; 0 <= l; l--) e[f + l] = e[h + l];
                                                if (0 === n) {
                                                    m = !0;
                                                    break
                                                }
                                            }
                                            if (e[c--] = r[u--], 1 == --s) {
                                                m = !0;
                                                break
                                            }
                                            if (0 != (v = s - Mi(e[d], r, 0, s, s - 1, t))) {
                                                for (s -= v, f = 1 + (c -= v), h = 1 + (u -= v), l = 0; l < v; l++) e[f + l] = r[h + l];
                                                if (s <= 1) {
                                                    m = !0;
                                                    break
                                                }
                                            }
                                            if (e[c--] = e[d--], 0 == --n) {
                                                m = !0;
                                                break
                                            }
                                            g--
                                        } while (Ni <= p || Ni <= v);
                                        if (m) break;
                                        g < 0 && (g = 0), g += 2
                                    }
                                    if ((a = g) < 1 && (a = 1), 1 === s) {
                                        for (f = 1 + (c -= n), h = 1 + (d -= n), l = n - 1; 0 <= l; l--) e[f + l] = e[h + l];
                                        e[c] = r[u]
                                    } else {
                                        if (0 === s) throw new Error;
                                        for (h = c - (s - 1), l = 0; l < s; l++) e[h + l] = r[l]
                                    }
                                } else for (h = c - (s - 1), l = 0; l < s; l++) e[h + l] = r[l]
                            }(l, d, u, c))
                        }

                        i = [], n = [], this.mergeRuns = function () {
                            for (; 1 < o;) {
                                var e = o - 2;
                                if (1 <= e && n[e - 1] <= n[e] + n[e + 1] || 2 <= e && n[e - 2] <= n[e] + n[e - 1]) n[e - 1] < n[e + 1] && e--; else if (n[e] > n[e + 1]) break;
                                s(e)
                            }
                        }, this.forceMergeRuns = function () {
                            for (; 1 < o;) {
                                var e = o - 2;
                                0 < e && n[e - 1] < n[e + 1] && e--, s(e)
                            }
                        }, this.pushRun = function (e, t) {
                            i[o] = e, n[o] = t, o += 1
                        }
                    }(e, t), s = function (e) {
                        for (var t = 0; xi <= e;) t |= 1 & e, e >>= 1;
                        return e + t
                    }(a);
                    do {
                        if ((o = Ei(e, i, n, t)) < s) {
                            var l = a;
                            s < l && (l = s), Pi(e, i, i + l, i + o, t), o = l
                        }
                        r.pushRun(i, o), r.mergeRuns(), a -= o, i += o
                    } while (0 !== a);
                    r.forceMergeRuns()
                }
            }
        }

        function Li(e, t) {
            return e.zlevel === t.zlevel ? e.z === t.z ? e.z2 - t.z2 : e.z - t.z : e.zlevel - t.zlevel
        }

        function Bi() {
            this._roots = [], this._displayList = [], this._displayListLen = 0
        }

        Bi.prototype = {
            constructor: Bi, traverse: function (e, t) {
                for (var i = 0; i < this._roots.length; i++) this._roots[i].traverse(e, t)
            }, getDisplayList: function (e, t) {
                return t = t || !1, e && this.updateDisplayList(t), this._displayList
            }, updateDisplayList: function (e) {
                this._displayListLen = 0;
                for (var t = this._roots, i = this._displayList, n = 0, o = t.length; n < o; n++) this._updateAndAddDisplayable(t[n], null, e);
                i.length = this._displayListLen, a.canvasSupported && Fi(i, Li)
            }, _updateAndAddDisplayable: function (e, t, i) {
                if (!e.ignore || i) {
                    e.beforeUpdate(), e.__dirty && e.update(), e.afterUpdate();
                    var n = e.clipPath;
                    if (n) {
                        t = t ? t.slice() : [];
                        for (var a = n, o = e; a;) a.parent = o, a.updateTransform(), t.push(a), a = (o = a).clipPath
                    }
                    if (e.isGroup) {
                        for (var r = e._children, s = 0; s < r.length; s++) {
                            var l = r[s];
                            e.__dirty && (l.__dirty = !0), this._updateAndAddDisplayable(l, t, i)
                        }
                        e.__dirty = !1
                    } else e.__clipPaths = t, this._displayList[this._displayListLen++] = e
                }
            }, addRoot: function (e) {
                e.__storage !== this && (e instanceof Di && e.addChildrenToStorage(this), this.addToStorage(e), this._roots.push(e))
            }, delRoot: function (e) {
                if (null == e) {
                    for (var t = 0; t < this._roots.length; t++) {
                        var i = this._roots[t];
                        i instanceof Di && i.delChildrenFromStorage(this)
                    }
                    return this._roots = [], this._displayList = [], void (this._displayListLen = 0)
                }
                if (e instanceof Array) {
                    t = 0;
                    for (var n = e.length; t < n; t++) this.delRoot(e[t])
                } else {
                    var a = S(this._roots, e);
                    0 <= a && (this.delFromStorage(e), this._roots.splice(a, 1), e instanceof Di && e.delChildrenFromStorage(this))
                }
            }, addToStorage: function (e) {
                return e && (e.__storage = this, e.dirty(!1)), this
            }, delFromStorage: function (e) {
                return e && (e.__storage = null), this
            }, dispose: function () {
                this._renderList = this._roots = null
            }, displayableSortFunc: Li
        };
        var Ui = {
                shadowBlur: 1,
                shadowOffsetX: 1,
                shadowOffsetY: 1,
                textShadowBlur: 1,
                textShadowOffsetX: 1,
                textShadowOffsetY: 1,
                textBoxShadowBlur: 1,
                textBoxShadowOffsetX: 1,
                textBoxShadowOffsetY: 1
            }, Ri = function (e, t, i) {
                return Ui.hasOwnProperty(t) ? i * e.dpr : i
            }, Ki = {NONE: 0, STYLE_BIND: 1, PLAIN_TEXT: 2}, Wi = 9,
            Vi = [["shadowBlur", 0], ["shadowOffsetX", 0], ["shadowOffsetY", 0], ["shadowColor", "#000"], ["lineCap", "butt"], ["lineJoin", "miter"], ["miterLimit", 10]],
            Hi = function (e) {
                this.extendFrom(e, !1)
            };
        Hi.prototype = {
            constructor: Hi,
            fill: "#000",
            stroke: null,
            opacity: 1,
            fillOpacity: null,
            strokeOpacity: null,
            lineDash: null,
            lineDashOffset: 0,
            shadowBlur: 0,
            shadowOffsetX: 0,
            shadowOffsetY: 0,
            lineWidth: 1,
            strokeNoScale: !1,
            text: null,
            font: null,
            textFont: null,
            fontStyle: null,
            fontWeight: null,
            fontSize: null,
            fontFamily: null,
            textTag: null,
            textFill: "#000",
            textStroke: null,
            textWidth: null,
            textHeight: null,
            textStrokeWidth: 0,
            textLineHeight: null,
            textPosition: "inside",
            textRect: null,
            textOffset: null,
            textAlign: null,
            textVerticalAlign: null,
            textDistance: 5,
            textShadowColor: "transparent",
            textShadowBlur: 0,
            textShadowOffsetX: 0,
            textShadowOffsetY: 0,
            textBoxShadowColor: "transparent",
            textBoxShadowBlur: 0,
            textBoxShadowOffsetX: 0,
            textBoxShadowOffsetY: 0,
            transformText: !1,
            textRotation: 0,
            textOrigin: null,
            textBackgroundColor: null,
            textBorderColor: null,
            textBorderWidth: 0,
            textBorderRadius: 0,
            textPadding: null,
            rich: null,
            truncate: null,
            blend: null,
            bind: function (e, t, i) {
                var n = this, a = i && i.style, o = !a || e.__attrCachedBy !== Ki.STYLE_BIND;
                e.__attrCachedBy = Ki.STYLE_BIND;
                for (var r = 0; r < Vi.length; r++) {
                    var s = Vi[r], l = s[0];
                    !o && n[l] === a[l] || (e[l] = Ri(e, l, n[l] || s[1]))
                }
                if (!o && n.fill === a.fill || (e.fillStyle = n.fill), !o && n.stroke === a.stroke || (e.strokeStyle = n.stroke), !o && n.opacity === a.opacity || (e.globalAlpha = null == n.opacity ? 1 : n.opacity), !o && n.blend === a.blend || (e.globalCompositeOperation = n.blend || "source-over"), this.hasStroke()) {
                    var d = n.lineWidth;
                    e.lineWidth = d / (this.strokeNoScale && t && t.getLineScale ? t.getLineScale() : 1)
                }
            },
            hasFill: function () {
                var e = this.fill;
                return null != e && "none" !== e
            },
            hasStroke: function () {
                var e = this.stroke;
                return null != e && "none" !== e && 0 < this.lineWidth
            },
            extendFrom: function (e, t) {
                if (e) for (var i in e) !e.hasOwnProperty(i) || !0 !== t && (!1 === t ? this.hasOwnProperty(i) : null == e[i]) || (this[i] = e[i])
            },
            set: function (e, t) {
                "string" == typeof e ? this[e] = t : this.extendFrom(e, !0)
            },
            clone: function () {
                var e = new this.constructor;
                return e.extendFrom(this, !0), e
            },
            getGradient: function (e, t, i) {
                for (var n = ("radial" === t.type ? function (e, t, i) {
                    var n = i.width, a = i.height, o = Math.min(n, a), r = null == t.x ? .5 : t.x,
                        s = null == t.y ? .5 : t.y, l = null == t.r ? .5 : t.r;
                    return t.global || (r = r * n + i.x, s = s * a + i.y, l *= o), e.createRadialGradient(r, s, 0, r, s, l)
                } : function (e, t, i) {
                    var n = null == t.x ? 0 : t.x, a = null == t.x2 ? 1 : t.x2, o = null == t.y ? 0 : t.y,
                        r = null == t.y2 ? 0 : t.y2;
                    return t.global || (n = n * i.width + i.x, a = a * i.width + i.x, o = o * i.height + i.y, r = r * i.height + i.y), n = isNaN(n) ? 0 : n, a = isNaN(a) ? 1 : a, o = isNaN(o) ? 0 : o, r = isNaN(r) ? 0 : r, e.createLinearGradient(n, o, a, r)
                })(e, t, i), a = t.colorStops, o = 0; o < a.length; o++) n.addColorStop(a[o].offset, a[o].color);
                return n
            }
        };
        for (var zi = Hi.prototype, ji = 0; ji < Vi.length; ji++) {
            var Gi = Vi[ji];
            Gi[0] in zi || (zi[Gi[0]] = Gi[1])
        }

        function $i(e, t) {
            this.image = e, this.repeat = t, this.type = "pattern"
        }

        function Xi() {
            return !1
        }

        function qi(e, t, i) {
            var n = w(), a = t.getWidth(), o = t.getHeight(), r = n.style;
            return r && (r.position = "absolute", r.left = 0, r.top = 0, r.width = a + "px", r.height = o + "px", n.setAttribute("data-zr-dom-id", e)), n.width = a * i, n.height = o * i, n
        }

        function Yi(e, t, i) {
            var n;
            i = i || gi, "string" == typeof e ? n = qi(e, t, i) : B(e) && (e = (n = e).id), this.id = e;
            var a = (this.dom = n).style;
            a && (n.onselectstart = Xi, a["-webkit-user-select"] = "none", a["user-select"] = "none", a["-webkit-touch-callout"] = "none", a["-webkit-tap-highlight-color"] = "rgba(0,0,0,0)", a.padding = 0, a.margin = 0, a["border-width"] = 0), this.domBack = null, this.ctxBack = null, this.painter = t, this.config = null, this.clearColor = 0, this.motionBlur = !1, this.lastFrameAlpha = .7, this.dpr = i
        }

        Hi.getGradient = zi.getGradient, Yi.prototype = {
            constructor: Yi,
            __dirty: !0,
            __used: !($i.prototype.getCanvasPattern = function (e) {
                return e.createPattern(this.image, this.repeat || "repeat")
            }),
            __drawIndex: 0,
            __startIndex: 0,
            __endIndex: 0,
            incremental: !1,
            getElementCount: function () {
                return this.__endIndex - this.__startIndex
            },
            initContext: function () {
                this.ctx = this.dom.getContext("2d"), this.ctx.dpr = this.dpr
            },
            createBackBuffer: function () {
                var e = this.dpr;
                this.domBack = qi("back-" + this.id, this.painter, e), this.ctxBack = this.domBack.getContext("2d"), 1 !== e && this.ctxBack.scale(e, e)
            },
            resize: function (e, t) {
                var i = this.dpr, n = this.dom, a = n.style, o = this.domBack;
                a && (a.width = e + "px", a.height = t + "px"), n.width = e * i, n.height = t * i, o && (o.width = e * i, o.height = t * i, 1 !== i && this.ctxBack.scale(i, i))
            },
            clear: function (e, t) {
                var i, n = this.dom, a = this.ctx, o = n.width, r = n.height,
                    s = (t = t || this.clearColor, this.motionBlur && !e), l = this.lastFrameAlpha, d = this.dpr;
                if (s && (this.domBack || this.createBackBuffer(), this.ctxBack.globalCompositeOperation = "copy", this.ctxBack.drawImage(n, 0, 0, o / d, r / d)), a.clearRect(0, 0, o, r), t && "transparent" !== t && (t.colorStops ? (i = t.__canvasGradient || Hi.getGradient(a, t, {
                    x: 0,
                    y: 0,
                    width: o,
                    height: r
                }), t.__canvasGradient = i) : t.image && (i = $i.prototype.getCanvasPattern.call(t, a)), a.save(), a.fillStyle = i || t, a.fillRect(0, 0, o, r), a.restore()), s) {
                    var u = this.domBack;
                    a.save(), a.globalAlpha = l, a.drawImage(u, 0, 0, o, r), a.restore()
                }
            }
        };
        var Ji = "undefined" != typeof window && (window.requestAnimationFrame && window.requestAnimationFrame.bind(window) || window.msRequestAnimationFrame && window.msRequestAnimationFrame.bind(window) || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame) || function (e) {
            setTimeout(e, 16)
        }, Zi = new _t(50);

        function Qi(e) {
            if ("string" != typeof e) return e;
            var t = Zi.get(e);
            return t && t.image
        }

        function en(e, t, i, n, a) {
            if (e) {
                if ("string" != typeof e) return e;
                if (t && t.__zrImageSrc === e || !i) return t;
                var o = Zi.get(e), r = {hostEl: i, cb: n, cbPayload: a};
                return o ? nn(t = o.image) || o.pending.push(r) : ((t = new Image).onload = t.onerror = tn, Zi.put(e, t.__cachedImgObj = {
                    image: t,
                    pending: [r]
                }), t.src = t.__zrImageSrc = e), t
            }
            return t
        }

        function tn() {
            var e = this.__cachedImgObj;
            this.onload = this.onerror = this.__cachedImgObj = null;
            for (var t = 0; t < e.pending.length; t++) {
                var i = e.pending[t], n = i.cb;
                n && n(this, i.cbPayload), i.hostEl.dirty()
            }
            e.pending.length = 0
        }

        function nn(e) {
            return e && e.width && e.height
        }

        var an = {}, on = 0, rn = 5e3, sn = /\{([a-zA-Z0-9_]+)\|([^}]*)\}/g, ln = "12px sans-serif", dn = {};

        function un(e, t) {
            var i = e + ":" + (t = t || ln);
            if (an[i]) return an[i];
            for (var n, a, o = (e + "").split("\n"), r = 0, s = 0, l = o.length; s < l; s++) r = Math.max((n = o[s], a = t, dn.measureText(n, a)).width, r);
            return rn < on && (on = 0, an = {}), on++, an[i] = r
        }

        function cn(e, t, i, n, a, o, r, s) {
            return r ? function (e, t, i, n, a, o, r, s) {
                var l = wn(e, {rich: r, truncate: s, font: t, textAlign: i, textPadding: a, textLineHeight: o}),
                    d = l.outerWidth, u = l.outerHeight, c = hn(0, d, i), h = fn(0, u, n);
                return new Ai(c, h, d, u)
            }(e, t, i, n, a, o, r, s) : function (e, t, i, n, a, o, r) {
                var s = Tn(e, t, a, o, r), l = un(e, t);
                a && (l += a[1] + a[3]);
                var d = s.outerHeight, u = hn(0, l, i), c = fn(0, d, n), h = new Ai(u, c, l, d);
                return h.lineHeight = s.lineHeight, h
            }(e, t, i, n, a, o, s)
        }

        function hn(e, t, i) {
            return "right" === i ? e -= t : "center" === i && (e -= t / 2), e
        }

        function fn(e, t, i) {
            return "middle" === i ? e -= t / 2 : "bottom" === i && (e -= t), e
        }

        function gn(e, t, i) {
            var n = t.textPosition, a = t.textDistance, o = i.x, r = i.y;
            a = a || 0;
            var s = i.height, l = i.width, d = s / 2, u = "left", c = "top";
            switch (n) {
                case"left":
                    o -= a, r += d, u = "right", c = "middle";
                    break;
                case"right":
                    o += a + l, r += d, c = "middle";
                    break;
                case"top":
                    o += l / 2, r -= a, u = "center", c = "bottom";
                    break;
                case"bottom":
                    o += l / 2, r += s + a, u = "center";
                    break;
                case"inside":
                    o += l / 2, r += d, u = "center", c = "middle";
                    break;
                case"insideLeft":
                    o += a, r += d, c = "middle";
                    break;
                case"insideRight":
                    o += l - a, r += d, u = "right", c = "middle";
                    break;
                case"insideTop":
                    o += l / 2, r += a, u = "center";
                    break;
                case"insideBottom":
                    o += l / 2, r += s - a, u = "center", c = "bottom";
                    break;
                case"insideTopLeft":
                    o += a, r += a;
                    break;
                case"insideTopRight":
                    o += l - a, r += a, u = "right";
                    break;
                case"insideBottomLeft":
                    o += a, r += s - a, c = "bottom";
                    break;
                case"insideBottomRight":
                    o += l - a, r += s - a, u = "right", c = "bottom"
            }
            return (e = e || {}).x = o, e.y = r, e.textAlign = u, e.textVerticalAlign = c, e
        }

        function pn(e, t, i, n, a) {
            if (!t) return "";
            var o = (e + "").split("\n");
            a = vn(t, i, n, a);
            for (var r = 0, s = o.length; r < s; r++) o[r] = mn(o[r], a);
            return o.join("\n")
        }

        function vn(e, t, i, n) {
            (n = k({}, n)).font = t, i = H(i, "..."), n.maxIterations = H(n.maxIterations, 2);
            var a = n.minChar = H(n.minChar, 0);
            n.cnCharWidth = un("国", t);
            var o = n.ascCharWidth = un("a", t);
            n.placeholder = H(n.placeholder, "");
            for (var r = e = Math.max(0, e - 1), s = 0; s < a && o <= r; s++) r -= o;
            var l = un(i, t);
            return r < l && (i = "", l = 0), r = e - l, n.ellipsis = i, n.ellipsisWidth = l, n.contentWidth = r, n.containerWidth = e, n
        }

        function mn(e, t) {
            var i = t.containerWidth, n = t.font, a = t.contentWidth;
            if (!i) return "";
            var o = un(e, n);
            if (o <= i) return e;
            for (var r = 0; ; r++) {
                if (o <= a || r >= t.maxIterations) {
                    e += t.ellipsis;
                    break
                }
                var s = 0 === r ? yn(e, a, t.ascCharWidth, t.cnCharWidth) : 0 < o ? Math.floor(e.length * a / o) : 0;
                o = un(e = e.substr(0, s), n)
            }
            return "" === e && (e = t.placeholder), e
        }

        function yn(e, t, i, n) {
            for (var a = 0, o = 0, r = e.length; o < r && a < t; o++) {
                var s = e.charCodeAt(o);
                a += 0 <= s && s <= 127 ? i : n
            }
            return o
        }

        function kn(e) {
            return un("国", e)
        }

        function Tn(e, t, i, n, a) {
            null != e && (e += "");
            var o = H(n, kn(t)), r = e ? e.split("\n") : [], s = r.length * o, l = s, d = !0;
            if (i && (l += i[0] + i[2]), e && a) {
                d = !1;
                var u = a.outerHeight, c = a.outerWidth;
                if (null != u && u < l) e = "", r = []; else if (null != c) for (var h = vn(c - (i ? i[1] + i[3] : 0), t, a.ellipsis, {
                    minChar: a.minChar,
                    placeholder: a.placeholder
                }), f = 0, g = r.length; f < g; f++) r[f] = mn(r[f], h)
            }
            return {lines: r, height: s, outerHeight: l, lineHeight: o, canCacheByTextString: d}
        }

        function wn(e, t) {
            var i = {lines: [], width: 0, height: 0};
            if (null != e && (e += ""), !e) return i;
            for (var n, a = sn.lastIndex = 0; null != (n = sn.exec(e));) {
                var o = n.index;
                a < o && Cn(i, e.substring(a, o)), Cn(i, n[2], n[1]), a = sn.lastIndex
            }
            a < e.length && Cn(i, e.substring(a, e.length));
            var r = i.lines, s = 0, l = 0, d = [], u = t.textPadding, c = t.truncate, h = c && c.outerWidth,
                f = c && c.outerHeight;
            u && (null != h && (h -= u[1] + u[3]), null != f && (f -= u[0] + u[2]));
            for (var g = 0; g < r.length; g++) {
                for (var p = r[g], v = 0, m = 0, y = 0; y < p.tokens.length; y++) {
                    var k = (x = p.tokens[y]).styleName && t.rich[x.styleName] || {}, T = x.textPadding = k.textPadding,
                        w = x.font = k.font || t.font, C = x.textHeight = H(k.textHeight, kn(w));
                    if (T && (C += T[0] + T[2]), x.height = C, x.lineHeight = z(k.textLineHeight, t.textLineHeight, C), x.textAlign = k && k.textAlign || t.textAlign, x.textVerticalAlign = k && k.textVerticalAlign || "middle", null != f && s + x.lineHeight > f) return {
                        lines: [],
                        width: 0,
                        height: 0
                    };
                    x.textWidth = un(x.text, w);
                    var S = k.textWidth, b = null == S || "auto" === S;
                    if ("string" == typeof S && "%" === S.charAt(S.length - 1)) x.percentWidth = S, d.push(x), S = 0; else {
                        if (b) {
                            S = x.textWidth;
                            var I = k.textBackgroundColor, _ = I && I.image;
                            _ && nn(_ = Qi(_)) && (S = Math.max(S, _.width * C / _.height))
                        }
                        var A = T ? T[1] + T[3] : 0;
                        S += A;
                        var D = null != h ? h - m : null;
                        null != D && D < S && (!b || D < A ? (x.text = "", x.textWidth = S = 0) : (x.text = pn(x.text, D - A, w, c.ellipsis, {minChar: c.minChar}), x.textWidth = un(x.text, w), S = x.textWidth + A))
                    }
                    m += x.width = S, k && (v = Math.max(v, x.lineHeight))
                }
                p.width = m, s += p.lineHeight = v, l = Math.max(l, m)
            }
            for (i.outerWidth = i.width = H(t.textWidth, l), i.outerHeight = i.height = H(t.textHeight, s), u && (i.outerWidth += u[1] + u[3], i.outerHeight += u[0] + u[2]), g = 0; g < d.length; g++) {
                var x, N = (x = d[g]).percentWidth;
                x.width = parseInt(N, 10) / 100 * l
            }
            return i
        }

        function Cn(e, t, i) {
            for (var n = "" === t, a = t.split("\n"), o = e.lines, r = 0; r < a.length; r++) {
                var s = a[r], l = {styleName: i, text: s, isLineHolder: !s && !n};
                if (r) o.push({tokens: [l]}); else {
                    var d = (o[o.length - 1] || (o[0] = {tokens: []})).tokens, u = d.length;
                    1 === u && d[0].isLineHolder ? d[0] = l : !s && u && !n || d.push(l)
                }
            }
        }

        function Sn(e) {
            var t = (e.fontSize || e.fontFamily) && [e.fontStyle, e.fontWeight, (e.fontSize || 12) + "px", e.fontFamily || "sans-serif"].join(" ");
            return t && X(t) || e.textFont || e.font
        }

        function bn(e, t) {
            var i, n, a, o, r, s = t.x, l = t.y, d = t.width, u = t.height, c = t.r;
            d < 0 && (s += d, d = -d), u < 0 && (l += u, u = -u), "number" == typeof c ? i = n = a = o = c : c instanceof Array ? 1 === c.length ? i = n = a = o = c[0] : 2 === c.length ? (i = a = c[0], n = o = c[1]) : 3 === c.length ? (i = c[0], n = o = c[1], a = c[2]) : (i = c[0], n = c[1], a = c[2], o = c[3]) : i = n = a = o = 0, d < i + n && (i *= d / (r = i + n), n *= d / r), d < a + o && (a *= d / (r = a + o), o *= d / r), u < n + a && (n *= u / (r = n + a), a *= u / r), u < i + o && (i *= u / (r = i + o), o *= u / r), e.moveTo(s + i, l), e.lineTo(s + d - n, l), 0 !== n && e.arc(s + d - n, l + n, n, -Math.PI / 2, 0), e.lineTo(s + d, l + u - a), 0 !== a && e.arc(s + d - a, l + u - a, a, 0, Math.PI / 2), e.lineTo(s + o, l + u), 0 !== o && e.arc(s + o, l + u - o, o, Math.PI / 2, Math.PI), e.lineTo(s, l + i), 0 !== i && e.arc(s + i, l + i, i, Math.PI, 1.5 * Math.PI)
        }

        dn.measureText = function (e, t) {
            var i = C();
            return i.font = t || ln, i.measureText(e)
        };
        var In = ln, _n = {left: 1, right: 1, center: 1}, An = {top: 1, bottom: 1, middle: 1},
            Dn = [["textShadowBlur", "shadowBlur", 0], ["textShadowOffsetX", "shadowOffsetX", 0], ["textShadowOffsetY", "shadowOffsetY", 0], ["textShadowColor", "shadowColor", "transparent"]],
            xn = {}, Nn = {};

        function En(e) {
            return Pn(e), A(e.rich, Pn), e
        }

        function Pn(e) {
            if (e) {
                e.font = Sn(e);
                var t = e.textAlign;
                "middle" === t && (t = "center"), e.textAlign = null == t || _n[t] ? t : "left";
                var i = e.textVerticalAlign || e.textBaseline;
                "center" === i && (i = "middle"), e.textVerticalAlign = null == i || An[i] ? i : "top", e.textPadding && (e.textPadding = G(e.textPadding))
            }
        }

        function Mn(e, t, i, n, a, o) {
            n.rich ? function (e, t, i, n, a, o) {
                o !== Wi && (t.__attrCachedBy = Ki.NONE);
                var r = e.__textCotentBlock;
                r && !e.__dirtyText || (r = e.__textCotentBlock = wn(i, n)), function (e, t, i, n, a) {
                    var o = i.width, r = i.outerWidth, s = i.outerHeight, l = n.textPadding, d = Rn(Nn, e, n, a),
                        u = d.baseX, c = d.baseY, h = d.textAlign, f = d.textVerticalAlign;
                    On(t, n, a, u, c);
                    var g = hn(u, r, h), p = fn(c, s, f), v = g, m = p;
                    l && (v += l[3], m += l[0]);
                    var y = v + o;
                    Ln(n) && Bn(e, t, n, g, p, r, s);
                    for (var k = 0; k < i.lines.length; k++) {
                        for (var T, w = i.lines[k], C = w.tokens, S = C.length, b = w.lineHeight, I = w.width, _ = 0, A = v, D = y, x = S - 1; _ < S && (!(T = C[_]).textAlign || "left" === T.textAlign);) Fn(e, t, T, n, b, m, A, "left"), I -= T.width, A += T.width, _++;
                        for (; 0 <= x && "right" === (T = C[x]).textAlign;) Fn(e, t, T, n, b, m, D, "right"), I -= T.width, D -= T.width, x--;
                        for (A += (o - (A - v) - (y - D) - I) / 2; _ <= x;) T = C[_], Fn(e, t, T, n, b, m, A + T.width / 2, "center"), A += T.width, _++;
                        m += b
                    }
                }(e, t, r, n, a)
            }(e, t, i, n, a, o) : function (e, t, i, n, a, o) {
                var r, s = Ln(n), l = !1, d = t.__attrCachedBy === Ki.PLAIN_TEXT;
                o !== Wi ? (o && (r = o.style, l = !s && d && r), t.__attrCachedBy = s ? Ki.NONE : Ki.PLAIN_TEXT) : d && (t.__attrCachedBy = Ki.NONE);
                var u = n.font || In;
                l && u === (r.font || In) || (t.font = u);
                var c = e.__computedFont;
                e.__styleFont !== u && (e.__styleFont = u, c = e.__computedFont = t.font);
                var h = n.textPadding, f = n.textLineHeight, g = e.__textCotentBlock;
                g && !e.__dirtyText || (g = e.__textCotentBlock = Tn(i, c, h, f, n.truncate));
                var p = g.outerHeight, v = g.lines, m = g.lineHeight, y = Rn(Nn, e, n, a), k = y.baseX, T = y.baseY,
                    w = y.textAlign || "left", C = y.textVerticalAlign;
                On(t, n, a, k, T);
                var S = fn(T, p, C), b = k, I = S;
                if (s || h) {
                    var _ = un(i, c);
                    h && (_ += h[1] + h[3]);
                    var A = hn(k, _, w);
                    s && Bn(e, t, n, A, S, _, p), h && (b = zn(k, w, h), I += h[0])
                }
                t.textAlign = w, t.textBaseline = "middle", t.globalAlpha = n.opacity || 1;
                for (var D = 0; D < Dn.length; D++) {
                    var x = Dn[D], N = x[0], E = x[1], P = n[N];
                    l && P === r[N] || (t[E] = Ri(t, E, P || x[2]))
                }
                I += m / 2;
                var M = n.textStrokeWidth, O = l ? r.textStrokeWidth : null, F = !l || M !== O,
                    L = !l || F || n.textStroke !== r.textStroke, B = Wn(n.textStroke, M), U = Vn(n.textFill);
                if (B && (F && (t.lineWidth = M), L && (t.strokeStyle = B)), U && (l && n.textFill === r.textFill || (t.fillStyle = U)), 1 === v.length) B && t.strokeText(v[0], b, I), U && t.fillText(v[0], b, I); else for (D = 0; D < v.length; D++) B && t.strokeText(v[D], b, I), U && t.fillText(v[D], b, I), I += m
            }(e, t, i, n, a, o)
        }

        function On(e, t, i, n, a) {
            if (i && t.textRotation) {
                var o = t.textOrigin;
                "center" === o ? (n = i.width / 2 + i.x, a = i.height / 2 + i.y) : o && (n = o[0] + i.x, a = o[1] + i.y), e.translate(n, a), e.rotate(-t.textRotation), e.translate(-n, -a)
            }
        }

        function Fn(e, t, i, n, a, o, r, s) {
            var l = n.rich[i.styleName] || {};
            l.text = i.text;
            var d = i.textVerticalAlign, u = o + a / 2;
            "top" === d ? u = o + i.height / 2 : "bottom" === d && (u = o + a - i.height / 2), !i.isLineHolder && Ln(l) && Bn(e, t, l, "right" === s ? r - i.width : "center" === s ? r - i.width / 2 : r, u - i.height / 2, i.width, i.height);
            var c = i.textPadding;
            c && (r = zn(r, s, c), u -= i.height / 2 - c[2] - i.textHeight / 2), Kn(t, "shadowBlur", z(l.textShadowBlur, n.textShadowBlur, 0)), Kn(t, "shadowColor", l.textShadowColor || n.textShadowColor || "transparent"), Kn(t, "shadowOffsetX", z(l.textShadowOffsetX, n.textShadowOffsetX, 0)), Kn(t, "shadowOffsetY", z(l.textShadowOffsetY, n.textShadowOffsetY, 0)), Kn(t, "textAlign", s), Kn(t, "textBaseline", "middle"), Kn(t, "font", i.font || In);
            var h = Wn(l.textStroke || n.textStroke, g), f = Vn(l.textFill || n.textFill),
                g = H(l.textStrokeWidth, n.textStrokeWidth);
            h && (Kn(t, "lineWidth", g), Kn(t, "strokeStyle", h), t.strokeText(i.text, r, u)), f && (Kn(t, "fillStyle", f), t.fillText(i.text, r, u))
        }

        function Ln(e) {
            return !!(e.textBackgroundColor || e.textBorderWidth && e.textBorderColor)
        }

        function Bn(e, t, i, n, a, o, r) {
            var s = i.textBackgroundColor, l = i.textBorderWidth, d = i.textBorderColor, u = L(s);
            if (Kn(t, "shadowBlur", i.textBoxShadowBlur || 0), Kn(t, "shadowColor", i.textBoxShadowColor || "transparent"), Kn(t, "shadowOffsetX", i.textBoxShadowOffsetX || 0), Kn(t, "shadowOffsetY", i.textBoxShadowOffsetY || 0), u || l && d) {
                t.beginPath();
                var c = i.textBorderRadius;
                c ? bn(t, {x: n, y: a, width: o, height: r, r: c}) : t.rect(n, a, o, r), t.closePath()
            }
            if (u) if (Kn(t, "fillStyle", s), null != i.fillOpacity) {
                var h = t.globalAlpha;
                t.globalAlpha = i.fillOpacity * i.opacity, t.fill(), t.globalAlpha = h
            } else t.fill(); else if (B(s)) {
                var f = s.image;
                (f = en(f, null, e, Un, s)) && nn(f) && t.drawImage(f, n, a, o, r)
            }
            l && d && (Kn(t, "lineWidth", l), Kn(t, "strokeStyle", d), null != i.strokeOpacity ? (h = t.globalAlpha, t.globalAlpha = i.strokeOpacity * i.opacity, t.stroke(), t.globalAlpha = h) : t.stroke())
        }

        function Un(e, t) {
            t.image = e
        }

        function Rn(e, t, i, n) {
            var a = i.x || 0, o = i.y || 0, r = i.textAlign, s = i.textVerticalAlign;
            if (n) {
                var l = i.textPosition;
                if (l instanceof Array) a = n.x + Hn(l[0], n.width), o = n.y + Hn(l[1], n.height); else {
                    var d = t && t.calculateTextPosition ? t.calculateTextPosition(xn, i, n) : gn(xn, i, n);
                    a = d.x, o = d.y, r = r || d.textAlign, s = s || d.textVerticalAlign
                }
                var u = i.textOffset;
                u && (a += u[0], o += u[1])
            }
            return (e = e || {}).baseX = a, e.baseY = o, e.textAlign = r, e.textVerticalAlign = s, e
        }

        function Kn(e, t, i) {
            return e[t] = Ri(e, t, i), e[t]
        }

        function Wn(e, t) {
            return null == e || t <= 0 || "transparent" === e || "none" === e ? null : e.image || e.colorStops ? "#000" : e
        }

        function Vn(e) {
            return null == e || "none" === e ? null : e.image || e.colorStops ? "#000" : e
        }

        function Hn(e, t) {
            return "string" == typeof e ? 0 <= e.lastIndexOf("%") ? parseFloat(e) / 100 * t : parseFloat(e) : e
        }

        function zn(e, t, i) {
            return "right" === t ? e - i[1] : "center" === t ? e + i[3] / 2 - i[1] / 2 : e + i[3]
        }

        function jn(e, t) {
            return null != e && (e || t.textBackgroundColor || t.textBorderWidth && t.textBorderColor || t.textPadding)
        }

        function Gn() {
        }

        var $n = new Ai;

        function Xn(e) {
            for (var t in e = e || {}, ki.call(this, e), e) e.hasOwnProperty(t) && "style" !== t && (this[t] = e[t]);
            this.style = new Hi(e.style, this), this._rect = null, this.__clipPaths = null
        }

        function qn(e) {
            Xn.call(this, e)
        }

        Xn.prototype = {
            constructor: Xn,
            type: "displayable",
            __dirty: !0,
            invisible: !(Gn.prototype = {
                constructor: Gn, drawRectText: function (e, t) {
                    var i = this.style;
                    t = i.textRect || t, this.__dirty && En(i);
                    var n = i.text;
                    if (null != n && (n += ""), jn(n, i)) {
                        e.save();
                        var a = this.transform;
                        i.transformText ? this.setTransform(e) : a && ($n.copy(t), $n.applyTransform(a), t = $n), Mn(this, e, n, i, t, Wi), e.restore()
                    }
                }
            }),
            z: 0,
            z2: 0,
            zlevel: 0,
            draggable: !1,
            dragging: !1,
            silent: !1,
            culling: !1,
            cursor: "pointer",
            rectHover: !1,
            progressive: !1,
            incremental: !1,
            globalScaleRatio: 1,
            beforeBrush: function (e) {
            },
            afterBrush: function (e) {
            },
            brush: function (e, t) {
            },
            getBoundingRect: function () {
            },
            contain: function (e, t) {
                return this.rectContain(e, t)
            },
            traverse: function (e, t) {
                e.call(t, this)
            },
            rectContain: function (e, t) {
                var i = this.transformCoordToLocal(e, t);
                return this.getBoundingRect().contain(i[0], i[1])
            },
            dirty: function () {
                this.__dirty = this.__dirtyText = !0, this._rect = null, this.__zr && this.__zr.refresh()
            },
            animateStyle: function (e) {
                return this.animate("style", e)
            },
            attrKV: function (e, t) {
                "style" !== e ? ki.prototype.attrKV.call(this, e, t) : this.style.set(t)
            },
            setStyle: function (e, t) {
                return this.style.set(e, t), this.dirty(!1), this
            },
            useStyle: function (e) {
                return this.style = new Hi(e, this), this.dirty(!1), this
            },
            calculateTextPosition: null
        }, b(Xn, ki), I(Xn, Gn), qn.prototype = {
            constructor: qn, type: "image", brush: function (e, t) {
                var i = this.style, n = i.image;
                i.bind(e, this, t);
                var a = this._image = en(n, this._image, this, this.onload);
                if (a && nn(a)) {
                    var o = i.x || 0, r = i.y || 0, s = i.width, l = i.height, d = a.width / a.height;
                    if (null == s && null != l ? s = l * d : null == l && null != s ? l = s / d : null == s && null == l && (s = a.width, l = a.height), this.setTransform(e), i.sWidth && i.sHeight) {
                        var u = i.sx || 0, c = i.sy || 0;
                        e.drawImage(a, u, c, i.sWidth, i.sHeight, o, r, s, l)
                    } else if (i.sx && i.sy) {
                        var h = s - (u = i.sx), f = l - (c = i.sy);
                        e.drawImage(a, u, c, h, f, o, r, s, l)
                    } else e.drawImage(a, o, r, s, l);
                    null != i.text && (this.restoreTransform(e), this.drawRectText(e, this.getBoundingRect()))
                }
            }, getBoundingRect: function () {
                var e = this.style;
                return this._rect || (this._rect = new Ai(e.x || 0, e.y || 0, e.width || 0, e.height || 0)), this._rect
            }
        }, b(qn, Xn);
        var Yn = 314159;

        function Jn(e) {
            return parseInt(e, 10)
        }

        var Zn = new Ai(0, 0, 0, 0), Qn = new Ai(0, 0, 0, 0);

        function ea(e, t, i) {
            this.type = "canvas";
            var n = !e.nodeName || "CANVAS" === e.nodeName.toUpperCase();
            this._opts = i = k({}, i || {}), this.dpr = i.devicePixelRatio || gi, this._singleCanvas = n;
            var a = (this.root = e).style;
            a && (a["-webkit-tap-highlight-color"] = "transparent", a["-webkit-user-select"] = a["user-select"] = a["-webkit-touch-callout"] = "none", e.innerHTML = ""), this.storage = t;
            var o = this._zlevelList = [], r = this._layers = {};
            if (this._layerConfig = {}, this._needsManuallyCompositing = !1, n) {
                var s = e.width, l = e.height;
                null != i.width && (s = i.width), null != i.height && (l = i.height), this.dpr = i.devicePixelRatio || 1, e.width = s * this.dpr, e.height = l * this.dpr, this._width = s, this._height = l;
                var d = new Yi(e, this, this.dpr);
                d.__builtin__ = !0, d.initContext(), (r[Yn] = d).zlevel = Yn, o.push(Yn), this._domRoot = e
            } else {
                this._width = this._getSize(0), this._height = this._getSize(1);
                var u = this._domRoot = function (e, t) {
                    var i = document.createElement("div");
                    return i.style.cssText = ["position:relative", "width:" + e + "px", "height:" + t + "px", "padding:0", "margin:0", "border-width:0"].join(";") + ";", i
                }(this._width, this._height);
                e.appendChild(u)
            }
            this._hoverlayer = null, this._hoverElements = []
        }

        function ta(e) {
            e = e || {}, this.stage = e.stage || {}, this.onframe = e.onframe || function () {
            }, this._clips = [], this._running = !1, this._time, this._pausedTime, this._pauseStart, this._paused = !1, xe.call(this)
        }

        ea.prototype = {
            constructor: ea, getType: function () {
                return "canvas"
            }, isSingleCanvas: function () {
                return this._singleCanvas
            }, getViewportRoot: function () {
                return this._domRoot
            }, getViewportRootOffset: function () {
                var e = this.getViewportRoot();
                if (e) return {offsetLeft: e.offsetLeft || 0, offsetTop: e.offsetTop || 0}
            }, refresh: function (e) {
                var t = this.storage.getDisplayList(!0), i = this._zlevelList;
                this._redrawId = Math.random(), this._paintList(t, e, this._redrawId);
                for (var n = 0; n < i.length; n++) {
                    var a = i[n], o = this._layers[a];
                    if (!o.__builtin__ && o.refresh) {
                        var r = 0 === n ? this._backgroundColor : null;
                        o.refresh(r)
                    }
                }
                return this.refreshHover(), this
            }, addHover: function (e, t) {
                if (!e.__hoverMir) {
                    var i = new e.constructor({style: e.style, shape: e.shape, z: e.z, z2: e.z2, silent: e.silent});
                    return (i.__from = e).__hoverMir = i, t && i.setStyle(t), this._hoverElements.push(i), i
                }
            }, removeHover: function (e) {
                var t = e.__hoverMir, i = this._hoverElements, n = S(i, t);
                0 <= n && i.splice(n, 1), e.__hoverMir = null
            }, clearHover: function (e) {
                for (var t = this._hoverElements, i = 0; i < t.length; i++) {
                    var n = t[i].__from;
                    n && (n.__hoverMir = null)
                }
                t.length = 0
            }, refreshHover: function () {
                var e = this._hoverElements, t = e.length, i = this._hoverlayer;
                if (i && i.clear(), t) {
                    Fi(e, this.storage.displayableSortFunc);
                    var n = {};
                    (i = i || (this._hoverlayer = this.getLayer(1e5))).ctx.save();
                    for (var a = 0; a < t;) {
                        var o = e[a], r = o.__from;
                        r && r.__zr ? (a++, r.invisible || (o.transform = r.transform, o.invTransform = r.invTransform, o.__clipPaths = r.__clipPaths, this._doPaintEl(o, i, !0, n))) : (e.splice(a, 1), r.__hoverMir = null, t--)
                    }
                    i.ctx.restore()
                }
            }, getHoverLayer: function () {
                return this.getLayer(1e5)
            }, _paintList: function (e, t, i) {
                if (this._redrawId === i) {
                    t = t || !1, this._updateLayerStatus(e);
                    var n = this._doPaintList(e, t);
                    if (this._needsManuallyCompositing && this._compositeManually(), !n) {
                        var a = this;
                        Ji(function () {
                            a._paintList(e, t, i)
                        })
                    }
                }
            }, _compositeManually: function () {
                var e = this.getLayer(Yn).ctx, t = this._domRoot.width, i = this._domRoot.height;
                e.clearRect(0, 0, t, i), this.eachBuiltinLayer(function (n) {
                    n.virtual && e.drawImage(n.dom, 0, 0, t, i)
                })
            }, _doPaintList: function (e, t) {
                for (var i = [], n = 0; n < this._zlevelList.length; n++) {
                    var o = this._zlevelList[n];
                    (l = this._layers[o]).__builtin__ && l !== this._hoverlayer && (l.__dirty || t) && i.push(l)
                }
                for (var r = !0, s = 0; s < i.length; s++) {
                    var l, d = (l = i[s]).ctx, u = {};
                    d.save();
                    var c = t ? l.__startIndex : l.__drawIndex, h = !t && l.incremental && Date.now,
                        f = h && Date.now(), g = l.zlevel === this._zlevelList[0] ? this._backgroundColor : null;
                    if (l.__startIndex === l.__endIndex) l.clear(!1, g); else if (c === l.__startIndex) {
                        var p = e[c];
                        p.incremental && p.notClear && !t || l.clear(!1, g)
                    }
                    -1 === c && (console.error("For some unknown reason. drawIndex is -1"), c = l.__startIndex);
                    for (var v = c; v < l.__endIndex; v++) {
                        var m = e[v];
                        if (this._doPaintEl(m, l, t, u), m.__dirty = m.__dirtyText = !1, h && 15 < Date.now() - f) break
                    }
                    l.__drawIndex = v, l.__drawIndex < l.__endIndex && (r = !1), u.prevElClipPaths && d.restore(), d.restore()
                }
                return a.wxa && A(this._layers, function (e) {
                    e && e.ctx && e.ctx.draw && e.ctx.draw()
                }), r
            }, _doPaintEl: function (e, t, i, n) {
                var a = t.ctx, o = e.transform;
                if ((t.__dirty || i) && !e.invisible && 0 !== e.style.opacity && (!o || o[0] || o[3]) && (!e.culling || !function (e, t, i) {
                    return Zn.copy(e.getBoundingRect()), e.transform && Zn.applyTransform(e.transform), Qn.width = t, Qn.height = i, !Zn.intersect(Qn)
                }(e, this._width, this._height))) {
                    var r = e.__clipPaths, s = n.prevElClipPaths;
                    s && !function (e, t) {
                        if (e === t) return !1;
                        if (!e || !t || e.length !== t.length) return !0;
                        for (var i = 0; i < e.length; i++) if (e[i] !== t[i]) return !0;
                        return !1
                    }(r, s) || (s && (a.restore(), n.prevElClipPaths = null, n.prevEl = null), r && (a.save(), function (e, t) {
                        for (var i = 0; i < e.length; i++) {
                            var n = e[i];
                            n.setTransform(t), t.beginPath(), n.buildPath(t, n.shape), t.clip(), n.restoreTransform(t)
                        }
                    }(r, a), n.prevElClipPaths = r)), e.beforeBrush && e.beforeBrush(a), e.brush(a, n.prevEl || null), (n.prevEl = e).afterBrush && e.afterBrush(a)
                }
            }, getLayer: function (e, t) {
                this._singleCanvas && !this._needsManuallyCompositing && (e = Yn);
                var i = this._layers[e];
                return i || ((i = new Yi("zr_" + e, this, this.dpr)).zlevel = e, i.__builtin__ = !0, this._layerConfig[e] ? m(i, this._layerConfig[e], !0) : this._layerConfig[e - .01] && m(i, this._layerConfig[e - .01], !0), t && (i.virtual = t), this.insertLayer(e, i), i.initContext()), i
            }, insertLayer: function (e, t) {
                var i = this._layers, n = this._zlevelList, a = n.length, o = null, r = -1, s = this._domRoot;
                if (i[e]) vi("ZLevel " + e + " has been used already"); else if (function (e) {
                    return !!e && (!!e.__builtin__ || "function" == typeof e.resize && "function" == typeof e.refresh)
                }(t)) {
                    if (0 < a && e > n[0]) {
                        for (r = 0; r < a - 1 && !(n[r] < e && n[r + 1] > e); r++) ;
                        o = i[n[r]]
                    }
                    if (n.splice(r + 1, 0, e), !(i[e] = t).virtual) if (o) {
                        var l = o.dom;
                        l.nextSibling ? s.insertBefore(t.dom, l.nextSibling) : s.appendChild(t.dom)
                    } else s.firstChild ? s.insertBefore(t.dom, s.firstChild) : s.appendChild(t.dom)
                } else vi("Layer of zlevel " + e + " is not valid")
            }, eachLayer: function (e, t) {
                var i, n, a = this._zlevelList;
                for (n = 0; n < a.length; n++) i = a[n], e.call(t, this._layers[i], i)
            }, eachBuiltinLayer: function (e, t) {
                var i, n, a, o = this._zlevelList;
                for (a = 0; a < o.length; a++) n = o[a], (i = this._layers[n]).__builtin__ && e.call(t, i, n)
            }, eachOtherLayer: function (e, t) {
                var i, n, a, o = this._zlevelList;
                for (a = 0; a < o.length; a++) n = o[a], (i = this._layers[n]).__builtin__ || e.call(t, i, n)
            }, getLayers: function () {
                return this._layers
            }, _updateLayerStatus: function (e) {
                function t(e) {
                    a && (a.__endIndex !== e && (a.__dirty = !0), a.__endIndex = e)
                }

                if (this.eachBuiltinLayer(function (e, t) {
                    e.__dirty = e.__used = !1
                }), this._singleCanvas) for (var i = 1; i < e.length; i++) if ((r = e[i]).zlevel !== e[i - 1].zlevel || r.incremental) {
                    this._needsManuallyCompositing = !0;
                    break
                }
                var n, a = null, o = 0;
                for (i = 0; i < e.length; i++) {
                    var r, s, l = (r = e[i]).zlevel;
                    n !== l && (n = l, o = 0), r.incremental ? ((s = this.getLayer(l + .001, this._needsManuallyCompositing)).incremental = !0, o = 1) : s = this.getLayer(l + (0 < o ? .01 : 0), this._needsManuallyCompositing), s.__builtin__ || vi("ZLevel " + l + " has been used by unkown layer " + s.id), s !== a && (s.__used = !0, s.__startIndex !== i && (s.__dirty = !0), s.__startIndex = i, s.incremental ? s.__drawIndex = -1 : s.__drawIndex = i, t(i), a = s), r.__dirty && (s.__dirty = !0, s.incremental && s.__drawIndex < 0 && (s.__drawIndex = i))
                }
                t(i), this.eachBuiltinLayer(function (e, t) {
                    !e.__used && 0 < e.getElementCount() && (e.__dirty = !0, e.__startIndex = e.__endIndex = e.__drawIndex = 0), e.__dirty && e.__drawIndex < 0 && (e.__drawIndex = e.__startIndex)
                })
            }, clear: function () {
                return this.eachBuiltinLayer(this._clearLayer), this
            }, _clearLayer: function (e) {
                e.clear()
            }, setBackgroundColor: function (e) {
                this._backgroundColor = e
            }, configLayer: function (e, t) {
                if (t) {
                    var i = this._layerConfig;
                    i[e] ? m(i[e], t, !0) : i[e] = t;
                    for (var n = 0; n < this._zlevelList.length; n++) {
                        var a = this._zlevelList[n];
                        a !== e && a !== e + .01 || m(this._layers[a], i[e], !0)
                    }
                }
            }, delLayer: function (e) {
                var t = this._layers, i = this._zlevelList, n = t[e];
                n && (n.dom.parentNode.removeChild(n.dom), delete t[e], i.splice(S(i, e), 1))
            }, resize: function (e, t) {
                if (this._domRoot.style) {
                    var i = this._domRoot;
                    i.style.display = "none";
                    var n = this._opts;
                    if (null != e && (n.width = e), null != t && (n.height = t), e = this._getSize(0), t = this._getSize(1), i.style.display = "", this._width !== e || t !== this._height) {
                        for (var a in i.style.width = e + "px", i.style.height = t + "px", this._layers) this._layers.hasOwnProperty(a) && this._layers[a].resize(e, t);
                        A(this._progressiveLayers, function (i) {
                            i.resize(e, t)
                        }), this.refresh(!0)
                    }
                    this._width = e, this._height = t
                } else {
                    if (null == e || null == t) return;
                    this._width = e, this._height = t, this.getLayer(Yn).resize(e, t)
                }
                return this
            }, clearLayer: function (e) {
                var t = this._layers[e];
                t && t.clear()
            }, dispose: function () {
                this.root.innerHTML = "", this.root = this.storage = this._domRoot = this._layers = null
            }, getRenderedCanvas: function (e) {
                if (e = e || {}, this._singleCanvas && !this._compositeManually) return this._layers[Yn].dom;
                var t = new Yi("image", this, e.pixelRatio || this.dpr);
                if (t.initContext(), t.clear(!1, e.backgroundColor || this._backgroundColor), e.pixelRatio <= this.dpr) {
                    this.refresh();
                    var i = t.dom.width, n = t.dom.height, a = t.ctx;
                    this.eachLayer(function (e) {
                        e.__builtin__ ? a.drawImage(e.dom, 0, 0, i, n) : e.renderToCanvas && (t.ctx.save(), e.renderToCanvas(t.ctx), t.ctx.restore())
                    })
                } else for (var o = {}, r = this.storage.getDisplayList(!0), s = 0; s < r.length; s++) {
                    var l = r[s];
                    this._doPaintEl(l, t, !0, o)
                }
                return t.dom
            }, getWidth: function () {
                return this._width
            }, getHeight: function () {
                return this._height
            }, _getSize: function (e) {
                var t = this._opts, i = ["width", "height"][e], n = ["clientWidth", "clientHeight"][e],
                    a = ["paddingLeft", "paddingTop"][e], o = ["paddingRight", "paddingBottom"][e];
                if (null != t[i] && "auto" !== t[i]) return parseFloat(t[i]);
                var r = this.root, s = document.defaultView.getComputedStyle(r);
                return (r[n] || Jn(s[i]) || Jn(r.style[i])) - (Jn(s[a]) || 0) - (Jn(s[o]) || 0) | 0
            }, pathToImage: function (e, t) {
                t = t || this.dpr;
                var i = document.createElement("canvas"), n = i.getContext("2d"), a = e.getBoundingRect(), o = e.style,
                    r = o.shadowBlur * t, s = o.shadowOffsetX * t, l = o.shadowOffsetY * t,
                    d = o.hasStroke() ? o.lineWidth : 0, u = Math.max(d / 2, r - s), c = Math.max(d / 2, s + r),
                    h = Math.max(d / 2, r - l), f = Math.max(d / 2, l + r), g = a.width + u + c, p = a.height + h + f;
                i.width = g * t, i.height = p * t, n.scale(t, t), n.clearRect(0, 0, g, p), n.dpr = t;
                var v = {position: e.position, rotation: e.rotation, scale: e.scale};
                e.position = [u - a.x, h - a.y], e.rotation = 0, e.scale = [1, 1], e.updateTransform(), e && e.brush(n);
                var m = new qn({style: {x: 0, y: 0, image: i}});
                return null != v.position && (m.position = e.position = v.position), null != v.rotation && (m.rotation = e.rotation = v.rotation), null != v.scale && (m.scale = e.scale = v.scale), m
            }
        }, ta.prototype = {
            constructor: ta, addClip: function (e) {
                this._clips.push(e)
            }, addAnimator: function (e) {
                e.animation = this;
                for (var t = e.getClips(), i = 0; i < t.length; i++) this.addClip(t[i])
            }, removeClip: function (e) {
                var t = S(this._clips, e);
                0 <= t && this._clips.splice(t, 1)
            }, removeAnimator: function (e) {
                for (var t = e.getClips(), i = 0; i < t.length; i++) this.removeClip(t[i]);
                e.animation = null
            }, _update: function () {
                for (var e = (new Date).getTime() - this._pausedTime, t = e - this._time, i = this._clips, n = i.length, a = [], o = [], r = 0; r < n; r++) {
                    var s = i[r], l = s.step(e, t);
                    l && (a.push(l), o.push(s))
                }
                for (r = 0; r < n;) i[r]._needsRemove ? (i[r] = i[n - 1], i.pop(), n--) : r++;
                for (n = a.length, r = 0; r < n; r++) o[r].fire(a[r]);
                this._time = e, this.onframe(t), this.trigger("frame", t), this.stage.update && this.stage.update()
            }, _startLoop: function () {
                var e = this;
                this._running = !0, Ji(function t() {
                    e._running && (Ji(t), e._paused || e._update())
                })
            }, start: function () {
                this._time = (new Date).getTime(), this._pausedTime = 0, this._startLoop()
            }, stop: function () {
                this._running = !1
            }, pause: function () {
                this._paused || (this._pauseStart = (new Date).getTime(), this._paused = !0)
            }, resume: function () {
                this._paused && (this._pausedTime += (new Date).getTime() - this._pauseStart, this._paused = !1)
            }, clear: function () {
                this._clips = []
            }, isFinished: function () {
                return !this._clips.length
            }, animate: function (e, t) {
                var i = new hi(e, (t = t || {}).loop, t.getter, t.setter);
                return this.addAnimator(i), i
            }
        }, I(ta, xe);
        var ia, na, aa = a.domSupported, oa = (na = {
            pointerdown: 1,
            pointerup: 1,
            pointermove: 1,
            pointerout: 1
        }, {
            mouse: ia = ["click", "dblclick", "mousewheel", "mouseout", "mouseup", "mousedown", "mousemove", "contextmenu"],
            touch: ["touchstart", "touchend", "touchmove"],
            pointer: D(ia, function (e) {
                var t = e.replace("mouse", "pointer");
                return na.hasOwnProperty(t) ? t : e
            })
        }), ra = {mouse: ["mousemove", "mouseup"], pointer: ["pointermove", "pointerup"]};

        function sa(e) {
            return "mousewheel" === e && a.browser.firefox ? "DOMMouseScroll" : e
        }

        function la(e) {
            var t = e.pointerType;
            return "pen" === t || "touch" === t
        }

        function da(e) {
            e && (e.zrByTouch = !0)
        }

        function ua(e, t) {
            for (var i = t, n = !1; i && 9 !== i.nodeType && !(n = i.domBelongToZr || i !== t && i === e.painterRoot);) i = i.parentNode;
            return n
        }

        function ca(e, t) {
            this.type = t.type, this.target = this.currentTarget = e.dom, this.pointerType = t.pointerType, this.clientX = t.clientX, this.clientY = t.clientY
        }

        var ha = ca.prototype;
        ha.stopPropagation = ha.stopImmediatePropagation = ha.preventDefault = te;
        var fa = {
            mousedown: function (e) {
                e = ze(this.dom, e), this._mayPointerCapture = [e.zrX, e.zrY], this.trigger("mousedown", e)
            }, mousemove: function (e) {
                e = ze(this.dom, e);
                var t = this._mayPointerCapture;
                !t || e.zrX === t[0] && e.zrY === t[1] || ma(this, !0), this.trigger("mousemove", e)
            }, mouseup: function (e) {
                e = ze(this.dom, e), ma(this, !1), this.trigger("mouseup", e)
            }, mouseout: function (e) {
                e = ze(this.dom, e), this._pointerCapturing && (e.zrEventControl = "no_globalout");
                var t = e.toElement || e.relatedTarget;
                e.zrIsToLocalDOM = ua(this, t), this.trigger("mouseout", e)
            }, touchstart: function (e) {
                da(e = ze(this.dom, e)), this._lastTouchMoment = new Date, this.handler.processGesture(e, "start"), fa.mousemove.call(this, e), fa.mousedown.call(this, e)
            }, touchmove: function (e) {
                da(e = ze(this.dom, e)), this.handler.processGesture(e, "change"), fa.mousemove.call(this, e)
            }, touchend: function (e) {
                da(e = ze(this.dom, e)), this.handler.processGesture(e, "end"), fa.mouseup.call(this, e), +new Date - this._lastTouchMoment < 300 && fa.click.call(this, e)
            }, pointerdown: function (e) {
                fa.mousedown.call(this, e)
            }, pointermove: function (e) {
                la(e) || fa.mousemove.call(this, e)
            }, pointerup: function (e) {
                fa.mouseup.call(this, e)
            }, pointerout: function (e) {
                la(e) || fa.mouseout.call(this, e)
            }
        };
        A(["click", "mousewheel", "dblclick", "contextmenu"], function (e) {
            fa[e] = function (t) {
                t = ze(this.dom, t), this.trigger(e, t)
            }
        });
        var ga = {
            pointermove: function (e) {
                la(e) || ga.mousemove.call(this, e)
            }, pointerup: function (e) {
                ga.mouseup.call(this, e)
            }, mousemove: function (e) {
                this.trigger("mousemove", e)
            }, mouseup: function (e) {
                var t = this._pointerCapturing;
                ma(this, !1), this.trigger("mouseup", e), t && (e.zrEventControl = "only_globalout", this.trigger("mouseout", e))
            }
        };

        function pa(e, t, i, n) {
            e.mounted[t] = i, e.listenerOpts[t] = n, je(e.domTarget, sa(t), i, n)
        }

        function va(e) {
            var t, i, n, a, o = e.mounted;
            for (var r in o) o.hasOwnProperty(r) && (t = e.domTarget, i = sa(r), n = o[r], a = e.listenerOpts[r], Ue ? t.removeEventListener(i, n, a) : t.detachEvent("on" + i, n));
            e.mounted = {}
        }

        function ma(e, t) {
            if (e._mayPointerCapture = null, aa && e._pointerCapturing ^ t) {
                e._pointerCapturing = t;
                var i = e._globalHandlerScope;
                t ? function (e, t) {
                    function i(i) {
                        pa(t, i, function (n) {
                            n = He(n), ua(e, n.target) || (n = function (e, t) {
                                return ze(e.dom, new ca(e, t), !0)
                            }(e, n), t.domHandlers[i].call(e, n))
                        }, {capture: !0})
                    }

                    a.pointerEventsSupported ? A(ra.pointer, i) : a.touchEventsSupported || A(ra.mouse, i)
                }(e, i) : va(i)
            }
        }

        function ya(e, t) {
            this.domTarget = e, this.domHandlers = t, this.mounted = {}, this.listenerOpts = {}, this.touchTimer = null, this.touching = !1
        }

        function ka(e, t) {
            var i, n, o;
            xe.call(this), this.dom = e, this.painterRoot = t, this._localHandlerScope = new ya(e, fa), aa && (this._globalHandlerScope = new ya(document, ga)), this._pointerCapturing = !1, this._mayPointerCapture = null, i = this, n = this._localHandlerScope, o = n.domHandlers, a.pointerEventsSupported ? A(oa.pointer, function (e) {
                pa(n, e, function (t) {
                    o[e].call(i, t)
                })
            }) : (a.touchEventsSupported && A(oa.touch, function (e) {
                pa(n, e, function (t) {
                    o[e].call(i, t), function (e) {
                        e.touching = !0, null != e.touchTimer && (clearTimeout(e.touchTimer), e.touchTimer = null), e.touchTimer = setTimeout(function () {
                            e.touching = !1, e.touchTimer = null
                        }, 700)
                    }(n)
                })
            }), A(oa.mouse, function (e) {
                pa(n, e, function (t) {
                    t = He(t), n.touching || o[e].call(i, t)
                })
            }))
        }

        var Ta = ka.prototype;
        Ta.dispose = function () {
            va(this._localHandlerScope), aa && va(this._globalHandlerScope)
        }, Ta.setCursor = function (e) {
            this.dom.style && (this.dom.style.cursor = e || "default")
        }, I(ka, xe);
        var wa = !a.canvasSupported, Ca = {canvas: ea}, Sa = {};

        function ba(e, t) {
            var i = new _a(n(), e, t);
            return Sa[i.id] = i
        }

        function Ia(e, t) {
            Ca[e] = t
        }

        var _a = function (e, t, i) {
            i = i || {}, this.dom = t, this.id = e;
            var n = this, o = new Bi, r = i.renderer;
            if (wa) {
                if (!Ca.vml) throw new Error("You need to require 'zrender/vml/vml' to support IE8");
                r = "vml"
            } else r && Ca[r] || (r = "canvas");
            var s = new Ca[r](t, o, i, e);
            this.storage = o, this.painter = s;
            var l = a.node || a.worker ? null : new ka(s.getViewportRoot(), s.root);
            this.handler = new et(o, s, l, s.root), this.animation = new ta({stage: {update: P(this.flush, this)}}), this.animation.start(), this._needsRefresh;
            var d = o.delFromStorage, u = o.addToStorage;
            o.delFromStorage = function (e) {
                d.call(o, e), e && e.removeSelfFromZr(n)
            }, o.addToStorage = function (e) {
                u.call(o, e), e.addSelfToZr(n)
            }
        };
        _a.prototype = {
            constructor: _a, getId: function () {
                return this.id
            }, add: function (e) {
                this.storage.addRoot(e), this._needsRefresh = !0
            }, remove: function (e) {
                this.storage.delRoot(e), this._needsRefresh = !0
            }, configLayer: function (e, t) {
                this.painter.configLayer && this.painter.configLayer(e, t), this._needsRefresh = !0
            }, setBackgroundColor: function (e) {
                this.painter.setBackgroundColor && this.painter.setBackgroundColor(e), this._needsRefresh = !0
            }, refreshImmediately: function () {
                this._needsRefresh = this._needsRefreshHover = !1, this.painter.refresh(), this._needsRefresh = this._needsRefreshHover = !1
            }, refresh: function () {
                this._needsRefresh = !0
            }, flush: function () {
                var e;
                this._needsRefresh && (e = !0, this.refreshImmediately()), this._needsRefreshHover && (e = !0, this.refreshHoverImmediately()), e && this.trigger("rendered")
            }, addHover: function (e, t) {
                if (this.painter.addHover) {
                    var i = this.painter.addHover(e, t);
                    return this.refreshHover(), i
                }
            }, removeHover: function (e) {
                this.painter.removeHover && (this.painter.removeHover(e), this.refreshHover())
            }, clearHover: function () {
                this.painter.clearHover && (this.painter.clearHover(), this.refreshHover())
            }, refreshHover: function () {
                this._needsRefreshHover = !0
            }, refreshHoverImmediately: function () {
                this._needsRefreshHover = !1, this.painter.refreshHover && this.painter.refreshHover()
            }, resize: function (e) {
                e = e || {}, this.painter.resize(e.width, e.height), this.handler.resize()
            }, clearAnimation: function () {
                this.animation.clear()
            }, getWidth: function () {
                return this.painter.getWidth()
            }, getHeight: function () {
                return this.painter.getHeight()
            }, pathToImage: function (e, t) {
                return this.painter.pathToImage(e, t)
            }, setCursorStyle: function (e) {
                this.handler.setCursorStyle(e)
            }, findHover: function (e, t) {
                return this.handler.findHover(e, t)
            }, on: function (e, t, i) {
                this.handler.on(e, t, i)
            }, off: function (e, t) {
                this.handler.off(e, t)
            }, trigger: function (e, t) {
                this.handler.trigger(e, t)
            }, clear: function () {
                this.storage.delRoot(), this.painter.clear()
            }, dispose: function () {
                var e;
                this.animation.stop(), this.clear(), this.storage.dispose(), this.painter.dispose(), this.handler.dispose(), this.animation = this.storage = this.painter = this.handler = null, e = this.id, delete Sa[e]
            }
        };
        var Aa = (Object.freeze || Object)({
            version: "4.3.1", init: ba, dispose: function (e) {
                if (e) e.dispose(); else {
                    for (var t in Sa) Sa.hasOwnProperty(t) && Sa[t].dispose();
                    Sa = {}
                }
                return this
            }, getInstance: function (e) {
                return Sa[e]
            }, registerPainter: Ia
        }), Da = A, xa = B, Na = O, Ea = "series\0";

        function Pa(e) {
            return e instanceof Array ? e : null == e ? [] : [e]
        }

        function Ma(e, t, i) {
            if (e) {
                e[t] = e[t] || {}, e.emphasis = e.emphasis || {}, e.emphasis[t] = e.emphasis[t] || {};
                for (var n = 0, a = i.length; n < a; n++) {
                    var o = i[n];
                    !e.emphasis[t].hasOwnProperty(o) && e[t].hasOwnProperty(o) && (e.emphasis[t][o] = e[t][o])
                }
            }
        }

        var Oa = ["fontStyle", "fontWeight", "fontSize", "fontFamily", "rich", "tag", "color", "textBorderColor", "textBorderWidth", "width", "height", "lineHeight", "align", "verticalAlign", "baseline", "shadowColor", "shadowBlur", "shadowOffsetX", "shadowOffsetY", "textShadowColor", "textShadowBlur", "textShadowOffsetX", "textShadowOffsetY", "backgroundColor", "borderColor", "borderWidth", "borderRadius", "padding"];

        function Fa(e) {
            return !xa(e) || Na(e) || e instanceof Date ? e : e.value
        }

        function La(e, t) {
            t = (t || []).slice();
            var i = D(e || [], function (e, t) {
                return {exist: e}
            });
            return Da(t, function (e, n) {
                if (xa(e)) {
                    for (var a = 0; a < i.length; a++) if (!i[a].option && null != e.id && i[a].exist.id === e.id + "") return i[a].option = e, void (t[n] = null);
                    for (a = 0; a < i.length; a++) {
                        var o = i[a].exist;
                        if (!(i[a].option || null != o.id && null != e.id || null == e.name || Ra(e) || Ra(o) || o.name !== e.name + "")) return i[a].option = e, void (t[n] = null)
                    }
                }
            }), Da(t, function (e, t) {
                if (xa(e)) {
                    for (var n = 0; n < i.length; n++) {
                        var a = i[n].exist;
                        if (!i[n].option && !Ra(a) && null == e.id) {
                            i[n].option = e;
                            break
                        }
                    }
                    n >= i.length && i.push({option: e})
                }
            }), i
        }

        function Ba(e) {
            var t = Q();
            Da(e, function (e, i) {
                var n = e.exist;
                n && t.set(n.id, e)
            }), Da(e, function (e, i) {
                var n = e.option;
                $(!n || null == n.id || !t.get(n.id) || t.get(n.id) === e, "id duplicates: " + (n && n.id)), n && null != n.id && t.set(n.id, e), e.keyInfo || (e.keyInfo = {})
            }), Da(e, function (e, i) {
                var n = e.exist, a = e.option, o = e.keyInfo;
                if (xa(a)) {
                    if (o.name = null != a.name ? a.name + "" : n ? n.name : Ea + i, n) o.id = n.id; else if (null != a.id) o.id = a.id + ""; else for (var r = 0; o.id = "\0" + o.name + "\0" + r++, t.get(o.id);) ;
                    t.set(o.id, e)
                }
            })
        }

        function Ua(e) {
            var t = e.name;
            return !(!t || !t.indexOf(Ea))
        }

        function Ra(e) {
            return xa(e) && e.id && 0 === (e.id + "").indexOf("\0_ec_\0")
        }

        function Ka(e, t) {
            return null != t.dataIndexInside ? t.dataIndexInside : null != t.dataIndex ? O(t.dataIndex) ? D(t.dataIndex, function (t) {
                return e.indexOfRawIndex(t)
            }) : e.indexOfRawIndex(t.dataIndex) : null != t.name ? O(t.name) ? D(t.name, function (t) {
                return e.indexOfName(t)
            }) : e.indexOfName(t.name) : void 0
        }

        function Wa() {
            var e = "__\0ec_inner_" + Va++ + "_" + Math.random().toFixed(5);
            return function (t) {
                return t[e] || (t[e] = {})
            }
        }

        var Va = 0;

        function Ha(e, t, i) {
            if (L(t)) {
                var n = {};
                n[t + "Index"] = 0, t = n
            }
            var a = i && i.defaultMainType;
            !a || za(t, a + "Index") || za(t, a + "Id") || za(t, a + "Name") || (t[a + "Index"] = 0);
            var o = {};
            return Da(t, function (n, a) {
                if (n = t[a], "dataIndex" !== a && "dataIndexInside" !== a) {
                    var r = a.match(/^(\w+)(Index|Id|Name)$/) || [], s = r[1], l = (r[2] || "").toLowerCase();
                    if (!(!s || !l || null == n || "index" === l && "none" === n || i && i.includeMainTypes && S(i.includeMainTypes, s) < 0)) {
                        var d = {mainType: s};
                        "index" === l && "all" === n || (d[l] = n);
                        var u = e.queryComponents(d);
                        o[s + "Models"] = u, o[s + "Model"] = u[0]
                    }
                } else o[a] = n
            }), o
        }

        function za(e, t) {
            return e && e.hasOwnProperty(t)
        }

        function ja(e, t, i) {
            e.setAttribute ? e.setAttribute(t, i) : e[t] = i
        }

        function Ga(e) {
            return "auto" === e ? a.domSupported ? "html" : "richText" : e || "html"
        }

        function $a(e, t) {
            var i = Q(), n = [];
            return A(e, function (e) {
                var a = t(e);
                (i.get(a) || (n.push(a), i.set(a, []))).push(e)
            }), {keys: n, buckets: i}
        }

        var Xa = ".", qa = "___EC__COMPONENT__CONTAINER___";

        function Ya(e) {
            var t = {main: "", sub: ""};
            return e && (e = e.split(Xa), t.main = e[0] || "", t.sub = e[1] || ""), t
        }

        function Ja(e) {
            (e.$constructor = e).extend = function (e) {
                function t() {
                    e.$constructor ? e.$constructor.apply(this, arguments) : i.apply(this, arguments)
                }

                var i = this;
                return k(t.prototype, e), t.extend = this.extend, t.superCall = eo, t.superApply = to, b(t, this), t.superClass = i, t
            }
        }

        var Za = 0;

        function Qa(e) {
            var t = ["__\0is_clz", Za++, Math.random().toFixed(3)].join("_");
            e.prototype[t] = !0, e.isInstance = function (e) {
                return !(!e || !e[t])
            }
        }

        function eo(e, t) {
            var i = j(arguments, 2);
            return this.superClass.prototype[t].apply(e, i)
        }

        function to(e, t, i) {
            return this.superClass.prototype[t].apply(e, i)
        }

        function io(e, t) {
            t = t || {};
            var i = {};
            if (e.registerClass = function (e, t) {
                return t && (function (e) {
                    $(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(e), 'componentType "' + e + '" illegal')
                }(t), (t = Ya(t)).sub ? t.sub !== qa && ((function (e) {
                    var t = i[e.main];
                    return t && t[qa] || ((t = i[e.main] = {})[qa] = !0), t
                }(t))[t.sub] = e) : i[t.main] = e), e
            }, e.getClass = function (e, t, n) {
                var a = i[e];
                if (a && a[qa] && (a = t ? a[t] : null), n && !a) throw new Error(t ? "Component " + e + "." + (t || "") + " not exists. Load it first." : e + ".type should be specified.");
                return a
            }, e.getClassesByMainType = function (e) {
                e = Ya(e);
                var t = [], n = i[e.main];
                return n && n[qa] ? A(n, function (e, i) {
                    i !== qa && t.push(e)
                }) : t.push(n), t
            }, e.hasClass = function (e) {
                return e = Ya(e), !!i[e.main]
            }, e.getAllClassMainTypes = function () {
                var e = [];
                return A(i, function (t, i) {
                    e.push(i)
                }), e
            }, e.hasSubTypes = function (e) {
                e = Ya(e);
                var t = i[e.main];
                return t && t[qa]
            }, e.parseClassType = Ya, t.registerWhenExtend) {
                var n = e.extend;
                n && (e.extend = function (t) {
                    var i = n.call(this, t);
                    return e.registerClass(i, t.type)
                })
            }
            return e
        }

        function no(e) {
            for (var t = 0; t < e.length; t++) e[t][1] || (e[t][1] = e[t][0]);
            return function (t, i, n) {
                for (var a = {}, o = 0; o < e.length; o++) {
                    var r = e[o][1];
                    if (!(i && 0 <= S(i, r) || n && S(n, r) < 0)) {
                        var s = t.getShallow(r);
                        null != s && (a[e[o][0]] = s)
                    }
                }
                return a
            }
        }

        var ao = no([["lineWidth", "width"], ["stroke", "color"], ["opacity"], ["shadowBlur"], ["shadowOffsetX"], ["shadowOffsetY"], ["shadowColor"]]),
            oo = {
                getLineStyle: function (e) {
                    var t = ao(this, e);
                    return t.lineDash = this.getLineDash(t.lineWidth), t
                }, getLineDash: function (e) {
                    null == e && (e = 1);
                    var t = this.get("type"), i = Math.max(e, 2), n = 4 * e;
                    return "solid" !== t && null != t && ("dashed" === t ? [n, n] : [i, i])
                }
            },
            ro = no([["fill", "color"], ["shadowBlur"], ["shadowOffsetX"], ["shadowOffsetY"], ["opacity"], ["shadowColor"]]),
            so = {
                getAreaStyle: function (e, t) {
                    return ro(this, e, t)
                }
            }, lo = Math.pow, uo = Math.sqrt, co = 1e-8, ho = 1e-4, fo = uo(3), go = 1 / 3, po = ae(), vo = ae(),
            mo = ae();

        function yo(e) {
            return -co < e && e < co
        }

        function ko(e) {
            return co < e || e < -co
        }

        function To(e, t, i, n, a) {
            var o = 1 - a;
            return o * o * (o * e + 3 * a * t) + a * a * (a * n + 3 * o * i)
        }

        function wo(e, t, i, n, a) {
            var o = 1 - a;
            return 3 * (((t - e) * o + 2 * (i - t) * a) * o + (n - i) * a * a)
        }

        function Co(e, t, i, n, a) {
            var o = 6 * i - 12 * t + 6 * e, r = 9 * t + 3 * n - 3 * e - 9 * i, s = 3 * t - 3 * e, l = 0;
            if (yo(r)) ko(o) && 0 <= (u = -s / o) && u <= 1 && (a[l++] = u); else {
                var d = o * o - 4 * r * s;
                if (yo(d)) a[0] = -o / (2 * r); else if (0 < d) {
                    var u, c = uo(d), h = (-o - c) / (2 * r);
                    0 <= (u = (-o + c) / (2 * r)) && u <= 1 && (a[l++] = u), 0 <= h && h <= 1 && (a[l++] = h)
                }
            }
            return l
        }

        function So(e, t, i, n, a, o) {
            var r = (t - e) * a + e, s = (i - t) * a + t, l = (n - i) * a + i, d = (s - r) * a + r, u = (l - s) * a + s,
                c = (u - d) * a + d;
            o[0] = e, o[1] = r, o[2] = d, o[3] = c, o[4] = c, o[5] = u, o[6] = l, o[7] = n
        }

        function bo(e, t, i, n) {
            var a = 1 - n;
            return a * (a * e + 2 * n * t) + n * n * i
        }

        function Io(e, t, i, n) {
            return 2 * ((1 - n) * (t - e) + n * (i - t))
        }

        function _o(e, t, i) {
            var n = e + i - 2 * t;
            return 0 == n ? .5 : (e - t) / n
        }

        function Ao(e, t, i, n, a) {
            var o = (t - e) * n + e, r = (i - t) * n + t, s = (r - o) * n + o;
            a[0] = e, a[1] = o, a[2] = s, a[3] = s, a[4] = r, a[5] = i
        }

        var Do = Math.min, xo = Math.max, No = Math.sin, Eo = Math.cos, Po = 2 * Math.PI, Mo = ae(), Oo = ae(),
            Fo = ae();

        function Lo(e, t, i) {
            if (0 !== e.length) {
                var n, a = e[0], o = a[0], r = a[0], s = a[1], l = a[1];
                for (n = 1; n < e.length; n++) a = e[n], o = Do(o, a[0]), r = xo(r, a[0]), s = Do(s, a[1]), l = xo(l, a[1]);
                t[0] = o, t[1] = s, i[0] = r, i[1] = l
            }
        }

        function Bo(e, t, i, n, a, o) {
            a[0] = Do(e, i), a[1] = Do(t, n), o[0] = xo(e, i), o[1] = xo(t, n)
        }

        var Uo = [], Ro = [];

        function Ko(e, t, i, n, a, o, r, s, l, d) {
            var u, c = Co, h = To, f = c(e, i, a, r, Uo);
            for (l[0] = 1 / 0, l[1] = 1 / 0, d[0] = -1 / 0, d[1] = -1 / 0, u = 0; u < f; u++) {
                var g = h(e, i, a, r, Uo[u]);
                l[0] = Do(g, l[0]), d[0] = xo(g, d[0])
            }
            for (f = c(t, n, o, s, Ro), u = 0; u < f; u++) {
                var p = h(t, n, o, s, Ro[u]);
                l[1] = Do(p, l[1]), d[1] = xo(p, d[1])
            }
            l[0] = Do(e, l[0]), d[0] = xo(e, d[0]), l[0] = Do(r, l[0]), d[0] = xo(r, d[0]), l[1] = Do(t, l[1]), d[1] = xo(t, d[1]), l[1] = Do(s, l[1]), d[1] = xo(s, d[1])
        }

        function Wo(e, t, i, n, a, o, r, s, l) {
            var d = Se, u = be, c = Math.abs(a - o);
            if (c % Po < 1e-4 && 1e-4 < c) return s[0] = e - i, s[1] = t - n, l[0] = e + i, void (l[1] = t + n);
            if (Mo[0] = Eo(a) * i + e, Mo[1] = No(a) * n + t, Oo[0] = Eo(o) * i + e, Oo[1] = No(o) * n + t, d(s, Mo, Oo), u(l, Mo, Oo), (a %= Po) < 0 && (a += Po), (o %= Po) < 0 && (o += Po), o < a && !r ? o += Po : a < o && r && (a += Po), r) {
                var h = o;
                o = a, a = h
            }
            for (var f = 0; f < o; f += Math.PI / 2) a < f && (Fo[0] = Eo(f) * i + e, Fo[1] = No(f) * n + t, d(s, Fo, s), u(l, Fo, l))
        }

        var Vo = {M: 1, L: 2, C: 3, Q: 4, A: 5, Z: 6, R: 7}, Ho = [], zo = [], jo = [], Go = [], $o = Math.min,
            Xo = Math.max, qo = Math.cos, Yo = Math.sin, Jo = Math.sqrt, Zo = Math.abs,
            Qo = "undefined" != typeof Float32Array, er = function (e) {
                this._saveData = !e, this._saveData && (this.data = []), this._ctx = null
            };

        function tr(e, t, i, n, a, o, r) {
            if (0 === a) return !1;
            var s = a, l = 0;
            if (t + s < r && n + s < r || r < t - s && r < n - s || e + s < o && i + s < o || o < e - s && o < i - s) return !1;
            if (e === i) return Math.abs(o - e) <= s / 2;
            var d = (l = (t - n) / (e - i)) * o - r + (e * n - i * t) / (e - i);
            return d * d / (l * l + 1) <= s / 2 * s / 2
        }

        function ir(e, t, i, n, a, o, r, s, l, d, u) {
            if (0 === l) return !1;
            var c = l;
            return !(t + c < u && n + c < u && o + c < u && s + c < u || u < t - c && u < n - c && u < o - c && u < s - c || e + c < d && i + c < d && a + c < d && r + c < d || d < e - c && d < i - c && d < a - c && d < r - c) && function (e, t, i, n, a, o, r, s, l, d, u) {
                var c, h, f, g, p, v = .005, m = 1 / 0;
                po[0] = l, po[1] = d;
                for (var y = 0; y < 1; y += .05) vo[0] = To(e, i, a, r, y), vo[1] = To(t, n, o, s, y), (g = Te(po, vo)) < m && (c = y, m = g);
                m = 1 / 0;
                for (var k = 0; k < 32 && !(v < ho); k++) h = c - v, f = c + v, vo[0] = To(e, i, a, r, h), vo[1] = To(t, n, o, s, h), g = Te(vo, po), 0 <= h && g < m ? (c = h, m = g) : (mo[0] = To(e, i, a, r, f), mo[1] = To(t, n, o, s, f), p = Te(mo, po), f <= 1 && p < m ? (c = f, m = p) : v *= .5);
                return uo(m)
            }(e, t, i, n, a, o, r, s, d, u) <= c / 2
        }

        function nr(e, t, i, n, a, o, r, s, l) {
            if (0 === r) return !1;
            var d = r;
            return !(t + d < l && n + d < l && o + d < l || l < t - d && l < n - d && l < o - d || e + d < s && i + d < s && a + d < s || s < e - d && s < i - d && s < a - d) && function (e, t, i, n, a, o, r, s, l) {
                var d, u = .005, c = 1 / 0;
                po[0] = r, po[1] = s;
                for (var h = 0; h < 1; h += .05) vo[0] = bo(e, i, a, h), vo[1] = bo(t, n, o, h), (v = Te(po, vo)) < c && (d = h, c = v);
                c = 1 / 0;
                for (var f = 0; f < 32 && !(u < ho); f++) {
                    var g = d - u, p = d + u;
                    vo[0] = bo(e, i, a, g), vo[1] = bo(t, n, o, g);
                    var v = Te(vo, po);
                    if (0 <= g && v < c) d = g, c = v; else {
                        mo[0] = bo(e, i, a, p), mo[1] = bo(t, n, o, p);
                        var m = Te(mo, po);
                        p <= 1 && m < c ? (d = p, c = m) : u *= .5
                    }
                }
                return uo(c)
            }(e, t, i, n, a, o, s, l) <= d / 2
        }

        er.prototype = {
            constructor: er,
            _xi: 0,
            _yi: 0,
            _x0: 0,
            _y0: 0,
            _ux: 0,
            _uy: 0,
            _len: 0,
            _lineDash: null,
            _dashOffset: 0,
            _dashIdx: 0,
            _dashSum: 0,
            setScale: function (e, t, i) {
                i = i || 0, this._ux = Zo(i / gi / e) || 0, this._uy = Zo(i / gi / t) || 0
            },
            getContext: function () {
                return this._ctx
            },
            beginPath: function (e) {
                return (this._ctx = e) && e.beginPath(), e && (this.dpr = e.dpr), this._saveData && (this._len = 0), this._lineDash && (this._lineDash = null, this._dashOffset = 0), this
            },
            moveTo: function (e, t) {
                return this.addData(Vo.M, e, t), this._ctx && this._ctx.moveTo(e, t), this._x0 = e, this._y0 = t, this._xi = e, this._yi = t, this
            },
            lineTo: function (e, t) {
                var i = Zo(e - this._xi) > this._ux || Zo(t - this._yi) > this._uy || this._len < 5;
                return this.addData(Vo.L, e, t), this._ctx && i && (this._needsDash() ? this._dashedLineTo(e, t) : this._ctx.lineTo(e, t)), i && (this._xi = e, this._yi = t), this
            },
            bezierCurveTo: function (e, t, i, n, a, o) {
                return this.addData(Vo.C, e, t, i, n, a, o), this._ctx && (this._needsDash() ? this._dashedBezierTo(e, t, i, n, a, o) : this._ctx.bezierCurveTo(e, t, i, n, a, o)), this._xi = a, this._yi = o, this
            },
            quadraticCurveTo: function (e, t, i, n) {
                return this.addData(Vo.Q, e, t, i, n), this._ctx && (this._needsDash() ? this._dashedQuadraticTo(e, t, i, n) : this._ctx.quadraticCurveTo(e, t, i, n)), this._xi = i, this._yi = n, this
            },
            arc: function (e, t, i, n, a, o) {
                return this.addData(Vo.A, e, t, i, i, n, a - n, 0, o ? 0 : 1), this._ctx && this._ctx.arc(e, t, i, n, a, o), this._xi = qo(a) * i + e, this._yi = Yo(a) * i + t, this
            },
            arcTo: function (e, t, i, n, a) {
                return this._ctx && this._ctx.arcTo(e, t, i, n, a), this
            },
            rect: function (e, t, i, n) {
                return this._ctx && this._ctx.rect(e, t, i, n), this.addData(Vo.R, e, t, i, n), this
            },
            closePath: function () {
                this.addData(Vo.Z);
                var e = this._ctx, t = this._x0, i = this._y0;
                return e && (this._needsDash() && this._dashedLineTo(t, i), e.closePath()), this._xi = t, this._yi = i, this
            },
            fill: function (e) {
                e && e.fill(), this.toStatic()
            },
            stroke: function (e) {
                e && e.stroke(), this.toStatic()
            },
            setLineDash: function (e) {
                if (e instanceof Array) {
                    this._lineDash = e;
                    for (var t = this._dashIdx = 0, i = 0; i < e.length; i++) t += e[i];
                    this._dashSum = t
                }
                return this
            },
            setLineDashOffset: function (e) {
                return this._dashOffset = e, this
            },
            len: function () {
                return this._len
            },
            setData: function (e) {
                var t = e.length;
                this.data && this.data.length === t || !Qo || (this.data = new Float32Array(t));
                for (var i = 0; i < t; i++) this.data[i] = e[i];
                this._len = t
            },
            appendPath: function (e) {
                e instanceof Array || (e = [e]);
                for (var t = e.length, i = 0, n = this._len, a = 0; a < t; a++) i += e[a].len();
                for (Qo && this.data instanceof Float32Array && (this.data = new Float32Array(n + i)), a = 0; a < t; a++) for (var o = e[a].data, r = 0; r < o.length; r++) this.data[n++] = o[r];
                this._len = n
            },
            addData: function (e) {
                if (this._saveData) {
                    var t = this.data;
                    this._len + arguments.length > t.length && (this._expandData(), t = this.data);
                    for (var i = 0; i < arguments.length; i++) t[this._len++] = arguments[i];
                    this._prevCmd = e
                }
            },
            _expandData: function () {
                if (!(this.data instanceof Array)) {
                    for (var e = [], t = 0; t < this._len; t++) e[t] = this.data[t];
                    this.data = e
                }
            },
            _needsDash: function () {
                return this._lineDash
            },
            _dashedLineTo: function (e, t) {
                var i, n, a = this._dashSum, o = this._dashOffset, r = this._lineDash, s = this._ctx, l = this._xi,
                    d = this._yi, u = e - l, c = t - d, h = Jo(u * u + c * c), f = l, g = d, p = r.length;
                for (o < 0 && (o = a + o), f -= (o %= a) * (u /= h), g -= o * (c /= h); 0 < u && f <= e || u < 0 && e <= f || 0 === u && (0 < c && g <= t || c < 0 && t <= g);) f += u * (i = r[n = this._dashIdx]), g += c * i, this._dashIdx = (n + 1) % p, 0 < u && f < l || u < 0 && l < f || 0 < c && g < d || c < 0 && d < g || s[n % 2 ? "moveTo" : "lineTo"](0 <= u ? $o(f, e) : Xo(f, e), 0 <= c ? $o(g, t) : Xo(g, t));
                u = f - e, c = g - t, this._dashOffset = -Jo(u * u + c * c)
            },
            _dashedBezierTo: function (e, t, i, n, a, o) {
                var r, s, l, d, u, c = this._dashSum, h = this._dashOffset, f = this._lineDash, g = this._ctx,
                    p = this._xi, v = this._yi, m = To, y = 0, k = this._dashIdx, T = f.length, w = 0;
                for (h < 0 && (h = c + h), h %= c, r = 0; r < 1; r += .1) s = m(p, e, i, a, r + .1) - m(p, e, i, a, r), l = m(v, t, n, o, r + .1) - m(v, t, n, o, r), y += Jo(s * s + l * l);
                for (; k < T && !(h < (w += f[k])); k++) ;
                for (r = (w - h) / y; r <= 1;) d = m(p, e, i, a, r), u = m(v, t, n, o, r), k % 2 ? g.moveTo(d, u) : g.lineTo(d, u), r += f[k] / y, k = (k + 1) % T;
                k % 2 != 0 && g.lineTo(a, o), s = a - d, l = o - u, this._dashOffset = -Jo(s * s + l * l)
            },
            _dashedQuadraticTo: function (e, t, i, n) {
                var a = i, o = n;
                i = (i + 2 * e) / 3, n = (n + 2 * t) / 3, e = (this._xi + 2 * e) / 3, t = (this._yi + 2 * t) / 3, this._dashedBezierTo(e, t, i, n, a, o)
            },
            toStatic: function () {
                var e = this.data;
                e instanceof Array && (e.length = this._len, Qo && (this.data = new Float32Array(e)))
            },
            getBoundingRect: function () {
                Ho[0] = Ho[1] = jo[0] = jo[1] = Number.MAX_VALUE, zo[0] = zo[1] = Go[0] = Go[1] = -Number.MAX_VALUE;
                for (var e, t, i, n, a, o, r, s, l, d, u, c, h, f, g = this.data, p = 0, v = 0, m = 0, y = 0, k = 0; k < g.length;) {
                    var T = g[k++];
                    switch (1 === k && (m = p = g[k], y = v = g[k + 1]), T) {
                        case Vo.M:
                            p = m = g[k++], v = y = g[k++], jo[0] = m, jo[1] = y, Go[0] = m, Go[1] = y;
                            break;
                        case Vo.L:
                            Bo(p, v, g[k], g[k + 1], jo, Go), p = g[k++], v = g[k++];
                            break;
                        case Vo.C:
                            Ko(p, v, g[k++], g[k++], g[k++], g[k++], g[k], g[k + 1], jo, Go), p = g[k++], v = g[k++];
                            break;
                        case Vo.Q:
                            e = p, t = v, i = g[k++], n = g[k++], a = g[k], o = g[k + 1], r = jo, s = Go, d = l = void 0, d = bo, u = xo(Do((l = _o)(e, i, a), 1), 0), c = xo(Do(l(t, n, o), 1), 0), h = d(e, i, a, u), f = d(t, n, o, c), r[0] = Do(e, a, h), r[1] = Do(t, o, f), s[0] = xo(e, a, h), s[1] = xo(t, o, f), p = g[k++], v = g[k++];
                            break;
                        case Vo.A:
                            var w = g[k++], C = g[k++], S = g[k++], b = g[k++], I = g[k++], _ = g[k++] + I;
                            k += 1;
                            var A = 1 - g[k++];
                            1 === k && (m = qo(I) * S + w, y = Yo(I) * b + C), Wo(w, C, S, b, I, _, A, jo, Go), p = qo(_) * S + w, v = Yo(_) * b + C;
                            break;
                        case Vo.R:
                            Bo(m = p = g[k++], y = v = g[k++], m + g[k++], y + g[k++], jo, Go);
                            break;
                        case Vo.Z:
                            p = m, v = y
                    }
                    Se(Ho, Ho, jo), be(zo, zo, Go)
                }
                return 0 === k && (Ho[0] = Ho[1] = zo[0] = zo[1] = 0), new Ai(Ho[0], Ho[1], zo[0] - Ho[0], zo[1] - Ho[1])
            },
            rebuildPath: function (e) {
                for (var t, i, n, a, o, r, s = this.data, l = this._ux, d = this._uy, u = this._len, c = 0; c < u;) {
                    var h = s[c++];
                    switch (1 === c && (t = n = s[c], i = a = s[c + 1]), h) {
                        case Vo.M:
                            t = n = s[c++], i = a = s[c++], e.moveTo(n, a);
                            break;
                        case Vo.L:
                            o = s[c++], r = s[c++], (Zo(o - n) > l || Zo(r - a) > d || c === u - 1) && (e.lineTo(o, r), n = o, a = r);
                            break;
                        case Vo.C:
                            e.bezierCurveTo(s[c++], s[c++], s[c++], s[c++], s[c++], s[c++]), n = s[c - 2], a = s[c - 1];
                            break;
                        case Vo.Q:
                            e.quadraticCurveTo(s[c++], s[c++], s[c++], s[c++]), n = s[c - 2], a = s[c - 1];
                            break;
                        case Vo.A:
                            var f = s[c++], g = s[c++], p = s[c++], v = s[c++], m = s[c++], y = s[c++], k = s[c++],
                                T = s[c++], w = v < p ? p : v, C = v < p ? 1 : p / v, S = v < p ? v / p : 1, b = m + y;
                            .001 < Math.abs(p - v) ? (e.translate(f, g), e.rotate(k), e.scale(C, S), e.arc(0, 0, w, m, b, 1 - T), e.scale(1 / C, 1 / S), e.rotate(-k), e.translate(-f, -g)) : e.arc(f, g, w, m, b, 1 - T), 1 === c && (t = qo(m) * p + f, i = Yo(m) * v + g), n = qo(b) * p + f, a = Yo(b) * v + g;
                            break;
                        case Vo.R:
                            t = n = s[c], i = a = s[c + 1], e.rect(s[c++], s[c++], s[c++], s[c++]);
                            break;
                        case Vo.Z:
                            e.closePath(), n = t, a = i
                    }
                }
            }
        }, er.CMD = Vo;
        var ar = 2 * Math.PI;

        function or(e) {
            return (e %= ar) < 0 && (e += ar), e
        }

        var rr = 2 * Math.PI;

        function sr(e, t, i, n, a, o, r, s, l) {
            if (0 === r) return !1;
            var d = r;
            s -= e, l -= t;
            var u = Math.sqrt(s * s + l * l);
            if (i < u - d || u + d < i) return !1;
            if (Math.abs(n - a) % rr < 1e-4) return !0;
            if (o) {
                var c = n;
                n = or(a), a = or(c)
            } else n = or(n), a = or(a);
            a < n && (a += rr);
            var h = Math.atan2(l, s);
            return h < 0 && (h += rr), n <= h && h <= a || n <= h + rr && h + rr <= a
        }

        function lr(e, t, i, n, a, o) {
            if (t < o && n < o || o < t && o < n) return 0;
            if (n === t) return 0;
            var r = n < t ? 1 : -1, s = (o - t) / (n - t);
            1 != s && 0 != s || (r = n < t ? .5 : -.5);
            var l = s * (i - e) + e;
            return l === a ? 1 / 0 : a < l ? r : 0
        }

        var dr = er.CMD, ur = 2 * Math.PI, cr = 1e-4, hr = [-1, -1, -1], fr = [-1, -1];

        function gr(e, t, i, n, a, o, r, s, l, d) {
            if (t < d && n < d && o < d && s < d || d < t && d < n && d < o && d < s) return 0;
            var u, c = function (e, t, i, n, a, o) {
                var r = n + 3 * (t - i) - e, s = 3 * (i - 2 * t + e), l = 3 * (t - e), d = e - a, u = s * s - 3 * r * l,
                    c = s * l - 9 * r * d, h = l * l - 3 * s * d, f = 0;
                if (yo(u) && yo(c)) yo(s) ? o[0] = 0 : 0 <= (b = -l / s) && b <= 1 && (o[f++] = b); else {
                    var g = c * c - 4 * u * h;
                    if (yo(g)) {
                        var p = c / u, v = -p / 2;
                        0 <= (b = -s / r + p) && b <= 1 && (o[f++] = b), 0 <= v && v <= 1 && (o[f++] = v)
                    } else if (0 < g) {
                        var m = uo(g), y = u * s + 1.5 * r * (-c + m), k = u * s + 1.5 * r * (-c - m);
                        0 <= (b = (-s - ((y = y < 0 ? -lo(-y, go) : lo(y, go)) + (k = k < 0 ? -lo(-k, go) : lo(k, go)))) / (3 * r)) && b <= 1 && (o[f++] = b)
                    } else {
                        var T = (2 * u * s - 3 * r * c) / (2 * uo(u * u * u)), w = Math.acos(T) / 3, C = uo(u),
                            S = Math.cos(w), b = (-s - 2 * C * S) / (3 * r),
                            I = (v = (-s + C * (S + fo * Math.sin(w))) / (3 * r), (-s + C * (S - fo * Math.sin(w))) / (3 * r));
                        0 <= b && b <= 1 && (o[f++] = b), 0 <= v && v <= 1 && (o[f++] = v), 0 <= I && I <= 1 && (o[f++] = I)
                    }
                }
                return f
            }(t, n, o, s, d, hr);
            if (0 === c) return 0;
            for (var h, f, g = 0, p = -1, v = 0; v < c; v++) {
                var m = hr[v], y = 0 === m || 1 === m ? .5 : 1;
                To(e, i, a, r, m) < l || (p < 0 && (p = Co(t, n, o, s, fr), fr[1] < fr[0] && 1 < p && (u = fr[0], fr[0] = fr[1], fr[1] = u), h = To(t, n, o, s, fr[0]), 1 < p && (f = To(t, n, o, s, fr[1]))), 2 === p ? m < fr[0] ? g += h < t ? y : -y : m < fr[1] ? g += f < h ? y : -y : g += s < f ? y : -y : m < fr[0] ? g += h < t ? y : -y : g += s < h ? y : -y)
            }
            return g
        }

        function pr(e, t, i, n, a, o, r, s) {
            if (t < s && n < s && o < s || s < t && s < n && s < o) return 0;
            var l = function (e, t, i, n, a) {
                var o = e - 2 * t + i, r = 2 * (t - e), s = e - n, l = 0;
                if (yo(o)) ko(r) && 0 <= (u = -s / r) && u <= 1 && (a[l++] = u); else {
                    var d = r * r - 4 * o * s;
                    if (yo(d)) 0 <= (u = -r / (2 * o)) && u <= 1 && (a[l++] = u); else if (0 < d) {
                        var u, c = uo(d), h = (-r - c) / (2 * o);
                        0 <= (u = (-r + c) / (2 * o)) && u <= 1 && (a[l++] = u), 0 <= h && h <= 1 && (a[l++] = h)
                    }
                }
                return l
            }(t, n, o, s, hr);
            if (0 === l) return 0;
            var d = _o(t, n, o);
            if (0 <= d && d <= 1) {
                for (var u = 0, c = bo(t, n, o, d), h = 0; h < l; h++) {
                    var f = 0 === hr[h] || 1 === hr[h] ? .5 : 1;
                    bo(e, i, a, hr[h]) < r || (hr[h] < d ? u += c < t ? f : -f : u += o < c ? f : -f)
                }
                return u
            }
            return f = 0 === hr[0] || 1 === hr[0] ? .5 : 1, bo(e, i, a, hr[0]) < r ? 0 : o < t ? f : -f
        }

        function vr(e, t, i, n, a, o, r, s) {
            if (i < (s -= t) || s < -i) return 0;
            var l = Math.sqrt(i * i - s * s);
            hr[0] = -l, hr[1] = l;
            var d = Math.abs(n - a);
            if (d < 1e-4) return 0;
            if (d % ur < 1e-4) {
                a = ur;
                var u = o ? 1 : -1;
                return r >= hr[n = 0] + e && r <= hr[1] + e ? u : 0
            }
            o ? (l = n, n = or(a), a = or(l)) : (n = or(n), a = or(a)), a < n && (a += ur);
            for (var c = 0, h = 0; h < 2; h++) {
                var f = hr[h];
                if (r < f + e) {
                    var g = Math.atan2(s, f);
                    u = o ? 1 : -1, g < 0 && (g = ur + g), (n <= g && g <= a || n <= g + ur && g + ur <= a) && (g > Math.PI / 2 && g < 1.5 * Math.PI && (u = -u), c += u)
                }
            }
            return c
        }

        function mr(e, t, i, n, a) {
            for (var o = 0, r = 0, s = 0, l = 0, d = 0, u = 0; u < e.length;) {
                var c = e[u++];
                switch (c === dr.M && 1 < u && (i || (o += lr(r, s, l, d, n, a))), 1 === u && (l = r = e[u], d = s = e[u + 1]), c) {
                    case dr.M:
                        r = l = e[u++], s = d = e[u++];
                        break;
                    case dr.L:
                        if (i) {
                            if (tr(r, s, e[u], e[u + 1], t, n, a)) return !0
                        } else o += lr(r, s, e[u], e[u + 1], n, a) || 0;
                        r = e[u++], s = e[u++];
                        break;
                    case dr.C:
                        if (i) {
                            if (ir(r, s, e[u++], e[u++], e[u++], e[u++], e[u], e[u + 1], t, n, a)) return !0
                        } else o += gr(r, s, e[u++], e[u++], e[u++], e[u++], e[u], e[u + 1], n, a) || 0;
                        r = e[u++], s = e[u++];
                        break;
                    case dr.Q:
                        if (i) {
                            if (nr(r, s, e[u++], e[u++], e[u], e[u + 1], t, n, a)) return !0
                        } else o += pr(r, s, e[u++], e[u++], e[u], e[u + 1], n, a) || 0;
                        r = e[u++], s = e[u++];
                        break;
                    case dr.A:
                        var h = e[u++], f = e[u++], g = e[u++], p = e[u++], v = e[u++], m = e[u++];
                        u += 1;
                        var y = 1 - e[u++], k = Math.cos(v) * g + h, T = Math.sin(v) * p + f;
                        1 < u ? o += lr(r, s, k, T, n, a) : (l = k, d = T);
                        var w = (n - h) * p / g + h;
                        if (i) {
                            if (sr(h, f, p, v, v + m, y, t, w, a)) return !0
                        } else o += vr(h, f, p, v, v + m, y, w, a);
                        r = Math.cos(v + m) * g + h, s = Math.sin(v + m) * p + f;
                        break;
                    case dr.R:
                        if (l = r = e[u++], d = s = e[u++], k = l + e[u++], T = d + e[u++], i) {
                            if (tr(l, d, k, d, t, n, a) || tr(k, d, k, T, t, n, a) || tr(k, T, l, T, t, n, a) || tr(l, T, l, d, t, n, a)) return !0
                        } else o += lr(k, d, k, T, n, a), o += lr(l, T, l, d, n, a);
                        break;
                    case dr.Z:
                        if (i) {
                            if (tr(r, s, l, d, t, n, a)) return !0
                        } else o += lr(r, s, l, d, n, a);
                        r = l, s = d
                }
            }
            return i || function (e, t) {
                return Math.abs(e - t) < cr
            }(s, d) || (o += lr(r, s, l, d, n, a) || 0), 0 !== o
        }

        var yr = $i.prototype.getCanvasPattern, kr = Math.abs, Tr = new er(!0);

        function wr(e) {
            Xn.call(this, e), this.path = null
        }

        function Cr(e) {
            return Math.sqrt(e[0] * e[0] + e[1] * e[1])
        }

        wr.prototype = {
            constructor: wr,
            type: "path",
            __dirtyPath: !0,
            strokeContainThreshold: 5,
            segmentIgnoreThreshold: 0,
            subPixelOptimize: !1,
            brush: function (e, t) {
                var i, n = this.style, a = this.path || Tr, o = n.hasStroke(), r = n.hasFill(), s = n.fill,
                    l = n.stroke, d = r && !!s.colorStops, u = o && !!l.colorStops, c = r && !!s.image,
                    h = o && !!l.image;
                n.bind(e, this, t), this.setTransform(e), this.__dirty && (d && (i = i || this.getBoundingRect(), this._fillGradient = n.getGradient(e, s, i)), u && (i = i || this.getBoundingRect(), this._strokeGradient = n.getGradient(e, l, i))), d ? e.fillStyle = this._fillGradient : c && (e.fillStyle = yr.call(s, e)), u ? e.strokeStyle = this._strokeGradient : h && (e.strokeStyle = yr.call(l, e));
                var f = n.lineDash, g = n.lineDashOffset, p = !!e.setLineDash, v = this.getGlobalScale();
                if (a.setScale(v[0], v[1], this.segmentIgnoreThreshold), this.__dirtyPath || f && !p && o ? (a.beginPath(e), f && !p && (a.setLineDash(f), a.setLineDashOffset(g)), this.buildPath(a, this.shape, !1), this.path && (this.__dirtyPath = !1)) : (e.beginPath(), this.path.rebuildPath(e)), r) if (null != n.fillOpacity) {
                    var m = e.globalAlpha;
                    e.globalAlpha = n.fillOpacity * n.opacity, a.fill(e), e.globalAlpha = m
                } else a.fill(e);
                f && p && (e.setLineDash(f), e.lineDashOffset = g), o && (null != n.strokeOpacity ? (m = e.globalAlpha, e.globalAlpha = n.strokeOpacity * n.opacity, a.stroke(e), e.globalAlpha = m) : a.stroke(e)), f && p && e.setLineDash([]), null != n.text && (this.restoreTransform(e), this.drawRectText(e, this.getBoundingRect()))
            },
            buildPath: function (e, t, i) {
            },
            createPathProxy: function () {
                this.path = new er
            },
            getBoundingRect: function () {
                var e = this._rect, t = this.style, i = !e;
                if (i) {
                    var n = this.path;
                    n = n || (this.path = new er), this.__dirtyPath && (n.beginPath(), this.buildPath(n, this.shape, !1)), e = n.getBoundingRect()
                }
                if (this._rect = e, t.hasStroke()) {
                    var a = this._rectWithStroke || (this._rectWithStroke = e.clone());
                    if (this.__dirty || i) {
                        a.copy(e);
                        var o = t.lineWidth, r = t.strokeNoScale ? this.getLineScale() : 1;
                        t.hasFill() || (o = Math.max(o, this.strokeContainThreshold || 4)), 1e-10 < r && (a.width += o / r, a.height += o / r, a.x -= o / r / 2, a.y -= o / r / 2)
                    }
                    return a
                }
                return e
            },
            contain: function (e, t) {
                var i = this.transformCoordToLocal(e, t), n = this.getBoundingRect(), a = this.style;
                if (e = i[0], t = i[1], n.contain(e, t)) {
                    var o = this.path.data;
                    if (a.hasStroke()) {
                        var r = a.lineWidth, s = a.strokeNoScale ? this.getLineScale() : 1;
                        if (1e-10 < s && (a.hasFill() || (r = Math.max(r, this.strokeContainThreshold)), function (e, t, i, n) {
                            return mr(e, t, !0, i, n)
                        }(o, r / s, e, t))) return !0
                    }
                    if (a.hasFill()) return function (e, t, i) {
                        return mr(e, 0, !1, t, i)
                    }(o, e, t)
                }
                return !1
            },
            dirty: function (e) {
                null == e && (e = !0), e && (this.__dirtyPath = e, this._rect = null), this.__dirty = this.__dirtyText = !0, this.__zr && this.__zr.refresh(), this.__clipTarget && this.__clipTarget.dirty()
            },
            animateShape: function (e) {
                return this.animate("shape", e)
            },
            attrKV: function (e, t) {
                "shape" === e ? (this.setShape(t), this.__dirtyPath = !0, this._rect = null) : Xn.prototype.attrKV.call(this, e, t)
            },
            setShape: function (e, t) {
                var i = this.shape;
                if (i) {
                    if (B(e)) for (var n in e) e.hasOwnProperty(n) && (i[n] = e[n]); else i[e] = t;
                    this.dirty(!0)
                }
                return this
            },
            getLineScale: function () {
                var e = this.transform;
                return e && 1e-10 < kr(e[0] - 1) && 1e-10 < kr(e[3] - 1) ? Math.sqrt(kr(e[0] * e[3] - e[2] * e[1])) : 1
            }
        }, wr.extend = function (e) {
            function t(t) {
                wr.call(this, t), e.style && this.style.extendFrom(e.style, !1);
                var i = e.shape;
                if (i) {
                    this.shape = this.shape || {};
                    var n = this.shape;
                    for (var a in i) !n.hasOwnProperty(a) && i.hasOwnProperty(a) && (n[a] = i[a])
                }
                e.init && e.init.call(this, t)
            }

            for (var i in b(t, wr), e) "style" !== i && "shape" !== i && (t.prototype[i] = e[i]);
            return t
        }, b(wr, Xn);
        var Sr = er.CMD, br = [[], [], []], Ir = Math.sqrt, _r = Math.atan2, Ar = function (e, t) {
            var i, n, a, o, r, s = e.data, l = Sr.M, d = Sr.C, u = Sr.L, c = Sr.R, h = Sr.A, f = Sr.Q;
            for (o = a = 0; a < s.length;) {
                switch (i = s[a++], o = a, n = 0, i) {
                    case l:
                    case u:
                        n = 1;
                        break;
                    case d:
                        n = 3;
                        break;
                    case f:
                        n = 2;
                        break;
                    case h:
                        var g = t[4], p = t[5], v = Ir(t[0] * t[0] + t[1] * t[1]), m = Ir(t[2] * t[2] + t[3] * t[3]),
                            y = _r(-t[1] / m, t[0] / v);
                        s[a] *= v, s[a++] += g, s[a] *= m, s[a++] += p, s[a++] *= v, s[a++] *= m, s[a++] += y, s[a++] += y, o = a += 2;
                        break;
                    case c:
                        k[0] = s[a++], k[1] = s[a++], Ce(k, k, t), s[o++] = k[0], s[o++] = k[1], k[0] += s[a++], k[1] += s[a++], Ce(k, k, t), s[o++] = k[0], s[o++] = k[1]
                }
                for (r = 0; r < n; r++) {
                    var k;
                    (k = br[r])[0] = s[a++], k[1] = s[a++], Ce(k, k, t), s[o++] = k[0], s[o++] = k[1]
                }
            }
        }, Dr = Math.sqrt, xr = Math.sin, Nr = Math.cos, Er = Math.PI, Pr = function (e, t) {
            return (e[0] * t[0] + e[1] * t[1]) / (Cr(e) * Cr(t))
        }, Mr = function (e, t) {
            return (e[0] * t[1] < e[1] * t[0] ? -1 : 1) * Math.acos(Pr(e, t))
        };

        function Or(e, t, i, n, a, o, r, s, l, d, u) {
            var c = l * (Er / 180), h = Nr(c) * (e - i) / 2 + xr(c) * (t - n) / 2,
                f = -1 * xr(c) * (e - i) / 2 + Nr(c) * (t - n) / 2, g = h * h / (r * r) + f * f / (s * s);
            1 < g && (r *= Dr(g), s *= Dr(g));
            var p = (a === o ? -1 : 1) * Dr((r * r * (s * s) - r * r * (f * f) - s * s * (h * h)) / (r * r * (f * f) + s * s * (h * h))) || 0,
                v = p * r * f / s, m = p * -s * h / r, y = (e + i) / 2 + Nr(c) * v - xr(c) * m,
                k = (t + n) / 2 + xr(c) * v + Nr(c) * m, T = Mr([1, 0], [(h - v) / r, (f - m) / s]),
                w = [(h - v) / r, (f - m) / s], C = [(-1 * h - v) / r, (-1 * f - m) / s], S = Mr(w, C);
            Pr(w, C) <= -1 && (S = Er), 1 <= Pr(w, C) && (S = 0), 0 === o && 0 < S && (S -= 2 * Er), 1 === o && S < 0 && (S += 2 * Er), u.addData(d, y, k, r, s, T, S, c, o)
        }

        var Fr = /([mlvhzcqtsa])([^mlvhzcqtsa]*)/gi, Lr = /-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;

        function Br(e, t) {
            var i = function (e) {
                if (!e) return new er;
                for (var t, i = 0, n = 0, a = i, o = n, r = new er, s = er.CMD, l = e.match(Fr), d = 0; d < l.length; d++) {
                    for (var u, c = l[d], h = c.charAt(0), f = c.match(Lr) || [], g = f.length, p = 0; p < g; p++) f[p] = parseFloat(f[p]);
                    for (var v = 0; v < g;) {
                        var m, y, k, T, w, C, S, b = i, I = n;
                        switch (h) {
                            case"l":
                                i += f[v++], n += f[v++], u = s.L, r.addData(u, i, n);
                                break;
                            case"L":
                                i = f[v++], n = f[v++], u = s.L, r.addData(u, i, n);
                                break;
                            case"m":
                                i += f[v++], n += f[v++], u = s.M, r.addData(u, i, n), a = i, o = n, h = "l";
                                break;
                            case"M":
                                i = f[v++], n = f[v++], u = s.M, r.addData(u, i, n), a = i, o = n, h = "L";
                                break;
                            case"h":
                                i += f[v++], u = s.L, r.addData(u, i, n);
                                break;
                            case"H":
                                i = f[v++], u = s.L, r.addData(u, i, n);
                                break;
                            case"v":
                                n += f[v++], u = s.L, r.addData(u, i, n);
                                break;
                            case"V":
                                n = f[v++], u = s.L, r.addData(u, i, n);
                                break;
                            case"C":
                                u = s.C, r.addData(u, f[v++], f[v++], f[v++], f[v++], f[v++], f[v++]), i = f[v - 2], n = f[v - 1];
                                break;
                            case"c":
                                u = s.C, r.addData(u, f[v++] + i, f[v++] + n, f[v++] + i, f[v++] + n, f[v++] + i, f[v++] + n), i += f[v - 2], n += f[v - 1];
                                break;
                            case"S":
                                m = i, y = n;
                                var _ = r.len(), A = r.data;
                                t === s.C && (m += i - A[_ - 4], y += n - A[_ - 3]), u = s.C, b = f[v++], I = f[v++], i = f[v++], n = f[v++], r.addData(u, m, y, b, I, i, n);
                                break;
                            case"s":
                                m = i, y = n, _ = r.len(), A = r.data, t === s.C && (m += i - A[_ - 4], y += n - A[_ - 3]), u = s.C, b = i + f[v++], I = n + f[v++], i += f[v++], n += f[v++], r.addData(u, m, y, b, I, i, n);
                                break;
                            case"Q":
                                b = f[v++], I = f[v++], i = f[v++], n = f[v++], u = s.Q, r.addData(u, b, I, i, n);
                                break;
                            case"q":
                                b = f[v++] + i, I = f[v++] + n, i += f[v++], n += f[v++], u = s.Q, r.addData(u, b, I, i, n);
                                break;
                            case"T":
                                m = i, y = n, _ = r.len(), A = r.data, t === s.Q && (m += i - A[_ - 4], y += n - A[_ - 3]), i = f[v++], n = f[v++], u = s.Q, r.addData(u, m, y, i, n);
                                break;
                            case"t":
                                m = i, y = n, _ = r.len(), A = r.data, t === s.Q && (m += i - A[_ - 4], y += n - A[_ - 3]), i += f[v++], n += f[v++], u = s.Q, r.addData(u, m, y, i, n);
                                break;
                            case"A":
                                k = f[v++], T = f[v++], w = f[v++], C = f[v++], S = f[v++], Or(b = i, I = n, i = f[v++], n = f[v++], C, S, k, T, w, u = s.A, r);
                                break;
                            case"a":
                                k = f[v++], T = f[v++], w = f[v++], C = f[v++], S = f[v++], Or(b = i, I = n, i += f[v++], n += f[v++], C, S, k, T, w, u = s.A, r)
                        }
                    }
                    "z" !== h && "Z" !== h || (u = s.Z, r.addData(u), i = a, n = o), t = u
                }
                return r.toStatic(), r
            }(e);
            return (t = t || {}).buildPath = function (e) {
                if (e.setData) e.setData(i.data), (t = e.getContext()) && e.rebuildPath(t); else {
                    var t = e;
                    i.rebuildPath(t)
                }
            }, t.applyTransform = function (e) {
                Ar(i, e), this.dirty(!0)
            }, t
        }

        function Ur(e, t) {
            return new wr(Br(e, t))
        }

        var Rr = function (e) {
            Xn.call(this, e)
        };

        function Kr(e) {
            return a.browser.ie && 11 <= a.browser.version ? function () {
                var t, i = this.__clipPaths, n = this.style;
                if (i) for (var a = 0; a < i.length; a++) {
                    var o = i[a], r = o && o.shape, s = o && o.type;
                    if (r && ("sector" === s && r.startAngle === r.endAngle || "rect" === s && (!r.width || !r.height))) {
                        for (var l = 0; l < Vr.length; l++) Vr[l][2] = n[Vr[l][0]], n[Vr[l][0]] = Vr[l][1];
                        t = !0;
                        break
                    }
                }
                if (e.apply(this, arguments), t) for (l = 0; l < Vr.length; l++) n[Vr[l][0]] = Vr[l][2]
            } : e
        }

        Rr.prototype = {
            constructor: Rr, type: "text", brush: function (e, t) {
                var i = this.style;
                this.__dirty && En(i), i.fill = i.stroke = i.shadowBlur = i.shadowColor = i.shadowOffsetX = i.shadowOffsetY = null;
                var n = i.text;
                null != n && (n += ""), jn(n, i) ? (this.setTransform(e), Mn(this, e, n, i, null, t), this.restoreTransform(e)) : e.__attrCachedBy = Ki.NONE
            }, getBoundingRect: function () {
                var e = this.style;
                if (this.__dirty && En(e), !this._rect) {
                    var t = e.text;
                    null != t ? t += "" : t = "";
                    var i = cn(e.text + "", e.font, e.textAlign, e.textVerticalAlign, e.textPadding, e.textLineHeight, e.rich);
                    if (i.x += e.x || 0, i.y += e.y || 0, Wn(e.textStroke, e.textStrokeWidth)) {
                        var n = e.textStrokeWidth;
                        i.x -= n / 2, i.y -= n / 2, i.width += n, i.height += n
                    }
                    this._rect = i
                }
                return this._rect
            }
        }, b(Rr, Xn);
        var Wr = wr.extend({
                type: "circle", shape: {cx: 0, cy: 0, r: 0}, buildPath: function (e, t, i) {
                    i && e.moveTo(t.cx + t.r, t.cy), e.arc(t.cx, t.cy, t.r, 0, 2 * Math.PI, !0)
                }
            }), Vr = [["shadowBlur", 0], ["shadowColor", "#000"], ["shadowOffsetX", 0], ["shadowOffsetY", 0]],
            Hr = wr.extend({
                type: "sector",
                shape: {cx: 0, cy: 0, r0: 0, r: 0, startAngle: 0, endAngle: 2 * Math.PI, clockwise: !0},
                brush: Kr(wr.prototype.brush),
                buildPath: function (e, t) {
                    var i = t.cx, n = t.cy, a = Math.max(t.r0 || 0, 0), o = Math.max(t.r, 0), r = t.startAngle,
                        s = t.endAngle, l = t.clockwise, d = Math.cos(r), u = Math.sin(r);
                    e.moveTo(d * a + i, u * a + n), e.lineTo(d * o + i, u * o + n), e.arc(i, n, o, r, s, !l), e.lineTo(Math.cos(s) * a + i, Math.sin(s) * a + n), 0 !== a && e.arc(i, n, a, s, r, l), e.closePath()
                }
            }), zr = wr.extend({
                type: "ring", shape: {cx: 0, cy: 0, r: 0, r0: 0}, buildPath: function (e, t) {
                    var i = t.cx, n = t.cy, a = 2 * Math.PI;
                    e.moveTo(i + t.r, n), e.arc(i, n, t.r, 0, a, !1), e.moveTo(i + t.r0, n), e.arc(i, n, t.r0, 0, a, !0)
                }
            });

        function jr(e, t, i, n, a, o, r) {
            var s = .5 * (i - e), l = .5 * (n - t);
            return (2 * (t - i) + s + l) * r + (-3 * (t - i) - 2 * s - l) * o + s * a + t
        }

        function Gr(e, t, i) {
            var n = t.points, a = t.smooth;
            if (n && 2 <= n.length) {
                if (a && "spline" !== a) {
                    var o = function (e, t, i, n) {
                        var a, o, r, s, l = [], d = [], u = [], c = [];
                        if (n) {
                            r = [1 / 0, 1 / 0], s = [-1 / 0, -1 / 0];
                            for (var h = 0, f = e.length; h < f; h++) Se(r, r, e[h]), be(s, s, e[h]);
                            Se(r, r, n[0]), be(s, s, n[1])
                        }
                        for (h = 0, f = e.length; h < f; h++) {
                            var g = e[h];
                            if (i) a = e[h ? h - 1 : f - 1], o = e[(h + 1) % f]; else {
                                if (0 === h || h === f - 1) {
                                    l.push(re(e[h]));
                                    continue
                                }
                                a = e[h - 1], o = e[h + 1]
                            }
                            ue(d, o, a), pe(d, d, t);
                            var p = me(g, a), v = me(g, o), m = p + v;
                            0 !== m && (p /= m, v /= m), pe(u, d, -p), pe(c, d, v);
                            var y = le([], g, u), k = le([], g, c);
                            n && (be(y, y, r), Se(y, y, s), be(k, k, r), Se(k, k, s)), l.push(y), l.push(k)
                        }
                        return i && l.push(l.shift()), l
                    }(n, a, i, t.smoothConstraint);
                    e.moveTo(n[0][0], n[0][1]);
                    for (var r = n.length, s = 0; s < (i ? r : r - 1); s++) {
                        var l = o[2 * s], d = o[2 * s + 1], u = n[(s + 1) % r];
                        e.bezierCurveTo(l[0], l[1], d[0], d[1], u[0], u[1])
                    }
                } else {
                    "spline" === a && (n = function (e, t) {
                        for (var i = e.length, n = [], a = 0, o = 1; o < i; o++) a += me(e[o - 1], e[o]);
                        var r = a / 2;
                        for (r = r < i ? i : r, o = 0; o < r; o++) {
                            var s, l, d, u = o / (r - 1) * (t ? i : i - 1), c = Math.floor(u), h = u - c, f = e[c % i];
                            d = t ? (s = e[(c - 1 + i) % i], l = e[(c + 1) % i], e[(c + 2) % i]) : (s = e[0 === c ? c : c - 1], l = e[i - 2 < c ? i - 1 : c + 1], e[i - 3 < c ? i - 1 : c + 2]);
                            var g = h * h, p = h * g;
                            n.push([jr(s[0], f[0], l[0], d[0], h, g, p), jr(s[1], f[1], l[1], d[1], h, g, p)])
                        }
                        return n
                    }(n, i)), e.moveTo(n[0][0], n[0][1]), s = 1;
                    for (var c = n.length; s < c; s++) e.lineTo(n[s][0], n[s][1])
                }
                i && e.closePath()
            }
        }

        var $r = wr.extend({
            type: "polygon",
            shape: {points: null, smooth: !1, smoothConstraint: null},
            buildPath: function (e, t) {
                Gr(e, t, !0)
            }
        }), Xr = wr.extend({
            type: "polyline",
            shape: {points: null, smooth: !1, smoothConstraint: null},
            style: {stroke: "#000", fill: null},
            buildPath: function (e, t) {
                Gr(e, t, !1)
            }
        }), qr = Math.round;

        function Yr(e, t, i) {
            if (t) {
                var n = t.x1, a = t.x2, o = t.y1, r = t.y2;
                e.x1 = n, e.x2 = a, e.y1 = o, e.y2 = r;
                var s = i && i.lineWidth;
                s && (qr(2 * n) === qr(2 * a) && (e.x1 = e.x2 = Zr(n, s, !0)), qr(2 * o) === qr(2 * r) && (e.y1 = e.y2 = Zr(o, s, !0)))
            }
        }

        function Jr(e, t, i) {
            if (t) {
                var n = t.x, a = t.y, o = t.width, r = t.height;
                e.x = n, e.y = a, e.width = o, e.height = r;
                var s = i && i.lineWidth;
                s && (e.x = Zr(n, s, !0), e.y = Zr(a, s, !0), e.width = Math.max(Zr(n + o, s, !1) - e.x, 0 === o ? 0 : 1), e.height = Math.max(Zr(a + r, s, !1) - e.y, 0 === r ? 0 : 1))
            }
        }

        function Zr(e, t, i) {
            if (!t) return e;
            var n = qr(2 * e);
            return (n + qr(t)) % 2 == 0 ? n / 2 : (n + (i ? 1 : -1)) / 2
        }

        var Qr = {}, es = wr.extend({
            type: "rect", shape: {r: 0, x: 0, y: 0, width: 0, height: 0}, buildPath: function (e, t) {
                var i, n, a, o;
                this.subPixelOptimize ? (Jr(Qr, t, this.style), i = Qr.x, n = Qr.y, a = Qr.width, o = Qr.height, Qr.r = t.r, t = Qr) : (i = t.x, n = t.y, a = t.width, o = t.height), t.r ? bn(e, t) : e.rect(i, n, a, o), e.closePath()
            }
        }), ts = {}, is = wr.extend({
            type: "line",
            shape: {x1: 0, y1: 0, x2: 0, y2: 0, percent: 1},
            style: {stroke: "#000", fill: null},
            buildPath: function (e, t) {
                var i, n, a, o;
                o = this.subPixelOptimize ? (Yr(ts, t, this.style), i = ts.x1, n = ts.y1, a = ts.x2, ts.y2) : (i = t.x1, n = t.y1, a = t.x2, t.y2);
                var r = t.percent;
                0 !== r && (e.moveTo(i, n), r < 1 && (a = i * (1 - r) + a * r, o = n * (1 - r) + o * r), e.lineTo(a, o))
            },
            pointAt: function (e) {
                var t = this.shape;
                return [t.x1 * (1 - e) + t.x2 * e, t.y1 * (1 - e) + t.y2 * e]
            }
        }), ns = [];

        function as(e, t, i) {
            var n = e.cpx2, a = e.cpy2;
            return null === n || null === a ? [(i ? wo : To)(e.x1, e.cpx1, e.cpx2, e.x2, t), (i ? wo : To)(e.y1, e.cpy1, e.cpy2, e.y2, t)] : [(i ? Io : bo)(e.x1, e.cpx1, e.x2, t), (i ? Io : bo)(e.y1, e.cpy1, e.y2, t)]
        }

        function os(e) {
            this.colorStops = e || []
        }

        var rs = wr.extend({
            type: "bezier-curve",
            shape: {x1: 0, y1: 0, x2: 0, y2: 0, cpx1: 0, cpy1: 0, percent: 1},
            style: {stroke: "#000", fill: null},
            buildPath: function (e, t) {
                var i = t.x1, n = t.y1, a = t.x2, o = t.y2, r = t.cpx1, s = t.cpy1, l = t.cpx2, d = t.cpy2,
                    u = t.percent;
                0 !== u && (e.moveTo(i, n), null == l || null == d ? (u < 1 && (Ao(i, r, a, u, ns), r = ns[1], a = ns[2], Ao(n, s, o, u, ns), s = ns[1], o = ns[2]), e.quadraticCurveTo(r, s, a, o)) : (u < 1 && (So(i, r, l, a, u, ns), r = ns[1], l = ns[2], a = ns[3], So(n, s, d, o, u, ns), s = ns[1], d = ns[2], o = ns[3]), e.bezierCurveTo(r, s, l, d, a, o)))
            },
            pointAt: function (e) {
                return as(this.shape, e, !1)
            },
            tangentAt: function (e) {
                var t = as(this.shape, e, !0);
                return ve(t, t)
            }
        }), ss = wr.extend({
            type: "arc",
            shape: {cx: 0, cy: 0, r: 0, startAngle: 0, endAngle: 2 * Math.PI, clockwise: !0},
            style: {stroke: "#000", fill: null},
            buildPath: function (e, t) {
                var i = t.cx, n = t.cy, a = Math.max(t.r, 0), o = t.startAngle, r = t.endAngle, s = t.clockwise,
                    l = Math.cos(o), d = Math.sin(o);
                e.moveTo(l * a + i, d * a + n), e.arc(i, n, a, o, r, !s)
            }
        }), ls = wr.extend({
            type: "compound", shape: {paths: null}, _updatePathDirty: function () {
                for (var e = this.__dirtyPath, t = this.shape.paths, i = 0; i < t.length; i++) e = e || t[i].__dirtyPath;
                this.__dirtyPath = e, this.__dirty = this.__dirty || e
            }, beforeBrush: function () {
                this._updatePathDirty();
                for (var e = this.shape.paths || [], t = this.getGlobalScale(), i = 0; i < e.length; i++) e[i].path || e[i].createPathProxy(), e[i].path.setScale(t[0], t[1], e[i].segmentIgnoreThreshold)
            }, buildPath: function (e, t) {
                for (var i = t.paths || [], n = 0; n < i.length; n++) i[n].buildPath(e, i[n].shape, !0)
            }, afterBrush: function () {
                for (var e = this.shape.paths || [], t = 0; t < e.length; t++) e[t].__dirtyPath = !1
            }, getBoundingRect: function () {
                return this._updatePathDirty(), wr.prototype.getBoundingRect.call(this)
            }
        });

        function ds(e, t, i, n, a, o) {
            this.x = null == e ? 0 : e, this.y = null == t ? 0 : t, this.x2 = null == i ? 1 : i, this.y2 = null == n ? 0 : n, this.type = "linear", this.global = o || !1, os.call(this, a)
        }

        function us(e, t, i, n, a) {
            this.x = null == e ? .5 : e, this.y = null == t ? .5 : t, this.r = null == i ? .5 : i, this.type = "radial", this.global = a || !1, os.call(this, n)
        }

        function cs(e) {
            Xn.call(this, e), this._displayables = [], this._temporaryDisplayables = [], this._cursor = 0, this.notClear = !0
        }

        os.prototype = {
            constructor: os, addColorStop: function (e, t) {
                this.colorStops.push({offset: e, color: t})
            }
        }, ds.prototype = {constructor: ds}, b(ds, os), us.prototype = {constructor: us}, b(us, os), cs.prototype.incremental = !0, cs.prototype.clearDisplaybles = function () {
            this._displayables = [], this._temporaryDisplayables = [], this._cursor = 0, this.dirty(), this.notClear = !1
        }, cs.prototype.addDisplayable = function (e, t) {
            t ? this._temporaryDisplayables.push(e) : this._displayables.push(e), this.dirty()
        }, cs.prototype.addDisplayables = function (e, t) {
            t = t || !1;
            for (var i = 0; i < e.length; i++) this.addDisplayable(e[i], t)
        }, cs.prototype.eachPendingDisplayable = function (e) {
            for (var t = this._cursor; t < this._displayables.length; t++) e && e(this._displayables[t]);
            for (t = 0; t < this._temporaryDisplayables.length; t++) e && e(this._temporaryDisplayables[t])
        }, cs.prototype.update = function () {
            this.updateTransform();
            for (var e = this._cursor; e < this._displayables.length; e++) (t = this._displayables[e]).parent = this, t.update(), t.parent = null;
            for (e = 0; e < this._temporaryDisplayables.length; e++) {
                var t;
                (t = this._temporaryDisplayables[e]).parent = this, t.update(), t.parent = null
            }
        }, cs.prototype.brush = function (e, t) {
            for (var i = this._cursor; i < this._displayables.length; i++) (n = this._displayables[i]).beforeBrush && n.beforeBrush(e), n.brush(e, i === this._cursor ? null : this._displayables[i - 1]), n.afterBrush && n.afterBrush(e);
            for (this._cursor = i, i = 0; i < this._temporaryDisplayables.length; i++) {
                var n;
                (n = this._temporaryDisplayables[i]).beforeBrush && n.beforeBrush(e), n.brush(e, 0 === i ? null : this._temporaryDisplayables[i - 1]), n.afterBrush && n.afterBrush(e)
            }
            this._temporaryDisplayables = [], this.notClear = !0
        };
        var hs = [];
        cs.prototype.getBoundingRect = function () {
            if (!this._rect) {
                for (var e = new Ai(1 / 0, 1 / 0, -1 / 0, -1 / 0), t = 0; t < this._displayables.length; t++) {
                    var i = this._displayables[t], n = i.getBoundingRect().clone();
                    i.needLocalTransform() && n.applyTransform(i.getLocalTransform(hs)), e.union(n)
                }
                this._rect = e
            }
            return this._rect
        }, cs.prototype.contain = function (e, t) {
            var i = this.transformCoordToLocal(e, t);
            if (this.getBoundingRect().contain(i[0], i[1])) for (var n = 0; n < this._displayables.length; n++) if (this._displayables[n].contain(e, t)) return !0;
            return !1
        }, b(cs, Xn);
        var fs = Math.max, gs = Math.min, ps = {}, vs = 1,
            ms = {color: "textFill", textBorderColor: "textStroke", textBorderWidth: "textStrokeWidth"},
            ys = "emphasis", ks = "normal", Ts = 1, ws = {}, Cs = {};

        function Ss(e) {
            return wr.extend(e)
        }

        function bs(e, t) {
            Cs[e] = t
        }

        function Is(e) {
            if (Cs.hasOwnProperty(e)) return Cs[e]
        }

        function _s(e, t, i, n) {
            var a = Ur(e, t);
            return i && ("center" === n && (i = Ds(i, a.getBoundingRect())), Ns(a, i)), a
        }

        function As(e, t, i) {
            var n = new qn({
                style: {image: e, x: t.x, y: t.y, width: t.width, height: t.height}, onload: function (e) {
                    if ("center" === i) {
                        var a = {width: e.width, height: e.height};
                        n.setStyle(Ds(t, a))
                    }
                }
            });
            return n
        }

        function Ds(e, t) {
            var i, n = t.width / t.height, a = e.height * n;
            return i = a <= e.width ? e.height : (a = e.width) / n, {
                x: e.x + e.width / 2 - a / 2,
                y: e.y + e.height / 2 - i / 2,
                width: a,
                height: i
            }
        }

        var xs = function (e, t) {
            for (var i = [], n = e.length, a = 0; a < n; a++) {
                var o = e[a];
                o.path || o.createPathProxy(), o.__dirtyPath && o.buildPath(o.path, o.shape, !0), i.push(o.path)
            }
            var r = new wr(t);
            return r.createPathProxy(), r.buildPath = function (e) {
                e.appendPath(i);
                var t = e.getContext();
                t && e.rebuildPath(t)
            }, r
        };

        function Ns(e, t) {
            if (e.applyTransform) {
                var i = e.getBoundingRect().calculateTransform(t);
                e.applyTransform(i)
            }
        }

        var Es = Zr;

        function Ps(e) {
            return null != e && "none" !== e
        }

        var Ms = Q(), Os = 0;

        function Fs(e) {
            var t = e.__hoverStl;
            if (t && !e.__highlighted) {
                var i = e.__zr, n = e.useHoverLayer && i && "canvas" === i.painter.type;
                if (e.__highlighted = n ? "layer" : "plain", !(e.isGroup || !i && e.useHoverLayer)) {
                    var a = e, o = e.style;
                    n && (o = (a = i.addHover(e)).style), il(o), n || function (e) {
                        if (e.__hoverStlDirty) {
                            e.__hoverStlDirty = !1;
                            var t = e.__hoverStl;
                            if (t) {
                                var i = e.__cachedNormalStl = {};
                                e.__cachedNormalZ2 = e.z2;
                                var n = e.style;
                                for (var a in t) null != t[a] && (i[a] = n[a]);
                                i.fill = n.fill, i.stroke = n.stroke
                            } else e.__cachedNormalStl = e.__cachedNormalZ2 = null
                        }
                    }(a), o.extendFrom(t), Ls(o, t, "fill"), Ls(o, t, "stroke"), tl(o), n || (e.dirty(!1), e.z2 += vs)
                }
            }
        }

        function Ls(e, t, i) {
            !Ps(t[i]) && Ps(e[i]) && (e[i] = function (e) {
                if ("string" != typeof e) return e;
                var t = Ms.get(e);
                return t || (t = Ht(e, -.1), Os < 1e4 && (Ms.set(e, t), Os++)), t
            }(e[i]))
        }

        function Bs(e) {
            var t = e.__highlighted;
            if (t && (e.__highlighted = !1, !e.isGroup)) if ("layer" === t) e.__zr && e.__zr.removeHover(e); else {
                var i = e.style, n = e.__cachedNormalStl;
                n && (il(i), e.setStyle(n), tl(i));
                var a = e.__cachedNormalZ2;
                null != a && e.z2 - a === vs && (e.z2 = a)
            }
        }

        function Us(e, t, i) {
            var n, a = ks, o = ks;
            e.__highlighted && (a = ys, n = !0), t(e, i), e.__highlighted && (o = ys, n = !0), e.isGroup && e.traverse(function (e) {
                e.isGroup || t(e, i)
            }), n && e.__highDownOnUpdate && e.__highDownOnUpdate(a, o)
        }

        function Rs(e, t) {
            t = e.__hoverStl = !1 !== t && (e.hoverStyle || t || {}), e.__hoverStlDirty = !0, e.__highlighted && (e.__cachedNormalStl = null, Bs(e), Fs(e))
        }

        function Ks(e) {
            zs(this, e) || this.__highByOuter || Us(this, Fs)
        }

        function Ws(e) {
            zs(this, e) || this.__highByOuter || Us(this, Bs)
        }

        function Vs(e) {
            this.__highByOuter |= 1 << (e || 0), Us(this, Fs)
        }

        function Hs(e) {
            (this.__highByOuter &= ~(1 << (e || 0))) || Us(this, Bs)
        }

        function zs(e, t) {
            return e.__highDownSilentOnTouch && t.zrByTouch
        }

        function js(e, t) {
            Gs(e, !0), Us(e, Rs, t)
        }

        function Gs(e, t) {
            var i = !1 === t;
            if (e.__highDownSilentOnTouch = e.highDownSilentOnTouch, e.__highDownOnUpdate = e.highDownOnUpdate, !i || e.__highDownDispatcher) {
                var n = i ? "off" : "on";
                e[n]("mouseover", Ks)[n]("mouseout", Ws), e[n]("emphasis", Vs)[n]("normal", Hs), e.__highByOuter = e.__highByOuter || 0, e.__highDownDispatcher = !i
            }
        }

        function $s(e) {
            return !(!e || !e.__highDownDispatcher)
        }

        function Xs(e) {
            var t = ws[e];
            return null == t && Ts <= 32 && (t = ws[e] = Ts++), t
        }

        function qs(e, t, i, n, a, o, r) {
            var s, l = (a = a || ps).labelFetcher, d = a.labelDataIndex, u = a.labelDimIndex, c = a.labelProp,
                h = i.getShallow("show"), f = n.getShallow("show");
            (h || f) && (l && (s = l.getFormattedLabel(d, "normal", null, u, c)), null == s && (s = F(a.defaultText) ? a.defaultText(d, a) : a.defaultText));
            var g = h ? s : null, p = f ? H(l ? l.getFormattedLabel(d, "emphasis", null, u, c) : null, s) : null;
            null == g && null == p || (Js(e, i, o, a), Js(t, n, r, a, !0)), e.text = g, t.text = p
        }

        function Ys(e, t, i) {
            var n = e.style;
            t && (il(n), e.setStyle(t), tl(n)), n = e.__hoverStl, i && n && (il(n), k(n, i), tl(n))
        }

        function Js(e, t, i, n, a) {
            return Zs(e, t, n, a), i && k(e, i), e
        }

        function Zs(e, t, i, n) {
            if ((i = i || ps).isRectText) {
                var a;
                i.getTextPosition ? a = i.getTextPosition(t, n) : "outside" === (a = t.getShallow("position") || (n ? null : "inside")) && (a = "top"), e.textPosition = a, e.textOffset = t.getShallow("offset");
                var o = t.getShallow("rotate");
                null != o && (o *= Math.PI / 180), e.textRotation = o, e.textDistance = H(t.getShallow("distance"), n ? null : 5)
            }
            var r, s = t.ecModel, l = s && s.option.textStyle, d = function (e) {
                for (var t; e && e !== e.ecModel;) {
                    var i = (e.option || ps).rich;
                    if (i) for (var n in t = t || {}, i) i.hasOwnProperty(n) && (t[n] = 1);
                    e = e.parentModel
                }
                return t
            }(t);
            if (d) for (var u in r = {}, d) if (d.hasOwnProperty(u)) {
                var c = t.getModel(["rich", u]);
                Qs(r[u] = {}, c, l, i, n)
            }
            return e.rich = r, Qs(e, t, l, i, n, !0), i.forceRich && !i.textStyle && (i.textStyle = {}), e
        }

        function Qs(e, t, i, n, a, o) {
            i = !a && i || ps, e.textFill = el(t.getShallow("color"), n) || i.color, e.textStroke = el(t.getShallow("textBorderColor"), n) || i.textBorderColor, e.textStrokeWidth = H(t.getShallow("textBorderWidth"), i.textBorderWidth), a || (o && (e.insideRollbackOpt = n, tl(e)), null == e.textFill && (e.textFill = n.autoColor)), e.fontStyle = t.getShallow("fontStyle") || i.fontStyle, e.fontWeight = t.getShallow("fontWeight") || i.fontWeight, e.fontSize = t.getShallow("fontSize") || i.fontSize, e.fontFamily = t.getShallow("fontFamily") || i.fontFamily, e.textAlign = t.getShallow("align"), e.textVerticalAlign = t.getShallow("verticalAlign") || t.getShallow("baseline"), e.textLineHeight = t.getShallow("lineHeight"), e.textWidth = t.getShallow("width"), e.textHeight = t.getShallow("height"), e.textTag = t.getShallow("tag"), o && n.disableBox || (e.textBackgroundColor = el(t.getShallow("backgroundColor"), n), e.textPadding = t.getShallow("padding"), e.textBorderColor = el(t.getShallow("borderColor"), n), e.textBorderWidth = t.getShallow("borderWidth"), e.textBorderRadius = t.getShallow("borderRadius"), e.textBoxShadowColor = t.getShallow("shadowColor"), e.textBoxShadowBlur = t.getShallow("shadowBlur"), e.textBoxShadowOffsetX = t.getShallow("shadowOffsetX"), e.textBoxShadowOffsetY = t.getShallow("shadowOffsetY")), e.textShadowColor = t.getShallow("textShadowColor") || i.textShadowColor, e.textShadowBlur = t.getShallow("textShadowBlur") || i.textShadowBlur, e.textShadowOffsetX = t.getShallow("textShadowOffsetX") || i.textShadowOffsetX, e.textShadowOffsetY = t.getShallow("textShadowOffsetY") || i.textShadowOffsetY
        }

        function el(e, t) {
            return "auto" !== e ? e : t && t.autoColor ? t.autoColor : null
        }

        function tl(e) {
            var t, i = e.textPosition, n = e.insideRollbackOpt;
            if (n && null == e.textFill) {
                var a = n.autoColor, o = n.isRectText, r = n.useInsideStyle,
                    s = !1 !== r && (!0 === r || o && i && "string" == typeof i && 0 <= i.indexOf("inside")),
                    l = !s && null != a;
                (s || l) && (t = {
                    textFill: e.textFill,
                    textStroke: e.textStroke,
                    textStrokeWidth: e.textStrokeWidth
                }), s && (e.textFill = "#fff", null == e.textStroke && (e.textStroke = a, null == e.textStrokeWidth && (e.textStrokeWidth = 2))), l && (e.textFill = a)
            }
            e.insideRollback = t
        }

        function il(e) {
            var t = e.insideRollback;
            t && (e.textFill = t.textFill, e.textStroke = t.textStroke, e.textStrokeWidth = t.textStrokeWidth, e.insideRollback = null)
        }

        function nl(e, t) {
            var i = t && t.getModel("textStyle");
            return X([e.fontStyle || i && i.getShallow("fontStyle") || "", e.fontWeight || i && i.getShallow("fontWeight") || "", (e.fontSize || i && i.getShallow("fontSize") || 12) + "px", e.fontFamily || i && i.getShallow("fontFamily") || "sans-serif"].join(" "))
        }

        function al(e, t, i, n, a, o) {
            if ("function" == typeof a && (o = a, a = null), n && n.isAnimationEnabled()) {
                var r = e ? "Update" : "", s = n.getShallow("animationDuration" + r),
                    l = n.getShallow("animationEasing" + r), d = n.getShallow("animationDelay" + r);
                "function" == typeof d && (d = d(a, n.getAnimationDelayParams ? n.getAnimationDelayParams(t, a) : null)), "function" == typeof s && (s = s(a)), 0 < s ? t.animateTo(i, s, d || 0, l, o, !!o) : (t.stopAnimation(), t.attr(i), o && o())
            } else t.stopAnimation(), t.attr(i), o && o()
        }

        function ol(e, t, i, n, a) {
            al(!0, e, t, i, n, a)
        }

        function rl(e, t, i, n, a) {
            al(!1, e, t, i, n, a)
        }

        function sl(e, t) {
            for (var i = rt([]); e && e !== t;) lt(i, e.getLocalTransform(), i), e = e.parent;
            return i
        }

        function ll(e, t, i) {
            return t && !_(t) && (t = mt.getLocalTransform(t)), i && (t = ht([], t)), Ce([], e, t)
        }

        function dl(e, t, i) {
            var n = 0 === t[4] || 0 === t[5] || 0 === t[0] ? 1 : Math.abs(2 * t[4] / t[0]),
                a = 0 === t[4] || 0 === t[5] || 0 === t[2] ? 1 : Math.abs(2 * t[4] / t[2]),
                o = ["left" === e ? -n : "right" === e ? n : 0, "top" === e ? -a : "bottom" === e ? a : 0];
            return o = ll(o, t, i), Math.abs(o[0]) > Math.abs(o[1]) ? 0 < o[0] ? "right" : "left" : 0 < o[1] ? "bottom" : "top"
        }

        function ul(e, t, i, n) {
            if (e && t) {
                var a, o = (a = {}, e.traverse(function (e) {
                    !e.isGroup && e.anid && (a[e.anid] = e)
                }), a);
                t.traverse(function (e) {
                    if (!e.isGroup && e.anid) {
                        var t = o[e.anid];
                        if (t) {
                            var n = r(e);
                            e.attr(r(t)), ol(e, n, i, e.dataIndex)
                        }
                    }
                })
            }

            function r(e) {
                var t = {position: re(e.position), rotation: e.rotation};
                return e.shape && (t.shape = k({}, e.shape)), t
            }
        }

        function cl(e, t) {
            return D(e, function (e) {
                var i = e[0];
                i = fs(i, t.x), i = gs(i, t.x + t.width);
                var n = e[1];
                return n = fs(n, t.y), [i, n = gs(n, t.y + t.height)]
            })
        }

        function hl(e, t, i) {
            var n = (t = k({rectHover: !0}, t)).style = {strokeNoScale: !0};
            if (i = i || {
                x: -1,
                y: -1,
                width: 2,
                height: 2
            }, e) return 0 === e.indexOf("image://") ? (n.image = e.slice(8), T(n, i), new qn(t)) : _s(e.replace("path://", ""), t, i, "center")
        }

        function fl(e, t, i, n, a) {
            for (var o = 0, r = a[a.length - 1]; o < a.length; o++) {
                var s = a[o];
                if (gl(e, t, i, n, s[0], s[1], r[0], r[1])) return !0;
                r = s
            }
        }

        function gl(e, t, i, n, a, o, r, s) {
            var l = i - e, d = n - t, u = r - a, c = s - o, h = pl(u, c, l, d);
            var f = e - a, g = t - o, p = pl(f, g, l, d) / h;
            if (p < 0 || 1 < p) return !1;
            var v = pl(f, g, u, c) / h;
            return !(v < 0 || 1 < v)
        }

        function pl(e, t, i, n) {
            return e * n - i * t
        }

        bs("circle", Wr), bs("sector", Hr), bs("ring", zr), bs("polygon", $r), bs("polyline", Xr), bs("rect", es), bs("line", is), bs("bezierCurve", rs), bs("arc", ss);
        var vl = (Object.freeze || Object)({
                Z2_EMPHASIS_LIFT: vs,
                CACHED_LABEL_STYLE_PROPERTIES: ms,
                extendShape: Ss,
                extendPath: function (e, t) {
                    return function (e, t) {
                        return wr.extend(Br(e, t))
                    }(e, t)
                },
                registerShape: bs,
                getShapeClass: Is,
                makePath: _s,
                makeImage: As,
                mergePath: xs,
                resizePath: Ns,
                subPixelOptimizeLine: function (e) {
                    return Yr(e.shape, e.shape, e.style), e
                },
                subPixelOptimizeRect: function (e) {
                    return Jr(e.shape, e.shape, e.style), e
                },
                subPixelOptimize: Es,
                setElementHoverStyle: Rs,
                setHoverStyle: js,
                setAsHighDownDispatcher: Gs,
                isHighDownDispatcher: $s,
                getHighlightDigit: Xs,
                setLabelStyle: qs,
                modifyLabelStyle: Ys,
                setTextStyle: Js,
                setText: function (e, t, i) {
                    var n, a = {isRectText: !0};
                    !1 === i ? n = !0 : a.autoColor = i, Zs(e, t, a, n)
                },
                getFont: nl,
                updateProps: ol,
                initProps: rl,
                getTransform: sl,
                applyTransform: ll,
                transformDirection: dl,
                groupTransition: ul,
                clipPointsByRect: cl,
                clipRectByRect: function (e, t) {
                    var i = fs(e.x, t.x), n = gs(e.x + e.width, t.x + t.width), a = fs(e.y, t.y),
                        o = gs(e.y + e.height, t.y + t.height);
                    if (i <= n && a <= o) return {x: i, y: a, width: n - i, height: o - a}
                },
                createIcon: hl,
                linePolygonIntersect: fl,
                lineLineIntersect: gl,
                Group: Di,
                Image: qn,
                Text: Rr,
                Circle: Wr,
                Sector: Hr,
                Ring: zr,
                Polygon: $r,
                Polyline: Xr,
                Rect: es,
                Line: is,
                BezierCurve: rs,
                Arc: ss,
                IncrementalDisplayable: cs,
                CompoundPath: ls,
                LinearGradient: ds,
                RadialGradient: us,
                BoundingRect: Ai
            }), ml = ["textStyle", "color"], yl = {
                getTextColor: function (e) {
                    var t = this.ecModel;
                    return this.getShallow("color") || (!e && t ? t.get(ml) : null)
                }, getFont: function () {
                    return nl({
                        fontStyle: this.getShallow("fontStyle"),
                        fontWeight: this.getShallow("fontWeight"),
                        fontSize: this.getShallow("fontSize"),
                        fontFamily: this.getShallow("fontFamily")
                    }, this.ecModel)
                }, getTextRect: function (e) {
                    return cn(e, this.getFont(), this.getShallow("align"), this.getShallow("verticalAlign") || this.getShallow("baseline"), this.getShallow("padding"), this.getShallow("lineHeight"), this.getShallow("rich"), this.getShallow("truncateText"))
                }
            },
            kl = no([["fill", "color"], ["stroke", "borderColor"], ["lineWidth", "borderWidth"], ["opacity"], ["shadowBlur"], ["shadowOffsetX"], ["shadowOffsetY"], ["shadowColor"], ["textPosition"], ["textAlign"]]),
            Tl = {
                getItemStyle: function (e, t) {
                    var i = kl(this, e, t), n = this.getBorderLineDash();
                    return n && (i.lineDash = n), i
                }, getBorderLineDash: function () {
                    var e = this.get("borderType");
                    return "solid" === e || null == e ? null : "dashed" === e ? [5, 5] : [1, 1]
                }
            }, wl = I, Cl = Wa();

        function Sl(e, t, i) {
            this.parentModel = t, this.ecModel = i, this.option = e
        }

        function bl(e, t, i) {
            for (var n = 0; n < t.length && (!t[n] || null != (e = e && "object" == typeof e ? e[t[n]] : null)); n++) ;
            return null == e && i && (e = i.get(t)), e
        }

        function Il(e, t) {
            var i = Cl(e).getParent;
            return i ? i.call(e, t) : e.parentModel
        }

        Sl.prototype = {
            constructor: Sl, init: null, mergeOption: function (e) {
                m(this.option, e, !0)
            }, get: function (e, t) {
                return null == e ? this.option : bl(this.option, this.parsePath(e), !t && Il(this, e))
            }, getShallow: function (e, t) {
                var i = this.option, n = null == i ? i : i[e], a = !t && Il(this, e);
                return null == n && a && (n = a.getShallow(e)), n
            }, getModel: function (e, t) {
                var i;
                return new Sl(null == e ? this.option : bl(this.option, e = this.parsePath(e)), t = t || (i = Il(this, e)) && i.getModel(e), this.ecModel)
            }, isEmpty: function () {
                return null == this.option
            }, restoreData: function () {
            }, clone: function () {
                return new this.constructor(v(this.option))
            }, setReadOnly: function (e) {
            }, parsePath: function (e) {
                return "string" == typeof e && (e = e.split(".")), e
            }, customizeGetParent: function (e) {
                Cl(this).getParent = e
            }, isAnimationEnabled: function () {
                if (!a.node) {
                    if (null != this.option.animation) return !!this.option.animation;
                    if (this.parentModel) return this.parentModel.isAnimationEnabled()
                }
            }
        }, Ja(Sl), Qa(Sl), wl(Sl, oo), wl(Sl, so), wl(Sl, yl), wl(Sl, Tl);
        var _l = 0;

        function Al(e) {
            return [e || "", _l++, Math.random().toFixed(5)].join("_")
        }

        var Dl = 1e-4;

        function xl(e, t, i, n) {
            var a = t[1] - t[0], o = i[1] - i[0];
            if (0 == a) return 0 == o ? i[0] : (i[0] + i[1]) / 2;
            if (n) if (0 < a) {
                if (e <= t[0]) return i[0];
                if (e >= t[1]) return i[1]
            } else {
                if (e >= t[0]) return i[0];
                if (e <= t[1]) return i[1]
            } else {
                if (e === t[0]) return i[0];
                if (e === t[1]) return i[1]
            }
            return (e - t[0]) / a * o + i[0]
        }

        function Nl(e, t) {
            switch (e) {
                case"center":
                case"middle":
                    e = "50%";
                    break;
                case"left":
                case"top":
                    e = "0%";
                    break;
                case"right":
                case"bottom":
                    e = "100%"
            }
            return "string" == typeof e ? function (e) {
                return e.replace(/^\s+|\s+$/g, "")
            }(e).match(/%$/) ? parseFloat(e) / 100 * t : parseFloat(e) : null == e ? NaN : +e
        }

        function El(e, t, i) {
            return null == t && (t = 10), t = Math.min(Math.max(0, t), 20), e = (+e).toFixed(t), i ? e : +e
        }

        function Pl(e) {
            return e.sort(function (e, t) {
                return e - t
            }), e
        }

        function Ml(e) {
            if (e = +e, isNaN(e)) return 0;
            for (var t = 1, i = 0; Math.round(e * t) / t !== e;) t *= 10, i++;
            return i
        }

        function Ol(e) {
            var t = e.toString(), i = t.indexOf("e");
            if (0 < i) {
                var n = +t.slice(i + 1);
                return n < 0 ? -n : 0
            }
            var a = t.indexOf(".");
            return a < 0 ? 0 : t.length - 1 - a
        }

        function Fl(e, t) {
            var i = Math.log, n = Math.LN10, a = Math.floor(i(e[1] - e[0]) / n),
                o = Math.round(i(Math.abs(t[1] - t[0])) / n), r = Math.min(Math.max(-a + o, 0), 20);
            return isFinite(r) ? r : 20
        }

        function Ll(e, t, i) {
            if (!e[t]) return 0;
            var n = x(e, function (e, t) {
                return e + (isNaN(t) ? 0 : t)
            }, 0);
            if (0 === n) return 0;
            for (var a = Math.pow(10, i), o = D(e, function (e) {
                return (isNaN(e) ? 0 : e) / n * a * 100
            }), r = 100 * a, s = D(o, function (e) {
                return Math.floor(e)
            }), l = x(s, function (e, t) {
                return e + t
            }, 0), d = D(o, function (e, t) {
                return e - s[t]
            }); l < r;) {
                for (var u = Number.NEGATIVE_INFINITY, c = null, h = 0, f = d.length; h < f; ++h) d[h] > u && (u = d[h], c = h);
                ++s[c], d[c] = 0, ++l
            }
            return s[t] / a
        }

        var Bl = 9007199254740991;

        function Ul(e) {
            var t = 2 * Math.PI;
            return (e % t + t) % t
        }

        function Rl(e) {
            return -Dl < e && e < Dl
        }

        var Kl = /^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d\d)(?::(\d\d)(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/;

        function Wl(e) {
            if (e instanceof Date) return e;
            if ("string" != typeof e) return null == e ? new Date(NaN) : new Date(Math.round(e));
            var t = Kl.exec(e);
            if (!t) return new Date(NaN);
            if (t[8]) {
                var i = +t[4] || 0;
                return "Z" !== t[8].toUpperCase() && (i -= t[8].slice(0, 3)), new Date(Date.UTC(+t[1], +(t[2] || 1) - 1, +t[3] || 1, i, +(t[5] || 0), +t[6] || 0, +t[7] || 0))
            }
            return new Date(+t[1], +(t[2] || 1) - 1, +t[3] || 1, +t[4] || 0, +(t[5] || 0), +t[6] || 0, +t[7] || 0)
        }

        function Vl(e) {
            return Math.pow(10, Hl(e))
        }

        function Hl(e) {
            if (0 === e) return 0;
            var t = Math.floor(Math.log(e) / Math.LN10);
            return 10 <= e / Math.pow(10, t) && t++, t
        }

        function zl(e, t) {
            var i = Hl(e), n = Math.pow(10, i), a = e / n;
            return e = (t ? a < 1.5 ? 1 : a < 2.5 ? 2 : a < 4 ? 3 : a < 7 ? 5 : 10 : a < 1 ? 1 : a < 2 ? 2 : a < 3 ? 3 : a < 5 ? 5 : 10) * n, -20 <= i ? +e.toFixed(i < 0 ? -i : 0) : e
        }

        function jl(e) {
            e.sort(function (e, t) {
                return function e(t, i, n) {
                    return t.interval[n] < i.interval[n] || t.interval[n] === i.interval[n] && (t.close[n] - i.close[n] == (n ? -1 : 1) || !n && e(t, i, 1))
                }(e, t, 0) ? -1 : 1
            });
            for (var t = -1 / 0, i = 1, n = 0; n < e.length;) {
                for (var a = e[n].interval, o = e[n].close, r = 0; r < 2; r++) a[r] <= t && (a[r] = t, o[r] = r ? 1 : 1 - i), t = a[r], i = o[r];
                a[0] === a[1] && o[0] * o[1] != 1 ? e.splice(n, 1) : n++
            }
            return e
        }

        function Gl(e) {
            return 0 <= e - parseFloat(e)
        }

        var $l = (Object.freeze || Object)({
            linearMap: xl,
            parsePercent: Nl,
            round: El,
            asc: Pl,
            getPrecision: Ml,
            getPrecisionSafe: Ol,
            getPixelPrecision: Fl,
            getPercentWithPrecision: Ll,
            MAX_SAFE_INTEGER: Bl,
            remRadian: Ul,
            isRadianAroundZero: Rl,
            parseDate: Wl,
            quantity: Vl,
            quantityExponent: Hl,
            nice: zl,
            quantile: function (e, t) {
                var i = (e.length - 1) * t + 1, n = Math.floor(i), a = +e[n - 1], o = i - n;
                return o ? a + o * (e[n] - a) : a
            },
            reformIntervals: jl,
            isNumeric: Gl
        });

        function Xl(e) {
            return isNaN(e) ? "-" : (e = (e + "").split("."))[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g, "$1,") + (1 < e.length ? "." + e[1] : "")
        }

        function ql(e, t) {
            return e = (e || "").toLowerCase().replace(/-(.)/g, function (e, t) {
                return t.toUpperCase()
            }), t && e && (e = e.charAt(0).toUpperCase() + e.slice(1)), e
        }

        var Yl = G, Jl = /([&<>"'])/g, Zl = {"&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;"};

        function Ql(e) {
            return null == e ? "" : (e + "").replace(Jl, function (e, t) {
                return Zl[t]
            })
        }

        function ed(e, t) {
            return "{" + e + (null == t ? "" : t) + "}"
        }

        var td = ["a", "b", "c", "d", "e", "f", "g"];

        function id(e, t, i) {
            O(t) || (t = [t]);
            var n = t.length;
            if (!n) return "";
            for (var a = t[0].$vars || [], o = 0; o < a.length; o++) {
                var r = td[o];
                e = e.replace(ed(r), ed(r, 0))
            }
            for (var s = 0; s < n; s++) for (var l = 0; l < a.length; l++) {
                var d = t[s][a[l]];
                e = e.replace(ed(td[l], s), i ? Ql(d) : d)
            }
            return e
        }

        function nd(e, t, i) {
            return A(t, function (t, n) {
                e = e.replace("{" + n + "}", i ? Ql(t) : t)
            }), e
        }

        function ad(e, t) {
            var i = (e = L(e) ? {color: e, extraCssText: t} : e || {}).color, n = e.type,
                a = (t = e.extraCssText, e.renderMode || "html"), o = e.markerId || "X";
            return i ? "html" === a ? "subItem" === n ? '<span style="display:inline-block;vertical-align:middle;margin-right:8px;margin-left:3px;border-radius:4px;width:4px;height:4px;background-color:' + Ql(i) + ";" + (t || "") + '"></span>' : '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:10px;height:10px;background-color:' + Ql(i) + ";" + (t || "") + '"></span>' : {
                renderMode: a,
                content: "{marker" + o + "|}  ",
                style: {color: i}
            } : ""
        }

        function od(e, t) {
            return "0000".substr(0, t - (e += "").length) + e
        }

        function rd(e, t, i) {
            "week" !== e && "month" !== e && "quarter" !== e && "half-year" !== e && "year" !== e || (e = "MM-dd\nyyyy");
            var n = Wl(t), a = i ? "UTC" : "", o = n["get" + a + "FullYear"](), r = n["get" + a + "Month"]() + 1,
                s = n["get" + a + "Date"](), l = n["get" + a + "Hours"](), d = n["get" + a + "Minutes"](),
                u = n["get" + a + "Seconds"](), c = n["get" + a + "Milliseconds"]();
            return e = e.replace("MM", od(r, 2)).replace("M", r).replace("yyyy", o).replace("yy", o % 100).replace("dd", od(s, 2)).replace("d", s).replace("hh", od(l, 2)).replace("h", l).replace("mm", od(d, 2)).replace("m", d).replace("ss", od(u, 2)).replace("s", u).replace("SSS", od(c, 3))
        }

        function sd(e) {
            return e ? e.charAt(0).toUpperCase() + e.substr(1) : e
        }

        var ld = pn;

        function dd(e, t) {
            if ("_blank" === t || "blank" === t) {
                var i = window.open();
                i.opener = null, i.location = e
            } else window.open(e, t)
        }

        var ud = (Object.freeze || Object)({
                addCommas: Xl,
                toCamelCase: ql,
                normalizeCssArray: Yl,
                encodeHTML: Ql,
                formatTpl: id,
                formatTplSimple: nd,
                getTooltipMarker: ad,
                formatTime: rd,
                capitalFirst: sd,
                truncateText: ld,
                getTextBoundingRect: function (e) {
                    return cn(e.text, e.font, e.textAlign, e.textVerticalAlign, e.textPadding, e.textLineHeight, e.rich, e.truncate)
                },
                getTextRect: function (e, t, i, n, a, o, r, s) {
                    return cn(e, t, i, n, a, s, o, r)
                },
                windowOpen: dd
            }), cd = A, hd = ["left", "right", "top", "bottom", "width", "height"],
            fd = [["width", "left", "right"], ["height", "top", "bottom"]];

        function gd(e, t, i, n, a) {
            var o = 0, r = 0;
            null == n && (n = 1 / 0), null == a && (a = 1 / 0);
            var s = 0;
            t.eachChild(function (l, d) {
                var u, c, h = l.position, f = l.getBoundingRect(), g = t.childAt(d + 1), p = g && g.getBoundingRect();
                if ("horizontal" === e) {
                    var v = f.width + (p ? -p.x + f.x : 0);
                    s = n < (u = o + v) || l.newline ? (o = 0, u = v, r += s + i, f.height) : Math.max(s, f.height)
                } else {
                    var m = f.height + (p ? -p.y + f.y : 0);
                    s = a < (c = r + m) || l.newline ? (o += s + i, r = 0, c = m, f.width) : Math.max(s, f.width)
                }
                l.newline || (h[0] = o, h[1] = r, "horizontal" === e ? o = u + i : r = c + i)
            })
        }

        var pd = gd;

        function vd(e, t, i) {
            i = Yl(i || 0);
            var n = t.width, a = t.height, o = Nl(e.left, n), r = Nl(e.top, a), s = Nl(e.right, n), l = Nl(e.bottom, a),
                d = Nl(e.width, n), u = Nl(e.height, a), c = i[2] + i[0], h = i[1] + i[3], f = e.aspect;
            switch (isNaN(d) && (d = n - s - h - o), isNaN(u) && (u = a - l - c - r), null != f && (isNaN(d) && isNaN(u) && (n / a < f ? d = .8 * n : u = .8 * a), isNaN(d) && (d = f * u), isNaN(u) && (u = d / f)), isNaN(o) && (o = n - s - d - h), isNaN(r) && (r = a - l - u - c), e.left || e.right) {
                case"center":
                    o = n / 2 - d / 2 - i[3];
                    break;
                case"right":
                    o = n - d - h
            }
            switch (e.top || e.bottom) {
                case"middle":
                case"center":
                    r = a / 2 - u / 2 - i[0];
                    break;
                case"bottom":
                    r = a - u - c
            }
            o = o || 0, r = r || 0, isNaN(d) && (d = n - h - o - (s || 0)), isNaN(u) && (u = a - c - r - (l || 0));
            var g = new Ai(o + i[3], r + i[0], d, u);
            return g.margin = i, g
        }

        function md(e, t, i, n, a) {
            var o = !a || !a.hv || a.hv[0], r = !a || !a.hv || a.hv[1], s = a && a.boundingMode || "all";
            if (o || r) {
                var l;
                if ("raw" === s) l = "group" === e.type ? new Ai(0, 0, +t.width || 0, +t.height || 0) : e.getBoundingRect(); else if (l = e.getBoundingRect(), e.needLocalTransform()) {
                    var d = e.getLocalTransform();
                    (l = l.clone()).applyTransform(d)
                }
                t = vd(T({width: l.width, height: l.height}, t), i, n);
                var u = e.position, c = o ? t.x - l.x : 0, h = r ? t.y - l.y : 0;
                e.attr("position", "raw" === s ? [c, h] : [u[0] + c, u[1] + h])
            }
        }

        function yd(e, t, i) {
            B(i) || (i = {});
            var n = i.ignoreSize;
            O(n) || (n = [n, n]);
            var a = r(fd[0], 0), o = r(fd[1], 1);

            function r(i, a) {
                var o = {}, r = 0, d = {}, u = 0;
                if (cd(i, function (t) {
                    d[t] = e[t]
                }), cd(i, function (e) {
                    s(t, e) && (o[e] = d[e] = t[e]), l(o, e) && r++, l(d, e) && u++
                }), n[a]) return l(t, i[1]) ? d[i[2]] = null : l(t, i[2]) && (d[i[1]] = null), d;
                if (2 !== u && r) {
                    if (2 <= r) return o;
                    for (var c = 0; c < i.length; c++) {
                        var h = i[c];
                        if (!s(o, h) && s(e, h)) {
                            o[h] = e[h];
                            break
                        }
                    }
                    return o
                }
                return d
            }

            function s(e, t) {
                return e.hasOwnProperty(t)
            }

            function l(e, t) {
                return null != e[t] && "auto" !== e[t]
            }

            function d(e, t, i) {
                cd(e, function (e) {
                    t[e] = i[e]
                })
            }

            d(fd[0], e, a), d(fd[1], e, o)
        }

        function kd(e) {
            return Td({}, e)
        }

        function Td(e, t) {
            return t && e && cd(hd, function (i) {
                t.hasOwnProperty(i) && (e[i] = t[i])
            }), e
        }

        M(gd, "vertical"), M(gd, "horizontal");
        var wd, Cd, Sd, bd = Wa(), Id = Sl.extend({
            type: "component",
            id: "",
            name: "",
            mainType: "",
            subType: "",
            componentIndex: 0,
            defaultOption: null,
            ecModel: null,
            dependentModels: [],
            uid: null,
            layoutMode: null,
            $constructor: function (e, t, i, n) {
                Sl.call(this, e, t, i, n), this.uid = Al("ec_cpt_model")
            },
            init: function (e, t, i, n) {
                this.mergeDefaultAndTheme(e, i)
            },
            mergeDefaultAndTheme: function (e, t) {
                var i = this.layoutMode, n = i ? kd(e) : {};
                m(e, t.getTheme().get(this.mainType)), m(e, this.getDefaultOption()), i && yd(e, n, i)
            },
            mergeOption: function (e, t) {
                m(this.option, e, !0);
                var i = this.layoutMode;
                i && yd(this.option, e, i)
            },
            optionUpdated: function (e, t) {
            },
            getDefaultOption: function () {
                var e = bd(this);
                if (!e.defaultOption) {
                    for (var t = [], i = this.constructor; i;) {
                        var n = i.prototype.defaultOption;
                        n && t.push(n), i = i.superClass
                    }
                    for (var a = {}, o = t.length - 1; 0 <= o; o--) a = m(a, t[o], !0);
                    e.defaultOption = a
                }
                return e.defaultOption
            },
            getReferringComponents: function (e) {
                return this.ecModel.queryComponents({
                    mainType: e,
                    index: this.get(e + "Index", !0),
                    id: this.get(e + "Id", !0)
                })
            }
        });

        function _d(e, t) {
            return e[t] || (e[t] = {predecessor: [], successor: []}), e[t]
        }

        io(Id, {registerWhenExtend: !0}), Cd = {}, (wd = Id).registerSubTypeDefaulter = function (e, t) {
            e = Ya(e), Cd[e.main] = t
        }, wd.determineSubType = function (e, t) {
            var i = t.type;
            if (!i) {
                var n = Ya(e).main;
                wd.hasSubTypes(e) && Cd[n] && (i = Cd[n](t))
            }
            return i
        }, Sd = function (e) {
            var t = [];
            return A(Id.getClassesByMainType(e), function (e) {
                t = t.concat(e.prototype.dependencies || [])
            }), t = D(t, function (e) {
                return Ya(e).main
            }), "dataset" !== e && S(t, "dataset") <= 0 && t.unshift("dataset"), t
        }, Id.topologicalTravel = function (e, t, i, n) {
            if (e.length) {
                var a = function (e) {
                    var t = {}, i = [];
                    return A(e, function (n) {
                        var a = _d(t, n), o = function (e, t) {
                            var i = [];
                            return A(e, function (e) {
                                0 <= S(t, e) && i.push(e)
                            }), i
                        }(a.originalDeps = Sd(n), e);
                        a.entryCount = o.length, 0 === a.entryCount && i.push(n), A(o, function (e) {
                            S(a.predecessor, e) < 0 && a.predecessor.push(e);
                            var i = _d(t, e);
                            S(i.successor, e) < 0 && i.successor.push(n)
                        })
                    }), {graph: t, noEntryList: i}
                }(t), o = a.graph, r = a.noEntryList, s = {};
                for (A(e, function (e) {
                    s[e] = !0
                }); r.length;) {
                    var l = r.pop(), d = o[l], u = !!s[l];
                    u && (i.call(n, l, d.originalDeps.slice()), delete s[l]), A(d.successor, u ? h : c)
                }
                A(s, function () {
                    throw new Error("Circle dependency may exists")
                })
            }

            function c(e) {
                o[e].entryCount--, 0 === o[e].entryCount && r.push(e)
            }

            function h(e) {
                s[e] = !0, c(e)
            }
        }, I(Id, {
            getBoxLayoutParams: function () {
                return {
                    left: this.get("left"),
                    top: this.get("top"),
                    right: this.get("right"),
                    bottom: this.get("bottom"),
                    width: this.get("width"),
                    height: this.get("height")
                }
            }
        });
        var Ad = "";
        "undefined" != typeof navigator && (Ad = navigator.platform || "");
        var Dd = {
                color: ["#c23531", "#2f4554", "#61a0a8", "#d48265", "#91c7ae", "#749f83", "#ca8622", "#bda29a", "#6e7074", "#546570", "#c4ccd3"],
                gradientColor: ["#f6efa6", "#d88273", "#bf444c"],
                textStyle: {
                    fontFamily: Ad.match(/^Win/) ? "Microsoft YaHei" : "sans-serif",
                    fontSize: 12,
                    fontStyle: "normal",
                    fontWeight: "normal"
                },
                blendMode: null,
                animation: "auto",
                animationDuration: 1e3,
                animationDurationUpdate: 300,
                animationEasing: "exponentialOut",
                animationEasingUpdate: "cubicOut",
                animationThreshold: 2e3,
                progressiveThreshold: 3e3,
                progressive: 400,
                hoverLayerThreshold: 3e3,
                useUTC: !1
            }, xd = Wa(), Nd = {
                clearColorPalette: function () {
                    xd(this).colorIdx = 0, xd(this).colorNameMap = {}
                }, getColorFromPalette: function (e, t, i) {
                    var n = xd(t = t || this), a = n.colorIdx || 0, o = n.colorNameMap = n.colorNameMap || {};
                    if (o.hasOwnProperty(e)) return o[e];
                    var r = Pa(this.get("color", !0)), s = this.get("colorLayer", !0),
                        l = null != i && s ? function (e, t) {
                            for (var i = e.length, n = 0; n < i; n++) if (e[n].length > t) return e[n];
                            return e[i - 1]
                        }(s, i) : r;
                    if ((l = l || r) && l.length) {
                        var d = l[a];
                        return e && (o[e] = d), n.colorIdx = (a + 1) % l.length, d
                    }
                }
            }, Ed = "original", Pd = "arrayRows", Md = "objectRows", Od = "keyedColumns", Fd = "unknown", Ld = "typedArray",
            Bd = "column", Ud = "row";

        function Rd(e) {
            this.fromDataset = e.fromDataset, this.data = e.data || (e.sourceFormat === Od ? {} : []), this.sourceFormat = e.sourceFormat || Fd, this.seriesLayoutBy = e.seriesLayoutBy || Bd, this.dimensionsDefine = e.dimensionsDefine, this.encodeDefine = e.encodeDefine && Q(e.encodeDefine), this.startIndex = e.startIndex || 0, this.dimensionsDetectCount = e.dimensionsDetectCount
        }

        Rd.seriesDataToSource = function (e) {
            return new Rd({data: e, sourceFormat: R(e) ? Ld : Ed, fromDataset: !1})
        }, Qa(Rd);
        var Kd = {Must: 1, Might: 2, Not: 3}, Wd = Wa();

        function Vd(e) {
            var t = e.option, i = t.data, n = R(i) ? Ld : Ed, a = !1, o = t.seriesLayoutBy, r = t.sourceHeader,
                s = t.dimensions, l = $d(e);
            if (l) {
                var d = l.option;
                i = d.source, n = Wd(l).sourceFormat, a = !0, o = o || d.seriesLayoutBy, null == r && (r = d.sourceHeader), s = s || d.dimensions
            }
            var u = function (e, t, i, n, a) {
                if (!e) return {dimensionsDefine: Hd(a)};
                var o, r;
                if (t === Pd) "auto" === n || null == n ? zd(function (e) {
                    null != e && "-" !== e && (L(e) ? null == r && (r = 1) : r = 0)
                }, i, e, 10) : r = n ? 1 : 0, a || 1 !== r || (a = [], zd(function (e, t) {
                    a[t] = null != e ? e : ""
                }, i, e)), o = a ? a.length : i === Ud ? e.length : e[0] ? e[0].length : null; else if (t === Md) a = a || function (e) {
                    for (var t, i = 0; i < e.length && !(t = e[i++]);) ;
                    if (t) {
                        var n = [];
                        return A(t, function (e, t) {
                            n.push(t)
                        }), n
                    }
                }(e); else if (t === Od) a || (a = [], A(e, function (e, t) {
                    a.push(t)
                })); else if (t === Ed) {
                    var s = Fa(e[0]);
                    o = O(s) && s.length || 1
                }
                return {startIndex: r, dimensionsDefine: Hd(a), dimensionsDetectCount: o}
            }(i, n, o, r, s);
            Wd(e).source = new Rd({
                data: i,
                fromDataset: a,
                seriesLayoutBy: o,
                sourceFormat: n,
                dimensionsDefine: u.dimensionsDefine,
                startIndex: u.startIndex,
                dimensionsDetectCount: u.dimensionsDetectCount,
                encodeDefine: t.encode
            })
        }

        function Hd(e) {
            if (e) {
                var t = Q();
                return D(e, function (e, i) {
                    if (null == (e = k({}, B(e) ? e : {name: e})).name) return e;
                    e.name += "", null == e.displayName && (e.displayName = e.name);
                    var n = t.get(e.name);
                    return n ? e.name += "-" + n.count++ : t.set(e.name, {count: 1}), e
                })
            }
        }

        function zd(e, t, i, n) {
            if (null == n && (n = 1 / 0), t === Ud) for (var a = 0; a < i.length && a < n; a++) e(i[a] ? i[a][0] : null, a); else {
                var o = i[0] || [];
                for (a = 0; a < o.length && a < n; a++) e(o[a], a)
            }
        }

        function jd(e, t, i) {
            var n = {}, a = $d(t);
            if (!a || !e) return n;
            var o, r, s = [], l = [], d = t.ecModel, u = Wd(d).datasetMap, c = a.uid + "_" + i.seriesLayoutBy;
            A(e = e.slice(), function (t, i) {
                B(t) || (e[i] = {name: t}), "ordinal" === t.type && null == o && (r = g(e[o = i])), n[t.name] = []
            });
            var h = u.get(c) || u.set(c, {categoryWayDim: r, valueWayDim: 0});

            function f(e, t, i) {
                for (var n = 0; n < i; n++) e.push(t + n)
            }

            function g(e) {
                var t = e.dimsDef;
                return t ? t.length : 1
            }

            return A(e, function (e, t) {
                var i = e.name, a = g(e);
                if (null == o) {
                    var r = h.valueWayDim;
                    f(n[i], r, a), f(l, r, a), h.valueWayDim += a
                } else o === t ? (f(n[i], 0, a), f(s, 0, a)) : (r = h.categoryWayDim, f(n[i], r, a), f(l, r, a), h.categoryWayDim += a)
            }), s.length && (n.itemName = s), l.length && (n.seriesName = l), n
        }

        function Gd(e, t, i) {
            var n = {};
            if (!$d(e)) return n;
            var a, o = t.sourceFormat, r = t.dimensionsDefine;
            o !== Md && o !== Od || A(r, function (e, t) {
                "name" === (B(e) ? e.name : e) && (a = t)
            });
            var s = function () {
                for (var e = {}, n = {}, s = [], l = 0, d = Math.min(5, i); l < d; l++) {
                    var u = Xd(t.data, o, t.seriesLayoutBy, r, t.startIndex, l);
                    s.push(u);
                    var c = u === Kd.Not;
                    if (c && null == e.v && l !== a && (e.v = l), null != e.n && e.n !== e.v && (c || s[e.n] !== Kd.Not) || (e.n = l), h(e) && s[e.n] !== Kd.Not) return e;
                    c || (u === Kd.Might && null == n.v && l !== a && (n.v = l), null != n.n && n.n !== n.v || (n.n = l))
                }

                function h(e) {
                    return null != e.v && null != e.n
                }

                return h(e) ? e : h(n) ? n : null
            }();
            if (s) {
                n.value = s.v;
                var l = null != a ? a : s.n;
                n.itemName = [l], n.seriesName = [l]
            }
            return n
        }

        function $d(e) {
            var t = e.option;
            if (!t.data) return e.ecModel.getComponent("dataset", t.datasetIndex || 0)
        }

        function Xd(e, t, i, n, a, o) {
            var r, s, l;
            if (R(e)) return Kd.Not;
            if (n) {
                var d = n[o];
                B(d) ? (s = d.name, l = d.type) : L(d) && (s = d)
            }
            if (null != l) return "ordinal" === l ? Kd.Must : Kd.Not;
            if (t === Pd) if (i === Ud) {
                for (var u = e[o], c = 0; c < (u || []).length && c < 5; c++) if (null != (r = p(u[a + c]))) return r
            } else for (c = 0; c < e.length && c < 5; c++) {
                var h = e[a + c];
                if (h && null != (r = p(h[o]))) return r
            } else if (t === Md) {
                if (!s) return Kd.Not;
                for (c = 0; c < e.length && c < 5; c++) if ((f = e[c]) && null != (r = p(f[s]))) return r
            } else if (t === Od) {
                if (!s) return Kd.Not;
                if (!(u = e[s]) || R(u)) return Kd.Not;
                for (c = 0; c < u.length && c < 5; c++) if (null != (r = p(u[c]))) return r
            } else if (t === Ed) for (c = 0; c < e.length && c < 5; c++) {
                var f, g = Fa(f = e[c]);
                if (!O(g)) return Kd.Not;
                if (null != (r = p(g[o]))) return r
            }

            function p(e) {
                var t = L(e);
                return null != e && isFinite(e) && "" !== e ? t ? Kd.Might : Kd.Not : t && "-" !== e ? Kd.Must : void 0
            }

            return Kd.Not
        }

        var qd = "\0_ec_inner", Yd = Sl.extend({
            init: function (e, t, i, n) {
                i = i || {}, this.option = null, this._theme = new Sl(i), this._optionManager = n
            }, setOption: function (e, t) {
                $(!(qd in e), "please use chart.getOption()"), this._optionManager.setOption(e, t), this.resetOption(null)
            }, resetOption: function (e) {
                var t = !1, i = this._optionManager;
                if (!e || "recreate" === e) {
                    var n = i.mountOption("recreate" === e);
                    this.option && "recreate" !== e ? (this.restoreData(), this.mergeOption(n)) : function (e) {
                        e = e, this.option = {}, this.option[qd] = 1, this._componentsMap = Q({series: []}), this._seriesIndices, this._seriesIndicesMap, function (e, t) {
                            var i = e.color && !e.colorLayer;
                            A(t, function (t, n) {
                                "colorLayer" === n && i || Id.hasClass(n) || ("object" == typeof t ? e[n] = e[n] ? m(e[n], t, !1) : v(t) : null == e[n] && (e[n] = t))
                            })
                        }(e, this._theme.option), m(e, Dd, !1), this.mergeOption(e)
                    }.call(this, n), t = !0
                }
                if ("timeline" !== e && "media" !== e || this.restoreData(), !e || "recreate" === e || "timeline" === e) {
                    var a = i.getTimelineOption(this);
                    a && (this.mergeOption(a), t = !0)
                }
                if (!e || "recreate" === e || "media" === e) {
                    var o = i.getMediaOption(this, this._api);
                    o.length && A(o, function (e) {
                        this.mergeOption(e, t = !0)
                    }, this)
                }
                return t
            }, mergeOption: function (e) {
                var t = this.option, i = this._componentsMap, n = [];
                Wd(this).datasetMap = Q(), A(e, function (e, i) {
                    null != e && (Id.hasClass(i) ? i && n.push(i) : t[i] = null == t[i] ? v(e) : m(t[i], e, !0))
                }), Id.topologicalTravel(n, Id.getAllClassMainTypes(), function (n, a) {
                    var o = Pa(e[n]), r = La(i.get(n), o);
                    Ba(r), A(r, function (e, t) {
                        var i = e.option;
                        B(i) && (e.keyInfo.mainType = n, e.keyInfo.subType = function (e, t, i) {
                            return t.type ? t.type : i ? i.subType : Id.determineSubType(e, t)
                        }(n, i, e.exist))
                    });
                    var s = function (e, t) {
                        O(t) || (t = t ? [t] : []);
                        var i = {};
                        return A(t, function (t) {
                            i[t] = (e.get(t) || []).slice()
                        }), i
                    }(i, a);
                    t[n] = [], i.set(n, []), A(r, function (e, a) {
                        var o = e.exist, r = e.option;
                        if ($(B(r) || o, "Empty component definition"), r) {
                            var l = Id.getClass(n, e.keyInfo.subType, !0);
                            if (o && o.constructor === l) o.name = e.keyInfo.name, o.mergeOption(r, this), o.optionUpdated(r, !1); else {
                                var d = k({dependentModels: s, componentIndex: a}, e.keyInfo);
                                k(o = new l(r, this, this, d), d), o.init(r, this, this, d), o.optionUpdated(null, !0)
                            }
                        } else o.mergeOption({}, this), o.optionUpdated({}, !1);
                        i.get(n)[a] = o, t[n][a] = o.option
                    }, this), "series" === n && Jd(this, i.get("series"))
                }, this), this._seriesIndicesMap = Q(this._seriesIndices = this._seriesIndices || [])
            }, getOption: function () {
                var e = v(this.option);
                return A(e, function (t, i) {
                    if (Id.hasClass(i)) {
                        for (var n = (t = Pa(t)).length - 1; 0 <= n; n--) Ra(t[n]) && t.splice(n, 1);
                        e[i] = t
                    }
                }), delete e[qd], e
            }, getTheme: function () {
                return this._theme
            }, getComponent: function (e, t) {
                var i = this._componentsMap.get(e);
                if (i) return i[t || 0]
            }, queryComponents: function (e) {
                var t = e.mainType;
                if (!t) return [];
                var i, n = e.index, a = e.id, o = e.name, r = this._componentsMap.get(t);
                if (!r || !r.length) return [];
                if (null != n) O(n) || (n = [n]), i = N(D(n, function (e) {
                    return r[e]
                }), function (e) {
                    return !!e
                }); else if (null != a) {
                    var s = O(a);
                    i = N(r, function (e) {
                        return s && 0 <= S(a, e.id) || !s && e.id === a
                    })
                } else if (null != o) {
                    var l = O(o);
                    i = N(r, function (e) {
                        return l && 0 <= S(o, e.name) || !l && e.name === o
                    })
                } else i = r.slice();
                return Zd(i, e)
            }, findComponents: function (e) {
                var t, i, n, a, o, r = e.query, s = e.mainType,
                    l = (i = s + "Index", n = s + "Id", a = s + "Name", !(t = r) || null == t[i] && null == t[n] && null == t[a] ? null : {
                        mainType: s,
                        index: t[i],
                        id: t[n],
                        name: t[a]
                    }), d = l ? this.queryComponents(l) : this._componentsMap.get(s);
                return o = Zd(d, e), e.filter ? N(o, e.filter) : o
            }, eachComponent: function (e, t, i) {
                var n = this._componentsMap;
                "function" == typeof e ? (i = t, t = e, n.each(function (e, n) {
                    A(e, function (e, a) {
                        t.call(i, n, e, a)
                    })
                })) : L(e) ? A(n.get(e), t, i) : B(e) && A(this.findComponents(e), t, i)
            }, getSeriesByName: function (e) {
                return N(this._componentsMap.get("series"), function (t) {
                    return t.name === e
                })
            }, getSeriesByIndex: function (e) {
                return this._componentsMap.get("series")[e]
            }, getSeriesByType: function (e) {
                return N(this._componentsMap.get("series"), function (t) {
                    return t.subType === e
                })
            }, getSeries: function () {
                return this._componentsMap.get("series").slice()
            }, getSeriesCount: function () {
                return this._componentsMap.get("series").length
            }, eachSeries: function (e, t) {
                A(this._seriesIndices, function (i) {
                    var n = this._componentsMap.get("series")[i];
                    e.call(t, n, i)
                }, this)
            }, eachRawSeries: function (e, t) {
                A(this._componentsMap.get("series"), e, t)
            }, eachSeriesByType: function (e, t, i) {
                A(this._seriesIndices, function (n) {
                    var a = this._componentsMap.get("series")[n];
                    a.subType === e && t.call(i, a, n)
                }, this)
            }, eachRawSeriesByType: function (e, t, i) {
                return A(this.getSeriesByType(e), t, i)
            }, isSeriesFiltered: function (e) {
                return null == this._seriesIndicesMap.get(e.componentIndex)
            }, getCurrentSeriesIndices: function () {
                return (this._seriesIndices || []).slice()
            }, filterSeries: function (e, t) {
                var i = N(this._componentsMap.get("series"), e, t);
                Jd(this, i)
            }, restoreData: function (e) {
                var t = this._componentsMap;
                Jd(this, t.get("series"));
                var i = [];
                t.each(function (e, t) {
                    i.push(t)
                }), Id.topologicalTravel(i, Id.getAllClassMainTypes(), function (i, n) {
                    A(t.get(i), function (t) {
                        "series" === i && function (e, t) {
                            if (t) {
                                var i = t.seiresIndex, n = t.seriesId, a = t.seriesName;
                                return null != i && e.componentIndex !== i || null != n && e.id !== n || null != a && e.name !== a
                            }
                        }(t, e) || t.restoreData()
                    })
                })
            }
        });

        function Jd(e, t) {
            e._seriesIndicesMap = Q(e._seriesIndices = D(t, function (e) {
                return e.componentIndex
            }) || [])
        }

        function Zd(e, t) {
            return t.hasOwnProperty("subType") ? N(e, function (e) {
                return e.subType === t.subType
            }) : e
        }

        I(Yd, Nd);
        var Qd = ["getDom", "getZr", "getWidth", "getHeight", "getDevicePixelRatio", "dispatchAction", "isDisposed", "on", "off", "getDataURL", "getConnectedDataURL", "getModel", "getOption", "getViewOfComponentModel", "getViewOfSeriesModel"];

        function eu(e) {
            A(Qd, function (t) {
                this[t] = P(e[t], e)
            }, this)
        }

        var tu = {};

        function iu() {
            this._coordinateSystems = []
        }

        iu.prototype = {
            constructor: iu, create: function (e, t) {
                var i = [];
                A(tu, function (n, a) {
                    var o = n.create(e, t);
                    i = i.concat(o || [])
                }), this._coordinateSystems = i
            }, update: function (e, t) {
                A(this._coordinateSystems, function (i) {
                    i.update && i.update(e, t)
                })
            }, getCoordinateSystems: function () {
                return this._coordinateSystems.slice()
            }
        }, iu.register = function (e, t) {
            tu[e] = t
        }, iu.get = function (e) {
            return tu[e]
        };
        var nu = A, au = v, ou = D, ru = m, su = /^(min|max)?(.+)$/;

        function lu(e) {
            this._api = e, this._timelineOptions = [], this._mediaList = [], this._mediaDefault, this._currentMediaIndices = [], this._optionBackup, this._newBaseOption
        }

        function du(e, t, i) {
            var n = {width: t, height: i, aspectratio: t / i}, a = !0;
            return A(e, function (e, t) {
                var i = t.match(su);
                if (i && i[1] && i[2]) {
                    i[1];
                    var o = i[2].toLowerCase();
                    !function (e, t, i) {
                        return e === t
                    }(n[o], e) && (a = !1)
                }
            }), a
        }

        lu.prototype = {
            constructor: lu, setOption: function (e, t) {
                e && A(Pa(e.series), function (e) {
                    e && e.data && R(e.data) && Y(e.data)
                }), e = au(e);
                var i = this._optionBackup, n = function (e, t, i) {
                    var n, a, o = [], r = [], s = e.timeline;
                    if (e.baseOption && (a = e.baseOption), (s || e.options) && (a = a || {}, o = (e.options || []).slice()), e.media) {
                        a = a || {};
                        var l = e.media;
                        nu(l, function (e) {
                            e && e.option && (e.query ? r.push(e) : n = n || e)
                        })
                    }
                    return (a = a || e).timeline || (a.timeline = s), nu([a].concat(o).concat(D(r, function (e) {
                        return e.option
                    })), function (e) {
                        nu(t, function (t) {
                            t(e, i)
                        })
                    }), {baseOption: a, timelineOptions: o, mediaDefault: n, mediaList: r}
                }.call(this, e, t, !i);
                this._newBaseOption = n.baseOption, i ? (function (e, t) {
                    nu(t = t || {}, function (t, i) {
                        if (null != t) {
                            var n = e[i];
                            if (Id.hasClass(i)) {
                                t = Pa(t);
                                var a = La(n = Pa(n), t);
                                e[i] = ou(a, function (e) {
                                    return e.option && e.exist ? ru(e.exist, e.option, !0) : e.exist || e.option
                                })
                            } else e[i] = ru(n, t, !0)
                        }
                    })
                }(i.baseOption, n.baseOption), n.timelineOptions.length && (i.timelineOptions = n.timelineOptions), n.mediaList.length && (i.mediaList = n.mediaList), n.mediaDefault && (i.mediaDefault = n.mediaDefault)) : this._optionBackup = n
            }, mountOption: function (e) {
                var t = this._optionBackup;
                return this._timelineOptions = ou(t.timelineOptions, au), this._mediaList = ou(t.mediaList, au), this._mediaDefault = au(t.mediaDefault), this._currentMediaIndices = [], au(e ? t.baseOption : this._newBaseOption)
            }, getTimelineOption: function (e) {
                var t, i = this._timelineOptions;
                if (i.length) {
                    var n = e.getComponent("timeline");
                    n && (t = au(i[n.getCurrentIndex()], !0))
                }
                return t
            }, getMediaOption: function (e) {
                var t = this._api.getWidth(), i = this._api.getHeight(), n = this._mediaList, a = this._mediaDefault,
                    o = [], r = [];
                if (!n.length && !a) return r;
                for (var s = 0, l = n.length; s < l; s++) du(n[s].query, t, i) && o.push(s);
                return !o.length && a && (o = [-1]), o.length && !function (e, t) {
                    return e.join(",") === t.join(",")
                }(o, this._currentMediaIndices) && (r = ou(o, function (e) {
                    return au(-1 === e ? a.option : n[e].option)
                })), this._currentMediaIndices = o, r
            }
        };
        var uu = A, cu = B,
            hu = ["areaStyle", "lineStyle", "nodeStyle", "linkStyle", "chordStyle", "label", "labelLine"];

        function fu(e) {
            var t = e && e.itemStyle;
            if (t) for (var i = 0, n = hu.length; i < n; i++) {
                var a = hu[i], o = t.normal, r = t.emphasis;
                o && o[a] && (e[a] = e[a] || {}, e[a].normal ? m(e[a].normal, o[a]) : e[a].normal = o[a], o[a] = null), r && r[a] && (e[a] = e[a] || {}, e[a].emphasis ? m(e[a].emphasis, r[a]) : e[a].emphasis = r[a], r[a] = null)
            }
        }

        function gu(e, t, i) {
            if (e && e[t] && (e[t].normal || e[t].emphasis)) {
                var n = e[t].normal, a = e[t].emphasis;
                n && (i ? (e[t].normal = e[t].emphasis = null, T(e[t], n)) : e[t] = n), a && (e.emphasis = e.emphasis || {}, e.emphasis[t] = a)
            }
        }

        function pu(e) {
            gu(e, "itemStyle"), gu(e, "lineStyle"), gu(e, "areaStyle"), gu(e, "label"), gu(e, "labelLine"), gu(e, "upperLabel"), gu(e, "edgeLabel")
        }

        function vu(e, t) {
            var i = cu(e) && e[t], n = cu(i) && i.textStyle;
            if (n) for (var a = 0, o = Oa.length; a < o; a++) t = Oa[a], n.hasOwnProperty(t) && (i[t] = n[t])
        }

        function mu(e) {
            e && (pu(e), vu(e, "label"), e.emphasis && vu(e.emphasis, "label"))
        }

        function yu(e) {
            return O(e) ? e : e ? [e] : []
        }

        function ku(e) {
            return (O(e) ? e[0] : e) || {}
        }

        function Tu(e) {
            A(wu, function (t) {
                t[0] in e && !(t[1] in e) && (e[t[1]] = e[t[0]])
            })
        }

        var wu = [["x", "left"], ["y", "top"], ["x2", "right"], ["y2", "bottom"]],
            Cu = ["grid", "geo", "parallel", "legend", "toolbox", "title", "visualMap", "dataZoom", "timeline"],
            Su = function (e, t) {
                (function (e, t) {
                    uu(yu(e.series), function (e) {
                        cu(e) && function (e) {
                            if (cu(e)) {
                                fu(e), pu(e), vu(e, "label"), vu(e, "upperLabel"), vu(e, "edgeLabel"), e.emphasis && (vu(e.emphasis, "label"), vu(e.emphasis, "upperLabel"), vu(e.emphasis, "edgeLabel")), (i = e.markPoint) && (fu(i), mu(i)), (n = e.markLine) && (fu(n), mu(n));
                                var t = e.markArea;
                                t && mu(t);
                                var i, n, a = e.data;
                                if ("graph" === e.type) {
                                    a = a || e.nodes;
                                    var o = e.links || e.edges;
                                    if (o && !R(o)) for (var r = 0; r < o.length; r++) mu(o[r]);
                                    A(e.categories, function (e) {
                                        pu(e)
                                    })
                                }
                                if (a && !R(a)) for (r = 0; r < a.length; r++) mu(a[r]);
                                if ((i = e.markPoint) && i.data) {
                                    var s = i.data;
                                    for (r = 0; r < s.length; r++) mu(s[r])
                                }
                                if ((n = e.markLine) && n.data) {
                                    var l = n.data;
                                    for (r = 0; r < l.length; r++) O(l[r]) ? (mu(l[r][0]), mu(l[r][1])) : mu(l[r])
                                }
                                "gauge" === e.type ? (vu(e, "axisLabel"), vu(e, "title"), vu(e, "detail")) : "treemap" === e.type ? (gu(e.breadcrumb, "itemStyle"), A(e.levels, function (e) {
                                    pu(e)
                                })) : "tree" === e.type && pu(e.leaves)
                            }
                        }(e)
                    });
                    var i = ["xAxis", "yAxis", "radiusAxis", "angleAxis", "singleAxis", "parallelAxis", "radar"];
                    t && i.push("valueAxis", "categoryAxis", "logAxis", "timeAxis"), uu(i, function (t) {
                        uu(yu(e[t]), function (e) {
                            e && (vu(e, "axisLabel"), vu(e.axisPointer, "label"))
                        })
                    }), uu(yu(e.parallel), function (e) {
                        var t = e && e.parallelAxisDefault;
                        vu(t, "axisLabel"), vu(t && t.axisPointer, "label")
                    }), uu(yu(e.calendar), function (e) {
                        gu(e, "itemStyle"), vu(e, "dayLabel"), vu(e, "monthLabel"), vu(e, "yearLabel")
                    }), uu(yu(e.radar), function (e) {
                        vu(e, "name")
                    }), uu(yu(e.geo), function (e) {
                        cu(e) && (mu(e), uu(yu(e.regions), function (e) {
                            mu(e)
                        }))
                    }), uu(yu(e.timeline), function (e) {
                        mu(e), gu(e, "label"), gu(e, "itemStyle"), gu(e, "controlStyle", !0);
                        var t = e.data;
                        O(t) && A(t, function (e) {
                            B(e) && (gu(e, "label"), gu(e, "itemStyle"))
                        })
                    }), uu(yu(e.toolbox), function (e) {
                        gu(e, "iconStyle"), uu(e.feature, function (e) {
                            gu(e, "iconStyle")
                        })
                    }), vu(ku(e.axisPointer), "label"), vu(ku(e.tooltip).axisPointer, "label")
                })(e, t), e.series = Pa(e.series), A(e.series, function (e) {
                    if (B(e)) {
                        var t = e.type;
                        if ("line" === t) null != e.clipOverflow && (e.clip = e.clipOverflow); else if ("pie" === t || "gauge" === t) null != e.clockWise && (e.clockwise = e.clockWise); else if ("gauge" === t) {
                            var i = function (e, t) {
                                t = t.split(",");
                                for (var i = e, n = 0; n < t.length && null != (i = i && i[t[n]]); n++) ;
                                return i
                            }(e, "pointer.color");
                            null != i && function (e, t, i, n) {
                                t = t.split(",");
                                for (var a, o = e, r = 0; r < t.length - 1; r++) null == o[a = t[r]] && (o[a] = {}), o = o[a];
                                null != o[t[r]] || (o[t[r]] = i)
                            }(e, "itemStyle.color", i)
                        }
                        Tu(e)
                    }
                }), e.dataRange && (e.visualMap = e.dataRange), A(Cu, function (t) {
                    var i = e[t];
                    i && (O(i) || (i = [i]), A(i, function (e) {
                        Tu(e)
                    }))
                })
            };

        function bu(e) {
            A(e, function (t, i) {
                var n = [], a = [NaN, NaN], o = [t.stackResultDimension, t.stackedOverDimension], r = t.data,
                    s = t.isStackedByIndex, l = r.map(o, function (o, l, d) {
                        var u, c, h = r.get(t.stackedDimension, d);
                        if (isNaN(h)) return a;
                        s ? c = r.getRawIndex(d) : u = r.get(t.stackedByDimension, d);
                        for (var f = NaN, g = i - 1; 0 <= g; g--) {
                            var p = e[g];
                            if (s || (c = p.data.rawIndexOf(p.stackedByDimension, u)), 0 <= c) {
                                var v = p.data.getByRawIndex(p.stackResultDimension, c);
                                if (0 <= h && 0 < v || h <= 0 && v < 0) {
                                    h += v, f = v;
                                    break
                                }
                            }
                        }
                        return n[0] = h, n[1] = f, n
                    });
                r.hostModel.setData(l), t.data = l
            })
        }

        function Iu(e, t) {
            Rd.isInstance(e) || (e = Rd.seriesDataToSource(e)), this._source = e;
            var i = this._data = e.data, n = e.sourceFormat;
            n === Ld && (this._offset = 0, this._dimSize = t, this._data = i), k(this, Au[n === Pd ? n + "_" + e.seriesLayoutBy : n])
        }

        var _u = Iu.prototype;
        _u.pure = !1;
        var Au = {
            arrayRows_column: {
                pure: _u.persistent = !0, count: function () {
                    return Math.max(0, this._data.length - this._source.startIndex)
                }, getItem: function (e) {
                    return this._data[e + this._source.startIndex]
                }, appendData: Nu
            },
            arrayRows_row: {
                pure: !0, count: function () {
                    var e = this._data[0];
                    return e ? Math.max(0, e.length - this._source.startIndex) : 0
                }, getItem: function (e) {
                    e += this._source.startIndex;
                    for (var t = [], i = this._data, n = 0; n < i.length; n++) {
                        var a = i[n];
                        t.push(a ? a[e] : null)
                    }
                    return t
                }, appendData: function () {
                    throw new Error('Do not support appendData when set seriesLayoutBy: "row".')
                }
            },
            objectRows: {pure: !0, count: Du, getItem: xu, appendData: Nu},
            keyedColumns: {
                pure: !0, count: function () {
                    var e = this._source.dimensionsDefine[0].name, t = this._data[e];
                    return t ? t.length : 0
                }, getItem: function (e) {
                    for (var t = [], i = this._source.dimensionsDefine, n = 0; n < i.length; n++) {
                        var a = this._data[i[n].name];
                        t.push(a ? a[e] : null)
                    }
                    return t
                }, appendData: function (e) {
                    var t = this._data;
                    A(e, function (e, i) {
                        for (var n = t[i] || (t[i] = []), a = 0; a < (e || []).length; a++) n.push(e[a])
                    })
                }
            },
            original: {count: Du, getItem: xu, appendData: Nu},
            typedArray: {
                persistent: !(_u.getSource = function () {
                    return this._source
                }), pure: !0, count: function () {
                    return this._data ? this._data.length / this._dimSize : 0
                }, getItem: function (e, t) {
                    e -= this._offset, t = t || [];
                    for (var i = this._dimSize * e, n = 0; n < this._dimSize; n++) t[n] = this._data[i + n];
                    return t
                }, appendData: function (e) {
                    this._data = e
                }, clean: function () {
                    this._offset += this.count(), this._data = null
                }
            }
        };

        function Du() {
            return this._data.length
        }

        function xu(e) {
            return this._data[e]
        }

        function Nu(e) {
            for (var t = 0; t < e.length; t++) this._data.push(e[t])
        }

        var Eu = {
            arrayRows: Pu, objectRows: function (e, t, i, n) {
                return null != i ? e[n] : e
            }, keyedColumns: Pu, original: function (e, t, i, n) {
                var a = Fa(e);
                return null != i && a instanceof Array ? a[i] : a
            }, typedArray: Pu
        };

        function Pu(e, t, i, n) {
            return null != i ? e[i] : e
        }

        var Mu = {
            arrayRows: Ou, objectRows: function (e, t, i, n) {
                return Fu(e[t], this._dimensionInfos[t])
            }, keyedColumns: Ou, original: function (e, t, i, n) {
                var a = e && (null == e.value ? e : e.value);
                return !this._rawData.pure && function (e) {
                    return xa(e) && !(e instanceof Array)
                }(e) && (this.hasItemOption = !0), Fu(a instanceof Array ? a[n] : a, this._dimensionInfos[t])
            }, typedArray: function (e, t, i, n) {
                return e[n]
            }
        };

        function Ou(e, t, i, n) {
            return Fu(e[n], this._dimensionInfos[t])
        }

        function Fu(e, t) {
            var i = t && t.type;
            if ("ordinal" !== i) return "time" === i && "number" != typeof e && null != e && "-" !== e && (e = +Wl(e)), null == e || "" === e ? NaN : +e;
            var n = t && t.ordinalMeta;
            return n ? n.parseAndCollect(e) : e
        }

        function Lu(e, t, i) {
            if (e) {
                var n = e.getRawDataItem(t);
                if (null != n) {
                    var a, o, r = e.getProvider().getSource().sourceFormat, s = e.getDimensionInfo(i);
                    return s && (a = s.name, o = s.index), Eu[r](n, t, o, a)
                }
            }
        }

        function Bu(e, t, i) {
            if (e) {
                var n = e.getProvider().getSource().sourceFormat;
                if (n === Ed || n === Md) {
                    var a = e.getRawDataItem(t);
                    return n !== Ed || B(a) || (a = null), a ? a[i] : void 0
                }
            }
        }

        var Uu = /\{@(.+?)\}/g, Ru = {
            getDataParams: function (e, t) {
                var i = this.getData(t), n = this.getRawValue(e, t), a = i.getRawIndex(e), o = i.getName(e),
                    r = i.getRawDataItem(e), s = i.getItemVisual(e, "color"), l = i.getItemVisual(e, "borderColor"),
                    d = this.ecModel.getComponent("tooltip"), u = Ga(d && d.get("renderMode")), c = this.mainType,
                    h = "series" === c, f = i.userOutput;
                return {
                    componentType: c,
                    componentSubType: this.subType,
                    componentIndex: this.componentIndex,
                    seriesType: h ? this.subType : null,
                    seriesIndex: this.seriesIndex,
                    seriesId: h ? this.id : null,
                    seriesName: h ? this.name : null,
                    name: o,
                    dataIndex: a,
                    data: r,
                    dataType: t,
                    value: n,
                    color: s,
                    borderColor: l,
                    dimensionNames: f ? f.dimensionNames : null,
                    encode: f ? f.encode : null,
                    marker: ad({color: s, renderMode: u}),
                    $vars: ["seriesName", "name", "value"]
                }
            }, getFormattedLabel: function (e, t, i, n, a) {
                t = t || "normal";
                var o = this.getData(i), r = o.getItemModel(e), s = this.getDataParams(e, i);
                null != n && s.value instanceof Array && (s.value = s.value[n]);
                var l = r.get("normal" === t ? [a || "label", "formatter"] : [t, a || "label", "formatter"]);
                return "function" == typeof l ? (s.status = t, s.dimensionIndex = n, l(s)) : "string" == typeof l ? id(l, s).replace(Uu, function (t, i) {
                    var n = i.length;
                    return "[" === i.charAt(0) && "]" === i.charAt(n - 1) && (i = +i.slice(1, n - 1)), Lu(o, e, i)
                }) : void 0
            }, getRawValue: function (e, t) {
                return Lu(this.getData(t), e)
            }, formatTooltip: function () {
            }
        };

        function Ku(e) {
            return new Wu(e)
        }

        function Wu(e) {
            e = e || {}, this._reset = e.reset, this._plan = e.plan, this._count = e.count, this._onDirty = e.onDirty, this._dirty = !0, this.context
        }

        var Vu = Wu.prototype;
        Vu.perform = function (e) {
            var t, i = this._upstream, n = e && e.skip;
            if (this._dirty && i) {
                var a = this.context;
                a.data = a.outputData = i.context.outputData
            }
            this.__pipeline && (this.__pipeline.currentTask = this), this._plan && !n && (t = this._plan(this.context));
            var o, r = u(this._modBy), s = this._modDataCount || 0, l = u(e && e.modBy), d = e && e.modDataCount || 0;

            function u(e) {
                return 1 <= e || (e = 1), e
            }

            r === l && s === d || (t = "reset"), !this._dirty && "reset" !== t || (this._dirty = !1, o = function (e, t) {
                var i, n;
                e._dueIndex = e._outputDueEnd = e._dueEnd = 0, e._settedOutputEnd = null, !t && e._reset && ((i = e._reset(e.context)) && i.progress && (n = i.forceFirstProgress, i = i.progress), O(i) && !i.length && (i = null)), e._progress = i, e._modBy = e._modDataCount = null;
                var a = e._downstream;
                return a && a.dirty(), n
            }(this, n)), this._modBy = l, this._modDataCount = d;
            var c = e && e.step;
            if (this._dueEnd = i ? i._outputDueEnd : this._count ? this._count(this.context) : 1 / 0, this._progress) {
                var h = this._dueIndex, f = Math.min(null != c ? this._dueIndex + c : 1 / 0, this._dueEnd);
                if (!n && (o || h < f)) {
                    var g = this._progress;
                    if (O(g)) for (var p = 0; p < g.length; p++) Zu(this, g[p], h, f, l, d); else Zu(this, g, h, f, l, d)
                }
                this._dueIndex = f;
                var v = null != this._settedOutputEnd ? this._settedOutputEnd : f;
                this._outputDueEnd = v
            } else this._dueIndex = this._outputDueEnd = null != this._settedOutputEnd ? this._settedOutputEnd : this._dueEnd;
            return this.unfinished()
        };
        var Hu, zu, ju, Gu, $u, Xu, qu = Xu = {
            reset: function (e, t, i, n) {
                zu = e, Hu = t, ju = i, Gu = n, $u = Math.ceil(Gu / ju), Xu.next = 1 < ju && 0 < Gu ? Ju : Yu
            }
        };

        function Yu() {
            return zu < Hu ? zu++ : null
        }

        function Ju() {
            var e = zu % $u * ju + Math.ceil(zu / $u), t = Hu <= zu ? null : e < Gu ? e : zu;
            return zu++, t
        }

        function Zu(e, t, i, n, a, o) {
            qu.reset(i, n, a, o), e._callingProgress = t, e._callingProgress({
                start: i,
                end: n,
                count: n - i,
                next: qu.next
            }, e.context)
        }

        Vu.dirty = function () {
            this._dirty = !0, this._onDirty && this._onDirty(this.context)
        }, Vu.unfinished = function () {
            return this._progress && this._dueIndex < this._dueEnd
        }, Vu.pipe = function (e) {
            this._downstream === e && !this._dirty || ((this._downstream = e)._upstream = this, e.dirty())
        }, Vu.dispose = function () {
            this._disposed || (this._upstream && (this._upstream._downstream = null), this._downstream && (this._downstream._upstream = null), this._dirty = !1, this._disposed = !0)
        }, Vu.getUpstream = function () {
            return this._upstream
        }, Vu.getDownstream = function () {
            return this._downstream
        }, Vu.setOutputEnd = function (e) {
            this._outputDueEnd = this._settedOutputEnd = e
        };
        var Qu = Wa(), ec = Id.extend({
            type: "series.__base__",
            seriesIndex: 0,
            coordinateSystem: null,
            defaultOption: null,
            legendVisualProvider: null,
            visualColorAccessPath: "itemStyle.color",
            visualBorderColorAccessPath: "itemStyle.borderColor",
            layoutMode: null,
            init: function (e, t, i, n) {
                this.seriesIndex = this.componentIndex, this.dataTask = Ku({
                    count: ic,
                    reset: nc
                }), this.dataTask.context = {model: this}, this.mergeDefaultAndTheme(e, i), Vd(this);
                var a = this.getInitialData(e, i);
                oc(a, this), this.dataTask.context.data = a, Qu(this).dataBeforeProcessed = a, tc(this)
            },
            mergeDefaultAndTheme: function (e, t) {
                var i = this.layoutMode, n = i ? kd(e) : {}, a = this.subType;
                Id.hasClass(a) && (a += "Series"), m(e, t.getTheme().get(this.subType)), m(e, this.getDefaultOption()), Ma(e, "label", ["show"]), this.fillDataTextStyle(e.data), i && yd(e, n, i)
            },
            mergeOption: function (e, t) {
                e = m(this.option, e, !0), this.fillDataTextStyle(e.data);
                var i = this.layoutMode;
                i && yd(this.option, e, i), Vd(this);
                var n = this.getInitialData(e, t);
                oc(n, this), this.dataTask.dirty(), this.dataTask.context.data = n, Qu(this).dataBeforeProcessed = n, tc(this)
            },
            fillDataTextStyle: function (e) {
                if (e && !R(e)) for (var t = ["show"], i = 0; i < e.length; i++) e[i] && e[i].label && Ma(e[i], "label", t)
            },
            getInitialData: function () {
            },
            appendData: function (e) {
                this.getRawData().appendData(e.data)
            },
            getData: function (e) {
                var t = sc(this);
                if (t) {
                    var i = t.context.data;
                    return null == e ? i : i.getLinkedData(e)
                }
                return Qu(this).data
            },
            setData: function (e) {
                var t = sc(this);
                if (t) {
                    var i = t.context;
                    i.data !== e && t.modifyOutputEnd && t.setOutputEnd(e.count()), i.outputData = e, t !== this.dataTask && (i.data = e)
                }
                Qu(this).data = e
            },
            getSource: function () {
                return Wd(this).source
            },
            getRawData: function () {
                return Qu(this).dataBeforeProcessed
            },
            getBaseAxis: function () {
                var e = this.coordinateSystem;
                return e && e.getBaseAxis && e.getBaseAxis()
            },
            formatTooltip: function (e, t, i, n) {
                var a = this, o = "html" === (n = n || "html") ? "<br/>" : "\n", r = "richText" === n, s = {}, l = 0,
                    d = this.getData(), u = d.mapDimension("defaultedTooltip", !0), c = u.length,
                    h = this.getRawValue(e), f = O(h), g = d.getItemVisual(e, "color");
                B(g) && g.colorStops && (g = (g.colorStops[0] || {}).color), g = g || "transparent";
                var p = (1 < c || f && !c ? function (i) {
                        var o = x(i, function (e, t, i) {
                            var n = d.getDimensionInfo(i);
                            return e | (n && !1 !== n.tooltip && null != n.displayName)
                        }, 0), c = [];

                        function h(e, i) {
                            var u = d.getDimensionInfo(i);
                            if (u && !1 !== u.otherDims.tooltip) {
                                var h = u.type, f = "sub" + a.seriesIndex + "at" + l,
                                    p = ad({color: g, type: "subItem", renderMode: n, markerId: f}),
                                    v = "string" == typeof p ? p : p.content,
                                    m = (o ? v + Ql(u.displayName || "-") + ": " : "") + Ql("ordinal" === h ? e + "" : "time" === h ? t ? "" : rd("yyyy/MM/dd hh:mm:ss", e) : Xl(e));
                                m && c.push(m), r && (s[f] = g, ++l)
                            }
                        }

                        u.length ? A(u, function (t) {
                            h(Lu(d, e, t), t)
                        }) : A(i, h);
                        var f = o ? r ? "\n" : "<br/>" : "", p = f + c.join(f || ", ");
                        return {renderMode: n, content: p, style: s}
                    }(h) : function (e) {
                        return {renderMode: n, content: Ql(Xl(e)), style: s}
                    }(c ? Lu(d, e, u[0]) : f ? h[0] : h)).content, v = a.seriesIndex + "at" + l,
                    m = ad({color: g, type: "item", renderMode: n, markerId: v});
                s[v] = g, ++l;
                var y = d.getName(e), k = this.name;
                Ua(this) || (k = ""), k = k ? Ql(k) + (t ? ": " : o) : "";
                var T = "string" == typeof m ? m : m.content;
                return {html: t ? T + k + p : k + T + (y ? Ql(y) + ": " + p : p), markers: s}
            },
            isAnimationEnabled: function () {
                if (a.node) return !1;
                var e = this.getShallow("animation");
                return e && this.getData().count() > this.getShallow("animationThreshold") && (e = !1), e
            },
            restoreData: function () {
                this.dataTask.dirty()
            },
            getColorFromPalette: function (e, t, i) {
                var n = this.ecModel, a = Nd.getColorFromPalette.call(this, e, t, i);
                return a = a || n.getColorFromPalette(e, t, i)
            },
            coordDimToDataDim: function (e) {
                return this.getRawData().mapDimension(e, !0)
            },
            getProgressive: function () {
                return this.get("progressive")
            },
            getProgressiveThreshold: function () {
                return this.get("progressiveThreshold")
            },
            getAxisTooltipData: null,
            getTooltipPosition: null,
            pipeTask: null,
            preventIncremental: null,
            pipelineContext: null
        });

        function tc(e) {
            var t = e.name;
            Ua(e) || (e.name = function (e) {
                var t = e.getRawData(), i = t.mapDimension("seriesName", !0), n = [];
                return A(i, function (e) {
                    var i = t.getDimensionInfo(e);
                    i.displayName && n.push(i.displayName)
                }), n.join(" ")
            }(e) || t)
        }

        function ic(e) {
            return e.model.getRawData().count()
        }

        function nc(e) {
            var t = e.model;
            return t.setData(t.getRawData().cloneShallow()), ac
        }

        function ac(e, t) {
            t.outputData && e.end > t.outputData.count() && t.model.getRawData().cloneShallow(t.outputData)
        }

        function oc(e, t) {
            A(e.CHANGABLE_METHODS, function (i) {
                e.wrapMethod(i, M(rc, t))
            })
        }

        function rc(e) {
            var t = sc(e);
            t && t.setOutputEnd(this.count())
        }

        function sc(e) {
            var t = (e.ecModel || {}).scheduler, i = t && t.getPipeline(e.uid);
            if (i) {
                var n = i.currentTask;
                if (n) {
                    var a = n.agentStubMap;
                    a && (n = a.get(e.uid))
                }
                return n
            }
        }

        I(ec, Ru), I(ec, Nd);
        var lc = function () {
            this.group = new Di, this.uid = Al("viewComponent")
        };
        lc.prototype = {
            constructor: lc, init: function (e, t) {
            }, render: function (e, t, i, n) {
            }, dispose: function () {
            }, filterForExposedEvent: null
        };
        var dc = lc.prototype;

        function uc() {
            var e = Wa();
            return function (t) {
                var i = e(t), n = t.pipelineContext, a = i.large, o = i.progressiveRender, r = i.large = n && n.large,
                    s = i.progressiveRender = n && n.progressiveRender;
                return !!(a ^ r || o ^ s) && "reset"
            }
        }

        dc.updateView = dc.updateLayout = dc.updateVisual = function (e, t, i, n) {
        }, Ja(lc), io(lc, {registerWhenExtend: !0});
        var cc = Wa(), hc = uc();

        function fc() {
            this.group = new Di, this.uid = Al("viewChart"), this.renderTask = Ku({
                plan: mc,
                reset: yc
            }), this.renderTask.context = {view: this}
        }

        var gc = fc.prototype = {
            type: "chart",
            init: function (e, t) {
            },
            render: function (e, t, i, n) {
            },
            highlight: function (e, t, i, n) {
                vc(e.getData(), n, "emphasis")
            },
            downplay: function (e, t, i, n) {
                vc(e.getData(), n, "normal")
            },
            remove: function (e, t) {
                this.group.removeAll()
            },
            dispose: function () {
            },
            incrementalPrepareRender: null,
            incrementalRender: null,
            updateTransform: null,
            filterForExposedEvent: null
        };

        function pc(e, t, i) {
            if (e && (e.trigger(t, i), e.isGroup && !$s(e))) for (var n = 0, a = e.childCount(); n < a; n++) pc(e.childAt(n), t, i)
        }

        function vc(e, t, i) {
            var n = Ka(e, t), a = t && null != t.highlightKey ? Xs(t.highlightKey) : null;
            null != n ? A(Pa(n), function (t) {
                pc(e.getItemGraphicEl(t), i, a)
            }) : e.eachItemGraphicEl(function (e) {
                pc(e, i, a)
            })
        }

        function mc(e) {
            return hc(e.model)
        }

        function yc(e) {
            var t = e.model, i = e.ecModel, n = e.api, a = e.payload, o = t.pipelineContext.progressiveRender,
                r = e.view, s = a && cc(a).updateMethod, l = o ? "incrementalPrepareRender" : s && r[s] ? s : "render";
            return "render" !== l && r[l](t, i, n, a), kc[l]
        }

        gc.updateView = gc.updateLayout = gc.updateVisual = function (e, t, i, n) {
            this.render(e, t, i, n)
        }, Ja(fc), io(fc, {registerWhenExtend: !0}), fc.markUpdateMethod = function (e, t) {
            cc(e).updateMethod = t
        };
        var kc = {
            incrementalPrepareRender: {
                progress: function (e, t) {
                    t.view.incrementalRender(e, t.model, t.ecModel, t.api, t.payload)
                }
            }, render: {
                forceFirstProgress: !0, progress: function (e, t) {
                    t.view.render(t.model, t.ecModel, t.api, t.payload)
                }
            }
        }, Tc = "\0__throttleOriginMethod", wc = "\0__throttleRate", Cc = "\0__throttleType";

        function Sc(e, t, i) {
            var n, a, o, r, s, l = 0, d = 0, u = null;

            function c() {
                d = (new Date).getTime(), u = null, e.apply(o, r || [])
            }

            function h() {
                n = (new Date).getTime(), o = this, r = arguments;
                var e = s || t, h = s || i;
                s = null, a = n - (h ? l : d) - e, clearTimeout(u), h ? u = setTimeout(c, e) : 0 <= a ? c() : u = setTimeout(c, -a), l = n
            }

            return t = t || 0, h.clear = function () {
                u && (clearTimeout(u), u = null)
            }, h.debounceNextCall = function (e) {
                s = e
            }, h
        }

        function bc(e, t, i, n) {
            var a = e[t];
            if (a) {
                var o = a[Tc] || a, r = a[Cc];
                if (a[wc] !== i || r !== n) {
                    if (null == i || !n) return e[t] = o;
                    (a = e[t] = Sc(o, i, "debounce" === n))[Tc] = o, a[Cc] = n, a[wc] = i
                }
                return a
            }
        }

        function Ic(e, t) {
            var i = e[t];
            i && i[Tc] && (e[t] = i[Tc])
        }

        var _c = {
            createOnAllSeries: !0, performRawSeries: !0, reset: function (e, t) {
                var i = e.getData(), n = (e.visualColorAccessPath || "itemStyle.color").split("."), a = e.get(n),
                    o = !F(a) || a instanceof os ? null : a;
                a && !o || (a = e.getColorFromPalette(e.name, null, t.getSeriesCount())), i.setVisual("color", a);
                var r = (e.visualBorderColorAccessPath || "itemStyle.borderColor").split("."), s = e.get(r);
                if (i.setVisual("borderColor", s), !t.isSeriesFiltered(e)) return o && i.each(function (t) {
                    i.setItemVisual(t, "color", o(e.getDataParams(t)))
                }), {
                    dataEach: i.hasItemOption ? function (e, t) {
                        var i = e.getItemModel(t), a = i.get(n, !0), o = i.get(r, !0);
                        null != a && e.setItemVisual(t, "color", a), null != o && e.setItemVisual(t, "borderColor", o)
                    } : null
                }
            }
        }, Ac = {
            legend: {selector: {all: "全选", inverse: "反选"}},
            toolbox: {
                brush: {
                    title: {
                        rect: "矩形选择",
                        polygon: "圈选",
                        lineX: "横向选择",
                        lineY: "纵向选择",
                        keep: "保持选择",
                        clear: "清除选择"
                    }
                },
                dataView: {title: "数据视图", lang: ["数据视图", "关闭", "刷新"]},
                dataZoom: {title: {zoom: "区域缩放", back: "区域缩放还原"}},
                magicType: {title: {line: "切换为折线图", bar: "切换为柱状图", stack: "切换为堆叠", tiled: "切换为平铺"}},
                restore: {title: "还原"},
                saveAsImage: {title: "保存为图片", lang: ["右键另存为图片"]}
            },
            series: {
                typeNames: {
                    pie: "饼图",
                    bar: "柱状图",
                    line: "折线图",
                    scatter: "散点图",
                    effectScatter: "涟漪散点图",
                    radar: "雷达图",
                    tree: "树图",
                    treemap: "矩形树图",
                    boxplot: "箱型图",
                    candlestick: "K线图",
                    k: "K线图",
                    heatmap: "热力图",
                    map: "地图",
                    parallel: "平行坐标图",
                    lines: "线图",
                    graph: "关系图",
                    sankey: "桑基图",
                    funnel: "漏斗图",
                    gauge: "仪表盘图",
                    pictorialBar: "象形柱图",
                    themeRiver: "主题河流图",
                    sunburst: "旭日图"
                }
            },
            aria: {
                general: {withTitle: "这是一个关于“{title}”的图表。", withoutTitle: "这是一个图表，"},
                series: {
                    single: {
                        prefix: "",
                        withName: "图表类型是{seriesType}，表示{seriesName}。",
                        withoutName: "图表类型是{seriesType}。"
                    },
                    multiple: {
                        prefix: "它由{seriesCount}个图表系列组成。",
                        withName: "第{seriesId}个系列是一个表示{seriesName}的{seriesType}，",
                        withoutName: "第{seriesId}个系列是一个{seriesType}，",
                        separator: {middle: "；", end: "。"}
                    }
                },
                data: {
                    allData: "其数据是——",
                    partialData: "其中，前{displayCnt}项是——",
                    withName: "{name}的数据是{value}",
                    withoutName: "{value}",
                    separator: {middle: "，", end: ""}
                }
            }
        }, Dc = function (e, t) {
            var i = t.getModel("aria");
            if (i.get("show")) if (i.get("description")) e.setAttribute("aria-label", i.get("description")); else {
                var n = 0;
                t.eachSeries(function (e, t) {
                    ++n
                }, this);
                var a, o = i.get("data.maxCount") || 10, r = i.get("series.maxCount") || 10, s = Math.min(n, r);
                if (!(n < 1)) {
                    var l = function () {
                        var e = t.getModel("title").option;
                        return e && e.length && (e = e[0]), e && e.text
                    }();
                    a = l ? u(c("general.withTitle"), {title: l}) : c("general.withoutTitle");
                    var d = [];
                    a += u(c(1 < n ? "series.multiple.prefix" : "series.single.prefix"), {seriesCount: n}), t.eachSeries(function (e, t) {
                        if (t < s) {
                            var i, a = e.get("name"), r = "series." + (1 < n ? "multiple" : "single") + ".";
                            i = u(i = c(a ? r + "withName" : r + "withoutName"), {
                                seriesId: e.seriesIndex,
                                seriesName: e.get("name"),
                                seriesType: function (e) {
                                    return Ac.series.typeNames[e] || "自定义图"
                                }(e.subType)
                            });
                            var l = e.getData();
                            (window.data = l).count() > o ? i += u(c("data.partialData"), {displayCnt: o}) : i += c("data.allData");
                            for (var h = [], f = 0; f < l.count(); f++) if (f < o) {
                                var g = l.getName(f), p = Lu(l, f);
                                h.push(u(c(g ? "data.withName" : "data.withoutName"), {name: g, value: p}))
                            }
                            i += h.join(c("data.separator.middle")) + c("data.separator.end"), d.push(i)
                        }
                    }), a += d.join(c("series.multiple.separator.middle")) + c("series.multiple.separator.end"), e.setAttribute("aria-label", a)
                }
            }

            function u(e, t) {
                if ("string" != typeof e) return e;
                var i = e;
                return A(t, function (e, t) {
                    i = i.replace(new RegExp("\\{\\s*" + t + "\\s*\\}", "g"), e)
                }), i
            }

            function c(e) {
                var t = i.get(e);
                if (null != t) return t;
                for (var n = e.split("."), a = Ac.aria, o = 0; o < n.length; ++o) a = a[n[o]];
                return a
            }
        }, xc = Math.PI;

        function Nc(e, t, i, n) {
            this.ecInstance = e, this.api = t, this.unfinished, i = this._dataProcessorHandlers = i.slice(), n = this._visualHandlers = n.slice(), this._allHandlers = i.concat(n), this._stageTaskMap = Q()
        }

        var Ec = Nc.prototype;

        function Pc(e, t, i, n, a) {
            var o;

            function r(e, t) {
                return e.setDirty && (!e.dirtyMap || e.dirtyMap.get(t.__pipeline.id))
            }

            a = a || {}, A(t, function (t, s) {
                if (!a.visualType || a.visualType === t.visualType) {
                    var l = e._stageTaskMap.get(t.uid), d = l.seriesTaskMap, u = l.overallTask;
                    if (u) {
                        var c, h = u.agentStubMap;
                        h.each(function (e) {
                            r(a, e) && (e.dirty(), c = !0)
                        }), c && u.dirty(), Mc(u, n);
                        var f = e.getPerformArgs(u, a.block);
                        h.each(function (e) {
                            e.perform(f)
                        }), o |= u.perform(f)
                    } else d && d.each(function (s, l) {
                        r(a, s) && s.dirty();
                        var d = e.getPerformArgs(s, a.block);
                        d.skip = !t.performRawSeries && i.isSeriesFiltered(s.context.model), Mc(s, n), o |= s.perform(d)
                    })
                }
            }), e.unfinished |= o
        }

        Ec.restoreData = function (e, t) {
            e.restoreData(t), this._stageTaskMap.each(function (e) {
                var t = e.overallTask;
                t && t.dirty()
            })
        }, Ec.getPerformArgs = function (e, t) {
            if (e.__pipeline) {
                var i = this._pipelineMap.get(e.__pipeline.id), n = i.context,
                    a = !t && i.progressiveEnabled && (!n || n.progressiveRender) && e.__idxInPipeline > i.blockIndex ? i.step : null,
                    o = n && n.modDataCount;
                return {step: a, modBy: null != o ? Math.ceil(o / a) : null, modDataCount: o}
            }
        }, Ec.getPipeline = function (e) {
            return this._pipelineMap.get(e)
        }, Ec.updateStreamModes = function (e, t) {
            var i = this._pipelineMap.get(e.uid), n = e.getData().count(),
                a = i.progressiveEnabled && t.incrementalPrepareRender && n >= i.threshold,
                o = e.get("large") && n >= e.get("largeThreshold"),
                r = "mod" === e.get("progressiveChunkMode") ? n : null;
            e.pipelineContext = i.context = {progressiveRender: a, modDataCount: r, large: o}
        }, Ec.restorePipelines = function (e) {
            var t = this, i = t._pipelineMap = Q();
            e.eachSeries(function (e) {
                var n = e.getProgressive(), a = e.uid;
                i.set(a, {
                    id: a,
                    head: null,
                    tail: null,
                    threshold: e.getProgressiveThreshold(),
                    progressiveEnabled: n && !(e.preventIncremental && e.preventIncremental()),
                    blockIndex: -1,
                    step: Math.round(n || 700),
                    count: 0
                }), Hc(t, e, e.dataTask)
            })
        }, Ec.prepareStageTasks = function () {
            var e = this._stageTaskMap, t = this.ecInstance.getModel(), i = this.api;
            A(this._allHandlers, function (n) {
                var a = e.get(n.uid) || e.set(n.uid, []);
                n.reset && function (e, t, i, n, a) {
                    var o = i.seriesTaskMap || (i.seriesTaskMap = Q()), r = t.seriesType, s = t.getTargetSeries;

                    function l(i) {
                        var r = i.uid, s = o.get(r) || o.set(r, Ku({plan: Uc, reset: Rc, count: Vc}));
                        s.context = {
                            model: i,
                            ecModel: n,
                            api: a,
                            useClearVisual: t.isVisual && !t.isLayout,
                            plan: t.plan,
                            reset: t.reset,
                            scheduler: e
                        }, Hc(e, i, s)
                    }

                    t.createOnAllSeries ? n.eachRawSeries(l) : r ? n.eachRawSeriesByType(r, l) : s && s(n, a).each(l);
                    var d = e._pipelineMap;
                    o.each(function (e, t) {
                        d.get(t) || (e.dispose(), o.removeKey(t))
                    })
                }(this, n, a, t, i), n.overallReset && function (e, t, i, n, a) {
                    var o = i.overallTask = i.overallTask || Ku({reset: Oc});
                    o.context = {ecModel: n, api: a, overallReset: t.overallReset, scheduler: e};
                    var r = o.agentStubMap = o.agentStubMap || Q(), s = t.seriesType, l = t.getTargetSeries, d = !0,
                        u = t.modifyOutputEnd;

                    function c(t) {
                        var i = t.uid, n = r.get(i);
                        n || (n = r.set(i, Ku({reset: Fc, onDirty: Bc})), o.dirty()), n.context = {
                            model: t,
                            overallProgress: d,
                            modifyOutputEnd: u
                        }, n.agent = o, n.__block = d, Hc(e, t, n)
                    }

                    s ? n.eachRawSeriesByType(s, c) : l ? l(n, a).each(c) : (d = !1, A(n.getSeries(), c));
                    var h = e._pipelineMap;
                    r.each(function (e, t) {
                        h.get(t) || (e.dispose(), o.dirty(), r.removeKey(t))
                    })
                }(this, n, a, t, i)
            }, this)
        }, Ec.prepareView = function (e, t, i, n) {
            var a = e.renderTask, o = a.context;
            o.model = t, o.ecModel = i, o.api = n, a.__block = !e.incrementalPrepareRender, Hc(this, t, a)
        }, Ec.performDataProcessorTasks = function (e, t) {
            Pc(this, this._dataProcessorHandlers, e, t, {block: !0})
        }, Ec.performVisualTasks = function (e, t, i) {
            Pc(this, this._visualHandlers, e, t, i)
        }, Ec.performSeriesTasks = function (e) {
            var t;
            e.eachSeries(function (e) {
                t |= e.dataTask.perform()
            }), this.unfinished |= t
        }, Ec.plan = function () {
            this._pipelineMap.each(function (e) {
                var t = e.tail;
                do {
                    if (t.__block) {
                        e.blockIndex = t.__idxInPipeline;
                        break
                    }
                    t = t.getUpstream()
                } while (t)
            })
        };
        var Mc = Ec.updatePayload = function (e, t) {
            "remain" !== t && (e.context.payload = t)
        };

        function Oc(e) {
            e.overallReset(e.ecModel, e.api, e.payload)
        }

        function Fc(e, t) {
            return e.overallProgress && Lc
        }

        function Lc() {
            this.agent.dirty(), this.getDownstream().dirty()
        }

        function Bc() {
            this.agent && this.agent.dirty()
        }

        function Uc(e) {
            return e.plan && e.plan(e.model, e.ecModel, e.api, e.payload)
        }

        function Rc(e) {
            e.useClearVisual && e.data.clearAllVisual();
            var t = e.resetDefines = Pa(e.reset(e.model, e.ecModel, e.api, e.payload));
            return 1 < t.length ? D(t, function (e, t) {
                return Wc(t)
            }) : Kc
        }

        var Kc = Wc(0);

        function Wc(e) {
            return function (t, i) {
                var n = i.data, a = i.resetDefines[e];
                if (a && a.dataEach) for (var o = t.start; o < t.end; o++) a.dataEach(n, o); else a && a.progress && a.progress(t, n)
            }
        }

        function Vc(e) {
            return e.data.count()
        }

        function Hc(e, t, i) {
            var n = t.uid, a = e._pipelineMap.get(n);
            a.head || (a.head = i), a.tail && a.tail.pipe(i), (a.tail = i).__idxInPipeline = a.count++, i.__pipeline = a
        }

        Nc.wrapStageHandler = function (e, t) {
            return F(e) && (e = {
                overallReset: e, seriesType: function (e) {
                    zc = null;
                    try {
                        e(jc, Gc)
                    } catch (e) {
                    }
                    return zc
                }(e)
            }), e.uid = Al("stageHandler"), t && (e.visualType = t), e
        };
        var zc, jc = {}, Gc = {};

        function $c(e, t) {
            for (var i in t.prototype) e[i] = te
        }

        function Xc() {
            return {
                axisLine: {lineStyle: {color: Jc}},
                axisTick: {lineStyle: {color: Jc}},
                axisLabel: {textStyle: {color: Jc}},
                splitLine: {lineStyle: {type: "dashed", color: "#aaa"}},
                splitArea: {areaStyle: {color: Jc}}
            }
        }

        $c(jc, Yd), $c(Gc, eu), jc.eachSeriesByType = jc.eachRawSeriesByType = function (e) {
            zc = e
        }, jc.eachComponent = function (e) {
            "series" === e.mainType && e.subType && (zc = e.subType)
        };
        var qc = ["#37A2DA", "#32C5E9", "#67E0E3", "#9FE6B8", "#FFDB5C", "#ff9f7f", "#fb7293", "#E062AE", "#E690D1", "#e7bcf3", "#9d96f5", "#8378EA", "#96BFFF"],
            Yc = {
                color: qc,
                colorLayer: [["#37A2DA", "#ffd85c", "#fd7b5f"], ["#37A2DA", "#67E0E3", "#FFDB5C", "#ff9f7f", "#E062AE", "#9d96f5"], ["#37A2DA", "#32C5E9", "#9FE6B8", "#FFDB5C", "#ff9f7f", "#fb7293", "#e7bcf3", "#8378EA", "#96BFFF"], qc]
            }, Jc = "#eee",
            Zc = ["#dd6b66", "#759aa0", "#e69d87", "#8dc1a9", "#ea7e53", "#eedd78", "#73a373", "#73b9bc", "#7289ab", "#91ca8c", "#f49f42"],
            Qc = {
                color: Zc,
                backgroundColor: "#333",
                tooltip: {axisPointer: {lineStyle: {color: Jc}, crossStyle: {color: Jc}, label: {color: "#000"}}},
                legend: {textStyle: {color: Jc}},
                textStyle: {color: Jc},
                title: {textStyle: {color: Jc}},
                toolbox: {iconStyle: {normal: {borderColor: Jc}}},
                dataZoom: {textStyle: {color: Jc}},
                visualMap: {textStyle: {color: Jc}},
                timeline: {
                    lineStyle: {color: Jc},
                    itemStyle: {normal: {color: Zc[1]}},
                    label: {normal: {textStyle: {color: Jc}}},
                    controlStyle: {normal: {color: Jc, borderColor: Jc}}
                },
                timeAxis: Xc(),
                logAxis: Xc(),
                valueAxis: Xc(),
                categoryAxis: Xc(),
                line: {symbol: "circle"},
                graph: {color: Zc},
                gauge: {title: {textStyle: {color: Jc}}},
                candlestick: {
                    itemStyle: {
                        normal: {
                            color: "#FD1050",
                            color0: "#0CF49B",
                            borderColor: "#FD1050",
                            borderColor0: "#0CF49B"
                        }
                    }
                }
            };
        Qc.categoryAxis.splitLine.show = !1, Id.extend({
            type: "dataset",
            defaultOption: {seriesLayoutBy: Bd, sourceHeader: null, dimensions: null, source: null},
            optionUpdated: function () {
                !function (e) {
                    var t = e.option.source, i = Fd;
                    if (R(t)) i = Ld; else if (O(t)) {
                        0 === t.length && (i = Pd);
                        for (var n = 0, a = t.length; n < a; n++) {
                            var o = t[n];
                            if (null != o) {
                                if (O(o)) {
                                    i = Pd;
                                    break
                                }
                                if (B(o)) {
                                    i = Md;
                                    break
                                }
                            }
                        }
                    } else if (B(t)) {
                        for (var r in t) if (t.hasOwnProperty(r) && _(t[r])) {
                            i = Od;
                            break
                        }
                    } else if (null != t) throw new Error("Invalid data");
                    Wd(e).sourceFormat = i
                }(this)
            }
        }), lc.extend({type: "dataset"});
        var eh = wr.extend({
            type: "ellipse", shape: {cx: 0, cy: 0, rx: 0, ry: 0}, buildPath: function (e, t) {
                var i = t.cx, n = t.cy, a = t.rx, o = t.ry, r = .5522848 * a, s = .5522848 * o;
                e.moveTo(i - a, n), e.bezierCurveTo(i - a, n - s, i - r, n - o, i, n - o), e.bezierCurveTo(i + r, n - o, i + a, n - s, i + a, n), e.bezierCurveTo(i + a, n + s, i + r, n + o, i, n + o), e.bezierCurveTo(i - r, n + o, i - a, n + s, i - a, n), e.closePath()
            }
        }), th = /[\s,]+/;

        function ih(e) {
            for (L(e) && (e = (new DOMParser).parseFromString(e, "text/xml")), 9 === e.nodeType && (e = e.firstChild); "svg" !== e.nodeName.toLowerCase() || 1 !== e.nodeType;) e = e.nextSibling;
            return e
        }

        function nh() {
            this._defs = {}, this._root = null, this._isDefine = !1, this._isText = !1
        }

        nh.prototype.parse = function (e, t) {
            t = t || {};
            var i = ih(e);
            if (!i) throw new Error("Illegal svg");
            var n = new Di;
            this._root = n;
            var a = i.getAttribute("viewBox") || "", o = parseFloat(i.getAttribute("width") || t.width),
                r = parseFloat(i.getAttribute("height") || t.height);
            isNaN(o) && (o = null), isNaN(r) && (r = null), dh(i, n, null, !0);
            for (var s, l, d = i.firstChild; d;) this._parseNode(d, n), d = d.nextSibling;
            if (a) {
                var u = X(a).split(th);
                4 <= u.length && (s = {
                    x: parseFloat(u[0] || 0),
                    y: parseFloat(u[1] || 0),
                    width: parseFloat(u[2]),
                    height: parseFloat(u[3])
                })
            }
            if (s && null != o && null != r && (l = gh(s, o, r), !t.ignoreViewBox)) {
                var c = n;
                (n = new Di).add(c), c.scale = l.scale.slice(), c.position = l.position.slice()
            }
            return t.ignoreRootClip || null == o || null == r || n.setClipPath(new es({
                shape: {
                    x: 0,
                    y: 0,
                    width: o,
                    height: r
                }
            })), {root: n, width: o, height: r, viewBoxRect: s, viewBoxTransform: l}
        }, nh.prototype._parseNode = function (e, t) {
            var i, n, a = e.nodeName.toLowerCase();
            if ("defs" === a ? this._isDefine = !0 : "text" === a && (this._isText = !0), this._isDefine) {
                if (n = oh[a]) {
                    var o = n.call(this, e), r = e.getAttribute("id");
                    r && (this._defs[r] = o)
                }
            } else (n = ah[a]) && (i = n.call(this, e, t), t.add(i));
            for (var s = e.firstChild; s;) 1 === s.nodeType && this._parseNode(s, i), 3 === s.nodeType && this._isText && this._parseText(s, i), s = s.nextSibling;
            "defs" === a ? this._isDefine = !1 : "text" === a && (this._isText = !1)
        }, nh.prototype._parseText = function (e, t) {
            if (1 === e.nodeType) {
                var i = e.getAttribute("dx") || 0, n = e.getAttribute("dy") || 0;
                this._textX += parseFloat(i), this._textY += parseFloat(n)
            }
            var a = new Rr({
                style: {text: e.textContent, transformText: !0},
                position: [this._textX || 0, this._textY || 0]
            });
            rh(t, a), dh(e, a, this._defs);
            var o = a.style.fontSize;
            o && o < 9 && (a.style.fontSize = 9, a.scale = a.scale || [1, 1], a.scale[0] *= o / 9, a.scale[1] *= o / 9);
            var r = a.getBoundingRect();
            return this._textX += r.width, t.add(a), a
        };
        var ah = {
            g: function (e, t) {
                var i = new Di;
                return rh(t, i), dh(e, i, this._defs), i
            }, rect: function (e, t) {
                var i = new es;
                return rh(t, i), dh(e, i, this._defs), i.setShape({
                    x: parseFloat(e.getAttribute("x") || 0),
                    y: parseFloat(e.getAttribute("y") || 0),
                    width: parseFloat(e.getAttribute("width") || 0),
                    height: parseFloat(e.getAttribute("height") || 0)
                }), i
            }, circle: function (e, t) {
                var i = new Wr;
                return rh(t, i), dh(e, i, this._defs), i.setShape({
                    cx: parseFloat(e.getAttribute("cx") || 0),
                    cy: parseFloat(e.getAttribute("cy") || 0),
                    r: parseFloat(e.getAttribute("r") || 0)
                }), i
            }, line: function (e, t) {
                var i = new is;
                return rh(t, i), dh(e, i, this._defs), i.setShape({
                    x1: parseFloat(e.getAttribute("x1") || 0),
                    y1: parseFloat(e.getAttribute("y1") || 0),
                    x2: parseFloat(e.getAttribute("x2") || 0),
                    y2: parseFloat(e.getAttribute("y2") || 0)
                }), i
            }, ellipse: function (e, t) {
                var i = new eh;
                return rh(t, i), dh(e, i, this._defs), i.setShape({
                    cx: parseFloat(e.getAttribute("cx") || 0),
                    cy: parseFloat(e.getAttribute("cy") || 0),
                    rx: parseFloat(e.getAttribute("rx") || 0),
                    ry: parseFloat(e.getAttribute("ry") || 0)
                }), i
            }, polygon: function (e, t) {
                var i = e.getAttribute("points");
                i = i && sh(i);
                var n = new $r({shape: {points: i || []}});
                return rh(t, n), dh(e, n, this._defs), n
            }, polyline: function (e, t) {
                var i = new wr;
                rh(t, i), dh(e, i, this._defs);
                var n = e.getAttribute("points");
                return n = n && sh(n), new Xr({shape: {points: n || []}})
            }, image: function (e, t) {
                var i = new qn;
                return rh(t, i), dh(e, i, this._defs), i.setStyle({
                    image: e.getAttribute("xlink:href"),
                    x: e.getAttribute("x"),
                    y: e.getAttribute("y"),
                    width: e.getAttribute("width"),
                    height: e.getAttribute("height")
                }), i
            }, text: function (e, t) {
                var i = e.getAttribute("x") || 0, n = e.getAttribute("y") || 0, a = e.getAttribute("dx") || 0,
                    o = e.getAttribute("dy") || 0;
                this._textX = parseFloat(i) + parseFloat(a), this._textY = parseFloat(n) + parseFloat(o);
                var r = new Di;
                return rh(t, r), dh(e, r, this._defs), r
            }, tspan: function (e, t) {
                var i = e.getAttribute("x"), n = e.getAttribute("y");
                null != i && (this._textX = parseFloat(i)), null != n && (this._textY = parseFloat(n));
                var a = e.getAttribute("dx") || 0, o = e.getAttribute("dy") || 0, r = new Di;
                return rh(t, r), dh(e, r, this._defs), this._textX += a, this._textY += o, r
            }, path: function (e, t) {
                var i = Ur(e.getAttribute("d") || "");
                return rh(t, i), dh(e, i, this._defs), i
            }
        }, oh = {
            lineargradient: function (e) {
                var t = parseInt(e.getAttribute("x1") || 0, 10), i = parseInt(e.getAttribute("y1") || 0, 10),
                    n = parseInt(e.getAttribute("x2") || 10, 10), a = parseInt(e.getAttribute("y2") || 0, 10),
                    o = new ds(t, i, n, a);
                return function (e, t) {
                    for (var i = e.firstChild; i;) {
                        if (1 === i.nodeType) {
                            var n = i.getAttribute("offset");
                            n = 0 < n.indexOf("%") ? parseInt(n, 10) / 100 : n ? parseFloat(n) : 0;
                            var a = i.getAttribute("stop-color") || "#000000";
                            t.addColorStop(n, a)
                        }
                        i = i.nextSibling
                    }
                }(e, o), o
            }, radialgradient: function (e) {
            }
        };

        function rh(e, t) {
            e && e.__inheritedStyle && (t.__inheritedStyle || (t.__inheritedStyle = {}), T(t.__inheritedStyle, e.__inheritedStyle))
        }

        function sh(e) {
            for (var t = X(e).split(th), i = [], n = 0; n < t.length; n += 2) {
                var a = parseFloat(t[n]), o = parseFloat(t[n + 1]);
                i.push([a, o])
            }
            return i
        }

        var lh = {
            fill: "fill",
            stroke: "stroke",
            "stroke-width": "lineWidth",
            opacity: "opacity",
            "fill-opacity": "fillOpacity",
            "stroke-opacity": "strokeOpacity",
            "stroke-dasharray": "lineDash",
            "stroke-dashoffset": "lineDashOffset",
            "stroke-linecap": "lineCap",
            "stroke-linejoin": "lineJoin",
            "stroke-miterlimit": "miterLimit",
            "font-family": "fontFamily",
            "font-size": "fontSize",
            "font-style": "fontStyle",
            "font-weight": "fontWeight",
            "text-align": "textAlign",
            "alignment-baseline": "textBaseline"
        };

        function dh(e, t, i, n) {
            var a = t.__inheritedStyle || {}, o = "text" === t.type;
            if (1 === e.nodeType && (function (e, t) {
                var i = e.getAttribute("transform");
                if (i) {
                    var n = null, a = [];
                    (i = i.replace(/,/g, " ")).replace(hh, function (e, t, i) {
                        a.push(t, i)
                    });
                    for (var o = a.length - 1; 0 < o; o -= 2) {
                        var r = a[o], s = a[o - 1];
                        switch (n = n || ot(), s) {
                            case"translate":
                                r = X(r).split(th), dt(n, n, [parseFloat(r[0]), parseFloat(r[1] || 0)]);
                                break;
                            case"scale":
                                r = X(r).split(th), ct(n, n, [parseFloat(r[0]), parseFloat(r[1] || r[0])]);
                                break;
                            case"rotate":
                                r = X(r).split(th), ut(n, n, parseFloat(r[0]));
                                break;
                            case"skew":
                                r = X(r).split(th), console.warn("Skew transform is not supported yet");
                                break;
                            case"matrix":
                                r = X(r).split(th), n[0] = parseFloat(r[0]), n[1] = parseFloat(r[1]), n[2] = parseFloat(r[2]), n[3] = parseFloat(r[3]), n[4] = parseFloat(r[4]), n[5] = parseFloat(r[5])
                        }
                    }
                    t.setLocalTransform(n)
                }
            }(e, t), k(a, function (e) {
                var t = e.getAttribute("style"), i = {};
                if (!t) return i;
                var n, a = {};
                for (fh.lastIndex = 0; null != (n = fh.exec(t));) a[n[1]] = n[2];
                for (var o in lh) lh.hasOwnProperty(o) && null != a[o] && (i[lh[o]] = a[o]);
                return i
            }(e)), !n)) for (var r in lh) if (lh.hasOwnProperty(r)) {
                var s = e.getAttribute(r);
                null != s && (a[lh[r]] = s)
            }
            var l = o ? "textFill" : "fill", d = o ? "textStroke" : "stroke";
            t.style = t.style || new Hi;
            var u = t.style;
            null != a.fill && u.set(l, ch(a.fill, i)), null != a.stroke && u.set(d, ch(a.stroke, i)), A(["lineWidth", "opacity", "fillOpacity", "strokeOpacity", "miterLimit", "fontSize"], function (e) {
                var t = "lineWidth" === e && o ? "textStrokeWidth" : e;
                null != a[e] && u.set(t, parseFloat(a[e]))
            }), a.textBaseline && "auto" !== a.textBaseline || (a.textBaseline = "alphabetic"), "alphabetic" === a.textBaseline && (a.textBaseline = "bottom"), "start" === a.textAlign && (a.textAlign = "left"), "end" === a.textAlign && (a.textAlign = "right"), A(["lineDashOffset", "lineCap", "lineJoin", "fontWeight", "fontFamily", "fontStyle", "textAlign", "textBaseline"], function (e) {
                null != a[e] && u.set(e, a[e])
            }), a.lineDash && (t.style.lineDash = X(a.lineDash).split(th)), u[d] && "none" !== u[d] && (t[d] = !0), t.__inheritedStyle = a
        }

        var uh = /url\(\s*#(.*?)\)/;

        function ch(e, t) {
            var i = t && e && e.match(uh);
            return i ? t[X(i[1])] : e
        }

        var hh = /(translate|scale|rotate|skewX|skewY|matrix)\(([\-\s0-9\.e,]*)\)/g, fh = /([^\s:;]+)\s*:\s*([^:;]+)/g;

        function gh(e, t, i) {
            var n = t / e.width, a = i / e.height, o = Math.min(n, a);
            return {scale: [o, o], position: [-(e.x + e.width / 2) * o + t / 2, -(e.y + e.height / 2) * o + i / 2]}
        }

        var ph = Q(), vh = {
            registerMap: function (e, t, i) {
                var n;
                return A(n = O(t) ? t : t.svg ? [{
                    type: "svg",
                    source: t.svg,
                    specialAreas: t.specialAreas
                }] : (t.geoJson && !t.features && (i = t.specialAreas, t = t.geoJson), [{
                    type: "geoJSON",
                    source: t,
                    specialAreas: i
                }]), function (e) {
                    var t = e.type;
                    "geoJson" === t && (t = e.type = "geoJSON"), (0, mh[t])(e)
                }), ph.set(e, n)
            }, retrieveMap: function (e) {
                return ph.get(e)
            }
        }, mh = {
            geoJSON: function (e) {
                var t = e.source;
                e.geoJSON = L(t) ? "undefined" != typeof JSON && JSON.parse ? JSON.parse(t) : new Function("return (" + t + ");")() : t
            }, svg: function (e) {
                e.svgXML = ih(e.source)
            }
        }, yh = $, kh = A, Th = F, wh = B, Ch = Id.parseClassType, Sh = {
            PROCESSOR: {FILTER: 1e3, SERIES_FILTER: 800, STATISTIC: 5e3},
            VISUAL: {
                LAYOUT: 1e3,
                PROGRESSIVE_LAYOUT: 1100,
                GLOBAL: 2e3,
                CHART: 3e3,
                POST_CHART_LAYOUT: 3500,
                COMPONENT: 4e3,
                BRUSH: 5e3
            }
        }, bh = "__flagInMainProcess", Ih = "__optionUpdated", _h = /^[a-zA-Z0-9_]+$/;

        function Ah(e, t) {
            return function (i, n, a) {
                !t && this._disposed || (i = i && i.toLowerCase(), xe.prototype[e].call(this, i, n, a))
            }
        }

        function Dh() {
            xe.call(this)
        }

        function xh(e, t, i) {
            i = i || {}, "string" == typeof t && (t = Qh[t]), this.id, this.group, this._dom = e;
            var n = this._zr = ba(e, {
                renderer: i.renderer || "canvas",
                devicePixelRatio: i.devicePixelRatio,
                width: i.width,
                height: i.height
            });
            this._throttledZrFlush = Sc(P(n.flush, n), 17), (t = v(t)) && Su(t, !0), this._theme = t, this._chartsViews = [], this._chartsMap = {}, this._componentsViews = [], this._componentsMap = {}, this._coordSysMgr = new iu;
            var a = this._api = function (e) {
                var t = e._coordSysMgr;
                return k(new eu(e), {
                    getCoordinateSystems: P(t.getCoordinateSystems, t),
                    getComponentByElement: function (t) {
                        for (; t;) {
                            var i = t.__ecComponentInfo;
                            if (null != i) return e._model.getComponent(i.mainType, i.index);
                            t = t.parent
                        }
                    }
                })
            }(this);

            function o(e, t) {
                return e.__prio - t.__prio
            }

            Fi(Zh, o), Fi(qh, o), this._scheduler = new Nc(this, a, qh, Zh), xe.call(this, this._ecEventProcessor = new Gh), this._messageCenter = new Dh, this._initEvents(), this.resize = P(this.resize, this), this._pendingActions = [], n.animation.on("frame", this._onframe, this), function (e, t) {
                e.on("rendered", function () {
                    t.trigger("rendered"), !e.animation.isFinished() || t[Ih] || t._scheduler.unfinished || t._pendingActions.length || t.trigger("finished")
                })
            }(n, this), Y(this)
        }

        Dh.prototype.on = Ah("on", !0), Dh.prototype.off = Ah("off", !0), Dh.prototype.one = Ah("one", !0), I(Dh, xe);
        var Nh = xh.prototype;

        function Eh(e, t, i) {
            if (!this._disposed) {
                var n, a = this._model, o = this._coordSysMgr.getCoordinateSystems();
                t = Ha(a, t);
                for (var r = 0; r < o.length; r++) {
                    var s = o[r];
                    if (s[e] && null != (n = s[e](a, t, i))) return n
                }
            }
        }

        Nh._onframe = function () {
            if (!this._disposed) {
                var e = this._scheduler;
                if (this[Ih]) {
                    var t = this[Ih].silent;
                    this[bh] = !0, Mh(this), Ph.update.call(this), this[bh] = !1, this[Ih] = !1, Bh.call(this, t), Uh.call(this, t)
                } else if (e.unfinished) {
                    var i = 1, n = this._model;
                    this._api;
                    e.unfinished = !1;
                    do {
                        var a = +new Date;
                        e.performSeriesTasks(n), e.performDataProcessorTasks(n), Fh(this, n), e.performVisualTasks(n), Vh(this, this._model, 0, "remain"), i -= +new Date - a
                    } while (0 < i && e.unfinished);
                    e.unfinished || this._zr.flush()
                }
            }
        }, Nh.getDom = function () {
            return this._dom
        }, Nh.getZr = function () {
            return this._zr
        }, Nh.setOption = function (e, t, i) {
            if (!this._disposed) {
                var n;
                if (wh(t) && (i = t.lazyUpdate, n = t.silent, t = t.notMerge), this[bh] = !0, !this._model || t) {
                    var a = new lu(this._api), o = this._theme, r = this._model = new Yd;
                    r.scheduler = this._scheduler, r.init(null, null, o, a)
                }
                this._model.setOption(e, Yh), i ? (this[Ih] = {silent: n}, this[bh] = !1) : (Mh(this), Ph.update.call(this), this._zr.flush(), this[Ih] = !1, this[bh] = !1, Bh.call(this, n), Uh.call(this, n))
            }
        }, Nh.setTheme = function () {
            console.error("ECharts#setTheme() is DEPRECATED in ECharts 3.0")
        }, Nh.getModel = function () {
            return this._model
        }, Nh.getOption = function () {
            return this._model && this._model.getOption()
        }, Nh.getWidth = function () {
            return this._zr.getWidth()
        }, Nh.getHeight = function () {
            return this._zr.getHeight()
        }, Nh.getDevicePixelRatio = function () {
            return this._zr.painter.dpr || window.devicePixelRatio || 1
        }, Nh.getRenderedCanvas = function (e) {
            if (a.canvasSupported) return (e = e || {}).pixelRatio = e.pixelRatio || 1, e.backgroundColor = e.backgroundColor || this._model.get("backgroundColor"), this._zr.painter.getRenderedCanvas(e)
        }, Nh.getSvgDataURL = function () {
            if (a.svgSupported) {
                var e = this._zr;
                return A(e.storage.getDisplayList(), function (e) {
                    e.stopAnimation(!0)
                }), e.painter.toDataURL()
            }
        }, Nh.getDataURL = function (e) {
            if (!this._disposed) {
                var t = (e = e || {}).excludeComponents, i = this._model, n = [], a = this;
                kh(t, function (e) {
                    i.eachComponent({mainType: e}, function (e) {
                        var t = a._componentsMap[e.__viewId];
                        t.group.ignore || (n.push(t), t.group.ignore = !0)
                    })
                });
                var o = "svg" === this._zr.painter.getType() ? this.getSvgDataURL() : this.getRenderedCanvas(e).toDataURL("image/" + (e && e.type || "png"));
                return kh(n, function (e) {
                    e.group.ignore = !1
                }), o
            }
        }, Nh.getConnectedDataURL = function (e) {
            if (!this._disposed && a.canvasSupported) {
                var t = "svg" === e.type, i = this.group, n = Math.min, o = Math.max;
                if (nf[i]) {
                    var r = 1 / 0, s = 1 / 0, l = -1 / 0, d = -1 / 0, u = [], c = e && e.pixelRatio || 1;
                    A(tf, function (a, c) {
                        if (a.group === i) {
                            var h = t ? a.getZr().painter.getSvgDom().innerHTML : a.getRenderedCanvas(v(e)),
                                f = a.getDom().getBoundingClientRect();
                            r = n(f.left, r), s = n(f.top, s), l = o(f.right, l), d = o(f.bottom, d), u.push({
                                dom: h,
                                left: f.left,
                                top: f.top
                            })
                        }
                    });
                    var h = (l *= c) - (r *= c), f = (d *= c) - (s *= c), g = w(),
                        p = ba(g, {renderer: t ? "svg" : "canvas"});
                    if (p.resize({width: h, height: f}), t) {
                        var m = "";
                        return kh(u, function (e) {
                            var t = e.left - r, i = e.top - s;
                            m += '<g transform="translate(' + t + "," + i + ')">' + e.dom + "</g>"
                        }), p.painter.getSvgRoot().innerHTML = m, e.connectedBackgroundColor && p.painter.setBackgroundColor(e.connectedBackgroundColor), p.refreshImmediately(), p.painter.toDataURL()
                    }
                    return e.connectedBackgroundColor && p.add(new es({
                        shape: {x: 0, y: 0, width: h, height: f},
                        style: {fill: e.connectedBackgroundColor}
                    })), kh(u, function (e) {
                        var t = new qn({style: {x: e.left * c - r, y: e.top * c - s, image: e.dom}});
                        p.add(t)
                    }), p.refreshImmediately(), g.toDataURL("image/" + (e && e.type || "png"))
                }
                return this.getDataURL(e)
            }
        }, Nh.convertToPixel = M(Eh, "convertToPixel"), Nh.convertFromPixel = M(Eh, "convertFromPixel"), Nh.containPixel = function (e, t) {
            var i;
            if (!this._disposed) return A(e = Ha(this._model, e), function (e, n) {
                0 <= n.indexOf("Models") && A(e, function (e) {
                    var a = e.coordinateSystem;
                    if (a && a.containPoint) i |= !!a.containPoint(t); else if ("seriesModels" === n) {
                        var o = this._chartsMap[e.__viewId];
                        o && o.containPoint && (i |= o.containPoint(t, e))
                    }
                }, this)
            }, this), !!i
        }, Nh.getVisual = function (e, t) {
            var i = (e = Ha(this._model, e, {defaultMainType: "series"})).seriesModel.getData(),
                n = e.hasOwnProperty("dataIndexInside") ? e.dataIndexInside : e.hasOwnProperty("dataIndex") ? i.indexOfRawIndex(e.dataIndex) : null;
            return null != n ? i.getItemVisual(n, t) : i.getVisual(t)
        }, Nh.getViewOfComponentModel = function (e) {
            return this._componentsMap[e.__viewId]
        }, Nh.getViewOfSeriesModel = function (e) {
            return this._chartsMap[e.__viewId]
        };
        var Ph = {
            prepareAndUpdate: function (e) {
                Mh(this), Ph.update.call(this, e)
            }, update: function (e) {
                var t = this._model, i = this._api, n = this._zr, o = this._coordSysMgr, r = this._scheduler;
                if (t) {
                    r.restoreData(t, e), r.performSeriesTasks(t), o.create(t, i), r.performDataProcessorTasks(t, e), Fh(this, t), o.update(t, i), Kh(t), r.performVisualTasks(t, e), Wh(this, t, i, e);
                    var s = t.get("backgroundColor") || "transparent";
                    if (a.canvasSupported) n.setBackgroundColor(s); else {
                        var l = Wt(s);
                        s = Jt(l, "rgb"), 0 === l[3] && (s = "transparent")
                    }
                    Hh(t, i)
                }
            }, updateTransform: function (e) {
                var t = this._model, i = this, n = this._api;
                if (t) {
                    var a = [];
                    t.eachComponent(function (o, r) {
                        var s = i.getViewOfComponentModel(r);
                        if (s && s.__alive) if (s.updateTransform) {
                            var l = s.updateTransform(r, t, n, e);
                            l && l.update && a.push(s)
                        } else a.push(s)
                    });
                    var o = Q();
                    t.eachSeries(function (a) {
                        var r = i._chartsMap[a.__viewId];
                        if (r.updateTransform) {
                            var s = r.updateTransform(a, t, n, e);
                            s && s.update && o.set(a.uid, 1)
                        } else o.set(a.uid, 1)
                    }), Kh(t), this._scheduler.performVisualTasks(t, e, {
                        setDirty: !0,
                        dirtyMap: o
                    }), Vh(i, t, 0, e, o), Hh(t, this._api)
                }
            }, updateView: function (e) {
                var t = this._model;
                t && (fc.markUpdateMethod(e, "updateView"), Kh(t), this._scheduler.performVisualTasks(t, e, {setDirty: !0}), Wh(this, this._model, this._api, e), Hh(t, this._api))
            }, updateVisual: function (e) {
                Ph.update.call(this, e)
            }, updateLayout: function (e) {
                Ph.update.call(this, e)
            }
        };

        function Mh(e) {
            var t = e._model, i = e._scheduler;
            i.restorePipelines(t), i.prepareStageTasks(), Rh(e, "component", t, i), Rh(e, "chart", t, i), i.plan()
        }

        function Oh(e, t, i, n, a) {
            var o = e._model;
            if (n) {
                var r = {};
                r[n + "Id"] = i[n + "Id"], r[n + "Index"] = i[n + "Index"], r[n + "Name"] = i[n + "Name"];
                var s = {mainType: n, query: r};
                a && (s.subType = a);
                var l = i.excludeSeriesId;
                null != l && (l = Q(Pa(l))), o && o.eachComponent(s, function (t) {
                    l && null != l.get(t.id) || d(e["series" === n ? "_chartsMap" : "_componentsMap"][t.__viewId])
                }, e)
            } else kh(e._componentsViews.concat(e._chartsViews), d);

            function d(n) {
                n && n.__alive && n[t] && n[t](n.__model, o, e._api, i)
            }
        }

        function Fh(e, t) {
            var i = e._chartsMap, n = e._scheduler;
            t.eachSeries(function (e) {
                n.updateStreamModes(e, i[e.__viewId])
            })
        }

        function Lh(e, t) {
            var i = e.type, n = e.escapeConnect, a = $h[i], o = a.actionInfo, r = (o.update || "update").split(":"),
                s = r.pop();
            r = null != r[0] && Ch(r[0]), this[bh] = !0;
            var l = [e], d = !1;
            e.batch && (d = !0, l = D(e.batch, function (t) {
                return (t = T(k({}, t), e)).batch = null, t
            }));
            var u, c = [], h = "highlight" === i || "downplay" === i;
            kh(l, function (e) {
                (u = (u = a.action(e, this._model, this._api)) || k({}, e)).type = o.event || u.type, c.push(u), h ? Oh(this, s, e, "series") : r && Oh(this, s, e, r.main, r.sub)
            }, this), "none" === s || h || r || (this[Ih] ? (Mh(this), Ph.update.call(this, e), this[Ih] = !1) : Ph[s].call(this, e)), u = d ? {
                type: o.event || i,
                escapeConnect: n,
                batch: c
            } : c[0], this[bh] = !1, t || this._messageCenter.trigger(u.type, u)
        }

        function Bh(e) {
            for (var t = this._pendingActions; t.length;) {
                var i = t.shift();
                Lh.call(this, i, e)
            }
        }

        function Uh(e) {
            e || this.trigger("updated")
        }

        function Rh(e, t, i, n) {
            for (var a = "component" === t, o = a ? e._componentsViews : e._chartsViews, r = a ? e._componentsMap : e._chartsMap, s = e._zr, l = e._api, d = 0; d < o.length; d++) o[d].__alive = !1;

            function u(e) {
                var t = "_ec_" + e.id + "_" + e.type, d = r[t];
                if (!d) {
                    var u = Ch(e.type);
                    (d = new (a ? lc.getClass(u.main, u.sub) : fc.getClass(u.sub))).init(i, l), r[t] = d, o.push(d), s.add(d.group)
                }
                e.__viewId = d.__id = t, d.__alive = !0, d.__model = e, d.group.__ecComponentInfo = {
                    mainType: e.mainType,
                    index: e.componentIndex
                }, a || n.prepareView(d, e, i, l)
            }

            for (a ? i.eachComponent(function (e, t) {
                "series" !== e && u(t)
            }) : i.eachSeries(u), d = 0; d < o.length;) {
                var c = o[d];
                c.__alive ? d++ : (a || c.renderTask.dispose(), s.remove(c.group), c.dispose(i, l), o.splice(d, 1), delete r[c.__id], c.__id = c.group.__ecComponentInfo = null)
            }
        }

        function Kh(e) {
            e.clearColorPalette(), e.eachSeries(function (e) {
                e.clearColorPalette()
            })
        }

        function Wh(e, t, i, n) {
            !function (e, t, i, n, a) {
                kh(e._componentsViews, function (e) {
                    var a = e.__model;
                    e.render(a, t, i, n), jh(a, e)
                })
            }(e, t, i, n), kh(e._chartsViews, function (e) {
                e.__alive = !1
            }), Vh(e, t, 0, n), kh(e._chartsViews, function (e) {
                e.__alive || e.remove(t, i)
            })
        }

        function Vh(e, t, i, n, o) {
            var r, s = e._scheduler;
            t.eachSeries(function (t) {
                var i = e._chartsMap[t.__viewId];
                i.__alive = !0;
                var a = i.renderTask;
                s.updatePayload(a, n), o && o.get(t.uid) && a.dirty(), r |= a.perform(s.getPerformArgs(a)), i.group.silent = !!t.get("silent"), jh(t, i), function (e, t) {
                    var i = e.get("blendMode") || null;
                    t.group.traverse(function (e) {
                        e.isGroup || e.style.blend !== i && e.setStyle("blend", i), e.eachPendingDisplayable && e.eachPendingDisplayable(function (e) {
                            e.setStyle("blend", i)
                        })
                    })
                }(t, i)
            }), s.unfinished |= r, function (e, t) {
                var i = e._zr.storage, n = 0;
                i.traverse(function (e) {
                    n++
                }), n > t.get("hoverLayerThreshold") && !a.node && t.eachSeries(function (t) {
                    if (!t.preventUsingHoverLayer) {
                        var i = e._chartsMap[t.__viewId];
                        i.__alive && i.group.traverse(function (e) {
                            e.useHoverLayer = !0
                        })
                    }
                })
            }(e, t), Dc(e._zr.dom, t)
        }

        function Hh(e, t) {
            kh(Jh, function (i) {
                i(e, t)
            })
        }

        Nh.resize = function (e) {
            if (!this._disposed) {
                this._zr.resize(e);
                var t = this._model;
                if (this._loadingFX && this._loadingFX.resize(), t) {
                    var i = t.resetOption("media"), n = e && e.silent;
                    this[bh] = !0, i && Mh(this), Ph.update.call(this), this[bh] = !1, Bh.call(this, n), Uh.call(this, n)
                }
            }
        }, Nh.showLoading = function (e, t) {
            if (!this._disposed && (wh(e) && (t = e, e = ""), e = e || "default", this.hideLoading(), ef[e])) {
                var i = ef[e](this._api, t), n = this._zr;
                this._loadingFX = i, n.add(i)
            }
        }, Nh.hideLoading = function () {
            this._disposed || (this._loadingFX && this._zr.remove(this._loadingFX), this._loadingFX = null)
        }, Nh.makeActionFromEvent = function (e) {
            var t = k({}, e);
            return t.type = Xh[e.type], t
        }, Nh.dispatchAction = function (e, t) {
            this._disposed || (wh(t) || (t = {silent: !!t}), $h[e.type] && this._model && (this[bh] ? this._pendingActions.push(e) : (Lh.call(this, e, t.silent), t.flush ? this._zr.flush(!0) : !1 !== t.flush && a.browser.weChat && this._throttledZrFlush(), Bh.call(this, t.silent), Uh.call(this, t.silent))))
        }, Nh.appendData = function (e) {
            if (!this._disposed) {
                var t = e.seriesIndex;
                this.getModel().getSeriesByIndex(t).appendData(e), this._scheduler.unfinished = !0
            }
        }, Nh.on = Ah("on", !1), Nh.off = Ah("off", !1), Nh.one = Ah("one", !1);
        var zh = ["click", "dblclick", "mouseover", "mouseout", "mousemove", "mousedown", "mouseup", "globalout", "contextmenu"];

        function jh(e, t) {
            var i = e.get("z"), n = e.get("zlevel");
            t.group.traverse(function (e) {
                "group" !== e.type && (null != i && (e.z = i), null != n && (e.zlevel = n))
            })
        }

        function Gh() {
            this.eventInfo
        }

        Nh._initEvents = function () {
            kh(zh, function (e) {
                function t(t) {
                    var i, n = this.getModel(), a = t.target;
                    if ("globalout" === e) i = {}; else if (a && null != a.dataIndex) {
                        var o = a.dataModel || n.getSeriesByIndex(a.seriesIndex);
                        i = o && o.getDataParams(a.dataIndex, a.dataType, a) || {}
                    } else a && a.eventData && (i = k({}, a.eventData));
                    if (i) {
                        var r = i.componentType, s = i.componentIndex;
                        "markLine" !== r && "markPoint" !== r && "markArea" !== r || (r = "series", s = i.seriesIndex);
                        var l = r && null != s && n.getComponent(r, s),
                            d = l && this["series" === l.mainType ? "_chartsMap" : "_componentsMap"][l.__viewId];
                        i.event = t, i.type = e, this._ecEventProcessor.eventInfo = {
                            targetEl: a,
                            packedEvent: i,
                            model: l,
                            view: d
                        }, this.trigger(e, i)
                    }
                }

                t.zrEventfulCallAtLast = !0, this._zr.on(e, t, this)
            }, this), kh(Xh, function (e, t) {
                this._messageCenter.on(t, function (e) {
                    this.trigger(t, e)
                }, this)
            }, this)
        }, Nh.isDisposed = function () {
            return this._disposed
        }, Nh.clear = function () {
            this._disposed || this.setOption({series: []}, !0)
        }, Nh.dispose = function () {
            if (!this._disposed) {
                this._disposed = !0, ja(this.getDom(), rf, "");
                var e = this._api, t = this._model;
                kh(this._componentsViews, function (i) {
                    i.dispose(t, e)
                }), kh(this._chartsViews, function (i) {
                    i.dispose(t, e)
                }), this._zr.dispose(), delete tf[this.id]
            }
        }, I(xh, xe), Gh.prototype = {
            constructor: Gh, normalizeQuery: function (e) {
                var t = {}, i = {}, n = {};
                if (L(e)) {
                    var a = Ch(e);
                    t.mainType = a.main || null, t.subType = a.sub || null
                } else {
                    var o = ["Index", "Name", "Id"], r = {name: 1, dataIndex: 1, dataType: 1};
                    A(e, function (e, a) {
                        for (var s = !1, l = 0; l < o.length; l++) {
                            var d = o[l], u = a.lastIndexOf(d);
                            if (0 < u && u === a.length - d.length) {
                                var c = a.slice(0, u);
                                "data" !== c && (t.mainType = c, t[d.toLowerCase()] = e, s = !0)
                            }
                        }
                        r.hasOwnProperty(a) && (i[a] = e, s = !0), s || (n[a] = e)
                    })
                }
                return {cptQuery: t, dataQuery: i, otherQuery: n}
            }, filter: function (e, t, i) {
                var n = this.eventInfo;
                if (!n) return !0;
                var a = n.targetEl, o = n.packedEvent, r = n.model, s = n.view;
                if (!r || !s) return !0;
                var l = t.cptQuery, d = t.dataQuery;
                return u(l, r, "mainType") && u(l, r, "subType") && u(l, r, "index", "componentIndex") && u(l, r, "name") && u(l, r, "id") && u(d, o, "name") && u(d, o, "dataIndex") && u(d, o, "dataType") && (!s.filterForExposedEvent || s.filterForExposedEvent(e, t.otherQuery, a, o));

                function u(e, t, i, n) {
                    return null == e[i] || t[n || i] === e[i]
                }
            }, afterTrigger: function () {
                this.eventInfo = null
            }
        };
        var $h = {}, Xh = {}, qh = [], Yh = [], Jh = [], Zh = [], Qh = {}, ef = {}, tf = {}, nf = {}, af = new Date - 0,
            of = new Date - 0, rf = "_echarts_instance_";

        function sf(e) {
            nf[e] = !1
        }

        var lf = sf;

        function df(e) {
            return tf[function (e, t) {
                return e.getAttribute ? e.getAttribute(t) : e[t]
            }(e, rf)]
        }

        function uf(e, t) {
            Qh[e] = t
        }

        function cf(e) {
            Yh.push(e)
        }

        function hf(e, t) {
            mf(qh, e, t, 1e3)
        }

        function ff(e, t, i) {
            "function" == typeof t && (i = t, t = "");
            var n = wh(e) ? e.type : [e, e = {event: t}][0];
            e.event = (e.event || n).toLowerCase(), t = e.event, yh(_h.test(n) && _h.test(t)), $h[n] || ($h[n] = {
                action: i,
                actionInfo: e
            }), Xh[t] = n
        }

        function gf(e, t) {
            iu.register(e, t)
        }

        function pf(e, t) {
            mf(Zh, e, t, 1e3, "layout")
        }

        function vf(e, t) {
            mf(Zh, e, t, 3e3, "visual")
        }

        function mf(e, t, i, n, a) {
            (Th(t) || wh(t)) && (i = t, t = n);
            var o = Nc.wrapStageHandler(i, a);
            return o.__prio = t, o.__raw = i, e.push(o), o
        }

        function yf(e, t) {
            ef[e] = t
        }

        function kf(e) {
            return Id.extend(e)
        }

        function Tf(e) {
            return lc.extend(e)
        }

        function wf(e) {
            return ec.extend(e)
        }

        function Cf(e) {
            return fc.extend(e)
        }

        function Sf(e) {
            return e
        }

        function bf(e, t, i, n, a) {
            this._old = e, this._new = t, this._oldKeyGetter = i || Sf, this._newKeyGetter = n || Sf, this.context = a
        }

        function If(e, t, i, n, a) {
            for (var o = 0; o < e.length; o++) {
                var r = "_ec_" + a[n](e[o], o), s = t[r];
                null == s ? (i.push(r), t[r] = o) : (s.length || (t[r] = s = [s]), s.push(o))
            }
        }

        vf(2e3, _c), cf(Su), hf(900, function (e) {
            var t = Q();
            e.eachSeries(function (e) {
                var i = e.get("stack");
                if (i) {
                    var n = t.get(i) || t.set(i, []), a = e.getData(), o = {
                        stackResultDimension: a.getCalculationInfo("stackResultDimension"),
                        stackedOverDimension: a.getCalculationInfo("stackedOverDimension"),
                        stackedDimension: a.getCalculationInfo("stackedDimension"),
                        stackedByDimension: a.getCalculationInfo("stackedByDimension"),
                        isStackedByIndex: a.getCalculationInfo("isStackedByIndex"),
                        data: a,
                        seriesModel: e
                    };
                    if (!o.stackedDimension || !o.isStackedByIndex && !o.stackedByDimension) return;
                    n.length && a.setCalculationInfo("stackedOnSeries", n[n.length - 1].seriesModel), n.push(o)
                }
            }), t.each(bu)
        }), yf("default", function (e, t) {
            T(t = t || {}, {
                text: "loading",
                textColor: "#000",
                fontSize: "12px",
                maskColor: "rgba(255, 255, 255, 0.8)",
                showSpinner: !0,
                color: "#c23531",
                spinnerRadius: 10,
                lineWidth: 5,
                zlevel: 0
            });
            var i = new Di, n = new es({style: {fill: t.maskColor}, zlevel: t.zlevel, z: 1e4});
            i.add(n);
            var a = t.fontSize + " sans-serif", o = new es({
                style: {
                    fill: "none",
                    text: t.text,
                    font: a,
                    textPosition: "right",
                    textDistance: 10,
                    textFill: t.textColor
                }, zlevel: t.zlevel, z: 10001
            });
            if (i.add(o), t.showSpinner) {
                var r = new ss({
                    shape: {startAngle: -xc / 2, endAngle: -xc / 2 + .1, r: t.spinnerRadius},
                    style: {stroke: t.color, lineCap: "round", lineWidth: t.lineWidth},
                    zlevel: t.zlevel,
                    z: 10001
                });
                r.animateShape(!0).when(1e3, {endAngle: 3 * xc / 2}).start("circularInOut"), r.animateShape(!0).when(1e3, {startAngle: 3 * xc / 2}).delay(300).start("circularInOut"), i.add(r)
            }
            return i.resize = function () {
                var i = un(t.text, a), s = t.showSpinner ? t.spinnerRadius : 0,
                    l = (e.getWidth() - 2 * s - (t.showSpinner && i ? 10 : 0) - i) / 2 - (t.showSpinner ? 0 : i / 2),
                    d = e.getHeight() / 2;
                t.showSpinner && r.setShape({cx: l, cy: d}), o.setShape({
                    x: l - s,
                    y: d - s,
                    width: 2 * s,
                    height: 2 * s
                }), n.setShape({x: 0, y: 0, width: e.getWidth(), height: e.getHeight()})
            }, i.resize(), i
        }), ff({type: "highlight", event: "highlight", update: "highlight"}, te), ff({
            type: "downplay",
            event: "downplay",
            update: "downplay"
        }, te), uf("light", Yc), uf("dark", Qc), bf.prototype = {
            constructor: bf, add: function (e) {
                return this._add = e, this
            }, update: function (e) {
                return this._update = e, this
            }, remove: function (e) {
                return this._remove = e, this
            }, execute: function () {
                var e = this._old, t = this._new, i = {}, n = [], a = [];
                for (If(e, {}, n, "_oldKeyGetter", this), If(t, i, a, "_newKeyGetter", this), o = 0; o < e.length; o++) null != (s = i[r = n[o]]) ? ((d = s.length) ? (1 === d && (i[r] = null), s = s.shift()) : i[r] = null, this._update && this._update(s, o)) : this._remove && this._remove(o);
                for (var o = 0; o < a.length; o++) {
                    var r = a[o];
                    if (i.hasOwnProperty(r)) {
                        var s;
                        if (null == (s = i[r])) continue;
                        if (s.length) for (var l = 0, d = s.length; l < d; l++) this._add && this._add(s[l]); else this._add && this._add(s)
                    }
                }
            }
        };
        var _f = Q(["tooltip", "label", "itemName", "itemId", "seriesName"]);

        function Af(e, t) {
            return e.hasOwnProperty(t) || (e[t] = []), e[t]
        }

        function Df(e) {
            return "category" === e ? "ordinal" : "time" === e ? "time" : "float"
        }

        function xf(e) {
            null != e && k(this, e), this.otherDims = {}
        }

        var Nf = B, Ef = "undefined", Pf = {
                float: typeof Float64Array == Ef ? Array : Float64Array,
                int: typeof Int32Array == Ef ? Array : Int32Array,
                ordinal: Array,
                number: Array,
                time: Array
            }, Mf = typeof Uint32Array == Ef ? Array : Uint32Array, Of = typeof Int32Array == Ef ? Array : Int32Array,
            Ff = typeof Uint16Array == Ef ? Array : Uint16Array;

        function Lf(e) {
            return 65535 < e._rawCount ? Mf : Ff
        }

        var Bf = ["hasItemOption", "_nameList", "_idList", "_invertedIndicesMap", "_rawData", "_chunkSize", "_chunkCount", "_dimValueGetter", "_count", "_rawCount", "_nameDimIdx", "_idDimIdx"],
            Uf = ["_extent", "_approximateExtent", "_rawExtent"];

        function Rf(e, t) {
            A(Bf.concat(t.__wrappedMethods || []), function (i) {
                t.hasOwnProperty(i) && (e[i] = t[i])
            }), e.__wrappedMethods = t.__wrappedMethods, A(Uf, function (i) {
                e[i] = v(t[i])
            }), e._calculationInfo = k(t._calculationInfo)
        }

        var Kf = function (e, t) {
            e = e || ["x", "y"];
            for (var i = {}, n = [], a = {}, o = 0; o < e.length; o++) {
                var r = e[o];
                L(r) ? r = new xf({name: r}) : r instanceof xf || (r = new xf(r));
                var s = r.name;
                r.type = r.type || "float", r.coordDim || (r.coordDim = s, r.coordDimIndex = 0), r.otherDims = r.otherDims || {}, n.push(s), (i[s] = r).index = o, r.createInvertedIndices && (a[s] = [])
            }
            this.dimensions = n, this._dimensionInfos = i, this.hostModel = t, this.dataType, this._indices = null, this._count = 0, this._rawCount = 0, this._storage = {}, this._nameList = [], this._idList = [], this._optionModels = [], this._visual = {}, this._layout = {}, this._itemVisuals = [], this.hasItemVisual = {}, this._itemLayouts = [], this._graphicEls = [], this._chunkSize = 1e5, this._chunkCount = 0, this._rawData, this._rawExtent = {}, this._extent = {}, this._approximateExtent = {}, this._dimensionsSummary = function (e) {
                var t = {}, i = t.encode = {}, n = Q(), a = [], o = [],
                    r = t.userOutput = {dimensionNames: e.dimensions.slice(), encode: {}};
                A(e.dimensions, function (t) {
                    var s = e.getDimensionInfo(t), l = s.coordDim;
                    if (l) {
                        var d = s.coordDimIndex;
                        Af(i, l)[d] = t, s.isExtraCoord || (n.set(l, 1), function (e) {
                            return !("ordinal" === e || "time" === e)
                        }(s.type) && (a[0] = t), Af(r.encode, l)[d] = s.index), s.defaultTooltip && o.push(t)
                    }
                    _f.each(function (e, t) {
                        var n = Af(i, t), a = s.otherDims[t];
                        null != a && !1 !== a && (n[a] = s.name)
                    })
                });
                var s = [], l = {};
                n.each(function (e, t) {
                    var n = i[t];
                    l[t] = n[0], s = s.concat(n)
                }), t.dataDimsOnCoord = s, t.encodeFirstDimNotExtra = l;
                var d = i.label;
                d && d.length && (a = d.slice());
                var u = i.tooltip;
                return u && u.length ? o = u.slice() : o.length || (o = a.slice()), i.defaultedLabel = a, i.defaultedTooltip = o, t
            }(this), this._invertedIndicesMap = a, this._calculationInfo = {}, this.userOutput = this._dimensionsSummary.userOutput
        }, Wf = Kf.prototype;

        function Vf(e, t, i, n, a) {
            var o = Pf[t.type], r = n - 1, s = t.name, l = e[s][r];
            if (l && l.length < i) {
                for (var d = new o(Math.min(a - r * i, i)), u = 0; u < l.length; u++) d[u] = l[u];
                e[s][r] = d
            }
            for (var c = n * i; c < a; c += i) e[s].push(new o(Math.min(a - c, i)))
        }

        function Hf(e) {
            var t = e._invertedIndicesMap;
            A(t, function (i, n) {
                var a = e._dimensionInfos[n].ordinalMeta;
                if (a) {
                    i = t[n] = new Of(a.categories.length);
                    for (var o = 0; o < i.length; o++) i[o] = -1;
                    for (o = 0; o < e._count; o++) i[e.get(n, o)] = o
                }
            })
        }

        function zf(e, t, i) {
            var n;
            if (null != t) {
                var a = e._chunkSize, o = Math.floor(i / a), r = i % a, s = e.dimensions[t], l = e._storage[s][o];
                if (l) {
                    n = l[r];
                    var d = e._dimensionInfos[s].ordinalMeta;
                    d && d.categories.length && (n = d.categories[n])
                }
            }
            return n
        }

        function jf(e) {
            return e
        }

        function Gf(e) {
            return e < this._count && 0 <= e ? this._indices[e] : -1
        }

        function $f(e, t) {
            var i = e._idList[t];
            return null == i && (i = zf(e, e._idDimIdx, t)), null == i && (i = "e\0\0" + t), i
        }

        function Xf(e) {
            return O(e) || (e = [e]), e
        }

        function qf(e, t) {
            var i = e.dimensions, n = new Kf(D(i, e.getDimensionInfo, e), e.hostModel);
            Rf(n, e);
            for (var a = n._storage = {}, o = e._storage, r = 0; r < i.length; r++) {
                var s = i[r];
                o[s] && (0 <= S(t, s) ? (a[s] = Yf(o[s]), n._rawExtent[s] = [1 / 0, -1 / 0], n._extent[s] = null) : a[s] = o[s])
            }
            return n
        }

        function Yf(e) {
            for (var t, i, n = new Array(e.length), a = 0; a < e.length; a++) n[a] = (t = e[a], i = void 0, (i = t.constructor) === Array ? t.slice() : new i(t));
            return n
        }

        function Jf(e) {
            e.seriesIndex = this.seriesIndex, e.dataIndex = this.dataIndex, e.dataType = this.dataType
        }

        function Zf(e, t, i) {
            Rd.isInstance(t) || (t = Rd.seriesDataToSource(t)), i = i || {}, e = (e || []).slice();
            for (var n = (i.dimsDef || []).slice(), a = Q(), o = Q(), r = [], s = function (e, t, i, n) {
                var a = Math.max(e.dimensionsDetectCount || 1, t.length, i.length, n || 0);
                return A(t, function (e) {
                    var t = e.dimsDef;
                    t && (a = Math.max(a, t.length))
                }), a
            }(t, e, n, i.dimCount), l = 0; l < s; l++) {
                var d = n[l] = k({}, B(n[l]) ? n[l] : {name: n[l]}), u = d.name, c = r[l] = new xf;
                null != u && null == a.get(u) && (c.name = c.displayName = u, a.set(u, l)), null != d.type && (c.type = d.type), null != d.displayName && (c.displayName = d.displayName)
            }
            var h = i.encodeDef;
            !h && i.encodeDefaulter && (h = i.encodeDefaulter(t, s)), (h = Q(h)).each(function (e, t) {
                if (1 === (e = Pa(e).slice()).length && !L(e[0]) && e[0] < 0) h.set(t, !1); else {
                    var i = h.set(t, []);
                    A(e, function (e, n) {
                        L(e) && (e = a.get(e)), null != e && e < s && (i[n] = e, g(r[e], t, n))
                    })
                }
            });
            var f = 0;

            function g(e, t, i) {
                null != _f.get(t) ? e.otherDims[t] = i : (e.coordDim = t, e.coordDimIndex = i, o.set(t, !0))
            }

            A(e, function (e, t) {
                var i, n, a;
                if (L(e)) i = e, e = {}; else {
                    i = e.name;
                    var o = e.ordinalMeta;
                    e.ordinalMeta = null, (e = v(e)).ordinalMeta = o, n = e.dimsDef, a = e.otherDims, e.name = e.coordDim = e.coordDimIndex = e.dimsDef = e.otherDims = null
                }
                if (!1 !== (s = h.get(i))) {
                    var s;
                    if (!(s = Pa(s)).length) for (var l = 0; l < (n && n.length || 1); l++) {
                        for (; f < r.length && null != r[f].coordDim;) f++;
                        f < r.length && s.push(f++)
                    }
                    A(s, function (t, o) {
                        var s = r[t];
                        if (g(T(s, e), i, o), null == s.name && n) {
                            var l = n[o];
                            B(l) || (l = {name: l}), s.name = s.displayName = l.name, s.defaultTooltip = l.defaultTooltip
                        }
                        a && T(s.otherDims, a)
                    })
                }
            });
            var p = i.generateCoord, m = i.generateCoordCount, y = null != m;
            m = p ? m || 1 : 0;
            for (var w, C, S = p || "value", b = 0; b < s; b++) null == (c = r[b] = r[b] || new xf).coordDim && (c.coordDim = Qf(S, o, y), c.coordDimIndex = 0, (!p || m <= 0) && (c.isExtraCoord = !0), m--), null == c.name && (c.name = Qf(c.coordDim, a)), null == c.type && (w = t, C = b, c.name, Xd(w.data, w.sourceFormat, w.seriesLayoutBy, w.dimensionsDefine, w.startIndex, C) === Kd.Must || c.isExtraCoord && (null != c.otherDims.itemName || null != c.otherDims.seriesName)) && (c.type = "ordinal");
            return r
        }

        function Qf(e, t, i) {
            if (i || null != t.get(e)) {
                for (var n = 0; null != t.get(e + n);) n++;
                e += n
            }
            return t.set(e, !0), e
        }

        Wf.type = "list", Wf.hasItemOption = !0, Wf.getDimension = function (e) {
            return "number" != typeof e && (isNaN(e) || this._dimensionInfos.hasOwnProperty(e)) || (e = this.dimensions[e]), e
        }, Wf.getDimensionInfo = function (e) {
            return this._dimensionInfos[this.getDimension(e)]
        }, Wf.getDimensionsOnCoord = function () {
            return this._dimensionsSummary.dataDimsOnCoord.slice()
        }, Wf.mapDimension = function (e, t) {
            var i = this._dimensionsSummary;
            if (null == t) return i.encodeFirstDimNotExtra[e];
            var n = i.encode[e];
            return !0 === t ? (n || []).slice() : n && n[t]
        }, Wf.initData = function (e, t, i) {
            (Rd.isInstance(e) || _(e)) && (e = new Iu(e, this.dimensions.length)), this._rawData = e, this._storage = {}, this._indices = null, this._nameList = t || [], this._idList = [], this._nameRepeatCount = {}, i || (this.hasItemOption = !1), this.defaultDimValueGetter = Mu[this._rawData.getSource().sourceFormat], this._dimValueGetter = i = i || this.defaultDimValueGetter, this._dimValueGetterArrayRows = Mu.arrayRows, this._rawExtent = {}, this._initDataFromProvider(0, e.count()), e.pure && (this.hasItemOption = !1)
        }, Wf.getProvider = function () {
            return this._rawData
        }, Wf.appendData = function (e) {
            var t = this._rawData, i = this.count();
            t.appendData(e);
            var n = t.count();
            t.persistent || (n += i), this._initDataFromProvider(i, n)
        }, Wf.appendValues = function (e, t) {
            for (var i = this._chunkSize, n = this._storage, a = this.dimensions, o = a.length, r = this._rawExtent, s = this.count(), l = s + Math.max(e.length, t ? t.length : 0), d = this._chunkCount, u = 0; u < o; u++) r[m = a[u]] || (r[m] = [1 / 0, -1 / 0]), n[m] || (n[m] = []), Vf(n, this._dimensionInfos[m], i, d, l), this._chunkCount = n[m].length;
            for (var c = new Array(o), h = s; h < l; h++) {
                for (var f = h - s, g = Math.floor(h / i), p = h % i, v = 0; v < o; v++) {
                    var m = a[v], y = this._dimValueGetterArrayRows(e[f] || c, m, f, v);
                    n[m][g][p] = y;
                    var k = r[m];
                    y < k[0] && (k[0] = y), y > k[1] && (k[1] = y)
                }
                t && (this._nameList[h] = t[f])
            }
            this._rawCount = this._count = l, this._extent = {}, Hf(this)
        }, Wf._initDataFromProvider = function (e, t) {
            if (!(t <= e)) {
                for (var i, n = this._chunkSize, a = this._rawData, o = this._storage, r = this.dimensions, s = r.length, l = this._dimensionInfos, d = this._nameList, u = this._idList, c = this._rawExtent, h = this._nameRepeatCount = {}, f = this._chunkCount, g = 0; g < s; g++) {
                    c[w = r[g]] || (c[w] = [1 / 0, -1 / 0]);
                    var p = l[w];
                    0 === p.otherDims.itemName && (i = this._nameDimIdx = g), 0 === p.otherDims.itemId && (this._idDimIdx = g), o[w] || (o[w] = []), Vf(o, p, n, f, t), this._chunkCount = o[w].length
                }
                for (var v = new Array(s), m = e; m < t; m++) {
                    v = a.getItem(m, v);
                    for (var y = Math.floor(m / n), k = m % n, T = 0; T < s; T++) {
                        var w, C = o[w = r[T]][y], S = this._dimValueGetter(v, w, m, T);
                        C[k] = S;
                        var b = c[w];
                        S < b[0] && (b[0] = S), S > b[1] && (b[1] = S)
                    }
                    if (!a.pure) {
                        var I = d[m];
                        if (v && null == I) if (null != v.name) d[m] = I = v.name; else if (null != i) {
                            var _ = r[i], A = o[_][y];
                            if (A) {
                                I = A[k];
                                var D = l[_].ordinalMeta;
                                D && D.categories.length && (I = D.categories[I])
                            }
                        }
                        var x = null == v ? null : v.id;
                        null == x && null != I && (h[I] = h[I] || 0, 0 < h[x = I] && (x += "__ec__" + h[I]), h[I]++), null != x && (u[m] = x)
                    }
                }
                !a.persistent && a.clean && a.clean(), this._rawCount = this._count = t, this._extent = {}, Hf(this)
            }
        }, Wf.count = function () {
            return this._count
        }, Wf.getIndices = function () {
            var e = this._indices;
            if (e) {
                var t = e.constructor, i = this._count;
                if (t === Array) {
                    a = new t(i);
                    for (var n = 0; n < i; n++) a[n] = e[n]
                } else a = new t(e.buffer, 0, i)
            } else {
                var a = new (t = Lf(this))(this.count());
                for (n = 0; n < a.length; n++) a[n] = n
            }
            return a
        }, Wf.get = function (e, t) {
            if (!(0 <= t && t < this._count)) return NaN;
            var i = this._storage;
            if (!i[e]) return NaN;
            t = this.getRawIndex(t);
            var n = Math.floor(t / this._chunkSize), a = t % this._chunkSize;
            return i[e][n][a]
        }, Wf.getByRawIndex = function (e, t) {
            if (!(0 <= t && t < this._rawCount)) return NaN;
            var i = this._storage[e];
            if (!i) return NaN;
            var n = Math.floor(t / this._chunkSize), a = t % this._chunkSize;
            return i[n][a]
        }, Wf._getFast = function (e, t) {
            var i = Math.floor(t / this._chunkSize), n = t % this._chunkSize;
            return this._storage[e][i][n]
        }, Wf.getValues = function (e, t) {
            var i = [];
            O(e) || (t = e, e = this.dimensions);
            for (var n = 0, a = e.length; n < a; n++) i.push(this.get(e[n], t));
            return i
        }, Wf.hasValue = function (e) {
            for (var t = this._dimensionsSummary.dataDimsOnCoord, i = 0, n = t.length; i < n; i++) if (isNaN(this.get(t[i], e))) return !1;
            return !0
        }, Wf.getDataExtent = function (e) {
            e = this.getDimension(e);
            var t = this._storage[e], i = [1 / 0, -1 / 0];
            if (!t) return i;
            var n, a = this.count();
            if (!this._indices) return this._rawExtent[e].slice();
            if (n = this._extent[e]) return n.slice();
            for (var o = (n = i)[0], r = n[1], s = 0; s < a; s++) {
                var l = this._getFast(e, this.getRawIndex(s));
                l < o && (o = l), r < l && (r = l)
            }
            return n = [o, r], this._extent[e] = n
        }, Wf.getApproximateExtent = function (e) {
            return e = this.getDimension(e), this._approximateExtent[e] || this.getDataExtent(e)
        }, Wf.setApproximateExtent = function (e, t) {
            t = this.getDimension(t), this._approximateExtent[t] = e.slice()
        }, Wf.getCalculationInfo = function (e) {
            return this._calculationInfo[e]
        }, Wf.setCalculationInfo = function (e, t) {
            Nf(e) ? k(this._calculationInfo, e) : this._calculationInfo[e] = t
        }, Wf.getSum = function (e) {
            var t = 0;
            if (this._storage[e]) for (var i = 0, n = this.count(); i < n; i++) {
                var a = this.get(e, i);
                isNaN(a) || (t += a)
            }
            return t
        }, Wf.getMedian = function (e) {
            var t = [];
            this.each(e, function (e, i) {
                isNaN(e) || t.push(e)
            });
            var i = [].concat(t).sort(function (e, t) {
                return e - t
            }), n = this.count();
            return 0 === n ? 0 : n % 2 == 1 ? i[(n - 1) / 2] : (i[n / 2] + i[n / 2 - 1]) / 2
        }, Wf.rawIndexOf = function (e, t) {
            var i = (e && this._invertedIndicesMap[e])[t];
            return null == i || isNaN(i) ? -1 : i
        }, Wf.indexOfName = function (e) {
            for (var t = 0, i = this.count(); t < i; t++) if (this.getName(t) === e) return t;
            return -1
        }, Wf.indexOfRawIndex = function (e) {
            if (e >= this._rawCount || e < 0) return -1;
            if (!this._indices) return e;
            var t = this._indices, i = t[e];
            if (null != i && i < this._count && i === e) return e;
            for (var n = 0, a = this._count - 1; n <= a;) {
                var o = (n + a) / 2 | 0;
                if (t[o] < e) n = 1 + o; else {
                    if (!(t[o] > e)) return o;
                    a = o - 1
                }
            }
            return -1
        }, Wf.indicesOfNearest = function (e, t, i) {
            var n = [];
            if (!this._storage[e]) return n;
            null == i && (i = 1 / 0);
            for (var a = 1 / 0, o = -1, r = 0, s = 0, l = this.count(); s < l; s++) {
                var d = t - this.get(e, s), u = Math.abs(d);
                u <= i && ((u < a || u === a && 0 <= d && o < 0) && (a = u, o = d, r = 0), d === o && (n[r++] = s))
            }
            return n.length = r, n
        }, Wf.getRawIndex = jf, Wf.getRawDataItem = function (e) {
            if (this._rawData.persistent) return this._rawData.getItem(this.getRawIndex(e));
            for (var t = [], i = 0; i < this.dimensions.length; i++) {
                var n = this.dimensions[i];
                t.push(this.get(n, e))
            }
            return t
        }, Wf.getName = function (e) {
            var t = this.getRawIndex(e);
            return this._nameList[t] || zf(this, this._nameDimIdx, t) || ""
        }, Wf.getId = function (e) {
            return $f(this, this.getRawIndex(e))
        }, Wf.each = function (e, t, i, n) {
            if (this._count) {
                "function" == typeof e && (n = i, i = t, t = e, e = []), i = i || n || this;
                for (var a = (e = D(Xf(e), this.getDimension, this)).length, o = 0; o < this.count(); o++) switch (a) {
                    case 0:
                        t.call(i, o);
                        break;
                    case 1:
                        t.call(i, this.get(e[0], o), o);
                        break;
                    case 2:
                        t.call(i, this.get(e[0], o), this.get(e[1], o), o);
                        break;
                    default:
                        for (var r = 0, s = []; r < a; r++) s[r] = this.get(e[r], o);
                        s[r] = o, t.apply(i, s)
                }
            }
        }, Wf.filterSelf = function (e, t, i, n) {
            if (this._count) {
                "function" == typeof e && (n = i, i = t, t = e, e = []), i = i || n || this, e = D(Xf(e), this.getDimension, this);
                for (var a = this.count(), o = new (Lf(this))(a), r = [], s = e.length, l = 0, d = e[0], u = 0; u < a; u++) {
                    var c, h = this.getRawIndex(u);
                    if (0 === s) c = t.call(i, u); else if (1 === s) {
                        var f = this._getFast(d, h);
                        c = t.call(i, f, u)
                    } else {
                        for (var g = 0; g < s; g++) r[g] = this._getFast(d, h);
                        r[g] = u, c = t.apply(i, r)
                    }
                    c && (o[l++] = h)
                }
                return l < a && (this._indices = o), this._count = l, this._extent = {}, this.getRawIndex = this._indices ? Gf : jf, this
            }
        }, Wf.selectRange = function (e) {
            if (this._count) {
                var t = [];
                for (var i in e) e.hasOwnProperty(i) && t.push(i);
                var n = t.length;
                if (n) {
                    var a = this.count(), o = new (Lf(this))(a), r = 0, s = t[0], l = e[s][0], d = e[s][1], u = !1;
                    if (!this._indices) {
                        var c = 0;
                        if (1 === n) {
                            for (var h = this._storage[t[0]], f = 0; f < this._chunkCount; f++) for (var g = h[f], p = Math.min(this._count - f * this._chunkSize, this._chunkSize), v = 0; v < p; v++) (l <= (w = g[v]) && w <= d || isNaN(w)) && (o[r++] = c), c++;
                            u = !0
                        } else if (2 === n) {
                            h = this._storage[s];
                            var m = this._storage[t[1]], y = e[t[1]][0], k = e[t[1]][1];
                            for (f = 0; f < this._chunkCount; f++) {
                                g = h[f];
                                var T = m[f];
                                for (p = Math.min(this._count - f * this._chunkSize, this._chunkSize), v = 0; v < p; v++) {
                                    var w = g[v], C = T[v];
                                    (l <= w && w <= d || isNaN(w)) && (y <= C && C <= k || isNaN(C)) && (o[r++] = c), c++
                                }
                            }
                            u = !0
                        }
                    }
                    if (!u) if (1 === n) for (v = 0; v < a; v++) {
                        var S = this.getRawIndex(v);
                        (l <= (w = this._getFast(s, S)) && w <= d || isNaN(w)) && (o[r++] = S)
                    } else for (v = 0; v < a; v++) {
                        var b = !0;
                        for (S = this.getRawIndex(v), f = 0; f < n; f++) {
                            var I = t[f];
                            ((w = this._getFast(i, S)) < e[I][0] || w > e[I][1]) && (b = !1)
                        }
                        b && (o[r++] = this.getRawIndex(v))
                    }
                    return r < a && (this._indices = o), this._count = r, this._extent = {}, this.getRawIndex = this._indices ? Gf : jf, this
                }
            }
        }, Wf.mapArray = function (e, t, i, n) {
            "function" == typeof e && (n = i, i = t, t = e, e = []), i = i || n || this;
            var a = [];
            return this.each(e, function () {
                a.push(t && t.apply(this, arguments))
            }, i), a
        }, Wf.map = function (e, t, i, n) {
            i = i || n || this;
            var a = qf(this, e = D(Xf(e), this.getDimension, this));
            a._indices = this._indices, a.getRawIndex = a._indices ? Gf : jf;
            for (var o = a._storage, r = [], s = this._chunkSize, l = e.length, d = this.count(), u = [], c = a._rawExtent, h = 0; h < d; h++) {
                for (var f = 0; f < l; f++) u[f] = this.get(e[f], h);
                u[l] = h;
                var g = t && t.apply(i, u);
                if (null != g) {
                    "object" != typeof g && (r[0] = g, g = r);
                    for (var p = this.getRawIndex(h), v = Math.floor(p / s), m = p % s, y = 0; y < g.length; y++) {
                        var k = e[y], T = g[y], w = c[k], C = o[k];
                        C && (C[v][m] = T), T < w[0] && (w[0] = T), T > w[1] && (w[1] = T)
                    }
                }
            }
            return a
        }, Wf.downSample = function (e, t, i, n) {
            for (var a = qf(this, [e]), o = a._storage, r = [], s = Math.floor(1 / t), l = o[e], d = this.count(), u = this._chunkSize, c = a._rawExtent[e], h = new (Lf(this))(d), f = 0, g = 0; g < d; g += s) {
                d - g < s && (s = d - g, r.length = s);
                for (var p = 0; p < s; p++) {
                    var v = this.getRawIndex(g + p), m = Math.floor(v / u), y = v % u;
                    r[p] = l[m][y]
                }
                var k = i(r), T = this.getRawIndex(Math.min(g + n(r, k) || 0, d - 1)), w = T % u;
                (l[Math.floor(T / u)][w] = k) < c[0] && (c[0] = k), k > c[1] && (c[1] = k), h[f++] = T
            }
            return a._count = f, a._indices = h, a.getRawIndex = Gf, a
        }, Wf.getItemModel = function (e) {
            var t = this.hostModel;
            return new Sl(this.getRawDataItem(e), t, t && t.ecModel)
        }, Wf.diff = function (e) {
            var t = this;
            return new bf(e ? e.getIndices() : [], this.getIndices(), function (t) {
                return $f(e, t)
            }, function (e) {
                return $f(t, e)
            })
        }, Wf.getVisual = function (e) {
            var t = this._visual;
            return t && t[e]
        }, Wf.setVisual = function (e, t) {
            if (Nf(e)) for (var i in e) e.hasOwnProperty(i) && this.setVisual(i, e[i]); else this._visual = this._visual || {}, this._visual[e] = t
        }, Wf.setLayout = function (e, t) {
            if (Nf(e)) for (var i in e) e.hasOwnProperty(i) && this.setLayout(i, e[i]); else this._layout[e] = t
        }, Wf.getLayout = function (e) {
            return this._layout[e]
        }, Wf.getItemLayout = function (e) {
            return this._itemLayouts[e]
        }, Wf.setItemLayout = function (e, t, i) {
            this._itemLayouts[e] = i ? k(this._itemLayouts[e] || {}, t) : t
        }, Wf.clearItemLayouts = function () {
            this._itemLayouts.length = 0
        }, Wf.getItemVisual = function (e, t, i) {
            var n = this._itemVisuals[e], a = n && n[t];
            return null != a || i ? a : this.getVisual(t)
        }, Wf.setItemVisual = function (e, t, i) {
            var n = this._itemVisuals[e] || {}, a = this.hasItemVisual;
            if (this._itemVisuals[e] = n, Nf(t)) for (var o in t) t.hasOwnProperty(o) && (n[o] = t[o], a[o] = !0); else n[t] = i, a[t] = !0
        }, Wf.clearAllVisual = function () {
            this._visual = {}, this._itemVisuals = [], this.hasItemVisual = {}
        }, Wf.setItemGraphicEl = function (e, t) {
            var i = this.hostModel;
            t && (t.dataIndex = e, t.dataType = this.dataType, t.seriesIndex = i && i.seriesIndex, "group" === t.type && t.traverse(Jf, t)), this._graphicEls[e] = t
        }, Wf.getItemGraphicEl = function (e) {
            return this._graphicEls[e]
        }, Wf.eachItemGraphicEl = function (e, t) {
            A(this._graphicEls, function (i, n) {
                i && e && e.call(t, i, n)
            })
        }, Wf.cloneShallow = function (e) {
            if (!e) {
                var t = D(this.dimensions, this.getDimensionInfo, this);
                e = new Kf(t, this.hostModel)
            }
            if (e._storage = this._storage, Rf(e, this), this._indices) {
                var i = this._indices.constructor;
                e._indices = new i(this._indices)
            } else e._indices = null;
            return e.getRawIndex = e._indices ? Gf : jf, e
        }, Wf.wrapMethod = function (e, t) {
            var i = this[e];
            "function" == typeof i && (this.__wrappedMethods = this.__wrappedMethods || [], this.__wrappedMethods.push(e), this[e] = function () {
                var e = i.apply(this, arguments);
                return t.apply(this, [e].concat(j(arguments)))
            })
        }, Wf.TRANSFERABLE_METHODS = ["cloneShallow", "downSample", "map"], Wf.CHANGABLE_METHODS = ["filterSelf", "selectRange"];
        var eg = function (e, t) {
            return Zf((t = t || {}).coordDimensions || [], e, {
                dimsDef: t.dimensionsDefine || e.dimensionsDefine,
                encodeDef: t.encodeDefine || e.encodeDefine,
                dimCount: t.dimensionsCount,
                encodeDefaulter: t.encodeDefaulter,
                generateCoord: t.generateCoord,
                generateCoordCount: t.generateCoordCount
            })
        }, tg = {
            cartesian2d: function (e, t, i, n) {
                var a = e.getReferringComponents("xAxis")[0], o = e.getReferringComponents("yAxis")[0];
                t.coordSysDims = ["x", "y"], i.set("x", a), i.set("y", o), ig(a) && (n.set("x", a), t.firstCategoryDimIndex = 0), ig(o) && (n.set("y", o), t.firstCategoryDimIndex, t.firstCategoryDimIndex = 1)
            }, singleAxis: function (e, t, i, n) {
                var a = e.getReferringComponents("singleAxis")[0];
                t.coordSysDims = ["single"], i.set("single", a), ig(a) && (n.set("single", a), t.firstCategoryDimIndex = 0)
            }, polar: function (e, t, i, n) {
                var a = e.getReferringComponents("polar")[0], o = a.findAxisModel("radiusAxis"),
                    r = a.findAxisModel("angleAxis");
                t.coordSysDims = ["radius", "angle"], i.set("radius", o), i.set("angle", r), ig(o) && (n.set("radius", o), t.firstCategoryDimIndex = 0), ig(r) && (n.set("angle", r), null == t.firstCategoryDimIndex && (t.firstCategoryDimIndex = 1))
            }, geo: function (e, t, i, n) {
                t.coordSysDims = ["lng", "lat"]
            }, parallel: function (e, t, i, n) {
                var a = e.ecModel, o = a.getComponent("parallel", e.get("parallelIndex")),
                    r = t.coordSysDims = o.dimensions.slice();
                A(o.parallelAxisIndex, function (e, o) {
                    var s = a.getComponent("parallelAxis", e), l = r[o];
                    i.set(l, s), ig(s) && null == t.firstCategoryDimIndex && (n.set(l, s), t.firstCategoryDimIndex = o)
                })
            }
        };

        function ig(e) {
            return "category" === e.get("type")
        }

        function ng(e, t, i) {
            var n, a, o, r, s = (i = i || {}).byIndex, l = i.stackedCoordDimension, d = !(!e || !e.get("stack"));
            if (A(t, function (e, i) {
                L(e) && (t[i] = e = {name: e}), d && !e.isExtraCoord && (s || n || !e.ordinalMeta || (n = e), a || "ordinal" === e.type || "time" === e.type || l && l !== e.coordDim || (a = e))
            }), !a || s || n || (s = !0), a) {
                o = "__\0ecstackresult", r = "__\0ecstackedover", n && (n.createInvertedIndices = !0);
                var u = a.coordDim, c = a.type, h = 0;
                A(t, function (e) {
                    e.coordDim === u && h++
                }), t.push({
                    name: o,
                    coordDim: u,
                    coordDimIndex: h,
                    type: c,
                    isExtraCoord: !0,
                    isCalculationCoord: !0
                }), h++, t.push({
                    name: r,
                    coordDim: r,
                    coordDimIndex: h,
                    type: c,
                    isExtraCoord: !0,
                    isCalculationCoord: !0
                })
            }
            return {
                stackedDimension: a && a.name,
                stackedByDimension: n && n.name,
                isStackedByIndex: s,
                stackedOverDimension: r,
                stackResultDimension: o
            }
        }

        function ag(e, t) {
            return !!t && t === e.getCalculationInfo("stackedDimension")
        }

        function og(e, t) {
            return ag(e, t) ? e.getCalculationInfo("stackResultDimension") : t
        }

        function rg(e, t, i) {
            i = i || {}, Rd.isInstance(e) || (e = Rd.seriesDataToSource(e));
            var n, a = t.get("coordinateSystem"), o = iu.get(a), r = function (e) {
                var t = e.get("coordinateSystem"), i = new function (e) {
                    this.coordSysName = e, this.coordSysDims = [], this.axisMap = Q(), this.categoryAxisMap = Q(), this.firstCategoryDimIndex = null
                }(t), n = tg[t];
                if (n) return n(e, i, i.axisMap, i.categoryAxisMap), i
            }(t);
            r && (n = D(r.coordSysDims, function (e) {
                var t = {name: e}, i = r.axisMap.get(e);
                if (i) {
                    var n = i.get("type");
                    t.type = Df(n)
                }
                return t
            })), n = n || o && (o.getDimensionsInfo ? o.getDimensionsInfo() : o.dimensions.slice()) || ["x", "y"];
            var s, l, d = eg(e, {
                coordDimensions: n,
                generateCoord: i.generateCoord,
                encodeDefaulter: i.useEncodeDefaulter ? M(jd, n, t) : null
            });
            r && A(d, function (e, t) {
                var i = e.coordDim, n = r.categoryAxisMap.get(i);
                n && (null == s && (s = t), e.ordinalMeta = n.getOrdinalMeta()), null != e.otherDims.itemName && (l = !0)
            }), l || null == s || (d[s].otherDims.itemName = 0);
            var u = ng(t, d), c = new Kf(d, t);
            c.setCalculationInfo(u);
            var h = null != s && function (e) {
                if (e.sourceFormat === Ed) {
                    var t = function (e) {
                        for (var t = 0; t < e.length && null == e[t];) t++;
                        return e[t]
                    }(e.data || []);
                    return null != t && !O(Fa(t))
                }
            }(e) ? function (e, t, i, n) {
                return n === s ? i : this.defaultDimValueGetter(e, t, i, n)
            } : null;
            return c.hasItemOption = !1, c.initData(e, null, h), c
        }

        function sg(e) {
            this._setting = e || {}, this._extent = [1 / 0, -1 / 0], this._interval = 0, this.init && this.init.apply(this, arguments)
        }

        function lg(e) {
            this.categories = e.categories || [], this._needCollect = e.needCollect, this._deduplication = e.deduplication, this._map
        }

        sg.prototype.parse = function (e) {
            return e
        }, sg.prototype.getSetting = function (e) {
            return this._setting[e]
        }, sg.prototype.contain = function (e) {
            var t = this._extent;
            return e >= t[0] && e <= t[1]
        }, sg.prototype.normalize = function (e) {
            var t = this._extent;
            return t[1] === t[0] ? .5 : (e - t[0]) / (t[1] - t[0])
        }, sg.prototype.scale = function (e) {
            var t = this._extent;
            return e * (t[1] - t[0]) + t[0]
        }, sg.prototype.unionExtent = function (e) {
            var t = this._extent;
            e[0] < t[0] && (t[0] = e[0]), e[1] > t[1] && (t[1] = e[1])
        }, sg.prototype.unionExtentFromData = function (e, t) {
            this.unionExtent(e.getApproximateExtent(t))
        }, sg.prototype.getExtent = function () {
            return this._extent.slice()
        }, sg.prototype.setExtent = function (e, t) {
            var i = this._extent;
            isNaN(e) || (i[0] = e), isNaN(t) || (i[1] = t)
        }, sg.prototype.isBlank = function () {
            return this._isBlank
        }, sg.prototype.setBlank = function (e) {
            this._isBlank = e
        }, sg.prototype.getLabel = null, Ja(sg), io(sg, {registerWhenExtend: !0}), lg.createByAxisModel = function (e) {
            var t = e.option, i = t.data, n = i && D(i, cg);
            return new lg({categories: n, needCollect: !n, deduplication: !1 !== t.dedplication})
        };
        var dg = lg.prototype;

        function ug(e) {
            return e._map || (e._map = Q(e.categories))
        }

        function cg(e) {
            return B(e) && null != e.value ? e.value : e + ""
        }

        dg.getOrdinal = function (e) {
            return ug(this).get(e)
        }, dg.parseAndCollect = function (e) {
            var t, i = this._needCollect;
            if ("string" != typeof e && !i) return e;
            if (i && !this._deduplication) return t = this.categories.length, this.categories[t] = e, t;
            var n = ug(this);
            return null == (t = n.get(e)) && (i ? (t = this.categories.length, this.categories[t] = e, n.set(e, t)) : t = NaN), t
        };
        var hg = sg.prototype, fg = sg.extend({
            type: "ordinal", init: function (e, t) {
                e && !O(e) || (e = new lg({categories: e})), this._ordinalMeta = e, this._extent = t || [0, e.categories.length - 1]
            }, parse: function (e) {
                return "string" == typeof e ? this._ordinalMeta.getOrdinal(e) : Math.round(e)
            }, contain: function (e) {
                return e = this.parse(e), hg.contain.call(this, e) && null != this._ordinalMeta.categories[e]
            }, normalize: function (e) {
                return hg.normalize.call(this, this.parse(e))
            }, scale: function (e) {
                return Math.round(hg.scale.call(this, e))
            }, getTicks: function () {
                for (var e = [], t = this._extent, i = t[0]; i <= t[1];) e.push(i), i++;
                return e
            }, getLabel: function (e) {
                if (!this.isBlank()) return this._ordinalMeta.categories[e]
            }, count: function () {
                return this._extent[1] - this._extent[0] + 1
            }, unionExtentFromData: function (e, t) {
                this.unionExtent(e.getApproximateExtent(t))
            }, getOrdinalMeta: function () {
                return this._ordinalMeta
            }, niceTicks: te, niceExtent: te
        });
        fg.create = function () {
            return new fg
        };
        var gg = El;

        function pg(e) {
            return Ol(e) + 2
        }

        function vg(e, t, i) {
            e[t] = Math.max(Math.min(e[t], i[1]), i[0])
        }

        function mg(e, t) {
            isFinite(e[0]) || (e[0] = t[0]), isFinite(e[1]) || (e[1] = t[1]), vg(e, 0, t), vg(e, 1, t), e[0] > e[1] && (e[0] = e[1])
        }

        var yg = El, kg = sg.extend({
            type: "interval", _interval: 0, _intervalPrecision: 2, setExtent: function (e, t) {
                var i = this._extent;
                isNaN(e) || (i[0] = parseFloat(e)), isNaN(t) || (i[1] = parseFloat(t))
            }, unionExtent: function (e) {
                var t = this._extent;
                e[0] < t[0] && (t[0] = e[0]), e[1] > t[1] && (t[1] = e[1]), kg.prototype.setExtent.call(this, t[0], t[1])
            }, getInterval: function () {
                return this._interval
            }, setInterval: function (e) {
                this._interval = e, this._niceExtent = this._extent.slice(), this._intervalPrecision = pg(e)
            }, getTicks: function (e) {
                var t = this._interval, i = this._extent, n = this._niceExtent, a = this._intervalPrecision, o = [];
                if (!t) return o;
                i[0] < n[0] && (e ? o.push(yg(n[0] - t, a)) : o.push(i[0]));
                for (var r = n[0]; r <= n[1] && (o.push(r), (r = yg(r + t, a)) !== o[o.length - 1]);) if (1e4 < o.length) return [];
                var s = o.length ? o[o.length - 1] : n[1];
                return i[1] > s && (e ? o.push(yg(s + t, a)) : o.push(i[1])), o
            }, getMinorTicks: function (e) {
                for (var t = this.getTicks(!0), i = [], n = this.getExtent(), a = 1; a < t.length; a++) {
                    for (var o = t[a], r = t[a - 1], s = 0, l = [], d = (o - r) / e; s < e - 1;) {
                        var u = El(r + (s + 1) * d);
                        u > n[0] && u < n[1] && l.push(u), s++
                    }
                    i.push(l)
                }
                return i
            }, getLabel: function (e, t) {
                if (null == e) return "";
                var i = t && t.precision;
                return null == i ? i = Ol(e) || 0 : "auto" === i && (i = this._intervalPrecision), Xl(e = yg(e, i, !0))
            }, niceTicks: function (e, t, i) {
                e = e || 5;
                var n = this._extent, a = n[1] - n[0];
                if (isFinite(a)) {
                    a < 0 && (a = -a, n.reverse());
                    var o = function (e, t, i, n) {
                        var a = {}, o = e[1] - e[0], r = a.interval = zl(o / t, !0);
                        null != i && r < i && (r = a.interval = i), null != n && n < r && (r = a.interval = n);
                        var s = a.intervalPrecision = pg(r);
                        return mg(a.niceTickExtent = [gg(Math.ceil(e[0] / r) * r, s), gg(Math.floor(e[1] / r) * r, s)], e), a
                    }(n, e, t, i);
                    this._intervalPrecision = o.intervalPrecision, this._interval = o.interval, this._niceExtent = o.niceTickExtent
                }
            }, niceExtent: function (e) {
                var t = this._extent;
                if (t[0] === t[1]) if (0 !== t[0]) {
                    var i = t[0];
                    e.fixMax || (t[1] += i / 2), t[0] -= i / 2
                } else t[1] = 1;
                var n = t[1] - t[0];
                isFinite(n) || (t[0] = 0, t[1] = 1), this.niceTicks(e.splitNumber, e.minInterval, e.maxInterval);
                var a = this._interval;
                e.fixMin || (t[0] = yg(Math.floor(t[0] / a) * a)), e.fixMax || (t[1] = yg(Math.ceil(t[1] / a) * a))
            }
        });
        kg.create = function () {
            return new kg
        };
        var Tg = "__ec_stack_", wg = "undefined" != typeof Float32Array ? Float32Array : Array;

        function Cg(e) {
            return e.get("stack") || Tg + e.seriesIndex
        }

        function Sg(e) {
            return e.dim + e.index
        }

        function bg(e, t) {
            var i = [];
            return t.eachSeriesByType(e, function (e) {
                Ng(e) && !Eg(e) && i.push(e)
            }), i
        }

        function Ig(e) {
            var t = function (e) {
                var t = {};
                A(e, function (e) {
                    var i = e.coordinateSystem.getBaseAxis();
                    if ("time" === i.type || "value" === i.type) for (var n = e.getData(), a = i.dim + "_" + i.index, o = n.mapDimension(i.dim), r = 0, s = n.count(); r < s; ++r) {
                        var l = n.get(o, r);
                        t[a] ? t[a].push(l) : t[a] = [l]
                    }
                });
                var i = [];
                for (var n in t) if (t.hasOwnProperty(n)) {
                    var a = t[n];
                    if (a) {
                        a.sort(function (e, t) {
                            return e - t
                        });
                        for (var o = null, r = 1; r < a.length; ++r) {
                            var s = a[r] - a[r - 1];
                            0 < s && (o = null === o ? s : Math.min(o, s))
                        }
                        i[n] = o
                    }
                }
                return i
            }(e), i = [];
            return A(e, function (e) {
                var n, a = e.coordinateSystem.getBaseAxis(), o = a.getExtent();
                if ("category" === a.type) n = a.getBandWidth(); else if ("value" === a.type || "time" === a.type) {
                    var r = a.dim + "_" + a.index, s = t[r], l = Math.abs(o[1] - o[0]), d = a.scale.getExtent(),
                        u = Math.abs(d[1] - d[0]);
                    n = s ? l / u * s : l
                } else {
                    var c = e.getData();
                    n = Math.abs(o[1] - o[0]) / c.count()
                }
                var h = Nl(e.get("barWidth"), n), f = Nl(e.get("barMaxWidth"), n), g = Nl(e.get("barMinWidth") || 1, n),
                    p = e.get("barGap"), v = e.get("barCategoryGap");
                i.push({
                    bandWidth: n,
                    barWidth: h,
                    barMaxWidth: f,
                    barMinWidth: g,
                    barGap: p,
                    barCategoryGap: v,
                    axisKey: Sg(a),
                    stackId: Cg(e)
                })
            }), _g(i)
        }

        function _g(e) {
            var t = {};
            A(e, function (e, i) {
                var n = e.axisKey, a = e.bandWidth, o = t[n] || {
                    bandWidth: a,
                    remainedWidth: a,
                    autoWidthCount: 0,
                    categoryGap: "20%",
                    gap: "30%",
                    stacks: {}
                }, r = o.stacks;
                t[n] = o;
                var s = e.stackId;
                r[s] || o.autoWidthCount++, r[s] = r[s] || {width: 0, maxWidth: 0};
                var l = e.barWidth;
                l && !r[s].width && (r[s].width = l, l = Math.min(o.remainedWidth, l), o.remainedWidth -= l);
                var d = e.barMaxWidth;
                d && (r[s].maxWidth = d);
                var u = e.barMinWidth;
                u && (r[s].minWidth = u);
                var c = e.barGap;
                null != c && (o.gap = c);
                var h = e.barCategoryGap;
                null != h && (o.categoryGap = h)
            });
            var i = {};
            return A(t, function (e, t) {
                i[t] = {};
                var n = e.stacks, a = e.bandWidth, o = Nl(e.categoryGap, a), r = Nl(e.gap, 1), s = e.remainedWidth,
                    l = e.autoWidthCount, d = (s - o) / (l + (l - 1) * r);
                d = Math.max(d, 0), A(n, function (e) {
                    var t = e.maxWidth, i = e.minWidth;
                    if (e.width) n = e.width, t && (n = Math.min(n, t)), i && (n = Math.max(n, i)), e.width = n, s -= n + r * n, l--; else {
                        var n = d;
                        t && t < n && (n = Math.min(t, s)), i && n < i && (n = i), n !== d && (e.width = n, s -= n + r * n, l--)
                    }
                }), d = (s - o) / (l + (l - 1) * r), d = Math.max(d, 0);
                var u, c = 0;
                A(n, function (e, t) {
                    e.width || (e.width = d), c += (u = e).width * (1 + r)
                }), u && (c -= u.width * r);
                var h = -c / 2;
                A(n, function (e, n) {
                    i[t][n] = i[t][n] || {bandWidth: a, offset: h, width: e.width}, h += e.width * (1 + r)
                })
            }), i
        }

        function Ag(e, t, i) {
            if (e && t) {
                var n = e[Sg(t)];
                return null != n && null != i && (n = n[Cg(i)]), n
            }
        }

        function Dg(e, t) {
            var i = bg(e, t), n = Ig(i), a = {};
            A(i, function (e) {
                var t = e.getData(), i = e.coordinateSystem, o = i.getBaseAxis(), r = Cg(e), s = n[Sg(o)][r],
                    l = s.offset, d = s.width, u = i.getOtherAxis(o), c = e.get("barMinHeight") || 0;
                a[r] = a[r] || [], t.setLayout({bandWidth: s.bandWidth, offset: l, size: d});
                for (var h = t.mapDimension(u.dim), f = t.mapDimension(o.dim), g = ag(t, h), p = u.isHorizontal(), v = Pg(0, u), m = 0, y = t.count(); m < y; m++) {
                    var k, T, w, C, S, b = t.get(h, m), I = t.get(f, m), _ = 0 <= b ? "p" : "n", A = v;
                    g && (a[r][I] || (a[r][I] = {
                        p: v,
                        n: v
                    }), A = a[r][I][_]), p ? (k = A, T = (S = i.dataToPoint([b, I]))[1] + l, w = S[0] - v, C = d, Math.abs(w) < c && (w = (w < 0 ? -1 : 1) * c), isNaN(w) || g && (a[r][I][_] += w)) : (k = (S = i.dataToPoint([I, b]))[0] + l, T = A, w = d, C = S[1] - v, Math.abs(C) < c && (C = (C <= 0 ? -1 : 1) * c), isNaN(C) || g && (a[r][I][_] += C)), t.setItemLayout(m, {
                        x: k,
                        y: T,
                        width: w,
                        height: C
                    })
                }
            }, this)
        }

        var xg = {
            seriesType: "bar", plan: uc(), reset: function (e) {
                if (Ng(e) && Eg(e)) {
                    var t = e.getData(), i = e.coordinateSystem, n = i.grid.getRect(), a = i.getBaseAxis(),
                        o = i.getOtherAxis(a), r = t.mapDimension(o.dim), s = t.mapDimension(a.dim),
                        l = o.isHorizontal(), d = l ? 0 : 1, u = Ag(Ig([e]), a, e).width;
                    return .5 < u || (u = .5), {
                        progress: function (e, t) {
                            for (var a, c = e.count, h = new wg(2 * c), f = new wg(2 * c), g = new wg(c), p = [], v = [], m = 0, y = 0; null != (a = e.next());) v[d] = t.get(r, a), v[1 - d] = t.get(s, a), p = i.dataToPoint(v, null, p), f[m] = l ? n.x + n.width : p[0], h[m++] = p[0], f[m] = l ? p[1] : n.y + n.height, h[m++] = p[1], g[y++] = a;
                            t.setLayout({
                                largePoints: h,
                                largeDataIndices: g,
                                largeBackgroundPoints: f,
                                barWidth: u,
                                valueAxisStart: Pg(0, o),
                                backgroundStart: l ? n.x : n.y,
                                valueAxisHorizontal: l
                            })
                        }
                    }
                }
            }
        };

        function Ng(e) {
            return e.coordinateSystem && "cartesian2d" === e.coordinateSystem.type
        }

        function Eg(e) {
            return e.pipelineContext && e.pipelineContext.large
        }

        function Pg(e, t) {
            return t.toGlobalCoord(t.dataToCoord("log" === t.type ? 1 : 0))
        }

        var Mg = kg.prototype, Og = Math.ceil, Fg = Math.floor, Lg = 864e5, Bg = kg.extend({
            type: "time", getLabel: function (e) {
                var t = this._stepLvl, i = new Date(e);
                return rd(t[0], i, this.getSetting("useUTC"))
            }, niceExtent: function (e) {
                var t = this._extent;
                if (t[0] === t[1] && (t[0] -= Lg, t[1] += Lg), t[1] === -1 / 0 && t[0] === 1 / 0) {
                    var i = new Date;
                    t[1] = +new Date(i.getFullYear(), i.getMonth(), i.getDate()), t[0] = t[1] - Lg
                }
                this.niceTicks(e.splitNumber, e.minInterval, e.maxInterval);
                var n = this._interval;
                e.fixMin || (t[0] = El(Fg(t[0] / n) * n)), e.fixMax || (t[1] = El(Og(t[1] / n) * n))
            }, niceTicks: function (e, t, i) {
                e = e || 10;
                var n = this._extent, a = n[1] - n[0], o = a / e;
                null != t && o < t && (o = t), null != i && i < o && (o = i);
                var r = Ug.length, s = function (e, t, i, n) {
                    for (; i < n;) {
                        var a = i + n >>> 1;
                        e[a][1] < t ? i = 1 + a : n = a
                    }
                    return i
                }(Ug, o, 0, r), l = Ug[Math.min(s, r - 1)], d = l[1];
                "year" === l[0] && (d *= zl(a / d / e, !0));
                var u = this.getSetting("useUTC") ? 0 : 60 * new Date(+n[0] || +n[1]).getTimezoneOffset() * 1e3,
                    c = [Math.round(Og((n[0] - u) / d) * d + u), Math.round(Fg((n[1] - u) / d) * d + u)];
                mg(c, n), this._stepLvl = l, this._interval = d, this._niceExtent = c
            }, parse: function (e) {
                return +Wl(e)
            }
        });
        A(["contain", "normalize"], function (e) {
            Bg.prototype[e] = function (t) {
                return Mg[e].call(this, this.parse(t))
            }
        });
        var Ug = [["hh:mm:ss", 1e3], ["hh:mm:ss", 5e3], ["hh:mm:ss", 1e4], ["hh:mm:ss", 15e3], ["hh:mm:ss", 3e4], ["hh:mm\nMM-dd", 6e4], ["hh:mm\nMM-dd", 3e5], ["hh:mm\nMM-dd", 6e5], ["hh:mm\nMM-dd", 9e5], ["hh:mm\nMM-dd", 18e5], ["hh:mm\nMM-dd", 36e5], ["hh:mm\nMM-dd", 72e5], ["hh:mm\nMM-dd", 216e5], ["hh:mm\nMM-dd", 432e5], ["MM-dd\nyyyy", Lg], ["MM-dd\nyyyy", 2 * Lg], ["MM-dd\nyyyy", 3 * Lg], ["MM-dd\nyyyy", 4 * Lg], ["MM-dd\nyyyy", 5 * Lg], ["MM-dd\nyyyy", 6 * Lg], ["week", 7 * Lg], ["MM-dd\nyyyy", 864e6], ["week", 14 * Lg], ["week", 21 * Lg], ["month", 31 * Lg], ["week", 42 * Lg], ["month", 62 * Lg], ["week", 70 * Lg], ["quarter", 95 * Lg], ["month", 31 * Lg * 4], ["month", 13392e6], ["half-year", 16416e6], ["month", 31 * Lg * 8], ["month", 26784e6], ["year", 380 * Lg]];
        Bg.create = function (e) {
            return new Bg({useUTC: e.ecModel.get("useUTC")})
        };
        var Rg = sg.prototype, Kg = kg.prototype, Wg = Ol, Vg = El, Hg = Math.floor, zg = Math.ceil, jg = Math.pow,
            Gg = Math.log, $g = sg.extend({
                type: "log", base: 10, $constructor: function () {
                    sg.apply(this, arguments), this._originalScale = new kg
                }, getTicks: function (e) {
                    var t = this._originalScale, i = this._extent, n = t.getExtent();
                    return D(Kg.getTicks.call(this, e), function (e) {
                        var a = El(jg(this.base, e));
                        return a = e === i[0] && t.__fixMin ? Xg(a, n[0]) : a, a = e === i[1] && t.__fixMax ? Xg(a, n[1]) : a
                    }, this)
                }, getMinorTicks: Kg.getMinorTicks, getLabel: Kg.getLabel, scale: function (e) {
                    return e = Rg.scale.call(this, e), jg(this.base, e)
                }, setExtent: function (e, t) {
                    var i = this.base;
                    e = Gg(e) / Gg(i), t = Gg(t) / Gg(i), Kg.setExtent.call(this, e, t)
                }, getExtent: function () {
                    var e = this.base, t = Rg.getExtent.call(this);
                    t[0] = jg(e, t[0]), t[1] = jg(e, t[1]);
                    var i = this._originalScale, n = i.getExtent();
                    return i.__fixMin && (t[0] = Xg(t[0], n[0])), i.__fixMax && (t[1] = Xg(t[1], n[1])), t
                }, unionExtent: function (e) {
                    this._originalScale.unionExtent(e);
                    var t = this.base;
                    e[0] = Gg(e[0]) / Gg(t), e[1] = Gg(e[1]) / Gg(t), Rg.unionExtent.call(this, e)
                }, unionExtentFromData: function (e, t) {
                    this.unionExtent(e.getApproximateExtent(t))
                }, niceTicks: function (e) {
                    e = e || 10;
                    var t = this._extent, i = t[1] - t[0];
                    if (!(i == 1 / 0 || i <= 0)) {
                        var n = Vl(i);
                        for (e / i * n <= .5 && (n *= 10); !isNaN(n) && Math.abs(n) < 1 && 0 < Math.abs(n);) n *= 10;
                        var a = [El(zg(t[0] / n) * n), El(Hg(t[1] / n) * n)];
                        this._interval = n, this._niceExtent = a
                    }
                }, niceExtent: function (e) {
                    Kg.niceExtent.call(this, e);
                    var t = this._originalScale;
                    t.__fixMin = e.fixMin, t.__fixMax = e.fixMax
                }
            });

        function Xg(e, t) {
            return Vg(e, Wg(t))
        }

        function qg(e, t) {
            var i, n, a, o = e.type, r = t.getMin(), s = t.getMax(), l = e.getExtent();
            "ordinal" === o ? i = t.getCategories().length : (O(n = t.get("boundaryGap")) || (n = [n || 0, n || 0]), "boolean" == typeof n[0] && (n = [0, 0]), n[0] = Nl(n[0], 1), n[1] = Nl(n[1], 1), a = l[1] - l[0] || Math.abs(l[0])), "dataMin" === r ? r = l[0] : "function" == typeof r && (r = r({
                min: l[0],
                max: l[1]
            })), "dataMax" === s ? s = l[1] : "function" == typeof s && (s = s({min: l[0], max: l[1]}));
            var d = null != r, u = null != s;
            null == r && (r = "ordinal" === o ? i ? 0 : NaN : l[0] - n[0] * a), null == s && (s = "ordinal" === o ? i ? i - 1 : NaN : l[1] + n[1] * a), null != r && isFinite(r) || (r = NaN), null != s && isFinite(s) || (s = NaN), e.setBlank(W(r) || W(s) || "ordinal" === o && !e.getOrdinalMeta().categories.length), t.getNeedCrossZero() && (0 < r && 0 < s && !d && (r = 0), r < 0 && s < 0 && !u && (s = 0));
            var c = t.ecModel;
            if (c && "time" === o) {
                var h, f = bg("bar", c);
                if (A(f, function (e) {
                    h |= e.getBaseAxis() === t.axis
                }), h) {
                    var g = Ig(f), p = function (e, t, i, n) {
                        var a = i.axis.getExtent(), o = a[1] - a[0], r = Ag(n, i.axis);
                        if (void 0 === r) return {min: e, max: t};
                        var s = 1 / 0;
                        A(r, function (e) {
                            s = Math.min(e.offset, s)
                        });
                        var l = -1 / 0;
                        A(r, function (e) {
                            l = Math.max(e.offset + e.width, l)
                        }), s = Math.abs(s), l = Math.abs(l);
                        var d = s + l, u = t - e, c = u / (1 - (s + l) / o) - u;
                        return {min: e -= s / d * c, max: t += l / d * c}
                    }(r, s, t, g);
                    r = p.min, s = p.max
                }
            }
            return {extent: [r, s], fixMin: d, fixMax: u}
        }

        function Yg(e, t) {
            var i = qg(e, t), n = i.extent, a = t.get("splitNumber");
            "log" === e.type && (e.base = t.get("logBase"));
            var o = e.type;
            e.setExtent(n[0], n[1]), e.niceExtent({
                splitNumber: a,
                fixMin: i.fixMin,
                fixMax: i.fixMax,
                minInterval: "interval" === o || "time" === o ? t.get("minInterval") : null,
                maxInterval: "interval" === o || "time" === o ? t.get("maxInterval") : null
            });
            var r = t.get("interval");
            null != r && e.setInterval && e.setInterval(r)
        }

        function Jg(e, t) {
            if (t = t || e.get("type")) switch (t) {
                case"category":
                    return new fg(e.getOrdinalMeta ? e.getOrdinalMeta() : e.getCategories(), [1 / 0, -1 / 0]);
                case"value":
                    return new kg;
                default:
                    return (sg.getClass(t) || kg).create(e)
            }
        }

        function Zg(e) {
            var t, i = e.getLabelModel().get("formatter"), n = "category" === e.type ? e.scale.getExtent()[0] : null;
            return "string" == typeof i ? (t = i, i = function (i) {
                return i = e.scale.getLabel(i), t.replace("{value}", null != i ? i : "")
            }) : "function" == typeof i ? function (t, a) {
                return null != n && (a = t - n), i(Qg(e, t), a)
            } : function (t) {
                return e.scale.getLabel(t)
            }
        }

        function Qg(e, t) {
            return "category" === e.type ? e.scale.getLabel(t) : t
        }

        function ep(e) {
            var t = e.get("interval");
            return null == t ? "auto" : t
        }

        function tp(e) {
            return "category" === e.type && 0 === ep(e.getLabelModel())
        }

        A(["contain", "normalize"], function (e) {
            $g.prototype[e] = function (t) {
                return t = Gg(t) / Gg(this.base), Rg[e].call(this, t)
            }
        }), $g.create = function () {
            return new $g
        };
        var ip = {
            getMin: function (e) {
                var t = this.option, i = e || null == t.rangeStart ? t.min : t.rangeStart;
                return this.axis && null != i && "dataMin" !== i && "function" != typeof i && !W(i) && (i = this.axis.scale.parse(i)), i
            }, getMax: function (e) {
                var t = this.option, i = e || null == t.rangeEnd ? t.max : t.rangeEnd;
                return this.axis && null != i && "dataMax" !== i && "function" != typeof i && !W(i) && (i = this.axis.scale.parse(i)), i
            }, getNeedCrossZero: function () {
                var e = this.option;
                return null == e.rangeStart && null == e.rangeEnd && !e.scale
            }, getCoordSysModel: te, setRange: function (e, t) {
                this.option.rangeStart = e, this.option.rangeEnd = t
            }, resetRange: function () {
                this.option.rangeStart = this.option.rangeEnd = null
            }
        }, np = Ss({
            type: "triangle", shape: {cx: 0, cy: 0, width: 0, height: 0}, buildPath: function (e, t) {
                var i = t.cx, n = t.cy, a = t.width / 2, o = t.height / 2;
                e.moveTo(i, n - o), e.lineTo(i + a, n + o), e.lineTo(i - a, n + o), e.closePath()
            }
        }), ap = Ss({
            type: "diamond", shape: {cx: 0, cy: 0, width: 0, height: 0}, buildPath: function (e, t) {
                var i = t.cx, n = t.cy, a = t.width / 2, o = t.height / 2;
                e.moveTo(i, n - o), e.lineTo(i + a, n), e.lineTo(i, n + o), e.lineTo(i - a, n), e.closePath()
            }
        }), op = Ss({
            type: "pin", shape: {x: 0, y: 0, width: 0, height: 0}, buildPath: function (e, t) {
                var i = t.x, n = t.y, a = t.width / 5 * 3, o = Math.max(a, t.height), r = a / 2, s = r * r / (o - r),
                    l = n - o + r + s, d = Math.asin(s / r), u = Math.cos(d) * r, c = Math.sin(d), h = Math.cos(d),
                    f = .6 * r, g = .7 * r;
                e.moveTo(i - u, l + s), e.arc(i, l, r, Math.PI - d, 2 * Math.PI + d), e.bezierCurveTo(i + u - c * f, l + s + h * f, i, n - g, i, n), e.bezierCurveTo(i, n - g, i - u + c * f, l + s + h * f, i - u, l + s), e.closePath()
            }
        }), rp = Ss({
            type: "arrow", shape: {x: 0, y: 0, width: 0, height: 0}, buildPath: function (e, t) {
                var i = t.height, n = t.width, a = t.x, o = t.y, r = n / 3 * 2;
                e.moveTo(a, o), e.lineTo(a + r, o + i), e.lineTo(a, o + i / 4 * 3), e.lineTo(a - r, o + i), e.lineTo(a, o), e.closePath()
            }
        }), sp = {
            line: function (e, t, i, n, a) {
                a.x1 = e, a.y1 = t + n / 2, a.x2 = e + i, a.y2 = t + n / 2
            }, rect: function (e, t, i, n, a) {
                a.x = e, a.y = t, a.width = i, a.height = n
            }, roundRect: function (e, t, i, n, a) {
                a.x = e, a.y = t, a.width = i, a.height = n, a.r = Math.min(i, n) / 4
            }, square: function (e, t, i, n, a) {
                var o = Math.min(i, n);
                a.x = e, a.y = t, a.width = o, a.height = o
            }, circle: function (e, t, i, n, a) {
                a.cx = e + i / 2, a.cy = t + n / 2, a.r = Math.min(i, n) / 2
            }, diamond: function (e, t, i, n, a) {
                a.cx = e + i / 2, a.cy = t + n / 2, a.width = i, a.height = n
            }, pin: function (e, t, i, n, a) {
                a.x = e + i / 2, a.y = t + n / 2, a.width = i, a.height = n
            }, arrow: function (e, t, i, n, a) {
                a.x = e + i / 2, a.y = t + n / 2, a.width = i, a.height = n
            }, triangle: function (e, t, i, n, a) {
                a.cx = e + i / 2, a.cy = t + n / 2, a.width = i, a.height = n
            }
        }, lp = {};
        A({
            line: is,
            rect: es,
            roundRect: es,
            square: es,
            circle: Wr,
            diamond: ap,
            pin: op,
            arrow: rp,
            triangle: np
        }, function (e, t) {
            lp[t] = new e
        });
        var dp = Ss({
            type: "symbol",
            shape: {symbolType: "", x: 0, y: 0, width: 0, height: 0},
            calculateTextPosition: function (e, t, i) {
                var n = gn(e, t, i), a = this.shape;
                return a && "pin" === a.symbolType && "inside" === t.textPosition && (n.y = i.y + .4 * i.height), n
            },
            buildPath: function (e, t, i) {
                var n = t.symbolType;
                if ("none" !== n) {
                    var a = lp[n];
                    a = a || lp[n = "rect"], sp[n](t.x, t.y, t.width, t.height, a.shape), a.buildPath(e, a.shape, i)
                }
            }
        });

        function up(e, t) {
            if ("image" !== this.type) {
                var i = this.style, n = this.shape;
                n && "line" === n.symbolType ? i.stroke = e : this.__isEmptyBrush ? (i.stroke = e, i.fill = t || "#fff") : (i.fill && (i.fill = e), i.stroke && (i.stroke = e)), this.dirty(!1)
            }
        }

        function cp(e, t, i, n, a, o, r) {
            var s, l = 0 === e.indexOf("empty");
            return l && (e = e.substr(5, 1).toLowerCase() + e.substr(6)), (s = 0 === e.indexOf("image://") ? As(e.slice(8), new Ai(t, i, n, a), r ? "center" : "cover") : 0 === e.indexOf("path://") ? _s(e.slice(7), {}, new Ai(t, i, n, a), r ? "center" : "cover") : new dp({
                shape: {
                    symbolType: e,
                    x: t,
                    y: i,
                    width: n,
                    height: a
                }
            })).__isEmptyBrush = l, s.setColor = up, s.setColor(o), s
        }

        var hp = {isDimensionStacked: ag, enableDataStack: ng, getStackedDimension: og},
            fp = (Object.freeze || Object)({
                createList: function (e) {
                    return rg(e.getSource(), e)
                }, getLayoutRect: vd, dataStack: hp, createScale: function (e, t) {
                    var i = t;
                    Sl.isInstance(t) || I(i = new Sl(t), ip);
                    var n = Jg(i);
                    return n.setExtent(e[0], e[1]), Yg(n, i), n
                }, mixinAxisModelCommonMethods: function (e) {
                    I(e, ip)
                }, completeDimensions: Zf, createDimensions: eg, createSymbol: cp
            }), gp = 1e-8;

        function pp(e, t) {
            return Math.abs(e - t) < gp
        }

        function vp(e, t, i) {
            var n = 0, a = e[0];
            if (!a) return !1;
            for (var o = 1; o < e.length; o++) {
                var r = e[o];
                n += lr(a[0], a[1], r[0], r[1], t, i), a = r
            }
            var s = e[0];
            return pp(a[0], s[0]) && pp(a[1], s[1]) || (n += lr(a[0], a[1], s[0], s[1], t, i)), 0 !== n
        }

        function mp(e, t, i) {
            if (this.name = e, this.geometries = t, i) i = [i[0], i[1]]; else {
                var n = this.getBoundingRect();
                i = [n.x + n.width / 2, n.y + n.height / 2]
            }
            this.center = i
        }

        function yp(e, t, i) {
            for (var n = [], a = t[0], o = t[1], r = 0; r < e.length; r += 2) {
                var s = e.charCodeAt(r) - 64, l = e.charCodeAt(r + 1) - 64;
                s = s >> 1 ^ -(1 & s), l = l >> 1 ^ -(1 & l), a = s += a, o = l += o, n.push([s / i, l / i])
            }
            return n
        }

        function kp(e, t) {
            return function (e) {
                if (e.UTF8Encoding) {
                    var t = e.UTF8Scale;
                    null == t && (t = 1024);
                    for (var i = e.features, n = 0; n < i.length; n++) for (var a = i[n].geometry, o = a.coordinates, r = a.encodeOffsets, s = 0; s < o.length; s++) {
                        var l = o[s];
                        if ("Polygon" === a.type) o[s] = yp(l, r[s], t); else if ("MultiPolygon" === a.type) for (var d = 0; d < l.length; d++) {
                            var u = l[d];
                            l[d] = yp(u, r[s][d], t)
                        }
                    }
                    e.UTF8Encoding = !1
                }
            }(e), D(N(e.features, function (e) {
                return e.geometry && e.properties && 0 < e.geometry.coordinates.length
            }), function (e) {
                var i = e.properties, n = e.geometry, a = n.coordinates, o = [];
                "Polygon" === n.type && o.push({
                    type: "polygon",
                    exterior: a[0],
                    interiors: a.slice(1)
                }), "MultiPolygon" === n.type && A(a, function (e) {
                    e[0] && o.push({type: "polygon", exterior: e[0], interiors: e.slice(1)})
                });
                var r = new mp(i[t || "name"], o, i.cp);
                return r.properties = i, r
            })
        }

        mp.prototype = {
            constructor: mp, properties: null, getBoundingRect: function () {
                var e = this._rect;
                if (e) return e;
                for (var t = Number.MAX_VALUE, i = [t, t], n = [-t, -t], a = [], o = [], r = this.geometries, s = 0; s < r.length; s++) "polygon" === r[s].type && (Lo(r[s].exterior, a, o), Se(i, i, a), be(n, n, o));
                return 0 === s && (i[0] = i[1] = n[0] = n[1] = 0), this._rect = new Ai(i[0], i[1], n[0] - i[0], n[1] - i[1])
            }, contain: function (e) {
                var t = this.getBoundingRect(), i = this.geometries;
                if (!t.contain(e[0], e[1])) return !1;
                e:for (var n = 0, a = i.length; n < a; n++) if ("polygon" === i[n].type) {
                    var o = i[n].exterior, r = i[n].interiors;
                    if (vp(o, e[0], e[1])) {
                        for (var s = 0; s < (r ? r.length : 0); s++) if (vp(r[s])) continue e;
                        return !0
                    }
                }
                return !1
            }, transformTo: function (e, t, i, n) {
                var a = this.getBoundingRect(), o = a.width / a.height;
                i ? n = n || i / o : i = o * n;
                for (var r = new Ai(e, t, i, n), s = a.calculateTransform(r), l = this.geometries, d = 0; d < l.length; d++) if ("polygon" === l[d].type) {
                    for (var u = l[d].exterior, c = l[d].interiors, h = 0; h < u.length; h++) Ce(u[h], u[h], s);
                    for (var f = 0; f < (c ? c.length : 0); f++) for (h = 0; h < c[f].length; h++) Ce(c[f][h], c[f][h], s)
                }
                (a = this._rect).copy(r), this.center = [a.x + a.width / 2, a.y + a.height / 2]
            }, cloneShallow: function (e) {
                null == e && (e = this.name);
                var t = new mp(e, this.geometries, this.center);
                return t._rect = this._rect, t.transformTo = null, t
            }
        };
        var Tp = Wa();

        function wp(e, t) {
            var i, n = Cp(e, "labels"), a = ep(t), o = Sp(n, a);
            return o || bp(n, a, {
                labels: F(a) ? _p(e, a) : Ip(e, i = "auto" === a ? function (e) {
                    var t = Tp(e).autoInterval;
                    return null != t ? t : Tp(e).autoInterval = e.calculateCategoryInterval()
                }(e) : a), labelCategoryInterval: i
            })
        }

        function Cp(e, t) {
            return Tp(e)[t] || (Tp(e)[t] = [])
        }

        function Sp(e, t) {
            for (var i = 0; i < e.length; i++) if (e[i].key === t) return e[i].value
        }

        function bp(e, t, i) {
            return e.push({key: t, value: i}), i
        }

        function Ip(e, t, i) {
            var n = Zg(e), a = e.scale, o = a.getExtent(), r = e.getLabelModel(), s = [], l = Math.max((t || 0) + 1, 1),
                d = o[0], u = a.count();
            0 !== d && 1 < l && 2 < u / l && (d = Math.round(Math.ceil(d / l) * l));
            var c = tp(e), h = r.get("showMinLabel") || c, f = r.get("showMaxLabel") || c;
            h && d !== o[0] && p(o[0]);
            for (var g = d; g <= o[1]; g += l) p(g);

            function p(e) {
                s.push(i ? e : {formattedLabel: n(e), rawLabel: a.getLabel(e), tickValue: e})
            }

            return f && g - l !== o[1] && p(o[1]), s
        }

        function _p(e, t, i) {
            var n = e.scale, a = Zg(e), o = [];
            return A(n.getTicks(), function (e) {
                var r = n.getLabel(e);
                t(e, r) && o.push(i ? e : {formattedLabel: a(e), rawLabel: r, tickValue: e})
            }), o
        }

        var Ap = [0, 1], Dp = function (e, t, i) {
            this.dim = e, this.scale = t, this._extent = i || [0, 0], this.inverse = !1, this.onBand = !1
        };

        function xp(e, t) {
            var i = (e[1] - e[0]) / t / 2;
            e[0] += i, e[1] -= i
        }

        Dp.prototype = {
            constructor: Dp, contain: function (e) {
                var t = this._extent, i = Math.min(t[0], t[1]), n = Math.max(t[0], t[1]);
                return i <= e && e <= n
            }, containData: function (e) {
                return this.scale.contain(e)
            }, getExtent: function () {
                return this._extent.slice()
            }, getPixelPrecision: function (e) {
                return Fl(e || this.scale.getExtent(), this._extent)
            }, setExtent: function (e, t) {
                var i = this._extent;
                i[0] = e, i[1] = t
            }, dataToCoord: function (e, t) {
                var i = this._extent, n = this.scale;
                return e = n.normalize(e), this.onBand && "ordinal" === n.type && xp(i = i.slice(), n.count()), xl(e, Ap, i, t)
            }, coordToData: function (e, t) {
                var i = this._extent, n = this.scale;
                this.onBand && "ordinal" === n.type && xp(i = i.slice(), n.count());
                var a = xl(e, i, Ap, t);
                return this.scale.scale(a)
            }, pointToData: function (e, t) {
            }, getTicksCoords: function (e) {
                var t = (e = e || {}).tickModel || this.getTickModel(), i = D(function (e, t) {
                    return "category" === e.type ? function (e, t) {
                        var i, n, a = Cp(e, "ticks"), o = ep(t), r = Sp(a, o);
                        if (r) return r;
                        if (t.get("show") && !e.scale.isBlank() || (i = []), F(o)) i = _p(e, o, !0); else if ("auto" === o) {
                            var s = wp(e, e.getLabelModel());
                            n = s.labelCategoryInterval, i = D(s.labels, function (e) {
                                return e.tickValue
                            })
                        } else i = Ip(e, n = o, !0);
                        return bp(a, o, {ticks: i, tickCategoryInterval: n})
                    }(e, t) : {ticks: e.scale.getTicks()}
                }(this, t).ticks, function (e) {
                    return {coord: this.dataToCoord(e), tickValue: e}
                }, this);
                return function (e, t, i, n) {
                    var a = t.length;
                    if (e.onBand && !i && a) {
                        var o, r, s = e.getExtent();
                        if (1 === a) t[0].coord = s[0], o = t[1] = {coord: s[0]}; else {
                            var l = t[a - 1].tickValue - t[0].tickValue, d = (t[a - 1].coord - t[0].coord) / l;
                            A(t, function (e) {
                                e.coord -= d / 2
                            });
                            var u = e.scale.getExtent();
                            r = 1 + u[1] - t[a - 1].tickValue, o = {coord: t[a - 1].coord + d * r}, t.push(o)
                        }
                        var c = s[0] > s[1];
                        h(t[0].coord, s[0]) && (n ? t[0].coord = s[0] : t.shift()), n && h(s[0], t[0].coord) && t.unshift({coord: s[0]}), h(s[1], o.coord) && (n ? o.coord = s[1] : t.pop()), n && h(o.coord, s[1]) && t.push({coord: s[1]})
                    }

                    function h(e, t) {
                        return e = El(e), t = El(t), c ? t < e : e < t
                    }
                }(this, i, t.get("alignWithLabel"), e.clamp), i
            }, getMinorTicksCoords: function () {
                if ("ordinal" === this.scale.type) return [];
                var e = this.model.getModel("minorTick").get("splitNumber");
                return 0 < e && e < 100 || (e = 5), D(this.scale.getMinorTicks(e), function (e) {
                    return D(e, function (e) {
                        return {coord: this.dataToCoord(e), tickValue: e}
                    }, this)
                }, this)
            }, getViewLabels: function () {
                return (e = this, "category" === e.type ? function (e) {
                    var t = e.getLabelModel(), i = wp(e, t);
                    return !t.get("show") || e.scale.isBlank() ? {
                        labels: [],
                        labelCategoryInterval: i.labelCategoryInterval
                    } : i
                }(e) : function (e) {
                    var t = e.scale.getTicks(), i = Zg(e);
                    return {
                        labels: D(t, function (t, n) {
                            return {formattedLabel: i(t, n), rawLabel: e.scale.getLabel(t), tickValue: t}
                        })
                    }
                }(e)).labels;
                var e
            }, getLabelModel: function () {
                return this.model.getModel("axisLabel")
            }, getTickModel: function () {
                return this.model.getModel("axisTick")
            }, getBandWidth: function () {
                var e = this._extent, t = this.scale.getExtent(), i = t[1] - t[0] + (this.onBand ? 1 : 0);
                0 === i && (i = 1);
                var n = Math.abs(e[1] - e[0]);
                return Math.abs(n) / i
            }, isHorizontal: null, getRotate: null, calculateCategoryInterval: function () {
                return function (e) {
                    var t = function (e) {
                            var t = e.getLabelModel();
                            return {
                                axisRotate: e.getRotate ? e.getRotate() : e.isHorizontal && !e.isHorizontal() ? 90 : 0,
                                labelRotate: t.get("rotate") || 0,
                                font: t.getFont()
                            }
                        }(e), i = Zg(e), n = (t.axisRotate - t.labelRotate) / 180 * Math.PI, a = e.scale, o = a.getExtent(),
                        r = a.count();
                    if (o[1] - o[0] < 1) return 0;
                    var s = 1;
                    40 < r && (s = Math.max(1, Math.floor(r / 40)));
                    for (var l = o[0], d = e.dataToCoord(l + 1) - e.dataToCoord(l), u = Math.abs(d * Math.cos(n)), c = Math.abs(d * Math.sin(n)), h = 0, f = 0; l <= o[1]; l += s) {
                        var g, p, v = cn(i(l), t.font, "center", "top");
                        g = 1.3 * v.width, p = 1.3 * v.height, h = Math.max(h, g, 7), f = Math.max(f, p, 7)
                    }
                    var m = h / u, y = f / c;
                    isNaN(m) && (m = 1 / 0), isNaN(y) && (y = 1 / 0);
                    var k = Math.max(0, Math.floor(Math.min(m, y))), T = Tp(e.model), w = e.getExtent(),
                        C = T.lastAutoInterval, S = T.lastTickCount;
                    return null != C && null != S && Math.abs(C - k) <= 1 && Math.abs(S - r) <= 1 && k < C && T.axisExtend0 === w[0] && T.axisExtend1 === w[1] ? k = C : (T.lastTickCount = r, T.lastAutoInterval = k, T.axisExtend0 = w[0], T.axisExtend1 = w[1]), k
                }(this)
            }
        };
        var Np = kp, Ep = {};
        A(["map", "each", "filter", "indexOf", "inherits", "reduce", "filter", "bind", "curry", "isArray", "isString", "isObject", "isFunction", "extend", "defaults", "clone", "merge"], function (e) {
            Ep[e] = ie[e]
        });
        var Pp = {};

        function Mp(e, t) {
            var i = e.mapDimension("defaultedLabel", !0), n = i.length;
            if (1 === n) return Lu(e, t, i[0]);
            if (n) {
                for (var a = [], o = 0; o < i.length; o++) {
                    var r = Lu(e, t, i[o]);
                    a.push(r)
                }
                return a.join(" ")
            }
        }

        function Op(e, t, i) {
            Di.call(this), this.updateData(e, t, i)
        }

        A(["extendShape", "extendPath", "makePath", "makeImage", "mergePath", "resizePath", "createIcon", "setHoverStyle", "setLabelStyle", "setTextStyle", "setText", "getFont", "updateProps", "initProps", "getTransform", "clipPointsByRect", "clipRectByRect", "registerShape", "getShapeClass", "Group", "Image", "Text", "Circle", "Sector", "Ring", "Polygon", "Polyline", "Rect", "Line", "BezierCurve", "Arc", "IncrementalDisplayable", "CompoundPath", "LinearGradient", "RadialGradient", "BoundingRect"], function (e) {
            Pp[e] = vl[e]
        }), ec.extend({
            type: "series.line",
            dependencies: ["grid", "polar"],
            getInitialData: function (e, t) {
                return rg(this.getSource(), this, {useEncodeDefaulter: !0})
            },
            defaultOption: {
                zlevel: 0,
                z: 2,
                coordinateSystem: "cartesian2d",
                legendHoverLink: !0,
                hoverAnimation: !0,
                clip: !0,
                label: {position: "top"},
                lineStyle: {width: 2, type: "solid"},
                step: !1,
                smooth: !1,
                smoothMonotone: null,
                symbol: "emptyCircle",
                symbolSize: 4,
                symbolRotate: null,
                showSymbol: !0,
                showAllSymbol: "auto",
                connectNulls: !1,
                sampling: "none",
                animationEasing: "linear",
                progressive: 0,
                hoverLayerThreshold: 1 / 0
            }
        });
        var Fp = Op.prototype, Lp = Op.getSymbolSize = function (e, t) {
            var i = e.getItemVisual(t, "symbolSize");
            return i instanceof Array ? i.slice() : [+i, +i]
        };

        function Bp(e) {
            return [e[0] / 2, e[1] / 2]
        }

        function Up(e, t) {
            this.parent.drift(e, t)
        }

        Fp._createSymbol = function (e, t, i, n, a) {
            this.removeAll();
            var o = cp(e, -1, -1, 2, 2, t.getItemVisual(i, "color"), a);
            o.attr({z2: 100, culling: !0, scale: Bp(n)}), o.drift = Up, this._symbolType = e, this.add(o)
        }, Fp.stopSymbolAnimation = function (e) {
            this.childAt(0).stopAnimation(e)
        }, Fp.getSymbolPath = function () {
            return this.childAt(0)
        }, Fp.getScale = function () {
            return this.childAt(0).scale
        }, Fp.highlight = function () {
            this.childAt(0).trigger("emphasis")
        }, Fp.downplay = function () {
            this.childAt(0).trigger("normal")
        }, Fp.setZ = function (e, t) {
            var i = this.childAt(0);
            i.zlevel = e, i.z = t
        }, Fp.setDraggable = function (e) {
            var t = this.childAt(0);
            t.draggable = e, t.cursor = e ? "move" : t.cursor
        }, Fp.updateData = function (e, t, i) {
            this.silent = !1;
            var n = e.getItemVisual(t, "symbol") || "circle", a = e.hostModel, o = Lp(e, t), r = n !== this._symbolType;
            if (r) {
                var s = e.getItemVisual(t, "symbolKeepAspect");
                this._createSymbol(n, e, t, o, s)
            } else (l = this.childAt(0)).silent = !1, ol(l, {scale: Bp(o)}, a, t);
            if (this._updateCommon(e, t, o, i), r) {
                var l = this.childAt(0), d = i && i.fadeIn, u = {scale: l.scale.slice()};
                d && (u.style = {opacity: l.style.opacity}), l.scale = [0, 0], d && (l.style.opacity = 0), rl(l, u, a, t)
            }
            this._seriesModel = a
        };
        var Rp = ["itemStyle"], Kp = ["emphasis", "itemStyle"], Wp = ["label"], Vp = ["emphasis", "label"];

        function Hp(e, t) {
            if (!this.incremental && !this.useHoverLayer) if ("emphasis" === t) {
                var i = this.__symbolOriginalScale, n = i[1] / i[0],
                    a = {scale: [Math.max(1.1 * i[0], i[0] + 3), Math.max(1.1 * i[1], i[1] + 3 * n)]};
                this.animateTo(a, 400, "elasticOut")
            } else "normal" === t && this.animateTo({scale: this.__symbolOriginalScale}, 400, "elasticOut")
        }

        function zp(e) {
            this.group = new Di, this._symbolCtor = e || Op
        }

        Fp._updateCommon = function (e, t, i, n) {
            var a = this.childAt(0), o = e.hostModel, r = e.getItemVisual(t, "color");
            "image" !== a.type ? a.useStyle({strokeNoScale: !0}) : a.setStyle({
                opacity: null,
                shadowBlur: null,
                shadowOffsetX: null,
                shadowOffsetY: null,
                shadowColor: null
            });
            var s = n && n.itemStyle, l = n && n.hoverItemStyle, d = n && n.symbolOffset, u = n && n.labelModel,
                c = n && n.hoverLabelModel, h = n && n.hoverAnimation, f = n && n.cursorStyle;
            if (!n || e.hasItemOption) {
                var g = n && n.itemModel ? n.itemModel : e.getItemModel(t);
                s = g.getModel(Rp).getItemStyle(["color"]), l = g.getModel(Kp).getItemStyle(), d = g.getShallow("symbolOffset"), u = g.getModel(Wp), c = g.getModel(Vp), h = g.getShallow("hoverAnimation"), f = g.getShallow("cursor")
            } else l = k({}, l);
            var p = a.style, v = e.getItemVisual(t, "symbolRotate");
            a.attr("rotation", (v || 0) * Math.PI / 180 || 0), d && a.attr("position", [Nl(d[0], i[0]), Nl(d[1], i[1])]), f && a.attr("cursor", f), a.setColor(r, n && n.symbolInnerColor), a.setStyle(s);
            var m = e.getItemVisual(t, "opacity");
            null != m && (p.opacity = m);
            var y = e.getItemVisual(t, "liftZ"), T = a.__z2Origin;
            null != y ? null == T && (a.__z2Origin = a.z2, a.z2 += y) : null != T && (a.z2 = T, a.__z2Origin = null);
            var w = n && n.useNameLabel;
            qs(p, l, u, c, {
                labelFetcher: o, labelDataIndex: t, defaultText: function (t, i) {
                    return w ? e.getName(t) : Mp(e, t)
                }, isRectText: !0, autoColor: r
            }), a.__symbolOriginalScale = Bp(i), a.hoverStyle = l, a.highDownOnUpdate = h && o.isAnimationEnabled() ? Hp : null, js(a)
        }, Fp.fadeOut = function (e, t) {
            var i = this.childAt(0);
            this.silent = i.silent = !0, t && t.keepLabel || (i.style.text = null), ol(i, {
                style: {opacity: 0},
                scale: [0, 0]
            }, this._seriesModel, this.dataIndex, e)
        }, b(Op, Di);
        var jp = zp.prototype;

        function Gp(e, t, i, n) {
            return t && !isNaN(t[0]) && !isNaN(t[1]) && !(n.isIgnore && n.isIgnore(i)) && !(n.clipShape && !n.clipShape.contain(t[0], t[1])) && "none" !== e.getItemVisual(i, "symbol")
        }

        function $p(e) {
            return null == e || B(e) || (e = {isIgnore: e}), e || {}
        }

        function Xp(e) {
            var t = e.hostModel;
            return {
                itemStyle: t.getModel("itemStyle").getItemStyle(["color"]),
                hoverItemStyle: t.getModel("emphasis.itemStyle").getItemStyle(),
                symbolRotate: t.get("symbolRotate"),
                symbolOffset: t.get("symbolOffset"),
                hoverAnimation: t.get("hoverAnimation"),
                labelModel: t.getModel("label"),
                hoverLabelModel: t.getModel("emphasis.label"),
                cursorStyle: t.get("cursor")
            }
        }

        function qp(e, t, i) {
            var n, a = e.getBaseAxis(), o = e.getOtherAxis(a), r = function (e, t) {
                    var i = 0, n = e.scale.getExtent();
                    return "start" === t ? i = n[0] : "end" === t ? i = n[1] : 0 < n[0] ? i = n[0] : n[1] < 0 && (i = n[1]), i
                }(o, i), s = a.dim, l = o.dim, d = t.mapDimension(l), u = t.mapDimension(s),
                c = "x" === l || "radius" === l ? 1 : 0, h = D(e.dimensions, function (e) {
                    return t.mapDimension(e)
                }), f = t.getCalculationInfo("stackResultDimension");
            return (n |= ag(t, h[0])) && (h[0] = f), (n |= ag(t, h[1])) && (h[1] = f), {
                dataDimsForPoint: h,
                valueStart: r,
                valueAxisDim: l,
                baseAxisDim: s,
                stacked: !!n,
                valueDim: d,
                baseDim: u,
                baseDataOffset: c,
                stackedOverDimension: t.getCalculationInfo("stackedOverDimension")
            }
        }

        function Yp(e, t, i, n) {
            var a = NaN;
            e.stacked && (a = i.get(i.getCalculationInfo("stackedOverDimension"), n)), isNaN(a) && (a = e.valueStart);
            var o = e.baseDataOffset, r = [];
            return r[o] = i.get(e.baseDim, n), r[1 - o] = a, t.dataToPoint(r)
        }

        jp.updateData = function (e, t) {
            t = $p(t);
            var i = this.group, n = e.hostModel, a = this._data, o = this._symbolCtor, r = Xp(e);
            a || i.removeAll(), e.diff(a).add(function (n) {
                var a = e.getItemLayout(n);
                if (Gp(e, a, n, t)) {
                    var s = new o(e, n, r);
                    s.attr("position", a), e.setItemGraphicEl(n, s), i.add(s)
                }
            }).update(function (s, l) {
                var d = a.getItemGraphicEl(l), u = e.getItemLayout(s);
                Gp(e, u, s, t) ? (d ? (d.updateData(e, s, r), ol(d, {position: u}, n)) : (d = new o(e, s)).attr("position", u), i.add(d), e.setItemGraphicEl(s, d)) : i.remove(d)
            }).remove(function (e) {
                var t = a.getItemGraphicEl(e);
                t && t.fadeOut(function () {
                    i.remove(t)
                })
            }).execute(), this._data = e
        }, jp.isPersistent = function () {
            return !0
        }, jp.updateLayout = function () {
            var e = this._data;
            e && e.eachItemGraphicEl(function (t, i) {
                var n = e.getItemLayout(i);
                t.attr("position", n)
            })
        }, jp.incrementalPrepareUpdate = function (e) {
            this._seriesScope = Xp(e), this._data = null, this.group.removeAll()
        }, jp.incrementalUpdate = function (e, t, i) {
            function n(e) {
                e.isGroup || (e.incremental = e.useHoverLayer = !0)
            }

            i = $p(i);
            for (var a = e.start; a < e.end; a++) {
                var o = t.getItemLayout(a);
                if (Gp(t, o, a, i)) {
                    var r = new this._symbolCtor(t, a, this._seriesScope);
                    r.traverse(n), r.attr("position", o), this.group.add(r), t.setItemGraphicEl(a, r)
                }
            }
        }, jp.remove = function (e) {
            var t = this.group, i = this._data;
            i && e ? i.eachItemGraphicEl(function (e) {
                e.fadeOut(function () {
                    t.remove(e)
                })
            }) : t.removeAll()
        };
        var Jp = Se, Zp = be, Qp = de, ev = oe, tv = [], iv = [], nv = [];

        function av(e) {
            return isNaN(e[0]) || isNaN(e[1])
        }

        function ov(e, t, i, n, a, o, r, s, l, d) {
            return "none" !== d && d ? function (e, t, i, n, a, o, r, s, l, d, u) {
                for (var c = 0, h = i, f = 0; f < n; f++) {
                    var g = t[h];
                    if (a <= h || h < 0) break;
                    if (av(g)) {
                        if (u) {
                            h += o;
                            continue
                        }
                        break
                    }
                    if (h === i) e[0 < o ? "moveTo" : "lineTo"](g[0], g[1]); else if (0 < l) {
                        var p = t[c], v = "y" === d ? 1 : 0, m = (g[v] - p[v]) * l;
                        ev(iv, p), iv[v] = p[v] + m, ev(nv, g), nv[v] = g[v] - m, e.bezierCurveTo(iv[0], iv[1], nv[0], nv[1], g[0], g[1])
                    } else e.lineTo(g[0], g[1]);
                    c = h, h += o
                }
                return f
            }.apply(this, arguments) : function (e, t, i, n, a, o, r, s, l, d, u) {
                for (var c = 0, h = i, f = 0; f < n; f++) {
                    var g = t[h];
                    if (a <= h || h < 0) break;
                    if (av(g)) {
                        if (u) {
                            h += o;
                            continue
                        }
                        break
                    }
                    if (h === i) e[0 < o ? "moveTo" : "lineTo"](g[0], g[1]), ev(iv, g); else if (0 < l) {
                        var p = h + o, v = t[p];
                        if (u) for (; v && av(t[p]);) v = t[p += o];
                        var m = .5, y = t[c];
                        if (!(v = t[p]) || av(v)) ev(nv, g); else {
                            var k, T;
                            if (av(v) && !u && (v = g), ue(tv, v, y), "x" === d || "y" === d) {
                                var w = "x" === d ? 0 : 1;
                                k = Math.abs(g[w] - y[w]), T = Math.abs(g[w] - v[w])
                            } else k = ye(g, y), T = ye(g, v);
                            Qp(nv, g, tv, -l * (1 - (m = T / (T + k))))
                        }
                        Jp(iv, iv, s), Zp(iv, iv, r), Jp(nv, nv, s), Zp(nv, nv, r), e.bezierCurveTo(iv[0], iv[1], nv[0], nv[1], g[0], g[1]), Qp(iv, g, tv, l * m)
                    } else e.lineTo(g[0], g[1]);
                    c = h, h += o
                }
                return f
            }.apply(this, arguments)
        }

        function rv(e, t) {
            var i = [1 / 0, 1 / 0], n = [-1 / 0, -1 / 0];
            if (t) for (var a = 0; a < e.length; a++) {
                var o = e[a];
                o[0] < i[0] && (i[0] = o[0]), o[1] < i[1] && (i[1] = o[1]), o[0] > n[0] && (n[0] = o[0]), o[1] > n[1] && (n[1] = o[1])
            }
            return {min: t ? i : n, max: t ? n : i}
        }

        var sv = wr.extend({
            type: "ec-polyline",
            shape: {points: [], smooth: 0, smoothConstraint: !0, smoothMonotone: null, connectNulls: !1},
            style: {fill: null, stroke: "#000"},
            brush: Kr(wr.prototype.brush),
            buildPath: function (e, t) {
                var i = t.points, n = 0, a = i.length, o = rv(i, t.smoothConstraint);
                if (t.connectNulls) {
                    for (; 0 < a && av(i[a - 1]); a--) ;
                    for (; n < a && av(i[n]); n++) ;
                }
                for (; n < a;) n += ov(e, i, n, a, a, 1, o.min, o.max, t.smooth, t.smoothMonotone, t.connectNulls) + 1
            }
        }), lv = wr.extend({
            type: "ec-polygon",
            shape: {
                points: [],
                stackedOnPoints: [],
                smooth: 0,
                stackedOnSmooth: 0,
                smoothConstraint: !0,
                smoothMonotone: null,
                connectNulls: !1
            },
            brush: Kr(wr.prototype.brush),
            buildPath: function (e, t) {
                var i = t.points, n = t.stackedOnPoints, a = 0, o = i.length, r = t.smoothMonotone,
                    s = rv(i, t.smoothConstraint), l = rv(n, t.smoothConstraint);
                if (t.connectNulls) {
                    for (; 0 < o && av(i[o - 1]); o--) ;
                    for (; a < o && av(i[a]); a++) ;
                }
                for (; a < o;) {
                    var d = ov(e, i, a, o, o, 1, s.min, s.max, t.smooth, r, t.connectNulls);
                    ov(e, n, a + d - 1, d, o, -1, l.min, l.max, t.stackedOnSmooth, r, t.connectNulls), a += d + 1, e.closePath()
                }
            }
        });

        function dv(e, t, i) {
            var n = e.getArea(), a = e.getBaseAxis().isHorizontal(), o = n.x, r = n.y, s = n.width, l = n.height,
                d = i.get("lineStyle.width") || 2;
            o -= d / 2, r -= d / 2, s += d, l += d, o = Math.floor(o), s = Math.round(s);
            var u = new es({shape: {x: o, y: r, width: s, height: l}});
            return t && (u.shape[a ? "width" : "height"] = 0, rl(u, {shape: {width: s, height: l}}, i)), u
        }

        function uv(e, t, i) {
            var n = e.getArea(), a = new Hr({
                shape: {
                    cx: El(e.cx, 1),
                    cy: El(e.cy, 1),
                    r0: El(n.r0, 1),
                    r: El(n.r, 1),
                    startAngle: n.startAngle,
                    endAngle: n.endAngle,
                    clockwise: n.clockwise
                }
            });
            return t && (a.shape.endAngle = n.startAngle, rl(a, {shape: {endAngle: n.endAngle}}, i)), a
        }

        function cv(e, t, i) {
            return e ? "polar" === e.type ? uv(e, t, i) : "cartesian2d" === e.type ? dv(e, t, i) : null : null
        }

        function hv(e, t) {
            if (e.length === t.length) {
                for (var i = 0; i < e.length; i++) {
                    var n = e[i], a = t[i];
                    if (n[0] !== a[0] || n[1] !== a[1]) return
                }
                return !0
            }
        }

        function fv(e, t) {
            var i = [], n = [], a = [], o = [];
            return Lo(e, i, n), Lo(t, a, o), Math.max(Math.abs(i[0] - a[0]), Math.abs(i[1] - a[1]), Math.abs(n[0] - o[0]), Math.abs(n[1] - o[1]))
        }

        function gv(e) {
            return "number" == typeof e ? e : e ? .5 : 0
        }

        function pv(e, t, i) {
            for (var n = t.getBaseAxis(), a = "x" === n.dim || "radius" === n.dim ? 0 : 1, o = [], r = 0; r < e.length - 1; r++) {
                var s = e[r + 1], l = e[r];
                o.push(l);
                var d = [];
                switch (i) {
                    case"end":
                        d[a] = s[a], d[1 - a] = l[1 - a], o.push(d);
                        break;
                    case"middle":
                        var u = (l[a] + s[a]) / 2, c = [];
                        d[a] = c[a] = u, d[1 - a] = l[1 - a], c[1 - a] = s[1 - a], o.push(d), o.push(c);
                        break;
                    default:
                        d[a] = l[a], d[1 - a] = s[1 - a], o.push(d)
                }
            }
            return e[r] && o.push(e[r]), o
        }

        function vv(e, t, i) {
            if ("cartesian2d" !== e.type) return uv(e, t, i);
            var n = e.getBaseAxis().isHorizontal(), a = dv(e, t, i);
            if (!i.get("clip", !0)) {
                var o = a.shape, r = Math.max(o.width, o.height);
                n ? (o.y -= r, o.height += 2 * r) : (o.x -= r, o.width += 2 * r)
            }
            return a
        }

        function mv(e, t, i) {
            return {
                seriesType: e, performRawSeries: !0, reset: function (e, n, a) {
                    var o = e.getData(), r = e.get("symbol"), s = e.get("symbolSize"), l = e.get("symbolKeepAspect"),
                        d = e.get("symbolRotate"), u = F(r), c = F(s), h = F(d), f = u || c || h, g = !u && r ? r : t,
                        p = c ? null : s;
                    if (o.setVisual({
                        legendSymbol: i || g,
                        symbol: g,
                        symbolSize: p,
                        symbolKeepAspect: l,
                        symbolRotate: d
                    }), !n.isSeriesFiltered(e)) return {
                        dataEach: o.hasItemOption || f ? function (t, i) {
                            if (f) {
                                var n = e.getRawValue(i), a = e.getDataParams(i);
                                u && t.setItemVisual(i, "symbol", r(n, a)), c && t.setItemVisual(i, "symbolSize", s(n, a)), h && t.setItemVisual(i, "symbolRotate", d(n, a))
                            }
                            if (t.hasItemOption) {
                                var o = t.getItemModel(i), l = o.getShallow("symbol", !0),
                                    g = o.getShallow("symbolSize", !0), p = o.getShallow("symbolRotate", !0),
                                    v = o.getShallow("symbolKeepAspect", !0);
                                null != l && t.setItemVisual(i, "symbol", l), null != g && t.setItemVisual(i, "symbolSize", g), null != p && t.setItemVisual(i, "symbolRotate", p), null != v && t.setItemVisual(i, "symbolKeepAspect", v)
                            }
                        } : null
                    }
                }
            }
        }

        function yv(e) {
            return {
                seriesType: e, plan: uc(), reset: function (e) {
                    var t = e.getData(), i = e.coordinateSystem, n = e.pipelineContext.large;
                    if (i) {
                        var a = D(i.dimensions, function (e) {
                            return t.mapDimension(e)
                        }).slice(0, 2), o = a.length, r = t.getCalculationInfo("stackResultDimension");
                        return ag(t, a[0]) && (a[0] = r), ag(t, a[1]) && (a[1] = r), o && {
                            progress: function (e, t) {
                                for (var r = e.end - e.start, s = n && new Float32Array(r * o), l = e.start, d = 0, u = [], c = []; l < e.end; l++) {
                                    var h;
                                    if (1 === o) {
                                        var f = t.get(a[0], l);
                                        h = !isNaN(f) && i.dataToPoint(f, null, c)
                                    } else {
                                        f = u[0] = t.get(a[0], l);
                                        var g = u[1] = t.get(a[1], l);
                                        h = !isNaN(f) && !isNaN(g) && i.dataToPoint(u, null, c)
                                    }
                                    n ? (s[d++] = h ? h[0] : NaN, s[d++] = h ? h[1] : NaN) : t.setItemLayout(l, h && h.slice() || [NaN, NaN])
                                }
                                n && t.setLayout("symbolPoints", s)
                            }
                        }
                    }
                }
            }
        }

        function kv(e, t) {
            return Math.round(e.length / 2)
        }

        fc.extend({
            type: "line", init: function () {
                var e = new Di, t = new zp;
                this.group.add(t.group), this._symbolDraw = t, this._lineGroup = e
            }, render: function (e, t, i) {
                var n = e.coordinateSystem, a = this.group, o = e.getData(), r = e.getModel("lineStyle"),
                    s = e.getModel("areaStyle"), l = o.mapArray(o.getItemLayout), d = "polar" === n.type,
                    u = this._coordSys, c = this._symbolDraw, h = this._polyline, f = this._polygon,
                    g = this._lineGroup, p = e.get("animation"), v = !s.isEmpty(), m = s.get("origin"),
                    y = function (e, t, i) {
                        if (!i.valueDim) return [];
                        for (var n = [], a = 0, o = t.count(); a < o; a++) n.push(Yp(i, e, t, a));
                        return n
                    }(n, o, qp(n, o, m)), k = e.get("showSymbol"), w = k && !d && function (e, t, i) {
                        var n = e.get("showAllSymbol"), a = "auto" === n;
                        if (!n || a) {
                            var o = i.getAxesByScale("ordinal")[0];
                            if (o && (!a || !function (e, t) {
                                var i = e.getExtent(), n = Math.abs(i[1] - i[0]) / e.scale.count();
                                isNaN(n) && (n = 0);
                                for (var a = t.count(), o = Math.max(1, Math.round(a / 5)), r = 0; r < a; r += o) if (1.5 * Op.getSymbolSize(t, r)[e.isHorizontal() ? 1 : 0] > n) return !1;
                                return !0
                            }(o, t))) {
                                var r = t.mapDimension(o.dim), s = {};
                                return A(o.getViewLabels(), function (e) {
                                    s[e.tickValue] = 1
                                }), function (e) {
                                    return !s.hasOwnProperty(t.get(r, e))
                                }
                            }
                        }
                    }(e, o, n), C = this._data;
                C && C.eachItemGraphicEl(function (e, t) {
                    e.__temp && (a.remove(e), C.setItemGraphicEl(t, null))
                }), k || c.remove(), a.add(g);
                var S, b = !d && e.get("step");
                n && n.getArea && e.get("clip", !0) && (null != (S = n.getArea()).width ? (S.x -= .1, S.y -= .1, S.width += .2, S.height += .2) : S.r0 && (S.r0 -= .5, S.r1 += .5)), this._clipShapeForSymbol = S, h && u.type === n.type && b === this._step ? (v && !f ? f = this._newPolygon(l, y, n, p) : f && !v && (g.remove(f), f = this._polygon = null), g.setClipPath(vv(n, !1, e)), k && c.updateData(o, {
                    isIgnore: w,
                    clipShape: S
                }), o.eachItemGraphicEl(function (e) {
                    e.stopAnimation(!0)
                }), hv(this._stackedOnPoints, y) && hv(this._points, l) || (p ? this._updateAnimation(o, y, n, i, b, m) : (b && (l = pv(l, n, b), y = pv(y, n, b)), h.setShape({points: l}), f && f.setShape({
                    points: l,
                    stackedOnPoints: y
                })))) : (k && c.updateData(o, {
                    isIgnore: w,
                    clipShape: S
                }), b && (l = pv(l, n, b), y = pv(y, n, b)), h = this._newPolyline(l, n, p), v && (f = this._newPolygon(l, y, n, p)), g.setClipPath(vv(n, !0, e)));
                var I = function (e, t) {
                    var i = e.getVisual("visualMeta");
                    if (i && i.length && e.count() && "cartesian2d" === t.type) {
                        for (var n, a, o = i.length - 1; 0 <= o; o--) {
                            var r = i[o].dimension, s = e.dimensions[r], l = e.getDimensionInfo(s);
                            if ("x" === (n = l && l.coordDim) || "y" === n) {
                                a = i[o];
                                break
                            }
                        }
                        if (a) {
                            var d = t.getAxis(n), u = D(a.stops, function (e) {
                                return {coord: d.toGlobalCoord(d.dataToCoord(e.value)), color: e.color}
                            }), c = u.length, h = a.outerColors.slice();
                            c && u[0].coord > u[c - 1].coord && (u.reverse(), h.reverse());
                            var f = u[0].coord - 10, g = u[c - 1].coord + 10, p = g - f;
                            if (p < .001) return "transparent";
                            A(u, function (e) {
                                e.offset = (e.coord - f) / p
                            }), u.push({
                                offset: c ? u[c - 1].offset : .5,
                                color: h[1] || "transparent"
                            }), u.unshift({offset: c ? u[0].offset : .5, color: h[0] || "transparent"});
                            var v = new ds(0, 0, 0, 0, u, !0);
                            return v[n] = f, v[n + "2"] = g, v
                        }
                    }
                }(o, n) || o.getVisual("color");
                h.useStyle(T(r.getLineStyle(), {fill: "none", stroke: I, lineJoin: "bevel"}));
                var _ = e.get("smooth");
                if (_ = gv(e.get("smooth")), h.setShape({
                    smooth: _,
                    smoothMonotone: e.get("smoothMonotone"),
                    connectNulls: e.get("connectNulls")
                }), f) {
                    var x = o.getCalculationInfo("stackedOnSeries"), N = 0;
                    f.useStyle(T(s.getAreaStyle(), {
                        fill: I,
                        opacity: .7,
                        lineJoin: "bevel"
                    })), x && (N = gv(x.get("smooth"))), f.setShape({
                        smooth: _,
                        stackedOnSmooth: N,
                        smoothMonotone: e.get("smoothMonotone"),
                        connectNulls: e.get("connectNulls")
                    })
                }
                this._data = o, this._coordSys = n, this._stackedOnPoints = y, this._points = l, this._step = b, this._valueOrigin = m
            }, dispose: function () {
            }, highlight: function (e, t, i, n) {
                var a = e.getData(), o = Ka(a, n);
                if (!(o instanceof Array) && null != o && 0 <= o) {
                    var r = a.getItemGraphicEl(o);
                    if (!r) {
                        var s = a.getItemLayout(o);
                        if (!s) return;
                        if (this._clipShapeForSymbol && !this._clipShapeForSymbol.contain(s[0], s[1])) return;
                        (r = new Op(a, o)).position = s, r.setZ(e.get("zlevel"), e.get("z")), r.ignore = isNaN(s[0]) || isNaN(s[1]), r.__temp = !0, a.setItemGraphicEl(o, r), r.stopSymbolAnimation(!0), this.group.add(r)
                    }
                    r.highlight()
                } else fc.prototype.highlight.call(this, e, t, i, n)
            }, downplay: function (e, t, i, n) {
                var a = e.getData(), o = Ka(a, n);
                if (null != o && 0 <= o) {
                    var r = a.getItemGraphicEl(o);
                    r && (r.__temp ? (a.setItemGraphicEl(o, null), this.group.remove(r)) : r.downplay())
                } else fc.prototype.downplay.call(this, e, t, i, n)
            }, _newPolyline: function (e) {
                var t = this._polyline;
                return t && this._lineGroup.remove(t), t = new sv({
                    shape: {points: e},
                    silent: !0,
                    z2: 10
                }), this._lineGroup.add(t), this._polyline = t
            }, _newPolygon: function (e, t) {
                var i = this._polygon;
                return i && this._lineGroup.remove(i), i = new lv({
                    shape: {points: e, stackedOnPoints: t},
                    silent: !0
                }), this._lineGroup.add(i), this._polygon = i
            }, _updateAnimation: function (e, t, i, n, a, o) {
                var r = this._polyline, s = this._polygon, l = e.hostModel, d = function (e, t, i, n, a, o, r, s) {
                        for (var l = function (e, t) {
                            var i = [];
                            return t.diff(e).add(function (e) {
                                i.push({cmd: "+", idx: e})
                            }).update(function (e, t) {
                                i.push({cmd: "=", idx: t, idx1: e})
                            }).remove(function (e) {
                                i.push({cmd: "-", idx: e})
                            }).execute(), i
                        }(e, t), d = [], u = [], c = [], h = [], f = [], g = [], p = [], v = qp(a, t, r), m = qp(o, e, s), y = 0; y < l.length; y++) {
                            var k = l[y], T = !0;
                            switch (k.cmd) {
                                case"=":
                                    var w = e.getItemLayout(k.idx), C = t.getItemLayout(k.idx1);
                                    (isNaN(w[0]) || isNaN(w[1])) && (w = C.slice()), d.push(w), u.push(C), c.push(i[k.idx]), h.push(n[k.idx1]), p.push(t.getRawIndex(k.idx1));
                                    break;
                                case"+":
                                    var S = k.idx;
                                    d.push(a.dataToPoint([t.get(v.dataDimsForPoint[0], S), t.get(v.dataDimsForPoint[1], S)])), u.push(t.getItemLayout(S).slice()), c.push(Yp(v, a, t, S)), h.push(n[S]), p.push(t.getRawIndex(S));
                                    break;
                                case"-":
                                    S = k.idx;
                                    var b = e.getRawIndex(S);
                                    b !== S ? (d.push(e.getItemLayout(S)), u.push(o.dataToPoint([e.get(m.dataDimsForPoint[0], S), e.get(m.dataDimsForPoint[1], S)])), c.push(i[S]), h.push(Yp(m, o, e, S)), p.push(b)) : T = !1
                            }
                            T && (f.push(k), g.push(g.length))
                        }
                        g.sort(function (e, t) {
                            return p[e] - p[t]
                        });
                        var I = [], _ = [], A = [], D = [], x = [];
                        for (y = 0; y < g.length; y++) S = g[y], I[y] = d[S], _[y] = u[S], A[y] = c[S], D[y] = h[S], x[y] = f[S];
                        return {current: I, next: _, stackedOnCurrent: A, stackedOnNext: D, status: x}
                    }(this._data, e, this._stackedOnPoints, t, this._coordSys, i, this._valueOrigin, o), u = d.current,
                    c = d.stackedOnCurrent, h = d.next, f = d.stackedOnNext;
                if (a && (u = pv(d.current, i, a), c = pv(d.stackedOnCurrent, i, a), h = pv(d.next, i, a), f = pv(d.stackedOnNext, i, a)), 3e3 < fv(u, h) || s && 3e3 < fv(c, f)) return r.setShape({points: h}), void (s && s.setShape({
                    points: h,
                    stackedOnPoints: f
                }));
                r.shape.__points = d.current, r.shape.points = u, ol(r, {shape: {points: h}}, l), s && (s.setShape({
                    points: u,
                    stackedOnPoints: c
                }), ol(s, {shape: {points: h, stackedOnPoints: f}}, l));
                for (var g = [], p = d.status, v = 0; v < p.length; v++) if ("=" === p[v].cmd) {
                    var m = e.getItemGraphicEl(p[v].idx1);
                    m && g.push({el: m, ptIdx: v})
                }
                r.animators && r.animators.length && r.animators[0].during(function () {
                    for (var e = 0; e < g.length; e++) g[e].el.attr("position", r.shape.__points[g[e].ptIdx])
                })
            }, remove: function (e) {
                var t = this.group, i = this._data;
                this._lineGroup.removeAll(), this._symbolDraw.remove(!0), i && i.eachItemGraphicEl(function (e, n) {
                    e.__temp && (t.remove(e), i.setItemGraphicEl(n, null))
                }), this._polyline = this._polygon = this._coordSys = this._points = this._stackedOnPoints = this._data = null
            }
        });
        var Tv = {
            average: function (e) {
                for (var t = 0, i = 0, n = 0; n < e.length; n++) isNaN(e[n]) || (t += e[n], i++);
                return 0 === i ? NaN : t / i
            }, sum: function (e) {
                for (var t = 0, i = 0; i < e.length; i++) t += e[i] || 0;
                return t
            }, max: function (e) {
                for (var t = -1 / 0, i = 0; i < e.length; i++) e[i] > t && (t = e[i]);
                return isFinite(t) ? t : NaN
            }, min: function (e) {
                for (var t = 1 / 0, i = 0; i < e.length; i++) e[i] < t && (t = e[i]);
                return isFinite(t) ? t : NaN
            }, nearest: function (e) {
                return e[0]
            }
        };

        function wv(e) {
            return this._axes[e]
        }

        function Cv(e) {
            this._axes = {}, this._dimList = [], this.name = e || ""
        }

        function Sv(e) {
            Cv.call(this, e)
        }

        function bv(e, t, i, n, a) {
            Dp.call(this, e, t, i), this.type = n || "value", this.position = a || "bottom"
        }

        Cv.prototype = {
            constructor: Cv, type: "cartesian", getAxis: function (e) {
                return this._axes[e]
            }, getAxes: function () {
                return D(this._dimList, wv, this)
            }, getAxesByScale: function (e) {
                return e = e.toLowerCase(), N(this.getAxes(), function (t) {
                    return t.scale.type === e
                })
            }, addAxis: function (e) {
                var t = e.dim;
                this._axes[t] = e, this._dimList.push(t)
            }, dataToCoord: function (e) {
                return this._dataCoordConvert(e, "dataToCoord")
            }, coordToData: function (e) {
                return this._dataCoordConvert(e, "coordToData")
            }, _dataCoordConvert: function (e, t) {
                for (var i = this._dimList, n = e instanceof Array ? [] : {}, a = 0; a < i.length; a++) {
                    var o = i[a], r = this._axes[o];
                    n[o] = r[t](e[o])
                }
                return n
            }
        }, Sv.prototype = {
            constructor: Sv, type: "cartesian2d", dimensions: ["x", "y"], getBaseAxis: function () {
                return this.getAxesByScale("ordinal")[0] || this.getAxesByScale("time")[0] || this.getAxis("x")
            }, containPoint: function (e) {
                var t = this.getAxis("x"), i = this.getAxis("y");
                return t.contain(t.toLocalCoord(e[0])) && i.contain(i.toLocalCoord(e[1]))
            }, containData: function (e) {
                return this.getAxis("x").containData(e[0]) && this.getAxis("y").containData(e[1])
            }, dataToPoint: function (e, t, i) {
                var n = this.getAxis("x"), a = this.getAxis("y");
                return (i = i || [])[0] = n.toGlobalCoord(n.dataToCoord(e[0])), i[1] = a.toGlobalCoord(a.dataToCoord(e[1])), i
            }, clampData: function (e, t) {
                var i = this.getAxis("x").scale, n = this.getAxis("y").scale, a = i.getExtent(), o = n.getExtent(),
                    r = i.parse(e[0]), s = n.parse(e[1]);
                return (t = t || [])[0] = Math.min(Math.max(Math.min(a[0], a[1]), r), Math.max(a[0], a[1])), t[1] = Math.min(Math.max(Math.min(o[0], o[1]), s), Math.max(o[0], o[1])), t
            }, pointToData: function (e, t) {
                var i = this.getAxis("x"), n = this.getAxis("y");
                return (t = t || [])[0] = i.coordToData(i.toLocalCoord(e[0])), t[1] = n.coordToData(n.toLocalCoord(e[1])), t
            }, getOtherAxis: function (e) {
                return this.getAxis("x" === e.dim ? "y" : "x")
            }, getArea: function () {
                var e = this.getAxis("x").getGlobalExtent(), t = this.getAxis("y").getGlobalExtent(),
                    i = Math.min(e[0], e[1]), n = Math.min(t[0], t[1]);
                return new Ai(i, n, Math.max(e[0], e[1]) - i, Math.max(t[0], t[1]) - n)
            }
        }, b(Sv, Cv), bv.prototype = {
            constructor: bv,
            index: 0,
            getAxesOnZeroOf: null,
            model: null,
            isHorizontal: function () {
                var e = this.position;
                return "top" === e || "bottom" === e
            },
            getGlobalExtent: function (e) {
                var t = this.getExtent();
                return t[0] = this.toGlobalCoord(t[0]), t[1] = this.toGlobalCoord(t[1]), e && t[0] > t[1] && t.reverse(), t
            },
            getOtherAxis: function () {
                this.grid.getOtherAxis()
            },
            pointToData: function (e, t) {
                return this.coordToData(this.toLocalCoord(e["x" === this.dim ? 0 : 1]), t)
            },
            toLocalCoord: null,
            toGlobalCoord: null
        }, b(bv, Dp);
        var Iv = {
            show: !0,
            zlevel: 0,
            z: 0,
            inverse: !1,
            name: "",
            nameLocation: "end",
            nameRotate: null,
            nameTruncate: {maxWidth: null, ellipsis: "...", placeholder: "."},
            nameTextStyle: {},
            nameGap: 15,
            silent: !1,
            triggerEvent: !1,
            tooltip: {show: !1},
            axisPointer: {},
            axisLine: {
                show: !0,
                onZero: !0,
                onZeroAxisIndex: null,
                lineStyle: {color: "#333", width: 1, type: "solid"},
                symbol: ["none", "none"],
                symbolSize: [10, 15]
            },
            axisTick: {show: !0, inside: !1, length: 5, lineStyle: {width: 1}},
            axisLabel: {
                show: !0,
                inside: !1,
                rotate: 0,
                showMinLabel: null,
                showMaxLabel: null,
                margin: 8,
                fontSize: 12
            },
            splitLine: {show: !0, lineStyle: {color: ["#ccc"], width: 1, type: "solid"}},
            splitArea: {show: !1, areaStyle: {color: ["rgba(250,250,250,0.3)", "rgba(200,200,200,0.3)"]}}
        }, _v = {};

        function Av(e, t, i, n) {
            A(Dv, function (a) {
                t.extend({
                    type: e + "Axis." + a, mergeDefaultAndTheme: function (t, n) {
                        var o = this.layoutMode, r = o ? kd(t) : {};
                        m(t, n.getTheme().get(a + "Axis")), m(t, this.getDefaultOption()), t.type = i(e, t), o && yd(t, r, o)
                    }, optionUpdated: function () {
                        "category" === this.option.type && (this.__ordinalMeta = lg.createByAxisModel(this))
                    }, getCategories: function (e) {
                        var t = this.option;
                        if ("category" === t.type) return e ? t.data : this.__ordinalMeta.categories
                    }, getOrdinalMeta: function () {
                        return this.__ordinalMeta
                    }, defaultOption: y([{}, _v[a + "Axis"], n], !0)
                })
            }), Id.registerSubTypeDefaulter(e + "Axis", M(i, e))
        }

        _v.categoryAxis = m({
            boundaryGap: !0,
            deduplication: null,
            splitLine: {show: !1},
            axisTick: {alignWithLabel: !1, interval: "auto"},
            axisLabel: {interval: "auto"}
        }, Iv), _v.valueAxis = m({
            boundaryGap: [0, 0],
            splitNumber: 5,
            minorTick: {show: !1, splitNumber: 5, length: 3, lineStyle: {}},
            minorSplitLine: {show: !1, lineStyle: {color: "#eee", width: 1}}
        }, Iv), _v.timeAxis = T({scale: !0, min: "dataMin", max: "dataMax"}, _v.valueAxis), _v.logAxis = T({
            scale: !0,
            logBase: 10
        }, _v.valueAxis);
        var Dv = ["value", "category", "time", "log"], xv = Id.extend({
            type: "cartesian2dAxis", axis: null, init: function () {
                xv.superApply(this, "init", arguments), this.resetRange()
            }, mergeOption: function () {
                xv.superApply(this, "mergeOption", arguments), this.resetRange()
            }, restoreData: function () {
                xv.superApply(this, "restoreData", arguments), this.resetRange()
            }, getCoordSysModel: function () {
                return this.ecModel.queryComponents({
                    mainType: "grid",
                    index: this.option.gridIndex,
                    id: this.option.gridId
                })[0]
            }
        });

        function Nv(e, t) {
            return t.type || (t.data ? "category" : "value")
        }

        m(xv.prototype, ip);
        var Ev = {offset: 0};

        function Pv(e, t) {
            return e.getCoordSysModel() === t
        }

        function Mv(e, t, i) {
            this._coordsMap = {}, this._coordsList = [], this._axesMap = {}, this._axesList = [], this._initCartesian(e, t, i), this.model = e
        }

        Av("x", xv, Nv, Ev), Av("y", xv, Nv, Ev), Id.extend({
            type: "grid",
            dependencies: ["xAxis", "yAxis"],
            layoutMode: "box",
            coordinateSystem: null,
            defaultOption: {
                show: !1,
                zlevel: 0,
                z: 0,
                left: "10%",
                top: 60,
                right: "10%",
                bottom: 60,
                containLabel: !1,
                backgroundColor: "rgba(0,0,0,0)",
                borderWidth: 1,
                borderColor: "#ccc"
            }
        });
        var Ov = Mv.prototype;

        function Fv(e, t, i, n) {
            i.getAxesOnZeroOf = function () {
                return a ? [a] : []
            };
            var a, o = e[t], r = i.model, s = r.get("axisLine.onZero"), l = r.get("axisLine.onZeroAxisIndex");
            if (s) {
                if (null != l) Lv(o[l]) && (a = o[l]); else for (var d in o) if (o.hasOwnProperty(d) && Lv(o[d]) && !n[u(o[d])]) {
                    a = o[d];
                    break
                }
                a && (n[u(a)] = !0)
            }

            function u(e) {
                return e.dim + "_" + e.index
            }
        }

        function Lv(e) {
            return e && "category" !== e.type && "time" !== e.type && function (e) {
                var t = e.scale.getExtent(), i = t[0], n = t[1];
                return !(0 < i && 0 < n || i < 0 && n < 0)
            }(e)
        }

        Ov.type = "grid", Ov.axisPointerEnabled = !0, Ov.getRect = function () {
            return this._rect
        }, Ov.update = function (e, t) {
            var i = this._axesMap;
            this._updateScale(e, this.model), A(i.x, function (e) {
                Yg(e.scale, e.model)
            }), A(i.y, function (e) {
                Yg(e.scale, e.model)
            });
            var n = {};
            A(i.x, function (e) {
                Fv(i, "y", e, n)
            }), A(i.y, function (e) {
                Fv(i, "x", e, n)
            }), this.resize(this.model, t)
        }, Ov.resize = function (e, t, i) {
            var n = vd(e.getBoxLayoutParams(), {width: t.getWidth(), height: t.getHeight()});
            this._rect = n;
            var a = this._axesList;

            function o() {
                A(a, function (e) {
                    var t = e.isHorizontal(), i = t ? [0, n.width] : [0, n.height], a = e.inverse ? 1 : 0;
                    e.setExtent(i[a], i[1 - a]), function (e, t) {
                        var i = e.getExtent(), n = i[0] + i[1];
                        e.toGlobalCoord = "x" === e.dim ? function (e) {
                            return e + t
                        } : function (e) {
                            return n - e + t
                        }, e.toLocalCoord = "x" === e.dim ? function (e) {
                            return e - t
                        } : function (e) {
                            return n - e + t
                        }
                    }(e, t ? n.x : n.y)
                })
            }

            o(), !i && e.get("containLabel") && (A(a, function (e) {
                if (!e.model.get("axisLabel.inside")) {
                    var t = function (e) {
                        var t = e.model, i = e.scale;
                        if (t.get("axisLabel.show") && !i.isBlank()) {
                            var n, a, o = "category" === e.type, r = i.getExtent();
                            a = o ? i.count() : (n = i.getTicks()).length;
                            var s, l, d, u, c, h, f, g, p, v = e.getLabelModel(), m = Zg(e), y = 1;
                            40 < a && (y = Math.ceil(a / 40));
                            for (var k = 0; k < a; k += y) {
                                var T = m(n ? n[k] : r[0] + k), w = v.getTextRect(T),
                                    C = (l = w, d = v.get("rotate") || 0, u = d * Math.PI / 180, c = l.plain(), h = c.width, f = c.height, g = h * Math.cos(u) + f * Math.sin(u), p = h * Math.sin(u) + f * Math.cos(u), new Ai(c.x, c.y, g, p));
                                s ? s.union(C) : s = C
                            }
                            return s
                        }
                    }(e);
                    if (t) {
                        var i = e.isHorizontal() ? "height" : "width", a = e.model.get("axisLabel.margin");
                        n[i] -= t[i] + a, "top" === e.position ? n.y += t.height + a : "left" === e.position && (n.x += t.width + a)
                    }
                }
            }), o())
        }, Ov.getAxis = function (e, t) {
            var i = this._axesMap[e];
            if (null != i) {
                if (null == t) for (var n in i) if (i.hasOwnProperty(n)) return i[n];
                return i[t]
            }
        }, Ov.getAxes = function () {
            return this._axesList.slice()
        }, Ov.getCartesian = function (e, t) {
            if (null != e && null != t) {
                var i = "x" + e + "y" + t;
                return this._coordsMap[i]
            }
            B(e) && (t = e.yAxisIndex, e = e.xAxisIndex);
            for (var n = 0, a = this._coordsList; n < a.length; n++) if (a[n].getAxis("x").index === e || a[n].getAxis("y").index === t) return a[n]
        }, Ov.getCartesians = function () {
            return this._coordsList.slice()
        }, Ov.convertToPixel = function (e, t, i) {
            var n = this._findConvertTarget(e, t);
            return n.cartesian ? n.cartesian.dataToPoint(i) : n.axis ? n.axis.toGlobalCoord(n.axis.dataToCoord(i)) : null
        }, Ov.convertFromPixel = function (e, t, i) {
            var n = this._findConvertTarget(e, t);
            return n.cartesian ? n.cartesian.pointToData(i) : n.axis ? n.axis.coordToData(n.axis.toLocalCoord(i)) : null
        }, Ov._findConvertTarget = function (e, t) {
            var i, n, a = t.seriesModel, o = t.xAxisModel || a && a.getReferringComponents("xAxis")[0],
                r = t.yAxisModel || a && a.getReferringComponents("yAxis")[0], s = t.gridModel, l = this._coordsList;
            return a ? S(l, i = a.coordinateSystem) < 0 && (i = null) : o && r ? i = this.getCartesian(o.componentIndex, r.componentIndex) : o ? n = this.getAxis("x", o.componentIndex) : r ? n = this.getAxis("y", r.componentIndex) : s && s.coordinateSystem === this && (i = this._coordsList[0]), {
                cartesian: i,
                axis: n
            }
        }, Ov.containPoint = function (e) {
            var t = this._coordsList[0];
            if (t) return t.containPoint(e)
        }, Ov._initCartesian = function (e, t, i) {
            var n = {left: !1, right: !1, top: !1, bottom: !1}, a = {x: {}, y: {}}, o = {x: 0, y: 0};
            if (t.eachComponent("xAxis", r("x"), this), t.eachComponent("yAxis", r("y"), this), !o.x || !o.y) return this._axesMap = {}, void (this._axesList = []);

            function r(t) {
                return function (i, r) {
                    if (Pv(i, e)) {
                        var s = i.get("position");
                        "x" === t ? "top" !== s && "bottom" !== s && (s = n.bottom ? "top" : "bottom") : "left" !== s && "right" !== s && (s = n.left ? "right" : "left"), n[s] = !0;
                        var l = new bv(t, Jg(i), [0, 0], i.get("type"), s), d = "category" === l.type;
                        l.onBand = d && i.get("boundaryGap"), l.inverse = i.get("inverse"), (i.axis = l).model = i, l.grid = this, l.index = r, this._axesList.push(l), a[t][r] = l, o[t]++
                    }
                }
            }

            A((this._axesMap = a).x, function (t, i) {
                A(a.y, function (n, a) {
                    var o = "x" + i + "y" + a, r = new Sv(o);
                    r.grid = this, r.model = e, this._coordsMap[o] = r, this._coordsList.push(r), r.addAxis(t), r.addAxis(n)
                }, this)
            }, this)
        }, Ov._updateScale = function (e, t) {
            function i(e, t) {
                A(e.mapDimension(t.dim, !0), function (i) {
                    t.scale.unionExtentFromData(e, og(e, i))
                })
            }

            A(this._axesList, function (e) {
                e.scale.setExtent(1 / 0, -1 / 0)
            }), e.eachSeries(function (e) {
                if (Rv(e)) {
                    var n = Uv(e), a = n[0], o = n[1];
                    if (!Pv(a, t) || !Pv(o, t)) return;
                    var r = this.getCartesian(a.componentIndex, o.componentIndex), s = e.getData(), l = r.getAxis("x"),
                        d = r.getAxis("y");
                    "list" === s.type && (i(s, l), i(s, d))
                }
            }, this)
        }, Ov.getTooltipAxes = function (e) {
            var t = [], i = [];
            return A(this.getCartesians(), function (n) {
                var a = null != e && "auto" !== e ? n.getAxis(e) : n.getBaseAxis(), o = n.getOtherAxis(a);
                S(t, a) < 0 && t.push(a), S(i, o) < 0 && i.push(o)
            }), {baseAxes: t, otherAxes: i}
        };
        var Bv = ["xAxis", "yAxis"];

        function Uv(e) {
            return D(Bv, function (t) {
                return e.getReferringComponents(t)[0]
            })
        }

        function Rv(e) {
            return "cartesian2d" === e.get("coordinateSystem")
        }

        function Kv(e, t) {
            this.opt = t, this.axisModel = e, T(t, {
                labelOffset: 0,
                nameDirection: 1,
                tickDirection: 1,
                labelDirection: 1,
                silent: !0
            }), this.group = new Di;
            var i = new Di({position: t.position.slice(), rotation: t.rotation});
            i.updateTransform(), this._transform = i.transform, this._dumbGroup = i
        }

        Mv.create = function (e, t) {
            var i = [];
            return e.eachComponent("grid", function (n, a) {
                var o = new Mv(n, e, t);
                o.name = "grid_" + a, o.resize(n, t, !0), n.coordinateSystem = o, i.push(o)
            }), e.eachSeries(function (e) {
                if (Rv(e)) {
                    var t = Uv(e), i = t[0], n = t[1], a = i.getCoordSysModel().coordinateSystem;
                    e.coordinateSystem = a.getCartesian(i.componentIndex, n.componentIndex)
                }
            }), i
        }, Mv.dimensions = Mv.prototype.dimensions = Sv.prototype.dimensions, iu.register("cartesian2d", Mv);
        var Wv = Math.PI;
        Kv.prototype = {
            constructor: Kv, hasBuilder: function (e) {
                return !!Vv[e]
            }, add: function (e) {
                Vv[e].call(this)
            }, getGroup: function () {
                return this.group
            }
        };
        var Vv = {
            axisLine: function () {
                var e = this.opt, t = this.axisModel;
                if (t.get("axisLine.show")) {
                    var i = this.axisModel.axis.getExtent(), n = this._transform, a = [i[0], 0], o = [i[1], 0];
                    n && (Ce(a, a, n), Ce(o, o, n));
                    var r = k({lineCap: "round"}, t.getModel("axisLine.lineStyle").getLineStyle());
                    this.group.add(new is({
                        anid: "line",
                        subPixelOptimize: !0,
                        shape: {x1: a[0], y1: a[1], x2: o[0], y2: o[1]},
                        style: r,
                        strokeContainThreshold: e.strokeContainThreshold || 5,
                        silent: !0,
                        z2: 1
                    }));
                    var s = t.get("axisLine.symbol"), l = t.get("axisLine.symbolSize"),
                        d = t.get("axisLine.symbolOffset") || 0;
                    if ("number" == typeof d && (d = [d, d]), null != s) {
                        "string" == typeof s && (s = [s, s]), "string" != typeof l && "number" != typeof l || (l = [l, l]);
                        var u = l[0], c = l[1];
                        A([{rotate: e.rotation + Math.PI / 2, offset: d[0], r: 0}, {
                            rotate: e.rotation - Math.PI / 2,
                            offset: d[1],
                            r: Math.sqrt((a[0] - o[0]) * (a[0] - o[0]) + (a[1] - o[1]) * (a[1] - o[1]))
                        }], function (t, i) {
                            if ("none" !== s[i] && null != s[i]) {
                                var n = cp(s[i], -u / 2, -c / 2, u, c, r.stroke, !0), o = t.r + t.offset,
                                    l = [a[0] + o * Math.cos(e.rotation), a[1] - o * Math.sin(e.rotation)];
                                n.attr({rotation: t.rotate, position: l, silent: !0, z2: 11}), this.group.add(n)
                            }
                        }, this)
                    }
                }
            }, axisTickLabel: function () {
                var e = this.axisModel, t = this.opt, i = function (e, t, i) {
                    var n = t.axis, a = t.getModel("axisTick");
                    if (a.get("show") && !n.scale.isBlank()) {
                        for (var o = a.getModel("lineStyle"), r = i.tickDirection * a.get("length"), s = qv(n.getTicksCoords(), e._transform, r, T(o.getLineStyle(), {stroke: t.get("axisLine.lineStyle.color")}), "ticks"), l = 0; l < s.length; l++) e.group.add(s[l]);
                        return s
                    }
                }(this, e, t);
                !function (e, t, i) {
                    if (!tp(e.axis)) {
                        var n = e.get("axisLabel.showMinLabel"), a = e.get("axisLabel.showMaxLabel");
                        i = i || [];
                        var o = (t = t || [])[0], r = t[1], s = t[t.length - 1], l = t[t.length - 2], d = i[0],
                            u = i[1], c = i[i.length - 1], h = i[i.length - 2];
                        !1 === n ? (Gv(o), Gv(d)) : $v(o, r) && (n ? (Gv(r), Gv(u)) : (Gv(o), Gv(d))), !1 === a ? (Gv(s), Gv(c)) : $v(l, s) && (a ? (Gv(l), Gv(h)) : (Gv(s), Gv(c)))
                    }
                }(e, function (e, t, i) {
                    var n = t.axis;
                    if (V(i.axisLabelShow, t.get("axisLabel.show")) && !n.scale.isBlank()) {
                        var a = t.getModel("axisLabel"), o = a.get("margin"), r = n.getViewLabels(),
                            s = (V(i.labelRotate, a.get("rotate")) || 0) * Wv / 180,
                            l = zv(i.rotation, s, i.labelDirection), d = t.getCategories && t.getCategories(!0), u = [],
                            c = jv(t), h = t.get("triggerEvent");
                        return A(r, function (r, s) {
                            var f = r.tickValue, g = r.formattedLabel, p = r.rawLabel, v = a;
                            d && d[f] && d[f].textStyle && (v = new Sl(d[f].textStyle, a, t.ecModel));
                            var m = v.getTextColor() || t.get("axisLine.lineStyle.color"),
                                y = [n.dataToCoord(f), i.labelOffset + i.labelDirection * o],
                                k = new Rr({anid: "label_" + f, position: y, rotation: l.rotation, silent: c, z2: 10});
                            Js(k.style, v, {
                                text: g,
                                textAlign: v.getShallow("align", !0) || l.textAlign,
                                textVerticalAlign: v.getShallow("verticalAlign", !0) || v.getShallow("baseline", !0) || l.textVerticalAlign,
                                textFill: "function" == typeof m ? m("category" === n.type ? p : "value" === n.type ? f + "" : f, s) : m
                            }), h && (k.eventData = Hv(t), k.eventData.targetType = "axisLabel", k.eventData.value = p), e._dumbGroup.add(k), k.updateTransform(), u.push(k), e.group.add(k), k.decomposeTransform()
                        }), u
                    }
                }(this, e, t), i), function (e, t, i) {
                    var n = t.axis, a = t.getModel("minorTick");
                    if (a.get("show") && !n.scale.isBlank()) {
                        var o = n.getMinorTicksCoords();
                        if (o.length) for (var r = a.getModel("lineStyle"), s = i.tickDirection * a.get("length"), l = T(r.getLineStyle(), T(t.getModel("axisTick").getLineStyle(), {stroke: t.get("axisLine.lineStyle.color")})), d = 0; d < o.length; d++) for (var u = qv(o[d], e._transform, s, l, "minorticks_" + d), c = 0; c < u.length; c++) e.group.add(u[c])
                    }
                }(this, e, t)
            }, axisName: function () {
                var e = this.opt, t = this.axisModel, i = V(e.axisName, t.get("name"));
                if (i) {
                    var n, a, o = t.get("nameLocation"), r = e.nameDirection, s = t.getModel("nameTextStyle"),
                        l = t.get("nameGap") || 0, d = this.axisModel.axis.getExtent(), u = d[0] > d[1] ? -1 : 1,
                        c = ["start" === o ? d[0] - u * l : "end" === o ? d[1] + u * l : (d[0] + d[1]) / 2, Xv(o) ? e.labelOffset + r * l : 0],
                        h = t.get("nameRotate");
                    null != h && (h = h * Wv / 180), Xv(o) ? n = zv(e.rotation, null != h ? h : e.rotation, r) : (n = function (e, t, i, n) {
                        var a, o, r = Ul(i - e.rotation), s = n[0] > n[1],
                            l = "start" === t && !s || "start" !== t && s;
                        return a = Rl(r - Wv / 2) ? (o = l ? "bottom" : "top", "center") : Rl(r - 1.5 * Wv) ? (o = l ? "top" : "bottom", "center") : (o = "middle", r < 1.5 * Wv && Wv / 2 < r ? l ? "left" : "right" : l ? "right" : "left"), {
                            rotation: r,
                            textAlign: a,
                            textVerticalAlign: o
                        }
                    }(e, o, h || 0, d), null != (a = e.axisNameAvailableWidth) && (a = Math.abs(a / Math.sin(n.rotation)), isFinite(a) || (a = null)));
                    var f = s.getFont(), g = t.get("nameTruncate", !0) || {}, p = g.ellipsis,
                        v = V(e.nameTruncateMaxWidth, g.maxWidth, a),
                        m = null != p && null != v ? ld(i, v, f, p, {minChar: 2, placeholder: g.placeholder}) : i,
                        y = t.get("tooltip", !0), T = t.mainType, w = {componentType: T, name: i, $vars: ["name"]};
                    w[T + "Index"] = t.componentIndex;
                    var C = new Rr({
                        anid: "name",
                        __fullText: i,
                        __truncatedText: m,
                        position: c,
                        rotation: n.rotation,
                        silent: jv(t),
                        z2: 1,
                        tooltip: y && y.show ? k({
                            content: i, formatter: function () {
                                return i
                            }, formatterParams: w
                        }, y) : null
                    });
                    Js(C.style, s, {
                        text: m,
                        textFont: f,
                        textFill: s.getTextColor() || t.get("axisLine.lineStyle.color"),
                        textAlign: s.get("align") || n.textAlign,
                        textVerticalAlign: s.get("verticalAlign") || n.textVerticalAlign
                    }), t.get("triggerEvent") && (C.eventData = Hv(t), C.eventData.targetType = "axisName", C.eventData.name = i), this._dumbGroup.add(C), C.updateTransform(), this.group.add(C), C.decomposeTransform()
                }
            }
        }, Hv = Kv.makeAxisEventDataBase = function (e) {
            var t = {componentType: e.mainType, componentIndex: e.componentIndex};
            return t[e.mainType + "Index"] = e.componentIndex, t
        }, zv = Kv.innerTextLayout = function (e, t, i) {
            var n, a = Ul(t - e);
            return {
                rotation: a,
                textAlign: Rl(a) ? (n = 0 < i ? "top" : "bottom", "center") : Rl(a - Wv) ? (n = 0 < i ? "bottom" : "top", "center") : (n = "middle", 0 < a && a < Wv ? 0 < i ? "right" : "left" : 0 < i ? "left" : "right"),
                textVerticalAlign: n
            }
        }, jv = Kv.isLabelSilent = function (e) {
            var t = e.get("tooltip");
            return e.get("silent") || !(e.get("triggerEvent") || t && t.show)
        };

        function Gv(e) {
            e && (e.ignore = !0)
        }

        function $v(e, t) {
            var i = e && e.getBoundingRect().clone(), n = t && t.getBoundingRect().clone();
            if (i && n) {
                var a = rt([]);
                return ut(a, a, -e.rotation), i.applyTransform(lt([], a, e.getLocalTransform())), n.applyTransform(lt([], a, t.getLocalTransform())), i.intersect(n)
            }
        }

        function Xv(e) {
            return "middle" === e || "center" === e
        }

        function qv(e, t, i, n, a) {
            for (var o = [], r = [], s = [], l = 0; l < e.length; l++) {
                var d = e[l].coord;
                r[0] = d, s[r[1] = 0] = d, s[1] = i, t && (Ce(r, r, t), Ce(s, s, t));
                var u = new is({
                    anid: a + "_" + e[l].tickValue,
                    subPixelOptimize: !0,
                    shape: {x1: r[0], y1: r[1], x2: s[0], y2: s[1]},
                    style: n,
                    z2: 2,
                    silent: !0
                });
                o.push(u)
            }
            return o
        }

        var Yv = A, Jv = M;

        function Zv(e, t) {
            return "all" === e || O(e) && 0 <= S(e, t) || e === t
        }

        function Qv(e) {
            var t = (e.ecModel.getComponent("axisPointer") || {}).coordSysAxesInfo;
            return t && t.axesInfo[tm(e)]
        }

        function em(e) {
            return !!e.get("handle.show")
        }

        function tm(e) {
            return e.type + "||" + e.id
        }

        var im = Tf({
            type: "axis", _axisPointer: null, axisPointerClass: null, render: function (e, t, i, n) {
                this.axisPointerClass && function (e) {
                    var t = Qv(e);
                    if (t) {
                        var i = t.axisPointerModel, n = t.axis.scale, a = i.option, o = i.get("status"),
                            r = i.get("value");
                        null != r && (r = n.parse(r));
                        var s = em(i);
                        null == o && (a.status = s ? "show" : "hide");
                        var l = n.getExtent().slice();
                        l[0] > l[1] && l.reverse(), (null == r || r > l[1]) && (r = l[1]), r < l[0] && (r = l[0]), a.value = r, s && (a.status = t.axis.scale.isBlank() ? "hide" : "show")
                    }
                }(e), im.superApply(this, "render", arguments), nm(this, e, 0, i, 0, !0)
            }, updateAxisPointer: function (e, t, i, n, a) {
                nm(this, e, 0, i, 0, !1)
            }, remove: function (e, t) {
                var i = this._axisPointer;
                i && i.remove(t), im.superApply(this, "remove", arguments)
            }, dispose: function (e, t) {
                am(this, t), im.superApply(this, "dispose", arguments)
            }
        });

        function nm(e, t, i, n, a, o) {
            var r = im.getAxisPointerClass(e.axisPointerClass);
            if (r) {
                var s = function (e) {
                    var t = Qv(e);
                    return t && t.axisPointerModel
                }(t);
                s ? (e._axisPointer || (e._axisPointer = new r)).render(t, s, n, o) : am(e, n)
            }
        }

        function am(e, t, i) {
            var n = e._axisPointer;
            n && n.dispose(t, i), e._axisPointer = null
        }

        var om = [];

        function rm(e, t, i) {
            i = i || {};
            var n = e.coordinateSystem, a = t.axis, o = {}, r = a.getAxesOnZeroOf()[0], s = a.position,
                l = r ? "onZero" : s, d = a.dim, u = n.getRect(), c = [u.x, u.x + u.width, u.y, u.y + u.height],
                h = {left: 0, right: 1, top: 0, bottom: 1, onZero: 2}, f = t.get("offset") || 0,
                g = "x" === d ? [c[2] - f, c[3] + f] : [c[0] - f, c[1] + f];
            if (r) {
                var p = r.toGlobalCoord(r.dataToCoord(0));
                g[h.onZero] = Math.max(Math.min(p, g[1]), g[0])
            }
            o.position = ["y" === d ? g[h[l]] : c[0], "x" === d ? g[h[l]] : c[3]], o.rotation = Math.PI / 2 * ("x" === d ? 0 : 1), o.labelDirection = o.tickDirection = o.nameDirection = {
                top: -1,
                bottom: 1,
                left: -1,
                right: 1
            }[s], o.labelOffset = r ? g[h[s]] - g[h.onZero] : 0, t.get("axisTick.inside") && (o.tickDirection = -o.tickDirection), V(i.labelInside, t.get("axisLabel.inside")) && (o.labelDirection = -o.labelDirection);
            var v = t.get("axisLabel.rotate");
            return o.labelRotate = "top" === l ? -v : v, o.z2 = 1, o
        }

        function sm(e, t, i, n) {
            var a = i.axis;
            if (!a.scale.isBlank()) {
                var o = i.getModel("splitArea"), r = o.getModel("areaStyle"), s = r.get("color"),
                    l = n.coordinateSystem.getRect(), d = a.getTicksCoords({tickModel: o, clamp: !0});
                if (d.length) {
                    var u = s.length, c = e.__splitAreaColors, h = Q(), f = 0;
                    if (c) for (var g = 0; g < d.length; g++) {
                        var p = c.get(d[g].tickValue);
                        if (null != p) {
                            f = (p + (u - 1) * g) % u;
                            break
                        }
                    }
                    var v = a.toGlobalCoord(d[0].coord), m = r.getAreaStyle();
                    for (s = O(s) ? s : [s], g = 1; g < d.length; g++) {
                        var y, k, w, C, S = a.toGlobalCoord(d[g].coord);
                        v = a.isHorizontal() ? (y = v, k = l.y, w = S - y, C = l.height, y + w) : (y = l.x, k = v, w = l.width, k + (C = S - k));
                        var b = d[g - 1].tickValue;
                        null != b && h.set(b, f), t.add(new es({
                            anid: null != b ? "area_" + b : null,
                            shape: {x: y, y: k, width: w, height: C},
                            style: T({fill: s[f]}, m),
                            silent: !0
                        })), f = (f + 1) % u
                    }
                    e.__splitAreaColors = h
                }
            }
        }

        function lm(e) {
            e.__splitAreaColors = null
        }

        im.registerAxisPointerClass = function (e, t) {
            om[e] = t
        }, im.getAxisPointerClass = function (e) {
            return e && om[e]
        };
        var dm = ["axisLine", "axisTickLabel", "axisName"], um = ["splitArea", "splitLine", "minorSplitLine"],
            cm = im.extend({
                type: "cartesianAxis",
                axisPointerClass: "CartesianAxisPointer",
                render: function (e, t, i, n) {
                    this.group.removeAll();
                    var a = this._axisGroup;
                    if (this._axisGroup = new Di, this.group.add(this._axisGroup), e.get("show")) {
                        var o = e.getCoordSysModel(), r = rm(o, e), s = new Kv(e, r);
                        A(dm, s.add, s), this._axisGroup.add(s.getGroup()), A(um, function (t) {
                            e.get(t + ".show") && this["_" + t](e, o)
                        }, this), ul(a, this._axisGroup, e), cm.superCall(this, "render", e, t, i, n)
                    }
                },
                remove: function () {
                    lm(this)
                },
                _splitLine: function (e, t) {
                    var i = e.axis;
                    if (!i.scale.isBlank()) {
                        var n = e.getModel("splitLine"), a = n.getModel("lineStyle"), o = a.get("color");
                        o = O(o) ? o : [o];
                        for (var r = t.coordinateSystem.getRect(), s = i.isHorizontal(), l = 0, d = i.getTicksCoords({tickModel: n}), u = [], c = [], h = a.getLineStyle(), f = 0; f < d.length; f++) {
                            var g = i.toGlobalCoord(d[f].coord);
                            s ? (u[0] = g, u[1] = r.y, c[0] = g, c[1] = r.y + r.height) : (u[0] = r.x, u[1] = g, c[0] = r.x + r.width, c[1] = g);
                            var p = l++ % o.length, v = d[f].tickValue;
                            this._axisGroup.add(new is({
                                anid: null != v ? "line_" + d[f].tickValue : null,
                                subPixelOptimize: !0,
                                shape: {x1: u[0], y1: u[1], x2: c[0], y2: c[1]},
                                style: T({stroke: o[p]}, h),
                                silent: !0
                            }))
                        }
                    }
                },
                _minorSplitLine: function (e, t) {
                    var i = e.axis, n = e.getModel("minorSplitLine").getModel("lineStyle"),
                        a = t.coordinateSystem.getRect(), o = i.isHorizontal(), r = i.getMinorTicksCoords();
                    if (r.length) for (var s = [], l = [], d = n.getLineStyle(), u = 0; u < r.length; u++) for (var c = 0; c < r[u].length; c++) {
                        var h = i.toGlobalCoord(r[u][c].coord);
                        o ? (s[0] = h, s[1] = a.y, l[0] = h, l[1] = a.y + a.height) : (s[0] = a.x, s[1] = h, l[0] = a.x + a.width, l[1] = h), this._axisGroup.add(new is({
                            anid: "minor_line_" + r[u][c].tickValue,
                            subPixelOptimize: !0,
                            shape: {x1: s[0], y1: s[1], x2: l[0], y2: l[1]},
                            style: d,
                            silent: !0
                        }))
                    }
                },
                _splitArea: function (e, t) {
                    sm(this, this._axisGroup, e, t)
                }
            });
        cm.extend({type: "xAxis"}), cm.extend({type: "yAxis"}), Tf({
            type: "grid", render: function (e, t) {
                this.group.removeAll(), e.get("show") && this.group.add(new es({
                    shape: e.coordinateSystem.getRect(),
                    style: T({fill: e.get("backgroundColor")}, e.getItemStyle()),
                    silent: !0,
                    z2: -1
                }))
            }
        }), cf(function (e) {
            e.xAxis && e.yAxis && !e.grid && (e.grid = {})
        }), vf(mv("line", "circle", "line")), pf(yv("line")), hf(Sh.PROCESSOR.STATISTIC, {
            seriesType: "line",
            modifyOutputEnd: !0,
            reset: function (e, t, i) {
                var n = e.getData(), a = e.get("sampling"), o = e.coordinateSystem;
                if ("cartesian2d" === o.type && a) {
                    var r, s = o.getBaseAxis(), l = o.getOtherAxis(s), d = s.getExtent(), u = d[1] - d[0],
                        c = Math.round(n.count() / u);
                    1 < c && ("string" == typeof a ? r = Tv[a] : "function" == typeof a && (r = a), r && e.setData(n.downSample(n.mapDimension(l.dim), 1 / c, r, kv)))
                }
            }
        });
        var hm = ec.extend({
            type: "series.__base_bar__",
            getInitialData: function (e, t) {
                return rg(this.getSource(), this, {useEncodeDefaulter: !0})
            },
            getMarkerPosition: function (e) {
                var t = this.coordinateSystem;
                if (t) {
                    var i = t.dataToPoint(t.clampData(e)), n = this.getData(), a = n.getLayout("offset"),
                        o = n.getLayout("size");
                    return i[t.getBaseAxis().isHorizontal() ? 0 : 1] += a + o / 2, i
                }
                return [NaN, NaN]
            },
            defaultOption: {
                zlevel: 0,
                z: 2,
                coordinateSystem: "cartesian2d",
                legendHoverLink: !0,
                barMinHeight: 0,
                barMinAngle: 0,
                large: !1,
                largeThreshold: 400,
                progressive: 3e3,
                progressiveChunkMode: "mod",
                itemStyle: {},
                emphasis: {}
            }
        });

        function fm(e, t, i, n, a, o) {
            qs(e, t, i.getModel("label"), i.getModel("emphasis.label"), {
                labelFetcher: a,
                labelDataIndex: o,
                defaultText: Mp(a.getData(), o),
                isRectText: !0,
                autoColor: n
            }), gm(e), gm(t)
        }

        function gm(e, t) {
            "outside" === e.textPosition && (e.textPosition = t)
        }

        hm.extend({
            type: "series.bar",
            dependencies: ["grid", "polar"],
            brushSelector: "rect",
            getProgressive: function () {
                return !!this.get("large") && this.get("progressive")
            },
            getProgressiveThreshold: function () {
                var e = this.get("progressiveThreshold"), t = this.get("largeThreshold");
                return e < t && (e = t), e
            },
            defaultOption: {
                clip: !0,
                roundCap: !1,
                showBackground: !1,
                backgroundStyle: {
                    color: "rgba(180, 180, 180, 0.2)",
                    borderColor: null,
                    borderWidth: 0,
                    borderType: "solid",
                    borderRadius: 0,
                    shadowBlur: 0,
                    shadowColor: null,
                    shadowOffsetX: 0,
                    shadowOffsetY: 0,
                    opacity: 1
                }
            }
        });
        var pm = no([["fill", "color"], ["stroke", "borderColor"], ["lineWidth", "borderWidth"], ["stroke", "barBorderColor"], ["lineWidth", "barBorderWidth"], ["opacity"], ["shadowBlur"], ["shadowOffsetX"], ["shadowOffsetY"], ["shadowColor"]]),
            vm = {
                getBarItemStyle: function (e) {
                    var t = pm(this, e);
                    if (this.getBorderLineDash) {
                        var i = this.getBorderLineDash();
                        i && (t.lineDash = i)
                    }
                    return t
                }
            }, mm = Ss({
                type: "sausage",
                shape: {cx: 0, cy: 0, r0: 0, r: 0, startAngle: 0, endAngle: 2 * Math.PI, clockwise: !0},
                buildPath: function (e, t) {
                    var i = t.cx, n = t.cy, a = Math.max(t.r0 || 0, 0), o = Math.max(t.r, 0), r = .5 * (o - a), s = a + r,
                        l = t.startAngle, d = t.endAngle, u = t.clockwise, c = Math.cos(l), h = Math.sin(l),
                        f = Math.cos(d), g = Math.sin(d);
                    (u ? d - l < 2 * Math.PI : l - d < 2 * Math.PI) && (e.moveTo(c * a + i, h * a + n), e.arc(c * s + i, h * s + n, r, -Math.PI + l, l, !u)), e.arc(i, n, o, l, d, !u), e.moveTo(f * o + i, g * o + n), e.arc(f * s + i, g * s + n, r, d - 2 * Math.PI, d - Math.PI, !u), 0 !== a && (e.arc(i, n, a, d, l, u), e.moveTo(c * a + i, g * a + n)), e.closePath()
                }
            }), ym = ["itemStyle", "barBorderWidth"], km = [0, 0];
        k(Sl.prototype, vm), Cf({
            type: "bar", render: function (e, t, i) {
                this._updateDrawMode(e);
                var n = e.get("coordinateSystem");
                return "cartesian2d" !== n && "polar" !== n || (this._isLargeDraw ? this._renderLarge(e, t, i) : this._renderNormal(e, t, i)), this.group
            }, incrementalPrepareRender: function (e, t, i) {
                this._clear(), this._updateDrawMode(e)
            }, incrementalRender: function (e, t, i, n) {
                this._incrementalRenderLarge(e, t)
            }, _updateDrawMode: function (e) {
                var t = e.pipelineContext.large;
                (null == this._isLargeDraw || t ^ this._isLargeDraw) && (this._isLargeDraw = t, this._clear())
            }, _renderNormal: function (e, t, i) {
                var n, a = this.group, o = e.getData(), r = this._data, s = e.coordinateSystem, l = s.getBaseAxis();
                "cartesian2d" === s.type ? n = l.isHorizontal() : "polar" === s.type && (n = "angle" === l.dim);
                var d = e.isAnimationEnabled() ? e : null, u = e.get("clip", !0), c = function (e, t) {
                    var i = e.getArea && e.getArea();
                    if ("cartesian2d" === e.type) {
                        var n = e.getBaseAxis();
                        if ("category" !== n.type || !n.onBand) {
                            var a = t.getLayout("bandWidth");
                            n.isHorizontal() ? (i.x -= a, i.width += 2 * a) : (i.y -= a, i.height += 2 * a)
                        }
                    }
                    return i
                }(s, o);
                a.removeClipPath();
                var h = e.get("roundCap", !0), f = e.get("showBackground", !0), g = e.getModel("backgroundStyle"),
                    p = g.get("barBorderRadius") || 0, v = [], m = this._backgroundEls || [];
                o.diff(r).add(function (t) {
                    var i = o.getItemModel(t), r = _m[s.type](o, t, i);
                    if (f) {
                        var l = _m[s.type](o, t), m = function (e, t, i) {
                            return new ("polar" === e.type ? Hr : es)({shape: Pm(t, i, e), silent: !0, z2: 0})
                        }(s, n, l);
                        m.useStyle(g.getBarItemStyle()), "cartesian2d" === s.type && m.setShape("r", p), v[t] = m
                    }
                    if (o.hasValue(t)) {
                        if (u && Cm[s.type](c, r)) return void a.remove(y);
                        var y = Sm[s.type](t, r, n, d, !1, h);
                        o.setItemGraphicEl(t, y), a.add(y), Dm(y, o, t, i, r, e, n, "polar" === s.type)
                    }
                }).update(function (t, i) {
                    var l = o.getItemModel(t), y = _m[s.type](o, t, l);
                    if (f) {
                        var k = m[i];
                        k.useStyle(g.getBarItemStyle()), "cartesian2d" === s.type && k.setShape("r", p), v[t] = k;
                        var T = _m[s.type](o, t);
                        ol(k, {shape: Pm(n, T, s)}, d, t)
                    }
                    var w = r.getItemGraphicEl(i);
                    if (o.hasValue(t)) {
                        if (u && Cm[s.type](c, y)) return void a.remove(w);
                        w ? ol(w, {shape: y}, d, t) : w = Sm[s.type](t, y, n, d, !0, h), o.setItemGraphicEl(t, w), a.add(w), Dm(w, o, t, l, y, e, n, "polar" === s.type)
                    } else a.remove(w)
                }).remove(function (e) {
                    var t = r.getItemGraphicEl(e);
                    "cartesian2d" === s.type ? t && bm(e, d, t) : t && Im(e, d, t)
                }).execute();
                var y = this._backgroundGroup || (this._backgroundGroup = new Di);
                y.removeAll();
                for (var k = 0; k < v.length; ++k) y.add(v[k]);
                a.add(y), this._backgroundEls = v, this._data = o
            }, _renderLarge: function (e, t, i) {
                this._clear(), Nm(e, this.group);
                var n = e.get("clip", !0) ? cv(e.coordinateSystem, !1, e) : null;
                n ? this.group.setClipPath(n) : this.group.removeClipPath()
            }, _incrementalRenderLarge: function (e, t) {
                this._removeBackground(), Nm(t, this.group, !0)
            }, dispose: te, remove: function (e) {
                this._clear(e)
            }, _clear: function (e) {
                var t = this.group, i = this._data;
                e && e.get("animation") && i && !this._isLargeDraw ? (this._removeBackground(), this._backgroundEls = [], i.eachItemGraphicEl(function (t) {
                    "sector" === t.type ? Im(t.dataIndex, e, t) : bm(t.dataIndex, e, t)
                })) : t.removeAll(), this._data = null
            }, _removeBackground: function () {
                this.group.remove(this._backgroundGroup), this._backgroundGroup = null
            }
        });
        var Tm = Math.max, wm = Math.min, Cm = {
            cartesian2d: function (e, t) {
                var i = t.width < 0 ? -1 : 1, n = t.height < 0 ? -1 : 1;
                i < 0 && (t.x += t.width, t.width = -t.width), n < 0 && (t.y += t.height, t.height = -t.height);
                var a = Tm(t.x, e.x), o = wm(t.x + t.width, e.x + e.width), r = Tm(t.y, e.y),
                    s = wm(t.y + t.height, e.y + e.height);
                t.x = a, t.y = r, t.width = o - a, t.height = s - r;
                var l = t.width < 0 || t.height < 0;
                return i < 0 && (t.x += t.width, t.width = -t.width), n < 0 && (t.y += t.height, t.height = -t.height), l
            }, polar: function (e) {
                return !1
            }
        }, Sm = {
            cartesian2d: function (e, t, i, n, a) {
                var o = new es({shape: k({}, t), z2: 1});
                if (o.name = "item", n) {
                    var r = i ? "height" : "width", s = {};
                    o.shape[r] = 0, s[r] = t[r], vl[a ? "updateProps" : "initProps"](o, {shape: s}, n, e)
                }
                return o
            }, polar: function (e, t, i, n, a, o) {
                var r = t.startAngle < t.endAngle, s = new (!i && o ? mm : Hr)({shape: T({clockwise: r}, t), z2: 1});
                if (s.name = "item", n) {
                    var l = i ? "r" : "endAngle", d = {};
                    s.shape[l] = i ? 0 : t.startAngle, d[l] = t[l], vl[a ? "updateProps" : "initProps"](s, {shape: d}, n, e)
                }
                return s
            }
        };

        function bm(e, t, i) {
            i.style.text = null, ol(i, {shape: {width: 0}}, t, e, function () {
                i.parent && i.parent.remove(i)
            })
        }

        function Im(e, t, i) {
            i.style.text = null, ol(i, {shape: {r: i.shape.r0}}, t, e, function () {
                i.parent && i.parent.remove(i)
            })
        }

        var _m = {
            cartesian2d: function (e, t, i) {
                var n = e.getItemLayout(t), a = i ? function (e, t) {
                    var i = e.get(ym) || 0, n = isNaN(t.width) ? Number.MAX_VALUE : Math.abs(t.width),
                        a = isNaN(t.height) ? Number.MAX_VALUE : Math.abs(t.height);
                    return Math.min(i, n, a)
                }(i, n) : 0, o = 0 < n.width ? 1 : -1, r = 0 < n.height ? 1 : -1;
                return {x: n.x + o * a / 2, y: n.y + r * a / 2, width: n.width - o * a, height: n.height - r * a}
            }, polar: function (e, t, i) {
                var n = e.getItemLayout(t);
                return {cx: n.cx, cy: n.cy, r0: n.r0, r: n.r, startAngle: n.startAngle, endAngle: n.endAngle}
            }
        };

        function Am(e) {
            return null != e.startAngle && null != e.endAngle && e.startAngle === e.endAngle
        }

        function Dm(e, t, i, n, a, o, r, s) {
            var l = t.getItemVisual(i, "color"), d = t.getItemVisual(i, "opacity"), u = t.getVisual("borderColor"),
                c = n.getModel("itemStyle"), h = n.getModel("emphasis.itemStyle").getBarItemStyle();
            s || e.setShape("r", c.get("barBorderRadius") || 0), e.useStyle(T({
                stroke: Am(a) ? "none" : u,
                fill: Am(a) ? "none" : l,
                opacity: d
            }, c.getBarItemStyle()));
            var f = n.getShallow("cursor");
            f && e.attr("cursor", f), r ? a.height : a.width, s || fm(e.style, h, n, l, o, i), Am(a) && (h.fill = h.stroke = "none"), js(e, h)
        }

        var xm = wr.extend({
            type: "largeBar", shape: {points: []}, buildPath: function (e, t) {
                for (var i = t.points, n = this.__startPoint, a = this.__baseDimIdx, o = 0; o < i.length; o += 2) n[a] = i[o + a], e.moveTo(n[0], n[1]), e.lineTo(i[o], i[o + 1])
            }
        });

        function Nm(e, t, i) {
            var n = e.getData(), a = [], o = n.getLayout("valueAxisHorizontal") ? 1 : 0;
            a[1 - o] = n.getLayout("valueAxisStart");
            var r = n.getLayout("largeDataIndices"), s = n.getLayout("barWidth"), l = e.getModel("backgroundStyle");
            if (e.get("showBackground", !0)) {
                var d = n.getLayout("largeBackgroundPoints"), u = [];
                u[1 - o] = n.getLayout("backgroundStart");
                var c = new xm({
                    shape: {points: d},
                    incremental: !!i,
                    __startPoint: u,
                    __baseDimIdx: o,
                    __largeDataIndices: r,
                    __barWidth: s,
                    silent: !0,
                    z2: 0
                });
                !function (e, t, i) {
                    var n = t.get("borderColor") || t.get("color"), a = t.getItemStyle(["color", "borderColor"]);
                    e.useStyle(a), e.style.fill = null, e.style.stroke = n, e.style.lineWidth = i.getLayout("barWidth")
                }(c, l, n), t.add(c)
            }
            var h = new xm({
                shape: {points: n.getLayout("largePoints")},
                incremental: !!i,
                __startPoint: a,
                __baseDimIdx: o,
                __largeDataIndices: r,
                __barWidth: s
            });
            t.add(h), function (e, t, i) {
                var n = i.getVisual("borderColor") || i.getVisual("color"),
                    a = t.getModel("itemStyle").getItemStyle(["color", "borderColor"]);
                e.useStyle(a), e.style.fill = null, e.style.stroke = n, e.style.lineWidth = i.getLayout("barWidth")
            }(h, e, n), h.seriesIndex = e.seriesIndex, e.get("silent") || (h.on("mousedown", Em), h.on("mousemove", Em))
        }

        var Em = Sc(function (e) {
            var t = function (e, t, i) {
                var n = e.__baseDimIdx, a = 1 - n, o = e.shape.points, r = e.__largeDataIndices,
                    s = Math.abs(e.__barWidth / 2), l = e.__startPoint[a];
                km[0] = t, km[1] = i;
                for (var d = km[n], u = km[1 - n], c = d - s, h = d + s, f = 0, g = o.length / 2; f < g; f++) {
                    var p = 2 * f, v = o[p + n], m = o[p + a];
                    if (c <= v && v <= h && (l <= m ? l <= u && u <= m : m <= u && u <= l)) return r[f]
                }
                return -1
            }(this, e.offsetX, e.offsetY);
            this.dataIndex = 0 <= t ? t : null
        }, 30, !1);

        function Pm(e, t, i) {
            var n, a = "polar" === i.type;
            return n = a ? i.getArea() : i.grid.getRect(), a ? {
                cx: n.cx,
                cy: n.cy,
                r0: e ? n.r0 : t.r0,
                r: e ? n.r : t.r,
                startAngle: e ? t.startAngle : 0,
                endAngle: e ? t.endAngle : 2 * Math.PI
            } : {x: e ? t.x : n.x, y: e ? n.y : t.y, width: e ? t.width : n.width, height: e ? n.height : t.height}
        }

        function Mm(e, t, i) {
            t = O(t) && {coordDimensions: t} || k({}, t);
            var n = e.getSource(), a = eg(n, t), o = new Kf(a, e);
            return o.initData(n, i), o
        }

        pf(Sh.VISUAL.LAYOUT, M(Dg, "bar")), pf(Sh.VISUAL.PROGRESSIVE_LAYOUT, xg), vf({
            seriesType: "bar",
            reset: function (e) {
                e.getData().setVisual("legendSymbol", "roundRect")
            }
        });
        var Om = {
            updateSelectedMap: function (e) {
                this._targetList = O(e) ? e.slice() : [], this._selectTargetMap = x(e || [], function (e, t) {
                    return e.set(t.name, t), e
                }, Q())
            }, select: function (e, t) {
                var i = null != t ? this._targetList[t] : this._selectTargetMap.get(e);
                "single" === this.get("selectedMode") && this._selectTargetMap.each(function (e) {
                    e.selected = !1
                }), i && (i.selected = !0)
            }, unSelect: function (e, t) {
                var i = null != t ? this._targetList[t] : this._selectTargetMap.get(e);
                i && (i.selected = !1)
            }, toggleSelected: function (e, t) {
                var i = null != t ? this._targetList[t] : this._selectTargetMap.get(e);
                if (null != i) return this[i.selected ? "unSelect" : "select"](e, t), i.selected
            }, isSelected: function (e, t) {
                var i = null != t ? this._targetList[t] : this._selectTargetMap.get(e);
                return i && i.selected
            }
        };

        function Fm(e, t) {
            this.getAllNames = function () {
                var e = t();
                return e.mapArray(e.getName)
            }, this.containName = function (e) {
                return 0 <= t().indexOfName(e)
            }, this.indexOfName = function (t) {
                return e().indexOfName(t)
            }, this.getItemVisual = function (t, i) {
                return e().getItemVisual(t, i)
            }
        }

        var Lm = wf({
            type: "series.pie",
            init: function (e) {
                Lm.superApply(this, "init", arguments), this.legendVisualProvider = new Fm(P(this.getData, this), P(this.getRawData, this)), this.updateSelectedMap(this._createSelectableList()), this._defaultLabelLine(e)
            },
            mergeOption: function (e) {
                Lm.superCall(this, "mergeOption", e), this.updateSelectedMap(this._createSelectableList())
            },
            getInitialData: function (e, t) {
                return Mm(this, {coordDimensions: ["value"], encodeDefaulter: M(Gd, this)})
            },
            _createSelectableList: function () {
                for (var e = this.getRawData(), t = e.mapDimension("value"), i = [], n = 0, a = e.count(); n < a; n++) i.push({
                    name: e.getName(n),
                    value: e.get(t, n),
                    selected: Bu(e, n, "selected")
                });
                return i
            },
            getDataParams: function (e) {
                var t = this.getData(), i = Lm.superCall(this, "getDataParams", e), n = [];
                return t.each(t.mapDimension("value"), function (e) {
                    n.push(e)
                }), i.percent = Ll(n, e, t.hostModel.get("percentPrecision")), i.$vars.push("percent"), i
            },
            _defaultLabelLine: function (e) {
                Ma(e, "labelLine", ["show"]);
                var t = e.labelLine, i = e.emphasis.labelLine;
                t.show = t.show && e.label.show, i.show = i.show && e.emphasis.label.show
            },
            defaultOption: {
                zlevel: 0,
                z: 2,
                legendHoverLink: !0,
                hoverAnimation: !0,
                center: ["50%", "50%"],
                radius: [0, "75%"],
                clockwise: !0,
                startAngle: 90,
                minAngle: 0,
                minShowLabelAngle: 0,
                selectedOffset: 10,
                hoverOffset: 10,
                avoidLabelOverlap: !0,
                percentPrecision: 2,
                stillShowZeroSum: !0,
                left: 0,
                top: 0,
                right: 0,
                bottom: 0,
                width: null,
                height: null,
                label: {
                    rotate: !1,
                    show: !0,
                    position: "outer",
                    alignTo: "none",
                    margin: "25%",
                    bleedMargin: 10,
                    distanceToLabelLine: 5
                },
                labelLine: {show: !0, length: 15, length2: 15, smooth: !1, lineStyle: {width: 1, type: "solid"}},
                itemStyle: {borderWidth: 1},
                animationType: "expansion",
                animationTypeUpdate: "transition",
                animationEasing: "cubicOut"
            }
        });

        function Bm(e, t, i, n) {
            var a = t.getData(), o = this.dataIndex, r = a.getName(o), s = t.get("selectedOffset");
            n.dispatchAction({type: "pieToggleSelect", from: e, name: r, seriesId: t.id}), a.each(function (e) {
                Um(a.getItemGraphicEl(e), a.getItemLayout(e), t.isSelected(a.getName(e)), s, i)
            })
        }

        function Um(e, t, i, n, a) {
            var o = (t.startAngle + t.endAngle) / 2, r = i ? n : 0, s = [Math.cos(o) * r, Math.sin(o) * r];
            a ? e.animate().when(200, {position: s}).start("bounceOut") : e.attr("position", s)
        }

        function Rm(e, t) {
            Di.call(this);
            var i = new Hr({z2: 2}), n = new Xr, a = new Rr;
            this.add(i), this.add(n), this.add(a), this.updateData(e, t, !0)
        }

        I(Lm, Om);
        var Km = Rm.prototype;

        function Wm(e, t) {
            A(t, function (t) {
                t.update = "updateView", ff(t, function (i, n) {
                    var a = {};
                    return n.eachComponent({mainType: "series", subType: e, query: i}, function (e) {
                        e[t.method] && e[t.method](i.name, i.dataIndex);
                        var n = e.getData();
                        n.each(function (t) {
                            var i = n.getName(t);
                            a[i] = e.isSelected(i) || !1
                        })
                    }), {name: i.name, selected: a, seriesId: i.seriesId}
                })
            })
        }

        function Vm(e) {
            return {
                getTargetSeries: function (t) {
                    var i = {}, n = Q();
                    return t.eachSeriesByType(e, function (e) {
                        e.__paletteScope = i, n.set(e.uid, e)
                    }), n
                }, reset: function (e, t) {
                    var i = e.getRawData(), n = {}, a = e.getData();
                    a.each(function (e) {
                        var t = a.getRawIndex(e);
                        n[t] = e
                    }), i.each(function (t) {
                        var o, r = n[t], s = null != r && a.getItemVisual(r, "color", !0),
                            l = null != r && a.getItemVisual(r, "borderColor", !0);
                        if (s && l || (o = i.getItemModel(t)), !s) {
                            var d = o.get("itemStyle.color") || e.getColorFromPalette(i.getName(t) || t + "", e.__paletteScope, i.count());
                            null != r && a.setItemVisual(r, "color", d)
                        }
                        if (!l) {
                            var u = o.get("itemStyle.borderColor");
                            null != r && a.setItemVisual(r, "borderColor", u)
                        }
                    })
                }
            }
        }

        Km.updateData = function (e, t, i) {
            var n = this.childAt(0), a = this.childAt(1), o = this.childAt(2), r = e.hostModel, s = e.getItemModel(t),
                l = e.getItemLayout(t), d = k({}, l);
            d.label = null;
            var u = r.getShallow("animationTypeUpdate");
            i ? (n.setShape(d), "scale" === r.getShallow("animationType") ? (n.shape.r = l.r0, rl(n, {shape: {r: l.r}}, r, t)) : (n.shape.endAngle = l.startAngle, ol(n, {shape: {endAngle: l.endAngle}}, r, t))) : "expansion" === u ? n.setShape(d) : ol(n, {shape: d}, r, t);
            var c = e.getItemVisual(t, "color");
            n.useStyle(T({
                lineJoin: "bevel",
                fill: c
            }, s.getModel("itemStyle").getItemStyle())), n.hoverStyle = s.getModel("emphasis.itemStyle").getItemStyle();
            var h = s.getShallow("cursor");
            h && n.attr("cursor", h), Um(this, e.getItemLayout(t), r.isSelected(e.getName(t)), r.get("selectedOffset"), r.get("animation"));
            var f = !i && "transition" === u;
            this._updateLabel(e, t, f), this.highDownOnUpdate = r.get("silent") ? null : function (e, t) {
                var i = r.isAnimationEnabled() && s.get("hoverAnimation");
                "emphasis" === t ? (a.ignore = a.hoverIgnore, o.ignore = o.hoverIgnore, i && (n.stopAnimation(!0), n.animateTo({shape: {r: l.r + r.get("hoverOffset")}}, 300, "elasticOut"))) : (a.ignore = a.normalIgnore, o.ignore = o.normalIgnore, i && (n.stopAnimation(!0), n.animateTo({shape: {r: l.r}}, 300, "elasticOut")))
            }, js(this)
        }, Km._updateLabel = function (e, t, i) {
            var n = this.childAt(1), a = this.childAt(2), o = e.hostModel, r = e.getItemModel(t),
                s = e.getItemLayout(t).label, l = e.getItemVisual(t, "color");
            if (!s || isNaN(s.x) || isNaN(s.y)) a.ignore = a.normalIgnore = a.hoverIgnore = n.ignore = n.normalIgnore = n.hoverIgnore = !0; else {
                var d = {points: s.linePoints || [[s.x, s.y], [s.x, s.y], [s.x, s.y]]}, u = {x: s.x, y: s.y};
                i ? (ol(n, {shape: d}, o, t), ol(a, {style: u}, o, t)) : (n.attr({shape: d}), a.attr({style: u})), a.attr({
                    rotation: s.rotation,
                    origin: [s.x, s.y],
                    z2: 10
                });
                var c = r.getModel("label"), h = r.getModel("emphasis.label"), f = r.getModel("labelLine"),
                    g = r.getModel("emphasis.labelLine");
                l = e.getItemVisual(t, "color"), qs(a.style, a.hoverStyle = {}, c, h, {
                    labelFetcher: e.hostModel,
                    labelDataIndex: t,
                    defaultText: s.text,
                    autoColor: l,
                    useInsideStyle: !!s.inside
                }, {
                    textAlign: s.textAlign,
                    textVerticalAlign: s.verticalAlign,
                    opacity: e.getItemVisual(t, "opacity")
                }), a.ignore = a.normalIgnore = !c.get("show"), a.hoverIgnore = !h.get("show"), n.ignore = n.normalIgnore = !f.get("show"), n.hoverIgnore = !g.get("show"), n.setStyle({
                    stroke: l,
                    opacity: e.getItemVisual(t, "opacity")
                }), n.setStyle(f.getModel("lineStyle").getLineStyle()), n.hoverStyle = g.getModel("lineStyle").getLineStyle();
                var p = f.get("smooth");
                p && !0 === p && (p = .4), n.setShape({smooth: p})
            }
        }, b(Rm, Di), fc.extend({
            type: "pie", init: function () {
                var e = new Di;
                this._sectorGroup = e
            }, render: function (e, t, i, n) {
                if (!n || n.from !== this.uid) {
                    var a = e.getData(), o = this._data, r = this.group, s = t.get("animation"), l = !o,
                        d = e.get("animationType"), u = e.get("animationTypeUpdate"), c = M(Bm, this.uid, e, s, i),
                        h = e.get("selectedMode");
                    if (a.diff(o).add(function (e) {
                        var t = new Rm(a, e);
                        l && "scale" !== d && t.eachChild(function (e) {
                            e.stopAnimation(!0)
                        }), h && t.on("click", c), a.setItemGraphicEl(e, t), r.add(t)
                    }).update(function (e, t) {
                        var i = o.getItemGraphicEl(t);
                        l || "transition" === u || i.eachChild(function (e) {
                            e.stopAnimation(!0)
                        }), i.updateData(a, e), i.off("click"), h && i.on("click", c), r.add(i), a.setItemGraphicEl(e, i)
                    }).remove(function (e) {
                        var t = o.getItemGraphicEl(e);
                        r.remove(t)
                    }).execute(), s && 0 < a.count() && (l ? "scale" !== d : "transition" !== u)) {
                        for (var f = a.getItemLayout(0), g = 1; isNaN(f.startAngle) && g < a.count(); ++g) f = a.getItemLayout(g);
                        var p = Math.max(i.getWidth(), i.getHeight()) / 2, v = P(r.removeClipPath, r);
                        r.setClipPath(this._createClipPath(f.cx, f.cy, p, f.startAngle, f.clockwise, v, e, l))
                    } else r.removeClipPath();
                    this._data = a
                }
            }, dispose: function () {
            }, _createClipPath: function (e, t, i, n, a, o, r, s) {
                var l = new Hr({shape: {cx: e, cy: t, r0: 0, r: i, startAngle: n, endAngle: n, clockwise: a}});
                return (s ? rl : ol)(l, {shape: {endAngle: n + (a ? 1 : -1) * Math.PI * 2}}, r, o), l
            }, containPoint: function (e, t) {
                var i = t.getData().getItemLayout(0);
                if (i) {
                    var n = e[0] - i.cx, a = e[1] - i.cy, o = Math.sqrt(n * n + a * a);
                    return o <= i.r && o >= i.r0
                }
            }
        });
        var Hm = Math.PI / 180;

        function zm(e, t, i, n, a, o, r, s, l, d) {
            function u(t, i, n) {
                for (var a = t; a < i && !(e[a].y + n > l + r); a++) if (e[a].y += n, t < a && a + 1 < i && e[a + 1].y > e[a].y + e[a].height) return void c(a, n / 2);
                c(i - 1, n / 2)
            }

            function c(t, i) {
                for (var n = t; 0 <= n && !(e[n].y - i < l) && (e[n].y -= i, !(0 < n && e[n].y > e[n - 1].y + e[n - 1].height)); n--) ;
            }

            function h(e, t, i, n, a, o) {
                for (var r = t ? Number.MAX_VALUE : 0, s = 0, l = e.length; s < l; s++) if ("none" === e[s].labelAlignTo) {
                    var d = Math.abs(e[s].y - n), u = e[s].len, c = e[s].len2,
                        h = d < a + u ? Math.sqrt((a + u + c) * (a + u + c) - d * d) : Math.abs(e[s].x - i);
                    t && r <= h && (h = r - 10), !t && h <= r && (h = r + 10), e[s].x = i + h * o, r = h
                }
            }

            e.sort(function (e, t) {
                return e.y - t.y
            });
            for (var f, g = 0, p = e.length, v = [], m = [], y = 0; y < p; y++) {
                if ("outer" === e[y].position && "labelLine" === e[y].labelAlignTo) {
                    var k = e[y].x - d;
                    e[y].linePoints[1][0] += k, e[y].x = d
                }
                (f = e[y].y - g) < 0 && u(y, p, -f), g = e[y].y + e[y].height
            }
            for (r - g < 0 && c(p - 1, g - r), y = 0; y < p; y++) e[y].y >= i ? m.push(e[y]) : v.push(e[y]);
            h(v, !1, t, i, n, a), h(m, !0, t, i, n, a)
        }

        function jm(e) {
            return "center" === e.position
        }

        var Gm = 2 * Math.PI, $m = Math.PI / 180;

        function Xm(e) {
            return {
                seriesType: e, reset: function (e, t) {
                    var i = t.findComponents({mainType: "legend"});
                    if (i && i.length) {
                        var n = e.getData();
                        n.filterSelf(function (e) {
                            for (var t = n.getName(e), a = 0; a < i.length; a++) if (!i[a].isSelected(t)) return !1;
                            return !0
                        })
                    }
                }
            }
        }

        Wm("pie", [{type: "pieToggleSelect", event: "pieselectchanged", method: "toggleSelected"}, {
            type: "pieSelect",
            event: "pieselected",
            method: "select"
        }, {
            type: "pieUnSelect",
            event: "pieunselected",
            method: "unSelect"
        }]), vf(Vm("pie")), pf(M(function (e, t, i, n) {
            t.eachSeriesByType(e, function (e) {
                var t = e.getData(), n = t.mapDimension("value"), a = function (e, t) {
                    return vd(e.getBoxLayoutParams(), {width: t.getWidth(), height: t.getHeight()})
                }(e, i), o = e.get("center"), r = e.get("radius");
                O(r) || (r = [0, r]), O(o) || (o = [o, o]);
                var s = Nl(a.width, i.getWidth()), l = Nl(a.height, i.getHeight()), d = Math.min(s, l),
                    u = Nl(o[0], s) + a.x, c = Nl(o[1], l) + a.y, h = Nl(r[0], d / 2), f = Nl(r[1], d / 2),
                    g = -e.get("startAngle") * $m, p = e.get("minAngle") * $m, v = 0;
                t.each(n, function (e) {
                    isNaN(e) || v++
                });
                var m = t.getSum(n), y = Math.PI / (m || v) * 2, k = e.get("clockwise"), T = e.get("roseType"),
                    w = e.get("stillShowZeroSum"), C = t.getDataExtent(n);
                C[0] = 0;
                var S = Gm, b = 0, I = g, _ = k ? 1 : -1;
                if (t.each(n, function (e, i) {
                    var n;
                    if (isNaN(e)) t.setItemLayout(i, {
                        angle: NaN,
                        startAngle: NaN,
                        endAngle: NaN,
                        clockwise: k,
                        cx: u,
                        cy: c,
                        r0: h,
                        r: T ? NaN : f,
                        viewRect: a
                    }); else {
                        (n = "area" !== T ? 0 === m && w ? y : e * y : Gm / v) < p ? S -= n = p : b += e;
                        var o = I + _ * n;
                        t.setItemLayout(i, {
                            angle: n,
                            startAngle: I,
                            endAngle: o,
                            clockwise: k,
                            cx: u,
                            cy: c,
                            r0: h,
                            r: T ? xl(e, C, [h, f]) : f,
                            viewRect: a
                        }), I = o
                    }
                }), S < Gm && v) if (S <= .001) {
                    var A = Gm / v;
                    t.each(n, function (e, i) {
                        if (!isNaN(e)) {
                            var n = t.getItemLayout(i);
                            n.angle = A, n.startAngle = g + _ * i * A, n.endAngle = g + _ * (i + 1) * A
                        }
                    })
                } else y = S / b, I = g, t.each(n, function (e, i) {
                    if (!isNaN(e)) {
                        var n = t.getItemLayout(i), a = n.angle === p ? p : e * y;
                        n.startAngle = I, n.endAngle = I + _ * a, I += _ * a
                    }
                });
                !function (e, t, i, n, a, o) {
                    var r, s, l = e.getData(), d = [], u = !1, c = (e.get("minShowLabelAngle") || 0) * Hm;
                    l.each(function (n) {
                        var o = l.getItemLayout(n), h = l.getItemModel(n), f = h.getModel("label"),
                            g = f.get("position") || h.get("emphasis.label.position"), p = f.get("distanceToLabelLine"),
                            v = f.get("alignTo"), m = Nl(f.get("margin"), i), y = f.get("bleedMargin"), k = f.getFont(),
                            T = h.getModel("labelLine"), w = T.get("length");
                        w = Nl(w, i);
                        var C = T.get("length2");
                        if (C = Nl(C, i), !(o.angle < c)) {
                            var S, b, I, _, A = (o.startAngle + o.endAngle) / 2, D = Math.cos(A), x = Math.sin(A);
                            r = o.cx, s = o.cy;
                            var N, E = e.getFormattedLabel(n, "normal") || l.getName(n), P = cn(E, k, _, "top"),
                                M = "inside" === g || "inner" === g;
                            if ("center" === g) S = o.cx, b = o.cy, _ = "center"; else {
                                var O = (M ? (o.r + o.r0) / 2 * D : o.r * D) + r,
                                    F = (M ? (o.r + o.r0) / 2 * x : o.r * x) + s;
                                if (S = O + 3 * D, b = F + 3 * x, !M) {
                                    var L = O + D * (w + t - o.r), B = F + x * (w + t - o.r),
                                        U = L + (D < 0 ? -1 : 1) * C;
                                    S = "edge" === v ? D < 0 ? a + m : a + i - m : U + (D < 0 ? -p : p), I = [[O, F], [L, B], [U, b = B]]
                                }
                                _ = M ? "center" : "edge" === v ? 0 < D ? "right" : "left" : 0 < D ? "left" : "right"
                            }
                            var R = f.get("rotate");
                            N = "number" == typeof R ? R * (Math.PI / 180) : R ? D < 0 ? -A + Math.PI : -A : 0, u = !!N, o.label = {
                                x: S,
                                y: b,
                                position: g,
                                height: P.height,
                                len: w,
                                len2: C,
                                linePoints: I,
                                textAlign: _,
                                verticalAlign: "middle",
                                rotation: N,
                                inside: M,
                                labelDistance: p,
                                labelAlignTo: v,
                                labelMargin: m,
                                bleedMargin: y,
                                textRect: P,
                                text: E,
                                font: k
                            }, M || d.push(o.label)
                        }
                    }), !u && e.get("avoidLabelOverlap") && function (e, t, i, n, a, o, r, s) {
                        for (var l = [], d = [], u = Number.MAX_VALUE, c = -Number.MAX_VALUE, h = 0; h < e.length; h++) jm(e[h]) || (e[h].x < t ? (u = Math.min(u, e[h].x), l.push(e[h])) : (c = Math.max(c, e[h].x), d.push(e[h])));
                        for (zm(d, t, i, n, 1, 0, o, 0, s, c), zm(l, t, i, n, -1, 0, o, 0, s, u), h = 0; h < e.length; h++) {
                            var f = e[h];
                            if (!jm(f)) {
                                var g = f.linePoints;
                                if (g) {
                                    var p, v = "edge" === f.labelAlignTo, m = f.textRect.width;
                                    (p = v ? f.x < t ? g[2][0] - f.labelDistance - r - f.labelMargin : r + a - f.labelMargin - g[2][0] - f.labelDistance : f.x < t ? f.x - r - f.bleedMargin : r + a - f.x - f.bleedMargin) < f.textRect.width && (f.text = pn(f.text, p, f.font), "edge" === f.labelAlignTo && (m = un(f.text, f.font)));
                                    var y = g[1][0] - g[2][0];
                                    v ? f.x < t ? g[2][0] = r + f.labelMargin + m + f.labelDistance : g[2][0] = r + a - f.labelMargin - m - f.labelDistance : (f.x < t ? g[2][0] = f.x + f.labelDistance : g[2][0] = f.x - f.labelDistance, g[1][0] = g[2][0] + y), g[1][1] = g[2][1] = f.y
                                }
                            }
                        }
                    }(d, r, s, t, i, n, a, o)
                }(e, f, a.width, a.height, a.x, a.y)
            })
        }, "pie")), hf(Xm("pie")), ec.extend({
            type: "series.scatter",
            dependencies: ["grid", "polar", "geo", "singleAxis", "calendar"],
            getInitialData: function (e, t) {
                return rg(this.getSource(), this, {useEncodeDefaulter: !0})
            },
            brushSelector: "point",
            getProgressive: function () {
                var e = this.option.progressive;
                return null == e ? this.option.large ? 5e3 : this.get("progressive") : e
            },
            getProgressiveThreshold: function () {
                var e = this.option.progressiveThreshold;
                return null == e ? this.option.large ? 1e4 : this.get("progressiveThreshold") : e
            },
            defaultOption: {
                coordinateSystem: "cartesian2d",
                zlevel: 0,
                z: 2,
                legendHoverLink: !0,
                hoverAnimation: !0,
                symbolSize: 10,
                large: !1,
                largeThreshold: 2e3,
                itemStyle: {opacity: .8},
                clip: !0
            }
        });
        var qm = Ss({
            shape: {points: null}, symbolProxy: null, softClipShape: null, buildPath: function (e, t) {
                var i = t.points, n = t.size, a = this.symbolProxy, o = a.shape;
                if (!((e.getContext ? e.getContext() : e) && n[0] < 4)) for (var r = 0; r < i.length;) {
                    var s = i[r++], l = i[r++];
                    isNaN(s) || isNaN(l) || this.softClipShape && !this.softClipShape.contain(s, l) || (o.x = s - n[0] / 2, o.y = l - n[1] / 2, o.width = n[0], o.height = n[1], a.buildPath(e, o, !0))
                }
            }, afterBrush: function (e) {
                var t = this.shape, i = t.points, n = t.size;
                if (n[0] < 4) {
                    this.setTransform(e);
                    for (var a = 0; a < i.length;) {
                        var o = i[a++], r = i[a++];
                        isNaN(o) || isNaN(r) || this.softClipShape && !this.softClipShape.contain(o, r) || e.fillRect(o - n[0] / 2, r - n[1] / 2, n[0], n[1])
                    }
                    this.restoreTransform(e)
                }
            }, findDataIndex: function (e, t) {
                for (var i = this.shape, n = i.points, a = i.size, o = Math.max(a[0], 4), r = Math.max(a[1], 4), s = n.length / 2 - 1; 0 <= s; s--) {
                    var l = 2 * s, d = n[l] - o / 2, u = n[1 + l] - r / 2;
                    if (d <= e && u <= t && e <= d + o && t <= u + r) return s
                }
                return -1
            }
        });

        function Ym() {
            this.group = new Di
        }

        var Jm = Ym.prototype;

        function Zm(e, t, i) {
            Dp.call(this, e, t, i), this.type = "value", this.angle = 0, this.name = "", this.model
        }

        function Qm(e, t, i) {
            this._model = e, this.dimensions = [], this._indicatorAxes = D(e.getIndicatorModels(), function (e, t) {
                var i = "indicator_" + t, n = new Zm(i, "log" === e.get("axisType") ? new $g : new kg);
                return n.name = e.get("name"), (n.model = e).axis = n, this.dimensions.push(i), n
            }, this), this.resize(e, i), this.cx, this.cy, this.r, this.r0, this.startAngle
        }

        Jm.isPersistent = function () {
            return !this._incremental
        }, Jm.updateData = function (e, t) {
            this.group.removeAll();
            var i = new qm({rectHover: !0, cursor: "default"});
            i.setShape({points: e.getLayout("symbolPoints")}), this._setCommon(i, e, !1, t), this.group.add(i), this._incremental = null
        }, Jm.updateLayout = function (e) {
            if (!this._incremental) {
                var t = e.getLayout("symbolPoints");
                this.group.eachChild(function (e) {
                    if (null != e.startIndex) {
                        var i = 2 * (e.endIndex - e.startIndex), n = 4 * e.startIndex * 2;
                        t = new Float32Array(t.buffer, n, i)
                    }
                    e.setShape("points", t)
                })
            }
        }, Jm.incrementalPrepareUpdate = function (e) {
            this.group.removeAll(), this._clearIncremental(), 2e6 < e.count() ? (this._incremental || (this._incremental = new cs({silent: !0})), this.group.add(this._incremental)) : this._incremental = null
        }, Jm.incrementalUpdate = function (e, t, i) {
            var n;
            this._incremental ? (n = new qm, this._incremental.addDisplayable(n, !0)) : ((n = new qm({
                rectHover: !0,
                cursor: "default",
                startIndex: e.start,
                endIndex: e.end
            })).incremental = !0, this.group.add(n)), n.setShape({points: t.getLayout("symbolPoints")}), this._setCommon(n, t, !!this._incremental, i)
        }, Jm._setCommon = function (e, t, i, n) {
            var a = t.hostModel;
            n = n || {};
            var o = t.getVisual("symbolSize");
            e.setShape("size", o instanceof Array ? o : [o, o]), e.softClipShape = n.clipShape || null, e.symbolProxy = cp(t.getVisual("symbol"), 0, 0, 0, 0), e.setColor = e.symbolProxy.setColor;
            var r = e.shape.size[0] < 4;
            e.useStyle(a.getModel("itemStyle").getItemStyle(r ? ["color", "shadowBlur", "shadowColor"] : ["color"]));
            var s = t.getVisual("color");
            s && e.setColor(s), i || (e.seriesIndex = a.seriesIndex, e.on("mousemove", function (t) {
                e.dataIndex = null;
                var i = e.findDataIndex(t.offsetX, t.offsetY);
                0 <= i && (e.dataIndex = i + (e.startIndex || 0))
            }))
        }, Jm.remove = function () {
            this._clearIncremental(), this._incremental = null, this.group.removeAll()
        }, Jm._clearIncremental = function () {
            var e = this._incremental;
            e && e.clearDisplaybles()
        }, Cf({
            type: "scatter", render: function (e, t, i) {
                var n = e.getData();
                this._updateSymbolDraw(n, e).updateData(n, {clipShape: this._getClipShape(e)}), this._finished = !0
            }, incrementalPrepareRender: function (e, t, i) {
                var n = e.getData();
                this._updateSymbolDraw(n, e).incrementalPrepareUpdate(n), this._finished = !1
            }, incrementalRender: function (e, t, i) {
                this._symbolDraw.incrementalUpdate(e, t.getData(), {clipShape: this._getClipShape(t)}), this._finished = e.end === t.getData().count()
            }, updateTransform: function (e, t, i) {
                var n = e.getData();
                if (this.group.dirty(), !this._finished || 1e4 < n.count() || !this._symbolDraw.isPersistent()) return {update: !0};
                var a = yv().reset(e);
                a.progress && a.progress({start: 0, end: n.count()}, n), this._symbolDraw.updateLayout(n)
            }, _getClipShape: function (e) {
                var t = e.coordinateSystem, i = t && t.getArea && t.getArea();
                return e.get("clip", !0) ? i : null
            }, _updateSymbolDraw: function (e, t) {
                var i = this._symbolDraw, n = t.pipelineContext.large;
                return i && n === this._isLargeDraw || (i && i.remove(), i = this._symbolDraw = n ? new Ym : new zp, this._isLargeDraw = n, this.group.removeAll()), this.group.add(i.group), i
            }, remove: function (e, t) {
                this._symbolDraw && this._symbolDraw.remove(!0), this._symbolDraw = null
            }, dispose: function () {
            }
        }), vf(mv("scatter", "circle")), pf(yv("scatter")), b(Zm, Dp), Qm.prototype.getIndicatorAxes = function () {
            return this._indicatorAxes
        }, Qm.prototype.dataToPoint = function (e, t) {
            var i = this._indicatorAxes[t];
            return this.coordToPoint(i.dataToCoord(e), t)
        }, Qm.prototype.coordToPoint = function (e, t) {
            var i = this._indicatorAxes[t].angle;
            return [this.cx + e * Math.cos(i), this.cy - e * Math.sin(i)]
        }, Qm.prototype.pointToData = function (e) {
            var t = e[0] - this.cx, i = e[1] - this.cy, n = Math.sqrt(t * t + i * i);
            t /= n, i /= n;
            for (var a, o = Math.atan2(-i, t), r = 1 / 0, s = -1, l = 0; l < this._indicatorAxes.length; l++) {
                var d = this._indicatorAxes[l], u = Math.abs(o - d.angle);
                u < r && (a = d, s = l, r = u)
            }
            return [s, +(a && a.coordToData(n))]
        }, Qm.prototype.resize = function (e, t) {
            var i = e.get("center"), n = t.getWidth(), a = t.getHeight(), o = Math.min(n, a) / 2;
            this.cx = Nl(i[0], n), this.cy = Nl(i[1], a), this.startAngle = e.get("startAngle") * Math.PI / 180;
            var r = e.get("radius");
            "string" != typeof r && "number" != typeof r || (r = [0, r]), this.r0 = Nl(r[0], o), this.r = Nl(r[1], o), A(this._indicatorAxes, function (e, t) {
                e.setExtent(this.r0, this.r);
                var i = this.startAngle + t * Math.PI * 2 / this._indicatorAxes.length;
                i = Math.atan2(Math.sin(i), Math.cos(i)), e.angle = i
            }, this)
        }, Qm.prototype.update = function (e, t) {
            var i = this._indicatorAxes, n = this._model;
            A(i, function (e) {
                e.scale.setExtent(1 / 0, -1 / 0)
            }), e.eachSeriesByType("radar", function (t, a) {
                if ("radar" === t.get("coordinateSystem") && e.getComponent("radar", t.get("radarIndex")) === n) {
                    var o = t.getData();
                    A(i, function (e) {
                        e.scale.unionExtentFromData(o, o.mapDimension(e.dim))
                    })
                }
            }, this);
            var a = n.get("splitNumber");

            function o(e) {
                var t = Math.pow(10, Math.floor(Math.log(e) / Math.LN10)), i = e / t;
                return 2 === i ? i = 5 : i *= 2, i * t
            }

            A(i, function (e, t) {
                var i = qg(e.scale, e.model).extent;
                Yg(e.scale, e.model);
                var n = e.model, r = e.scale, s = n.getMin(), l = n.getMax(), d = r.getInterval();
                if (null != s && null != l) r.setExtent(+s, +l), r.setInterval((l - s) / a); else if (null != s) for (; c = s + d * a, r.setExtent(+s, c), r.setInterval(d), d = o(d), c < i[1] && isFinite(c) && isFinite(i[1]);) ; else if (null != l) for (; h = l - d * a, r.setExtent(h, +l), r.setInterval(d), d = o(d), h > i[0] && isFinite(h) && isFinite(i[0]);) ; else {
                    var u = r.getTicks().length - 1;
                    a < u && (d = o(d));
                    var c, h = El((c = Math.ceil(i[1] / d) * d) - d * a);
                    r.setExtent(h, c), r.setInterval(d)
                }
            })
        }, Qm.dimensions = [], Qm.create = function (e, t) {
            var i = [];
            return e.eachComponent("radar", function (n) {
                var a = new Qm(n, e, t);
                i.push(a), n.coordinateSystem = a
            }), e.eachSeriesByType("radar", function (e) {
                "radar" === e.get("coordinateSystem") && (e.coordinateSystem = i[e.get("radarIndex") || 0])
            }), i
        }, iu.register("radar", Qm);
        var ey = _v.valueAxis;

        function ty(e, t) {
            return T({show: t}, e)
        }

        kf({
            type: "radar",
            optionUpdated: function () {
                var e = this.get("boundaryGap"), t = this.get("splitNumber"), i = this.get("scale"),
                    n = this.get("axisLine"), a = this.get("axisTick"), o = this.get("axisType"),
                    r = this.get("axisLabel"), s = this.get("name"), l = this.get("name.show"),
                    d = this.get("name.formatter"), u = this.get("nameGap"), c = this.get("triggerEvent"),
                    h = D(this.get("indicator") || [], function (h) {
                        null != h.max && 0 < h.max && !h.min ? h.min = 0 : null != h.min && h.min < 0 && !h.max && (h.max = 0);
                        var f = s;
                        if (null != h.color && (f = T({color: h.color}, s)), h = m(v(h), {
                            boundaryGap: e,
                            splitNumber: t,
                            scale: i,
                            axisLine: n,
                            axisTick: a,
                            axisType: o,
                            axisLabel: r,
                            name: h.text,
                            nameLocation: "end",
                            nameGap: u,
                            nameTextStyle: f,
                            triggerEvent: c
                        }, !1), l || (h.name = ""), "string" == typeof d) {
                            var g = h.name;
                            h.name = d.replace("{value}", null != g ? g : "")
                        } else "function" == typeof d && (h.name = d(h.name, h));
                        var p = k(new Sl(h, null, this.ecModel), ip);
                        return p.mainType = "radar", p.componentIndex = this.componentIndex, p
                    }, this);
                this.getIndicatorModels = function () {
                    return h
                }
            },
            defaultOption: {
                zlevel: 0,
                z: 0,
                center: ["50%", "50%"],
                radius: "75%",
                startAngle: 90,
                name: {show: !0},
                boundaryGap: [0, 0],
                splitNumber: 5,
                nameGap: 15,
                scale: !1,
                shape: "polygon",
                axisLine: m({lineStyle: {color: "#bbb"}}, ey.axisLine),
                axisLabel: ty(ey.axisLabel, !1),
                axisTick: ty(ey.axisTick, !1),
                axisType: "interval",
                splitLine: ty(ey.splitLine, !0),
                splitArea: ty(ey.splitArea, !0),
                indicator: []
            }
        });
        var iy = ["axisLine", "axisTickLabel", "axisName"];
        Tf({
            type: "radar", render: function (e, t, i) {
                this.group.removeAll(), this._buildAxes(e), this._buildSplitLineAndArea(e)
            }, _buildAxes: function (e) {
                var t = e.coordinateSystem;
                A(D(t.getIndicatorAxes(), function (e) {
                    return new Kv(e.model, {
                        position: [t.cx, t.cy],
                        rotation: e.angle,
                        labelDirection: -1,
                        tickDirection: -1,
                        nameDirection: 1
                    })
                }), function (e) {
                    A(iy, e.add, e), this.group.add(e.getGroup())
                }, this)
            }, _buildSplitLineAndArea: function (e) {
                var t = e.coordinateSystem, i = t.getIndicatorAxes();
                if (i.length) {
                    var n = e.get("shape"), a = e.getModel("splitLine"), o = e.getModel("splitArea"),
                        r = a.getModel("lineStyle"), s = o.getModel("areaStyle"), l = a.get("show"), d = o.get("show"),
                        u = r.get("color"), c = s.get("color");
                    u = O(u) ? u : [u], c = O(c) ? c : [c];
                    var h = [], f = [];
                    if ("circle" === n) for (var g = i[0].getTicksCoords(), p = t.cx, v = t.cy, m = 0; m < g.length; m++) l && h[_(h, u, m)].push(new Wr({
                        shape: {
                            cx: p,
                            cy: v,
                            r: g[m].coord
                        }
                    })), d && m < g.length - 1 && f[_(f, c, m)].push(new zr({
                        shape: {
                            cx: p,
                            cy: v,
                            r0: g[m].coord,
                            r: g[m + 1].coord
                        }
                    })); else {
                        var y, k = D(i, function (e, i) {
                            var n = e.getTicksCoords();
                            return y = null == y ? n.length - 1 : Math.min(n.length - 1, y), D(n, function (e) {
                                return t.coordToPoint(e.coord, i)
                            })
                        }), w = [];
                        for (m = 0; m <= y; m++) {
                            for (var C = [], S = 0; S < i.length; S++) C.push(k[S][m]);
                            C[0] && C.push(C[0].slice()), l && h[_(h, u, m)].push(new Xr({shape: {points: C}})), d && w && f[_(f, c, m - 1)].push(new $r({shape: {points: C.concat(w)}})), w = C.slice().reverse()
                        }
                    }
                    var b = r.getLineStyle(), I = s.getAreaStyle();
                    A(f, function (e, t) {
                        this.group.add(xs(e, {style: T({stroke: "none", fill: c[t % c.length]}, I), silent: !0}))
                    }, this), A(h, function (e, t) {
                        this.group.add(xs(e, {style: T({fill: "none", stroke: u[t % u.length]}, b), silent: !0}))
                    }, this)
                }

                function _(e, t, i) {
                    var n = i % t.length;
                    return e[n] = e[n] || [], n
                }
            }
        });
        var ny = ec.extend({
            type: "series.radar",
            dependencies: ["radar"],
            init: function (e) {
                ny.superApply(this, "init", arguments), this.legendVisualProvider = new Fm(P(this.getData, this), P(this.getRawData, this))
            },
            getInitialData: function (e, t) {
                return Mm(this, {generateCoord: "indicator_", generateCoordCount: 1 / 0})
            },
            formatTooltip: function (e) {
                var t = this.getData(), i = this.coordinateSystem.getIndicatorAxes(), n = this.getData().getName(e);
                return Ql("" === n ? this.name : n) + "<br/>" + D(i, function (i, n) {
                    var a = t.get(t.mapDimension(i.dim), e);
                    return Ql(i.name + " : " + a)
                }).join("<br />")
            },
            getTooltipPosition: function (e) {
                if (null != e) for (var t = this.getData(), i = this.coordinateSystem, n = t.getValues(D(i.dimensions, function (e) {
                    return t.mapDimension(e)
                }), e, !0), a = 0, o = n.length; a < o; a++) if (!isNaN(n[a])) {
                    var r = i.getIndicatorAxes();
                    return i.coordToPoint(r[a].dataToCoord(n[a]), a)
                }
            },
            defaultOption: {
                zlevel: 0,
                z: 2,
                coordinateSystem: "radar",
                legendHoverLink: !0,
                radarIndex: 0,
                lineStyle: {width: 2, type: "solid"},
                label: {position: "top"},
                symbol: "emptyCircle",
                symbolSize: 4
            }
        });

        function ay(e) {
            return !isNaN(e[0]) && !isNaN(e[1])
        }

        function oy(e) {
            return [e.cx, e.cy]
        }

        Cf({
            type: "radar", render: function (e, t, i) {
                var n = e.coordinateSystem, a = this.group, o = e.getData(), r = this._data;

                function s(e, t) {
                    var i = e.getItemVisual(t, "symbol") || "circle", n = e.getItemVisual(t, "color");
                    if ("none" !== i) {
                        var a = function (e) {
                            return O(e) || (e = [+e, +e]), e
                        }(e.getItemVisual(t, "symbolSize")), o = cp(i, -1, -1, 2, 2, n);
                        return o.attr({style: {strokeNoScale: !0}, z2: 100, scale: [a[0] / 2, a[1] / 2]}), o
                    }
                }

                function l(t, i, n, a, o, r) {
                    n.removeAll();
                    for (var l = 0; l < i.length - 1; l++) {
                        var d = s(a, o);
                        d && (t[d.__dimIdx = l] ? (d.attr("position", t[l]), vl[r ? "initProps" : "updateProps"](d, {position: i[l]}, e, o)) : d.attr("position", i[l]), n.add(d))
                    }
                }

                function d(e) {
                    return D(e, function (e) {
                        return [n.cx, n.cy]
                    })
                }

                o.diff(r).add(function (t) {
                    var i = o.getItemLayout(t);
                    if (i) {
                        var n = new $r, a = new Xr, r = {shape: {points: i}};
                        n.shape.points = d(i), a.shape.points = d(i), rl(n, r, e, t), rl(a, r, e, t);
                        var s = new Di, u = new Di;
                        s.add(a), s.add(n), s.add(u), l(a.shape.points, i, u, o, t, !0), o.setItemGraphicEl(t, s)
                    }
                }).update(function (t, i) {
                    var n = r.getItemGraphicEl(i), a = n.childAt(0), s = n.childAt(1), d = n.childAt(2),
                        u = {shape: {points: o.getItemLayout(t)}};
                    u.shape.points && (l(a.shape.points, u.shape.points, d, o, t, !1), ol(a, u, e), ol(s, u, e), o.setItemGraphicEl(t, n))
                }).remove(function (e) {
                    a.remove(r.getItemGraphicEl(e))
                }).execute(), o.eachItemGraphicEl(function (e, t) {
                    var i = o.getItemModel(t), n = e.childAt(0), r = e.childAt(1), s = e.childAt(2),
                        l = o.getItemVisual(t, "color");
                    a.add(e), n.useStyle(T(i.getModel("lineStyle").getLineStyle(), {
                        fill: "none",
                        stroke: l
                    })), n.hoverStyle = i.getModel("emphasis.lineStyle").getLineStyle();
                    var d = i.getModel("areaStyle"), u = i.getModel("emphasis.areaStyle"),
                        c = d.isEmpty() && d.parentModel.isEmpty(), h = u.isEmpty() && u.parentModel.isEmpty();
                    h = h && c, r.ignore = c, r.useStyle(T(d.getAreaStyle(), {
                        fill: l,
                        opacity: .7
                    })), r.hoverStyle = u.getAreaStyle();
                    var f = i.getModel("itemStyle").getItemStyle(["color"]),
                        g = i.getModel("emphasis.itemStyle").getItemStyle(), p = i.getModel("label"),
                        m = i.getModel("emphasis.label");
                    s.eachChild(function (e) {
                        e.setStyle(f), e.hoverStyle = v(g);
                        var i = o.get(o.dimensions[e.__dimIdx], t);
                        null != i && !isNaN(i) || (i = ""), qs(e.style, e.hoverStyle, p, m, {
                            labelFetcher: o.hostModel,
                            labelDataIndex: t,
                            labelDimIndex: e.__dimIdx,
                            defaultText: i,
                            autoColor: l,
                            isRectText: !0
                        })
                    }), e.highDownOnUpdate = function (e, t) {
                        r.attr("ignore", "emphasis" === t ? h : c)
                    }, js(e)
                }), this._data = o
            }, remove: function () {
                this.group.removeAll(), this._data = null
            }, dispose: function () {
            }
        }), vf(Vm("radar")), vf(mv("radar", "circle")), pf(function (e) {
            e.eachSeriesByType("radar", function (e) {
                var t = e.getData(), i = [], n = e.coordinateSystem;
                if (n) {
                    var a = n.getIndicatorAxes();
                    A(a, function (e, o) {
                        t.each(t.mapDimension(a[o].dim), function (e, t) {
                            i[t] = i[t] || [];
                            var a = n.dataToPoint(e, o);
                            i[t][o] = ay(a) ? a : oy(n)
                        })
                    }), t.each(function (e) {
                        var a = E(i[e], function (e) {
                            return ay(e)
                        }) || oy(n);
                        i[e].push(a.slice()), t.setItemLayout(e, i[e])
                    })
                }
            })
        }), hf(Xm("radar")), cf(function (e) {
            var t = e.polar;
            if (t) {
                O(t) || (t = [t]);
                var i = [];
                A(t, function (t, n) {
                    t.indicator ? (t.type && !t.shape && (t.shape = t.type), e.radar = e.radar || [], O(e.radar) || (e.radar = [e.radar]), e.radar.push(t)) : i.push(t)
                }), e.polar = i
            }
            A(e.series, function (e) {
                e && "radar" === e.type && e.polarIndex && (e.radarIndex = e.polarIndex)
            })
        });
        for (var ry = [126, 25], sy = [[[0, 3.5], [7, 11.2], [15, 11.9], [30, 7], [42, .7], [52, .7], [56, 7.7], [59, .7], [64, .7], [64, 0], [5, 0], [0, 3.5]], [[13, 16.1], [19, 14.7], [16, 21.7], [11, 23.1], [13, 16.1]], [[12, 32.2], [14, 38.5], [15, 38.5], [13, 32.2], [12, 32.2]], [[16, 47.6], [12, 53.2], [13, 53.2], [18, 47.6], [16, 47.6]], [[6, 64.4], [8, 70], [9, 70], [8, 64.4], [6, 64.4]], [[23, 82.6], [29, 79.8], [30, 79.8], [25, 82.6], [23, 82.6]], [[37, 70.7], [43, 62.3], [44, 62.3], [39, 70.7], [37, 70.7]], [[48, 51.1], [51, 45.5], [53, 45.5], [50, 51.1], [48, 51.1]], [[51, 35], [51, 28.7], [53, 28.7], [53, 35], [51, 35]], [[52, 22.4], [55, 17.5], [56, 17.5], [53, 22.4], [52, 22.4]], [[58, 12.6], [62, 7], [63, 7], [60, 12.6], [58, 12.6]], [[0, 3.5], [0, 93.1], [64, 93.1], [64, 0], [63, 0], [63, 92.4], [1, 92.4], [1, 3.5], [0, 3.5]]], ly = 0; ly < sy.length; ly++) for (var dy = 0; dy < sy[ly].length; dy++) sy[ly][dy][0] /= 10.5, sy[ly][dy][1] /= -14, sy[ly][dy][0] += ry[0], sy[ly][dy][1] += ry[1];
        var uy = {"南海诸岛": [32, 80], "广东": [0, -10], "香港": [10, 5], "澳门": [-10, 10], "天津": [5, 5]},
            cy = {Russia: [100, 60], "United States": [-99, 38], "United States of America": [-99, 38]}, hy = Wa(),
            fy = {
                load: function (e, t, i) {
                    var n = hy(t).parsed;
                    if (n) return n;
                    var a, o = t.specialAreas || {}, r = t.geoJSON;
                    try {
                        a = r ? kp(r, i) : []
                    } catch (t) {
                        throw new Error("Invalid geoJson format\n" + t.message)
                    }
                    return A(a, function (t) {
                        var i = t.name;
                        !function (e, t) {
                            if ("china" === e) {
                                var i = uy[t.name];
                                if (i) {
                                    var n = t.center;
                                    n[0] += i[0] / 10.5, n[1] += -i[1] / 14
                                }
                            }
                        }(e, t), function (e, t) {
                            if ("world" === e) {
                                var i = cy[t.name];
                                if (i) {
                                    var n = t.center;
                                    n[0] = i[0], n[1] = i[1]
                                }
                            }
                        }(e, t);
                        var n = o[i];
                        n && t.transformTo(n.left, n.top, n.width, n.height)
                    }), hy(t).parsed = {
                        regions: a, boundingRect: function (e) {
                            for (var t, i = 0; i < e.length; i++) {
                                var n = e[i].getBoundingRect();
                                (t = t || n.clone()).union(n)
                            }
                            return t
                        }(a)
                    }
                }
            }, gy = Wa();

        function py(e, t) {
            var i, n, a = e.svgXML;
            try {
                $(null != (n = (i = a && function (e, t) {
                    return (new nh).parse(e, {ignoreViewBox: !0, ignoreRootClip: !0})
                }(a) || {}).root))
            } catch (e) {
                throw new Error("Invalid svg format\n" + e.message)
            }
            var o = i.width, r = i.height, s = i.viewBoxRect;
            if (t || (t = null == o || null == r ? n.getBoundingRect() : new Ai(0, 0, 0, 0), null != o && (t.width = o), null != r && (t.height = r)), s) {
                var l = gh(s, t.width, t.height), d = n;
                (n = new Di).add(d), d.scale = l.scale, d.position = l.position
            }
            return n.setClipPath(new es({shape: t.plain()})), {root: n, boundingRect: t}
        }

        var vy = {
            geoJSON: fy, svg: {
                load: function (e, t) {
                    var i = gy(t).originRoot;
                    if (i) return {root: i, boundingRect: gy(t).boundingRect};
                    var n = py(t);
                    return gy(t).originRoot = n.root, gy(t).boundingRect = n.boundingRect, n
                }, makeGraphic: function (e, t, i) {
                    var n = gy(t), a = n.rootMap || (n.rootMap = Q()), o = a.get(i);
                    if (o) return o;
                    var r = n.originRoot, s = n.boundingRect;
                    return o = n.originRootHostKey ? py(t, s).root : (n.originRootHostKey = i, r), a.set(i, o)
                }, removeGraphic: function (e, t, i) {
                    var n = gy(t), a = n.rootMap;
                    a && a.removeKey(i), i === n.originRootHostKey && (n.originRootHostKey = null)
                }
            }
        }, my = {
            load: function (e, t, i) {
                var n, a = [], o = Q(), r = Q();
                return A(ky(e), function (s) {
                    var l = vy[s.type].load(e, s, i);
                    A(l.regions, function (e) {
                        var i = e.name;
                        t && t.hasOwnProperty(i) && (e = e.cloneShallow(i = t[i])), a.push(e), o.set(i, e), r.set(i, e.center)
                    });
                    var d = l.boundingRect;
                    d && (n ? n.union(d) : n = d.clone())
                }), {regions: a, regionsMap: o, nameCoordMap: r, boundingRect: n || new Ai(0, 0, 0, 0)}
            }, makeGraphic: yy("makeGraphic"), removeGraphic: yy("removeGraphic")
        };

        function yy(e) {
            return function (t, i) {
                var n = ky(t), a = [];
                return A(n, function (n) {
                    var o = vy[n.type][e];
                    o && a.push(o(t, n, i))
                }), a
            }
        }

        function ky(e) {
            return vh.retrieveMap(e) || []
        }

        I(ec.extend({
            type: "series.map",
            dependencies: ["geo"],
            layoutMode: "box",
            needsDrawMap: !1,
            seriesGroup: [],
            getInitialData: function (e) {
                for (var t = Mm(this, {
                    coordDimensions: ["value"],
                    encodeDefaulter: M(Gd, this)
                }), i = t.mapDimension("value"), n = Q(), a = [], o = [], r = 0, s = t.count(); r < s; r++) {
                    var l = t.getName(r);
                    n.set(l, !0), a.push({name: l, value: t.get(i, r), selected: Bu(t, r, "selected")})
                }
                return A(my.load(this.getMapType(), this.option.nameMap, this.option.nameProperty).regions, function (e) {
                    var t = e.name;
                    n.get(t) || (a.push({name: t}), o.push(t))
                }), this.updateSelectedMap(a), t.appendValues([], o), t
            },
            getHostGeoModel: function () {
                var e = this.option.geoIndex;
                return null != e ? this.dependentModels.geo[e] : null
            },
            getMapType: function () {
                return (this.getHostGeoModel() || this).option.map
            },
            getRawValue: function (e) {
                var t = this.getData();
                return t.get(t.mapDimension("value"), e)
            },
            getRegionModel: function (e) {
                var t = this.getData();
                return t.getItemModel(t.indexOfName(e))
            },
            formatTooltip: function (e) {
                for (var t = this.getData(), i = Xl(this.getRawValue(e)), n = t.getName(e), a = this.seriesGroup, o = [], r = 0; r < a.length; r++) {
                    var s = a[r].originalData.indexOfName(n), l = t.mapDimension("value");
                    isNaN(a[r].originalData.get(l, s)) || o.push(Ql(a[r].name))
                }
                return o.join(", ") + "<br />" + Ql(n + " : " + i)
            },
            getTooltipPosition: function (e) {
                if (null != e) {
                    var t = this.getData().getName(e), i = this.coordinateSystem, n = i.getRegion(t);
                    return n && i.dataToPoint(n.center)
                }
            },
            setZoom: function (e) {
                this.option.zoom = e
            },
            setCenter: function (e) {
                this.option.center = e
            },
            defaultOption: {
                zlevel: 0,
                z: 2,
                coordinateSystem: "geo",
                map: "",
                left: "center",
                top: "center",
                aspectScale: .75,
                showLegendSymbol: !0,
                dataRangeHoverLink: !0,
                boundingCoords: null,
                center: null,
                zoom: 1,
                scaleLimit: null,
                label: {show: !1, color: "#000"},
                itemStyle: {borderWidth: .5, borderColor: "#444", areaColor: "#eee"},
                emphasis: {label: {show: !0, color: "rgb(100,0,0)"}, itemStyle: {areaColor: "rgba(255,215,0,0.8)"}},
                nameProperty: "name"
            }
        }), Om);
        var Ty = "\0_ec_interaction_mutex";

        function wy(e, t) {
            return !!Cy(e)[t]
        }

        function Cy(e) {
            return e[Ty] || (e[Ty] = {})
        }

        function Sy(e) {
            this.pointerChecker, this._zr = e, this._opt = {};
            var t = P, i = t(by, this), n = t(Iy, this), a = t(_y, this), o = t(Ay, this), r = t(Dy, this);
            xe.call(this), this.setPointerChecker = function (e) {
                this.pointerChecker = e
            }, this.enable = function (t, s) {
                this.disable(), this._opt = T(v(s) || {}, {
                    zoomOnMouseWheel: !0,
                    moveOnMouseMove: !0,
                    moveOnMouseWheel: !1,
                    preventDefaultMouseMove: !0
                }), null == t && (t = !0), !0 !== t && "move" !== t && "pan" !== t || (e.on("mousedown", i), e.on("mousemove", n), e.on("mouseup", a)), !0 !== t && "scale" !== t && "zoom" !== t || (e.on("mousewheel", o), e.on("pinch", r))
            }, this.disable = function () {
                e.off("mousedown", i), e.off("mousemove", n), e.off("mouseup", a), e.off("mousewheel", o), e.off("pinch", r)
            }, this.dispose = this.disable, this.isDragging = function () {
                return this._dragging
            }, this.isPinching = function () {
                return this._pinching
            }
        }

        function by(e) {
            if (!($e(e) || e.target && e.target.draggable)) {
                var t = e.offsetX, i = e.offsetY;
                this.pointerChecker && this.pointerChecker(e, t, i) && (this._x = t, this._y = i, this._dragging = !0)
            }
        }

        function Iy(e) {
            if (this._dragging && Ey("moveOnMouseMove", e, this._opt) && "pinch" !== e.gestureEvent && !wy(this._zr, "globalPan")) {
                var t = e.offsetX, i = e.offsetY, n = this._x, a = this._y, o = t - n, r = i - a;
                this._x = t, this._y = i, this._opt.preventDefaultMouseMove && Ge(e.event), Ny(this, "pan", "moveOnMouseMove", e, {
                    dx: o,
                    dy: r,
                    oldX: n,
                    oldY: a,
                    newX: t,
                    newY: i
                })
            }
        }

        function _y(e) {
            $e(e) || (this._dragging = !1)
        }

        function Ay(e) {
            var t = Ey("zoomOnMouseWheel", e, this._opt), i = Ey("moveOnMouseWheel", e, this._opt), n = e.wheelDelta,
                a = Math.abs(n), o = e.offsetX, r = e.offsetY;
            if (0 !== n && (t || i)) {
                if (t) {
                    var s = 3 < a ? 1.4 : 1 < a ? 1.2 : 1.1;
                    xy(this, "zoom", "zoomOnMouseWheel", e, {scale: 0 < n ? s : 1 / s, originX: o, originY: r})
                }
                if (i) {
                    var l = Math.abs(n);
                    xy(this, "scrollMove", "moveOnMouseWheel", e, {
                        scrollDelta: (0 < n ? 1 : -1) * (3 < l ? .4 : 1 < l ? .15 : .05),
                        originX: o,
                        originY: r
                    })
                }
            }
        }

        function Dy(e) {
            wy(this._zr, "globalPan") || xy(this, "zoom", null, e, {
                scale: 1 < e.pinchScale ? 1.1 : 1 / 1.1,
                originX: e.pinchX,
                originY: e.pinchY
            })
        }

        function xy(e, t, i, n, a) {
            e.pointerChecker && e.pointerChecker(n, a.originX, a.originY) && (Ge(n.event), Ny(e, t, i, n, a))
        }

        function Ny(e, t, i, n, a) {
            a.isAvailableBehavior = P(Ey, null, i, n), e.trigger(t, a)
        }

        function Ey(e, t, i) {
            var n = i[e];
            return !e || n && (!L(n) || t.event[n + "Key"])
        }

        function Py(e, t, i) {
            var n = e.target, a = n.position;
            a[0] += t, a[1] += i, n.dirty()
        }

        function My(e, t, i, n) {
            var a = e.target, o = e.zoomLimit, r = a.position, s = a.scale, l = e.zoom = e.zoom || 1;
            if (l *= t, o) {
                var d = o.min || 0, u = o.max || 1 / 0;
                l = Math.max(Math.min(u, l), d)
            }
            var c = l / e.zoom;
            e.zoom = l, r[0] -= (i - r[0]) * (c - 1), r[1] -= (n - r[1]) * (c - 1), s[0] *= c, s[1] *= c, a.dirty()
        }

        ff({type: "takeGlobalCursor", event: "globalCursorTaken", update: "update"}, function () {
        }), I(Sy, xe);
        var Oy = {axisPointer: 1, tooltip: 1, brush: 1};

        function Fy(e, t, i) {
            var n = t.getComponentByElement(e.topTarget), a = n && n.coordinateSystem;
            return n && n !== i && !Oy[n.mainType] && a && a.model !== i
        }

        function Ly(e) {
            var t = e.getItemStyle(), i = e.get("areaColor");
            return null != i && (t.fill = i), t
        }

        function By(e, t) {
            t.eachChild(function (t) {
                A(t.__regions, function (i) {
                    t.trigger(e.isSelected(i.name) ? "emphasis" : "normal")
                })
            })
        }

        function Uy(e, t) {
            var i = new Di;
            this.uid = Al("ec_map_draw"), this._controller = new Sy(e.getZr()), this._controllerHost = {target: t ? i : null}, this.group = i, this._updateGroup = t, this._mouseDownFlag, this._mapName, this._initialized, i.add(this._regionsGroup = new Di), i.add(this._backgroundGroup = new Di)
        }

        Uy.prototype = {
            constructor: Uy, draw: function (e, t, i, n, a) {
                var o = "geo" === e.mainType, r = e.getData && e.getData();
                o && t.eachComponent({mainType: "series", subType: "map"}, function (t) {
                    r || t.getHostGeoModel() !== e || (r = t.getData())
                });
                var s = e.coordinateSystem;
                this._updateBackground(s);
                var l, d = this._regionsGroup, u = this.group, c = s.getTransformInfo(), h = !d.childAt(0) || a;
                if (h) u.transform = c.roamTransform, u.decomposeTransform(), u.dirty(); else {
                    var f = new mt;
                    f.transform = c.roamTransform, f.decomposeTransform();
                    var g = {scale: f.scale, position: f.position};
                    l = f.scale, ol(u, g, e)
                }
                var p = c.rawScale, v = c.rawPosition;
                d.removeAll();
                var m = ["itemStyle"], y = ["emphasis", "itemStyle"], k = ["label"], T = ["emphasis", "label"], w = Q();
                A(s.regions, function (t) {
                    var i = w.get(t.name) || w.set(t.name, new Di),
                        n = new ls({segmentIgnoreThreshold: 1, shape: {paths: []}});
                    i.add(n);
                    var a, s = (O = e.getRegionModel(t.name) || e).getModel(m), c = O.getModel(y), f = Ly(s), g = Ly(c),
                        C = O.getModel(k), S = O.getModel(T);
                    if (r) {
                        a = r.indexOfName(t.name);
                        var b = r.getItemVisual(a, "color", !0);
                        b && (f.fill = b)
                    }

                    function I(e) {
                        return [e[0] * p[0] + v[0], e[1] * p[1] + v[1]]
                    }

                    A(t.geometries, function (e) {
                        if ("polygon" === e.type) {
                            for (var t = [], i = 0; i < e.exterior.length; ++i) t.push(I(e.exterior[i]));
                            for (n.shape.paths.push(new $r({
                                segmentIgnoreThreshold: 1,
                                shape: {points: t}
                            })), i = 0; i < (e.interiors ? e.interiors.length : 0); ++i) {
                                for (var a = e.interiors[i], o = (t = [], 0); o < a.length; ++o) t.push(I(a[o]));
                                n.shape.paths.push(new $r({segmentIgnoreThreshold: 1, shape: {points: t}}))
                            }
                        }
                    }), n.setStyle(f), n.style.strokeNoScale = !0, n.culling = !0;
                    var _ = C.get("show"), D = S.get("show"), x = r && isNaN(r.get(r.mapDimension("value"), a)),
                        N = r && r.getItemLayout(a);
                    if (o || x && (_ || D) || N && N.showLabel) {
                        var E, P = o ? t.name : a;
                        (!r || 0 <= a) && (E = e);
                        var M = new Rr({
                            position: I(t.center.slice()),
                            scale: [1 / u.scale[0], 1 / u.scale[1]],
                            z2: 10,
                            silent: !0
                        });
                        qs(M.style, M.hoverStyle = {}, C, S, {
                            labelFetcher: E,
                            labelDataIndex: P,
                            defaultText: t.name,
                            useInsideStyle: !1
                        }, {
                            textAlign: "center",
                            textVerticalAlign: "middle"
                        }), h || ol(M, {scale: [1 / l[0], 1 / l[1]]}, e), i.add(M)
                    }
                    if (r) r.setItemGraphicEl(a, i); else {
                        var O = e.getRegionModel(t.name);
                        n.eventData = {
                            componentType: "geo",
                            componentIndex: e.componentIndex,
                            geoIndex: e.componentIndex,
                            name: t.name,
                            region: O && O.option || {}
                        }
                    }
                    (i.__regions || (i.__regions = [])).push(t), i.highDownSilentOnTouch = !!e.get("selectedMode"), js(i, g), d.add(i)
                }), this._updateController(e, t, i), function (e, t, i, n, a) {
                    i.off("click"), i.off("mousedown"), t.get("selectedMode") && (i.on("mousedown", function () {
                        e._mouseDownFlag = !0
                    }), i.on("click", function (o) {
                        if (e._mouseDownFlag) {
                            e._mouseDownFlag = !1;
                            for (var r = o.target; !r.__regions;) r = r.parent;
                            if (r) {
                                var s = {
                                    type: ("geo" === t.mainType ? "geo" : "map") + "ToggleSelect",
                                    batch: D(r.__regions, function (e) {
                                        return {name: e.name, from: a.uid}
                                    })
                                };
                                s[t.mainType + "Id"] = t.id, n.dispatchAction(s), By(t, i)
                            }
                        }
                    }))
                }(this, e, d, i, n), By(e, d)
            }, remove: function () {
                this._regionsGroup.removeAll(), this._backgroundGroup.removeAll(), this._controller.dispose(), this._mapName && my.removeGraphic(this._mapName, this.uid), this._mapName = null, this._controllerHost = {}
            }, _updateBackground: function (e) {
                var t = e.map;
                this._mapName !== t && A(my.makeGraphic(t, this.uid), function (e) {
                    this._backgroundGroup.add(e)
                }, this), this._mapName = t
            }, _updateController: function (e, t, i) {
                var n = e.coordinateSystem, a = this._controller, o = this._controllerHost;
                o.zoomLimit = e.get("scaleLimit"), o.zoom = n.getZoom(), a.enable(e.get("roam") || !1);
                var r = e.mainType;

                function s() {
                    var t = {type: "geoRoam", componentType: r};
                    return t[r + "Id"] = e.id, t
                }

                a.off("pan").on("pan", function (e) {
                    this._mouseDownFlag = !1, Py(o, e.dx, e.dy), i.dispatchAction(k(s(), {dx: e.dx, dy: e.dy}))
                }, this), a.off("zoom").on("zoom", function (e) {
                    if (this._mouseDownFlag = !1, My(o, e.scale, e.originX, e.originY), i.dispatchAction(k(s(), {
                        zoom: e.scale,
                        originX: e.originX,
                        originY: e.originY
                    })), this._updateGroup) {
                        var t = this.group.scale;
                        this._regionsGroup.traverse(function (e) {
                            "text" === e.type && e.attr("scale", [1 / t[0], 1 / t[1]])
                        })
                    }
                }, this), a.setPointerChecker(function (t, a, o) {
                    return n.getViewRectAfterRoam().contain(a, o) && !Fy(t, i, e)
                })
            }
        };
        var Ry = "__seriesMapHighDown", Ky = "__seriesMapCallKey";

        function Wy(e) {
            var t = this[Ry];
            t && t.recordVersion === this[Ky] && Vy(t, e)
        }

        function Vy(e, t) {
            var i = e.circle, n = e.labelModel, a = e.hoverLabelModel, o = e.emphasisText, r = e.normalText;
            t ? (i.style.extendFrom(Js({}, a, {text: a.get("show") ? o : null}, {
                isRectText: !0,
                useInsideStyle: !1
            }, !0)), i.__mapOriginalZ2 = i.z2, i.z2 += vs) : (Js(i.style, n, {
                text: n.get("show") ? r : null,
                textPosition: n.getShallow("position") || "bottom"
            }, {
                isRectText: !0,
                useInsideStyle: !1
            }), i.dirty(!1), null != i.__mapOriginalZ2 && (i.z2 = i.__mapOriginalZ2, i.__mapOriginalZ2 = null))
        }

        function Hy(e, t, i) {
            var n = e.getZoom(), a = e.getCenter(), o = t.zoom, r = e.dataToPoint(a);
            if (null != t.dx && null != t.dy && (r[0] -= t.dx, r[1] -= t.dy, a = e.pointToData(r), e.setCenter(a)), null != o) {
                if (i) {
                    var s = i.min || 0, l = i.max || 1 / 0;
                    o = Math.max(Math.min(n * o, l), s) / n
                }
                e.scale[0] *= o, e.scale[1] *= o;
                var d = e.position, u = (t.originX - d[0]) * (o - 1), c = (t.originY - d[1]) * (o - 1);
                d[0] -= u, d[1] -= c, e.updateTransform(), a = e.pointToData(r), e.setCenter(a), e.setZoom(o * n)
            }
            return {center: e.getCenter(), zoom: e.getZoom()}
        }

        Cf({
            type: "map", render: function (e, t, i, n) {
                if (!n || "mapToggleSelect" !== n.type || n.from !== this.uid) {
                    var a = this.group;
                    if (a.removeAll(), !e.getHostGeoModel()) {
                        if (n && "geoRoam" === n.type && "series" === n.componentType && n.seriesId === e.id) (o = this._mapDraw) && a.add(o.group); else if (e.needsDrawMap) {
                            var o = this._mapDraw || new Uy(i, !0);
                            a.add(o.group), o.draw(e, t, i, this, n), this._mapDraw = o
                        } else this._mapDraw && this._mapDraw.remove(), this._mapDraw = null;
                        e.get("showLegendSymbol") && t.getComponent("legend") && this._renderSymbols(e, t, i)
                    }
                }
            }, remove: function () {
                this._mapDraw && this._mapDraw.remove(), this._mapDraw = null, this.group.removeAll()
            }, dispose: function () {
                this._mapDraw && this._mapDraw.remove(), this._mapDraw = null
            }, _renderSymbols: function (e, t, i) {
                var n = e.originalData, a = this.group;
                n.each(n.mapDimension("value"), function (t, i) {
                    if (!isNaN(t)) {
                        var o = n.getItemLayout(i);
                        if (o && o.point) {
                            var r = o.point, s = o.offset, l = new Wr({
                                style: {fill: e.getData().getVisual("color")},
                                shape: {cx: r[0] + 9 * s, cy: r[1], r: 3},
                                silent: !0,
                                z2: 8 + (s ? 0 : vs + 1)
                            });
                            if (!s) {
                                var d = e.mainSeries.getData(), u = n.getName(i), c = d.indexOfName(u),
                                    h = n.getItemModel(i), f = h.getModel("label"), g = h.getModel("emphasis.label"),
                                    p = d.getItemGraphicEl(c), v = H(e.getFormattedLabel(c, "normal"), u),
                                    m = H(e.getFormattedLabel(c, "emphasis"), v), y = p[Ry], T = Math.random();
                                if (!y) {
                                    y = p[Ry] = {};
                                    var w = M(Wy, !0), C = M(Wy, !1);
                                    p.on("mouseover", w).on("mouseout", C).on("emphasis", w).on("normal", C)
                                }
                                k(y, {
                                    recordVersion: p[Ky] = T,
                                    circle: l,
                                    labelModel: f,
                                    hoverLabelModel: g,
                                    emphasisText: m,
                                    normalText: v
                                }), Vy(y, !1)
                            }
                            a.add(l)
                        }
                    }
                })
            }
        }), ff({type: "geoRoam", event: "geoRoam", update: "updateTransform"}, function (e, t) {
            var i = e.componentType || "series";
            t.eachComponent({mainType: i, query: e}, function (t) {
                var n = t.coordinateSystem;
                if ("geo" === n.type) {
                    var a = Hy(n, e, t.get("scaleLimit"));
                    t.setCenter && t.setCenter(a.center), t.setZoom && t.setZoom(a.zoom), "series" === i && A(t.seriesGroup, function (e) {
                        e.setCenter(a.center), e.setZoom(a.zoom)
                    })
                }
            })
        });
        var zy = Ce;

        function jy() {
            mt.call(this)
        }

        function Gy(e) {
            this.name = e, this.zoomLimit, mt.call(this), this._roamTransformable = new jy, this._rawTransformable = new jy, this._center, this._zoom
        }

        function $y(e, t, i, n) {
            var a = i.seriesModel, o = a ? a.coordinateSystem : null;
            return o === this ? o[e](n) : null
        }

        function Xy(e, t, i, n) {
            Gy.call(this, e), this.map = t;
            var a = my.load(t, i);
            this._nameCoordMap = a.nameCoordMap, this._regionsMap = a.regionsMap, this._invertLongitute = null == n || n, this.regions = a.regions, this._rect = a.boundingRect
        }

        function qy(e, t, i, n) {
            var a = i.geoModel, o = i.seriesModel,
                r = a ? a.coordinateSystem : o ? o.coordinateSystem || (o.getReferringComponents("geo")[0] || {}).coordinateSystem : null;
            return r === this ? r[e](n) : null
        }

        function Yy(e, t) {
            var i = e.get("boundingCoords");
            if (null != i) {
                var n = i[0], a = i[1];
                isNaN(n[0]) || isNaN(n[1]) || isNaN(a[0]) || isNaN(a[1]) || this.setBoundingRect(n[0], n[1], a[0] - n[0], a[1] - n[1])
            }
            var o, r = this.getBoundingRect(), s = e.get("layoutCenter"), l = e.get("layoutSize"), d = t.getWidth(),
                u = t.getHeight(), c = r.width / r.height * this.aspectScale, h = !1;
            if (s && l && (s = [Nl(s[0], d), Nl(s[1], u)], l = Nl(l, Math.min(d, u)), isNaN(s[0]) || isNaN(s[1]) || isNaN(l) || (h = !0)), h) {
                var f = {};
                1 < c ? (f.width = l, f.height = l / c) : (f.height = l, f.width = l * c), f.y = s[1] - f.height / 2, f.x = s[0] - f.width / 2
            } else (o = e.getBoxLayoutParams()).aspect = c, f = vd(o, {width: d, height: u});
            this.setViewRect(f.x, f.y, f.width, f.height), this.setCenter(e.get("center")), this.setZoom(e.get("zoom"))
        }

        function Jy(e, t) {
            A(t.get("geoCoord"), function (t, i) {
                e.addGeoCoord(i, t)
            })
        }

        I(jy, mt), Gy.prototype = {
            constructor: Gy,
            type: "view",
            dimensions: ["x", "y"],
            setBoundingRect: function (e, t, i, n) {
                return this._rect = new Ai(e, t, i, n), this._rect
            },
            getBoundingRect: function () {
                return this._rect
            },
            setViewRect: function (e, t, i, n) {
                this.transformTo(e, t, i, n), this._viewRect = new Ai(e, t, i, n)
            },
            transformTo: function (e, t, i, n) {
                var a = this.getBoundingRect(), o = this._rawTransformable;
                o.transform = a.calculateTransform(new Ai(e, t, i, n)), o.decomposeTransform(), this._updateTransform()
            },
            setCenter: function (e) {
                e && (this._center = e, this._updateCenterAndZoom())
            },
            setZoom: function (e) {
                e = e || 1;
                var t = this.zoomLimit;
                t && (null != t.max && (e = Math.min(t.max, e)), null != t.min && (e = Math.max(t.min, e))), this._zoom = e, this._updateCenterAndZoom()
            },
            getDefaultCenter: function () {
                var e = this.getBoundingRect();
                return [e.x + e.width / 2, e.y + e.height / 2]
            },
            getCenter: function () {
                return this._center || this.getDefaultCenter()
            },
            getZoom: function () {
                return this._zoom || 1
            },
            getRoamTransform: function () {
                return this._roamTransformable.getLocalTransform()
            },
            _updateCenterAndZoom: function () {
                var e = this._rawTransformable.getLocalTransform(), t = this._roamTransformable,
                    i = this.getDefaultCenter(), n = this.getCenter(), a = this.getZoom();
                n = Ce([], n, e), i = Ce([], i, e), t.origin = n, t.position = [i[0] - n[0], i[1] - n[1]], t.scale = [a, a], this._updateTransform()
            },
            _updateTransform: function () {
                var e = this._roamTransformable, t = this._rawTransformable;
                (t.parent = e).updateTransform(), t.updateTransform(), st(this.transform || (this.transform = []), t.transform || ot()), this._rawTransform = t.getLocalTransform(), this.invTransform = this.invTransform || [], ht(this.invTransform, this.transform), this.decomposeTransform()
            },
            getTransformInfo: function () {
                var e = this._roamTransformable.transform, t = this._rawTransformable;
                return {roamTransform: e ? j(e) : ot(), rawScale: j(t.scale), rawPosition: j(t.position)}
            },
            getViewRect: function () {
                return this._viewRect
            },
            getViewRectAfterRoam: function () {
                var e = this.getBoundingRect().clone();
                return e.applyTransform(this.transform), e
            },
            dataToPoint: function (e, t, i) {
                var n = t ? this._rawTransform : this.transform;
                return i = i || [], n ? zy(i, e, n) : oe(i, e)
            },
            pointToData: function (e) {
                var t = this.invTransform;
                return t ? zy([], e, t) : [e[0], e[1]]
            },
            convertToPixel: M($y, "dataToPoint"),
            convertFromPixel: M($y, "pointToData"),
            containPoint: function (e) {
                return this.getViewRectAfterRoam().contain(e[0], e[1])
            }
        }, I(Gy, mt), Xy.prototype = {
            constructor: Xy,
            type: "geo",
            dimensions: ["lng", "lat"],
            containCoord: function (e) {
                for (var t = this.regions, i = 0; i < t.length; i++) if (t[i].contain(e)) return !0;
                return !1
            },
            transformTo: function (e, t, i, n) {
                var a = this.getBoundingRect(), o = this._invertLongitute;
                a = a.clone(), o && (a.y = -a.y - a.height);
                var r = this._rawTransformable;
                if (r.transform = a.calculateTransform(new Ai(e, t, i, n)), r.decomposeTransform(), o) {
                    var s = r.scale;
                    s[1] = -s[1]
                }
                r.updateTransform(), this._updateTransform()
            },
            getRegion: function (e) {
                return this._regionsMap.get(e)
            },
            getRegionByCoord: function (e) {
                for (var t = this.regions, i = 0; i < t.length; i++) if (t[i].contain(e)) return t[i]
            },
            addGeoCoord: function (e, t) {
                this._nameCoordMap.set(e, t)
            },
            getGeoCoord: function (e) {
                return this._nameCoordMap.get(e)
            },
            getBoundingRect: function () {
                return this._rect
            },
            dataToPoint: function (e, t, i) {
                if ("string" == typeof e && (e = this.getGeoCoord(e)), e) return Gy.prototype.dataToPoint.call(this, e, t, i)
            },
            convertToPixel: M(qy, "dataToPoint"),
            convertFromPixel: M(qy, "pointToData")
        }, I(Xy, Gy);
        var Zy = {
            dimensions: Xy.prototype.dimensions, create: function (e, t) {
                var i = [];
                e.eachComponent("geo", function (e, n) {
                    var a = e.get("map"), o = e.get("aspectScale"), r = !0, s = vh.retrieveMap(a);
                    s && s[0] && "svg" === s[0].type ? (null == o && (o = 1), r = !1) : null == o && (o = .75);
                    var l = new Xy(a + n, a, e.get("nameMap"), r);
                    l.aspectScale = o, l.zoomLimit = e.get("scaleLimit"), i.push(l), Jy(l, e), (e.coordinateSystem = l).model = e, l.resize = Yy, l.resize(e, t)
                }), e.eachSeries(function (e) {
                    if ("geo" === e.get("coordinateSystem")) {
                        var t = e.get("geoIndex") || 0;
                        e.coordinateSystem = i[t]
                    }
                });
                var n = {};
                return e.eachSeriesByType("map", function (e) {
                    if (!e.getHostGeoModel()) {
                        var t = e.getMapType();
                        n[t] = n[t] || [], n[t].push(e)
                    }
                }), A(n, function (e, n) {
                    var a = new Xy(n, n, y(D(e, function (e) {
                        return e.get("nameMap")
                    })));
                    a.zoomLimit = V.apply(null, D(e, function (e) {
                        return e.get("scaleLimit")
                    })), i.push(a), a.resize = Yy, a.aspectScale = e[0].get("aspectScale"), a.resize(e[0], t), A(e, function (e) {
                        Jy(e.coordinateSystem = a, e)
                    })
                }), i
            }, getFilledRegions: function (e, t, i) {
                for (var n = (e || []).slice(), a = Q(), o = 0; o < n.length; o++) a.set(n[o].name, n[o]);
                return A(my.load(t, i).regions, function (e) {
                    var t = e.name;
                    a.get(t) || n.push({name: t})
                }), n
            }
        };
        gf("geo", Zy), pf(function (e) {
            var t = {};
            e.eachSeriesByType("map", function (i) {
                var n = i.getMapType();
                if (!i.getHostGeoModel() && !t[n]) {
                    var a = {};
                    A(i.seriesGroup, function (t) {
                        var i = t.coordinateSystem, n = t.originalData;
                        t.get("showLegendSymbol") && e.getComponent("legend") && n.each(n.mapDimension("value"), function (e, t) {
                            var o = n.getName(t), r = i.getRegion(o);
                            if (r && !isNaN(e)) {
                                var s = a[o] || 0, l = i.dataToPoint(r.center);
                                a[o] = s + 1, n.setItemLayout(t, {point: l, offset: s})
                            }
                        })
                    });
                    var o = i.getData();
                    o.each(function (e) {
                        var t = o.getName(e), i = o.getItemLayout(e) || {};
                        i.showLabel = !a[t], o.setItemLayout(e, i)
                    }), t[n] = !0
                }
            })
        }), vf(function (e) {
            e.eachSeriesByType("map", function (e) {
                var t = e.get("color"), i = e.getModel("itemStyle"), n = i.get("areaColor"),
                    a = i.get("color") || t[e.seriesIndex % t.length];
                e.getData().setVisual({areaColor: n, color: a})
            })
        }), hf(Sh.PROCESSOR.STATISTIC, function (e) {
            var t = {};
            e.eachSeriesByType("map", function (e) {
                var i = e.getHostGeoModel(), n = i ? "o" + i.id : "i" + e.getMapType();
                (t[n] = t[n] || []).push(e)
            }), A(t, function (e, t) {
                for (var i = function (e, t) {
                    var i = {};
                    return A(e, function (e) {
                        e.each(e.mapDimension("value"), function (t, n) {
                            var a = "ec-" + e.getName(n);
                            i[a] = i[a] || [], isNaN(t) || i[a].push(t)
                        })
                    }), e[0].map(e[0].mapDimension("value"), function (n, a) {
                        for (var o = "ec-" + e[0].getName(a), r = 0, s = 1 / 0, l = -1 / 0, d = i[o].length, u = 0; u < d; u++) s = Math.min(s, i[o][u]), l = Math.max(l, i[o][u]), r += i[o][u];
                        return 0 === d ? NaN : "min" === t ? s : "max" === t ? l : "average" === t ? r / d : r
                    })
                }(D(e, function (e) {
                    return e.getData()
                }), e[0].get("mapValueCalculation")), n = 0; n < e.length; n++) e[n].originalData = e[n].getData();
                for (n = 0; n < e.length; n++) (e[n].seriesGroup = e)[n].needsDrawMap = 0 === n && !e[n].getHostGeoModel(), e[n].setData(i.cloneShallow()), e[n].mainSeries = e[0]
            })
        }), cf(function (e) {
            var t = [];
            A(e.series, function (e) {
                e && "map" === e.type && (t.push(e), e.map = e.map || e.mapType, T(e, e.mapLocation))
            })
        }), Wm("map", [{
            type: "mapToggleSelect",
            event: "mapselectchanged",
            method: "toggleSelected"
        }, {type: "mapSelect", event: "mapselected", method: "select"}, {
            type: "mapUnSelect",
            event: "mapunselected",
            method: "unSelect"
        }]);
        var Qy = A, ek = "\0__link_datas", tk = "\0__link_mainData";

        function ik(e) {
            var t = e.mainData, i = e.datas;
            i || (i = {main: t}, e.datasAttr = {main: "data"}), e.datas = e.mainData = null, sk(t, i, e), Qy(i, function (i) {
                Qy(t.TRANSFERABLE_METHODS, function (t) {
                    i.wrapMethod(t, M(nk, e))
                })
            }), t.wrapMethod("cloneShallow", M(ok, e)), Qy(t.CHANGABLE_METHODS, function (i) {
                t.wrapMethod(i, M(ak, e))
            }), $(i[t.dataType] === t)
        }

        function nk(e, t) {
            if (function (e) {
                return e[tk] === e
            }(this)) {
                var i = k({}, this[ek]);
                sk(i[this.dataType] = t, i, e)
            } else lk(t, this.dataType, this[tk], e);
            return t
        }

        function ak(e, t) {
            return e.struct && e.struct.update(this), t
        }

        function ok(e, t) {
            return Qy(t[ek], function (i, n) {
                i !== t && lk(i.cloneShallow(), n, t, e)
            }), t
        }

        function rk(e) {
            var t = this[tk];
            return null == e || null == t ? t : t[ek][e]
        }

        function sk(e, t, i) {
            e[ek] = {}, Qy(t, function (t, n) {
                lk(t, n, e, i)
            })
        }

        function lk(e, t, i, n) {
            (i[ek][t] = e)[tk] = i, e.dataType = t, n.struct && (e[n.structAttr] = n.struct, n.struct[n.datasAttr[t]] = e), e.getLinkedData = rk
        }

        function dk(e, t) {
            this.name = e || "", this.depth = 0, this.height = 0, this.parentNode = null, this.dataIndex = -1, this.children = [], this.viewChildren = [], this.hostTree = t
        }

        function uk(e, t) {
            this.root, this.data, this._nodes = [], this.hostModel = e, this.levelModels = D(t || [], function (t) {
                return new Sl(t, e, e.ecModel)
            })
        }

        function ck(e, t) {
            var i = e.isExpand ? e.children : [], n = e.parentNode.children,
                a = e.hierNode.i ? n[e.hierNode.i - 1] : null;
            if (i.length) {
                !function (e) {
                    for (var t = e.children, i = t.length, n = 0, a = 0; 0 <= --i;) {
                        var o = t[i];
                        o.hierNode.prelim += n, o.hierNode.modifier += n, a += o.hierNode.change, n += o.hierNode.shift + a
                    }
                }(e);
                var o = (i[0].hierNode.prelim + i[i.length - 1].hierNode.prelim) / 2;
                a ? (e.hierNode.prelim = a.hierNode.prelim + t(e, a), e.hierNode.modifier = e.hierNode.prelim - o) : e.hierNode.prelim = o
            } else a && (e.hierNode.prelim = a.hierNode.prelim + t(e, a));
            e.parentNode.hierNode.defaultAncestor = function (e, t, i, n) {
                if (t) {
                    for (var a = e, o = e, r = o.parentNode.children[0], s = t, l = a.hierNode.modifier, d = o.hierNode.modifier, u = r.hierNode.modifier, c = s.hierNode.modifier; s = pk(s), o = vk(o), s && o;) {
                        a = pk(a), r = vk(r), a.hierNode.ancestor = e;
                        var h = s.hierNode.prelim + c - o.hierNode.prelim - d + n(s, o);
                        0 < h && (mk((g = e, p = i, (f = s).hierNode.ancestor.parentNode === g.parentNode ? f.hierNode.ancestor : p), e, h), d += h, l += h), c += s.hierNode.modifier, d += o.hierNode.modifier, l += a.hierNode.modifier, u += r.hierNode.modifier
                    }
                    s && !pk(a) && (a.hierNode.thread = s, a.hierNode.modifier += c - l), o && !vk(r) && (r.hierNode.thread = o, r.hierNode.modifier += d - u, i = e)
                }
                var f, g, p;
                return i
            }(e, a, e.parentNode.hierNode.defaultAncestor || n[0], t)
        }

        function hk(e) {
            var t = e.hierNode.prelim + e.parentNode.hierNode.modifier;
            e.setLayout({x: t}, !0), e.hierNode.modifier += e.parentNode.hierNode.modifier
        }

        function fk(e) {
            return arguments.length ? e : yk
        }

        function gk(e, t) {
            var i = {};
            return e -= Math.PI / 2, i.x = t * Math.cos(e), i.y = t * Math.sin(e), i
        }

        function pk(e) {
            var t = e.children;
            return t.length && e.isExpand ? t[t.length - 1] : e.hierNode.thread
        }

        function vk(e) {
            var t = e.children;
            return t.length && e.isExpand ? t[0] : e.hierNode.thread
        }

        function mk(e, t, i) {
            var n = i / (t.hierNode.i - e.hierNode.i);
            t.hierNode.change -= n, t.hierNode.shift += i, t.hierNode.modifier += i, t.hierNode.prelim += i, e.hierNode.change += n
        }

        function yk(e, t) {
            return e.parentNode === t.parentNode ? 1 : 2
        }

        dk.prototype = {
            constructor: dk, isRemoved: function () {
                return this.dataIndex < 0
            }, eachNode: function (e, t, i) {
                "function" == typeof e && (i = t, t = e, e = null), L(e = e || {}) && (e = {order: e});
                var n, a = e.order || "preorder", o = this[e.attr || "children"];
                "preorder" === a && (n = t.call(i, this));
                for (var r = 0; !n && r < o.length; r++) o[r].eachNode(e, t, i);
                "postorder" === a && t.call(i, this)
            }, updateDepthAndHeight: function (e) {
                var t = 0;
                this.depth = e;
                for (var i = 0; i < this.children.length; i++) {
                    var n = this.children[i];
                    n.updateDepthAndHeight(e + 1), n.height > t && (t = n.height)
                }
                this.height = t + 1
            }, getNodeById: function (e) {
                if (this.getId() === e) return this;
                for (var t = 0, i = this.children, n = i.length; t < n; t++) {
                    var a = i[t].getNodeById(e);
                    if (a) return a
                }
            }, contains: function (e) {
                if (e === this) return !0;
                for (var t = 0, i = this.children, n = i.length; t < n; t++) {
                    var a = i[t].contains(e);
                    if (a) return a
                }
            }, getAncestors: function (e) {
                for (var t = [], i = e ? this : this.parentNode; i;) t.push(i), i = i.parentNode;
                return t.reverse(), t
            }, getValue: function (e) {
                var t = this.hostTree.data;
                return t.get(t.getDimension(e || "value"), this.dataIndex)
            }, setLayout: function (e, t) {
                0 <= this.dataIndex && this.hostTree.data.setItemLayout(this.dataIndex, e, t)
            }, getLayout: function () {
                return this.hostTree.data.getItemLayout(this.dataIndex)
            }, getModel: function (e) {
                if (!(this.dataIndex < 0)) {
                    var t = this.hostTree.data.getItemModel(this.dataIndex), i = this.getLevelModel();
                    return i ? t.getModel(e, i.getModel(e)) : t.getModel(e)
                }
            }, getLevelModel: function () {
                return (this.hostTree.levelModels || [])[this.depth]
            }, setVisual: function (e, t) {
                0 <= this.dataIndex && this.hostTree.data.setItemVisual(this.dataIndex, e, t)
            }, getVisual: function (e, t) {
                return this.hostTree.data.getItemVisual(this.dataIndex, e, t)
            }, getRawIndex: function () {
                return this.hostTree.data.getRawIndex(this.dataIndex)
            }, getId: function () {
                return this.hostTree.data.getId(this.dataIndex)
            }, isAncestorOf: function (e) {
                for (var t = e.parentNode; t;) {
                    if (t === this) return !0;
                    t = t.parentNode
                }
                return !1
            }, isDescendantOf: function (e) {
                return e !== this && e.isAncestorOf(this)
            }
        }, uk.prototype = {
            constructor: uk, type: "tree", eachNode: function (e, t, i) {
                this.root.eachNode(e, t, i)
            }, getNodeByDataIndex: function (e) {
                var t = this.data.getRawIndex(e);
                return this._nodes[t]
            }, getNodeByName: function (e) {
                return this.root.getNodeByName(e)
            }, update: function () {
                for (var e = this.data, t = this._nodes, i = 0, n = t.length; i < n; i++) t[i].dataIndex = -1;
                for (i = 0, n = e.count(); i < n; i++) t[e.getRawIndex(i)].dataIndex = i
            }, clearLayouts: function () {
                this.data.clearItemLayouts()
            }
        }, uk.createTree = function (e, t, i, n) {
            var a = new uk(t, i && i.levels), o = [], r = 1;
            !function e(t, i) {
                var n = t.value;
                r = Math.max(r, O(n) ? n.length : 1), o.push(t);
                var s = new dk(t.name, a);
                i ? function (e, t) {
                    var i = t.children;
                    e.parentNode !== t && (i.push(e), e.parentNode = t)
                }(s, i) : a.root = s, a._nodes.push(s);
                var l = t.children;
                if (l) for (var d = 0; d < l.length; d++) e(l[d], s)
            }(e), a.root.updateDepthAndHeight(0);
            var s = eg(o, {coordDimensions: ["value"], dimensionsCount: r}), l = new Kf(s, t);
            return l.initData(o), n && n(l), ik({mainData: l, struct: a, structAttr: "tree"}), a.update(), a
        }, ec.extend({
            type: "series.tree",
            layoutInfo: null,
            layoutMode: "box",
            getInitialData: function (e) {
                var t = {name: e.name, children: e.data}, i = new Sl(e.leaves || {}, this, this.ecModel),
                    n = uk.createTree(t, this, {}, function (e) {
                        e.wrapMethod("getItemModel", function (e, t) {
                            var a = n.getNodeByDataIndex(t);
                            return a.children.length && a.isExpand || (e.parentModel = i), e
                        })
                    }), a = 0;
                n.eachNode("preorder", function (e) {
                    e.depth > a && (a = e.depth)
                });
                var o = e.expandAndCollapse && 0 <= e.initialTreeDepth ? e.initialTreeDepth : a;
                return n.root.eachNode("preorder", function (e) {
                    var t = e.hostTree.data.getRawDataItem(e.dataIndex);
                    e.isExpand = t && null != t.collapsed ? !t.collapsed : e.depth <= o
                }), n.data
            },
            getOrient: function () {
                var e = this.get("orient");
                return "horizontal" === e ? e = "LR" : "vertical" === e && (e = "TB"), e
            },
            setZoom: function (e) {
                this.option.zoom = e
            },
            setCenter: function (e) {
                this.option.center = e
            },
            formatTooltip: function (e) {
                for (var t = this.getData().tree, i = t.root.children[0], n = t.getNodeByDataIndex(e), a = n.getValue(), o = n.name; n && n !== i;) o = n.parentNode.name + "." + o, n = n.parentNode;
                return Ql(o + (isNaN(a) || null == a ? "" : " : " + a))
            },
            defaultOption: {
                zlevel: 0,
                z: 2,
                coordinateSystem: "view",
                left: "12%",
                top: "12%",
                right: "12%",
                bottom: "12%",
                layout: "orthogonal",
                edgeShape: "curve",
                edgeForkPosition: "50%",
                roam: !1,
                nodeScaleRatio: .4,
                center: null,
                zoom: 1,
                orient: "LR",
                symbol: "emptyCircle",
                symbolSize: 7,
                expandAndCollapse: !0,
                initialTreeDepth: 2,
                lineStyle: {color: "#ccc", width: 1.5, curveness: .5},
                itemStyle: {color: "lightsteelblue", borderColor: "#c23531", borderWidth: 1.5},
                label: {show: !0, color: "#555"},
                leaves: {label: {show: !0}},
                animationEasing: "linear",
                animationDuration: 700,
                animationDurationUpdate: 1e3
            }
        });
        var kk = Ss({
            shape: {parentPoint: [], childPoints: [], orient: "", forkPosition: ""},
            style: {stroke: "#000", fill: null},
            buildPath: function (e, t) {
                var i = t.childPoints, n = i.length, a = t.parentPoint, o = i[0], r = i[n - 1];
                if (1 === n) return e.moveTo(a[0], a[1]), void e.lineTo(o[0], o[1]);
                var s = t.orient, l = "TB" === s || "BT" === s ? 0 : 1, d = 1 - l, u = Nl(t.forkPosition, 1), c = [];
                c[l] = a[l], c[d] = a[d] + (r[d] - a[d]) * u, e.moveTo(a[0], a[1]), e.lineTo(c[0], c[1]), e.moveTo(o[0], o[1]), c[l] = o[l], e.lineTo(c[0], c[1]), c[l] = r[l], e.lineTo(c[0], c[1]), e.lineTo(r[0], r[1]);
                for (var h = 1; h < n - 1; h++) {
                    var f = i[h];
                    e.moveTo(f[0], f[1]), c[l] = f[l], e.lineTo(c[0], c[1])
                }
            }
        });

        function Tk(e, t) {
            var i = e.getItemLayout(t);
            return i && !isNaN(i.x) && !isNaN(i.y) && "none" !== e.getItemVisual(t, "symbol")
        }

        function wk(e, t, i) {
            return i.itemModel = t, i.itemStyle = t.getModel("itemStyle").getItemStyle(), i.hoverItemStyle = t.getModel("emphasis.itemStyle").getItemStyle(), i.lineStyle = t.getModel("lineStyle").getLineStyle(), i.labelModel = t.getModel("label"), i.hoverLabelModel = t.getModel("emphasis.label"), !1 === e.isExpand && 0 !== e.children.length ? i.symbolInnerColor = i.itemStyle.fill : i.symbolInnerColor = "#fff", i
        }

        function Ck(e, t, i, n, a, o) {
            var r = !i, s = e.tree.getNodeByDataIndex(t), l = s.getModel(), d = (o = wk(s, l, o), e.tree.root),
                u = s.parentNode === d ? s : s.parentNode || s, c = e.getItemGraphicEl(u.dataIndex), h = u.getLayout(),
                f = c ? {x: c.position[0], y: c.position[1], rawX: c.__radialOldRawX, rawY: c.__radialOldRawY} : h,
                g = s.getLayout();
            r ? (i = new Op(e, t, o)).attr("position", [f.x, f.y]) : i.updateData(e, t, o), i.__radialOldRawX = i.__radialRawX, i.__radialOldRawY = i.__radialRawY, i.__radialRawX = g.rawX, i.__radialRawY = g.rawY, n.add(i), e.setItemGraphicEl(t, i), ol(i, {position: [g.x, g.y]}, a);
            var p = i.getSymbolPath();
            if ("radial" === o.layout) {
                var v, m, y = d.children[0], k = y.getLayout(), w = y.children.length;
                if (g.x === k.x && !0 === s.isExpand) {
                    var C = {};
                    C.x = (y.children[0].getLayout().x + y.children[w - 1].getLayout().x) / 2, C.y = (y.children[0].getLayout().y + y.children[w - 1].getLayout().y) / 2, (v = Math.atan2(C.y - k.y, C.x - k.x)) < 0 && (v = 2 * Math.PI + v), (m = C.x < k.x) && (v -= Math.PI)
                } else (v = Math.atan2(g.y - k.y, g.x - k.x)) < 0 && (v = 2 * Math.PI + v), 0 === s.children.length || 0 !== s.children.length && !1 === s.isExpand ? (m = g.x < k.x) && (v -= Math.PI) : (m = g.x > k.x) || (v -= Math.PI);
                var S = m ? "left" : "right", b = o.labelModel.get("rotate"), I = b * (Math.PI / 180);
                p.setStyle({
                    textPosition: o.labelModel.get("position") || S,
                    textRotation: null == b ? -v : I,
                    textOrigin: "center",
                    verticalAlign: "middle"
                })
            }
            !function (e, t, i, n, a, o, r, s, l) {
                var d = l.edgeShape, u = n.__edge;
                if ("curve" === d) t.parentNode && t.parentNode !== i && ol(u = u || (n.__edge = new rs({
                    shape: bk(l, a, a),
                    style: T({opacity: 0, strokeNoScale: !0}, l.lineStyle)
                })), {
                    shape: bk(l, o, r),
                    style: {opacity: 1}
                }, e); else if ("polyline" === d && "orthogonal" === l.layout && t !== i && t.children && 0 !== t.children.length && !0 === t.isExpand) {
                    for (var c = t.children, h = [], f = 0; f < c.length; f++) {
                        var g = c[f].getLayout();
                        h.push([g.x, g.y])
                    }
                    ol(u = u || (n.__edge = new kk({
                        shape: {
                            parentPoint: [r.x, r.y],
                            childPoints: [[r.x, r.y]],
                            orient: l.orient,
                            forkPosition: l.edgeForkPosition
                        }, style: T({opacity: 0, strokeNoScale: !0}, l.lineStyle)
                    })), {shape: {parentPoint: [r.x, r.y], childPoints: h}, style: {opacity: 1}}, e)
                }
                s.add(u)
            }(a, s, d, i, f, h, g, n, o)
        }

        function Sk(e, t, i, n, a, o) {
            for (var r, s = e.tree.getNodeByDataIndex(t), l = e.tree.root, d = s.getModel(), u = (o = wk(s, d, o), s.parentNode === l ? s : s.parentNode || s), c = o.edgeShape; null == (r = u.getLayout());) u = u.parentNode === l ? u : u.parentNode || u;
            ol(i, {position: [r.x + 1, r.y + 1]}, a, function () {
                n.remove(i), e.setItemGraphicEl(t, null)
            }), i.fadeOut(null, {keepLabel: !0});
            var h = e.getItemGraphicEl(u.dataIndex).__edge,
                f = i.__edge || (!1 === u.isExpand || 1 === u.children.length ? h : void 0);
            c = o.edgeShape, f && ("curve" === c ? ol(f, {shape: bk(o, r, r), style: {opacity: 0}}, a, function () {
                n.remove(f)
            }) : "polyline" === c && "orthogonal" === o.layout && ol(f, {
                shape: {
                    parentPoint: [r.x, r.y],
                    childPoints: [[r.x, r.y]]
                }, style: {opacity: 0}
            }, a, function () {
                n.remove(f)
            }))
        }

        function bk(e, t, i) {
            var n, a, o, r, s, l, d, u, c = e.orient;
            if ("radial" !== e.layout) return s = t.x, d = t.y, l = i.x, u = i.y, "LR" !== c && "RL" !== c || (n = s + (l - s) * e.curvature, a = d, o = l + (s - l) * e.curvature, r = u), "TB" !== c && "BT" !== c || (n = s, a = d + (u - d) * e.curvature, o = l, r = u + (d - u) * e.curvature), {
                x1: s,
                y1: d,
                x2: l,
                y2: u,
                cpx1: n,
                cpy1: a,
                cpx2: o,
                cpy2: r
            };
            s = t.rawX, d = t.rawY, l = i.rawX, u = i.rawY;
            var h = gk(s, d), f = gk(s, d + (u - d) * e.curvature), g = gk(l, u + (d - u) * e.curvature), p = gk(l, u);
            return {x1: h.x, y1: h.y, x2: p.x, y2: p.y, cpx1: f.x, cpy1: f.y, cpx2: g.x, cpy2: g.y}
        }

        function Ik(e, t) {
            for (var i, n = [e]; i = n.pop();) if (t(i), i.isExpand) {
                var a = i.children;
                if (a.length) for (var o = a.length - 1; 0 <= o; o--) n.push(a[o])
            }
        }

        function _k(e, t, i) {
            if (e && 0 <= S(t, e.type)) {
                var n = i.getData().tree.root, a = e.targetNode;
                if ("string" == typeof a && (a = n.getNodeById(a)), a && n.contains(a)) return {node: a};
                var o = e.targetNodeId;
                if (null != o && (a = n.getNodeById(o))) return {node: a}
            }
        }

        function Ak(e) {
            for (var t = []; e;) (e = e.parentNode) && t.push(e);
            return t.reverse()
        }

        function Dk(e, t) {
            return 0 <= S(Ak(e), t)
        }

        function xk(e, t) {
            for (var i = []; e;) {
                var n = e.dataIndex;
                i.push({name: e.name, dataIndex: n, value: t.getRawValue(n)}), e = e.parentNode
            }
            return i.reverse(), i
        }

        Cf({
            type: "tree", init: function (e, t) {
                this._oldTree, this._mainGroup = new Di, this._controller = new Sy(t.getZr()), this._controllerHost = {target: this.group}, this.group.add(this._mainGroup)
            }, render: function (e, t, i, n) {
                var a = e.getData(), o = e.layoutInfo, r = this._mainGroup, s = e.get("layout");
                "radial" === s ? r.attr("position", [o.x + o.width / 2, o.y + o.height / 2]) : r.attr("position", [o.x, o.y]), this._updateViewCoordSys(e, o, s), this._updateController(e, t, i);
                var l = this._data, d = {
                    expandAndCollapse: e.get("expandAndCollapse"),
                    layout: s,
                    edgeShape: e.get("edgeShape"),
                    edgeForkPosition: e.get("edgeForkPosition"),
                    orient: e.getOrient(),
                    curvature: e.get("lineStyle.curveness"),
                    symbolRotate: e.get("symbolRotate"),
                    symbolOffset: e.get("symbolOffset"),
                    hoverAnimation: e.get("hoverAnimation"),
                    useNameLabel: !0,
                    fadeIn: !0
                };
                a.diff(l).add(function (t) {
                    Tk(a, t) && Ck(a, t, null, r, e, d)
                }).update(function (t, i) {
                    var n = l.getItemGraphicEl(i);
                    Tk(a, t) ? Ck(a, t, n, r, e, d) : n && Sk(l, i, n, r, e, d)
                }).remove(function (t) {
                    var i = l.getItemGraphicEl(t);
                    i && Sk(l, t, i, r, e, d)
                }).execute(), this._nodeScaleRatio = e.get("nodeScaleRatio"), this._updateNodeAndLinkScale(e), !0 === d.expandAndCollapse && a.eachItemGraphicEl(function (t, n) {
                    t.off("click").on("click", function () {
                        i.dispatchAction({type: "treeExpandAndCollapse", seriesId: e.id, dataIndex: n})
                    })
                }), this._data = a
            }, _updateViewCoordSys: function (e) {
                var t = e.getData(), i = [];
                t.each(function (e) {
                    var n = t.getItemLayout(e);
                    !n || isNaN(n.x) || isNaN(n.y) || i.push([+n.x, +n.y])
                });
                var n = [], a = [];
                Lo(i, n, a);
                var o = this._min, r = this._max;
                a[0] - n[0] == 0 && (n[0] = o ? o[0] : n[0] - 1, a[0] = r ? r[0] : a[0] + 1), a[1] - n[1] == 0 && (n[1] = o ? o[1] : n[1] - 1, a[1] = r ? r[1] : a[1] + 1);
                var s = e.coordinateSystem = new Gy;
                s.zoomLimit = e.get("scaleLimit"), s.setBoundingRect(n[0], n[1], a[0] - n[0], a[1] - n[1]), s.setCenter(e.get("center")), s.setZoom(e.get("zoom")), this.group.attr({
                    position: s.position,
                    scale: s.scale
                }), this._viewCoordSys = s, this._min = n, this._max = a
            }, _updateController: function (e, t, i) {
                var n = this._controller, a = this._controllerHost, o = this.group;
                n.setPointerChecker(function (t, n, a) {
                    var r = o.getBoundingRect();
                    return r.applyTransform(o.transform), r.contain(n, a) && !Fy(t, i, e)
                }), n.enable(e.get("roam")), a.zoomLimit = e.get("scaleLimit"), a.zoom = e.coordinateSystem.getZoom(), n.off("pan").off("zoom").on("pan", function (t) {
                    Py(a, t.dx, t.dy), i.dispatchAction({seriesId: e.id, type: "treeRoam", dx: t.dx, dy: t.dy})
                }, this).on("zoom", function (t) {
                    My(a, t.scale, t.originX, t.originY), i.dispatchAction({
                        seriesId: e.id,
                        type: "treeRoam",
                        zoom: t.scale,
                        originX: t.originX,
                        originY: t.originY
                    }), this._updateNodeAndLinkScale(e)
                }, this)
            }, _updateNodeAndLinkScale: function (e) {
                var t = e.getData(), i = this._getNodeGlobalScale(e), n = [i, i];
                t.eachItemGraphicEl(function (e, t) {
                    e.attr("scale", n)
                })
            }, _getNodeGlobalScale: function (e) {
                var t = e.coordinateSystem;
                if ("view" !== t.type) return 1;
                var i = this._nodeScaleRatio, n = t.scale, a = n && n[0] || 1;
                return ((t.getZoom() - 1) * i + 1) / a
            }, dispose: function () {
                this._controller && this._controller.dispose(), this._controllerHost = {}
            }, remove: function () {
                this._mainGroup.removeAll(), this._data = null
            }
        }), ff({type: "treeExpandAndCollapse", event: "treeExpandAndCollapse", update: "update"}, function (e, t) {
            t.eachComponent({mainType: "series", subType: "tree", query: e}, function (t) {
                var i = e.dataIndex, n = t.getData().tree.getNodeByDataIndex(i);
                n.isExpand = !n.isExpand
            })
        }), ff({type: "treeRoam", event: "treeRoam", update: "none"}, function (e, t) {
            t.eachComponent({mainType: "series", subType: "tree", query: e}, function (t) {
                var i = Hy(t.coordinateSystem, e);
                t.setCenter && t.setCenter(i.center), t.setZoom && t.setZoom(i.zoom)
            })
        }), vf(mv("tree", "circle")), pf(function (e, t) {
            e.eachSeriesByType("tree", function (e) {
                !function (e, t) {
                    var i = function (e, t) {
                        return vd(e.getBoxLayoutParams(), {width: t.getWidth(), height: t.getHeight()})
                    }(e, t);
                    e.layoutInfo = i;
                    var n = e.get("layout"), a = 0, o = 0, r = null;
                    r = "radial" === n ? (a = 2 * Math.PI, o = Math.min(i.height, i.width) / 2, fk(function (e, t) {
                        return (e.parentNode === t.parentNode ? 1 : 2) / e.depth
                    })) : (a = i.width, o = i.height, fk());
                    var s = e.getData().tree.root, l = s.children[0];
                    if (l) {
                        !function (e) {
                            e.hierNode = {
                                defaultAncestor: null,
                                ancestor: e,
                                prelim: 0,
                                modifier: 0,
                                change: 0,
                                shift: 0,
                                i: 0,
                                thread: null
                            };
                            for (var t, i, n = [e]; t = n.pop();) if (i = t.children, t.isExpand && i.length) for (var a = i.length - 1; 0 <= a; a--) {
                                var o = i[a];
                                o.hierNode = {
                                    defaultAncestor: null,
                                    ancestor: o,
                                    prelim: 0,
                                    modifier: 0,
                                    change: 0,
                                    shift: 0,
                                    i: a,
                                    thread: null
                                }, n.push(o)
                            }
                        }(s), function (e, t, i) {
                            for (var n, a = [e], o = []; n = a.pop();) if (o.push(n), n.isExpand) {
                                var r = n.children;
                                if (r.length) for (var s = 0; s < r.length; s++) a.push(r[s])
                            }
                            for (; n = o.pop();) t(n, i)
                        }(l, ck, r), s.hierNode.modifier = -l.hierNode.prelim, Ik(l, hk);
                        var d = l, u = l, c = l;
                        Ik(l, function (e) {
                            var t = e.getLayout().x;
                            t < d.getLayout().x && (d = e), t > u.getLayout().x && (u = e), e.depth > c.depth && (c = e)
                        });
                        var h = d === u ? 1 : r(d, u) / 2, f = h - d.getLayout().x, g = 0, p = 0, v = 0, m = 0;
                        if ("radial" === n) g = a / (u.getLayout().x + h + f), p = o / (c.depth - 1 || 1), Ik(l, function (e) {
                            v = (e.getLayout().x + f) * g, m = (e.depth - 1) * p;
                            var t = gk(v, m);
                            e.setLayout({x: t.x, y: t.y, rawX: v, rawY: m}, !0)
                        }); else {
                            var y = e.getOrient();
                            "RL" === y || "LR" === y ? (p = o / (u.getLayout().x + h + f), g = a / (c.depth - 1 || 1), Ik(l, function (e) {
                                m = (e.getLayout().x + f) * p, v = "LR" === y ? (e.depth - 1) * g : a - (e.depth - 1) * g, e.setLayout({
                                    x: v,
                                    y: m
                                }, !0)
                            })) : "TB" !== y && "BT" !== y || (g = a / (u.getLayout().x + h + f), p = o / (c.depth - 1 || 1), Ik(l, function (e) {
                                v = (e.getLayout().x + f) * g, m = "TB" === y ? (e.depth - 1) * p : o - (e.depth - 1) * p, e.setLayout({
                                    x: v,
                                    y: m
                                }, !0)
                            }))
                        }
                    }
                }(e, t)
            })
        }), ec.extend({
            type: "series.treemap",
            layoutMode: "box",
            dependencies: ["grid", "polar"],
            preventUsingHoverLayer: !0,
            _viewRoot: null,
            defaultOption: {
                progressive: 0,
                left: "center",
                top: "middle",
                right: null,
                bottom: null,
                width: "80%",
                height: "80%",
                sort: !0,
                clipWindow: "origin",
                squareRatio: .5 * (1 + Math.sqrt(5)),
                leafDepth: null,
                drillDownIcon: "▶",
                zoomToNodeRatio: .1024,
                roam: !0,
                nodeClick: "zoomToNode",
                animation: !0,
                animationDurationUpdate: 900,
                animationEasing: "quinticInOut",
                breadcrumb: {
                    show: !0,
                    height: 22,
                    left: "center",
                    top: "bottom",
                    emptyItemWidth: 25,
                    itemStyle: {
                        color: "rgba(0,0,0,0.7)",
                        borderColor: "rgba(255,255,255,0.7)",
                        borderWidth: 1,
                        shadowColor: "rgba(150,150,150,1)",
                        shadowBlur: 3,
                        shadowOffsetX: 0,
                        shadowOffsetY: 0,
                        textStyle: {color: "#fff"}
                    },
                    emphasis: {textStyle: {}}
                },
                label: {show: !0, distance: 0, padding: 5, position: "inside", color: "#fff", ellipsis: !0},
                upperLabel: {
                    show: !1,
                    position: [0, "50%"],
                    height: 20,
                    color: "#fff",
                    ellipsis: !0,
                    verticalAlign: "middle"
                },
                itemStyle: {
                    color: null,
                    colorAlpha: null,
                    colorSaturation: null,
                    borderWidth: 0,
                    gapWidth: 0,
                    borderColor: "#fff",
                    borderColorSaturation: null
                },
                emphasis: {
                    upperLabel: {
                        show: !0,
                        position: [0, "50%"],
                        color: "#fff",
                        ellipsis: !0,
                        verticalAlign: "middle"
                    }
                },
                visualDimension: 0,
                visualMin: null,
                visualMax: null,
                color: [],
                colorAlpha: null,
                colorSaturation: null,
                colorMappingBy: "index",
                visibleMin: 10,
                childrenVisibleMin: null,
                levels: []
            },
            getInitialData: function (e, t) {
                var i = {name: e.name, children: e.data};
                !function e(t) {
                    var i = 0;
                    A(t.children, function (t) {
                        e(t);
                        var n = t.value;
                        O(n) && (n = n[0]), i += n
                    });
                    var n = t.value;
                    O(n) && (n = n[0]), null != n && !isNaN(n) || (n = i), n < 0 && (n = 0), O(t.value) ? t.value[0] = n : t.value = n
                }(i);
                var n = e.levels || [], a = D((n = e.levels = function (e, t) {
                    var i, n = t.get("color");
                    if (n) return A(e = e || [], function (e) {
                        var t = new Sl(e), n = t.get("color");
                        (t.get("itemStyle.color") || n && "none" !== n) && (i = !0)
                    }), i || ((e[0] || (e[0] = {})).color = n.slice()), e
                }(n, t)) || [], function (e) {
                    return new Sl(e, this, t)
                }, this), o = uk.createTree(i, this, null, function (e) {
                    e.wrapMethod("getItemModel", function (e, t) {
                        var i = o.getNodeByDataIndex(t), n = a[i.depth];
                        return n && (e.parentModel = n), e
                    })
                });
                return o.data
            },
            optionUpdated: function () {
                this.resetViewRoot()
            },
            formatTooltip: function (e) {
                var t = this.getData(), i = this.getRawValue(e), n = O(i) ? Xl(i[0]) : Xl(i);
                return Ql(t.getName(e) + ": " + n)
            },
            getDataParams: function (e) {
                var t = ec.prototype.getDataParams.apply(this, arguments),
                    i = this.getData().tree.getNodeByDataIndex(e);
                return t.treePathInfo = xk(i, this), t
            },
            setLayoutInfo: function (e) {
                this.layoutInfo = this.layoutInfo || {}, k(this.layoutInfo, e)
            },
            mapIdToIndex: function (e) {
                var t = this._idIndexMap;
                t || (t = this._idIndexMap = Q(), this._idIndexMapCount = 0);
                var i = t.get(e);
                return null == i && t.set(e, i = this._idIndexMapCount++), i
            },
            getViewRoot: function () {
                return this._viewRoot
            },
            resetViewRoot: function (e) {
                e ? this._viewRoot = e : e = this._viewRoot;
                var t = this.getRawData().tree.root;
                e && (e === t || t.contains(e)) || (this._viewRoot = t)
            }
        });
        var Nk = 5;

        function Ek(e) {
            this.group = new Di, e.add(this.group)
        }

        function Pk(e, t, i, n, a, o) {
            var r = [[a ? e : e - Nk, t], [e + i, t], [e + i, t + n], [a ? e : e - Nk, t + n]];
            return o || r.splice(2, 0, [e + i + Nk, t + n / 2]), a || r.push([e, t + n / 2]), r
        }

        function Mk(e) {
            var t = Hk(e);
            return t.stroke = t.fill = t.lineWidth = null, t
        }

        Ek.prototype = {
            constructor: Ek, render: function (e, t, i, n) {
                var a = e.getModel("breadcrumb"), o = this.group;
                if (o.removeAll(), a.get("show") && i) {
                    var r = a.getModel("itemStyle"), s = r.getModel("textStyle"), l = {
                        pos: {
                            left: a.get("left"),
                            right: a.get("right"),
                            top: a.get("top"),
                            bottom: a.get("bottom")
                        },
                        box: {width: t.getWidth(), height: t.getHeight()},
                        emptyItemWidth: a.get("emptyItemWidth"),
                        totalWidth: 0,
                        renderList: []
                    };
                    this._prepare(i, l, s), this._renderContent(e, l, r, s, n), md(o, l.pos, l.box)
                }
            }, _prepare: function (e, t, i) {
                for (var n = e; n; n = n.parentNode) {
                    var a = n.getModel().get("name"), o = i.getTextRect(a),
                        r = Math.max(o.width + 16, t.emptyItemWidth);
                    t.totalWidth += r + 8, t.renderList.push({node: n, text: a, width: r})
                }
            }, _renderContent: function (e, t, i, n, a) {
                for (var o, r, s = 0, l = t.emptyItemWidth, d = e.get("breadcrumb.height"), u = function (e, t, i) {
                    var n = t.width, a = t.height, o = Nl(e.x, n), r = Nl(e.y, a), s = Nl(e.x2, n), l = Nl(e.y2, a);
                    return (isNaN(o) || isNaN(parseFloat(e.x))) && (o = 0), (isNaN(s) || isNaN(parseFloat(e.x2))) && (s = n), (isNaN(r) || isNaN(parseFloat(e.y))) && (r = 0), (isNaN(l) || isNaN(parseFloat(e.y2))) && (l = a), i = Yl(i || 0), {
                        width: Math.max(s - o - i[1] - i[3], 0),
                        height: Math.max(l - r - i[0] - i[2], 0)
                    }
                }(t.pos, t.box), c = t.totalWidth, h = t.renderList, f = h.length - 1; 0 <= f; f--) {
                    var g = h[f], p = g.node, v = g.width, m = g.text;
                    c > u.width && (c -= v - l, v = l, m = null);
                    var y = new $r({
                        shape: {points: Pk(s, 0, v, d, f === h.length - 1, 0 === f)},
                        style: T(i.getItemStyle(), {
                            lineJoin: "bevel",
                            text: m,
                            textFill: n.getTextColor(),
                            textFont: n.getFont()
                        }),
                        z: 10,
                        onclick: M(a, p)
                    });
                    this.group.add(y), o = e, r = p, y.eventData = {
                        componentType: "series",
                        componentSubType: "treemap",
                        componentIndex: o.componentIndex,
                        seriesIndex: o.componentIndex,
                        seriesName: o.name,
                        seriesType: "treemap",
                        selfType: "breadcrumb",
                        nodeData: {dataIndex: r && r.dataIndex, name: r && r.name},
                        treePathInfo: r && xk(r, o)
                    }, s += v + 8
                }
            }, remove: function () {
                this.group.removeAll()
            }
        };
        var Ok = P, Fk = Di, Lk = es, Bk = A, Uk = ["label"], Rk = ["emphasis", "label"], Kk = ["upperLabel"],
            Wk = ["emphasis", "upperLabel"], Vk = 10,
            Hk = no([["fill", "color"], ["stroke", "strokeColor"], ["lineWidth", "strokeWidth"], ["shadowBlur"], ["shadowOffsetX"], ["shadowOffsetY"], ["shadowColor"]]);

        function zk(e, t, i, n, a, o, r, s, l, d) {
            if (r) {
                var u = r.getLayout(), c = e.getData();
                if (c.setItemGraphicEl(r.dataIndex, null), u && u.isInView) {
                    var h = u.width, f = u.height, g = u.borderWidth, p = u.invisible, m = r.getRawIndex(),
                        y = s && s.getRawIndex(), T = r.viewChildren, w = u.upperHeight, C = T && T.length,
                        S = r.getModel("itemStyle"), b = r.getModel("emphasis.itemStyle"), I = P("nodeGroup", Fk);
                    if (I) {
                        if (l.add(I), I.attr("position", [u.x || 0, u.y || 0]), I.__tmNodeWidth = h, I.__tmNodeHeight = f, u.isAboveViewRoot) return I;
                        var _ = r.getModel(), A = P("background", Lk, d, 1);
                        if (A && function (t, i, n) {
                            if (i.dataIndex = r.dataIndex, i.seriesIndex = e.seriesIndex, i.setShape({
                                x: 0,
                                y: 0,
                                width: h,
                                height: f
                            }), p) x(i); else {
                                i.invisible = !1;
                                var a = r.getVisual("borderColor", !0), o = b.get("borderColor"), s = Mk(S);
                                s.fill = a;
                                var l = Hk(b);
                                if (l.fill = o, n) {
                                    var d = h - 2 * g;
                                    N(s, l, a, d, w, {x: g, y: 0, width: d, height: w})
                                } else s.text = l.text = null;
                                i.setStyle(s), Rs(i, l)
                            }
                            t.add(i)
                        }(I, A, C && u.upperLabelHeight), C) $s(I) && Gs(I, !1), A && (Gs(A, !0), c.setItemGraphicEl(r.dataIndex, A)); else {
                            var D = P("content", Lk, d, 2);
                            D && function (t, i) {
                                i.dataIndex = r.dataIndex, i.seriesIndex = e.seriesIndex;
                                var n = Math.max(h - 2 * g, 0), a = Math.max(f - 2 * g, 0);
                                if (i.culling = !0, i.setShape({x: g, y: g, width: n, height: a}), p) x(i); else {
                                    i.invisible = !1;
                                    var o = r.getVisual("color", !0), s = Mk(S);
                                    s.fill = o;
                                    var l = Hk(b);
                                    N(s, l, o, n, a), i.setStyle(s), Rs(i, l)
                                }
                                t.add(i)
                            }(I, D), A && $s(A) && Gs(A, !1), Gs(I, !0), c.setItemGraphicEl(r.dataIndex, I)
                        }
                        return I
                    }
                }
            }

            function x(e) {
                e.invisible || o.push(e)
            }

            function N(t, i, n, a, o, s) {
                var l = _.get("name"), d = _.getModel(s ? Kk : Uk), c = _.getModel(s ? Wk : Rk),
                    h = d.getShallow("show");
                qs(t, i, d, c, {
                    defaultText: h ? l : null,
                    autoColor: n,
                    isRectText: !0,
                    labelFetcher: e,
                    labelDataIndex: r.dataIndex,
                    labelProp: s ? "upperLabel" : "label"
                }), E(t, s, u), E(i, s, u), s && (t.textRect = v(s)), t.truncate = h && d.get("ellipsis") ? {
                    outerWidth: a,
                    outerHeight: o,
                    minChar: 2
                } : null
            }

            function E(t, i, n) {
                var a = t.text;
                if (!i && n.isLeafRoot && null != a) {
                    var o = e.get("drillDownIcon", !0);
                    t.text = o ? o + " " + a : a
                }
            }

            function P(e, o, s, l) {
                var d = null != y && i[e][y], u = a[e];
                return d ? (i[e][y] = null, function (e, t, i) {
                    (e[m] = {}).old = "nodeGroup" === i ? t.position.slice() : k({}, t.shape)
                }(u, d, e)) : p || ((d = new o({
                    z: function (e, t) {
                        var i = e * Vk + t;
                        return (i - 1) / i
                    }(s, l)
                })).__tmDepth = s, function (e, t, i) {
                    var o = e[m] = {}, s = r.parentNode;
                    if (s && (!n || "drillDown" === n.direction)) {
                        var l = 0, d = 0, u = a.background[s.getRawIndex()];
                        !n && u && u.old && (l = u.old.width, d = u.old.height), o.old = "nodeGroup" === i ? [0, d] : {
                            x: l,
                            y: d,
                            width: 0,
                            height: 0
                        }
                    }
                    o.fadein = "nodeGroup" !== i
                }(u, 0, d.__tmStorageName = e)), t[e][m] = d
            }
        }

        Cf({
            type: "treemap", init: function (e, t) {
                this._containerGroup, this._storage = {
                    nodeGroup: [],
                    background: [],
                    content: []
                }, this._oldTree, this._breadcrumb, this._controller, this._state = "ready"
            }, render: function (e, t, i, n) {
                if (!(S(t.findComponents({mainType: "series", subType: "treemap", query: n}), e) < 0)) {
                    this.seriesModel = e, this.api = i, this.ecModel = t;
                    var a = _k(n, ["treemapZoomToNode", "treemapRootToNode"], e), o = n && n.type, r = e.layoutInfo,
                        s = !this._oldTree, l = this._storage, d = "treemapRootToNode" === o && a && l ? {
                            rootNodeGroup: l.nodeGroup[a.node.getRawIndex()],
                            direction: n.direction
                        } : null, u = this._giveContainerGroup(r), c = this._doRender(u, e, d);
                    s || o && "treemapZoomToNode" !== o && "treemapRootToNode" !== o ? c.renderFinally() : this._doAnimation(u, c, e, d), this._resetController(i), this._renderBreadcrumb(e, i, a)
                }
            }, _giveContainerGroup: function (e) {
                var t = this._containerGroup;
                return t || (t = this._containerGroup = new Fk, this._initEvents(t), this.group.add(t)), t.attr("position", [e.x, e.y]), t
            }, _doRender: function (e, t, i) {
                var n = t.getData().tree, a = this._oldTree, o = {nodeGroup: [], background: [], content: []},
                    r = {nodeGroup: [], background: [], content: []}, s = this._storage, l = [],
                    d = M(zk, t, r, s, i, o, l);
                !function e(t, i, n, a, o) {
                    function r(e) {
                        return e.getId()
                    }

                    function s(r, s) {
                        var l = null != r ? t[r] : null, u = null != s ? i[s] : null, c = d(l, u, n, o);
                        c && e(l && l.viewChildren || [], u && u.viewChildren || [], c, a, o + 1)
                    }

                    a ? Bk(i = t, function (e, t) {
                        e.isRemoved() || s(t, t)
                    }) : new bf(i, t, r, r).add(s).update(s).remove(M(s, null)).execute()
                }(n.root ? [n.root] : [], a && a.root ? [a.root] : [], e, n === a || !a, 0);
                var u, c, h = (c = {nodeGroup: [], background: [], content: []}, (u = s) && Bk(u, function (e, t) {
                    var i = c[t];
                    Bk(e, function (e) {
                        e && (i.push(e), e.__tmWillDelete = 1)
                    })
                }), c);
                return this._oldTree = n, this._storage = r, {
                    lastsForAnimation: o,
                    willDeleteEls: h,
                    renderFinally: function () {
                        Bk(h, function (e) {
                            Bk(e, function (e) {
                                e.parent && e.parent.remove(e)
                            })
                        }), Bk(l, function (e) {
                            e.invisible = !0, e.dirty()
                        })
                    }
                }
            }, _doAnimation: function (e, t, i, n) {
                if (i.get("animation")) {
                    var a = i.get("animationDurationUpdate"), o = i.get("animationEasing"), r = function () {
                        var e, t = [], i = {};
                        return {
                            add: function (e, n, a, o, r) {
                                return L(o) && (r = o, o = 0), !i[e.id] && (i[e.id] = 1, t.push({
                                    el: e,
                                    target: n,
                                    time: a,
                                    delay: o,
                                    easing: r
                                }), !0)
                            }, done: function (t) {
                                return e = t, this
                            }, start: function () {
                                for (var n = t.length, a = 0, o = t.length; a < o; a++) {
                                    var r = t[a];
                                    r.el.animateTo(r.target, r.time, r.delay, r.easing, s)
                                }
                                return this;

                                function s() {
                                    --n || (t.length = 0, i = {}, e && e())
                                }
                            }
                        }
                    }();
                    Bk(t.willDeleteEls, function (e, t) {
                        Bk(e, function (e, i) {
                            if (!e.invisible) {
                                var s, l = e.parent;
                                if (n && "drillDown" === n.direction) s = l === n.rootNodeGroup ? {
                                    shape: {
                                        x: 0,
                                        y: 0,
                                        width: l.__tmNodeWidth,
                                        height: l.__tmNodeHeight
                                    }, style: {opacity: 0}
                                } : {style: {opacity: 0}}; else {
                                    var d = 0, u = 0;
                                    l.__tmWillDelete || (d = l.__tmNodeWidth / 2, u = l.__tmNodeHeight / 2), s = "nodeGroup" === t ? {
                                        position: [d, u],
                                        style: {opacity: 0}
                                    } : {shape: {x: d, y: u, width: 0, height: 0}, style: {opacity: 0}}
                                }
                                s && r.add(e, s, a, o)
                            }
                        })
                    }), Bk(this._storage, function (e, i) {
                        Bk(e, function (e, n) {
                            var s = t.lastsForAnimation[i][n], l = {};
                            s && ("nodeGroup" === i ? s.old && (l.position = e.position.slice(), e.attr("position", s.old)) : (s.old && (l.shape = k({}, e.shape), e.setShape(s.old)), s.fadein ? (e.setStyle("opacity", 0), l.style = {opacity: 1}) : 1 !== e.style.opacity && (l.style = {opacity: 1})), r.add(e, l, a, o))
                        })
                    }, this), this._state = "animating", r.done(Ok(function () {
                        this._state = "ready", t.renderFinally()
                    }, this)).start()
                }
            }, _resetController: function (e) {
                var t = this._controller;
                t || ((t = this._controller = new Sy(e.getZr())).enable(this.seriesModel.get("roam")), t.on("pan", Ok(this._onPan, this)), t.on("zoom", Ok(this._onZoom, this)));
                var i = new Ai(0, 0, e.getWidth(), e.getHeight());
                t.setPointerChecker(function (e, t, n) {
                    return i.contain(t, n)
                })
            }, _clearController: function () {
                var e = this._controller;
                e && (e.dispose(), e = null)
            }, _onPan: function (e) {
                if ("animating" !== this._state && (3 < Math.abs(e.dx) || 3 < Math.abs(e.dy))) {
                    var t = this.seriesModel.getData().tree.root;
                    if (!t) return;
                    var i = t.getLayout();
                    if (!i) return;
                    this.api.dispatchAction({
                        type: "treemapMove",
                        from: this.uid,
                        seriesId: this.seriesModel.id,
                        rootRect: {x: i.x + e.dx, y: i.y + e.dy, width: i.width, height: i.height}
                    })
                }
            }, _onZoom: function (e) {
                var t = e.originX, i = e.originY;
                if ("animating" !== this._state) {
                    var n = this.seriesModel.getData().tree.root;
                    if (!n) return;
                    var a = n.getLayout();
                    if (!a) return;
                    var o = new Ai(a.x, a.y, a.width, a.height), r = this.seriesModel.layoutInfo;
                    t -= r.x, i -= r.y;
                    var s = ot();
                    dt(s, s, [-t, -i]), ct(s, s, [e.scale, e.scale]), dt(s, s, [t, i]), o.applyTransform(s), this.api.dispatchAction({
                        type: "treemapRender",
                        from: this.uid,
                        seriesId: this.seriesModel.id,
                        rootRect: {x: o.x, y: o.y, width: o.width, height: o.height}
                    })
                }
            }, _initEvents: function (e) {
                e.on("click", function (e) {
                    if ("ready" === this._state) {
                        var t = this.seriesModel.get("nodeClick", !0);
                        if (t) {
                            var i = this.findTarget(e.offsetX, e.offsetY);
                            if (i) {
                                var n = i.node;
                                if (n.getLayout().isLeafRoot) this._rootToNode(i); else if ("zoomToNode" === t) this._zoomToNode(i); else if ("link" === t) {
                                    var a = n.hostTree.data.getItemModel(n.dataIndex), o = a.get("link", !0),
                                        r = a.get("target", !0) || "blank";
                                    o && dd(o, r)
                                }
                            }
                        }
                    }
                }, this)
            }, _renderBreadcrumb: function (e, t, i) {
                i = i || (i = null != e.get("leafDepth", !0) ? {node: e.getViewRoot()} : this.findTarget(t.getWidth() / 2, t.getHeight() / 2)) || {node: e.getData().tree.root}, (this._breadcrumb || (this._breadcrumb = new Ek(this.group))).render(e, t, i.node, Ok(function (t) {
                    "animating" !== this._state && (Dk(e.getViewRoot(), t) ? this._rootToNode({node: t}) : this._zoomToNode({node: t}))
                }, this))
            }, remove: function () {
                this._clearController(), this._containerGroup && this._containerGroup.removeAll(), this._storage = {
                    nodeGroup: [],
                    background: [],
                    content: []
                }, this._state = "ready", this._breadcrumb && this._breadcrumb.remove()
            }, dispose: function () {
                this._clearController()
            }, _zoomToNode: function (e) {
                this.api.dispatchAction({
                    type: "treemapZoomToNode",
                    from: this.uid,
                    seriesId: this.seriesModel.id,
                    targetNode: e.node
                })
            }, _rootToNode: function (e) {
                this.api.dispatchAction({
                    type: "treemapRootToNode",
                    from: this.uid,
                    seriesId: this.seriesModel.id,
                    targetNode: e.node
                })
            }, findTarget: function (e, t) {
                var i;
                return this.seriesModel.getViewRoot().eachNode({attr: "viewChildren", order: "preorder"}, function (n) {
                    var a = this._storage.background[n.getRawIndex()];
                    if (a) {
                        var o = a.transformCoordToLocal(e, t), r = a.shape;
                        if (!(r.x <= o[0] && o[0] <= r.x + r.width && r.y <= o[1] && o[1] <= r.y + r.height)) return !1;
                        i = {node: n, offsetX: o[0], offsetY: o[1]}
                    }
                }, this), i
            }
        });
        for (var jk = function () {
        }, Gk = ["treemapZoomToNode", "treemapRender", "treemapMove"], $k = 0; $k < Gk.length; $k++) ff({
            type: Gk[$k],
            update: "updateView"
        }, jk);
        ff({type: "treemapRootToNode", update: "updateView"}, function (e, t) {
            t.eachComponent({mainType: "series", subType: "treemap", query: e}, function (t, i) {
                var n = _k(e, ["treemapZoomToNode", "treemapRootToNode"], t);
                if (n) {
                    var a = t.getViewRoot();
                    a && (e.direction = Dk(a, n.node) ? "rollUp" : "drillDown"), t.resetViewRoot(n.node)
                }
            })
        });
        var Xk = A, qk = B, Yk = -1, Jk = function (e) {
            var t = e.mappingMethod, i = e.type, n = this.option = v(e);
            this.type = i, this.mappingMethod = t, this._normalizeData = lT[t];
            var a = Zk[i];
            this.applyVisual = a.applyVisual, this.getColorMapper = a.getColorMapper, this._doMap = a._doMap[t], "piecewise" === t ? (Qk(n), function (e) {
                var t = e.pieceList;
                e.hasSpecialVisual = !1, A(t, function (t, i) {
                    t.originIndex = i, null != t.visual && (e.hasSpecialVisual = !0)
                })
            }(n)) : "category" === t ? n.categories ? function (e) {
                var t = e.categories, i = e.visual, n = e.categoryMap = {};
                if (Xk(t, function (e, t) {
                    n[e] = t
                }), !O(i)) {
                    var a = [];
                    B(i) ? Xk(i, function (e, t) {
                        var i = n[t];
                        a[null != i ? i : Yk] = e
                    }) : a[Yk] = i, i = sT(e, a)
                }
                for (var o = t.length - 1; 0 <= o; o--) null == i[o] && (delete n[t[o]], t.pop())
            }(n) : Qk(n, !0) : ($("linear" !== t || n.dataExtent), Qk(n))
        };
        Jk.prototype = {
            constructor: Jk, mapValueToVisual: function (e) {
                var t = this._normalizeData(e);
                return this._doMap(t, e)
            }, getNormalizer: function () {
                return P(this._normalizeData, this)
            }
        };
        var Zk = Jk.visualHandlers = {
            color: {
                applyVisual: iT("color"), getColorMapper: function () {
                    var e = this.option;
                    return P("category" === e.mappingMethod ? function (e, t) {
                        return t || (e = this._normalizeData(e)), nT.call(this, e)
                    } : function (t, i, n) {
                        var a = !!n;
                        return i || (t = this._normalizeData(t)), n = jt(t, e.parsedVisual, n), a ? n : Jt(n, "rgba")
                    }, this)
                }, _doMap: {
                    linear: function (e) {
                        return Jt(jt(e, this.option.parsedVisual), "rgba")
                    }, category: nT, piecewise: function (e, t) {
                        var i = rT.call(this, t);
                        return null == i && (i = Jt(jt(e, this.option.parsedVisual), "rgba")), i
                    }, fixed: aT
                }
            },
            colorHue: eT(function (e, t) {
                return qt(e, t)
            }),
            colorSaturation: eT(function (e, t) {
                return qt(e, null, t)
            }),
            colorLightness: eT(function (e, t) {
                return qt(e, null, null, t)
            }),
            colorAlpha: eT(function (e, t) {
                return Yt(e, t)
            }),
            opacity: {applyVisual: iT("opacity"), _doMap: oT([0, 1])},
            liftZ: {applyVisual: iT("liftZ"), _doMap: {linear: aT, category: aT, piecewise: aT, fixed: aT}},
            symbol: {
                applyVisual: function (e, t, i) {
                    var n = this.mapValueToVisual(e);
                    if (L(n)) i("symbol", n); else if (qk(n)) for (var a in n) n.hasOwnProperty(a) && i(a, n[a])
                }, _doMap: {
                    linear: tT, category: nT, piecewise: function (e, t) {
                        var i = rT.call(this, t);
                        return null == i && (i = tT.call(this, e)), i
                    }, fixed: aT
                }
            },
            symbolSize: {applyVisual: iT("symbolSize"), _doMap: oT([0, 1])}
        };

        function Qk(e, t) {
            var i = e.visual, n = [];
            B(i) ? Xk(i, function (e) {
                n.push(e)
            }) : null != i && n.push(i), t || 1 !== n.length || {
                color: 1,
                symbol: 1
            }.hasOwnProperty(e.type) || (n[1] = n[0]), sT(e, n)
        }

        function eT(e) {
            return {
                applyVisual: function (t, i, n) {
                    t = this.mapValueToVisual(t), n("color", e(i("color"), t))
                }, _doMap: oT([0, 1])
            }
        }

        function tT(e) {
            var t = this.option.visual;
            return t[Math.round(xl(e, [0, 1], [0, t.length - 1], !0))] || {}
        }

        function iT(e) {
            return function (t, i, n) {
                n(e, this.mapValueToVisual(t))
            }
        }

        function nT(e) {
            var t = this.option.visual;
            return t[this.option.loop && e !== Yk ? e % t.length : e]
        }

        function aT() {
            return this.option.visual[0]
        }

        function oT(e) {
            return {
                linear: function (t) {
                    return xl(t, e, this.option.visual, !0)
                }, category: nT, piecewise: function (t, i) {
                    var n = rT.call(this, i);
                    return null == n && (n = xl(t, e, this.option.visual, !0)), n
                }, fixed: aT
            }
        }

        function rT(e) {
            var t = this.option, i = t.pieceList;
            if (t.hasSpecialVisual) {
                var n = i[Jk.findPieceIndex(e, i)];
                if (n && n.visual) return n.visual[this.type]
            }
        }

        function sT(e, t) {
            return e.visual = t, "color" === e.type && (e.parsedVisual = D(t, function (e) {
                return Wt(e)
            })), t
        }

        var lT = {
            linear: function (e) {
                return xl(e, this.option.dataExtent, [0, 1], !0)
            }, piecewise: function (e) {
                var t = this.option.pieceList, i = Jk.findPieceIndex(e, t, !0);
                if (null != i) return xl(i, [0, t.length - 1], [0, 1], !0)
            }, category: function (e) {
                var t = this.option.categories ? this.option.categoryMap[e] : e;
                return null == t ? Yk : t
            }, fixed: te
        };

        function dT(e, t, i) {
            return e ? t <= i : t < i
        }

        Jk.listVisualTypes = function () {
            var e = [];
            return A(Zk, function (t, i) {
                e.push(i)
            }), e
        }, Jk.addVisualHandler = function (e, t) {
            Zk[e] = t
        }, Jk.isValidType = function (e) {
            return Zk.hasOwnProperty(e)
        }, Jk.eachVisual = function (e, t, i) {
            B(e) ? A(e, t, i) : t.call(i, e)
        }, Jk.mapVisual = function (e, t, i) {
            var n, a = O(e) ? [] : B(e) ? {} : (n = !0, null);
            return Jk.eachVisual(e, function (e, o) {
                var r = t.call(i, e, o);
                n ? a = r : a[o] = r
            }), a
        }, Jk.retrieveVisuals = function (e) {
            var t, i = {};
            return e && Xk(Zk, function (n, a) {
                e.hasOwnProperty(a) && (i[a] = e[a], t = !0)
            }), t ? i : null
        }, Jk.prepareVisualTypes = function (e) {
            if (qk(e)) {
                var t = [];
                Xk(e, function (e, i) {
                    t.push(i)
                }), e = t
            } else {
                if (!O(e)) return [];
                e = e.slice()
            }
            return e.sort(function (e, t) {
                return "color" === t && "color" !== e && 0 === e.indexOf("color") ? 1 : -1
            }), e
        }, Jk.dependsOn = function (e, t) {
            return "color" === t ? !(!e || 0 !== e.indexOf(t)) : e === t
        }, Jk.findPieceIndex = function (e, t, i) {
            for (var n, a = 1 / 0, o = 0, r = t.length; o < r; o++) {
                var s = t[o].value;
                if (null != s) {
                    if (s === e || "string" == typeof s && s === e + "") return o;
                    i && c(s, o)
                }
            }
            for (o = 0, r = t.length; o < r; o++) {
                var l = t[o], d = l.interval, u = l.close;
                if (d) {
                    if (d[0] === -1 / 0) {
                        if (dT(u[1], e, d[1])) return o
                    } else if (d[1] === 1 / 0) {
                        if (dT(u[0], d[0], e)) return o
                    } else if (dT(u[0], d[0], e) && dT(u[1], e, d[1])) return o;
                    i && c(d[0], o), i && c(d[1], o)
                }
            }
            if (i) return e === 1 / 0 ? t.length - 1 : e === -1 / 0 ? 0 : n;

            function c(t, i) {
                var o = Math.abs(t - e);
                o < a && (a = o, n = i)
            }
        };
        var uT = O, cT = "itemStyle", hT = {
            seriesType: "treemap", reset: function (e, t, i, n) {
                var a = e.getData().tree, o = a.root, r = e.getModel(cT);
                o.isRemoved() || function e(t, i, n, a, o, r) {
                    var s = t.getModel(), l = t.getLayout();
                    if (l && !l.invisible && l.isInView) {
                        var d, u, c = t.getModel(cT), h = n[t.depth], f = function (e, t, i, n) {
                            var a = k({}, t);
                            return A(["color", "colorAlpha", "colorSaturation"], function (o) {
                                var r = e.get(o, !0);
                                null == r && i && (r = i[o]), null == r && (r = t[o]), null == r && (r = n.get(o)), null != r && (a[o] = r)
                            }), a
                        }(c, i, h, a), g = c.get("borderColor"), p = c.get("borderColorSaturation");
                        null != p && (d = fT(f), g = null != (u = d) ? qt(u, null, null, p) : null), t.setVisual("borderColor", g);
                        var v = t.viewChildren;
                        if (v && v.length) {
                            var m = function (e, t, i, n, a, o) {
                                if (o && o.length) {
                                    var r = pT(t, "color") || null != a.color && "none" !== a.color && (pT(t, "colorAlpha") || pT(t, "colorSaturation"));
                                    if (r) {
                                        var s = t.get("visualMin"), l = t.get("visualMax"), d = i.dataExtent.slice();
                                        null != s && s < d[0] && (d[0] = s), null != l && l > d[1] && (d[1] = l);
                                        var u = t.get("colorMappingBy"),
                                            c = {type: r.name, dataExtent: d, visual: r.range};
                                        "color" !== c.type || "index" !== u && "id" !== u ? c.mappingMethod = "linear" : (c.mappingMethod = "category", c.loop = !0);
                                        var h = new Jk(c);
                                        return h.__drColorMappingBy = u, h
                                    }
                                }
                            }(0, s, l, 0, f, v);
                            A(v, function (t, i) {
                                if (t.depth >= o.length || t === o[t.depth]) {
                                    var l = function (e, t, i, n, a, o) {
                                        var r = k({}, t);
                                        if (a) {
                                            var s = a.type, l = "color" === s && a.__drColorMappingBy,
                                                d = "index" === l ? n : "id" === l ? o.mapIdToIndex(i.getId()) : i.getValue(e.get("visualDimension"));
                                            r[s] = a.mapValueToVisual(d)
                                        }
                                        return r
                                    }(s, f, t, i, m, r);
                                    e(t, l, n, a, o, r)
                                }
                            })
                        } else d = fT(f), t.setVisual("color", d)
                    }
                }(o, {}, D(a.levelModels, function (e) {
                    return e ? e.get(cT) : null
                }), r, e.getViewRoot().getAncestors(), e)
            }
        };

        function fT(e) {
            var t = gT(e, "color");
            if (t) {
                var i = gT(e, "colorAlpha"), n = gT(e, "colorSaturation");
                return n && (t = qt(t, null, null, n)), i && (t = Yt(t, i)), t
            }
        }

        function gT(e, t) {
            var i = e[t];
            if (null != i && "none" !== i) return i
        }

        function pT(e, t) {
            var i = e.get(t);
            return uT(i) && i.length ? {name: t, range: i} : null
        }

        var vT = Math.max, mT = Math.min, yT = V, kT = A, TT = ["itemStyle", "borderWidth"],
            wT = ["itemStyle", "gapWidth"], CT = ["upperLabel", "show"], ST = ["upperLabel", "height"], bT = {
                seriesType: "treemap", reset: function (e, t, i, n) {
                    var a = i.getWidth(), o = i.getHeight(), r = e.option,
                        s = vd(e.getBoxLayoutParams(), {width: i.getWidth(), height: i.getHeight()}), l = r.size || [],
                        d = Nl(yT(s.width, l[0]), a), u = Nl(yT(s.height, l[1]), o), c = n && n.type,
                        h = _k(n, ["treemapZoomToNode", "treemapRootToNode"], e),
                        f = "treemapRender" === c || "treemapMove" === c ? n.rootRect : null, g = e.getViewRoot(),
                        p = Ak(g);
                    if ("treemapMove" !== c) {
                        var v = "treemapZoomToNode" === c ? function (e, t, i, n, a) {
                            var o, r = (t || {}).node, s = [n, a];
                            if (!r || r === i) return s;
                            for (var l = n * a, d = l * e.option.zoomToNodeRatio; o = r.parentNode;) {
                                for (var u = 0, c = o.children, h = 0, f = c.length; h < f; h++) u += c[h].getValue();
                                var g = r.getValue();
                                if (0 === g) return s;
                                d *= u / g;
                                var p = o.getModel(), v = p.get(TT), m = Math.max(v, DT(p));
                                d += 4 * v * v + (3 * v + m) * Math.pow(d, .5), Bl < d && (d = Bl), r = o
                            }
                            d < l && (d = l);
                            var y = Math.pow(d / l, .5);
                            return [n * y, a * y]
                        }(e, h, g, d, u) : f ? [f.width, f.height] : [d, u], m = r.sort;
                        m && "asc" !== m && "desc" !== m && (m = "desc");
                        var y = {squareRatio: r.squareRatio, sort: m, leafDepth: r.leafDepth};
                        g.hostTree.clearLayouts();
                        var T = {x: 0, y: 0, width: v[0], height: v[1], area: v[0] * v[1]};
                        g.setLayout(T), function e(t, i, n, a) {
                            var o, r;
                            if (!t.isRemoved()) {
                                var s = t.getLayout();
                                o = s.width, r = s.height;
                                var l = t.getModel(), d = l.get(TT), u = l.get(wT) / 2, c = DT(l), h = Math.max(d, c),
                                    f = d - u, g = h - u, l = t.getModel();
                                t.setLayout({
                                    borderWidth: d,
                                    upperHeight: h,
                                    upperLabelHeight: c
                                }, !0), o = vT(o - 2 * f, 0), r = vT(r - f - g, 0);
                                var p = o * r, v = IT(t, l, p, i, n, a);
                                if (v.length) {
                                    var m = {x: f, y: g, width: o, height: r}, y = mT(o, r), k = 1 / 0, T = [];
                                    T.area = 0;
                                    for (var w = 0, C = v.length; w < C;) {
                                        var S = v[w];
                                        T.push(S), T.area += S.getLayout().area;
                                        var b = _T(T, y, i.squareRatio);
                                        k = b <= k ? (w++, b) : (T.area -= T.pop().getLayout().area, AT(T, y, m, u, !1), y = mT(m.width, m.height), T.length = T.area = 0, 1 / 0)
                                    }
                                    if (T.length && AT(T, y, m, u, !0), !n) {
                                        var I = l.get("childrenVisibleMin");
                                        null != I && p < I && (n = !0)
                                    }
                                    for (var w = 0, C = v.length; w < C; w++) e(v[w], i, n, a + 1)
                                }
                            }
                        }(g, y, !1, 0), T = g.getLayout(), kT(p, function (e, t) {
                            var i = (p[t + 1] || g).getValue();
                            e.setLayout(k({dataExtent: [i, i], borderWidth: 0, upperHeight: 0}, T))
                        })
                    }
                    var w = e.getData().tree.root;
                    w.setLayout(function (e, t, i) {
                        if (t) return {x: t.x, y: t.y};
                        var n = {x: 0, y: 0};
                        if (!i) return n;
                        var a = i.node, o = a.getLayout();
                        if (!o) return n;
                        for (var r = [o.width / 2, o.height / 2], s = a; s;) {
                            var l = s.getLayout();
                            r[0] += l.x, r[1] += l.y, s = s.parentNode
                        }
                        return {x: e.width / 2 - r[0], y: e.height / 2 - r[1]}
                    }(s, f, h), !0), e.setLayoutInfo(s), function e(t, i, n, a, o) {
                        var r = t.getLayout(), s = n[o], l = s && s === t;
                        if (!(s && !l || o === n.length && t !== a)) {
                            t.setLayout({isInView: !0, invisible: !l && !i.intersect(r), isAboveViewRoot: l}, !0);
                            var d = new Ai(i.x - r.x, i.y - r.y, i.width, i.height);
                            kT(t.viewChildren || [], function (t) {
                                e(t, d, n, a, o + 1)
                            })
                        }
                    }(w, new Ai(-s.x, -s.y, a, o), p, g, 0)
                }
            };

        function IT(e, t, i, n, a, o) {
            var r = e.children || [], s = n.sort;
            "asc" !== s && "desc" !== s && (s = null);
            var l = null != n.leafDepth && n.leafDepth <= o;
            if (a && !l) return e.viewChildren = [];
            !function (e, t) {
                t && e.sort(function (e, i) {
                    var n = "asc" === t ? e.getValue() - i.getValue() : i.getValue() - e.getValue();
                    return 0 == n ? "asc" === t ? e.dataIndex - i.dataIndex : i.dataIndex - e.dataIndex : n
                })
            }(r = N(r, function (e) {
                return !e.isRemoved()
            }), s);
            var d = function (e, t, i) {
                for (var n = 0, a = 0, o = t.length; a < o; a++) n += t[a].getValue();
                var r = e.get("visualDimension");
                if (t && t.length) if ("value" === r && i) s = [t[t.length - 1].getValue(), t[0].getValue()], "asc" === i && s.reverse(); else {
                    var s = [1 / 0, -1 / 0];
                    kT(t, function (e) {
                        var t = e.getValue(r);
                        t < s[0] && (s[0] = t), t > s[1] && (s[1] = t)
                    })
                } else s = [NaN, NaN];
                return {sum: n, dataExtent: s}
            }(t, r, s);
            if (0 === d.sum) return e.viewChildren = [];
            if (d.sum = function (e, t, i, n, a) {
                if (!n) return i;
                for (var o = e.get("visibleMin"), r = a.length, s = r, l = r - 1; 0 <= l; l--) {
                    var d = a["asc" === n ? r - l - 1 : l].getValue();
                    d / i * t < o && (s = l, i -= d)
                }
                return "asc" === n ? a.splice(0, r - s) : a.splice(s, r - s), i
            }(t, i, d.sum, s, r), 0 === d.sum) return e.viewChildren = [];
            for (var u = 0, c = r.length; u < c; u++) {
                var h = r[u].getValue() / d.sum * i;
                r[u].setLayout({area: h})
            }
            return l && (r.length && e.setLayout({isLeafRoot: !0}, !0), r.length = 0), e.viewChildren = r, e.setLayout({dataExtent: d.dataExtent}, !0), r
        }

        function _T(e, t, i) {
            for (var n, a = 0, o = 1 / 0, r = 0, s = e.length; r < s; r++) (n = e[r].getLayout().area) && (n < o && (o = n), a < n && (a = n));
            var l = e.area * e.area, d = t * t * i;
            return l ? vT(d * a / l, l / (d * o)) : 1 / 0
        }

        function AT(e, t, i, n, a) {
            var o = t === i.width ? 0 : 1, r = 1 - o, s = ["x", "y"], l = ["width", "height"], d = i[s[o]],
                u = t ? e.area / t : 0;
            (a || u > i[l[r]]) && (u = i[l[r]]);
            for (var c = 0, h = e.length; c < h; c++) {
                var f = e[c], g = {}, p = u ? f.getLayout().area / u : 0, v = g[l[r]] = vT(u - 2 * n, 0),
                    m = i[s[o]] + i[l[o]] - d, y = c === h - 1 || m < p ? m : p, k = g[l[o]] = vT(y - 2 * n, 0);
                g[s[r]] = i[s[r]] + mT(n, v / 2), g[s[o]] = d + mT(n, k / 2), d += y, f.setLayout(g, !0)
            }
            i[s[r]] += u, i[l[r]] -= u
        }

        function DT(e) {
            return e.get(CT) ? e.get(ST) : 0
        }

        function xT(e) {
            return "_EC_" + e
        }

        function NT(e) {
            this._directed = e || !1, this.nodes = [], this.edges = [], this._nodesMap = {}, this._edgesMap = {}, this.data, this.edgeData
        }

        vf(hT), pf(bT);
        var ET = NT.prototype;

        function PT(e, t) {
            this.id = null == e ? "" : e, this.inEdges = [], this.outEdges = [], this.edges = [], this.hostGraph, this.dataIndex = null == t ? -1 : t
        }

        function MT(e, t, i) {
            this.node1 = e, this.node2 = t, this.dataIndex = null == i ? -1 : i
        }

        function OT(e, t) {
            return {
                getValue: function (i) {
                    var n = this[e][t];
                    return n.get(n.getDimension(i || "value"), this.dataIndex)
                }, setVisual: function (i, n) {
                    0 <= this.dataIndex && this[e][t].setItemVisual(this.dataIndex, i, n)
                }, getVisual: function (i, n) {
                    return this[e][t].getItemVisual(this.dataIndex, i, n)
                }, setLayout: function (i, n) {
                    0 <= this.dataIndex && this[e][t].setItemLayout(this.dataIndex, i, n)
                }, getLayout: function () {
                    return this[e][t].getItemLayout(this.dataIndex)
                }, getGraphicEl: function () {
                    return this[e][t].getItemGraphicEl(this.dataIndex)
                }, getRawIndex: function () {
                    return this[e][t].getRawIndex(this.dataIndex)
                }
            }
        }

        function FT(e, t, i, n, a) {
            for (var o = new NT(n), r = 0; r < e.length; r++) o.addNode(V(e[r].id, e[r].name, r), r);
            var s = [], l = [], d = 0;
            for (r = 0; r < t.length; r++) {
                var u = t[r], c = u.source, h = u.target;
                o.addEdge(c, h, d) && (l.push(u), s.push(V(u.id, c + " > " + h)), d++)
            }
            var f, g = i.get("coordinateSystem");
            if ("cartesian2d" === g || "polar" === g) f = rg(e, i); else {
                var p = iu.get(g), v = p && "view" !== p.type && p.dimensions || [];
                S(v, "value") < 0 && v.concat(["value"]);
                var m = eg(e, {coordDimensions: v});
                (f = new Kf(m, i)).initData(e)
            }
            var y = new Kf(["value"], i);
            return y.initData(l, s), a && a(f, y), ik({
                mainData: f,
                struct: o,
                structAttr: "graph",
                datas: {node: f, edge: y},
                datasAttr: {node: "data", edge: "edgeData"}
            }), o.update(), o
        }

        ET.type = "graph", ET.isDirected = function () {
            return this._directed
        }, ET.addNode = function (e, t) {
            e = null == e ? "" + t : "" + e;
            var i = this._nodesMap;
            if (!i[xT(e)]) {
                var n = new PT(e, t);
                return (n.hostGraph = this).nodes.push(n), i[xT(e)] = n
            }
        }, ET.getNodeByIndex = function (e) {
            var t = this.data.getRawIndex(e);
            return this.nodes[t]
        }, ET.getNodeById = function (e) {
            return this._nodesMap[xT(e)]
        }, ET.addEdge = function (e, t, i) {
            var n = this._nodesMap, a = this._edgesMap;
            if ("number" == typeof e && (e = this.nodes[e]), "number" == typeof t && (t = this.nodes[t]), PT.isInstance(e) || (e = n[xT(e)]), PT.isInstance(t) || (t = n[xT(t)]), e && t) {
                var o = e.id + "-" + t.id;
                if (!a[o]) {
                    var r = new MT(e, t, i);
                    return (r.hostGraph = this)._directed && (e.outEdges.push(r), t.inEdges.push(r)), e.edges.push(r), e !== t && t.edges.push(r), this.edges.push(r), a[o] = r
                }
            }
        }, ET.getEdgeByIndex = function (e) {
            var t = this.edgeData.getRawIndex(e);
            return this.edges[t]
        }, ET.getEdge = function (e, t) {
            PT.isInstance(e) && (e = e.id), PT.isInstance(t) && (t = t.id);
            var i = this._edgesMap;
            return this._directed ? i[e + "-" + t] : i[e + "-" + t] || i[t + "-" + e]
        }, ET.eachNode = function (e, t) {
            for (var i = this.nodes, n = i.length, a = 0; a < n; a++) 0 <= i[a].dataIndex && e.call(t, i[a], a)
        }, ET.eachEdge = function (e, t) {
            for (var i = this.edges, n = i.length, a = 0; a < n; a++) 0 <= i[a].dataIndex && 0 <= i[a].node1.dataIndex && 0 <= i[a].node2.dataIndex && e.call(t, i[a], a)
        }, ET.breadthFirstTraverse = function (e, t, i, n) {
            if (PT.isInstance(t) || (t = this._nodesMap[xT(t)]), t) {
                for (var a = "out" === i ? "outEdges" : "in" === i ? "inEdges" : "edges", o = 0; o < this.nodes.length; o++) this.nodes[o].__visited = !1;
                if (!e.call(n, t, null)) for (var r = [t]; r.length;) {
                    var s = r.shift(), l = s[a];
                    for (o = 0; o < l.length; o++) {
                        var d = l[o], u = d.node1 === s ? d.node2 : d.node1;
                        if (!u.__visited) {
                            if (e.call(n, u, s)) return;
                            r.push(u), u.__visited = !0
                        }
                    }
                }
            }
        }, ET.update = function () {
            for (var e = this.data, t = this.edgeData, i = this.nodes, n = this.edges, a = 0, o = i.length; a < o; a++) i[a].dataIndex = -1;
            for (a = 0, o = e.count(); a < o; a++) i[e.getRawIndex(a)].dataIndex = a;
            for (t.filterSelf(function (e) {
                var i = n[t.getRawIndex(e)];
                return 0 <= i.node1.dataIndex && 0 <= i.node2.dataIndex
            }), a = 0, o = n.length; a < o; a++) n[a].dataIndex = -1;
            for (a = 0, o = t.count(); a < o; a++) n[t.getRawIndex(a)].dataIndex = a
        }, ET.clone = function () {
            for (var e = new NT(this._directed), t = this.nodes, i = this.edges, n = 0; n < t.length; n++) e.addNode(t[n].id, t[n].dataIndex);
            for (n = 0; n < i.length; n++) {
                var a = i[n];
                e.addEdge(a.node1.id, a.node2.id, a.dataIndex)
            }
            return e
        }, PT.prototype = {
            constructor: PT, degree: function () {
                return this.edges.length
            }, inDegree: function () {
                return this.inEdges.length
            }, outDegree: function () {
                return this.outEdges.length
            }, getModel: function (e) {
                if (!(this.dataIndex < 0)) return this.hostGraph.data.getItemModel(this.dataIndex).getModel(e)
            }
        }, MT.prototype.getModel = function (e) {
            if (!(this.dataIndex < 0)) return this.hostGraph.edgeData.getItemModel(this.dataIndex).getModel(e)
        }, I(PT, OT("hostGraph", "data")), I(MT, OT("hostGraph", "edgeData")), NT.Node = PT, NT.Edge = MT, Qa(PT), Qa(MT);
        var LT = wf({
            type: "series.graph",
            init: function (e) {
                LT.superApply(this, "init", arguments);
                var t = this;

                function i() {
                    return t._categoriesData
                }

                this.legendVisualProvider = new Fm(i, i), this.fillDataTextStyle(e.edges || e.links), this._updateCategoriesData()
            },
            mergeOption: function (e) {
                LT.superApply(this, "mergeOption", arguments), this.fillDataTextStyle(e.edges || e.links), this._updateCategoriesData()
            },
            mergeDefaultAndTheme: function (e) {
                LT.superApply(this, "mergeDefaultAndTheme", arguments), Ma(e, ["edgeLabel"], ["show"])
            },
            getInitialData: function (e, t) {
                var i = e.edges || e.links || [], n = e.data || e.nodes || [], a = this;
                if (n && i) return FT(n, i, this, !0, function (e, i) {
                    e.wrapMethod("getItemModel", function (e) {
                        var t = a._categoriesModels[e.getShallow("category")];
                        return t && (t.parentModel = e.parentModel, e.parentModel = t), e
                    });
                    var n = a.getModel("edgeLabel"), o = new Sl({label: n.option}, n.parentModel, t),
                        r = a.getModel("emphasis.edgeLabel"),
                        s = new Sl({emphasis: {label: r.option}}, r.parentModel, t);

                    function l(e) {
                        return (e = this.parsePath(e)) && "label" === e[0] ? o : e && "emphasis" === e[0] && "label" === e[1] ? s : this.parentModel
                    }

                    i.wrapMethod("getItemModel", function (e) {
                        return e.customizeGetParent(l), e
                    })
                }).data
            },
            getGraph: function () {
                return this.getData().graph
            },
            getEdgeData: function () {
                return this.getGraph().edgeData
            },
            getCategoriesData: function () {
                return this._categoriesData
            },
            formatTooltip: function (e, t, i) {
                if ("edge" !== i) return LT.superApply(this, "formatTooltip", arguments);
                var n = this.getData(), a = this.getDataParams(e, i), o = n.graph.getEdgeByIndex(e),
                    r = n.getName(o.node1.dataIndex), s = n.getName(o.node2.dataIndex), l = [];
                return null != r && l.push(r), null != s && l.push(s), l = Ql(l.join(" > ")), a.value && (l += " : " + Ql(a.value)), l
            },
            _updateCategoriesData: function () {
                var e = D(this.option.categories || [], function (e) {
                    return null != e.value ? e : k({value: 0}, e)
                }), t = new Kf(["value"], this);
                t.initData(e), this._categoriesData = t, this._categoriesModels = t.mapArray(function (e) {
                    return t.getItemModel(e, !0)
                })
            },
            setZoom: function (e) {
                this.option.zoom = e
            },
            setCenter: function (e) {
                this.option.center = e
            },
            isAnimationEnabled: function () {
                return LT.superCall(this, "isAnimationEnabled") && !("force" === this.get("layout") && this.get("force.layoutAnimation"))
            },
            defaultOption: {
                zlevel: 0,
                z: 2,
                coordinateSystem: "view",
                legendHoverLink: !0,
                hoverAnimation: !0,
                layout: null,
                focusNodeAdjacency: !1,
                circular: {rotateLabel: !1},
                force: {
                    initLayout: null,
                    repulsion: [0, 50],
                    gravity: .1,
                    friction: .6,
                    edgeLength: 30,
                    layoutAnimation: !0
                },
                left: "center",
                top: "center",
                symbol: "circle",
                symbolSize: 10,
                edgeSymbol: ["none", "none"],
                edgeSymbolSize: 10,
                edgeLabel: {position: "middle", distance: 5},
                draggable: !1,
                roam: !1,
                center: null,
                zoom: 1,
                nodeScaleRatio: .6,
                label: {show: !1, formatter: "{b}"},
                itemStyle: {},
                lineStyle: {color: "#aaa", width: 1, curveness: 0, opacity: .5},
                emphasis: {label: {show: !0}}
            }
        }), BT = is.prototype, UT = rs.prototype;

        function RT(e) {
            return isNaN(+e.cpx1) || isNaN(+e.cpy1)
        }

        var KT = Ss({
            type: "ec-line",
            style: {stroke: "#000", fill: null},
            shape: {x1: 0, y1: 0, x2: 0, y2: 0, percent: 1, cpx1: null, cpy1: null},
            buildPath: function (e, t) {
                this[RT(t) ? "_buildPathLine" : "_buildPathCurve"](e, t)
            },
            _buildPathLine: BT.buildPath,
            _buildPathCurve: UT.buildPath,
            pointAt: function (e) {
                return this[RT(this.shape) ? "_pointAtLine" : "_pointAtCurve"](e)
            },
            _pointAtLine: BT.pointAt,
            _pointAtCurve: UT.pointAt,
            tangentAt: function (e) {
                var t = this.shape, i = RT(t) ? [t.x2 - t.x1, t.y2 - t.y1] : this._tangentAtCurve(e);
                return ve(i, i)
            },
            _tangentAtCurve: UT.tangentAt
        }), WT = ["fromSymbol", "toSymbol"];

        function VT(e) {
            return "_" + e + "Type"
        }

        function HT(e, t, i) {
            var n = t.getItemVisual(i, "color"), a = t.getItemVisual(i, e), o = t.getItemVisual(i, e + "Size");
            if (a && "none" !== a) {
                O(o) || (o = [o, o]);
                var r = cp(a, -o[0] / 2, -o[1] / 2, o[0], o[1], n);
                return r.name = e, r
            }
        }

        function zT(e, t) {
            e.x1 = t[0][0], e.y1 = t[0][1], e.x2 = t[1][0], e.y2 = t[1][1], e.percent = 1;
            var i = t[2];
            i ? (e.cpx1 = i[0], e.cpy1 = i[1]) : (e.cpx1 = NaN, e.cpy1 = NaN)
        }

        function jT(e, t, i) {
            Di.call(this), this._createLine(e, t, i)
        }

        var GT = jT.prototype;

        function $T(e) {
            this._ctor = e || jT, this.group = new Di
        }

        GT.beforeUpdate = function () {
            var e = this.childOfName("fromSymbol"), t = this.childOfName("toSymbol"), i = this.childOfName("label");
            if (e || t || !i.ignore) {
                for (var n = 1, a = this.parent; a;) a.scale && (n /= a.scale[0]), a = a.parent;
                var o = this.childOfName("line");
                if (this.__dirty || o.__dirty) {
                    var r = o.shape.percent, s = o.pointAt(0), l = o.pointAt(r), d = ue([], l, s);
                    if (ve(d, d), e) {
                        e.attr("position", s);
                        var u = o.tangentAt(0);
                        e.attr("rotation", Math.PI / 2 - Math.atan2(u[1], u[0])), e.attr("scale", [n * r, n * r])
                    }
                    if (t && (t.attr("position", l), u = o.tangentAt(1), t.attr("rotation", -Math.PI / 2 - Math.atan2(u[1], u[0])), t.attr("scale", [n * r, n * r])), !i.ignore) {
                        var c, h, f, g;
                        i.attr("position", l);
                        var p = i.__labelDistance, v = p[0] * n, m = p[1] * n, y = r / 2,
                            k = [(u = o.tangentAt(y))[1], -u[0]], T = o.pointAt(y);
                        0 < k[1] && (k[0] = -k[0], k[1] = -k[1]);
                        var w, C = u[0] < 0 ? -1 : 1;
                        if ("start" !== i.__position && "end" !== i.__position) {
                            var S = -Math.atan2(u[1], u[0]);
                            l[0] < s[0] && (S = Math.PI + S), i.attr("rotation", S)
                        }
                        switch (i.__position) {
                            case"insideStartTop":
                            case"insideMiddleTop":
                            case"insideEndTop":
                            case"middle":
                                w = -m, f = "bottom";
                                break;
                            case"insideStartBottom":
                            case"insideMiddleBottom":
                            case"insideEndBottom":
                                w = m, f = "top";
                                break;
                            default:
                                w = 0, f = "middle"
                        }
                        switch (i.__position) {
                            case"end":
                                c = [d[0] * v + l[0], d[1] * m + l[1]], h = .8 < d[0] ? "left" : d[0] < -.8 ? "right" : "center", f = .8 < d[1] ? "top" : d[1] < -.8 ? "bottom" : "middle";
                                break;
                            case"start":
                                c = [-d[0] * v + s[0], -d[1] * m + s[1]], h = .8 < d[0] ? "right" : d[0] < -.8 ? "left" : "center", f = .8 < d[1] ? "bottom" : d[1] < -.8 ? "top" : "middle";
                                break;
                            case"insideStartTop":
                            case"insideStart":
                            case"insideStartBottom":
                                c = [v * C + s[0], s[1] + w], h = u[0] < 0 ? "right" : "left", g = [-v * C, -w];
                                break;
                            case"insideMiddleTop":
                            case"insideMiddle":
                            case"insideMiddleBottom":
                            case"middle":
                                c = [T[0], T[1] + w], h = "center", g = [0, -w];
                                break;
                            case"insideEndTop":
                            case"insideEnd":
                            case"insideEndBottom":
                                c = [-v * C + l[0], l[1] + w], h = 0 <= u[0] ? "right" : "left", g = [v * C, -w]
                        }
                        i.attr({
                            style: {textVerticalAlign: i.__verticalAlign || f, textAlign: i.__textAlign || h},
                            position: c,
                            scale: [n, n],
                            origin: g
                        })
                    }
                }
            }
        }, GT._createLine = function (e, t, i) {
            var n = e.hostModel, a = function (e) {
                var t = new KT({name: "line", subPixelOptimize: !0});
                return zT(t.shape, e), t
            }(e.getItemLayout(t));
            a.shape.percent = 0, rl(a, {shape: {percent: 1}}, n, t), this.add(a);
            var o = new Rr({name: "label", lineLabelOriginalOpacity: 1});
            this.add(o), A(WT, function (i) {
                var n = HT(i, e, t);
                this.add(n), this[VT(i)] = e.getItemVisual(t, i)
            }, this), this._updateCommonStl(e, t, i)
        }, GT.updateData = function (e, t, i) {
            var n = e.hostModel, a = this.childOfName("line"), o = e.getItemLayout(t), r = {shape: {}};
            zT(r.shape, o), ol(a, r, n, t), A(WT, function (i) {
                var n = e.getItemVisual(t, i), a = VT(i);
                if (this[a] !== n) {
                    this.remove(this.childOfName(i));
                    var o = HT(i, e, t);
                    this.add(o)
                }
                this[a] = n
            }, this), this._updateCommonStl(e, t, i)
        }, GT._updateCommonStl = function (e, t, i) {
            var n = e.hostModel, a = this.childOfName("line"), o = i && i.lineStyle, r = i && i.hoverLineStyle,
                s = i && i.labelModel, l = i && i.hoverLabelModel;
            if (!i || e.hasItemOption) {
                var d = e.getItemModel(t);
                o = d.getModel("lineStyle").getLineStyle(), r = d.getModel("emphasis.lineStyle").getLineStyle(), s = d.getModel("label"), l = d.getModel("emphasis.label")
            }
            var u = e.getItemVisual(t, "color"), c = z(e.getItemVisual(t, "opacity"), o.opacity, 1);
            a.useStyle(T({
                strokeNoScale: !0,
                fill: "none",
                stroke: u,
                opacity: c
            }, o)), a.hoverStyle = r, A(WT, function (e) {
                var t = this.childOfName(e);
                t && (t.setColor(u), t.setStyle({opacity: c}))
            }, this);
            var h, f, g = s.getShallow("show"), p = l.getShallow("show"), v = this.childOfName("label");
            if ((g || p) && (h = u || "#000", null == (f = n.getFormattedLabel(t, "normal", e.dataType)))) {
                var m = n.getRawValue(t);
                f = null == m ? e.getName(t) : isFinite(m) ? El(m) : m
            }
            var y = g ? f : null, k = p ? H(n.getFormattedLabel(t, "emphasis", e.dataType), f) : null, w = v.style;
            if (null != y || null != k) {
                Js(v.style, s, {text: y}, {autoColor: h}), v.__textAlign = w.textAlign, v.__verticalAlign = w.textVerticalAlign, v.__position = s.get("position") || "middle";
                var C = s.get("distance");
                O(C) || (C = [C, C]), v.__labelDistance = C
            }
            v.hoverStyle = null != k ? {
                text: k,
                textFill: l.getTextColor(!0),
                fontStyle: l.getShallow("fontStyle"),
                fontWeight: l.getShallow("fontWeight"),
                fontSize: l.getShallow("fontSize"),
                fontFamily: l.getShallow("fontFamily")
            } : {text: null}, v.ignore = !g && !p, js(this)
        }, GT.highlight = function () {
            this.trigger("emphasis")
        }, GT.downplay = function () {
            this.trigger("normal")
        }, GT.updateLayout = function (e, t) {
            this.setLinePoints(e.getItemLayout(t))
        }, GT.setLinePoints = function (e) {
            var t = this.childOfName("line");
            zT(t.shape, e), t.dirty()
        }, b(jT, Di);
        var XT = $T.prototype;

        function qT(e) {
            var t = e.hostModel;
            return {
                lineStyle: t.getModel("lineStyle").getLineStyle(),
                hoverLineStyle: t.getModel("emphasis.lineStyle").getLineStyle(),
                labelModel: t.getModel("label"),
                hoverLabelModel: t.getModel("emphasis.label")
            }
        }

        function YT(e) {
            return isNaN(e[0]) || isNaN(e[1])
        }

        function JT(e) {
            return !YT(e[0]) && !YT(e[1])
        }

        function ZT(e) {
            var t = e.coordinateSystem;
            if ("view" !== t.type) return 1;
            var i = e.option.nodeScaleRatio, n = t.scale, a = n && n[0] || 1;
            return ((t.getZoom() - 1) * i + 1) / a
        }

        function QT(e) {
            var t = e.getVisual("symbolSize");
            return t instanceof Array && (t = (t[0] + t[1]) / 2), +t
        }

        XT.isPersistent = function () {
            return !0
        }, XT.updateData = function (e) {
            var t = this, i = t.group, n = t._lineData;
            t._lineData = e, n || i.removeAll();
            var a = qT(e);
            e.diff(n).add(function (i) {
                !function (e, t, i, n) {
                    if (JT(t.getItemLayout(i))) {
                        var a = new e._ctor(t, i, n);
                        t.setItemGraphicEl(i, a), e.group.add(a)
                    }
                }(t, e, i, a)
            }).update(function (i, o) {
                !function (e, t, i, n, a, o) {
                    var r = t.getItemGraphicEl(n);
                    if (!JT(i.getItemLayout(a))) return e.group.remove(r);
                    r ? r.updateData(i, a, o) : r = new e._ctor(i, a, o), i.setItemGraphicEl(a, r), e.group.add(r)
                }(t, n, e, o, i, a)
            }).remove(function (e) {
                i.remove(n.getItemGraphicEl(e))
            }).execute()
        }, XT.updateLayout = function () {
            var e = this._lineData;
            e && e.eachItemGraphicEl(function (t, i) {
                t.updateLayout(e, i)
            }, this)
        }, XT.incrementalPrepareUpdate = function (e) {
            this._seriesScope = qT(e), this._lineData = null, this.group.removeAll()
        }, XT.incrementalUpdate = function (e, t) {
            function i(e) {
                e.isGroup || function (e) {
                    return e.animators && 0 < e.animators.length
                }(e) || (e.incremental = e.useHoverLayer = !0)
            }

            for (var n = e.start; n < e.end; n++) if (JT(t.getItemLayout(n))) {
                var a = new this._ctor(t, n, this._seriesScope);
                a.traverse(i), this.group.add(a), t.setItemGraphicEl(n, a)
            }
        }, XT.remove = function () {
            this._clearIncremental(), this._incremental = null, this.group.removeAll()
        }, XT._clearIncremental = function () {
            var e = this._incremental;
            e && e.clearDisplaybles()
        };
        var ew = [], tw = [], iw = [], nw = bo, aw = Te, ow = Math.abs;

        function rw(e, t, i) {
            for (var n, a = e[0], o = e[1], r = e[2], s = 1 / 0, l = i * i, d = .1, u = .1; u <= .9; u += .1) ew[0] = nw(a[0], o[0], r[0], u), ew[1] = nw(a[1], o[1], r[1], u), (f = ow(aw(ew, t) - l)) < s && (s = f, n = u);
            for (var c = 0; c < 32; c++) {
                var h = n + d;
                tw[0] = nw(a[0], o[0], r[0], n), tw[1] = nw(a[1], o[1], r[1], n), iw[0] = nw(a[0], o[0], r[0], h), iw[1] = nw(a[1], o[1], r[1], h);
                var f = aw(tw, t) - l;
                if (ow(f) < .01) break;
                var g = aw(iw, t) - l;
                d /= 2, f < 0 ? 0 <= g ? n += d : n -= d : 0 <= g ? n -= d : n += d
            }
            return n
        }

        function sw(e, t) {
            var i = [], n = Ao, a = [[], [], []], o = [[], []], r = [];
            t /= 2, e.eachEdge(function (e, s) {
                var l = e.getLayout(), d = e.getVisual("fromSymbol"), u = e.getVisual("toSymbol");
                l.__original || (l.__original = [re(l[0]), re(l[1])], l[2] && l.__original.push(re(l[2])));
                var c = l.__original;
                if (null != l[2]) {
                    if (oe(a[0], c[0]), oe(a[1], c[2]), oe(a[2], c[1]), d && "none" !== d) {
                        var h = QT(e.node1), f = rw(a, c[0], h * t);
                        n(a[0][0], a[1][0], a[2][0], f, i), a[0][0] = i[3], a[1][0] = i[4], n(a[0][1], a[1][1], a[2][1], f, i), a[0][1] = i[3], a[1][1] = i[4]
                    }
                    u && "none" !== u && (h = QT(e.node2), f = rw(a, c[1], h * t), n(a[0][0], a[1][0], a[2][0], f, i), a[1][0] = i[1], a[2][0] = i[2], n(a[0][1], a[1][1], a[2][1], f, i), a[1][1] = i[1], a[2][1] = i[2]), oe(l[0], a[0]), oe(l[1], a[2]), oe(l[2], a[1])
                } else oe(o[0], c[0]), oe(o[1], c[1]), ue(r, o[1], o[0]), ve(r, r), d && "none" !== d && (h = QT(e.node1), de(o[0], o[0], r, h * t)), u && "none" !== u && (h = QT(e.node2), de(o[1], o[1], r, -h * t)), oe(l[0], o[0]), oe(l[1], o[1])
            })
        }

        var lw = "__focusNodeAdjacency", dw = "__unfocusNodeAdjacency", uw = ["itemStyle", "opacity"],
            cw = ["lineStyle", "opacity"];

        function hw(e, t) {
            var i = e.getVisual("opacity");
            return null != i ? i : e.getModel().get(t)
        }

        function fw(e, t, i) {
            var n = e.getGraphicEl(), a = hw(e, t);
            null != i && (null == a && (a = 1), a *= i), n.downplay && n.downplay(), n.traverse(function (e) {
                if (!e.isGroup) {
                    var t = e.lineLabelOriginalOpacity;
                    null != t && null == i || (t = a), e.setStyle("opacity", t)
                }
            })
        }

        function gw(e, t) {
            var i = hw(e, t), n = e.getGraphicEl();
            n.traverse(function (e) {
                e.isGroup || e.setStyle("opacity", i)
            }), n.highlight && n.highlight()
        }

        function pw(e) {
            return e instanceof Array || (e = [e, e]), e
        }

        function vw(e) {
            var t = e.coordinateSystem;
            if (!t || "view" === t.type) {
                var i = e.getGraph();
                i.eachNode(function (e) {
                    var t = e.getModel();
                    e.setLayout([+t.get("x"), +t.get("y")])
                }), mw(i)
            }
        }

        function mw(e) {
            e.eachEdge(function (e) {
                var t = e.getModel().get("lineStyle.curveness") || 0, i = re(e.node1.getLayout()),
                    n = re(e.node2.getLayout()), a = [i, n];
                +t && a.push([(i[0] + n[0]) / 2 - (i[1] - n[1]) * t, (i[1] + n[1]) / 2 - (n[0] - i[0]) * t]), e.setLayout(a)
            })
        }

        Cf({
            type: "graph", init: function (e, t) {
                var i = new zp, n = new $T, a = this.group;
                this._controller = new Sy(t.getZr()), this._controllerHost = {target: a}, a.add(i.group), a.add(n.group), this._symbolDraw = i, this._lineDraw = n, this._firstRender = !0
            }, render: function (e, t, i) {
                var n = this, a = e.coordinateSystem;
                this._model = e;
                var o = this._symbolDraw, r = this._lineDraw, s = this.group;
                if ("view" === a.type) {
                    var l = {position: a.position, scale: a.scale};
                    this._firstRender ? s.attr(l) : ol(s, l, e)
                }
                sw(e.getGraph(), ZT(e));
                var d = e.getData();
                o.updateData(d);
                var u = e.getEdgeData();
                r.updateData(u), this._updateNodeAndLinkScale(), this._updateController(e, t, i), clearTimeout(this._layoutTimeout);
                var c = e.forceLayout, h = e.get("force.layoutAnimation");
                c && this._startForceLayoutIteration(c, h), d.eachItemGraphicEl(function (t, a) {
                    var o = d.getItemModel(a);
                    t.off("drag").off("dragend");
                    var r = o.get("draggable");
                    r && t.on("drag", function () {
                        c && (c.warmUp(), this._layouting || this._startForceLayoutIteration(c, h), c.setFixed(a), d.setItemLayout(a, t.position))
                    }, this).on("dragend", function () {
                        c && c.setUnfixed(a)
                    }, this), t.setDraggable(r && c), t[lw] && t.off("mouseover", t[lw]), t[dw] && t.off("mouseout", t[dw]), o.get("focusNodeAdjacency") && (t.on("mouseover", t[lw] = function () {
                        n._clearTimer(), i.dispatchAction({
                            type: "focusNodeAdjacency",
                            seriesId: e.id,
                            dataIndex: t.dataIndex
                        })
                    }), t.on("mouseout", t[dw] = function () {
                        n._dispatchUnfocus(i)
                    }))
                }, this), d.graph.eachEdge(function (t) {
                    var a = t.getGraphicEl();
                    a[lw] && a.off("mouseover", a[lw]), a[dw] && a.off("mouseout", a[dw]), t.getModel().get("focusNodeAdjacency") && (a.on("mouseover", a[lw] = function () {
                        n._clearTimer(), i.dispatchAction({
                            type: "focusNodeAdjacency",
                            seriesId: e.id,
                            edgeDataIndex: t.dataIndex
                        })
                    }), a.on("mouseout", a[dw] = function () {
                        n._dispatchUnfocus(i)
                    }))
                });
                var f = "circular" === e.get("layout") && e.get("circular.rotateLabel"), g = d.getLayout("cx"),
                    p = d.getLayout("cy");
                d.eachItemGraphicEl(function (e, t) {
                    var i = d.getItemModel(t).get("label.rotate") || 0, n = e.getSymbolPath();
                    if (f) {
                        var a = d.getItemLayout(t), o = Math.atan2(a[1] - p, a[0] - g);
                        o < 0 && (o = 2 * Math.PI + o);
                        var r = a[0] < g;
                        r && (o -= Math.PI);
                        var s = r ? "left" : "right";
                        Ys(n, {textRotation: -o, textPosition: s, textOrigin: "center"}, {textPosition: s})
                    } else Ys(n, {textRotation: i *= Math.PI / 180})
                }), this._firstRender = !1
            }, dispose: function () {
                this._controller && this._controller.dispose(), this._controllerHost = {}, this._clearTimer()
            }, _dispatchUnfocus: function (e, t) {
                var i = this;
                this._clearTimer(), this._unfocusDelayTimer = setTimeout(function () {
                    i._unfocusDelayTimer = null, e.dispatchAction({type: "unfocusNodeAdjacency", seriesId: i._model.id})
                }, 500)
            }, _clearTimer: function () {
                this._unfocusDelayTimer && (clearTimeout(this._unfocusDelayTimer), this._unfocusDelayTimer = null)
            }, focusNodeAdjacency: function (e, t, i, n) {
                var a = e.getData().graph, o = n.dataIndex, r = n.edgeDataIndex, s = a.getNodeByIndex(o),
                    l = a.getEdgeByIndex(r);
                (s || l) && (a.eachNode(function (e) {
                    fw(e, uw, .1)
                }), a.eachEdge(function (e) {
                    fw(e, cw, .1)
                }), s && (gw(s, uw), A(s.edges, function (e) {
                    e.dataIndex < 0 || (gw(e, cw), gw(e.node1, uw), gw(e.node2, uw))
                })), l && (gw(l, cw), gw(l.node1, uw), gw(l.node2, uw)))
            }, unfocusNodeAdjacency: function (e, t, i, n) {
                var a = e.getData().graph;
                a.eachNode(function (e) {
                    fw(e, uw)
                }), a.eachEdge(function (e) {
                    fw(e, cw)
                })
            }, _startForceLayoutIteration: function (e, t) {
                var i = this;
                !function n() {
                    e.step(function (e) {
                        i.updateLayout(i._model), (i._layouting = !e) && (t ? i._layoutTimeout = setTimeout(n, 16) : n())
                    })
                }()
            }, _updateController: function (e, t, i) {
                var n = this._controller, a = this._controllerHost, o = this.group;
                n.setPointerChecker(function (t, n, a) {
                    var r = o.getBoundingRect();
                    return r.applyTransform(o.transform), r.contain(n, a) && !Fy(t, i, e)
                }), "view" === e.coordinateSystem.type ? (n.enable(e.get("roam")), a.zoomLimit = e.get("scaleLimit"), a.zoom = e.coordinateSystem.getZoom(), n.off("pan").off("zoom").on("pan", function (t) {
                    Py(a, t.dx, t.dy), i.dispatchAction({seriesId: e.id, type: "graphRoam", dx: t.dx, dy: t.dy})
                }).on("zoom", function (t) {
                    My(a, t.scale, t.originX, t.originY), i.dispatchAction({
                        seriesId: e.id,
                        type: "graphRoam",
                        zoom: t.scale,
                        originX: t.originX,
                        originY: t.originY
                    }), this._updateNodeAndLinkScale(), sw(e.getGraph(), ZT(e)), this._lineDraw.updateLayout()
                }, this)) : n.disable()
            }, _updateNodeAndLinkScale: function () {
                var e = this._model, t = e.getData(), i = ZT(e), n = [i, i];
                t.eachItemGraphicEl(function (e, t) {
                    e.attr("scale", n)
                })
            }, updateLayout: function (e) {
                sw(e.getGraph(), ZT(e)), this._symbolDraw.updateLayout(), this._lineDraw.updateLayout()
            }, remove: function (e, t) {
                this._symbolDraw && this._symbolDraw.remove(), this._lineDraw && this._lineDraw.remove()
            }
        }), ff({
            type: "focusNodeAdjacency",
            event: "focusNodeAdjacency",
            update: "series:focusNodeAdjacency"
        }, function () {
        }), ff({
            type: "unfocusNodeAdjacency",
            event: "unfocusNodeAdjacency",
            update: "series:unfocusNodeAdjacency"
        }, function () {
        }), ff({type: "graphRoam", event: "graphRoam", update: "none"}, function (e, t) {
            t.eachComponent({mainType: "series", query: e}, function (t) {
                var i = Hy(t.coordinateSystem, e);
                t.setCenter && t.setCenter(i.center), t.setZoom && t.setZoom(i.zoom)
            })
        });
        var yw = Math.PI, kw = [];

        function Tw(e, t) {
            var i = e.coordinateSystem;
            if (!i || "view" === i.type) {
                var n = i.getBoundingRect(), a = e.getData(), o = a.graph, r = n.width / 2 + n.x,
                    s = n.height / 2 + n.y, l = Math.min(n.width, n.height) / 2, d = a.count();
                a.setLayout({cx: r, cy: s}), d && (ww[t](e, i, o, a, l, r, s, d), o.eachEdge(function (e) {
                    var t, i = e.getModel().get("lineStyle.curveness") || 0, n = re(e.node1.getLayout()),
                        a = re(e.node2.getLayout()), o = (n[0] + a[0]) / 2, l = (n[1] + a[1]) / 2;
                    +i && (t = [r * (i *= 3) + o * (1 - i), s * i + l * (1 - i)]), e.setLayout([n, a, t])
                }))
            }
        }

        var ww = {
            value: function (e, t, i, n, a, o, r, s) {
                var l = 0, d = n.getSum("value"), u = 2 * Math.PI / (d || s);
                i.eachNode(function (e) {
                    var t = e.getValue("value"), i = u * (d ? t : 1) / 2;
                    l += i, e.setLayout([a * Math.cos(l) + o, a * Math.sin(l) + r]), l += i
                })
            }, symbolSize: function (e, t, i, n, a, o, r, s) {
                var l = 0;
                kw.length = s;
                var d = ZT(e);
                i.eachNode(function (e) {
                    var t = QT(e);
                    isNaN(t) && (t = 2), t < 0 && (t = 0), t *= d;
                    var i = Math.asin(t / 2 / a);
                    isNaN(i) && (i = yw / 2), kw[e.dataIndex] = i, l += 2 * i
                });
                var u = (2 * yw - l) / s / 2, c = 0;
                i.eachNode(function (e) {
                    var t = u + kw[e.dataIndex];
                    c += t, e.setLayout([a * Math.cos(c) + o, a * Math.sin(c) + r]), c += t
                })
            }
        }, Cw = de;
        hf(function (e) {
            var t = e.findComponents({mainType: "legend"});
            t && t.length && e.eachSeriesByType("graph", function (e) {
                var i = e.getCategoriesData(), n = e.getGraph().data, a = i.mapArray(i.getName);
                n.filterSelf(function (e) {
                    var i = n.getItemModel(e).getShallow("category");
                    if (null != i) {
                        "number" == typeof i && (i = a[i]);
                        for (var o = 0; o < t.length; o++) if (!t[o].isSelected(i)) return !1
                    }
                    return !0
                })
            }, this)
        }), vf(mv("graph", "circle", null)), vf(function (e) {
            var t = {};
            e.eachSeriesByType("graph", function (e) {
                var i = e.getCategoriesData(), n = e.getData(), a = {};
                i.each(function (n) {
                    var o = i.getName(n);
                    a["ec-" + o] = n;
                    var r = i.getItemModel(n), s = r.get("itemStyle.color") || e.getColorFromPalette(o, t);
                    i.setItemVisual(n, "color", s);
                    for (var l = ["opacity", "symbol", "symbolSize", "symbolKeepAspect"], d = 0; d < l.length; d++) {
                        var u = r.getShallow(l[d], !0);
                        null != u && i.setItemVisual(n, l[d], u)
                    }
                }), i.count() && n.each(function (e) {
                    var t = n.getItemModel(e).getShallow("category");
                    if (null != t) {
                        "string" == typeof t && (t = a["ec-" + t]);
                        for (var o = ["color", "opacity", "symbol", "symbolSize", "symbolKeepAspect"], r = 0; r < o.length; r++) null == n.getItemVisual(e, o[r], !0) && n.setItemVisual(e, o[r], i.getItemVisual(t, o[r]))
                    }
                })
            })
        }), vf(function (e) {
            e.eachSeriesByType("graph", function (e) {
                var t = e.getGraph(), i = e.getEdgeData(), n = pw(e.get("edgeSymbol")), a = pw(e.get("edgeSymbolSize")),
                    o = "lineStyle.color".split("."), r = "lineStyle.opacity".split(".");
                i.setVisual("fromSymbol", n && n[0]), i.setVisual("toSymbol", n && n[1]), i.setVisual("fromSymbolSize", a && a[0]), i.setVisual("toSymbolSize", a && a[1]), i.setVisual("color", e.get(o)), i.setVisual("opacity", e.get(r)), i.each(function (e) {
                    var n = i.getItemModel(e), a = t.getEdgeByIndex(e), s = pw(n.getShallow("symbol", !0)),
                        l = pw(n.getShallow("symbolSize", !0)), d = n.get(o), u = n.get(r);
                    switch (d) {
                        case"source":
                            d = a.node1.getVisual("color");
                            break;
                        case"target":
                            d = a.node2.getVisual("color")
                    }
                    s[0] && a.setVisual("fromSymbol", s[0]), s[1] && a.setVisual("toSymbol", s[1]), l[0] && a.setVisual("fromSymbolSize", l[0]), l[1] && a.setVisual("toSymbolSize", l[1]), a.setVisual("color", d), a.setVisual("opacity", u)
                })
            })
        }), pf(function (e, t) {
            e.eachSeriesByType("graph", function (e) {
                var t = e.get("layout"), i = e.coordinateSystem;
                if (i && "view" !== i.type) {
                    var n = e.getData(), a = [];
                    A(i.dimensions, function (e) {
                        a = a.concat(n.mapDimension(e, !0))
                    });
                    for (var o = 0; o < n.count(); o++) {
                        for (var r = [], s = !1, l = 0; l < a.length; l++) {
                            var d = n.get(a[l], o);
                            isNaN(d) || (s = !0), r.push(d)
                        }
                        s ? n.setItemLayout(o, i.dataToPoint(r)) : n.setItemLayout(o, [NaN, NaN])
                    }
                    mw(n.graph)
                } else t && "none" !== t || vw(e)
            })
        }), pf(Sh.VISUAL.POST_CHART_LAYOUT, function (e) {
            e.eachSeriesByType("graph", function (e) {
                "circular" === e.get("layout") && Tw(e, "symbolSize")
            })
        }), pf(function (e) {
            e.eachSeriesByType("graph", function (e) {
                if (!(c = e.coordinateSystem) || "view" === c.type) if ("force" === e.get("layout")) {
                    var t = e.preservedPoints || {}, i = e.getGraph(), n = i.data, a = i.edgeData,
                        o = e.getModel("force"), r = o.get("initLayout");
                    e.preservedPoints ? n.each(function (e) {
                        var i = n.getId(e);
                        n.setItemLayout(e, t[i] || [NaN, NaN])
                    }) : r && "none" !== r ? "circular" === r && Tw(e, "value") : vw(e);
                    var s = n.getDataExtent("value"), l = a.getDataExtent("value"), d = o.get("repulsion"),
                        u = o.get("edgeLength");
                    O(d) || (d = [d, d]), O(u) || (u = [u, u]), u = [u[1], u[0]];
                    var c, h = n.mapArray("value", function (e, t) {
                        var i = n.getItemLayout(t), a = xl(e, s, d);
                        return isNaN(a) && (a = (d[0] + d[1]) / 2), {
                            w: a,
                            rep: a,
                            fixed: n.getItemModel(t).get("fixed"),
                            p: !i || isNaN(i[0]) || isNaN(i[1]) ? null : i
                        }
                    }), f = a.mapArray("value", function (e, t) {
                        var n = i.getEdgeByIndex(t), a = xl(e, l, u);
                        isNaN(a) && (a = (u[0] + u[1]) / 2);
                        var o = n.getModel();
                        return {
                            n1: h[n.node1.dataIndex],
                            n2: h[n.node2.dataIndex],
                            d: a,
                            curveness: o.get("lineStyle.curveness") || 0,
                            ignoreForceLayout: o.get("ignoreForceLayout")
                        }
                    }), g = (c = e.coordinateSystem).getBoundingRect(), p = function (e, t, i) {
                        for (var n = i.rect, a = n.width, o = n.height, r = [n.x + a / 2, n.y + o / 2], s = null == i.gravity ? .1 : i.gravity, l = 0; l < e.length; l++) {
                            var d = e[l];
                            d.p || (d.p = ae(a * (Math.random() - .5) + r[0], o * (Math.random() - .5) + r[1])), d.pp = re(d.p), d.edges = null
                        }
                        var u = null == i.friction ? .6 : i.friction, c = u;
                        return {
                            warmUp: function () {
                                c = .8 * u
                            }, setFixed: function (t) {
                                e[t].fixed = !0
                            }, setUnfixed: function (t) {
                                e[t].fixed = !1
                            }, step: function (i) {
                                for (var n = [], a = e.length, o = 0; o < t.length; o++) {
                                    var l = t[o];
                                    if (!l.ignoreForceLayout) {
                                        var d = l.n1;
                                        ue(n, (g = l.n2).p, d.p);
                                        var u = ce(n) - l.d, h = g.w / (d.w + g.w);
                                        isNaN(h) && (h = 0), ve(n, n), d.fixed || Cw(d.p, d.p, n, h * u * c), g.fixed || Cw(g.p, g.p, n, -(1 - h) * u * c)
                                    }
                                }
                                for (o = 0; o < a; o++) (m = e[o]).fixed || (ue(n, r, m.p), Cw(m.p, m.p, n, s * c));
                                for (o = 0; o < a; o++) {
                                    d = e[o];
                                    for (var f = o + 1; f < a; f++) {
                                        var g;
                                        ue(n, (g = e[f]).p, d.p), 0 === (u = ce(n)) && (se(n, Math.random() - .5, Math.random() - .5), u = 1);
                                        var p = (d.rep + g.rep) / u / u;
                                        d.fixed || Cw(d.pp, d.pp, n, p), g.fixed || Cw(g.pp, g.pp, n, -p)
                                    }
                                }
                                var v = [];
                                for (o = 0; o < a; o++) {
                                    var m;
                                    (m = e[o]).fixed || (ue(v, m.p, m.pp), Cw(m.p, m.p, v, c), oe(m.pp, m.p))
                                }
                                c *= .992, i && i(e, t, c < .01)
                            }
                        }
                    }(h, f, {rect: g, gravity: o.get("gravity"), friction: o.get("friction")}), v = p.step;
                    p.step = function (e) {
                        for (var a = 0, o = h.length; a < o; a++) h[a].fixed && oe(h[a].p, i.getNodeByIndex(a).getLayout());
                        v(function (a, o, r) {
                            for (var s = 0, l = a.length; s < l; s++) a[s].fixed || i.getNodeByIndex(s).setLayout(a[s].p), t[n.getId(s)] = a[s].p;
                            for (s = 0, l = o.length; s < l; s++) {
                                var d = o[s], u = i.getEdgeByIndex(s), c = d.n1.p, h = d.n2.p, f = u.getLayout();
                                (f = f ? f.slice() : [])[0] = f[0] || [], f[1] = f[1] || [], oe(f[0], c), oe(f[1], h), +d.curveness && (f[2] = [(c[0] + h[0]) / 2 - (c[1] - h[1]) * d.curveness, (c[1] + h[1]) / 2 - (h[0] - c[0]) * d.curveness]), u.setLayout(f)
                            }
                            e && e(r)
                        })
                    }, e.forceLayout = p, e.preservedPoints = t, p.step()
                } else e.forceLayout = null
            })
        }), gf("graphView", {
            create: function (e, t) {
                var i = [];
                return e.eachSeriesByType("graph", function (e) {
                    var n = e.get("coordinateSystem");
                    if (!n || "view" === n) {
                        var a = e.getData(), o = [], r = [];
                        Lo(a.mapArray(function (e) {
                            var t = a.getItemModel(e);
                            return [+t.get("x"), +t.get("y")]
                        }), o, r), r[0] - o[0] == 0 && (r[0] += 1, o[0] -= 1), r[1] - o[1] == 0 && (r[1] += 1, o[1] -= 1);
                        var s = (r[0] - o[0]) / (r[1] - o[1]), l = function (e, t, i) {
                            var n = e.getBoxLayoutParams();
                            return n.aspect = i, vd(n, {width: t.getWidth(), height: t.getHeight()})
                        }(e, t, s);
                        isNaN(s) && (o = [l.x, l.y], r = [l.x + l.width, l.y + l.height]);
                        var d = r[0] - o[0], u = r[1] - o[1], c = l.width, h = l.height,
                            f = e.coordinateSystem = new Gy;
                        f.zoomLimit = e.get("scaleLimit"), f.setBoundingRect(o[0], o[1], d, u), f.setViewRect(l.x, l.y, c, h), f.setCenter(e.get("center")), f.setZoom(e.get("zoom")), i.push(f)
                    }
                }), i
            }
        }), ec.extend({
            type: "series.gauge",
            getInitialData: function (e, t) {
                return Mm(this, ["value"])
            },
            defaultOption: {
                zlevel: 0,
                z: 2,
                center: ["50%", "50%"],
                legendHoverLink: !0,
                radius: "75%",
                startAngle: 225,
                endAngle: -45,
                clockwise: !0,
                min: 0,
                max: 100,
                splitNumber: 10,
                axisLine: {show: !0, lineStyle: {color: [[.2, "#91c7ae"], [.8, "#63869e"], [1, "#c23531"]], width: 30}},
                splitLine: {show: !0, length: 30, lineStyle: {color: "#eee", width: 2, type: "solid"}},
                axisTick: {show: !0, splitNumber: 5, length: 8, lineStyle: {color: "#eee", width: 1, type: "solid"}},
                axisLabel: {show: !0, distance: 5, color: "auto"},
                pointer: {show: !0, length: "80%", width: 8},
                itemStyle: {color: "auto"},
                title: {show: !0, offsetCenter: [0, "-40%"], color: "#333", fontSize: 15},
                detail: {
                    show: !0,
                    backgroundColor: "rgba(0,0,0,0)",
                    borderWidth: 0,
                    borderColor: "#ccc",
                    width: 100,
                    height: null,
                    padding: [5, 10],
                    offsetCenter: [0, "40%"],
                    color: "auto",
                    fontSize: 30
                }
            }
        });
        var Sw = wr.extend({
            type: "echartsGaugePointer",
            shape: {angle: 0, width: 10, r: 10, x: 0, y: 0},
            buildPath: function (e, t) {
                var i = Math.cos, n = Math.sin, a = t.r, o = t.width, r = t.angle,
                    s = t.x - i(r) * o * (a / 3 <= o ? 1 : 2), l = t.y - n(r) * o * (a / 3 <= o ? 1 : 2);
                r = t.angle - Math.PI / 2, e.moveTo(s, l), e.lineTo(t.x + i(r) * o, t.y + n(r) * o), e.lineTo(t.x + i(t.angle) * a, t.y + n(t.angle) * a), e.lineTo(t.x - i(r) * o, t.y - n(r) * o), e.lineTo(s, l)
            }
        });

        function bw(e, t) {
            return t && ("string" == typeof t ? e = t.replace("{value}", null != e ? e : "") : "function" == typeof t && (e = t(e))), e
        }

        var Iw = 2 * Math.PI, _w = (fc.extend({
            type: "gauge", render: function (e, t, i) {
                this.group.removeAll();
                var n = e.get("axisLine.lineStyle.color"), a = function (e, t) {
                    var i = e.get("center"), n = t.getWidth(), a = t.getHeight(), o = Math.min(n, a);
                    return {cx: Nl(i[0], t.getWidth()), cy: Nl(i[1], t.getHeight()), r: Nl(e.get("radius"), o / 2)}
                }(e, i);
                this._renderMain(e, t, i, n, a)
            }, dispose: function () {
            }, _renderMain: function (e, t, i, n, a) {
                for (var o = this.group, r = e.getModel("axisLine"), s = r.getModel("lineStyle"), l = e.get("clockwise"), d = -e.get("startAngle") / 180 * Math.PI, u = ((p = -e.get("endAngle") / 180 * Math.PI) - d) % Iw, c = d, h = s.get("width"), f = r.get("show"), g = 0; f && g < n.length; g++) {
                    var p, v = Math.min(Math.max(n[g][0], 0), 1), m = new Hr({
                        shape: {
                            startAngle: c,
                            endAngle: p = d + u * v,
                            cx: a.cx,
                            cy: a.cy,
                            clockwise: l,
                            r0: a.r - h,
                            r: a.r
                        }, silent: !0
                    });
                    m.setStyle({fill: n[g][1]}), m.setStyle(s.getLineStyle(["color", "borderWidth", "borderColor"])), o.add(m), c = p
                }

                function y(e) {
                    if (e <= 0) return n[0][1];
                    for (var t = 0; t < n.length; t++) if (n[t][0] >= e && (0 === t ? 0 : n[t - 1][0]) < e) return n[t][1];
                    return n[t - 1][1]
                }

                if (!l) {
                    var k = d;
                    d = p, p = k
                }
                this._renderTicks(e, t, i, y, a, d, p, l), this._renderPointer(e, t, i, y, a, d, p, l), this._renderTitle(e, t, i, y, a), this._renderDetail(e, t, i, y, a)
            }, _renderTicks: function (e, t, i, n, a, o, r, s) {
                for (var l = this.group, d = a.cx, u = a.cy, c = a.r, h = +e.get("min"), f = +e.get("max"), g = e.getModel("splitLine"), p = e.getModel("axisTick"), v = e.getModel("axisLabel"), m = e.get("splitNumber"), y = p.get("splitNumber"), k = Nl(g.get("length"), c), T = Nl(p.get("length"), c), w = o, C = (r - o) / m, S = C / y, b = g.getModel("lineStyle").getLineStyle(), I = p.getModel("lineStyle").getLineStyle(), _ = 0; _ <= m; _++) {
                    var A = Math.cos(w), D = Math.sin(w);
                    if (g.get("show")) {
                        var x = new is({
                            shape: {x1: A * c + d, y1: D * c + u, x2: A * (c - k) + d, y2: D * (c - k) + u},
                            style: b,
                            silent: !0
                        });
                        "auto" === b.stroke && x.setStyle({stroke: n(_ / m)}), l.add(x)
                    }
                    if (v.get("show")) {
                        var N = bw(El(_ / m * (f - h) + h), v.get("formatter")), E = v.get("distance"), P = n(_ / m);
                        l.add(new Rr({
                            style: Js({}, v, {
                                text: N,
                                x: A * (c - k - E) + d,
                                y: D * (c - k - E) + u,
                                textVerticalAlign: D < -.4 ? "top" : .4 < D ? "bottom" : "middle",
                                textAlign: A < -.4 ? "left" : .4 < A ? "right" : "center"
                            }, {autoColor: P}), silent: !0
                        }))
                    }
                    if (p.get("show") && _ !== m) {
                        for (var M = 0; M <= y; M++) {
                            A = Math.cos(w), D = Math.sin(w);
                            var O = new is({
                                shape: {
                                    x1: A * c + d,
                                    y1: D * c + u,
                                    x2: A * (c - T) + d,
                                    y2: D * (c - T) + u
                                }, silent: !0, style: I
                            });
                            "auto" === I.stroke && O.setStyle({stroke: n((_ + M / y) / m)}), l.add(O), w += S
                        }
                        w -= S
                    } else w += C
                }
            }, _renderPointer: function (e, t, i, n, a, o, r, s) {
                var l = this.group, d = this._data;
                if (e.get("pointer.show")) {
                    var u = [+e.get("min"), +e.get("max")], c = [o, r], h = e.getData(), f = h.mapDimension("value");
                    h.diff(d).add(function (t) {
                        var i = new Sw({shape: {angle: o}});
                        rl(i, {shape: {angle: xl(h.get(f, t), u, c, !0)}}, e), l.add(i), h.setItemGraphicEl(t, i)
                    }).update(function (t, i) {
                        var n = d.getItemGraphicEl(i);
                        ol(n, {shape: {angle: xl(h.get(f, t), u, c, !0)}}, e), l.add(n), h.setItemGraphicEl(t, n)
                    }).remove(function (e) {
                        var t = d.getItemGraphicEl(e);
                        l.remove(t)
                    }).execute(), h.eachItemGraphicEl(function (e, t) {
                        var i = h.getItemModel(t), o = i.getModel("pointer");
                        e.setShape({
                            x: a.cx,
                            y: a.cy,
                            width: Nl(o.get("width"), a.r),
                            r: Nl(o.get("length"), a.r)
                        }), e.useStyle(i.getModel("itemStyle").getItemStyle()), "auto" === e.style.fill && e.setStyle("fill", n(xl(h.get(f, t), u, [0, 1], !0))), js(e, i.getModel("emphasis.itemStyle").getItemStyle())
                    }), this._data = h
                } else d && d.eachItemGraphicEl(function (e) {
                    l.remove(e)
                })
            }, _renderTitle: function (e, t, i, n, a) {
                var o = e.getData(), r = o.mapDimension("value"), s = e.getModel("title");
                if (s.get("show")) {
                    var l = s.get("offsetCenter"), d = a.cx + Nl(l[0], a.r), u = a.cy + Nl(l[1], a.r),
                        c = +e.get("min"), h = +e.get("max"), f = n(xl(e.getData().get(r, 0), [c, h], [0, 1], !0));
                    this.group.add(new Rr({
                        silent: !0,
                        style: Js({}, s, {
                            x: d,
                            y: u,
                            text: o.getName(0),
                            textAlign: "center",
                            textVerticalAlign: "middle"
                        }, {autoColor: f, forceRich: !0})
                    }))
                }
            }, _renderDetail: function (e, t, i, n, a) {
                var o = e.getModel("detail"), r = +e.get("min"), s = +e.get("max");
                if (o.get("show")) {
                    var l = o.get("offsetCenter"), d = a.cx + Nl(l[0], a.r), u = a.cy + Nl(l[1], a.r),
                        c = Nl(o.get("width"), a.r), h = Nl(o.get("height"), a.r), f = e.getData(),
                        g = f.get(f.mapDimension("value"), 0), p = n(xl(g, [r, s], [0, 1], !0));
                    this.group.add(new Rr({
                        silent: !0,
                        style: Js({}, o, {
                            x: d,
                            y: u,
                            text: bw(g, o.get("formatter")),
                            textWidth: isNaN(c) ? null : c,
                            textHeight: isNaN(h) ? null : h,
                            textAlign: "center",
                            textVerticalAlign: "middle"
                        }, {autoColor: p, forceRich: !0})
                    }))
                }
            }
        }), wf({
            type: "series.funnel",
            init: function (e) {
                _w.superApply(this, "init", arguments), this.legendVisualProvider = new Fm(P(this.getData, this), P(this.getRawData, this)), this._defaultLabelLine(e)
            },
            getInitialData: function (e, t) {
                return Mm(this, {coordDimensions: ["value"], encodeDefaulter: M(Gd, this)})
            },
            _defaultLabelLine: function (e) {
                Ma(e, "labelLine", ["show"]);
                var t = e.labelLine, i = e.emphasis.labelLine;
                t.show = t.show && e.label.show, i.show = i.show && e.emphasis.label.show
            },
            getDataParams: function (e) {
                var t = this.getData(), i = _w.superCall(this, "getDataParams", e), n = t.mapDimension("value"),
                    a = t.getSum(n);
                return i.percent = a ? +(t.get(n, e) / a * 100).toFixed(2) : 0, i.$vars.push("percent"), i
            },
            defaultOption: {
                zlevel: 0,
                z: 2,
                legendHoverLink: !0,
                left: 80,
                top: 60,
                right: 80,
                bottom: 60,
                minSize: "0%",
                maxSize: "100%",
                sort: "descending",
                gap: 0,
                funnelAlign: "center",
                label: {show: !0, position: "outer"},
                labelLine: {show: !0, length: 20, lineStyle: {width: 1, type: "solid"}},
                itemStyle: {borderColor: "#fff", borderWidth: 1},
                emphasis: {label: {show: !0}}
            }
        }));

        function Aw(e, t) {
            Di.call(this);
            var i = new $r, n = new Xr, a = new Rr;
            this.add(i), this.add(n), this.add(a), this.highDownOnUpdate = function (e, t) {
                "emphasis" === t ? (n.ignore = n.hoverIgnore, a.ignore = a.hoverIgnore) : (n.ignore = n.normalIgnore, a.ignore = a.normalIgnore)
            }, this.updateData(e, t, !0)
        }

        var Dw = Aw.prototype, xw = ["itemStyle", "opacity"];

        function Nw(e, t, i, n, a) {
            Dp.call(this, e, t, i), this.type = n || "value", this.axisIndex = a
        }

        function Ew(e, t, i, n, a, o) {
            e = e || 0;
            var r = i[1] - i[0];
            if (null != a && (a = Mw(a, [0, r])), null != o && (o = Math.max(o, null != a ? a : 0)), "all" === n) {
                var s = Math.abs(t[1] - t[0]);
                a = o = Mw(s = Mw(s, [0, r]), [a, o]), n = 0
            }
            t[0] = Mw(t[0], i), t[1] = Mw(t[1], i);
            var l = Pw(t, n);
            t[n] += e;
            var d = a || 0, u = i.slice();
            l.sign < 0 ? u[0] += d : u[1] -= d, t[n] = Mw(t[n], u);
            var c = Pw(t, n);
            return null != a && (c.sign !== l.sign || c.span < a) && (t[1 - n] = t[n] + l.sign * a), c = Pw(t, n), null != o && c.span > o && (t[1 - n] = t[n] + c.sign * o), t
        }

        function Pw(e, t) {
            var i = e[t] - e[1 - t];
            return {span: Math.abs(i), sign: 0 < i ? -1 : i < 0 ? 1 : t ? -1 : 1}
        }

        function Mw(e, t) {
            return Math.min(null != t[1] ? t[1] : 1 / 0, Math.max(null != t[0] ? t[0] : -1 / 0, e))
        }

        Dw.updateData = function (e, t, i) {
            var n = this.childAt(0), a = e.hostModel, o = e.getItemModel(t), r = e.getItemLayout(t),
                s = e.getItemModel(t).get(xw);
            s = null == s ? 1 : s, n.useStyle({}), i ? (n.setShape({points: r.points}), n.setStyle({opacity: 0}), rl(n, {style: {opacity: s}}, a, t)) : ol(n, {
                style: {opacity: s},
                shape: {points: r.points}
            }, a, t);
            var l = o.getModel("itemStyle"), d = e.getItemVisual(t, "color");
            n.setStyle(T({
                lineJoin: "round",
                fill: d
            }, l.getItemStyle(["opacity"]))), n.hoverStyle = l.getModel("emphasis").getItemStyle(), this._updateLabel(e, t), js(this)
        }, Dw._updateLabel = function (e, t) {
            var i = this.childAt(1), n = this.childAt(2), a = e.hostModel, o = e.getItemModel(t),
                r = e.getItemLayout(t).label, s = e.getItemVisual(t, "color");
            ol(i, {shape: {points: r.linePoints || r.linePoints}}, a, t), ol(n, {
                style: {
                    x: r.x,
                    y: r.y
                }
            }, a, t), n.attr({rotation: r.rotation, origin: [r.x, r.y], z2: 10});
            var l = o.getModel("label"), d = o.getModel("emphasis.label"), u = o.getModel("labelLine"),
                c = o.getModel("emphasis.labelLine");
            s = e.getItemVisual(t, "color"), qs(n.style, n.hoverStyle = {}, l, d, {
                labelFetcher: e.hostModel,
                labelDataIndex: t,
                defaultText: e.getName(t),
                autoColor: s,
                useInsideStyle: !!r.inside
            }, {
                textAlign: r.textAlign,
                textVerticalAlign: r.verticalAlign
            }), n.ignore = n.normalIgnore = !l.get("show"), n.hoverIgnore = !d.get("show"), i.ignore = i.normalIgnore = !u.get("show"), i.hoverIgnore = !c.get("show"), i.setStyle({stroke: s}), i.setStyle(u.getModel("lineStyle").getLineStyle()), i.hoverStyle = c.getModel("lineStyle").getLineStyle()
        }, b(Aw, Di), fc.extend({
            type: "funnel", render: function (e, t, i) {
                var n = e.getData(), a = this._data, o = this.group;
                n.diff(a).add(function (e) {
                    var t = new Aw(n, e);
                    n.setItemGraphicEl(e, t), o.add(t)
                }).update(function (e, t) {
                    var i = a.getItemGraphicEl(t);
                    i.updateData(n, e), o.add(i), n.setItemGraphicEl(e, i)
                }).remove(function (e) {
                    var t = a.getItemGraphicEl(e);
                    o.remove(t)
                }).execute(), this._data = n
            }, remove: function () {
                this.group.removeAll(), this._data = null
            }, dispose: function () {
            }
        }), vf(Vm("funnel")), pf(function (e, t, i) {
            e.eachSeriesByType("funnel", function (e) {
                var i = e.getData(), n = i.mapDimension("value"), a = e.get("sort"), o = function (e, t) {
                        return vd(e.getBoxLayoutParams(), {width: t.getWidth(), height: t.getHeight()})
                    }(e, t), r = function (e, t) {
                        for (var i = e.mapDimension("value"), n = e.mapArray(i, function (e) {
                            return e
                        }), a = [], o = "ascending" === t, r = 0, s = e.count(); r < s; r++) a[r] = r;
                        return "function" == typeof t ? a.sort(t) : "none" !== t && a.sort(function (e, t) {
                            return o ? n[e] - n[t] : n[t] - n[e]
                        }), a
                    }(i, a), s = [Nl(e.get("minSize"), o.width), Nl(e.get("maxSize"), o.width)], l = i.getDataExtent(n),
                    d = e.get("min"), u = e.get("max");

                function c(e, t) {
                    var a, r = xl(i.get(n, e) || 0, [d, u], s, !0);
                    switch (h) {
                        case"left":
                            a = o.x;
                            break;
                        case"center":
                            a = o.x + (o.width - r) / 2;
                            break;
                        case"right":
                            a = o.x + o.width - r
                    }
                    return [[a, t], [a + r, t]]
                }

                null == d && (d = Math.min(l[0], 0)), null == u && (u = l[1]);
                var h = e.get("funnelAlign"), f = e.get("gap"), g = (o.height - f * (i.count() - 1)) / i.count(),
                    p = o.y;
                "ascending" === a && (g = -g, f = -f, p += o.height, r = r.reverse());
                for (var v = 0; v < r.length; v++) {
                    var m = r[v], y = r[v + 1], k = i.getItemModel(m).get("itemStyle.height");
                    null == k ? k = g : (k = Nl(k, o.height), "ascending" === a && (k = -k));
                    var T = c(m, p), w = c(y, p + k);
                    p += k + f, i.setItemLayout(m, {points: T.concat(w.slice().reverse())})
                }
                !function (e) {
                    e.each(function (t) {
                        var i, n, a, o, r = e.getItemModel(t), s = r.getModel("label").get("position"),
                            l = r.getModel("labelLine"), d = e.getItemLayout(t), u = d.points,
                            c = "inner" === s || "inside" === s || "center" === s || "insideLeft" === s || "insideRight" === s;
                        if (c) i = "insideLeft" === s ? (n = (u[0][0] + u[3][0]) / 2 + 5, a = (u[0][1] + u[3][1]) / 2, "left") : "insideRight" === s ? (n = (u[1][0] + u[2][0]) / 2 - 5, a = (u[1][1] + u[2][1]) / 2, "right") : (n = (u[0][0] + u[1][0] + u[2][0] + u[3][0]) / 4, a = (u[0][1] + u[1][1] + u[2][1] + u[3][1]) / 4, "center"), o = [[n, a], [n, a]]; else {
                            var h, f, g, p = l.get("length");
                            i = "left" === s ? (h = (u[3][0] + u[0][0]) / 2, f = (u[3][1] + u[0][1]) / 2, n = (g = h - p) - 5, "right") : "right" === s ? (h = (u[1][0] + u[2][0]) / 2, f = (u[1][1] + u[2][1]) / 2, n = (g = h + p) + 5, "left") : "rightTop" === s ? (h = u[1][0], f = u[1][1], n = (g = h + p) + 5, "top") : "rightBottom" === s ? (h = u[2][0], f = u[2][1], n = (g = h + p) + 5, "bottom") : "leftTop" === s ? (h = u[0][0], f = u[1][1], n = (g = h - p) - 5, "right") : "leftBottom" === s ? (h = u[3][0], f = u[2][1], n = (g = h - p) - 5, "right") : (h = (u[1][0] + u[2][0]) / 2, f = (u[1][1] + u[2][1]) / 2, n = (g = h + p) + 5, "left"), o = [[h, f], [g, f]], a = f
                        }
                        d.label = {linePoints: o, x: n, y: a, verticalAlign: "middle", textAlign: i, inside: c}
                    })
                }(i)
            })
        }), hf(Xm("funnel")), Nw.prototype = {
            constructor: Nw, model: null, isHorizontal: function () {
                return "horizontal" !== this.coordinateSystem.getModel().get("layout")
            }
        }, b(Nw, Dp);
        var Ow = A, Fw = Math.min, Lw = Math.max, Bw = Math.floor, Uw = Math.ceil, Rw = El, Kw = Math.PI;

        function Ww(e, t, i) {
            this._axesMap = Q(), this._axesLayout = {}, this.dimensions = e.dimensions, this._rect, this._model = e, this._init(e, t, i)
        }

        function Vw(e, t) {
            return Fw(Lw(e, t[0]), t[1])
        }

        Ww.prototype = {
            type: "parallel", constructor: Ww, _init: function (e, t, i) {
                var n = e.dimensions, a = e.parallelAxisIndex;
                Ow(n, function (e, i) {
                    var n = a[i], o = t.getComponent("parallelAxis", n),
                        r = this._axesMap.set(e, new Nw(e, Jg(o), [0, 0], o.get("type"), n)), s = "category" === r.type;
                    r.onBand = s && o.get("boundaryGap"), r.inverse = o.get("inverse"), (o.axis = r).model = o, r.coordinateSystem = o.coordinateSystem = this
                }, this)
            }, update: function (e, t) {
                this._updateAxesFromSeries(this._model, e)
            }, containPoint: function (e) {
                var t = this._makeLayoutInfo(), i = t.axisBase, n = t.layoutBase, a = t.pixelDimIndex, o = e[1 - a],
                    r = e[a];
                return i <= o && o <= i + t.axisLength && n <= r && r <= n + t.layoutLength
            }, getModel: function () {
                return this._model
            }, _updateAxesFromSeries: function (e, t) {
                t.eachSeries(function (i) {
                    if (e.contains(i, t)) {
                        var n = i.getData();
                        Ow(this.dimensions, function (e) {
                            var t = this._axesMap.get(e);
                            t.scale.unionExtentFromData(n, n.mapDimension(e)), Yg(t.scale, t.model)
                        }, this)
                    }
                }, this)
            }, resize: function (e, t) {
                this._rect = vd(e.getBoxLayoutParams(), {
                    width: t.getWidth(),
                    height: t.getHeight()
                }), this._layoutAxes()
            }, getRect: function () {
                return this._rect
            }, _makeLayoutInfo: function () {
                var e, t = this._model, i = this._rect, n = ["x", "y"], a = ["width", "height"], o = t.get("layout"),
                    r = "horizontal" === o ? 0 : 1, s = i[a[r]], l = [0, s], d = this.dimensions.length,
                    u = Vw(t.get("axisExpandWidth"), l), c = Vw(t.get("axisExpandCount") || 0, [0, d]),
                    h = t.get("axisExpandable") && 3 < d && c < d && 1 < c && 0 < u && 0 < s,
                    f = t.get("axisExpandWindow");
                f ? (e = Vw(f[1] - f[0], l), f[1] = f[0] + e) : (e = Vw(u * (c - 1), l), (f = [u * (t.get("axisExpandCenter") || Bw(d / 2)) - e / 2])[1] = f[0] + e);
                var g = (s - e) / (d - c);
                g < 3 && (g = 0);
                var p = [Bw(Rw(f[0] / u, 1)) + 1, Uw(Rw(f[1] / u, 1)) - 1], v = g / u * f[0];
                return {
                    layout: o,
                    pixelDimIndex: r,
                    layoutBase: i[n[r]],
                    layoutLength: s,
                    axisBase: i[n[1 - r]],
                    axisLength: i[a[1 - r]],
                    axisExpandable: h,
                    axisExpandWidth: u,
                    axisCollapseWidth: g,
                    axisExpandWindow: f,
                    axisCount: d,
                    winInnerIndices: p,
                    axisExpandWindow0Pos: v
                }
            }, _layoutAxes: function () {
                var e = this._rect, t = this._axesMap, i = this.dimensions, n = this._makeLayoutInfo(), a = n.layout;
                t.each(function (e) {
                    var t = [0, n.axisLength], i = e.inverse ? 1 : 0;
                    e.setExtent(t[i], t[1 - i])
                }), Ow(i, function (t, i) {
                    var o = (n.axisExpandable ? function (e, t) {
                            var i, n, a = t.layoutLength, o = t.axisExpandWidth, r = t.axisCount, s = t.axisCollapseWidth,
                                l = t.winInnerIndices, d = s, u = !1;
                            return e < l[0] ? (i = e * s, n = s) : e <= l[1] ? (i = t.axisExpandWindow0Pos + e * o - t.axisExpandWindow[0], d = o, u = !0) : (i = a - (r - 1 - e) * s, n = s), {
                                position: i,
                                axisNameAvailableWidth: d,
                                axisLabelShow: u,
                                nameTruncateMaxWidth: n
                            }
                        } : function (e, t) {
                            var i = t.layoutLength / (t.axisCount - 1);
                            return {position: i * e, axisNameAvailableWidth: i, axisLabelShow: !0}
                        })(i, n), r = {horizontal: {x: o.position, y: n.axisLength}, vertical: {x: 0, y: o.position}},
                        s = {horizontal: Kw / 2, vertical: 0}, l = [r[a].x + e.x, r[a].y + e.y], d = s[a], u = ot();
                    ut(u, u, d), dt(u, u, l), this._axesLayout[t] = {
                        position: l,
                        rotation: d,
                        transform: u,
                        axisNameAvailableWidth: o.axisNameAvailableWidth,
                        axisLabelShow: o.axisLabelShow,
                        nameTruncateMaxWidth: o.nameTruncateMaxWidth,
                        tickDirection: 1,
                        labelDirection: 1
                    }
                }, this)
            }, getAxis: function (e) {
                return this._axesMap.get(e)
            }, dataToPoint: function (e, t) {
                return this.axisCoordToPoint(this._axesMap.get(t).dataToCoord(e), t)
            }, eachActiveState: function (e, t, i, n) {
                null == i && (i = 0), null == n && (n = e.count());
                var a = this._axesMap, o = this.dimensions, r = [], s = [];
                A(o, function (t) {
                    r.push(e.mapDimension(t)), s.push(a.get(t).model)
                });
                for (var l = this.hasAxisBrushed(), d = i; d < n; d++) {
                    var u;
                    if (l) {
                        u = "active";
                        for (var c = e.getValues(r, d), h = 0, f = o.length; h < f; h++) if ("inactive" === s[h].getActiveState(c[h])) {
                            u = "inactive";
                            break
                        }
                    } else u = "normal";
                    t(u, d)
                }
            }, hasAxisBrushed: function () {
                for (var e = this.dimensions, t = this._axesMap, i = !1, n = 0, a = e.length; n < a; n++) "normal" !== t.get(e[n]).model.getActiveState() && (i = !0);
                return i
            }, axisCoordToPoint: function (e, t) {
                return ll([e, 0], this._axesLayout[t].transform)
            }, getAxisLayout: function (e) {
                return v(this._axesLayout[e])
            }, getSlidedAxisExpandWindow: function (e) {
                var t = this._makeLayoutInfo(), i = t.pixelDimIndex, n = t.axisExpandWindow.slice(), a = n[1] - n[0],
                    o = [0, t.axisExpandWidth * (t.axisCount - 1)];
                if (!this.containPoint(e)) return {behavior: "none", axisExpandWindow: n};
                var r, s = e[i] - t.layoutBase - t.axisExpandWindow0Pos, l = "slide", d = t.axisCollapseWidth,
                    u = this._model.get("axisExpandSlideTriggerArea"), c = null != u[0];
                return d ? (c && d && s < a * u[0] ? (l = "jump", r = s - a * u[2]) : c && d && s > a * (1 - u[0]) ? (l = "jump", r = s - a * (1 - u[2])) : 0 <= (r = s - a * u[1]) && (r = s - a * (1 - u[1])) <= 0 && (r = 0), (r *= t.axisExpandWidth / d) ? Ew(r, n, o, "all") : l = "none") : (a = n[1] - n[0], (n = [Lw(0, o[1] * s / a - a / 2)])[1] = Fw(o[1], n[0] + a), n[0] = n[1] - a), {
                    axisExpandWindow: n,
                    behavior: l
                }
            }
        }, iu.register("parallel", {
            create: function (e, t) {
                var i = [];
                return e.eachComponent("parallel", function (n, a) {
                    var o = new Ww(n, e, t);
                    o.name = "parallel_" + a, o.resize(n, t), (n.coordinateSystem = o).model = n, i.push(o)
                }), e.eachSeries(function (t) {
                    if ("parallel" === t.get("coordinateSystem")) {
                        var i = e.queryComponents({
                            mainType: "parallel",
                            index: t.get("parallelIndex"),
                            id: t.get("parallelId")
                        })[0];
                        t.coordinateSystem = i.coordinateSystem
                    }
                }), i
            }
        });
        var Hw = Id.extend({
            type: "baseParallelAxis", axis: null, activeIntervals: [], getAreaSelectStyle: function () {
                return no([["fill", "color"], ["lineWidth", "borderWidth"], ["stroke", "borderColor"], ["width", "width"], ["opacity", "opacity"]])(this.getModel("areaSelectStyle"))
            }, setActiveIntervals: function (e) {
                var t = this.activeIntervals = v(e);
                if (t) for (var i = t.length - 1; 0 <= i; i--) Pl(t[i])
            }, getActiveState: function (e) {
                var t = this.activeIntervals;
                if (!t.length) return "normal";
                if (null == e || isNaN(e)) return "inactive";
                if (1 === t.length) {
                    var i = t[0];
                    if (i[0] <= e && e <= i[1]) return "active"
                } else for (var n = 0, a = t.length; n < a; n++) if (t[n][0] <= e && e <= t[n][1]) return "active";
                return "inactive"
            }
        });
        m(Hw.prototype, ip), Av("parallel", Hw, function (e, t) {
            return t.type || (t.data ? "category" : "value")
        }, {
            type: "value",
            dim: null,
            areaSelectStyle: {
                width: 20,
                borderWidth: 1,
                borderColor: "rgba(160,197,232)",
                color: "rgba(160,197,232)",
                opacity: .3
            },
            realtime: !0,
            z: 10
        }), Id.extend({
            type: "parallel",
            dependencies: ["parallelAxis"],
            coordinateSystem: null,
            dimensions: null,
            parallelAxisIndex: null,
            layoutMode: "box",
            defaultOption: {
                zlevel: 0,
                z: 0,
                left: 80,
                top: 60,
                right: 80,
                bottom: 60,
                layout: "horizontal",
                axisExpandable: !1,
                axisExpandCenter: null,
                axisExpandCount: 0,
                axisExpandWidth: 50,
                axisExpandRate: 17,
                axisExpandDebounce: 50,
                axisExpandSlideTriggerArea: [-.15, .05, .4],
                axisExpandTriggerOn: "click",
                parallelAxisDefault: null
            },
            init: function () {
                Id.prototype.init.apply(this, arguments), this.mergeOption({})
            },
            mergeOption: function (e) {
                var t = this.option;
                e && m(t, e, !0), this._initDimensions()
            },
            contains: function (e, t) {
                var i = e.get("parallelIndex");
                return null != i && t.getComponent("parallel", i) === this
            },
            setAxisExpand: function (e) {
                A(["axisExpandable", "axisExpandCenter", "axisExpandCount", "axisExpandWidth", "axisExpandWindow"], function (t) {
                    e.hasOwnProperty(t) && (this.option[t] = e[t])
                }, this)
            },
            _initDimensions: function () {
                var e = this.dimensions = [], t = this.parallelAxisIndex = [];
                A(N(this.dependentModels.parallelAxis, function (e) {
                    return (e.get("parallelIndex") || 0) === this.componentIndex
                }, this), function (i) {
                    e.push("dim" + i.get("dim")), t.push(i.componentIndex)
                })
            }
        }), ff({type: "axisAreaSelect", event: "axisAreaSelected"}, function (e, t) {
            t.eachComponent({mainType: "parallelAxis", query: e}, function (t) {
                t.axis.model.setActiveIntervals(e.intervals)
            })
        }), ff("parallelAxisExpand", function (e, t) {
            t.eachComponent({mainType: "parallel", query: e}, function (t) {
                t.setAxisExpand(e)
            })
        });
        var zw = M, jw = A, Gw = D, $w = Math.min, Xw = Math.max, qw = Math.pow, Yw = 1e4, Jw = 6, Zw = 6,
            Qw = "globalPan", eC = {w: [0, 0], e: [0, 1], n: [1, 0], s: [1, 1]},
            tC = {w: "ew", e: "ew", n: "ns", s: "ns", ne: "nesw", sw: "nesw", nw: "nwse", se: "nwse"}, iC = {
                brushStyle: {lineWidth: 2, stroke: "rgba(0,0,0,0.3)", fill: "rgba(0,0,0,0.1)"},
                transformable: !0,
                brushMode: "single",
                removeOnClick: !1
            }, nC = 0;

        function aC(e) {
            xe.call(this), this._zr = e, this.group = new Di, this._brushType, this._brushOption, this._panels, this._track = [], this._dragging, this._covers = [], this._creatingCover, this._creatingPanel, this._enableGlobalPan, this._uid = "brushController_" + nC++, this._handlers = {}, jw(NC, function (e, t) {
                this._handlers[t] = P(e, this)
            }, this)
        }

        function oC(e, t) {
            var i = PC[t.brushType].createCover(e, t);
            return i.__brushOption = t, lC(i, t), e.group.add(i), i
        }

        function rC(e, t) {
            var i = uC(t);
            return i.endCreating && (i.endCreating(e, t), lC(t, t.__brushOption)), t
        }

        function sC(e, t) {
            var i = t.__brushOption;
            uC(t).updateCoverShape(e, t, i.range, i)
        }

        function lC(e, t) {
            var i = t.z;
            null == i && (i = Yw), e.traverse(function (e) {
                e.z = i, e.z2 = i
            })
        }

        function dC(e, t) {
            uC(t).updateCommon(e, t), sC(e, t)
        }

        function uC(e) {
            return PC[e.__brushOption.brushType]
        }

        function cC(e, t, i) {
            var n, a = e._panels;
            if (!a) return !0;
            var o = e._transform;
            return jw(a, function (e) {
                e.isTargetByCursor(t, i, o) && (n = e)
            }), n
        }

        function hC(e, t) {
            var i = e._panels;
            if (!i) return !0;
            var n = t.__brushOption.panelId;
            return null == n || i[n]
        }

        function fC(e) {
            var t = e._covers, i = t.length;
            return jw(t, function (t) {
                e.group.remove(t)
            }, e), t.length = 0, !!i
        }

        function gC(e, t) {
            var i = Gw(e._covers, function (e) {
                var t = e.__brushOption, i = v(t.range);
                return {brushType: t.brushType, panelId: t.panelId, range: i}
            });
            e.trigger("brush", i, {isEnd: !!t.isEnd, removeOnClick: !!t.removeOnClick})
        }

        function pC(e) {
            var t = e.length - 1;
            return t < 0 && (t = 0), [e[0], e[t]]
        }

        function vC(e, t, i, n) {
            var a = new Di;
            return a.add(new es({
                name: "main",
                style: TC(i),
                silent: !0,
                draggable: !0,
                cursor: "move",
                drift: zw(e, t, a, "nswe"),
                ondragend: zw(gC, t, {isEnd: !0})
            })), jw(n, function (i) {
                a.add(new es({
                    name: i,
                    style: {opacity: 0},
                    draggable: !0,
                    silent: !0,
                    invisible: !0,
                    drift: zw(e, t, a, i),
                    ondragend: zw(gC, t, {isEnd: !0})
                }))
            }), a
        }

        function mC(e, t, i, n) {
            var a = n.brushStyle.lineWidth || 0, o = Xw(a, Zw), r = i[0][0], s = i[1][0], l = r - a / 2, d = s - a / 2,
                u = i[0][1], c = i[1][1], h = u - o + a / 2, f = c - o + a / 2, g = u - r, p = c - s, v = g + a,
                m = p + a;
            kC(e, t, "main", r, s, g, p), n.transformable && (kC(e, t, "w", l, d, o, m), kC(e, t, "e", h, d, o, m), kC(e, t, "n", l, d, v, o), kC(e, t, "s", l, f, v, o), kC(e, t, "nw", l, d, o, o), kC(e, t, "ne", h, d, o, o), kC(e, t, "sw", l, f, o, o), kC(e, t, "se", h, f, o, o))
        }

        function yC(e, t) {
            var i = t.__brushOption, n = i.transformable, a = t.childAt(0);
            a.useStyle(TC(i)), a.attr({
                silent: !n,
                cursor: n ? "move" : "default"
            }), jw(["w", "e", "n", "s", "se", "sw", "ne", "nw"], function (i) {
                var a = t.childOfName(i), o = function e(t, i) {
                    if (1 < i.length) {
                        i = i.split("");
                        var n = [e(t, i[0]), e(t, i[1])];
                        return "e" !== n[0] && "w" !== n[0] || n.reverse(), n.join("")
                    }
                    var n = dl({w: "left", e: "right", n: "top", s: "bottom"}[i], sl(t.group));
                    return {left: "w", right: "e", top: "n", bottom: "s"}[n]
                }(e, i);
                a && a.attr({silent: !n, invisible: !n, cursor: n ? tC[o] + "-resize" : null})
            })
        }

        function kC(e, t, i, n, a, o, r) {
            var s = t.childOfName(i);
            s && s.setShape(function (e) {
                var t = $w(e[0][0], e[1][0]), i = $w(e[0][1], e[1][1]), n = Xw(e[0][0], e[1][0]),
                    a = Xw(e[0][1], e[1][1]);
                return {x: t, y: i, width: n - t, height: a - i}
            }(IC(e, t, [[n, a], [n + o, a + r]])))
        }

        function TC(e) {
            return T({strokeNoScale: !0}, e.brushStyle)
        }

        function wC(e, t, i, n) {
            var a = [$w(e, i), $w(t, n)], o = [Xw(e, i), Xw(t, n)];
            return [[a[0], o[0]], [a[1], o[1]]]
        }

        function CC(e, t, i, n, a, o, r, s) {
            var l = n.__brushOption, d = e(l.range), u = bC(i, o, r);
            jw(a.split(""), function (e) {
                var t = eC[e];
                d[t[0]][t[1]] += u[t[0]]
            }), l.range = t(wC(d[0][0], d[1][0], d[0][1], d[1][1])), dC(i, n), gC(i, {isEnd: !1})
        }

        function SC(e, t, i, n, a) {
            var o = t.__brushOption.range, r = bC(e, i, n);
            jw(o, function (e) {
                e[0] += r[0], e[1] += r[1]
            }), dC(e, t), gC(e, {isEnd: !1})
        }

        function bC(e, t, i) {
            var n = e.group, a = n.transformCoordToLocal(t, i), o = n.transformCoordToLocal(0, 0);
            return [a[0] - o[0], a[1] - o[1]]
        }

        function IC(e, t, i) {
            var n = hC(e, t);
            return n && !0 !== n ? n.clipPath(i, e._transform) : v(i)
        }

        function _C(e) {
            var t = e.event;
            t.preventDefault && t.preventDefault()
        }

        function AC(e, t, i) {
            return e.childOfName("main").contain(t, i)
        }

        function DC(e, t, i, n) {
            var a, o = e._creatingCover, r = e._creatingPanel, s = e._brushOption;
            if (e._track.push(i.slice()), function (e) {
                var t = e._track;
                if (!t.length) return !1;
                var i = t[t.length - 1], n = t[0], a = i[0] - n[0], o = i[1] - n[1], r = qw(a * a + o * o, .5);
                return Jw < r
            }(e) || o) {
                if (r && !o) {
                    "single" === s.brushMode && fC(e);
                    var l = v(s);
                    l.brushType = xC(l.brushType, r), l.panelId = !0 === r ? null : r.panelId, o = e._creatingCover = oC(e, l), e._covers.push(o)
                }
                if (o) {
                    var d = PC[xC(e._brushType, r)];
                    o.__brushOption.range = d.getCreatingRange(IC(e, o, e._track)), n && (rC(e, o), d.updateCommon(e, o)), sC(e, o), a = {isEnd: n}
                }
            } else n && "single" === s.brushMode && s.removeOnClick && cC(e, t, i) && fC(e) && (a = {
                isEnd: n,
                removeOnClick: !0
            });
            return a
        }

        function xC(e, t) {
            return "auto" === e ? t.defaultBrushType : e
        }

        aC.prototype = {
            constructor: aC, enableBrush: function (e) {
                return this._brushType && function (e) {
                    var t = e._zr;
                    (function (e, t, i) {
                        var n = Cy(e);
                        n[t] === i && (n[t] = null)
                    })(t, Qw, e._uid), function (e, t) {
                        jw(t, function (t, i) {
                            e.off(i, t)
                        })
                    }(t, e._handlers), e._brushType = e._brushOption = null
                }(this), e.brushType && function (e, t) {
                    var i = e._zr;
                    e._enableGlobalPan || function (e, t, i) {
                        Cy(e).globalPan = i
                    }(i, 0, e._uid), function (e, t) {
                        jw(t, function (t, i) {
                            e.on(i, t)
                        })
                    }(i, e._handlers), e._brushType = t.brushType, e._brushOption = m(v(iC), t, !0)
                }(this, e), this
            }, setPanels: function (e) {
                if (e && e.length) {
                    var t = this._panels = {};
                    A(e, function (e) {
                        t[e.panelId] = v(e)
                    })
                } else this._panels = null;
                return this
            }, mount: function (e) {
                e = e || {}, this._enableGlobalPan = e.enableGlobalPan;
                var t = this.group;
                return this._zr.add(t), t.attr({
                    position: e.position || [0, 0],
                    rotation: e.rotation || 0,
                    scale: e.scale || [1, 1]
                }), this._transform = t.getLocalTransform(), this
            }, eachCover: function (e, t) {
                jw(this._covers, e, t)
            }, updateCovers: function (e) {
                e = D(e, function (e) {
                    return m(v(iC), e, !0)
                });
                var t = "\0-brush-index-", i = this._covers, n = this._covers = [], a = this, o = this._creatingCover;
                return new bf(i, e, function (e, t) {
                    return r(e.__brushOption, t)
                }, r).add(s).update(s).remove(function (e) {
                    i[e] !== o && a.group.remove(i[e])
                }).execute(), this;

                function r(e, i) {
                    return (null != e.id ? e.id : t + i) + "-" + e.brushType
                }

                function s(t, r) {
                    var s = e[t];
                    if (null != r && i[r] === o) n[t] = i[r]; else {
                        var l = n[t] = null != r ? (i[r].__brushOption = s, i[r]) : rC(a, oC(a, s));
                        dC(a, l)
                    }
                }
            }, unmount: function () {
                return this.enableBrush(!1), fC(this), this._zr.remove(this.group), this
            }, dispose: function () {
                this.unmount(), this.off()
            }
        }, I(aC, xe);
        var NC = {
            mousedown: function (e) {
                if (this._dragging) EC(this, e); else if (!e.target || !e.target.draggable) {
                    _C(e);
                    var t = this.group.transformCoordToLocal(e.offsetX, e.offsetY);
                    this._creatingCover = null, (this._creatingPanel = cC(this, e, t)) && (this._dragging = !0, this._track = [t.slice()])
                }
            }, mousemove: function (e) {
                var t = e.offsetX, i = e.offsetY, n = this.group.transformCoordToLocal(t, i);
                if (function (e, t, i) {
                    if (e._brushType && !function (e, t, i) {
                        var n = e._zr;
                        return t < 0 || t > n.getWidth() || i > n.getHeight()
                    }(e, t)) {
                        var n = e._zr, a = e._covers, o = cC(e, t, i);
                        if (!e._dragging) for (var r = 0; r < a.length; r++) {
                            var s = a[r].__brushOption;
                            if (o && (!0 === o || s.panelId === o.panelId) && PC[s.brushType].contain(a[r], i[0], i[1])) return
                        }
                        o && n.setCursorStyle("crosshair")
                    }
                }(this, e, n), this._dragging) {
                    _C(e);
                    var a = DC(this, e, n, !1);
                    a && gC(this, a)
                }
            }, mouseup: function (e) {
                EC(this, e)
            }
        };

        function EC(e, t) {
            if (e._dragging) {
                _C(t);
                var i = t.offsetX, n = t.offsetY, a = e.group.transformCoordToLocal(i, n), o = DC(e, t, a, !0);
                e._dragging = !1, e._track = [], e._creatingCover = null, o && gC(e, o)
            }
        }

        var PC = {
            lineX: MC(0), lineY: MC(1), rect: {
                createCover: function (e, t) {
                    return vC(zw(CC, function (e) {
                        return e
                    }, function (e) {
                        return e
                    }), e, t, ["w", "e", "n", "s", "se", "sw", "ne", "nw"])
                }, getCreatingRange: function (e) {
                    var t = pC(e);
                    return wC(t[1][0], t[1][1], t[0][0], t[0][1])
                }, updateCoverShape: function (e, t, i, n) {
                    mC(e, t, i, n)
                }, updateCommon: yC, contain: AC
            }, polygon: {
                createCover: function (e, t) {
                    var i = new Di;
                    return i.add(new Xr({name: "main", style: TC(t), silent: !0})), i
                }, getCreatingRange: function (e) {
                    return e
                }, endCreating: function (e, t) {
                    t.remove(t.childAt(0)), t.add(new $r({
                        name: "main",
                        draggable: !0,
                        drift: zw(SC, e, t),
                        ondragend: zw(gC, e, {isEnd: !0})
                    }))
                }, updateCoverShape: function (e, t, i, n) {
                    t.childAt(0).setShape({points: IC(e, t, i)})
                }, updateCommon: yC, contain: AC
            }
        };

        function MC(e) {
            return {
                createCover: function (t, i) {
                    return vC(zw(CC, function (t) {
                        var i = [t, [0, 100]];
                        return e && i.reverse(), i
                    }, function (t) {
                        return t[e]
                    }), t, i, [["w", "e"], ["n", "s"]][e])
                }, getCreatingRange: function (t) {
                    var i = pC(t);
                    return [$w(i[0][e], i[1][e]), Xw(i[0][e], i[1][e])]
                }, updateCoverShape: function (t, i, n, a) {
                    var o, r = hC(t, i);
                    if (!0 !== r && r.getLinearBrushOtherExtent) o = r.getLinearBrushOtherExtent(e, t._transform); else {
                        var s = t._zr;
                        o = [0, [s.getWidth(), s.getHeight()][1 - e]]
                    }
                    var l = [n, o];
                    e && l.reverse(), mC(t, i, l, a)
                }, updateCommon: yC, contain: AC
            }
        }

        function OC(e) {
            return e = BC(e), function (t, i) {
                return cl(t, e)
            }
        }

        function FC(e, t) {
            return e = BC(e), function (i) {
                var n = null != t ? t : i, a = n ? e.width : e.height, o = n ? e.x : e.y;
                return [o, o + (a || 0)]
            }
        }

        function LC(e, t, i) {
            return e = BC(e), function (n, a, o) {
                return e.contain(a[0], a[1]) && !Fy(n, t, i)
            }
        }

        function BC(e) {
            return Ai.create(e)
        }

        var UC = ["axisLine", "axisTickLabel", "axisName"], RC = Tf({
            type: "parallelAxis", init: function (e, t) {
                RC.superApply(this, "init", arguments), (this._brushController = new aC(t.getZr())).on("brush", P(this._onBrush, this))
            }, render: function (e, t, i, n) {
                if (!function (e, t, i) {
                    return i && "axisAreaSelect" === i.type && t.findComponents({
                        mainType: "parallelAxis",
                        query: i
                    })[0] === e
                }(e, t, n)) {
                    this.axisModel = e, this.api = i, this.group.removeAll();
                    var a = this._axisGroup;
                    if (this._axisGroup = new Di, this.group.add(this._axisGroup), e.get("show")) {
                        var o = function (e, t) {
                                return t.getComponent("parallel", e.get("parallelIndex"))
                            }(e, t), r = o.coordinateSystem, s = e.getAreaSelectStyle(), l = s.width, d = e.axis.dim,
                            u = k({strokeContainThreshold: l}, r.getAxisLayout(d)), c = new Kv(e, u);
                        A(UC, c.add, c), this._axisGroup.add(c.getGroup()), this._refreshBrushController(u, s, e, o, l, i);
                        var h = n && !1 === n.animation ? null : e;
                        ul(a, this._axisGroup, h)
                    }
                }
            }, _refreshBrushController: function (e, t, i, n, a, o) {
                var r = i.axis.getExtent(), s = r[1] - r[0], l = Math.min(30, .1 * Math.abs(s)),
                    d = Ai.create({x: r[0], y: -a / 2, width: s, height: a});
                d.x -= l, d.width += 2 * l, this._brushController.mount({
                    enableGlobalPan: !0,
                    rotation: e.rotation,
                    position: e.position
                }).setPanels([{
                    panelId: "pl",
                    clipPath: OC(d),
                    isTargetByCursor: LC(d, o, n),
                    getLinearBrushOtherExtent: FC(d, 0)
                }]).enableBrush({brushType: "lineX", brushStyle: t, removeOnClick: !0}).updateCovers(function (e) {
                    var t = e.axis;
                    return D(e.activeIntervals, function (e) {
                        return {
                            brushType: "lineX",
                            panelId: "pl",
                            range: [t.dataToCoord(e[0], !0), t.dataToCoord(e[1], !0)]
                        }
                    })
                }(i))
            }, _onBrush: function (e, t) {
                var i = this.axisModel, n = i.axis, a = D(e, function (e) {
                    return [n.coordToData(e.range[0], !0), n.coordToData(e.range[1], !0)]
                });
                !i.option.realtime !== t.isEnd && !t.removeOnClick || this.api.dispatchAction({
                    type: "axisAreaSelect",
                    parallelAxisId: i.id,
                    intervals: a
                })
            }, dispose: function () {
                this._brushController.dispose()
            }
        });
        Tf({
            type: "parallel", render: function (e, t, i) {
                this._model = e, this._api = i, this._handlers || (this._handlers = {}, A(KC, function (e, t) {
                    i.getZr().on(t, this._handlers[t] = P(e, this))
                }, this)), bc(this, "_throttledDispatchExpand", e.get("axisExpandRate"), "fixRate")
            }, dispose: function (e, t) {
                A(this._handlers, function (e, i) {
                    t.getZr().off(i, e)
                }), this._handlers = null
            }, _throttledDispatchExpand: function (e) {
                this._dispatchExpand(e)
            }, _dispatchExpand: function (e) {
                e && this._api.dispatchAction(k({type: "parallelAxisExpand"}, e))
            }
        });
        var KC = {
            mousedown: function (e) {
                WC(this, "click") && (this._mouseDownPoint = [e.offsetX, e.offsetY])
            }, mouseup: function (e) {
                var t = this._mouseDownPoint;
                if (WC(this, "click") && t) {
                    var i = [e.offsetX, e.offsetY];
                    if (5 < Math.pow(t[0] - i[0], 2) + Math.pow(t[1] - i[1], 2)) return;
                    var n = this._model.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX, e.offsetY]);
                    "none" !== n.behavior && this._dispatchExpand({axisExpandWindow: n.axisExpandWindow})
                }
                this._mouseDownPoint = null
            }, mousemove: function (e) {
                if (!this._mouseDownPoint && WC(this, "mousemove")) {
                    var t = this._model, i = t.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX, e.offsetY]),
                        n = i.behavior;
                    "jump" === n && this._throttledDispatchExpand.debounceNextCall(t.get("axisExpandDebounce")), this._throttledDispatchExpand("none" === n ? null : {
                        axisExpandWindow: i.axisExpandWindow,
                        animation: "jump" === n && null
                    })
                }
            }
        };

        function WC(e, t) {
            var i = e._model;
            return i.get("axisExpandable") && i.get("axisExpandTriggerOn") === t
        }

        function VC(e, t, i, n) {
            for (var a, o = [], r = 0; r < i.length; r++) {
                var s = i[r], l = e.get(e.mapDimension(s), t);
                a = l, ("category" === n.getAxis(s).type ? null == a : null == a || isNaN(a)) || o.push(n.dataToPoint(l, s))
            }
            return o
        }

        function HC(e, t, i, n, a) {
            var o = VC(e, i, n, a), r = new Xr({shape: {points: o}, silent: !0, z2: 10});
            return t.add(r), e.setItemGraphicEl(i, r), r
        }

        function zC(e) {
            var t = e.get("smooth", !0);
            return !0 === t && (t = .3), {lineStyle: e.getModel("lineStyle").getLineStyle(), smooth: null != t ? t : .3}
        }

        function jC(e, t, i, n) {
            var a = n.lineStyle;
            t.hasItemOption && (a = t.getItemModel(i).getModel("lineStyle").getLineStyle()), e.useStyle(a);
            var o = e.style;
            o.fill = null, o.stroke = t.getItemVisual(i, "color"), o.opacity = t.getItemVisual(i, "opacity"), n.smooth && (e.shape.smooth = n.smooth)
        }

        cf(function (e) {
            var t;
            !function (e) {
                if (!e.parallel) {
                    var t = !1;
                    A(e.series, function (e) {
                        e && "parallel" === e.type && (t = !0)
                    }), t && (e.parallel = [{}])
                }
            }(e), A(Pa((t = e).parallelAxis), function (e) {
                if (B(e)) {
                    var i = e.parallelIndex || 0, n = Pa(t.parallel)[i];
                    n && n.parallelAxisDefault && m(e, n.parallelAxisDefault, !1)
                }
            })
        }), ec.extend({
            type: "series.parallel",
            dependencies: ["parallel"],
            visualColorAccessPath: "lineStyle.color",
            getInitialData: function (e, t) {
                var i = this.getSource();
                return function (e, t) {
                    if (!e.encodeDefine) {
                        var i = t.ecModel.getComponent("parallel", t.get("parallelIndex"));
                        if (i) {
                            var n = e.encodeDefine = Q();
                            A(i.dimensions, function (e) {
                                var t = function (e) {
                                    return +e.replace("dim", "")
                                }(e);
                                n.set(e, t)
                            })
                        }
                    }
                }(i, this), rg(i, this)
            },
            getRawIndicesByActiveState: function (e) {
                var t = this.coordinateSystem, i = this.getData(), n = [];
                return t.eachActiveState(i, function (t, a) {
                    e === t && n.push(i.getRawIndex(a))
                }), n
            },
            defaultOption: {
                zlevel: 0,
                z: 2,
                coordinateSystem: "parallel",
                parallelIndex: 0,
                label: {show: !1},
                inactiveOpacity: .05,
                activeOpacity: 1,
                lineStyle: {width: 1, opacity: .45, type: "solid"},
                emphasis: {label: {show: !1}},
                progressive: 500,
                smooth: !1,
                animationEasing: "linear"
            }
        }), fc.extend({
            type: "parallel", init: function () {
                this._dataGroup = new Di, this.group.add(this._dataGroup), this._data, this._initialized
            }, render: function (e, t, i, n) {
                var a = this._dataGroup, o = e.getData(), r = this._data, s = e.coordinateSystem, l = s.dimensions,
                    d = zC(e);
                if (o.diff(r).add(function (e) {
                    jC(HC(o, a, e, l, s), o, e, d)
                }).update(function (t, i) {
                    var a = r.getItemGraphicEl(i), u = VC(o, t, l, s);
                    o.setItemGraphicEl(t, a);
                    var c = n && !1 === n.animation ? null : e;
                    ol(a, {shape: {points: u}}, c, t), jC(a, o, t, d)
                }).remove(function (e) {
                    var t = r.getItemGraphicEl(e);
                    a.remove(t)
                }).execute(), !this._initialized) {
                    this._initialized = !0;
                    var u = function (e, t, i) {
                        var n = e.model, a = e.getRect(),
                            o = new es({shape: {x: a.x, y: a.y, width: a.width, height: a.height}}),
                            r = "horizontal" === n.get("layout") ? "width" : "height";
                        return o.setShape(r, 0), rl(o, {shape: {width: a.width, height: a.height}}, t, i), o
                    }(s, e, function () {
                        setTimeout(function () {
                            a.removeClipPath()
                        })
                    });
                    a.setClipPath(u)
                }
                this._data = o
            }, incrementalPrepareRender: function (e, t, i) {
                this._initialized = !0, this._data = null, this._dataGroup.removeAll()
            }, incrementalRender: function (e, t, i) {
                for (var n = t.getData(), a = t.coordinateSystem, o = a.dimensions, r = zC(t), s = e.start; s < e.end; s++) {
                    var l = HC(n, this._dataGroup, s, o, a);
                    l.incremental = !0, jC(l, n, s, r)
                }
            }, dispose: function () {
            }, remove: function () {
                this._dataGroup && this._dataGroup.removeAll(), this._data = null
            }
        });
        var GC = ["lineStyle", "normal", "opacity"];
        vf({
            seriesType: "parallel", reset: function (e, t, i) {
                var n = e.getModel("itemStyle"), a = e.getModel("lineStyle"), o = t.get("color"),
                    r = a.get("color") || n.get("color") || o[e.seriesIndex % o.length], s = e.get("inactiveOpacity"),
                    l = e.get("activeOpacity"), d = e.getModel("lineStyle").getLineStyle(), u = e.coordinateSystem,
                    c = e.getData(), h = {normal: d.opacity, active: l, inactive: s};
                return c.setVisual("color", r), {
                    progress: function (e, t) {
                        u.eachActiveState(t, function (e, i) {
                            var n = h[e];
                            if ("normal" === e && t.hasItemOption) {
                                var a = t.getItemModel(i).get(GC, !0);
                                null != a && (n = a)
                            }
                            t.setItemVisual(i, "opacity", n)
                        }, e.start, e.end)
                    }
                }
            }
        });
        var $C = ec.extend({
                type: "series.sankey",
                layoutInfo: null,
                levelModels: null,
                getInitialData: function (e, t) {
                    for (var i = e.edges || e.links, n = e.data || e.nodes, a = e.levels, o = this.levelModels = {}, r = 0; r < a.length; r++) null != a[r].depth && 0 <= a[r].depth && (o[a[r].depth] = new Sl(a[r], this, t));
                    if (n && i) return FT(n, i, this, !0, function (e, t) {
                        e.wrapMethod("getItemModel", function (e, t) {
                            return e.customizeGetParent(function (e) {
                                var i = this.parentModel, n = i.getData().getItemLayout(t).depth;
                                return i.levelModels[n] || this.parentModel
                            }), e
                        }), t.wrapMethod("getItemModel", function (e, t) {
                            return e.customizeGetParent(function (e) {
                                var i = this.parentModel, n = i.getGraph().getEdgeByIndex(t).node1.getLayout().depth;
                                return i.levelModels[n] || this.parentModel
                            }), e
                        })
                    }).data
                },
                setNodePosition: function (e, t) {
                    var i = this.option.data[e];
                    i.localX = t[0], i.localY = t[1]
                },
                getGraph: function () {
                    return this.getData().graph
                },
                getEdgeData: function () {
                    return this.getGraph().edgeData
                },
                formatTooltip: function (e, t, i) {
                    if ("edge" === i) {
                        var n = this.getDataParams(e, i), a = n.data, o = a.source + " -- " + a.target;
                        return n.value && (o += " : " + n.value), Ql(o)
                    }
                    if ("node" !== i) return $C.superCall(this, "formatTooltip", e, t);
                    var r = this.getGraph().getNodeByIndex(e).getLayout().value, s = this.getDataParams(e, i).data.name;
                    return r && (o = s + " : " + r), Ql(o)
                },
                optionUpdated: function () {
                    var e = this.option;
                    !0 === e.focusNodeAdjacency && (e.focusNodeAdjacency = "allEdges")
                },
                getDataParams: function (e, t) {
                    var i = $C.superCall(this, "getDataParams", e, t);
                    if (null == i.value && "node" === t) {
                        var n = this.getGraph().getNodeByIndex(e).getLayout().value;
                        i.value = n
                    }
                    return i
                },
                defaultOption: {
                    zlevel: 0,
                    z: 2,
                    coordinateSystem: "view",
                    layout: null,
                    left: "5%",
                    top: "5%",
                    right: "20%",
                    bottom: "5%",
                    orient: "horizontal",
                    nodeWidth: 20,
                    nodeGap: 8,
                    draggable: !0,
                    focusNodeAdjacency: !1,
                    layoutIterations: 32,
                    label: {show: !0, position: "right", color: "#000", fontSize: 12},
                    levels: [],
                    nodeAlign: "justify",
                    itemStyle: {borderWidth: 1, borderColor: "#333"},
                    lineStyle: {color: "#314656", opacity: .2, curveness: .5},
                    emphasis: {label: {show: !0}, lineStyle: {opacity: .5}},
                    animationEasing: "linear",
                    animationDuration: 1e3
                }
            }), XC = ["itemStyle", "opacity"], qC = ["emphasis", "itemStyle", "opacity"], YC = ["lineStyle", "opacity"],
            JC = ["emphasis", "lineStyle", "opacity"];

        function ZC(e, t) {
            return e.getVisual("opacity") || e.getModel().get(t)
        }

        function QC(e, t, i) {
            var n = e.getGraphicEl(), a = ZC(e, t);
            null != i && (null == a && (a = 1), a *= i), n.downplay && n.downplay(), n.traverse(function (e) {
                "group" !== e.type && e.setStyle("opacity", a)
            })
        }

        function eS(e, t) {
            var i = ZC(e, t), n = e.getGraphicEl();
            n.traverse(function (e) {
                "group" !== e.type && e.setStyle("opacity", i)
            }), n.highlight && n.highlight()
        }

        var tS = Ss({
            shape: {x1: 0, y1: 0, x2: 0, y2: 0, cpx1: 0, cpy1: 0, cpx2: 0, cpy2: 0, extent: 0, orient: ""},
            buildPath: function (e, t) {
                var i = t.extent;
                e.moveTo(t.x1, t.y1), e.bezierCurveTo(t.cpx1, t.cpy1, t.cpx2, t.cpy2, t.x2, t.y2), "vertical" === t.orient ? (e.lineTo(t.x2 + i, t.y2), e.bezierCurveTo(t.cpx2 + i, t.cpy2, t.cpx1 + i, t.cpy1, t.x1 + i, t.y1)) : (e.lineTo(t.x2, t.y2 + i), e.bezierCurveTo(t.cpx2, t.cpy2 + i, t.cpx1, t.cpy1 + i, t.x1, t.y1 + i)), e.closePath()
            },
            highlight: function () {
                this.trigger("emphasis")
            },
            downplay: function () {
                this.trigger("normal")
            }
        });

        function iS(e) {
            var t = e.hostGraph.data.getRawDataItem(e.dataIndex);
            return null != t.depth && 0 <= t.depth
        }

        function nS(e, t, i, n, a) {
            var o = "vertical" === a ? "x" : "y";
            A(e, function (e) {
                var r, s, l;
                e.sort(function (e, t) {
                    return e.getLayout()[o] - t.getLayout()[o]
                });
                for (var d = 0, u = e.length, c = "vertical" === a ? "dx" : "dy", h = 0; h < u; h++) 0 < (l = d - (s = e[h]).getLayout()[o]) && (r = s.getLayout()[o] + l, "vertical" === a ? s.setLayout({x: r}, !0) : s.setLayout({y: r}, !0)), d = s.getLayout()[o] + s.getLayout()[c] + t;
                if (0 < (l = d - t - ("vertical" === a ? n : i))) for (r = s.getLayout()[o] - l, "vertical" === a ? s.setLayout({x: r}, !0) : s.setLayout({y: r}, !0), d = r, h = u - 2; 0 <= h; --h) 0 < (l = (s = e[h]).getLayout()[o] + s.getLayout()[c] + t - d) && (r = s.getLayout()[o] - l, "vertical" === a ? s.setLayout({x: r}, !0) : s.setLayout({y: r}, !0)), d = s.getLayout()[o]
            })
        }

        function aS(e, t, i) {
            A(e.slice().reverse(), function (e) {
                A(e, function (e) {
                    if (e.outEdges.length) {
                        var n = cS(e.outEdges, oS, i) / cS(e.outEdges, uS, i);
                        if (isNaN(n)) {
                            var a = e.outEdges.length;
                            n = a ? cS(e.outEdges, rS, i) / a : 0
                        }
                        if ("vertical" === i) {
                            var o = e.getLayout().x + (n - dS(e, i)) * t;
                            e.setLayout({x: o}, !0)
                        } else {
                            var r = e.getLayout().y + (n - dS(e, i)) * t;
                            e.setLayout({y: r}, !0)
                        }
                    }
                })
            })
        }

        function oS(e, t) {
            return dS(e.node2, t) * e.getValue()
        }

        function rS(e, t) {
            return dS(e.node2, t)
        }

        function sS(e, t) {
            return dS(e.node1, t) * e.getValue()
        }

        function lS(e, t) {
            return dS(e.node1, t)
        }

        function dS(e, t) {
            return "vertical" === t ? e.getLayout().x + e.getLayout().dx / 2 : e.getLayout().y + e.getLayout().dy / 2
        }

        function uS(e) {
            return e.getValue()
        }

        function cS(e, t, i) {
            for (var n = 0, a = e.length, o = -1; ++o < a;) {
                var r = +t.call(e, e[o], i);
                isNaN(r) || (n += r)
            }
            return n
        }

        function hS(e, t, i) {
            A(e, function (e) {
                A(e, function (e) {
                    if (e.inEdges.length) {
                        var n = cS(e.inEdges, sS, i) / cS(e.inEdges, uS, i);
                        if (isNaN(n)) {
                            var a = e.inEdges.length;
                            n = a ? cS(e.inEdges, lS, i) / a : 0
                        }
                        if ("vertical" === i) {
                            var o = e.getLayout().x + (n - dS(e, i)) * t;
                            e.setLayout({x: o}, !0)
                        } else {
                            var r = e.getLayout().y + (n - dS(e, i)) * t;
                            e.setLayout({y: r}, !0)
                        }
                    }
                })
            })
        }

        Cf({
            type: "sankey", _model: null, _focusAdjacencyDisabled: !1, render: function (e, t, i) {
                var n = this, a = e.getGraph(), o = this.group, r = e.layoutInfo, s = r.width, l = r.height,
                    d = e.getData(), u = e.getData("edge"), c = e.get("orient");
                this._model = e, o.removeAll(), o.attr("position", [r.x, r.y]), a.eachEdge(function (t) {
                    var i = new tS;
                    i.dataIndex = t.dataIndex, i.seriesIndex = e.seriesIndex, i.dataType = "edge";
                    var n, a, r, d, h, f, g, p, v = t.getModel("lineStyle"), m = v.get("curveness"),
                        y = t.node1.getLayout(), k = t.node1.getModel(), T = k.get("localX"), w = k.get("localY"),
                        C = t.node2.getLayout(), S = t.node2.getModel(), b = S.get("localX"), I = S.get("localY"),
                        _ = t.getLayout();
                    switch (i.shape.extent = Math.max(1, _.dy), p = "vertical" === (i.shape.orient = c) ? (n = (null != T ? T * s : y.x) + _.sy, a = (null != w ? w * l : y.y) + y.dy, r = (null != b ? b * s : C.x) + _.ty, h = n, f = a * (1 - m) + (d = null != I ? I * l : C.y) * m, g = r, a * m + d * (1 - m)) : (n = (null != T ? T * s : y.x) + y.dx, a = (null != w ? w * l : y.y) + _.sy, h = n * (1 - m) + (r = null != b ? b * s : C.x) * m, f = a, g = n * m + r * (1 - m), d = (null != I ? I * l : C.y) + _.ty), i.setShape({
                        x1: n,
                        y1: a,
                        x2: r,
                        y2: d,
                        cpx1: h,
                        cpy1: f,
                        cpx2: g,
                        cpy2: p
                    }), i.setStyle(v.getItemStyle()), i.style.fill) {
                        case"source":
                            i.style.fill = t.node1.getVisual("color");
                            break;
                        case"target":
                            i.style.fill = t.node2.getVisual("color")
                    }
                    js(i, t.getModel("emphasis.lineStyle").getItemStyle()), o.add(i), u.setItemGraphicEl(t.dataIndex, i)
                }), a.eachNode(function (t) {
                    var i = t.getLayout(), n = t.getModel(), a = n.get("localX"), r = n.get("localY"),
                        u = n.getModel("label"), c = n.getModel("emphasis.label"), h = new es({
                            shape: {
                                x: null != a ? a * s : i.x,
                                y: null != r ? r * l : i.y,
                                width: i.dx,
                                height: i.dy
                            }, style: n.getModel("itemStyle").getItemStyle()
                        }), f = t.getModel("emphasis.itemStyle").getItemStyle();
                    qs(h.style, f, u, c, {
                        labelFetcher: e,
                        labelDataIndex: t.dataIndex,
                        defaultText: t.id,
                        isRectText: !0
                    }), h.setStyle("fill", t.getVisual("color")), js(h, f), o.add(h), d.setItemGraphicEl(t.dataIndex, h), h.dataType = "node"
                }), d.eachItemGraphicEl(function (t, a) {
                    var o = d.getItemModel(a);
                    o.get("draggable") && (t.drift = function (t, o) {
                        n._focusAdjacencyDisabled = !0, this.shape.x += t, this.shape.y += o, this.dirty(), i.dispatchAction({
                            type: "dragNode",
                            seriesId: e.id,
                            dataIndex: d.getRawIndex(a),
                            localX: this.shape.x / s,
                            localY: this.shape.y / l
                        })
                    }, t.ondragend = function () {
                        n._focusAdjacencyDisabled = !1
                    }, t.draggable = !0, t.cursor = "move"), t.highlight = function () {
                        this.trigger("emphasis")
                    }, t.downplay = function () {
                        this.trigger("normal")
                    }, t.focusNodeAdjHandler && t.off("mouseover", t.focusNodeAdjHandler), t.unfocusNodeAdjHandler && t.off("mouseout", t.unfocusNodeAdjHandler), o.get("focusNodeAdjacency") && (t.on("mouseover", t.focusNodeAdjHandler = function () {
                        n._focusAdjacencyDisabled || (n._clearTimer(), i.dispatchAction({
                            type: "focusNodeAdjacency",
                            seriesId: e.id,
                            dataIndex: t.dataIndex
                        }))
                    }), t.on("mouseout", t.unfocusNodeAdjHandler = function () {
                        n._focusAdjacencyDisabled || n._dispatchUnfocus(i)
                    }))
                }), u.eachItemGraphicEl(function (t, a) {
                    var o = u.getItemModel(a);
                    t.focusNodeAdjHandler && t.off("mouseover", t.focusNodeAdjHandler), t.unfocusNodeAdjHandler && t.off("mouseout", t.unfocusNodeAdjHandler), o.get("focusNodeAdjacency") && (t.on("mouseover", t.focusNodeAdjHandler = function () {
                        n._focusAdjacencyDisabled || (n._clearTimer(), i.dispatchAction({
                            type: "focusNodeAdjacency",
                            seriesId: e.id,
                            edgeDataIndex: t.dataIndex
                        }))
                    }), t.on("mouseout", t.unfocusNodeAdjHandler = function () {
                        n._focusAdjacencyDisabled || n._dispatchUnfocus(i)
                    }))
                }), !this._data && e.get("animation") && o.setClipPath(function (e, t, i) {
                    var n = new es({shape: {x: e.x - 10, y: e.y - 10, width: 0, height: e.height + 20}});
                    return rl(n, {shape: {width: e.width + 20}}, t, function () {
                        o.removeClipPath()
                    }), n
                }(o.getBoundingRect(), e)), this._data = e.getData()
            }, dispose: function () {
                this._clearTimer()
            }, _dispatchUnfocus: function (e) {
                var t = this;
                this._clearTimer(), this._unfocusDelayTimer = setTimeout(function () {
                    t._unfocusDelayTimer = null, e.dispatchAction({type: "unfocusNodeAdjacency", seriesId: t._model.id})
                }, 500)
            }, _clearTimer: function () {
                this._unfocusDelayTimer && (clearTimeout(this._unfocusDelayTimer), this._unfocusDelayTimer = null)
            }, focusNodeAdjacency: function (e, t, i, n) {
                var a = e.getData(), o = a.graph, r = n.dataIndex, s = a.getItemModel(r), l = n.edgeDataIndex;
                if (null != r || null != l) {
                    var d = o.getNodeByIndex(r), u = o.getEdgeByIndex(l);
                    if (o.eachNode(function (e) {
                        QC(e, XC, .1)
                    }), o.eachEdge(function (e) {
                        QC(e, YC, .1)
                    }), d) {
                        eS(d, qC);
                        var c = s.get("focusNodeAdjacency");
                        "outEdges" === c ? A(d.outEdges, function (e) {
                            e.dataIndex < 0 || (eS(e, JC), eS(e.node2, qC))
                        }) : "inEdges" === c ? A(d.inEdges, function (e) {
                            e.dataIndex < 0 || (eS(e, JC), eS(e.node1, qC))
                        }) : "allEdges" === c && A(d.edges, function (e) {
                            e.dataIndex < 0 || (eS(e, JC), e.node1 !== d && eS(e.node1, qC), e.node2 !== d && eS(e.node2, qC))
                        })
                    }
                    u && (eS(u, JC), eS(u.node1, qC), eS(u.node2, qC))
                }
            }, unfocusNodeAdjacency: function (e, t, i, n) {
                var a = e.getGraph();
                a.eachNode(function (e) {
                    QC(e, XC)
                }), a.eachEdge(function (e) {
                    QC(e, YC)
                })
            }
        }), ff({type: "dragNode", event: "dragnode", update: "update"}, function (e, t) {
            t.eachComponent({mainType: "series", subType: "sankey", query: e}, function (t) {
                t.setNodePosition(e.dataIndex, [e.localX, e.localY])
            })
        }), pf(function (e, t, i) {
            e.eachSeriesByType("sankey", function (e) {
                var i = e.get("nodeWidth"), n = e.get("nodeGap"), a = function (e, t) {
                    return vd(e.getBoxLayoutParams(), {width: t.getWidth(), height: t.getHeight()})
                }(e, t), o = (e.layoutInfo = a).width, r = a.height, s = e.getGraph(), l = s.nodes, d = s.edges;
                !function (e) {
                    A(e, function (e) {
                        var t = cS(e.outEdges, uS), i = cS(e.inEdges, uS), n = e.getValue() || 0, a = Math.max(t, i, n);
                        e.setLayout({value: a}, !0)
                    })
                }(l), function (e, t, i, n, a, o, r, s, l) {
                    (function (e, t, i, n, a, o, r) {
                        for (var s = [], l = [], d = [], u = [], c = 0, h = 0; h < t.length; h++) s[h] = 1;
                        for (h = 0; h < e.length; h++) l[h] = e[h].inEdges.length, 0 === l[h] && d.push(e[h]);
                        for (var f = -1; d.length;) {
                            for (var g = 0; g < d.length; g++) {
                                var p = d[g], v = p.hostGraph.data.getRawDataItem(p.dataIndex),
                                    m = null != v.depth && 0 <= v.depth;
                                m && v.depth > f && (f = v.depth), p.setLayout({depth: m ? v.depth : c}, !0), "vertical" === o ? p.setLayout({dy: i}, !0) : p.setLayout({dx: i}, !0);
                                for (var y = 0; y < p.outEdges.length; y++) {
                                    var k = p.outEdges[y], T = t.indexOf(k);
                                    s[T] = 0;
                                    var w = k.node2, C = e.indexOf(w);
                                    0 == --l[C] && u.indexOf(w) < 0 && u.push(w)
                                }
                            }
                            ++c, d = u, u = []
                        }
                        for (h = 0; h < s.length; h++) if (1 === s[h]) throw new Error("Sankey is a DAG, the original data has cycle!");
                        var S = c - 1 < f ? f : c - 1;
                        r && "left" !== r && function (e, t, i, n) {
                            if ("right" === t) {
                                for (var a = [], o = e, r = 0; o.length;) {
                                    for (var s = 0; s < o.length; s++) {
                                        var l = o[s];
                                        l.setLayout({skNodeHeight: r}, !0);
                                        for (var d = 0; d < l.inEdges.length; d++) {
                                            var u = l.inEdges[d];
                                            a.indexOf(u.node1) < 0 && a.push(u.node1)
                                        }
                                    }
                                    o = a, a = [], ++r
                                }
                                A(e, function (e) {
                                    iS(e) || e.setLayout({depth: Math.max(0, n - e.getLayout().skNodeHeight)}, !0)
                                })
                            } else "justify" === t && function (e, t) {
                                A(e, function (e) {
                                    iS(e) || e.outEdges.length || e.setLayout({depth: t}, !0)
                                })
                            }(e, n)
                        }(e, r, 0, S), function (e, t, i) {
                            A(e, function (e) {
                                var n = e.getLayout().depth * t;
                                "vertical" === i ? e.setLayout({y: n}, !0) : e.setLayout({x: n}, !0)
                            })
                        }(e, "vertical" === o ? (a - i) / S : (n - i) / S, o)
                    })(e, t, i, a, o, s, l), function (e, t, i, n, a, o, r) {
                        var s = function (e, t) {
                            var i = [], n = "x", a = $a(e, function (e) {
                                return e.getLayout()[n]
                            });
                            return a.keys.sort(function (e, t) {
                                return e - t
                            }), A(a.keys, function (e) {
                                i.push(a.buckets.get(e))
                            }), i
                        }(e);
                        (function (e, t, i, n, a, o) {
                            var r = 1 / 0;
                            A(e, function (e) {
                                var t = e.length, s = 0;
                                A(e, function (e) {
                                    s += e.getLayout().value
                                });
                                var l = "vertical" === o ? (n - (t - 1) * a) / s : (i - (t - 1) * a) / s;
                                l < r && (r = l)
                            }), A(e, function (e) {
                                A(e, function (e, t) {
                                    var i = e.getLayout().value * r;
                                    "vertical" === o ? (e.setLayout({x: t}, !0), e.setLayout({dx: i}, !0)) : (e.setLayout({y: t}, !0), e.setLayout({dy: i}, !0))
                                })
                            }), A(t, function (e) {
                                var t = +e.getValue() * r;
                                e.setLayout({dy: t}, !0)
                            })
                        })(s, t, i, n, a, r), nS(s, a, i, n, r);
                        for (var l = 1; 0 < o; o--) aS(s, l *= .99, r), nS(s, a, i, n, r), hS(s, l, r), nS(s, a, i, n, r)
                    }(e, t, o, a, n, r, s), function (e, t) {
                        var i = "y";
                        A(e, function (e) {
                            e.outEdges.sort(function (e, t) {
                                return e.node2.getLayout()[i] - t.node2.getLayout()[i]
                            }), e.inEdges.sort(function (e, t) {
                                return e.node1.getLayout()[i] - t.node1.getLayout()[i]
                            })
                        }), A(e, function (e) {
                            var t = 0, i = 0;
                            A(e.outEdges, function (e) {
                                e.setLayout({sy: t}, !0), t += e.getLayout().dy
                            }), A(e.inEdges, function (e) {
                                e.setLayout({ty: i}, !0), i += e.getLayout().dy
                            })
                        })
                    }(e)
                }(l, d, i, n, o, r, 0 !== N(l, function (e) {
                    return 0 === e.getLayout().value
                }).length ? 0 : e.get("layoutIterations"), e.get("orient"), e.get("nodeAlign"))
            })
        }), vf(function (e, t) {
            e.eachSeriesByType("sankey", function (e) {
                var t = e.getGraph().nodes;
                if (t.length) {
                    var i = 1 / 0, n = -1 / 0;
                    A(t, function (e) {
                        var t = e.getLayout().value;
                        t < i && (i = t), n < t && (n = t)
                    }), A(t, function (t) {
                        var a = new Jk({
                            type: "color",
                            mappingMethod: "linear",
                            dataExtent: [i, n],
                            visual: e.get("color")
                        }).mapValueToVisual(t.getLayout().value), o = t.getModel().get("itemStyle.color");
                        null != o ? t.setVisual("color", o) : t.setVisual("color", a)
                    })
                }
            })
        });
        var fS = {
            _baseAxisDim: null, getInitialData: function (e, t) {
                var i, n, a = t.getComponent("xAxis", this.get("xAxisIndex")),
                    o = t.getComponent("yAxis", this.get("yAxisIndex")), r = a.get("type"), s = o.get("type");
                "category" === r ? (e.layout = "horizontal", i = a.getOrdinalMeta(), n = !0) : "category" === s ? (e.layout = "vertical", i = o.getOrdinalMeta(), n = !0) : e.layout = e.layout || "horizontal";
                var l = ["x", "y"], d = "horizontal" === e.layout ? 0 : 1, u = this._baseAxisDim = l[d], c = l[1 - d],
                    h = [a, o], f = h[d].get("type"), g = h[1 - d].get("type"), p = e.data;
                if (p && n) {
                    var v = [];
                    A(p, function (e, t) {
                        var i;
                        e.value && O(e.value) ? (i = e.value.slice(), e.value.unshift(t)) : O(e) ? (i = e.slice(), e.unshift(t)) : i = e, v.push(i)
                    }), e.data = v
                }
                var m = this.defaultValueDimensions, y = [{
                    name: u,
                    type: Df(f),
                    ordinalMeta: i,
                    otherDims: {tooltip: !1, itemName: 0},
                    dimsDef: ["base"]
                }, {name: c, type: Df(g), dimsDef: m.slice()}];
                return Mm(this, {coordDimensions: y, dimensionsCount: m.length + 1, encodeDefaulter: M(jd, y, this)})
            }, getBaseAxis: function () {
                var e = this._baseAxisDim;
                return this.ecModel.getComponent(e + "Axis", this.get(e + "AxisIndex")).axis
            }
        };
        I(ec.extend({
            type: "series.boxplot",
            dependencies: ["xAxis", "yAxis", "grid"],
            defaultValueDimensions: [{name: "min", defaultTooltip: !0}, {
                name: "Q1",
                defaultTooltip: !0
            }, {name: "median", defaultTooltip: !0}, {name: "Q3", defaultTooltip: !0}, {
                name: "max",
                defaultTooltip: !0
            }],
            dimensions: null,
            defaultOption: {
                zlevel: 0,
                z: 2,
                coordinateSystem: "cartesian2d",
                legendHoverLink: !0,
                hoverAnimation: !0,
                layout: null,
                boxWidth: [7, 50],
                itemStyle: {color: "#fff", borderWidth: 1},
                emphasis: {
                    itemStyle: {
                        borderWidth: 2,
                        shadowBlur: 5,
                        shadowOffsetX: 2,
                        shadowOffsetY: 2,
                        shadowColor: "rgba(0,0,0,0.4)"
                    }
                },
                animationEasing: "elasticOut",
                animationDuration: 800
            }
        }), fS, !0);
        var gS = ["itemStyle"], pS = ["emphasis", "itemStyle"], vS = (fc.extend({
            type: "boxplot", render: function (e, t, i) {
                var n = e.getData(), a = this.group, o = this._data;
                this._data || a.removeAll();
                var r = "horizontal" === e.get("layout") ? 1 : 0;
                n.diff(o).add(function (e) {
                    if (n.hasValue(e)) {
                        var t = mS(n.getItemLayout(e), n, e, r, !0);
                        n.setItemGraphicEl(e, t), a.add(t)
                    }
                }).update(function (e, t) {
                    var i = o.getItemGraphicEl(t);
                    if (n.hasValue(e)) {
                        var s = n.getItemLayout(e);
                        i ? yS(s, i, n, e) : i = mS(s, n, e, r), a.add(i), n.setItemGraphicEl(e, i)
                    } else a.remove(i)
                }).remove(function (e) {
                    var t = o.getItemGraphicEl(e);
                    t && a.remove(t)
                }).execute(), this._data = n
            }, remove: function (e) {
                var t = this.group, i = this._data;
                this._data = null, i && i.eachItemGraphicEl(function (e) {
                    e && t.remove(e)
                })
            }, dispose: te
        }), wr.extend({
            type: "boxplotBoxPath", shape: {}, buildPath: function (e, t) {
                var i = t.points, n = 0;
                for (e.moveTo(i[n][0], i[n][1]), n++; n < 4; n++) e.lineTo(i[n][0], i[n][1]);
                for (e.closePath(); n < i.length; n++) e.moveTo(i[n][0], i[n][1]), n++, e.lineTo(i[n][0], i[n][1])
            }
        }));

        function mS(e, t, i, n, a) {
            var o = e.ends, r = new vS({
                shape: {
                    points: a ? function (e, t, i) {
                        return D(e, function (e) {
                            return (e = e.slice())[t] = i.initBaseline, e
                        })
                    }(o, n, e) : o
                }
            });
            return yS(e, r, t, i, a), r
        }

        function yS(e, t, i, n, a) {
            var o = i.hostModel;
            (0, vl[a ? "initProps" : "updateProps"])(t, {shape: {points: e.ends}}, o, n);
            var r = i.getItemModel(n), s = r.getModel(gS), l = i.getItemVisual(n, "color"),
                d = s.getItemStyle(["borderColor"]);
            d.stroke = l, d.strokeNoScale = !0, t.useStyle(d), t.z2 = 100, js(t, r.getModel(pS).getItemStyle())
        }

        var kS = ["itemStyle", "borderColor"], TS = A;
        vf(function (e, t) {
            var i = e.get("color");
            e.eachRawSeriesByType("boxplot", function (t) {
                var n = i[t.seriesIndex % i.length], a = t.getData();
                a.setVisual({
                    legendSymbol: "roundRect",
                    color: t.get(kS) || n
                }), e.isSeriesFiltered(t) || a.each(function (e) {
                    var t = a.getItemModel(e);
                    a.setItemVisual(e, {color: t.get(kS, !0)})
                })
            })
        }), pf(function (e) {
            var t = function (e) {
                var t = [], i = [];
                return e.eachSeriesByType("boxplot", function (e) {
                    var n = e.getBaseAxis(), a = S(i, n);
                    a < 0 && (a = i.length, i[a] = n, t[a] = {axis: n, seriesModels: []}), t[a].seriesModels.push(e)
                }), t
            }(e);
            TS(t, function (e) {
                var t = e.seriesModels;
                t.length && (function (e) {
                    var t, i, n = e.axis, a = e.seriesModels, o = a.length, r = e.boxWidthList = [],
                        s = e.boxOffsetList = [], l = [];
                    if ("category" === n.type) i = n.getBandWidth(); else {
                        var d = 0;
                        TS(a, function (e) {
                            d = Math.max(d, e.getData().count())
                        }), t = n.getExtent(), Math.abs(t[1] - t[0])
                    }
                    TS(a, function (e) {
                        var t = e.get("boxWidth");
                        O(t) || (t = [t, t]), l.push([Nl(t[0], i) || 0, Nl(t[1], i) || 0])
                    });
                    var u = .8 * i - 2, c = u / o * .3, h = (u - c * (o - 1)) / o, f = h / 2 - u / 2;
                    TS(a, function (e, t) {
                        s.push(f), f += c + h, r.push(Math.min(Math.max(h, l[t][0]), l[t][1]))
                    })
                }(e), TS(t, function (t, i) {
                    !function (e, t, i) {
                        var n = e.coordinateSystem, a = e.getData(), o = i / 2,
                            r = "horizontal" === e.get("layout") ? 0 : 1, s = 1 - r, l = ["x", "y"],
                            d = a.mapDimension(l[r]), u = a.mapDimension(l[s], !0);
                        if (!(null == d || u.length < 5)) for (var c = 0; c < a.count(); c++) {
                            var h = a.get(d, c), f = k(h, u[2], c), g = k(h, u[0], c), p = k(h, u[1], c),
                                v = k(h, u[3], c), m = k(h, u[4], c), y = [];
                            T(y, p, 0), T(y, v, 1), y.push(g, p, m, v), w(y, g), w(y, m), w(y, f), a.setItemLayout(c, {
                                initBaseline: f[s],
                                ends: y
                            })
                        }

                        function k(e, i, o) {
                            var l, d = a.get(i, o), u = [];
                            return u[r] = e, u[s] = d, isNaN(e) || isNaN(d) ? l = [NaN, NaN] : (l = n.dataToPoint(u))[r] += t, l
                        }

                        function T(e, t, i) {
                            var n = t.slice(), a = t.slice();
                            n[r] += o, a[r] -= o, i ? e.push(n, a) : e.push(a, n)
                        }

                        function w(e, t) {
                            var i = t.slice(), n = t.slice();
                            i[r] -= o, n[r] += o, e.push(i, n)
                        }
                    }(t, e.boxOffsetList[i], e.boxWidthList[i])
                }))
            })
        }), I(ec.extend({
            type: "series.candlestick",
            dependencies: ["xAxis", "yAxis", "grid"],
            defaultValueDimensions: [{name: "open", defaultTooltip: !0}, {
                name: "close",
                defaultTooltip: !0
            }, {name: "lowest", defaultTooltip: !0}, {name: "highest", defaultTooltip: !0}],
            dimensions: null,
            defaultOption: {
                zlevel: 0,
                z: 2,
                coordinateSystem: "cartesian2d",
                legendHoverLink: !0,
                hoverAnimation: !0,
                layout: null,
                clip: !0,
                itemStyle: {
                    color: "#c23531",
                    color0: "#314656",
                    borderWidth: 1,
                    borderColor: "#c23531",
                    borderColor0: "#314656"
                },
                emphasis: {itemStyle: {borderWidth: 2}},
                barMaxWidth: null,
                barMinWidth: null,
                barWidth: null,
                large: !0,
                largeThreshold: 600,
                progressive: 3e3,
                progressiveThreshold: 1e4,
                progressiveChunkMode: "mod",
                animationUpdate: !1,
                animationEasing: "linear",
                animationDuration: 300
            },
            getShadowDim: function () {
                return "open"
            },
            brushSelector: function (e, t, i) {
                var n = t.getItemLayout(e);
                return n && i.rect(n.brushRect)
            }
        }), fS, !0);
        var wS = ["itemStyle"], CS = ["emphasis", "itemStyle"], SS = ["color", "color0", "borderColor", "borderColor0"],
            bS = (fc.extend({
                type: "candlestick", render: function (e, t, i) {
                    this.group.removeClipPath(), this._updateDrawMode(e), this._isLargeDraw ? this._renderLarge(e) : this._renderNormal(e)
                }, incrementalPrepareRender: function (e, t, i) {
                    this._clear(), this._updateDrawMode(e)
                }, incrementalRender: function (e, t, i, n) {
                    this._isLargeDraw ? this._incrementalRenderLarge(e, t) : this._incrementalRenderNormal(e, t)
                }, _updateDrawMode: function (e) {
                    var t = e.pipelineContext.large;
                    (null == this._isLargeDraw || t ^ this._isLargeDraw) && (this._isLargeDraw = t, this._clear())
                }, _renderNormal: function (e) {
                    var t = e.getData(), i = this._data, n = this.group, a = t.getLayout("isSimpleBox"),
                        o = e.get("clip", !0), r = e.coordinateSystem, s = r.getArea && r.getArea();
                    this._data || n.removeAll(), t.diff(i).add(function (i) {
                        if (t.hasValue(i)) {
                            var r, l = t.getItemLayout(i);
                            if (o && _S(s, l)) return;
                            rl(r = IS(l, 0, !0), {shape: {points: l.ends}}, e, i), AS(r, t, i, a), n.add(r), t.setItemGraphicEl(i, r)
                        }
                    }).update(function (r, l) {
                        var d = i.getItemGraphicEl(l);
                        if (t.hasValue(r)) {
                            var u = t.getItemLayout(r);
                            o && _S(s, u) ? n.remove(d) : (d ? ol(d, {shape: {points: u.ends}}, e, r) : d = IS(u), AS(d, t, r, a), n.add(d), t.setItemGraphicEl(r, d))
                        } else n.remove(d)
                    }).remove(function (e) {
                        var t = i.getItemGraphicEl(e);
                        t && n.remove(t)
                    }).execute(), this._data = t
                }, _renderLarge: function (e) {
                    this._clear(), xS(e, this.group);
                    var t = e.get("clip", !0) ? cv(e.coordinateSystem, !1, e) : null;
                    t ? this.group.setClipPath(t) : this.group.removeClipPath()
                }, _incrementalRenderNormal: function (e, t) {
                    for (var i, n = t.getData(), a = n.getLayout("isSimpleBox"); null != (i = e.next());) {
                        var o;
                        AS(o = IS(n.getItemLayout(i)), n, i, a), o.incremental = !0, this.group.add(o)
                    }
                }, _incrementalRenderLarge: function (e, t) {
                    xS(t, this.group, !0)
                }, remove: function (e) {
                    this._clear()
                }, _clear: function () {
                    this.group.removeAll(), this._data = null
                }, dispose: te
            }), wr.extend({
                type: "normalCandlestickBox", shape: {}, buildPath: function (e, t) {
                    var i = t.points;
                    this.__simpleBox ? (e.moveTo(i[4][0], i[4][1]), e.lineTo(i[6][0], i[6][1])) : (e.moveTo(i[0][0], i[0][1]), e.lineTo(i[1][0], i[1][1]), e.lineTo(i[2][0], i[2][1]), e.lineTo(i[3][0], i[3][1]), e.closePath(), e.moveTo(i[4][0], i[4][1]), e.lineTo(i[5][0], i[5][1]), e.moveTo(i[6][0], i[6][1]), e.lineTo(i[7][0], i[7][1]))
                }
            }));

        function IS(e, t, i) {
            var n = e.ends;
            return new bS({
                shape: {
                    points: i ? function (e, t) {
                        return D(e, function (e) {
                            return (e = e.slice())[1] = t.initBaseline, e
                        })
                    }(n, e) : n
                }, z2: 100
            })
        }

        function _S(e, t) {
            for (var i = !0, n = 0; n < t.ends.length; n++) if (e.contain(t.ends[n][0], t.ends[n][1])) {
                i = !1;
                break
            }
            return i
        }

        function AS(e, t, i, n) {
            var a = t.getItemModel(i), o = a.getModel(wS), r = t.getItemVisual(i, "color"),
                s = t.getItemVisual(i, "borderColor") || r, l = o.getItemStyle(SS);
            e.useStyle(l), e.style.strokeNoScale = !0, e.style.fill = r, e.style.stroke = s, e.__simpleBox = n, js(e, a.getModel(CS).getItemStyle())
        }

        var DS = wr.extend({
            type: "largeCandlestickBox", shape: {}, buildPath: function (e, t) {
                for (var i = t.points, n = 0; n < i.length;) if (this.__sign === i[n++]) {
                    var a = i[n++];
                    e.moveTo(a, i[n++]), e.lineTo(a, i[n++])
                } else n += 3
            }
        });

        function xS(e, t, i) {
            var n = e.getData(), a = n.getLayout("largePoints"), o = new DS({shape: {points: a}, __sign: 1});
            t.add(o);
            var r = new DS({shape: {points: a}, __sign: -1});
            t.add(r), NS(1, o, e, n), NS(-1, r, e, n), i && (o.incremental = !0, r.incremental = !0)
        }

        function NS(e, t, i, n) {
            var a = 0 < e ? "P" : "N", o = n.getVisual("borderColor" + a) || n.getVisual("color" + a),
                r = i.getModel(wS).getItemStyle(SS);
            t.useStyle(r), t.style.fill = null, t.style.stroke = o
        }

        var ES = ["itemStyle", "borderColor"], PS = ["itemStyle", "borderColor0"], MS = ["itemStyle", "color"],
            OS = ["itemStyle", "color0"], FS = {
                seriesType: "candlestick", plan: uc(), performRawSeries: !0, reset: function (e, t) {
                    if (e.getData().setVisual({
                        legendSymbol: "roundRect",
                        colorP: i(1, e),
                        colorN: i(-1, e),
                        borderColorP: n(1, e),
                        borderColorN: n(-1, e)
                    }), !t.isSeriesFiltered(e)) return !e.pipelineContext.large && {
                        progress: function (e, t) {
                            for (var a; null != (a = e.next());) {
                                var o = t.getItemModel(a), r = t.getItemLayout(a).sign;
                                t.setItemVisual(a, {color: i(r, o), borderColor: n(r, o)})
                            }
                        }
                    };

                    function i(e, t) {
                        return t.get(0 < e ? MS : OS)
                    }

                    function n(e, t) {
                        return t.get(0 < e ? ES : PS)
                    }
                }
            }, LS = "undefined" != typeof Float32Array ? Float32Array : Array, BS = {
                seriesType: "candlestick", plan: uc(), reset: function (e) {
                    var t = e.coordinateSystem, i = e.getData(), n = function (e, t) {
                            var i, n = e.getBaseAxis(),
                                a = "category" === n.type ? n.getBandWidth() : (i = n.getExtent(), Math.abs(i[1] - i[0]) / t.count()),
                                o = Nl(H(e.get("barMaxWidth"), a), a), r = Nl(H(e.get("barMinWidth"), 1), a),
                                s = e.get("barWidth");
                            return null != s ? Nl(s, a) : Math.max(Math.min(a / 2, o), r)
                        }(e, i), a = ["x", "y"], o = i.mapDimension(a[0]), r = i.mapDimension(a[1], !0), s = r[0], l = r[1],
                        d = r[2], u = r[3];
                    if (i.setLayout({
                        candleWidth: n,
                        isSimpleBox: n <= 1.3
                    }), !(null == o || r.length < 4)) return {
                        progress: e.pipelineContext.large ? function (e, i) {
                            for (var n, a, r = new LS(4 * e.count), c = 0, h = [], f = []; null != (a = e.next());) {
                                var g = i.get(o, a), p = i.get(s, a), v = i.get(l, a), m = i.get(d, a), y = i.get(u, a);
                                isNaN(g) || isNaN(m) || isNaN(y) ? (r[c++] = NaN, c += 3) : (r[c++] = US(i, a, p, v, l), h[0] = g, h[1] = m, n = t.dataToPoint(h, null, f), r[c++] = n ? n[0] : NaN, r[c++] = n ? n[1] : NaN, h[1] = y, n = t.dataToPoint(h, null, f), r[c++] = n ? n[1] : NaN)
                            }
                            i.setLayout("largePoints", r)
                        } : function (e, i) {
                            for (var a; null != (a = e.next());) {
                                var r = i.get(o, a), c = i.get(s, a), h = i.get(l, a), f = i.get(d, a), g = i.get(u, a),
                                    p = Math.min(c, h), v = Math.max(c, h), m = C(p, r), y = C(v, r), k = C(f, r),
                                    T = C(g, r), w = [];
                                S(w, y, 0), S(w, m, 1), w.push(I(T), I(y), I(k), I(m)), i.setItemLayout(a, {
                                    sign: US(i, a, c, h, l),
                                    initBaseline: h < c ? y[1] : m[1],
                                    ends: w,
                                    brushRect: b(f, g, r)
                                })
                            }

                            function C(e, i) {
                                var n = [];
                                return n[0] = i, n[1] = e, isNaN(i) || isNaN(e) ? [NaN, NaN] : t.dataToPoint(n)
                            }

                            function S(e, t, i) {
                                var a = t.slice(), o = t.slice();
                                a[0] = Es(a[0] + n / 2, 1, !1), o[0] = Es(o[0] - n / 2, 1, !0), i ? e.push(a, o) : e.push(o, a)
                            }

                            function b(e, t, i) {
                                var a = C(e, i), o = C(t, i);
                                return a[0] -= n / 2, o[0] -= n / 2, {x: a[0], y: a[1], width: n, height: o[1] - a[1]}
                            }

                            function I(e) {
                                return e[0] = Es(e[0], 1), e
                            }
                        }
                    }
                }
            };

        function US(e, t, i, n, a) {
            return n < i ? -1 : i < n ? 1 : 0 < t ? e.get(a, t - 1) <= n ? 1 : -1 : 1
        }

        function RS(e, t) {
            var i = t.rippleEffectColor || t.color;
            e.eachChild(function (e) {
                e.attr({
                    z: t.z,
                    zlevel: t.zlevel,
                    style: {stroke: "stroke" === t.brushType ? i : null, fill: "fill" === t.brushType ? i : null}
                })
            })
        }

        function KS(e, t) {
            Di.call(this);
            var i = new Op(e, t), n = new Di;
            this.add(i), this.add(n), n.beforeUpdate = function () {
                this.attr(i.getScale())
            }, this.updateData(e, t)
        }

        cf(function (e) {
            e && O(e.series) && A(e.series, function (e) {
                B(e) && "k" === e.type && (e.type = "candlestick")
            })
        }), vf(FS), pf(BS), ec.extend({
            type: "series.effectScatter",
            dependencies: ["grid", "polar"],
            getInitialData: function (e, t) {
                return rg(this.getSource(), this, {useEncodeDefaulter: !0})
            },
            brushSelector: "point",
            defaultOption: {
                coordinateSystem: "cartesian2d",
                zlevel: 0,
                z: 2,
                legendHoverLink: !0,
                effectType: "ripple",
                progressive: 0,
                showEffectOn: "render",
                rippleEffect: {period: 4, scale: 2.5, brushType: "fill"},
                symbolSize: 10
            }
        });
        var WS = KS.prototype;
        WS.stopEffectAnimation = function () {
            this.childAt(1).removeAll()
        }, WS.startEffectAnimation = function (e) {
            for (var t = e.symbolType, i = e.color, n = this.childAt(1), a = 0; a < 3; a++) {
                var o = cp(t, -1, -1, 2, 2, i);
                o.attr({style: {strokeNoScale: !0}, z2: 99, silent: !0, scale: [.5, .5]});
                var r = -a / 3 * e.period + e.effectOffset;
                o.animate("", !0).when(e.period, {scale: [e.rippleScale / 2, e.rippleScale / 2]}).delay(r).start(), o.animateStyle(!0).when(e.period, {opacity: 0}).delay(r).start(), n.add(o)
            }
            RS(n, e)
        }, WS.updateEffectAnimation = function (e) {
            for (var t = this._effectCfg, i = this.childAt(1), n = ["symbolType", "period", "rippleScale"], a = 0; a < n.length; a++) {
                var o = n[a];
                if (t[o] !== e[o]) return this.stopEffectAnimation(), void this.startEffectAnimation(e)
            }
            RS(i, e)
        }, WS.highlight = function () {
            this.trigger("emphasis")
        }, WS.downplay = function () {
            this.trigger("normal")
        }, WS.updateData = function (e, t) {
            var i = e.hostModel;
            this.childAt(0).updateData(e, t);
            var n = this.childAt(1), a = e.getItemModel(t), o = e.getItemVisual(t, "symbol"), r = function (e) {
                return O(e) || (e = [+e, +e]), e
            }(e.getItemVisual(t, "symbolSize")), s = e.getItemVisual(t, "color");
            n.attr("scale", r), n.traverse(function (e) {
                e.attr({fill: s})
            });
            var l = a.getShallow("symbolOffset");
            if (l) {
                var d = n.position;
                d[0] = Nl(l[0], r[0]), d[1] = Nl(l[1], r[1])
            }
            var u = e.getItemVisual(t, "symbolRotate");
            n.rotation = (u || 0) * Math.PI / 180 || 0;
            var c = {};
            if (c.showEffectOn = i.get("showEffectOn"), c.rippleScale = a.get("rippleEffect.scale"), c.brushType = a.get("rippleEffect.brushType"), c.period = 1e3 * a.get("rippleEffect.period"), c.effectOffset = t / e.count(), c.z = a.getShallow("z") || 0, c.zlevel = a.getShallow("zlevel") || 0, c.symbolType = o, c.color = s, c.rippleEffectColor = a.get("rippleEffect.color"), this.off("mouseover").off("mouseout").off("emphasis").off("normal"), "render" === c.showEffectOn) this._effectCfg ? this.updateEffectAnimation(c) : this.startEffectAnimation(c), this._effectCfg = c; else {
                this._effectCfg = null, this.stopEffectAnimation();
                var h = this.childAt(0), f = function () {
                    h.highlight(), "render" !== c.showEffectOn && this.startEffectAnimation(c)
                }, g = function () {
                    h.downplay(), "render" !== c.showEffectOn && this.stopEffectAnimation()
                };
                this.on("mouseover", f, this).on("mouseout", g, this).on("emphasis", f, this).on("normal", g, this)
            }
            this._effectCfg = c
        }, WS.fadeOut = function (e) {
            this.off("mouseover").off("mouseout").off("emphasis").off("normal"), e && e()
        }, b(KS, Di), Cf({
            type: "effectScatter", init: function () {
                this._symbolDraw = new zp(KS)
            }, render: function (e, t, i) {
                var n = e.getData(), a = this._symbolDraw;
                a.updateData(n), this.group.add(a.group)
            }, updateTransform: function (e, t, i) {
                var n = e.getData();
                this.group.dirty();
                var a = yv().reset(e);
                a.progress && a.progress({start: 0, end: n.count()}, n), this._symbolDraw.updateLayout(n)
            }, _updateGroupTransform: function (e) {
                var t = e.coordinateSystem;
                t && t.getRoamTransform && (this.group.transform = ft(t.getRoamTransform()), this.group.decomposeTransform())
            }, remove: function (e, t) {
                this._symbolDraw && this._symbolDraw.remove(t)
            }, dispose: function () {
            }
        }), vf(mv("effectScatter", "circle")), pf(yv("effectScatter"));
        var VS = "undefined" == typeof Uint32Array ? Array : Uint32Array,
            HS = "undefined" == typeof Float64Array ? Array : Float64Array;

        function zS(e) {
            var t = e.data;
            t && t[0] && t[0][0] && t[0][0].coord && (e.data = D(t, function (e) {
                var t = {coords: [e[0].coord, e[1].coord]};
                return e[0].name && (t.fromName = e[0].name), e[1].name && (t.toName = e[1].name), y([t, e[0], e[1]])
            }))
        }

        var jS = ec.extend({
            type: "series.lines",
            dependencies: ["grid", "polar"],
            visualColorAccessPath: "lineStyle.color",
            init: function (e) {
                e.data = e.data || [], zS(e);
                var t = this._processFlatCoordsArray(e.data);
                this._flatCoords = t.flatCoords, this._flatCoordsOffset = t.flatCoordsOffset, t.flatCoords && (e.data = new Float32Array(t.count)), jS.superApply(this, "init", arguments)
            },
            mergeOption: function (e) {
                if (e.data = e.data || [], zS(e), e.data) {
                    var t = this._processFlatCoordsArray(e.data);
                    this._flatCoords = t.flatCoords, this._flatCoordsOffset = t.flatCoordsOffset, t.flatCoords && (e.data = new Float32Array(t.count))
                }
                jS.superApply(this, "mergeOption", arguments)
            },
            appendData: function (e) {
                var t = this._processFlatCoordsArray(e.data);
                t.flatCoords && (this._flatCoords ? (this._flatCoords = ee(this._flatCoords, t.flatCoords), this._flatCoordsOffset = ee(this._flatCoordsOffset, t.flatCoordsOffset)) : (this._flatCoords = t.flatCoords, this._flatCoordsOffset = t.flatCoordsOffset), e.data = new Float32Array(t.count)), this.getRawData().appendData(e.data)
            },
            _getCoordsFromItemModel: function (e) {
                var t = this.getData().getItemModel(e);
                return t.option instanceof Array ? t.option : t.getShallow("coords")
            },
            getLineCoordsCount: function (e) {
                return this._flatCoordsOffset ? this._flatCoordsOffset[2 * e + 1] : this._getCoordsFromItemModel(e).length
            },
            getLineCoords: function (e, t) {
                if (this._flatCoordsOffset) {
                    for (var i = this._flatCoordsOffset[2 * e], n = this._flatCoordsOffset[2 * e + 1], a = 0; a < n; a++) t[a] = t[a] || [], t[a][0] = this._flatCoords[i + 2 * a], t[a][1] = this._flatCoords[i + 2 * a + 1];
                    return n
                }
                var o = this._getCoordsFromItemModel(e);
                for (a = 0; a < o.length; a++) t[a] = t[a] || [], t[a][0] = o[a][0], t[a][1] = o[a][1];
                return o.length
            },
            _processFlatCoordsArray: function (e) {
                var t = 0;
                if (this._flatCoords && (t = this._flatCoords.length), "number" != typeof e[0]) return {
                    flatCoordsOffset: null,
                    flatCoords: null,
                    count: e.length
                };
                for (var i = e.length, n = new VS(i), a = new HS(i), o = 0, r = 0, s = 0, l = 0; l < i;) {
                    s++;
                    var d = e[l++];
                    n[r++] = o + t, n[r++] = d;
                    for (var u = 0; u < d; u++) {
                        var c = e[l++], h = e[l++];
                        a[o++] = c, a[o++] = h
                    }
                }
                return {flatCoordsOffset: new Uint32Array(n.buffer, 0, r), flatCoords: a, count: s}
            },
            getInitialData: function (e, t) {
                var i = new Kf(["value"], this);
                return i.hasItemOption = !1, i.initData(e.data, [], function (e, t, n, a) {
                    if (e instanceof Array) return NaN;
                    i.hasItemOption = !0;
                    var o = e.value;
                    return null != o ? o instanceof Array ? o[a] : o : void 0
                }), i
            },
            formatTooltip: function (e) {
                var t = this.getData().getItemModel(e), i = t.get("name");
                if (i) return i;
                var n = t.get("fromName"), a = t.get("toName"), o = [];
                return null != n && o.push(n), null != a && o.push(a), Ql(o.join(" > "))
            },
            preventIncremental: function () {
                return !!this.get("effect.show")
            },
            getProgressive: function () {
                var e = this.option.progressive;
                return null == e ? this.option.large ? 1e4 : this.get("progressive") : e
            },
            getProgressiveThreshold: function () {
                var e = this.option.progressiveThreshold;
                return null == e ? this.option.large ? 2e4 : this.get("progressiveThreshold") : e
            },
            defaultOption: {
                coordinateSystem: "geo",
                zlevel: 0,
                z: 2,
                legendHoverLink: !0,
                hoverAnimation: !0,
                xAxisIndex: 0,
                yAxisIndex: 0,
                symbol: ["none", "none"],
                symbolSize: [10, 10],
                geoIndex: 0,
                effect: {
                    show: !1,
                    period: 4,
                    constantSpeed: 0,
                    symbol: "circle",
                    symbolSize: 3,
                    loop: !0,
                    trailLength: .2
                },
                large: !1,
                largeThreshold: 2e3,
                polyline: !1,
                clip: !0,
                label: {show: !1, position: "end"},
                lineStyle: {opacity: .5}
            }
        });

        function GS(e, t, i) {
            Di.call(this), this.add(this.createLine(e, t, i)), this._updateEffectSymbol(e, t)
        }

        var $S = GS.prototype;

        function XS(e, t, i) {
            Di.call(this), this._createPolyline(e, t, i)
        }

        $S.createLine = function (e, t, i) {
            return new jT(e, t, i)
        }, $S._updateEffectSymbol = function (e, t) {
            var i = e.getItemModel(t).getModel("effect"), n = i.get("symbolSize"), a = i.get("symbol");
            O(n) || (n = [n, n]);
            var o = i.get("color") || e.getItemVisual(t, "color"), r = this.childAt(1);
            this._symbolType !== a && (this.remove(r), (r = cp(a, -.5, -.5, 1, 1, o)).z2 = 100, r.culling = !0, this.add(r)), r && (r.setStyle("shadowColor", o), r.setStyle(i.getItemStyle(["color"])), r.attr("scale", n), r.setColor(o), r.attr("scale", n), this._symbolType = a, this._symbolScale = n, this._updateEffectAnimation(e, i, t))
        }, $S._updateEffectAnimation = function (e, t, i) {
            var n = this.childAt(1);
            if (n) {
                var a = this, o = e.getItemLayout(i), r = 1e3 * t.get("period"), s = t.get("loop"),
                    l = t.get("constantSpeed"), d = V(t.get("delay"), function (t) {
                        return t / e.count() * r / 3
                    }), u = "function" == typeof d;
                if (n.ignore = !0, this.updateAnimationPoints(n, o), 0 < l && (r = this.getLineLength(n) / l * 1e3), r !== this._period || s !== this._loop) {
                    n.stopAnimation();
                    var c = d;
                    u && (c = d(i)), 0 < n.__t && (c = -r * n.__t), n.__t = 0;
                    var h = n.animate("", s).when(r, {__t: 1}).delay(c).during(function () {
                        a.updateSymbolPosition(n)
                    });
                    s || h.done(function () {
                        a.remove(n)
                    }), h.start()
                }
                this._period = r, this._loop = s
            }
        }, $S.getLineLength = function (e) {
            return ye(e.__p1, e.__cp1) + ye(e.__cp1, e.__p2)
        }, $S.updateAnimationPoints = function (e, t) {
            e.__p1 = t[0], e.__p2 = t[1], e.__cp1 = t[2] || [(t[0][0] + t[1][0]) / 2, (t[0][1] + t[1][1]) / 2]
        }, $S.updateData = function (e, t, i) {
            this.childAt(0).updateData(e, t, i), this._updateEffectSymbol(e, t)
        }, $S.updateSymbolPosition = function (e) {
            var t = e.__p1, i = e.__p2, n = e.__cp1, a = e.__t, o = e.position, r = [o[0], o[1]], s = bo, l = Io;
            o[0] = s(t[0], n[0], i[0], a), o[1] = s(t[1], n[1], i[1], a);
            var d = l(t[0], n[0], i[0], a), u = l(t[1], n[1], i[1], a);
            if (e.rotation = -Math.atan2(u, d) - Math.PI / 2, "line" === this._symbolType || "rect" === this._symbolType || "roundRect" === this._symbolType) if (void 0 !== e.__lastT && e.__lastT < e.__t) {
                var c = 1.05 * ye(r, o);
                e.attr("scale", [e.scale[0], c]), 1 === a && (o[0] = r[0] + (o[0] - r[0]) / 2, o[1] = r[1] + (o[1] - r[1]) / 2)
            } else 1 === e.__lastT ? (c = 2 * ye(t, o), e.attr("scale", [e.scale[0], c])) : e.attr("scale", this._symbolScale);
            e.__lastT = e.__t, e.ignore = !1
        }, $S.updateLayout = function (e, t) {
            this.childAt(0).updateLayout(e, t);
            var i = e.getItemModel(t).getModel("effect");
            this._updateEffectAnimation(e, i, t)
        }, b(GS, Di);
        var qS = XS.prototype;

        function YS(e, t, i) {
            GS.call(this, e, t, i), this._lastFrame = 0, this._lastFramePercent = 0
        }

        qS._createPolyline = function (e, t, i) {
            var n = e.getItemLayout(t), a = new Xr({shape: {points: n}});
            this.add(a), this._updateCommonStl(e, t, i)
        }, qS.updateData = function (e, t, i) {
            var n = e.hostModel;
            ol(this.childAt(0), {shape: {points: e.getItemLayout(t)}}, n, t), this._updateCommonStl(e, t, i)
        }, qS._updateCommonStl = function (e, t, i) {
            var n = this.childAt(0), a = e.getItemModel(t), o = e.getItemVisual(t, "color"), r = i && i.lineStyle,
                s = i && i.hoverLineStyle;
            i && !e.hasItemOption || (r = a.getModel("lineStyle").getLineStyle(), s = a.getModel("emphasis.lineStyle").getLineStyle()), n.useStyle(T({
                strokeNoScale: !0,
                fill: "none",
                stroke: o
            }, r)), n.hoverStyle = s, js(this)
        }, qS.updateLayout = function (e, t) {
            this.childAt(0).setShape("points", e.getItemLayout(t))
        }, b(XS, Di);
        var JS = YS.prototype;
        JS.createLine = function (e, t, i) {
            return new XS(e, t, i)
        }, JS.updateAnimationPoints = function (e, t) {
            this._points = t;
            for (var i = [0], n = 0, a = 1; a < t.length; a++) {
                var o = t[a - 1], r = t[a];
                n += ye(o, r), i.push(n)
            }
            if (0 !== n) {
                for (a = 0; a < i.length; a++) i[a] /= n;
                this._offsets = i, this._length = n
            }
        }, JS.getLineLength = function (e) {
            return this._length
        }, JS.updateSymbolPosition = function (e) {
            var t = e.__t, i = this._points, n = this._offsets, a = i.length;
            if (n) {
                var o = this._lastFrame;
                if (t < this._lastFramePercent) {
                    for (r = Math.min(o + 1, a - 1); 0 <= r && !(n[r] <= t); r--) ;
                    r = Math.min(r, a - 2)
                } else {
                    for (var r = o; r < a && !(n[r] > t); r++) ;
                    r = Math.min(r - 1, a - 2)
                }
                we(e.position, i[r], i[r + 1], (t - n[r]) / (n[r + 1] - n[r]));
                var s = i[r + 1][0] - i[r][0], l = i[r + 1][1] - i[r][1];
                e.rotation = -Math.atan2(l, s) - Math.PI / 2, this._lastFrame = r, this._lastFramePercent = t, e.ignore = !1
            }
        }, b(YS, GS);
        var ZS = Ss({
            shape: {polyline: !1, curveness: 0, segs: []}, buildPath: function (e, t) {
                var i = t.segs, n = t.curveness;
                if (t.polyline) for (var a = 0; a < i.length;) {
                    var o = i[a++];
                    if (0 < o) {
                        e.moveTo(i[a++], i[a++]);
                        for (var r = 1; r < o; r++) e.lineTo(i[a++], i[a++])
                    }
                } else for (a = 0; a < i.length;) {
                    var s = i[a++], l = i[a++], d = i[a++], u = i[a++];
                    if (e.moveTo(s, l), 0 < n) {
                        var c = (s + d) / 2 - (l - u) * n, h = (l + u) / 2 - (d - s) * n;
                        e.quadraticCurveTo(c, h, d, u)
                    } else e.lineTo(d, u)
                }
            }, findDataIndex: function (e, t) {
                var i = this.shape, n = i.segs, a = i.curveness;
                if (i.polyline) for (var o = 0, r = 0; r < n.length;) {
                    var s = n[r++];
                    if (0 < s) for (var l = n[r++], d = n[r++], u = 1; u < s; u++) if (tr(l, d, c = n[r++], h = n[r++])) return o;
                    o++
                } else for (o = 0, r = 0; r < n.length;) {
                    l = n[r++], d = n[r++];
                    var c = n[r++], h = n[r++];
                    if (0 < a) {
                        if (nr(l, d, (l + c) / 2 - (d - h) * a, (d + h) / 2 - (c - l) * a, c, h)) return o
                    } else if (tr(l, d, c, h)) return o;
                    o++
                }
                return -1
            }
        });

        function QS() {
            this.group = new Di
        }

        var eb = QS.prototype;
        eb.isPersistent = function () {
            return !this._incremental
        }, eb.updateData = function (e) {
            this.group.removeAll();
            var t = new ZS({rectHover: !0, cursor: "default"});
            t.setShape({segs: e.getLayout("linesPoints")}), this._setCommon(t, e), this.group.add(t), this._incremental = null
        }, eb.incrementalPrepareUpdate = function (e) {
            this.group.removeAll(), this._clearIncremental(), 5e5 < e.count() ? (this._incremental || (this._incremental = new cs({silent: !0})), this.group.add(this._incremental)) : this._incremental = null
        }, eb.incrementalUpdate = function (e, t) {
            var i = new ZS;
            i.setShape({segs: t.getLayout("linesPoints")}), this._setCommon(i, t, !!this._incremental), this._incremental ? this._incremental.addDisplayable(i, !0) : (i.rectHover = !0, i.cursor = "default", i.__startIndex = e.start, this.group.add(i))
        }, eb.remove = function () {
            this._clearIncremental(), this._incremental = null, this.group.removeAll()
        }, eb._setCommon = function (e, t, i) {
            var n = t.hostModel;
            e.setShape({
                polyline: n.get("polyline"),
                curveness: n.get("lineStyle.curveness")
            }), e.useStyle(n.getModel("lineStyle").getLineStyle()), e.style.strokeNoScale = !0;
            var a = t.getVisual("color");
            a && e.setStyle("stroke", a), e.setStyle("fill"), i || (e.seriesIndex = n.seriesIndex, e.on("mousemove", function (t) {
                e.dataIndex = null;
                var i = e.findDataIndex(t.offsetX, t.offsetY);
                0 < i && (e.dataIndex = i + e.__startIndex)
            }))
        }, eb._clearIncremental = function () {
            var e = this._incremental;
            e && e.clearDisplaybles()
        };
        var tb = {
            seriesType: "lines", plan: uc(), reset: function (e) {
                var t = e.coordinateSystem, i = e.get("polyline"), n = e.pipelineContext.large;
                return {
                    progress: function (a, o) {
                        var r = [];
                        if (n) {
                            var s, l = a.end - a.start;
                            if (i) {
                                for (var d = 0, u = a.start; u < a.end; u++) d += e.getLineCoordsCount(u);
                                s = new Float32Array(l + 2 * d)
                            } else s = new Float32Array(4 * l);
                            var c = 0, h = [];
                            for (u = a.start; u < a.end; u++) {
                                var f = e.getLineCoords(u, r);
                                i && (s[c++] = f);
                                for (var g = 0; g < f; g++) h = t.dataToPoint(r[g], !1, h), s[c++] = h[0], s[c++] = h[1]
                            }
                            o.setLayout("linesPoints", s)
                        } else for (u = a.start; u < a.end; u++) {
                            var p = o.getItemModel(u), v = (f = e.getLineCoords(u, r), []);
                            if (i) for (var m = 0; m < f; m++) v.push(t.dataToPoint(r[m])); else {
                                v[0] = t.dataToPoint(r[0]), v[1] = t.dataToPoint(r[1]);
                                var y = p.get("lineStyle.curveness");
                                +y && (v[2] = [(v[0][0] + v[1][0]) / 2 - (v[0][1] - v[1][1]) * y, (v[0][1] + v[1][1]) / 2 - (v[1][0] - v[0][0]) * y])
                            }
                            o.setItemLayout(u, v)
                        }
                    }
                }
            }
        };

        function ib(e) {
            return e instanceof Array || (e = [e, e]), e
        }

        Cf({
            type: "lines", init: function () {
            }, render: function (e, t, i) {
                var n = e.getData(), a = this._updateLineDraw(n, e), o = e.get("zlevel"),
                    r = e.get("effect.trailLength"), s = i.getZr(), l = "svg" === s.painter.getType();
                l || s.painter.getLayer(o).clear(!0), null == this._lastZlevel || l || s.configLayer(this._lastZlevel, {motionBlur: !1}), this._showEffect(e) && r && (l || s.configLayer(o, {
                    motionBlur: !0,
                    lastFrameAlpha: Math.max(Math.min(r / 10 + .9, 1), 0)
                })), a.updateData(n);
                var d = e.get("clip", !0) && cv(e.coordinateSystem, !1, e);
                d ? this.group.setClipPath(d) : this.group.removeClipPath(), this._lastZlevel = o, this._finished = !0
            }, incrementalPrepareRender: function (e, t, i) {
                var n = e.getData();
                this._updateLineDraw(n, e).incrementalPrepareUpdate(n), this._clearLayer(i), this._finished = !1
            }, incrementalRender: function (e, t, i) {
                this._lineDraw.incrementalUpdate(e, t.getData()), this._finished = e.end === t.getData().count()
            }, updateTransform: function (e, t, i) {
                var n = e.getData(), a = e.pipelineContext;
                if (!this._finished || a.large || a.progressiveRender) return {update: !0};
                var o = tb.reset(e);
                o.progress && o.progress({
                    start: 0,
                    end: n.count()
                }, n), this._lineDraw.updateLayout(), this._clearLayer(i)
            }, _updateLineDraw: function (e, t) {
                var i = this._lineDraw, n = this._showEffect(t), a = !!t.get("polyline"), o = t.pipelineContext.large;
                return i && n === this._hasEffet && a === this._isPolyline && o === this._isLargeDraw || (i && i.remove(), i = this._lineDraw = o ? new QS : new $T(a ? n ? YS : XS : n ? GS : jT), this._hasEffet = n, this._isPolyline = a, this._isLargeDraw = o, this.group.removeAll()), this.group.add(i.group), i
            }, _showEffect: function (e) {
                return !!e.get("effect.show")
            }, _clearLayer: function (e) {
                var t = e.getZr();
                "svg" === t.painter.getType() || null == this._lastZlevel || t.painter.getLayer(this._lastZlevel).clear(!0)
            }, remove: function (e, t) {
                this._lineDraw && this._lineDraw.remove(), this._lineDraw = null, this._clearLayer(t)
            }, dispose: function () {
            }
        });
        var nb = "lineStyle.opacity".split("."), ab = {
            seriesType: "lines", reset: function (e, t, i) {
                var n = ib(e.get("symbol")), a = ib(e.get("symbolSize")), o = e.getData();
                return o.setVisual("fromSymbol", n && n[0]), o.setVisual("toSymbol", n && n[1]), o.setVisual("fromSymbolSize", a && a[0]), o.setVisual("toSymbolSize", a && a[1]), o.setVisual("opacity", e.get(nb)), {
                    dataEach: o.hasItemOption ? function (e, t) {
                        var i = e.getItemModel(t), n = ib(i.getShallow("symbol", !0)),
                            a = ib(i.getShallow("symbolSize", !0)), o = i.get(nb);
                        n[0] && e.setItemVisual(t, "fromSymbol", n[0]), n[1] && e.setItemVisual(t, "toSymbol", n[1]), a[0] && e.setItemVisual(t, "fromSymbolSize", a[0]), a[1] && e.setItemVisual(t, "toSymbolSize", a[1]), e.setItemVisual(t, "opacity", o)
                    } : null
                }
            }
        };

        function ob() {
            var e = w();
            this.canvas = e, this.blurSize = 30, this.pointSize = 20, this.maxOpacity = 1, this.minOpacity = 0, this._gradientPixels = {}
        }

        pf(tb), vf(ab), ec.extend({
            type: "series.heatmap",
            getInitialData: function (e, t) {
                return rg(this.getSource(), this, {generateCoord: "value"})
            },
            preventIncremental: function () {
                var e = iu.get(this.get("coordinateSystem"));
                if (e && e.dimensions) return "lng" === e.dimensions[0] && "lat" === e.dimensions[1]
            },
            defaultOption: {
                coordinateSystem: "cartesian2d",
                zlevel: 0,
                z: 2,
                geoIndex: 0,
                blurSize: 30,
                pointSize: 20,
                maxOpacity: 1,
                minOpacity: 0
            }
        }), ob.prototype = {
            update: function (e, t, i, n, a, o) {
                var r = this._getBrush(), s = this._getGradient(e, a, "inRange"),
                    l = this._getGradient(e, a, "outOfRange"), d = this.pointSize + this.blurSize, u = this.canvas,
                    c = u.getContext("2d"), h = e.length;
                u.width = t, u.height = i;
                for (var f = 0; f < h; ++f) {
                    var g = e[f], p = g[0], v = g[1], m = n(g[2]);
                    c.globalAlpha = m, c.drawImage(r, p - d, v - d)
                }
                if (!u.width || !u.height) return u;
                for (var y = c.getImageData(0, 0, u.width, u.height), k = y.data, T = 0, w = k.length, C = this.minOpacity, S = this.maxOpacity - C; T < w;) {
                    m = k[T + 3] / 256;
                    var b = 4 * Math.floor(255 * m);
                    if (0 < m) {
                        var I = o(m) ? s : l;
                        0 < m && (m = m * S + C), k[T++] = I[b], k[T++] = I[1 + b], k[T++] = I[2 + b], k[T++] = I[3 + b] * m * 256
                    } else T += 4
                }
                return c.putImageData(y, 0, 0), u
            }, _getBrush: function () {
                var e = this._brushCanvas || (this._brushCanvas = w()), t = this.pointSize + this.blurSize, i = 2 * t;
                e.width = i, e.height = i;
                var n = e.getContext("2d");
                return n.clearRect(0, 0, i, i), n.shadowOffsetX = i, n.shadowBlur = this.blurSize, n.shadowColor = "#000", n.beginPath(), n.arc(-t, t, this.pointSize, 0, 2 * Math.PI, !0), n.closePath(), n.fill(), e
            }, _getGradient: function (e, t, i) {
                for (var n = this._gradientPixels, a = n[i] || (n[i] = new Uint8ClampedArray(1024)), o = [0, 0, 0, 0], r = 0, s = 0; s < 256; s++) t[i](s / 255, !0, o), a[r++] = o[0], a[r++] = o[1], a[r++] = o[2], a[r++] = o[3];
                return a
            }
        }, Cf({
            type: "heatmap", render: function (e, t, i) {
                var n;
                t.eachComponent("visualMap", function (t) {
                    t.eachTargetSeries(function (i) {
                        i === e && (n = t)
                    })
                }), this.group.removeAll(), this._incrementalDisplayable = null;
                var a = e.coordinateSystem;
                "cartesian2d" === a.type || "calendar" === a.type ? this._renderOnCartesianAndCalendar(e, i, 0, e.getData().count()) : function (e) {
                    var t = e.dimensions;
                    return "lng" === t[0] && "lat" === t[1]
                }(a) && this._renderOnGeo(a, e, n, i)
            }, incrementalPrepareRender: function (e, t, i) {
                this.group.removeAll()
            }, incrementalRender: function (e, t, i, n) {
                t.coordinateSystem && this._renderOnCartesianAndCalendar(t, n, e.start, e.end, !0)
            }, _renderOnCartesianAndCalendar: function (e, t, i, n, a) {
                var o, r, s = e.coordinateSystem;
                if ("cartesian2d" === s.type) {
                    var l = s.getAxis("x"), d = s.getAxis("y");
                    o = l.getBandWidth(), r = d.getBandWidth()
                }
                for (var u = this.group, c = e.getData(), h = "emphasis.itemStyle", f = "emphasis.label", g = e.getModel("itemStyle").getItemStyle(["color"]), p = e.getModel(h).getItemStyle(), v = e.getModel("label"), m = e.getModel(f), y = s.type, T = "cartesian2d" === y ? [c.mapDimension("x"), c.mapDimension("y"), c.mapDimension("value")] : [c.mapDimension("time"), c.mapDimension("value")], w = i; w < n; w++) {
                    var C;
                    if ("cartesian2d" === y) {
                        if (isNaN(c.get(T[2], w))) continue;
                        var S = s.dataToPoint([c.get(T[0], w), c.get(T[1], w)]);
                        C = new es({
                            shape: {
                                x: Math.floor(Math.round(S[0]) - o / 2),
                                y: Math.floor(Math.round(S[1]) - r / 2),
                                width: Math.ceil(o),
                                height: Math.ceil(r)
                            }, style: {fill: c.getItemVisual(w, "color"), opacity: c.getItemVisual(w, "opacity")}
                        })
                    } else {
                        if (isNaN(c.get(T[1], w))) continue;
                        C = new es({
                            z2: 1,
                            shape: s.dataToRect([c.get(T[0], w)]).contentShape,
                            style: {fill: c.getItemVisual(w, "color"), opacity: c.getItemVisual(w, "opacity")}
                        })
                    }
                    var b = c.getItemModel(w);
                    c.hasItemOption && (g = b.getModel("itemStyle").getItemStyle(["color"]), p = b.getModel(h).getItemStyle(), v = b.getModel("label"), m = b.getModel(f));
                    var I = e.getRawValue(w), _ = "-";
                    I && null != I[2] && (_ = I[2]), qs(g, p, v, m, {
                        labelFetcher: e,
                        labelDataIndex: w,
                        defaultText: _,
                        isRectText: !0
                    }), C.setStyle(g), js(C, c.hasItemOption ? p : k({}, p)), (C.incremental = a) && (C.useHoverLayer = !0), u.add(C), c.setItemGraphicEl(w, C)
                }
            }, _renderOnGeo: function (e, t, i, n) {
                var a = i.targetVisuals.inRange, o = i.targetVisuals.outOfRange, r = t.getData(),
                    s = this._hmLayer || this._hmLayer || new ob;
                s.blurSize = t.get("blurSize"), s.pointSize = t.get("pointSize"), s.minOpacity = t.get("minOpacity"), s.maxOpacity = t.get("maxOpacity");
                var l = e.getViewRect().clone(), d = e.getRoamTransform();
                l.applyTransform(d);
                var u = Math.max(l.x, 0), c = Math.max(l.y, 0), h = Math.min(l.width + l.x, n.getWidth()),
                    f = Math.min(l.height + l.y, n.getHeight()), g = h - u, p = f - c,
                    v = [r.mapDimension("lng"), r.mapDimension("lat"), r.mapDimension("value")],
                    m = r.mapArray(v, function (t, i, n) {
                        var a = e.dataToPoint([t, i]);
                        return a[0] -= u, a[1] -= c, a.push(n), a
                    }), y = i.getExtent(), k = "visualMap.continuous" === i.type ? function (e, t) {
                        var i = e[1] - e[0];
                        return t = [(t[0] - e[0]) / i, (t[1] - e[0]) / i], function (e) {
                            return e >= t[0] && e <= t[1]
                        }
                    }(y, i.option.range) : function (e, t, i) {
                        var n = e[1] - e[0], a = (t = D(t, function (t) {
                            return {interval: [(t.interval[0] - e[0]) / n, (t.interval[1] - e[0]) / n]}
                        })).length, o = 0;
                        return function (e) {
                            for (var n = o; n < a; n++) if ((r = t[n].interval)[0] <= e && e <= r[1]) {
                                o = n;
                                break
                            }
                            if (n === a) for (n = o - 1; 0 <= n; n--) {
                                var r;
                                if ((r = t[n].interval)[0] <= e && e <= r[1]) {
                                    o = n;
                                    break
                                }
                            }
                            return 0 <= n && n < a && i[n]
                        }
                    }(y, i.getPieceList(), i.option.selected);
                s.update(m, g, p, a.color.getNormalizer(), {
                    inRange: a.color.getColorMapper(),
                    outOfRange: o.color.getColorMapper()
                }, k);
                var T = new qn({style: {width: g, height: p, x: u, y: c, image: s.canvas}, silent: !0});
                this.group.add(T)
            }, dispose: function () {
            }
        });
        var rb = hm.extend({
            type: "series.pictorialBar",
            dependencies: ["grid"],
            defaultOption: {
                symbol: "circle",
                symbolSize: null,
                symbolRotate: null,
                symbolPosition: null,
                symbolOffset: null,
                symbolMargin: null,
                symbolRepeat: !1,
                symbolRepeatDirection: "end",
                symbolClip: !1,
                symbolBoundingData: null,
                symbolPatternSize: 400,
                barGap: "-100%",
                progressive: 0,
                hoverAnimation: !1
            },
            getInitialData: function (e) {
                return e.stack = null, rb.superApply(this, "getInitialData", arguments)
            }
        }), sb = ["itemStyle", "borderWidth"], lb = [{xy: "x", wh: "width", index: 0, posDesc: ["left", "right"]}, {
            xy: "y",
            wh: "height",
            index: 1,
            posDesc: ["top", "bottom"]
        }], db = new Wr;

        function ub(e, t, i, n) {
            var a = e.getItemLayout(t), o = i.get("symbolRepeat"), r = i.get("symbolClip"),
                s = i.get("symbolPosition") || "start", l = (i.get("symbolRotate") || 0) * Math.PI / 180 || 0,
                d = i.get("symbolPatternSize") || 2, u = i.isAnimationEnabled(), c = {
                    dataIndex: t,
                    layout: a,
                    itemModel: i,
                    symbolType: e.getItemVisual(t, "symbol") || "circle",
                    color: e.getItemVisual(t, "color"),
                    symbolClip: r,
                    symbolRepeat: o,
                    symbolRepeatDirection: i.get("symbolRepeatDirection"),
                    symbolPatternSize: d,
                    rotation: l,
                    animationModel: u ? i : null,
                    hoverAnimation: u && i.get("hoverAnimation"),
                    z2: i.getShallow("z", !0) || 0
                };
            !function (e, t, i, n, a) {
                var o, r = n.valueDim, s = e.get("symbolBoundingData"),
                    l = n.coordSys.getOtherAxis(n.coordSys.getBaseAxis()), d = l.toGlobalCoord(l.dataToCoord(0)),
                    u = 1 - +(i[r.wh] <= 0);
                if (O(s)) {
                    var c = [cb(l, s[0]) - d, cb(l, s[1]) - d];
                    c[1] < c[0] && c.reverse(), o = c[u]
                } else o = null != s ? cb(l, s) - d : t ? n.coordSysExtent[r.index][u] - d : i[r.wh];
                a.boundingLength = o, t && (a.repeatCutLength = i[r.wh]), a.pxSign = 0 < o ? 1 : o < 0 ? -1 : 0
            }(i, o, a, n, c), function (e, t, i, n, a, o, r, s, l, d) {
                var u = l.valueDim, c = l.categoryDim, h = Math.abs(i[c.wh]), f = e.getItemVisual(t, "symbolSize");
                (f = O(f) ? f.slice() : (null == f && (f = "100%"), [f, f]))[c.index] = Nl(f[c.index], h), f[u.index] = Nl(f[u.index], n ? h : Math.abs(o)), d.symbolSize = f, (d.symbolScale = [f[0] / s, f[1] / s])[u.index] *= (l.isHorizontal ? -1 : 1) * r
            }(e, t, a, o, 0, c.boundingLength, c.pxSign, d, n, c), function (e, t, i, n, a) {
                var o = e.get(sb) || 0;
                o && (db.attr({
                    scale: t.slice(),
                    rotation: i
                }), db.updateTransform(), o /= db.getLineScale(), o *= t[n.valueDim.index]), a.valueLineWidth = o
            }(i, c.symbolScale, l, n, c);
            var h = c.symbolSize, f = i.get("symbolOffset");
            return O(f) && (f = [Nl(f[0], h[0]), Nl(f[1], h[1])]), function (e, t, i, n, a, o, r, s, l, d, u, c) {
                var h = u.categoryDim, f = u.valueDim, g = c.pxSign, p = Math.max(t[f.index] + s, 0), v = p;
                if (n) {
                    var m = Math.abs(l), y = V(e.get("symbolMargin"), "15%") + "", T = !1;
                    y.lastIndexOf("!") === y.length - 1 && (T = !0, y = y.slice(0, y.length - 1)), y = Nl(y, t[f.index]);
                    var w = Math.max(p + 2 * y, 0), C = T ? 0 : 2 * y, S = Gl(n), b = S ? n : Ab((m + C) / w);
                    w = p + 2 * (y = (m - b * p) / 2 / (T ? b : b - 1)), C = T ? 0 : 2 * y, S || "fixed" === n || (b = d ? Ab((Math.abs(d) + C) / w) : 0), v = b * w - C, c.repeatTimes = b, c.symbolMargin = y
                }
                var I = g * (v / 2), _ = c.pathPosition = [];
                _[h.index] = i[h.wh] / 2, _[f.index] = "start" === r ? I : "end" === r ? l - I : l / 2, o && (_[0] += o[0], _[1] += o[1]);
                var A = c.bundlePosition = [];
                A[h.index] = i[h.xy], A[f.index] = i[f.xy];
                var D = c.barRectShape = k({}, i);
                D[f.wh] = g * Math.max(Math.abs(i[f.wh]), Math.abs(_[f.index] + I)), D[h.wh] = i[h.wh];
                var x = c.clipShape = {};
                x[h.xy] = -i[h.xy], x[h.wh] = u.ecSize[h.wh], x[f.xy] = 0, x[f.wh] = i[f.wh]
            }(i, h, a, o, 0, f, s, c.valueLineWidth, c.boundingLength, c.repeatCutLength, n, c), c
        }

        function cb(e, t) {
            return e.toGlobalCoord(e.dataToCoord(e.scale.parse(t)))
        }

        function hb(e) {
            var t = e.symbolPatternSize, i = cp(e.symbolType, -t / 2, -t / 2, t, t, e.color);
            return i.attr({culling: !0}), "image" !== i.type && i.setStyle({strokeNoScale: !0}), i
        }

        function fb(e, t, i, n) {
            var a = e.__pictorialBundle, o = i.symbolSize, r = i.valueLineWidth, s = i.pathPosition, l = t.valueDim,
                d = i.repeatTimes || 0, u = 0, c = o[t.valueDim.index] + r + 2 * i.symbolMargin;
            for (bb(e, function (e) {
                e.__pictorialAnimationIndex = u, e.__pictorialRepeatTimes = d, u < d ? Ib(e, null, g(u), i, n) : Ib(e, null, {scale: [0, 0]}, i, n, function () {
                    a.remove(e)
                }), Tb(e, i), u++
            }); u < d; u++) {
                var h = hb(i);
                h.__pictorialAnimationIndex = u, h.__pictorialRepeatTimes = d, a.add(h);
                var f = g(u);
                Ib(h, {position: f.position, scale: [0, 0]}, {
                    scale: f.scale,
                    rotation: f.rotation
                }, i, n), h.on("mouseover", p).on("mouseout", v), Tb(h, i)
            }

            function g(e) {
                var t = s.slice(), n = i.pxSign, a = e;
                return ("start" === i.symbolRepeatDirection ? 0 < n : n < 0) && (a = d - 1 - e), t[l.index] = c * (a - d / 2 + .5) + s[l.index], {
                    position: t,
                    scale: i.symbolScale.slice(),
                    rotation: i.rotation
                }
            }

            function p() {
                bb(e, function (e) {
                    e.trigger("emphasis")
                })
            }

            function v() {
                bb(e, function (e) {
                    e.trigger("normal")
                })
            }
        }

        function gb(e, t, i, n) {
            var a = e.__pictorialBundle, o = e.__pictorialMainPath;
            o ? Ib(o, null, {
                position: i.pathPosition.slice(),
                scale: i.symbolScale.slice(),
                rotation: i.rotation
            }, i, n) : (o = e.__pictorialMainPath = hb(i), a.add(o), Ib(o, {
                position: i.pathPosition.slice(),
                scale: [0, 0],
                rotation: i.rotation
            }, {scale: i.symbolScale.slice()}, i, n), o.on("mouseover", function () {
                this.trigger("emphasis")
            }).on("mouseout", function () {
                this.trigger("normal")
            })), Tb(o, i)
        }

        function pb(e, t, i) {
            var n = k({}, t.barRectShape), a = e.__pictorialBarRect;
            a ? Ib(a, null, {shape: n}, t, i) : (a = e.__pictorialBarRect = new es({
                z2: 2,
                shape: n,
                silent: !0,
                style: {stroke: "transparent", fill: "transparent", lineWidth: 0}
            }), e.add(a))
        }

        function vb(e, t, i, n) {
            if (i.symbolClip) {
                var a = e.__pictorialClipPath, o = k({}, i.clipShape), r = t.valueDim, s = i.animationModel,
                    l = i.dataIndex;
                if (a) ol(a, {shape: o}, s, l); else {
                    o[r.wh] = 0, a = new es({shape: o}), e.__pictorialBundle.setClipPath(a), e.__pictorialClipPath = a;
                    var d = {};
                    d[r.wh] = i.clipShape[r.wh], vl[n ? "updateProps" : "initProps"](a, {shape: d}, s, l)
                }
            }
        }

        function mb(e, t) {
            var i = e.getItemModel(t);
            return i.getAnimationDelayParams = yb, i.isAnimationEnabled = kb, i
        }

        function yb(e) {
            return {index: e.__pictorialAnimationIndex, count: e.__pictorialRepeatTimes}
        }

        function kb() {
            return this.parentModel.isAnimationEnabled() && !!this.getShallow("animation")
        }

        function Tb(e, t) {
            e.off("emphasis").off("normal");
            var i = t.symbolScale.slice();
            t.hoverAnimation && e.on("emphasis", function () {
                this.animateTo({scale: [1.1 * i[0], 1.1 * i[1]]}, 400, "elasticOut")
            }).on("normal", function () {
                this.animateTo({scale: i.slice()}, 400, "elasticOut")
            })
        }

        function wb(e, t, i, n) {
            var a = new Di, o = new Di;
            return a.add(o), (a.__pictorialBundle = o).attr("position", i.bundlePosition.slice()), i.symbolRepeat ? fb(a, t, i) : gb(a, 0, i), pb(a, i, n), vb(a, t, i, n), a.__pictorialShapeStr = Sb(e, i), a.__pictorialSymbolMeta = i, a
        }

        function Cb(e, t, i, n) {
            var a = n.__pictorialBarRect;
            a && (a.style.text = null);
            var o = [];
            bb(n, function (e) {
                o.push(e)
            }), n.__pictorialMainPath && o.push(n.__pictorialMainPath), n.__pictorialClipPath && (i = null), A(o, function (e) {
                ol(e, {scale: [0, 0]}, i, t, function () {
                    n.parent && n.parent.remove(n)
                })
            }), e.setItemGraphicEl(t, null)
        }

        function Sb(e, t) {
            return [e.getItemVisual(t.dataIndex, "symbol") || "none", !!t.symbolRepeat, !!t.symbolClip].join(":")
        }

        function bb(e, t, i) {
            A(e.__pictorialBundle.children(), function (n) {
                n !== e.__pictorialBarRect && t.call(i, n)
            })
        }

        function Ib(e, t, i, n, a, o) {
            t && e.attr(t), n.symbolClip && !a ? i && e.attr(i) : i && vl[a ? "updateProps" : "initProps"](e, i, n.animationModel, n.dataIndex, o)
        }

        function _b(e, t, i) {
            var n = i.color, a = i.dataIndex, o = i.itemModel, r = o.getModel("itemStyle").getItemStyle(["color"]),
                s = o.getModel("emphasis.itemStyle").getItemStyle(), l = o.getShallow("cursor");
            bb(e, function (e) {
                e.setColor(n), e.setStyle(T({
                    fill: n,
                    opacity: i.opacity
                }, r)), js(e, s), l && (e.cursor = l), e.z2 = i.z2
            });
            var d = {}, u = (t.valueDim.posDesc[+(0 < i.boundingLength)], e.__pictorialBarRect);
            fm(u.style, d, o, n, t.seriesModel, a), js(u, d)
        }

        function Ab(e) {
            var t = Math.round(e);
            return Math.abs(e - t) < 1e-4 ? t : Math.ceil(e)
        }

        function Db(e, t, i, n, a) {
            Dp.call(this, e, t, i), this.type = n || "value", this.position = a || "bottom", this.orient = null
        }

        function xb(e, t, i) {
            this.dimension = "single", this.dimensions = ["single"], this._axis = null, this._rect, this._init(e, t, i), this.model = e
        }

        function Nb(e, t) {
            t = t || {};
            var i = e.coordinateSystem, n = e.axis, a = {}, o = n.position, r = n.orient, s = i.getRect(),
                l = [s.x, s.x + s.width, s.y, s.y + s.height],
                d = {horizontal: {top: l[2], bottom: l[3]}, vertical: {left: l[0], right: l[1]}};
            a.position = ["vertical" === r ? d.vertical[o] : l[0], "horizontal" === r ? d.horizontal[o] : l[3]], a.rotation = Math.PI / 2 * {
                horizontal: 0,
                vertical: 1
            }[r], a.labelDirection = a.tickDirection = a.nameDirection = {
                top: -1,
                bottom: 1,
                right: 1,
                left: -1
            }[o], e.get("axisTick.inside") && (a.tickDirection = -a.tickDirection), V(t.labelInside, e.get("axisLabel.inside")) && (a.labelDirection = -a.labelDirection);
            var u = t.rotate;
            return null == u && (u = e.get("axisLabel.rotate")), a.labelRotation = "top" === o ? -u : u, a.z2 = 1, a
        }

        Cf({
            type: "pictorialBar", render: function (e, t, i) {
                var n = this.group, a = e.getData(), o = this._data, r = e.coordinateSystem,
                    s = !!r.getBaseAxis().isHorizontal(), l = r.grid.getRect(), d = {
                        ecSize: {width: i.getWidth(), height: i.getHeight()},
                        seriesModel: e,
                        coordSys: r,
                        coordSysExtent: [[l.x, l.x + l.width], [l.y, l.y + l.height]],
                        isHorizontal: s,
                        valueDim: lb[+s],
                        categoryDim: lb[1 - s]
                    };
                return a.diff(o).add(function (e) {
                    if (a.hasValue(e)) {
                        var t = mb(a, e), i = ub(a, e, t, d), o = wb(a, d, i);
                        a.setItemGraphicEl(e, o), n.add(o), _b(o, d, i)
                    }
                }).update(function (e, t) {
                    var i = o.getItemGraphicEl(t);
                    if (a.hasValue(e)) {
                        var r = mb(a, e), s = ub(a, e, r, d), l = Sb(a, s);
                        i && l !== i.__pictorialShapeStr && (n.remove(i), a.setItemGraphicEl(e, null), i = null), i ? function (e, t, i) {
                            var n = i.animationModel, a = i.dataIndex;
                            ol(e.__pictorialBundle, {position: i.bundlePosition.slice()}, n, a), i.symbolRepeat ? fb(e, t, i, !0) : gb(e, 0, i, !0), pb(e, i, !0), vb(e, t, i, !0)
                        }(i, d, s) : i = wb(a, d, s, !0), a.setItemGraphicEl(e, i), i.__pictorialSymbolMeta = s, n.add(i), _b(i, d, s)
                    } else n.remove(i)
                }).remove(function (e) {
                    var t = o.getItemGraphicEl(e);
                    t && Cb(o, e, t.__pictorialSymbolMeta.animationModel, t)
                }).execute(), this._data = a, this.group
            }, dispose: te, remove: function (e, t) {
                var i = this.group, n = this._data;
                e.get("animation") ? n && n.eachItemGraphicEl(function (t) {
                    Cb(n, t.dataIndex, e, t)
                }) : i.removeAll()
            }
        }), pf(M(Dg, "pictorialBar")), vf(mv("pictorialBar", "roundRect")), Db.prototype = {
            constructor: Db,
            model: null,
            isHorizontal: function () {
                var e = this.position;
                return "top" === e || "bottom" === e
            },
            pointToData: function (e, t) {
                return this.coordinateSystem.pointToData(e, t)[0]
            },
            toGlobalCoord: null,
            toLocalCoord: null
        }, b(Db, Dp), iu.register("single", {
            create: function (e, t) {
                var i = [];
                return e.eachComponent("singleAxis", function (n, a) {
                    var o = new xb(n, e, t);
                    o.name = "single_" + a, o.resize(n, t), n.coordinateSystem = o, i.push(o)
                }), e.eachSeries(function (t) {
                    if ("singleAxis" === t.get("coordinateSystem")) {
                        var i = e.queryComponents({
                            mainType: "singleAxis",
                            index: t.get("singleAxisIndex"),
                            id: t.get("singleAxisId")
                        })[0];
                        t.coordinateSystem = i && i.coordinateSystem
                    }
                }), i
            },
            dimensions: (xb.prototype = {
                type: "singleAxis",
                axisPointerEnabled: !0,
                constructor: xb,
                _init: function (e, t, i) {
                    var n = this.dimension, a = new Db(n, Jg(e), [0, 0], e.get("type"), e.get("position")),
                        o = "category" === a.type;
                    a.onBand = o && e.get("boundaryGap"), a.inverse = e.get("inverse"), a.orient = e.get("orient"), (e.axis = a).model = e, (a.coordinateSystem = this)._axis = a
                },
                update: function (e, t) {
                    e.eachSeries(function (e) {
                        if (e.coordinateSystem === this) {
                            var t = e.getData();
                            A(t.mapDimension(this.dimension, !0), function (e) {
                                this._axis.scale.unionExtentFromData(t, e)
                            }, this), Yg(this._axis.scale, this._axis.model)
                        }
                    }, this)
                },
                resize: function (e, t) {
                    this._rect = vd({
                        left: e.get("left"),
                        top: e.get("top"),
                        right: e.get("right"),
                        bottom: e.get("bottom"),
                        width: e.get("width"),
                        height: e.get("height")
                    }, {width: t.getWidth(), height: t.getHeight()}), this._adjustAxis()
                },
                getRect: function () {
                    return this._rect
                },
                _adjustAxis: function () {
                    var e = this._rect, t = this._axis, i = t.isHorizontal(), n = i ? [0, e.width] : [0, e.height],
                        a = t.reverse ? 1 : 0;
                    t.setExtent(n[a], n[1 - a]), this._updateAxisTransform(t, i ? e.x : e.y)
                },
                _updateAxisTransform: function (e, t) {
                    var i = e.getExtent(), n = i[0] + i[1], a = e.isHorizontal();
                    e.toGlobalCoord = a ? function (e) {
                        return e + t
                    } : function (e) {
                        return n - e + t
                    }, e.toLocalCoord = a ? function (e) {
                        return e - t
                    } : function (e) {
                        return n - e + t
                    }
                },
                getAxis: function () {
                    return this._axis
                },
                getBaseAxis: function () {
                    return this._axis
                },
                getAxes: function () {
                    return [this._axis]
                },
                getTooltipAxes: function () {
                    return {baseAxes: [this.getAxis()]}
                },
                containPoint: function (e) {
                    var t = this.getRect(), i = this.getAxis();
                    return "horizontal" === i.orient ? i.contain(i.toLocalCoord(e[0])) && e[1] >= t.y && e[1] <= t.y + t.height : i.contain(i.toLocalCoord(e[1])) && e[0] >= t.y && e[0] <= t.y + t.height
                },
                pointToData: function (e) {
                    var t = this.getAxis();
                    return [t.coordToData(t.toLocalCoord(e["horizontal" === t.orient ? 0 : 1]))]
                },
                dataToPoint: function (e) {
                    var t = this.getAxis(), i = this.getRect(), n = [], a = "horizontal" === t.orient ? 0 : 1;
                    return e instanceof Array && (e = e[0]), n[a] = t.toGlobalCoord(t.dataToCoord(+e)), n[1 - a] = 0 == a ? i.y + i.height / 2 : i.x + i.width / 2, n
                }
            }).dimensions
        });
        var Eb = ["axisLine", "axisTickLabel", "axisName"], Pb = ["splitArea", "splitLine"], Mb = im.extend({
            type: "singleAxis", axisPointerClass: "SingleAxisPointer", render: function (e, t, i, n) {
                var a = this.group;
                a.removeAll();
                var o = this._axisGroup;
                this._axisGroup = new Di;
                var r = Nb(e), s = new Kv(e, r);
                A(Eb, s.add, s), a.add(this._axisGroup), a.add(s.getGroup()), A(Pb, function (t) {
                    e.get(t + ".show") && this["_" + t](e)
                }, this), ul(o, this._axisGroup, e), Mb.superCall(this, "render", e, t, i, n)
            }, remove: function () {
                lm(this)
            }, _splitLine: function (e) {
                var t = e.axis;
                if (!t.scale.isBlank()) {
                    var i = e.getModel("splitLine"), n = i.getModel("lineStyle"), a = n.get("width"),
                        o = n.get("color");
                    o = o instanceof Array ? o : [o];
                    for (var r = e.coordinateSystem.getRect(), s = t.isHorizontal(), l = [], d = 0, u = t.getTicksCoords({tickModel: i}), c = [], h = [], f = 0; f < u.length; ++f) {
                        var g = t.toGlobalCoord(u[f].coord);
                        s ? (c[0] = g, c[1] = r.y, h[0] = g, h[1] = r.y + r.height) : (c[0] = r.x, c[1] = g, h[0] = r.x + r.width, h[1] = g);
                        var p = d++ % o.length;
                        l[p] = l[p] || [], l[p].push(new is({
                            subPixelOptimize: !0,
                            shape: {x1: c[0], y1: c[1], x2: h[0], y2: h[1]},
                            style: {lineWidth: a},
                            silent: !0
                        }))
                    }
                    for (f = 0; f < l.length; ++f) this.group.add(xs(l[f], {
                        style: {
                            stroke: o[f % o.length],
                            lineDash: n.getLineDash(a),
                            lineWidth: a
                        }, silent: !0
                    }))
                }
            }, _splitArea: function (e) {
                sm(this, this._axisGroup, e, e)
            }
        }), Ob = Id.extend({
            type: "singleAxis",
            layoutMode: "box",
            axis: null,
            coordinateSystem: null,
            getCoordSysModel: function () {
                return this
            }
        });

        function Fb(e, t) {
            var i, n = [], a = e.seriesIndex;
            if (null == a || !(i = t.getSeriesByIndex(a))) return {point: []};
            var o = i.getData(), r = Ka(o, e);
            if (null == r || r < 0 || O(r)) return {point: []};
            var s = o.getItemGraphicEl(r), l = i.coordinateSystem;
            if (i.getTooltipPosition) n = i.getTooltipPosition(r) || []; else if (l && l.dataToPoint) n = l.dataToPoint(o.getValues(D(l.dimensions, function (e) {
                return o.mapDimension(e)
            }), r, !0)) || []; else if (s) {
                var d = s.getBoundingRect().clone();
                d.applyTransform(s.transform), n = [d.x + d.width / 2, d.y + d.height / 2]
            }
            return {point: n, el: s}
        }

        m(Ob.prototype, ip), Av("single", Ob, function (e, t) {
            return t.type || (t.data ? "category" : "value")
        }, {
            left: "5%",
            top: "5%",
            right: "5%",
            bottom: "5%",
            type: "value",
            position: "bottom",
            orient: "horizontal",
            axisLine: {show: !0, lineStyle: {width: 1, type: "solid"}},
            tooltip: {show: !0},
            axisTick: {show: !0, length: 6, lineStyle: {width: 1}},
            axisLabel: {show: !0, interval: "auto"},
            splitLine: {show: !0, lineStyle: {type: "dashed", opacity: .2}}
        });
        var Lb = A, Bb = M, Ub = Wa();

        function Rb(e, t, i, n, a) {
            var o = e.axis;
            if (!o.scale.isBlank() && o.containData(t)) if (e.involveSeries) {
                var r = function (e, t) {
                    var i = t.axis, n = i.dim, a = e, o = [], r = Number.MAX_VALUE, s = -1;
                    return Lb(t.seriesModels, function (t, l) {
                        var d, u, c = t.getData().mapDimension(n, !0);
                        if (t.getAxisTooltipData) {
                            var h = t.getAxisTooltipData(c, e, i);
                            u = h.dataIndices, d = h.nestestValue
                        } else {
                            if (!(u = t.getData().indicesOfNearest(c[0], e, "category" === i.type ? .5 : null)).length) return;
                            d = t.getData().get(c[0], u[0])
                        }
                        if (null != d && isFinite(d)) {
                            var f = e - d, g = Math.abs(f);
                            g <= r && ((g < r || 0 <= f && s < 0) && (r = g, s = f, a = d, o.length = 0), Lb(u, function (e) {
                                o.push({
                                    seriesIndex: t.seriesIndex,
                                    dataIndexInside: e,
                                    dataIndex: t.getData().getRawIndex(e)
                                })
                            }))
                        }
                    }), {payloadBatch: o, snapToValue: a}
                }(t, e), s = r.payloadBatch, l = r.snapToValue;
                s[0] && null == a.seriesIndex && k(a, s[0]), !n && e.snap && o.containData(l) && null != l && (t = l), i.showPointer(e, t, s, a), i.showTooltip(e, r, l)
            } else i.showPointer(e, t)
        }

        function Kb(e, t, i, n) {
            e[t.key] = {value: i, payloadBatch: n}
        }

        function Wb(e, t, i, n) {
            var a = i.payloadBatch, o = t.axis, r = o.model, s = t.axisPointerModel;
            if (t.triggerTooltip && a.length) {
                var l = t.coordSys.model, d = tm(l), u = e.map[d];
                u || (u = e.map[d] = {
                    coordSysId: l.id,
                    coordSysIndex: l.componentIndex,
                    coordSysType: l.type,
                    coordSysMainType: l.mainType,
                    dataByAxis: []
                }, e.list.push(u)), u.dataByAxis.push({
                    axisDim: o.dim,
                    axisIndex: r.componentIndex,
                    axisType: r.type,
                    axisId: r.id,
                    value: n,
                    valueLabelOpt: {precision: s.get("label.precision"), formatter: s.get("label.formatter")},
                    seriesDataIndices: a.slice()
                })
            }
        }

        function Vb(e) {
            var t = e.axis.model, i = {}, n = i.axisDim = e.axis.dim;
            return i.axisIndex = i[n + "AxisIndex"] = t.componentIndex, i.axisName = i[n + "AxisName"] = t.name, i.axisId = i[n + "AxisId"] = t.id, i
        }

        function Hb(e) {
            return !e || null == e[0] || isNaN(e[0]) || null == e[1] || isNaN(e[1])
        }

        kf({
            type: "axisPointer",
            coordSysAxesInfo: null,
            defaultOption: {
                show: "auto",
                triggerOn: null,
                zlevel: 0,
                z: 50,
                type: "line",
                snap: !1,
                triggerTooltip: !0,
                value: null,
                status: null,
                link: [],
                animation: null,
                animationDurationUpdate: 200,
                lineStyle: {color: "#aaa", width: 1, type: "solid"},
                shadowStyle: {color: "rgba(150,150,150,0.3)"},
                label: {
                    show: !0,
                    formatter: null,
                    precision: "auto",
                    margin: 3,
                    color: "#fff",
                    padding: [5, 7, 5, 7],
                    backgroundColor: "auto",
                    borderColor: null,
                    borderWidth: 0,
                    shadowBlur: 3,
                    shadowColor: "#aaa"
                },
                handle: {
                    show: !1,
                    icon: "M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z",
                    size: 45,
                    margin: 50,
                    color: "#333",
                    shadowBlur: 3,
                    shadowColor: "#aaa",
                    shadowOffsetX: 0,
                    shadowOffsetY: 2,
                    throttle: 40
                }
            }
        });
        var zb = Wa(), jb = A;

        function Gb(e, t, i) {
            if (!a.node) {
                var n = t.getZr();
                zb(n).records || (zb(n).records = {}), function (e, t) {
                    function i(i, n) {
                        e.on(i, function (i) {
                            var a = function (e) {
                                var t = {showTip: [], hideTip: []}, i = function (n) {
                                    var a = t[n.type];
                                    a ? a.push(n) : (n.dispatchAction = i, e.dispatchAction(n))
                                };
                                return {dispatchAction: i, pendings: t}
                            }(t);
                            jb(zb(e).records, function (e) {
                                e && n(e, i, a.dispatchAction)
                            }), function (e, t) {
                                var i, n = e.showTip.length, a = e.hideTip.length;
                                n ? i = e.showTip[n - 1] : a && (i = e.hideTip[a - 1]), i && (i.dispatchAction = null, t.dispatchAction(i))
                            }(a.pendings, t)
                        })
                    }

                    zb(e).initialized || (zb(e).initialized = !0, i("click", M(Xb, "click")), i("mousemove", M(Xb, "mousemove")), i("globalout", $b))
                }(n, t), (zb(n).records[e] || (zb(n).records[e] = {})).handler = i
            }
        }

        function $b(e, t, i) {
            e.handler("leave", null, i)
        }

        function Xb(e, t, i, n) {
            t.handler(e, i, n)
        }

        function qb(e, t) {
            if (!a.node) {
                var i = t.getZr();
                (zb(i).records || {})[e] && (zb(i).records[e] = null)
            }
        }

        var Yb = Tf({
            type: "axisPointer", render: function (e, t, i) {
                var n = t.getComponent("tooltip"),
                    a = e.get("triggerOn") || n && n.get("triggerOn") || "mousemove|click";
                Gb("axisPointer", i, function (e, t, i) {
                    "none" !== a && ("leave" === e || 0 <= a.indexOf(e)) && i({
                        type: "updateAxisPointer",
                        currTrigger: e,
                        x: t && t.offsetX,
                        y: t && t.offsetY
                    })
                })
            }, remove: function (e, t) {
                qb(t.getZr(), "axisPointer"), Yb.superApply(this._model, "remove", arguments)
            }, dispose: function (e, t) {
                qb("axisPointer", t), Yb.superApply(this._model, "dispose", arguments)
            }
        }), Jb = Wa(), Zb = v, Qb = P;

        function eI() {
        }

        function tI(e, t, i, n) {
            !function e(t, i) {
                if (B(t) && B(i)) {
                    var n = !0;
                    return A(i, function (i, a) {
                        n = n && e(t[a], i)
                    }), !!n
                }
                return t === i
            }(Jb(i).lastProp, n) && (Jb(i).lastProp = n, t ? ol(i, n, e) : (i.stopAnimation(), i.attr(n)))
        }

        function iI(e, t) {
            e[t.get("label.show") ? "show" : "hide"]()
        }

        function nI(e) {
            return {position: e.position.slice(), rotation: e.rotation || 0}
        }

        function aI(e, t, i) {
            var n = t.get("z"), a = t.get("zlevel");
            e && e.traverse(function (e) {
                "group" !== e.type && (null != n && (e.z = n), null != a && (e.zlevel = a), e.silent = i)
            })
        }

        function oI(e) {
            var t, i = e.get("type"), n = e.getModel(i + "Style");
            return "line" === i ? (t = n.getLineStyle()).fill = null : "shadow" === i && ((t = n.getAreaStyle()).stroke = null), t
        }

        function rI(e, t, i, n, a) {
            var o = sI(i.get("value"), t.axis, t.ecModel, i.get("seriesDataIndices"), {
                    precision: i.get("label.precision"),
                    formatter: i.get("label.formatter")
                }), r = i.getModel("label"), s = Yl(r.get("padding") || 0), l = r.getFont(), d = cn(o, l), u = a.position,
                c = d.width + s[1] + s[3], h = d.height + s[0] + s[2], f = a.align;
            "right" === f && (u[0] -= c), "center" === f && (u[0] -= c / 2);
            var g = a.verticalAlign;
            "bottom" === g && (u[1] -= h), "middle" === g && (u[1] -= h / 2), function (e, t, i, n) {
                var a = n.getWidth(), o = n.getHeight();
                e[0] = Math.min(e[0] + t, a) - t, e[1] = Math.min(e[1] + i, o) - i, e[0] = Math.max(e[0], 0), e[1] = Math.max(e[1], 0)
            }(u, c, h, n);
            var p = r.get("backgroundColor");
            p && "auto" !== p || (p = t.get("axisLine.lineStyle.color")), e.label = {
                shape: {
                    x: 0,
                    y: 0,
                    width: c,
                    height: h,
                    r: r.get("borderRadius")
                },
                position: u.slice(),
                style: {
                    text: o,
                    textFont: l,
                    textFill: r.getTextColor(),
                    textPosition: "inside",
                    textPadding: s,
                    fill: p,
                    stroke: r.get("borderColor") || "transparent",
                    lineWidth: r.get("borderWidth") || 0,
                    shadowBlur: r.get("shadowBlur"),
                    shadowColor: r.get("shadowColor"),
                    shadowOffsetX: r.get("shadowOffsetX"),
                    shadowOffsetY: r.get("shadowOffsetY")
                },
                z2: 10
            }
        }

        function sI(e, t, i, n, a) {
            e = t.scale.parse(e);
            var o = t.scale.getLabel(e, {precision: a.precision}), r = a.formatter;
            if (r) {
                var s = {value: Qg(t, e), axisDimension: t.dim, axisIndex: t.index, seriesData: []};
                A(n, function (e) {
                    var t = i.getSeriesByIndex(e.seriesIndex), n = e.dataIndexInside, a = t && t.getDataParams(n);
                    a && s.seriesData.push(a)
                }), L(r) ? o = r.replace("{value}", o) : F(r) && (o = r(s))
            }
            return o
        }

        function lI(e, t, i) {
            var n = ot();
            return ut(n, n, i.rotation), dt(n, n, i.position), ll([e.dataToCoord(t), (i.labelOffset || 0) + (i.labelDirection || 1) * (i.labelMargin || 0)], n)
        }

        function dI(e, t, i, n, a, o) {
            var r = Kv.innerTextLayout(i.rotation, 0, i.labelDirection);
            i.labelMargin = a.get("label.margin"), rI(t, n, a, o, {
                position: lI(n.axis, e, i),
                align: r.textAlign,
                verticalAlign: r.textVerticalAlign
            })
        }

        function uI(e, t, i) {
            return {x1: e[i = i || 0], y1: e[1 - i], x2: t[i], y2: t[1 - i]}
        }

        function cI(e, t, i) {
            return {x: e[i = i || 0], y: e[1 - i], width: t[i], height: t[1 - i]}
        }

        function hI(e, t, i, n, a, o) {
            return {cx: e, cy: t, r0: i, r: n, startAngle: a, endAngle: o, clockwise: !0}
        }

        Ja((eI.prototype = {
            _group: null,
            _lastGraphicKey: null,
            _handle: null,
            _dragging: !1,
            _lastValue: null,
            _lastStatus: null,
            _payloadInfo: null,
            animationThreshold: 15,
            render: function (e, t, i, n) {
                var a = t.get("value"), o = t.get("status");
                if (this._axisModel = e, this._axisPointerModel = t, this._api = i, n || this._lastValue !== a || this._lastStatus !== o) {
                    this._lastValue = a, this._lastStatus = o;
                    var r = this._group, s = this._handle;
                    if (!o || "hide" === o) return r && r.hide(), void (s && s.hide());
                    r && r.show(), s && s.show();
                    var l = {};
                    this.makeElOption(l, a, e, t, i);
                    var d = l.graphicKey;
                    d !== this._lastGraphicKey && this.clear(i), this._lastGraphicKey = d;
                    var u = this._moveAnimation = this.determineAnimation(e, t);
                    if (r) {
                        var c = M(tI, t, u);
                        this.updatePointerEl(r, l, c, t), this.updateLabelEl(r, l, c, t)
                    } else r = this._group = new Di, this.createPointerEl(r, l, e, t), this.createLabelEl(r, l, e, t), i.getZr().add(r);
                    aI(r, t, !0), this._renderHandle(a)
                }
            },
            remove: function (e) {
                this.clear(e)
            },
            dispose: function (e) {
                this.clear(e)
            },
            determineAnimation: function (e, t) {
                var i = t.get("animation"), n = e.axis, a = "category" === n.type, o = t.get("snap");
                if (!o && !a) return !1;
                if ("auto" !== i && null != i) return !0 === i;
                var r = this.animationThreshold;
                if (a && n.getBandWidth() > r) return !0;
                if (o) {
                    var s = Qv(e).seriesDataCount, l = n.getExtent();
                    return Math.abs(l[0] - l[1]) / s > r
                }
                return !1
            },
            makeElOption: function (e, t, i, n, a) {
            },
            createPointerEl: function (e, t, i, n) {
                var a = t.pointer;
                if (a) {
                    var o = Jb(e).pointerEl = new vl[a.type](Zb(t.pointer));
                    e.add(o)
                }
            },
            createLabelEl: function (e, t, i, n) {
                if (t.label) {
                    var a = Jb(e).labelEl = new es(Zb(t.label));
                    e.add(a), iI(a, n)
                }
            },
            updatePointerEl: function (e, t, i) {
                var n = Jb(e).pointerEl;
                n && t.pointer && (n.setStyle(t.pointer.style), i(n, {shape: t.pointer.shape}))
            },
            updateLabelEl: function (e, t, i, n) {
                var a = Jb(e).labelEl;
                a && (a.setStyle(t.label.style), i(a, {shape: t.label.shape, position: t.label.position}), iI(a, n))
            },
            _renderHandle: function (e) {
                if (!this._dragging && this.updateHandleTransform) {
                    var t, i = this._axisPointerModel, n = this._api.getZr(), a = this._handle,
                        o = i.getModel("handle"), r = i.get("status");
                    if (!o.get("show") || !r || "hide" === r) return a && n.remove(a), void (this._handle = null);
                    this._handle || (t = !0, a = this._handle = hl(o.get("icon"), {
                        cursor: "move",
                        draggable: !0,
                        onmousemove: function (e) {
                            Ge(e.event)
                        },
                        onmousedown: Qb(this._onHandleDragMove, this, 0, 0),
                        drift: Qb(this._onHandleDragMove, this),
                        ondragend: Qb(this._onHandleDragEnd, this)
                    }), n.add(a)), aI(a, i, !1), a.setStyle(o.getItemStyle(null, ["color", "borderColor", "borderWidth", "opacity", "shadowColor", "shadowBlur", "shadowOffsetX", "shadowOffsetY"]));
                    var s = o.get("size");
                    O(s) || (s = [s, s]), a.attr("scale", [s[0] / 2, s[1] / 2]), bc(this, "_doDispatchAxisPointer", o.get("throttle") || 0, "fixRate"), this._moveHandleToValue(e, t)
                }
            },
            _moveHandleToValue: function (e, t) {
                tI(this._axisPointerModel, !t && this._moveAnimation, this._handle, nI(this.getHandleTransform(e, this._axisModel, this._axisPointerModel)))
            },
            _onHandleDragMove: function (e, t) {
                var i = this._handle;
                if (i) {
                    this._dragging = !0;
                    var n = this.updateHandleTransform(nI(i), [e, t], this._axisModel, this._axisPointerModel);
                    this._payloadInfo = n, i.stopAnimation(), i.attr(nI(n)), Jb(i).lastProp = null, this._doDispatchAxisPointer()
                }
            },
            _doDispatchAxisPointer: function () {
                if (this._handle) {
                    var e = this._payloadInfo, t = this._axisModel;
                    this._api.dispatchAction({
                        type: "updateAxisPointer",
                        x: e.cursorPoint[0],
                        y: e.cursorPoint[1],
                        tooltipOption: e.tooltipOption,
                        axesInfo: [{axisDim: t.axis.dim, axisIndex: t.componentIndex}]
                    })
                }
            },
            _onHandleDragEnd: function (e) {
                if (this._dragging = !1, this._handle) {
                    var t = this._axisPointerModel.get("value");
                    this._moveHandleToValue(t), this._api.dispatchAction({type: "hideTip"})
                }
            },
            getHandleTransform: null,
            updateHandleTransform: null,
            clear: function (e) {
                this._lastValue = null, this._lastStatus = null;
                var t = e.getZr(), i = this._group, n = this._handle;
                t && i && (this._lastGraphicKey = null, i && t.remove(i), n && t.remove(n), this._group = null, this._handle = null, this._payloadInfo = null)
            },
            doClear: function () {
            },
            buildLabel: function (e, t, i) {
                return {x: e[i = i || 0], y: e[1 - i], width: t[i], height: t[1 - i]}
            }
        }).constructor = eI);
        var fI = eI.extend({
            makeElOption: function (e, t, i, n, a) {
                var o = i.axis, r = o.grid, s = n.get("type"), l = gI(r, o).getOtherAxis(o).getGlobalExtent(),
                    d = o.toGlobalCoord(o.dataToCoord(t, !0));
                if (s && "none" !== s) {
                    var u = oI(n), c = pI[s](o, d, l);
                    c.style = u, e.graphicKey = c.type, e.pointer = c
                }
                dI(t, e, rm(r.model, i), i, n, a)
            }, getHandleTransform: function (e, t, i) {
                var n = rm(t.axis.grid.model, t, {labelInside: !1});
                return n.labelMargin = i.get("handle.margin"), {
                    position: lI(t.axis, e, n),
                    rotation: n.rotation + (n.labelDirection < 0 ? Math.PI : 0)
                }
            }, updateHandleTransform: function (e, t, i, n) {
                var a = i.axis, o = a.grid, r = a.getGlobalExtent(!0), s = gI(o, a).getOtherAxis(a).getGlobalExtent(),
                    l = "x" === a.dim ? 0 : 1, d = e.position;
                d[l] += t[l], d[l] = Math.min(r[1], d[l]), d[l] = Math.max(r[0], d[l]);
                var u = (s[1] + s[0]) / 2, c = [u, u];
                return c[l] = d[l], {
                    position: d,
                    rotation: e.rotation,
                    cursorPoint: c,
                    tooltipOption: [{verticalAlign: "middle"}, {align: "center"}][l]
                }
            }
        });

        function gI(e, t) {
            var i = {};
            return i[t.dim + "AxisIndex"] = t.index, e.getCartesian(i)
        }

        var pI = {
            line: function (e, t, i) {
                return {type: "Line", subPixelOptimize: !0, shape: uI([t, i[0]], [t, i[1]], vI(e))}
            }, shadow: function (e, t, i) {
                var n = Math.max(1, e.getBandWidth()), a = i[1] - i[0];
                return {type: "Rect", shape: cI([t - n / 2, i[0]], [n, a], vI(e))}
            }
        };

        function vI(e) {
            return "x" === e.dim ? 0 : 1
        }

        im.registerAxisPointerClass("CartesianAxisPointer", fI), cf(function (e) {
            if (e) {
                e.axisPointer && 0 !== e.axisPointer.length || (e.axisPointer = {});
                var t = e.axisPointer.link;
                t && !O(t) && (e.axisPointer.link = [t])
            }
        }), hf(Sh.PROCESSOR.STATISTIC, function (e, t) {
            e.getComponent("axisPointer").coordSysAxesInfo = function (e, t) {
                var i = {axesInfo: {}, seriesInvolved: !1, coordSysAxesInfo: {}, coordSysMap: {}};
                return function (e, t, i) {
                    var n = t.getComponent("tooltip"), a = t.getComponent("axisPointer"), o = a.get("link", !0) || [],
                        r = [];
                    Yv(i.getCoordinateSystems(), function (i) {
                        if (i.axisPointerEnabled) {
                            var s = tm(i.model), l = e.coordSysAxesInfo[s] = {},
                                d = (e.coordSysMap[s] = i).model.getModel("tooltip", n);
                            if (Yv(i.getAxes(), Jv(f, !1, null)), i.getTooltipAxes && n && d.get("show")) {
                                var u = "axis" === d.get("trigger"), c = "cross" === d.get("axisPointer.type"),
                                    h = i.getTooltipAxes(d.get("axisPointer.axis"));
                                (u || c) && Yv(h.baseAxes, Jv(f, !c || "cross", u)), c && Yv(h.otherAxes, Jv(f, "cross", !1))
                            }
                        }

                        function f(n, s, u) {
                            var c = u.model.getModel("axisPointer", a), h = c.get("show");
                            if (h && ("auto" !== h || n || em(c))) {
                                null == s && (s = c.get("triggerTooltip"));
                                var f = (c = n ? function (e, t, i, n, a, o) {
                                        var r = t.getModel("axisPointer"), s = {};
                                        Yv(["type", "snap", "lineStyle", "shadowStyle", "label", "animation", "animationDurationUpdate", "animationEasingUpdate", "z"], function (e) {
                                            s[e] = v(r.get(e))
                                        }), s.snap = "category" !== e.type && !!o, "cross" === r.get("type") && (s.type = "line");
                                        var l = s.label || (s.label = {});
                                        if (null == l.show && (l.show = !1), "cross" === a) {
                                            var d = r.get("label.show");
                                            if (l.show = null == d || d, !o) {
                                                var u = s.lineStyle = r.get("crossStyle");
                                                u && T(l, u.textStyle)
                                            }
                                        }
                                        return e.model.getModel("axisPointer", new Sl(s, i, n))
                                    }(u, d, a, t, n, s) : c).get("snap"), g = tm(u.model),
                                    p = s || f || "category" === u.type, m = e.axesInfo[g] = {
                                        key: g,
                                        axis: u,
                                        coordSys: i,
                                        axisPointerModel: c,
                                        triggerTooltip: s,
                                        involveSeries: p,
                                        snap: f,
                                        useHandle: em(c),
                                        seriesModels: []
                                    };
                                l[g] = m, e.seriesInvolved |= p;
                                var y = function (e, t) {
                                    for (var i = t.model, n = t.dim, a = 0; a < e.length; a++) {
                                        var o = e[a] || {};
                                        if (Zv(o[n + "AxisId"], i.id) || Zv(o[n + "AxisIndex"], i.componentIndex) || Zv(o[n + "AxisName"], i.name)) return a
                                    }
                                }(o, u);
                                if (null != y) {
                                    var k = r[y] || (r[y] = {axesInfo: {}});
                                    k.axesInfo[g] = m, k.mapper = o[y].mapper, m.linkGroup = k
                                }
                            }
                        }
                    })
                }(i, e, t), i.seriesInvolved && function (e, t) {
                    t.eachSeries(function (t) {
                        var i = t.coordinateSystem, n = t.get("tooltip.trigger", !0), a = t.get("tooltip.show", !0);
                        i && "none" !== n && !1 !== n && "item" !== n && !1 !== a && !1 !== t.get("axisPointer.show", !0) && Yv(e.coordSysAxesInfo[tm(i.model)], function (e) {
                            var n = e.axis;
                            i.getAxis(n.dim) === n && (e.seriesModels.push(t), null == e.seriesDataCount && (e.seriesDataCount = 0), e.seriesDataCount += t.getData().count())
                        })
                    }, this)
                }(i, e), i
            }(e, t)
        }), ff({
            type: "updateAxisPointer",
            event: "updateAxisPointer",
            update: ":updateAxisPointer"
        }, function (e, t, i) {
            var n = e.currTrigger, a = [e.x, e.y], o = e, r = e.dispatchAction || P(i.dispatchAction, i),
                s = t.getComponent("axisPointer").coordSysAxesInfo;
            if (s) {
                Hb(a) && (a = Fb({seriesIndex: o.seriesIndex, dataIndex: o.dataIndex}, t).point);
                var l = Hb(a), d = o.axesInfo, u = s.axesInfo, c = "leave" === n || Hb(a), h = {}, f = {},
                    g = {list: [], map: {}}, p = {showPointer: Bb(Kb, f), showTooltip: Bb(Wb, g)};
                Lb(s.coordSysMap, function (e, t) {
                    var i = l || e.containPoint(a);
                    Lb(s.coordSysAxesInfo[t], function (e, t) {
                        var n = e.axis, o = function (e, t) {
                            for (var i = 0; i < (e || []).length; i++) {
                                var n = e[i];
                                if (t.axis.dim === n.axisDim && t.axis.model.componentIndex === n.axisIndex) return n
                            }
                        }(d, e);
                        if (!c && i && (!d || o)) {
                            var r = o && o.value;
                            null != r || l || (r = n.pointToData(a)), null != r && Rb(e, r, p, !1, h)
                        }
                    })
                });
                var v = {};
                return Lb(u, function (e, t) {
                    var i = e.linkGroup;
                    i && !f[t] && Lb(i.axesInfo, function (t, n) {
                        var a = f[n];
                        if (t !== e && a) {
                            var o = a.value;
                            i.mapper && (o = e.axis.scale.parse(i.mapper(o, Vb(t), Vb(e)))), v[e.key] = o
                        }
                    })
                }), Lb(v, function (e, t) {
                    Rb(u[t], e, p, !0, h)
                }), function (e, t, i) {
                    var n = i.axesInfo = [];
                    Lb(t, function (t, i) {
                        var a = t.axisPointerModel.option, o = e[i];
                        o ? (t.useHandle || (a.status = "show"), a.value = o.value, a.seriesDataIndices = (o.payloadBatch || []).slice()) : t.useHandle || (a.status = "hide"), "show" === a.status && n.push({
                            axisDim: t.axis.dim,
                            axisIndex: t.axis.model.componentIndex,
                            value: a.value
                        })
                    })
                }(f, u, h), function (e, t, i, n) {
                    if (Hb(t) || !e.list.length) return n({type: "hideTip"});
                    var a = ((e.list[0].dataByAxis[0] || {}).seriesDataIndices || [])[0] || {};
                    n({
                        type: "showTip",
                        escapeConnect: !0,
                        x: t[0],
                        y: t[1],
                        tooltipOption: i.tooltipOption,
                        position: i.position,
                        dataIndexInside: a.dataIndexInside,
                        dataIndex: a.dataIndex,
                        seriesIndex: a.seriesIndex,
                        dataByCoordSys: e.list
                    })
                }(g, a, e, r), function (e, t, i) {
                    var n = i.getZr(), a = "axisPointerLastHighlights", o = Ub(n)[a] || {}, r = Ub(n)[a] = {};
                    Lb(e, function (e, t) {
                        var i = e.axisPointerModel.option;
                        "show" === i.status && Lb(i.seriesDataIndices, function (e) {
                            var t = e.seriesIndex + " | " + e.dataIndex;
                            r[t] = e
                        })
                    });
                    var s = [], l = [];
                    A(o, function (e, t) {
                        r[t] || l.push(e)
                    }), A(r, function (e, t) {
                        o[t] || s.push(e)
                    }), l.length && i.dispatchAction({
                        type: "downplay",
                        escapeConnect: !0,
                        batch: l
                    }), s.length && i.dispatchAction({type: "highlight", escapeConnect: !0, batch: s})
                }(u, 0, i), h
            }
        });
        var mI = ["x", "y"], yI = ["width", "height"], kI = eI.extend({
            makeElOption: function (e, t, i, n, a) {
                var o = i.axis, r = o.coordinateSystem, s = CI(r, 1 - wI(o)), l = r.dataToPoint(t)[0],
                    d = n.get("type");
                if (d && "none" !== d) {
                    var u = oI(n), c = TI[d](o, l, s);
                    c.style = u, e.graphicKey = c.type, e.pointer = c
                }
                dI(t, e, Nb(i), i, n, a)
            }, getHandleTransform: function (e, t, i) {
                var n = Nb(t, {labelInside: !1});
                return n.labelMargin = i.get("handle.margin"), {
                    position: lI(t.axis, e, n),
                    rotation: n.rotation + (n.labelDirection < 0 ? Math.PI : 0)
                }
            }, updateHandleTransform: function (e, t, i, n) {
                var a = i.axis, o = a.coordinateSystem, r = wI(a), s = CI(o, r), l = e.position;
                l[r] += t[r], l[r] = Math.min(s[1], l[r]), l[r] = Math.max(s[0], l[r]);
                var d = CI(o, 1 - r), u = (d[1] + d[0]) / 2, c = [u, u];
                return c[r] = l[r], {
                    position: l,
                    rotation: e.rotation,
                    cursorPoint: c,
                    tooltipOption: {verticalAlign: "middle"}
                }
            }
        }), TI = {
            line: function (e, t, i) {
                return {type: "Line", subPixelOptimize: !0, shape: uI([t, i[0]], [t, i[1]], wI(e))}
            }, shadow: function (e, t, i) {
                var n = e.getBandWidth(), a = i[1] - i[0];
                return {type: "Rect", shape: cI([t - n / 2, i[0]], [n, a], wI(e))}
            }
        };

        function wI(e) {
            return e.isHorizontal() ? 0 : 1
        }

        function CI(e, t) {
            var i = e.getRect();
            return [i[mI[t]], i[mI[t]] + i[yI[t]]]
        }

        im.registerAxisPointerClass("SingleAxisPointer", kI), Tf({type: "single"});
        var SI = ec.extend({
            type: "series.themeRiver",
            dependencies: ["singleAxis"],
            nameMap: null,
            init: function (e) {
                SI.superApply(this, "init", arguments), this.legendVisualProvider = new Fm(P(this.getData, this), P(this.getRawData, this))
            },
            fixData: function (e) {
                var t = e.length, i = $a(e, function (e) {
                    return e[2]
                }), n = [];
                i.buckets.each(function (e, t) {
                    n.push({name: t, dataList: e})
                });
                for (var a = n.length, o = -1, r = -1, s = 0; s < a; ++s) {
                    var l = n[s].dataList.length;
                    o < l && (o = l, r = s)
                }
                for (var d = 0; d < a; ++d) if (d !== r) for (var u = n[d].name, c = 0; c < o; ++c) {
                    for (var h = n[r].dataList[c][0], f = n[d].dataList.length, g = -1, p = 0; p < f; ++p) if (n[d].dataList[p][0] === h) {
                        g = p;
                        break
                    }
                    -1 === g && (e[t] = [], e[t][0] = h, e[t][1] = 0, e[t][2] = u, t++)
                }
                return e
            },
            getInitialData: function (e, t) {
                for (var i = t.queryComponents({
                    mainType: "singleAxis",
                    index: this.get("singleAxisIndex"),
                    id: this.get("singleAxisId")
                })[0].get("type"), n = N(e.data, function (e) {
                    return void 0 !== e[2]
                }), a = this.fixData(n || []), o = [], r = this.nameMap = Q(), s = 0, l = 0; l < a.length; ++l) o.push(a[l][2]), r.get(a[l][2]) || (r.set(a[l][2], s), s++);
                var d = eg(a, {
                    coordDimensions: ["single"],
                    dimensionsDefine: [{name: "time", type: Df(i)}, {name: "value", type: "float"}, {
                        name: "name",
                        type: "ordinal"
                    }],
                    encodeDefine: {single: 0, value: 1, itemName: 2}
                }), u = new Kf(d, this);
                return u.initData(a), u
            },
            getLayerSeries: function () {
                for (var e = this.getData(), t = e.count(), i = [], n = 0; n < t; ++n) i[n] = n;
                var a = e.mapDimension("single"), o = $a(i, function (t) {
                    return e.get("name", t)
                }), r = [];
                return o.buckets.each(function (t, i) {
                    t.sort(function (t, i) {
                        return e.get(a, t) - e.get(a, i)
                    }), r.push({name: i, indices: t})
                }), r
            },
            getAxisTooltipData: function (e, t, i) {
                O(e) || (e = e ? [e] : []);
                for (var n, a = this.getData(), o = this.getLayerSeries(), r = [], s = o.length, l = 0; l < s; ++l) {
                    for (var d = Number.MAX_VALUE, u = -1, c = o[l].indices.length, h = 0; h < c; ++h) {
                        var f = a.get(e[0], o[l].indices[h]), g = Math.abs(f - t);
                        g <= d && (n = f, d = g, u = o[l].indices[h])
                    }
                    r.push(u)
                }
                return {dataIndices: r, nestestValue: n}
            },
            formatTooltip: function (e) {
                var t = this.getData(), i = t.getName(e), n = t.get(t.mapDimension("value"), e);
                return !isNaN(n) && null != n || (n = "-"), Ql(i + " : " + n)
            },
            defaultOption: {
                zlevel: 0,
                z: 2,
                coordinateSystem: "singleAxis",
                boundaryGap: ["10%", "10%"],
                singleAxisIndex: 0,
                animationEasing: "linear",
                label: {margin: 4, show: !0, position: "left", color: "#000", fontSize: 11},
                emphasis: {label: {show: !0}}
            }
        });

        function bI(e, t, i) {
            if (e.count()) for (var n, a = t.coordinateSystem, o = t.getLayerSeries(), r = e.mapDimension("single"), s = e.mapDimension("value"), l = D(o, function (t) {
                return D(t.indices, function (t) {
                    var i = a.dataToPoint(e.get(r, t));
                    return i[1] = e.get(s, t), i
                })
            }), d = function (e) {
                for (var t = e.length, i = e[0].length, n = [], a = [], o = 0, r = {}, s = 0; s < i; ++s) {
                    for (var l = 0, d = 0; l < t; ++l) d += e[l][s][1];
                    o < d && (o = d), n.push(d)
                }
                for (var u = 0; u < i; ++u) a[u] = (o - n[u]) / 2;
                for (var c = o = 0; c < i; ++c) {
                    var h = n[c] + a[c];
                    o < h && (o = h)
                }
                return r.y0 = a, r.max = o, r
            }(l), u = d.y0, c = i / d.max, h = o.length, f = o[0].indices.length, g = 0; g < f; ++g) {
                n = u[g] * c, e.setItemLayout(o[0].indices[g], {
                    layerIndex: 0,
                    x: l[0][g][0],
                    y0: n,
                    y: l[0][g][1] * c
                });
                for (var p = 1; p < h; ++p) n += l[p - 1][g][1] * c, e.setItemLayout(o[p].indices[g], {
                    layerIndex: p,
                    x: l[p][g][0],
                    y0: n,
                    y: l[p][g][1] * c
                })
            }
        }

        Cf({
            type: "themeRiver", init: function () {
                this._layers = []
            }, render: function (e, t, i) {
                var n = e.getData(), a = this.group, o = e.getLayerSeries(), r = n.getLayout("layoutInfo"), s = r.rect,
                    l = r.boundaryGap;

                function d(e) {
                    return e.name
                }

                a.attr("position", [0, s.y + l[0]]);
                var u = new bf(this._layersSeries || [], o, d, d), c = {};

                function h(t, i, r) {
                    var s = this._layers;
                    if ("remove" !== t) {
                        for (var l, d, u, h = [], f = [], g = o[i].indices, p = 0; p < g.length; p++) {
                            var v = n.getItemLayout(g[p]), m = v.x, y = v.y0, T = v.y;
                            h.push([m, y]), f.push([m, y + T]), l = n.getItemVisual(g[p], "color")
                        }
                        var w = n.getItemLayout(g[0]), C = n.getItemModel(g[p - 1]), S = C.getModel("label"),
                            b = S.get("margin");
                        if ("add" === t) {
                            var I = c[i] = new Di;
                            d = new lv({
                                shape: {
                                    points: h,
                                    stackedOnPoints: f,
                                    smooth: .4,
                                    stackedOnSmooth: .4,
                                    smoothConstraint: !1
                                }, z2: 0
                            }), u = new Rr({
                                style: {
                                    x: w.x - b,
                                    y: w.y0 + w.y / 2
                                }
                            }), I.add(d), I.add(u), a.add(I), d.setClipPath(function (e, t, i) {
                                var n = new es({shape: {x: e.x - 10, y: e.y - 10, width: 0, height: e.height + 20}});
                                return rl(n, {shape: {width: e.width + 20, height: e.height + 20}}, t, function () {
                                    d.removeClipPath()
                                }), n
                            }(d.getBoundingRect(), e))
                        } else I = s[r], d = I.childAt(0), u = I.childAt(1), a.add(I), c[i] = I, ol(d, {
                            shape: {
                                points: h,
                                stackedOnPoints: f
                            }
                        }, e), ol(u, {style: {x: w.x - b, y: w.y0 + w.y / 2}}, e);
                        var _ = C.getModel("emphasis.itemStyle"), A = C.getModel("itemStyle");
                        Js(u.style, S, {
                            text: S.get("show") ? e.getFormattedLabel(g[p - 1], "normal") || n.getName(g[p - 1]) : null,
                            textVerticalAlign: "middle"
                        }), d.setStyle(k({fill: l}, A.getItemStyle(["color"]))), js(d, _.getItemStyle())
                    } else a.remove(s[i])
                }

                u.add(P(h, this, "add")).update(P(h, this, "update")).remove(P(h, this, "remove")).execute(), this._layersSeries = o, this._layers = c
            }, dispose: function () {
            }
        }), pf(function (e, t) {
            e.eachSeriesByType("themeRiver", function (e) {
                var t = e.getData(), i = e.coordinateSystem, n = {}, a = i.getRect();
                n.rect = a;
                var o = e.get("boundaryGap"), r = i.getAxis();
                n.boundaryGap = o, "horizontal" === r.orient ? (o[0] = Nl(o[0], a.height), o[1] = Nl(o[1], a.height), bI(t, e, a.height - o[0] - o[1])) : (o[0] = Nl(o[0], a.width), o[1] = Nl(o[1], a.width), bI(t, e, a.width - o[0] - o[1])), t.setLayout("layoutInfo", n)
            })
        }), vf(function (e) {
            e.eachSeriesByType("themeRiver", function (e) {
                var t = e.getData(), i = e.getRawData(), n = e.get("color"), a = Q();
                t.each(function (e) {
                    a.set(t.getRawIndex(e), e)
                }), i.each(function (o) {
                    var r = i.getName(o), s = n[(e.nameMap.get(r) - 1) % n.length];
                    i.setItemVisual(o, "color", s);
                    var l = a.get(o);
                    null != l && t.setItemVisual(l, "color", s)
                })
            })
        }), hf(Xm("themeRiver")), ec.extend({
            type: "series.sunburst",
            _viewRoot: null,
            getInitialData: function (e, t) {
                var i = {name: e.name, children: e.data};
                !function e(t) {
                    var i = 0;
                    A(t.children, function (t) {
                        e(t);
                        var n = t.value;
                        O(n) && (n = n[0]), i += n
                    });
                    var n = t.value;
                    O(n) && (n = n[0]), null != n && !isNaN(n) || (n = i), n < 0 && (n = 0), O(t.value) ? t.value[0] = n : t.value = n
                }(i);
                var n = e.levels || [], a = {};
                return a.levels = n, uk.createTree(i, this, a).data
            },
            optionUpdated: function () {
                this.resetViewRoot()
            },
            getDataParams: function (e) {
                var t = ec.prototype.getDataParams.apply(this, arguments),
                    i = this.getData().tree.getNodeByDataIndex(e);
                return t.treePathInfo = xk(i, this), t
            },
            defaultOption: {
                zlevel: 0,
                z: 2,
                center: ["50%", "50%"],
                radius: [0, "75%"],
                clockwise: !0,
                startAngle: 90,
                minAngle: 0,
                percentPrecision: 2,
                stillShowZeroSum: !0,
                highlightPolicy: "descendant",
                nodeClick: "rootToNode",
                renderLabelForZeroData: !1,
                label: {
                    rotate: "radial",
                    show: !0,
                    opacity: 1,
                    align: "center",
                    position: "inside",
                    distance: 5,
                    silent: !0
                },
                itemStyle: {
                    borderWidth: 1,
                    borderColor: "white",
                    borderType: "solid",
                    shadowBlur: 0,
                    shadowColor: "rgba(0, 0, 0, 0.2)",
                    shadowOffsetX: 0,
                    shadowOffsetY: 0,
                    opacity: 1
                },
                highlight: {itemStyle: {opacity: 1}},
                downplay: {itemStyle: {opacity: .5}, label: {opacity: .6}},
                animationType: "expansion",
                animationDuration: 1e3,
                animationDurationUpdate: 500,
                animationEasing: "cubicOut",
                data: [],
                levels: [],
                sort: "desc"
            },
            getViewRoot: function () {
                return this._viewRoot
            },
            resetViewRoot: function (e) {
                e ? this._viewRoot = e : e = this._viewRoot;
                var t = this.getRawData().tree.root;
                e && (e === t || t.contains(e)) || (this._viewRoot = t)
            }
        });
        var II = 2, _I = 4;

        function AI(e, t, i) {
            Di.call(this);
            var n = new Hr({z2: II});
            n.seriesIndex = t.seriesIndex;
            var a = new Rr({z2: _I, silent: e.getModel("label").get("silent")});

            function o() {
                a.ignore = a.hoverIgnore
            }

            function r() {
                a.ignore = a.normalIgnore
            }

            this.add(n), this.add(a), this.updateData(!0, e, "normal", t, i), this.on("emphasis", o).on("normal", r).on("mouseover", o).on("mouseout", r)
        }

        var DI = AI.prototype;
        DI.updateData = function (e, t, i, n, a) {
            (this.node = t).piece = this, n = n || this._seriesModel, a = a || this._ecModel;
            var o = this.childAt(0);
            o.dataIndex = t.dataIndex;
            var r = t.getModel(), s = t.getLayout(), l = k({}, s);
            l.label = null;
            var d = function (e, t, i) {
                var n = e.getVisual("color"), a = e.getVisual("visualMeta");
                a && 0 !== a.length || (n = null);
                var o = e.getModel("itemStyle").get("color");
                if (o) return o;
                if (n) return n;
                if (0 === e.depth) return i.option.color[0];
                var r = i.option.color.length;
                return o = i.option.color[function (e) {
                    for (var t = e; 1 < t.depth;) t = t.parentNode;
                    return S(e.getAncestors()[0].children, t)
                }(e) % r]
            }(t, 0, a);
            !function (e, t, i) {
                t.getData().setItemVisual(e.dataIndex, "color", i)
            }(t, n, d);
            var u, c = r.getModel("itemStyle").getItemStyle();
            u = T({
                lineJoin: "bevel",
                fill: (u = "normal" === i ? c : m(r.getModel(i + ".itemStyle").getItemStyle(), c)).fill || d
            }, u), e ? (o.setShape(l), o.shape.r = s.r0, ol(o, {shape: {r: s.r}}, n, t.dataIndex), o.useStyle(u)) : "object" == typeof u.fill && u.fill.type || "object" == typeof o.style.fill && o.style.fill.type ? (ol(o, {shape: l}, n), o.useStyle(u)) : ol(o, {
                shape: l,
                style: u
            }, n), this._updateLabel(n, d, i);
            var h = r.getShallow("cursor");
            if (h && o.attr("cursor", h), e) {
                var f = n.getShallow("highlightPolicy");
                this._initEvents(o, t, n, f)
            }
            this._seriesModel = n || this._seriesModel, this._ecModel = a || this._ecModel, js(this)
        }, DI.onEmphasis = function (e) {
            var t = this;
            this.node.hostTree.root.eachNode(function (i) {
                i.piece && (t.node === i ? i.piece.updateData(!1, i, "emphasis") : function (e, t, i) {
                    return "none" !== i && ("self" === i ? e === t : "ancestor" === i ? e === t || e.isAncestorOf(t) : e === t || e.isDescendantOf(t))
                }(i, t.node, e) ? i.piece.childAt(0).trigger("highlight") : "none" !== e && i.piece.childAt(0).trigger("downplay"))
            })
        }, DI.onNormal = function () {
            this.node.hostTree.root.eachNode(function (e) {
                e.piece && e.piece.updateData(!1, e, "normal")
            })
        }, DI.onHighlight = function () {
            this.updateData(!1, this.node, "highlight")
        }, DI.onDownplay = function () {
            this.updateData(!1, this.node, "downplay")
        }, DI._updateLabel = function (e, t, i) {
            var n = this.node.getModel(), a = n.getModel("label"),
                o = "normal" === i || "emphasis" === i ? a : n.getModel(i + ".label"), r = n.getModel("emphasis.label"),
                s = V(e.getFormattedLabel(this.node.dataIndex, i, null, null, "label"), this.node.name);
            !1 === S("show") && (s = "");
            var l = this.node.getLayout(), d = o.get("minAngle");
            null == d && (d = a.get("minAngle")), d = d / 180 * Math.PI;
            var u = l.endAngle - l.startAngle;
            null != d && Math.abs(u) < d && (s = "");
            var c = this.childAt(1);
            qs(c.style, c.hoverStyle || {}, a, r, {
                defaultText: o.getShallow("show") ? s : null,
                autoColor: t,
                useInsideStyle: !0
            });
            var h, f = (l.startAngle + l.endAngle) / 2, g = Math.cos(f), p = Math.sin(f), v = S("position"),
                m = S("distance") || 0, y = S("align");
            "outside" === v ? (h = l.r + m, y = f > Math.PI / 2 ? "right" : "left") : y && "center" !== y ? "left" === y ? (h = l.r0 + m, f > Math.PI / 2 && (y = "right")) : "right" === y && (h = l.r - m, f > Math.PI / 2 && (y = "left")) : (h = (l.r + l.r0) / 2, y = "center"), c.attr("style", {
                text: s,
                textAlign: y,
                textVerticalAlign: S("verticalAlign") || "middle",
                opacity: S("opacity")
            });
            var k = h * g + l.cx, T = h * p + l.cy;
            c.attr("position", [k, T]);
            var w = S("rotate"), C = 0;

            function S(e) {
                var t = o.get(e);
                return null == t ? a.get(e) : t
            }

            "radial" === w ? (C = -f) < -Math.PI / 2 && (C += Math.PI) : "tangential" === w ? (C = Math.PI / 2 - f) > Math.PI / 2 ? C -= Math.PI : C < -Math.PI / 2 && (C += Math.PI) : "number" == typeof w && (C = w * Math.PI / 180), c.attr("rotation", C)
        }, DI._initEvents = function (e, t, i, n) {
            function a() {
                r.onEmphasis(n)
            }

            function o() {
                r.onNormal()
            }

            e.off("mouseover").off("mouseout").off("emphasis").off("normal");
            var r = this;
            i.isAnimationEnabled() && e.on("mouseover", a).on("mouseout", o).on("emphasis", a).on("normal", o).on("downplay", function () {
                r.onDownplay()
            }).on("highlight", function () {
                r.onHighlight()
            })
        }, b(AI, Di), fc.extend({
            type: "sunburst", init: function () {
            }, render: function (e, t, i, n) {
                var a = this;
                this.seriesModel = e, this.api = i, this.ecModel = t;
                var o = e.getData(), r = o.tree.root, s = e.getViewRoot(), l = this.group,
                    d = e.get("renderLabelForZeroData"), u = [];
                s.eachNode(function (e) {
                    u.push(e)
                });
                var c = this._oldChildren || [];
                if (function (i, n) {
                    function a(e) {
                        return e.getId()
                    }

                    function s(a, s) {
                        !function (i, n) {
                            if (d || !i || i.getValue() || (i = null), i !== r && n !== r) if (n && n.piece) i ? (n.piece.updateData(!1, i, "normal", e, t), o.setItemGraphicEl(i.dataIndex, n.piece)) : function (e) {
                                e && e.piece && (l.remove(e.piece), e.piece = null)
                            }(n); else if (i) {
                                var a = new AI(i, e, t);
                                l.add(a), o.setItemGraphicEl(i.dataIndex, a)
                            }
                        }(null == a ? null : i[a], null == s ? null : n[s])
                    }

                    0 === i.length && 0 === n.length || new bf(n, i, a, a).add(s).update(s).remove(M(s, null)).execute()
                }(u, c), function (i, n) {
                    if (0 < n.depth) {
                        a.virtualPiece ? a.virtualPiece.updateData(!1, i, "normal", e, t) : (a.virtualPiece = new AI(i, e, t), l.add(a.virtualPiece)), n.piece._onclickEvent && n.piece.off("click", n.piece._onclickEvent);
                        var o = function (e) {
                            a._rootToNode(n.parentNode)
                        };
                        n.piece._onclickEvent = o, a.virtualPiece.on("click", o)
                    } else a.virtualPiece && (l.remove(a.virtualPiece), a.virtualPiece = null)
                }(r, s), n && n.highlight && n.highlight.piece) {
                    var h = e.getShallow("highlightPolicy");
                    n.highlight.piece.onEmphasis(h)
                } else if (n && n.unhighlight) {
                    var f = this.virtualPiece;
                    !f && r.children.length && (f = r.children[0].piece), f && f.onNormal()
                }
                this._initEvents(), this._oldChildren = u
            }, dispose: function () {
            }, _initEvents: function () {
                function e(e) {
                    var i = !1;
                    t.seriesModel.getViewRoot().eachNode(function (n) {
                        if (!i && n.piece && n.piece.childAt(0) === e.target) {
                            var a = n.getModel().get("nodeClick");
                            if ("rootToNode" === a) t._rootToNode(n); else if ("link" === a) {
                                var o = n.getModel(), r = o.get("link");
                                r && dd(r, o.get("target", !0) || "_blank")
                            }
                            i = !0
                        }
                    })
                }

                var t = this;
                this.group._onclickEvent && this.group.off("click", this.group._onclickEvent), this.group.on("click", e), this.group._onclickEvent = e
            }, _rootToNode: function (e) {
                e !== this.seriesModel.getViewRoot() && this.api.dispatchAction({
                    type: "sunburstRootToNode",
                    from: this.uid,
                    seriesId: this.seriesModel.id,
                    targetNode: e
                })
            }, containPoint: function (e, t) {
                var i = t.getData().getItemLayout(0);
                if (i) {
                    var n = e[0] - i.cx, a = e[1] - i.cy, o = Math.sqrt(n * n + a * a);
                    return o <= i.r && o >= i.r0
                }
            }
        });
        var xI = "sunburstRootToNode";
        ff({type: xI, update: "updateView"}, function (e, t) {
            t.eachComponent({mainType: "series", subType: "sunburst", query: e}, function (t, i) {
                var n = _k(e, [xI], t);
                if (n) {
                    var a = t.getViewRoot();
                    a && (e.direction = Dk(a, n.node) ? "rollUp" : "drillDown"), t.resetViewRoot(n.node)
                }
            })
        });
        var NI = "sunburstHighlight";
        ff({type: NI, update: "updateView"}, function (e, t) {
            t.eachComponent({mainType: "series", subType: "sunburst", query: e}, function (t, i) {
                var n = _k(e, [NI], t);
                n && (e.highlight = n.node)
            })
        }), ff({type: "sunburstUnhighlight", update: "updateView"}, function (e, t) {
            t.eachComponent({mainType: "series", subType: "sunburst", query: e}, function (t, i) {
                e.unhighlight = !0
            })
        });
        var EI = Math.PI / 180;

        function PI(e, t) {
            return t = t || [0, 0], D(["x", "y"], function (i, n) {
                var a = this.getAxis(i), o = t[n], r = e[n] / 2;
                return "category" === a.type ? a.getBandWidth() : Math.abs(a.dataToCoord(o - r) - a.dataToCoord(o + r))
            }, this)
        }

        function MI(e, t) {
            return t = t || [0, 0], D([0, 1], function (i) {
                var n = t[i], a = e[i] / 2, o = [], r = [];
                return o[i] = n - a, r[i] = n + a, o[1 - i] = r[1 - i] = t[1 - i], Math.abs(this.dataToPoint(o)[i] - this.dataToPoint(r)[i])
            }, this)
        }

        function OI(e, t) {
            var i = this.getAxis(), n = t instanceof Array ? t[0] : t, a = (e instanceof Array ? e[0] : e) / 2;
            return "category" === i.type ? i.getBandWidth() : Math.abs(i.dataToCoord(n - a) - i.dataToCoord(n + a))
        }

        function FI(e, t) {
            return D(["Radius", "Angle"], function (i, n) {
                var a = this["get" + i + "Axis"](), o = t[n], r = e[n] / 2, s = "dataTo" + i,
                    l = "category" === a.type ? a.getBandWidth() : Math.abs(a[s](o - r) - a[s](o + r));
                return "Angle" === i && (l = l * Math.PI / 180), l
            }, this)
        }

        vf(M(Vm, "sunburst")), pf(M(function (e, t, i, n) {
            t.eachSeriesByType(e, function (e) {
                var t = e.get("center"), n = e.get("radius");
                O(n) || (n = [0, n]), O(t) || (t = [t, t]);
                var a = i.getWidth(), o = i.getHeight(), r = Math.min(a, o), s = Nl(t[0], a), l = Nl(t[1], o),
                    d = Nl(n[0], r / 2), u = Nl(n[1], r / 2), c = -e.get("startAngle") * EI, h = e.get("minAngle") * EI,
                    f = e.getData().tree.root, g = e.getViewRoot(), p = g.depth, v = e.get("sort");
                null != v && function e(t, i) {
                    var n = t.children || [];
                    t.children = function (e, t) {
                        if ("function" == typeof t) return e.sort(t);
                        var i = "asc" === t;
                        return e.sort(function (e, t) {
                            var n = (e.getValue() - t.getValue()) * (i ? 1 : -1);
                            return 0 == n ? (e.dataIndex - t.dataIndex) * (i ? -1 : 1) : n
                        })
                    }(n, i), n.length && A(t.children, function (t) {
                        e(t, i)
                    })
                }(g, v);
                var m = 0;
                A(g.children, function (e) {
                    isNaN(e.getValue()) || m++
                });
                var y = g.getValue(), k = Math.PI / (y || m) * 2, T = 0 < g.depth, w = g.height - (T ? -1 : 1),
                    C = (u - d) / (w || 1), S = e.get("clockwise"), b = e.get("stillShowZeroSum"), I = S ? 1 : -1,
                    _ = function (e, t) {
                        if (e) {
                            var i = t;
                            if (e !== f) {
                                var n = e.getValue(), a = 0 === y && b ? k : n * k;
                                a < h && (a = h), i = t + I * a;
                                var o = e.depth - p - (T ? -1 : 1), u = d + C * o, c = d + C * (1 + o),
                                    g = e.getModel();
                                null != g.get("r0") && (u = Nl(g.get("r0"), r / 2)), null != g.get("r") && (c = Nl(g.get("r"), r / 2)), e.setLayout({
                                    angle: a,
                                    startAngle: t,
                                    endAngle: i,
                                    clockwise: S,
                                    cx: s,
                                    cy: l,
                                    r0: u,
                                    r: c
                                })
                            }
                            if (e.children && e.children.length) {
                                var v = 0;
                                A(e.children, function (e) {
                                    v += _(e, t + v)
                                })
                            }
                            return i - t
                        }
                    };
                if (T) {
                    var D = d, x = d + C, N = 2 * Math.PI;
                    f.setLayout({angle: N, startAngle: c, endAngle: c + N, clockwise: S, cx: s, cy: l, r0: D, r: x})
                }
                _(g, c)
            })
        }, "sunburst")), hf(M(Xm, "sunburst"));
        var LI = ms, BI = ["itemStyle"], UI = ["emphasis", "itemStyle"], RI = ["label"], KI = ["emphasis", "label"],
            WI = "e\0\0", VI = {
                cartesian2d: function (e) {
                    var t = e.grid.getRect();
                    return {
                        coordSys: {type: "cartesian2d", x: t.x, y: t.y, width: t.width, height: t.height},
                        api: {
                            coord: function (t) {
                                return e.dataToPoint(t)
                            }, size: P(PI, e)
                        }
                    }
                }, geo: function (e) {
                    var t = e.getBoundingRect();
                    return {
                        coordSys: {type: "geo", x: t.x, y: t.y, width: t.width, height: t.height, zoom: e.getZoom()},
                        api: {
                            coord: function (t) {
                                return e.dataToPoint(t)
                            }, size: P(MI, e)
                        }
                    }
                }, singleAxis: function (e) {
                    var t = e.getRect();
                    return {
                        coordSys: {type: "singleAxis", x: t.x, y: t.y, width: t.width, height: t.height},
                        api: {
                            coord: function (t) {
                                return e.dataToPoint(t)
                            }, size: P(OI, e)
                        }
                    }
                }, polar: function (e) {
                    var t = e.getRadiusAxis(), i = e.getAngleAxis(), n = t.getExtent();
                    return n[0] > n[1] && n.reverse(), {
                        coordSys: {type: "polar", cx: e.cx, cy: e.cy, r: n[1], r0: n[0]},
                        api: {
                            coord: P(function (n) {
                                var a = t.dataToRadius(n[0]), o = i.dataToAngle(n[1]), r = e.coordToPoint([a, o]);
                                return r.push(a, o * Math.PI / 180), r
                            }), size: P(FI, e)
                        }
                    }
                }, calendar: function (e) {
                    var t = e.getRect(), i = e.getRangeInfo();
                    return {
                        coordSys: {
                            type: "calendar",
                            x: t.x,
                            y: t.y,
                            width: t.width,
                            height: t.height,
                            cellWidth: e.getCellWidth(),
                            cellHeight: e.getCellHeight(),
                            rangeInfo: {start: i.start, end: i.end, weeks: i.weeks, dayCount: i.allDay}
                        }, api: {
                            coord: function (t, i) {
                                return e.dataToPoint(t, i)
                            }
                        }
                    }
                }
            };

        function HI(e, t, i, n, a) {
            null == i[e] || a || (t[e] = i[e], i[e] = n[e])
        }

        function zI(e, t, i, n) {
            var a = e.get("renderItem"), o = e.coordinateSystem, r = {};
            o && (r = o.prepareCustoms ? o.prepareCustoms() : VI[o.type](o));
            var s, l, d, u, c, h = T({
                getWidth: n.getWidth,
                getHeight: n.getHeight,
                getZr: n.getZr,
                getDevicePixelRatio: n.getDevicePixelRatio,
                value: function (e, i) {
                    return null == i && (i = s), t.get(t.getDimension(e || 0), i)
                },
                style: function (i, n) {
                    null == n && (n = s), p(n);
                    var a = l.getModel(BI).getItemStyle();
                    null != c && (a.fill = c);
                    var o = t.getItemVisual(n, "opacity");
                    null != o && (a.opacity = o);
                    var r = i ? qI(i, d) : d;
                    return Js(a, r, null, {
                        autoColor: c,
                        isRectText: !0
                    }), a.text = r.getShallow("show") ? H(e.getFormattedLabel(n, "normal"), Mp(t, n)) : null, i && YI(a, i), a
                },
                styleEmphasis: function (i, n) {
                    null == n && (n = s), p(n);
                    var a = l.getModel(UI).getItemStyle(), o = i ? qI(i, u) : u;
                    return Js(a, o, null, {isRectText: !0}, !0), a.text = o.getShallow("show") ? z(e.getFormattedLabel(n, "emphasis"), e.getFormattedLabel(n, "normal"), Mp(t, n)) : null, i && YI(a, i), a
                },
                visual: function (e, i) {
                    return null == i && (i = s), t.getItemVisual(i, e)
                },
                barLayout: function (e) {
                    if (o.getBaseAxis) return function (e) {
                        var t = [], i = e.axis;
                        if ("category" === i.type) {
                            for (var n = i.getBandWidth(), a = 0; a < e.count; a++) t.push(T({
                                bandWidth: n,
                                axisKey: "axis0",
                                stackId: Tg + a
                            }, e));
                            var o = _g(t), r = [];
                            for (a = 0; a < e.count; a++) {
                                var s = o.axis0[Tg + a];
                                s.offsetCenter = s.offset + s.width / 2, r.push(s)
                            }
                            return r
                        }
                    }(T({axis: o.getBaseAxis()}, e))
                },
                currentSeriesIndices: function () {
                    return i.getCurrentSeriesIndices()
                },
                font: function (e) {
                    return nl(e, i)
                }
            }, r.api || {}), f = {
                context: {},
                seriesId: e.id,
                seriesName: e.name,
                seriesIndex: e.seriesIndex,
                coordSys: r.coordSys,
                dataInsideLength: t.count(),
                encode: function (e) {
                    var t = {};
                    return A(e.dimensions, function (i, n) {
                        var a = e.getDimensionInfo(i);
                        if (!a.isExtraCoord) {
                            var o = a.coordDim;
                            (t[o] = t[o] || [])[a.coordDimIndex] = n
                        }
                    }), t
                }(e.getData())
            }, g = !0;
            return function (e, i) {
                return s = e, g = !0, a && a(T({
                    dataIndexInside: e,
                    dataIndex: t.getRawIndex(e),
                    actionType: i ? i.type : null
                }, f), h)
            };

            function p(e) {
                null == e && (e = s), g && (l = t.getItemModel(e), d = l.getModel(RI), u = l.getModel(KI), c = t.getItemVisual(e, "color"), g = !1)
            }
        }

        function jI(e, t, i, n, a, o) {
            return (e = GI(e, t, i, n, a, o, !0)) && o.setItemGraphicEl(t, e), e
        }

        function GI(e, t, i, n, a, o, r) {
            var s = !i, l = (i = i || {}).type, d = i.shape, u = i.style;
            if (e && (s || null != l && l !== e.__customGraphicType || "path" === l && function (e) {
                return e && (e.hasOwnProperty("pathData") || e.hasOwnProperty("d"))
            }(d) && ZI(d) !== e.__customPathData || "image" === l && QI(u, "image") && u.image !== e.__customImagePath || "text" === l && QI(d, "text") && u.text !== e.__customText) && (a.remove(e), e = null), !s) {
                var c = !e;
                return function (e, t, i, n, a, o, r) {
                    var s = {}, l = i.style || {};
                    if (i.shape && (s.shape = v(i.shape)), i.position && (s.position = i.position.slice()), i.scale && (s.scale = i.scale.slice()), i.origin && (s.origin = i.origin.slice()), i.rotation && (s.rotation = i.rotation), "image" === e.type && i.style) {
                        var d = s.style = {};
                        A(["x", "y", "width", "height"], function (t) {
                            HI(t, d, l, e.style, o)
                        })
                    }
                    if ("text" === e.type && i.style && (d = s.style = {}, A(["x", "y"], function (t) {
                        HI(t, d, l, e.style, o)
                    }), !l.hasOwnProperty("textFill") && l.fill && (l.textFill = l.fill), !l.hasOwnProperty("textStroke") && l.stroke && (l.textStroke = l.stroke)), "group" !== e.type && (e.useStyle(l), o)) {
                        e.style.opacity = 0;
                        var u = l.opacity;
                        null == u && (u = 1), rl(e, {style: {opacity: u}}, n, t)
                    }
                    o ? e.attr(s) : ol(e, s, n, t), i.hasOwnProperty("z2") && e.attr("z2", i.z2 || 0), i.hasOwnProperty("silent") && e.attr("silent", i.silent), i.hasOwnProperty("invisible") && e.attr("invisible", i.invisible), i.hasOwnProperty("ignore") && e.attr("ignore", i.ignore), i.hasOwnProperty("info") && e.attr("info", i.info);
                    var c = i.styleEmphasis;
                    Rs(e, c), r && Gs(e, !1 !== c)
                }(e = e || function (e) {
                    var t, i = e.type;
                    if ("path" === i) {
                        var n = e.shape, a = null != n.width && null != n.height ? {
                            x: n.x || 0,
                            y: n.y || 0,
                            width: n.width,
                            height: n.height
                        } : null, o = ZI(n);
                        (t = _s(o, null, a, n.layout || "center")).__customPathData = o
                    } else if ("image" === i) (t = new qn({})).__customImagePath = e.style.image; else if ("text" === i) (t = new Rr({})).__customText = e.style.text; else if ("group" === i) t = new Di; else {
                        if ("compoundPath" === i) throw new Error('"compoundPath" is not supported yet.');
                        t = new (Is(i))
                    }
                    return t.__customGraphicType = i, t.name = e.name, t
                }(i), t, i, n, 0, c, r), "group" === l && function (e, t, i, n, a) {
                    var o = i.children, r = o ? o.length : 0, s = i.$mergeChildren,
                        l = "byName" === s || i.diffChildrenByName, d = !1 === s;
                    if (r || l || d) {
                        if (l) return function (e) {
                            new bf(e.oldChildren, e.newChildren, $I, $I, e).add(XI).update(XI).remove(JI).execute()
                        }({
                            oldChildren: e.children() || [],
                            newChildren: o || [],
                            dataIndex: t,
                            animatableModel: n,
                            group: e,
                            data: a
                        });
                        d && e.removeAll();
                        for (var u = 0; u < r; u++) o[u] && GI(e.childAt(u), t, o[u], n, e, a)
                    }
                }(e, t, i, n, o), a.add(e), e
            }
        }

        function $I(e, t) {
            var i = e && e.name;
            return null != i ? i : WI + t
        }

        function XI(e, t) {
            var i = this.context, n = null != e ? i.newChildren[e] : null;
            GI(null != t ? i.oldChildren[t] : null, i.dataIndex, n, i.animatableModel, i.group, i.data)
        }

        function qI(e, t) {
            var i = new Sl({}, t);
            return A(LI, function (t, n) {
                e.hasOwnProperty(t) && (i.option[n] = e[t])
            }), i
        }

        function YI(e, t) {
            for (var i in t) !t.hasOwnProperty(i) && LI.hasOwnProperty(i) || (e[i] = t[i])
        }

        function JI(e) {
            var t = this.context, i = t.oldChildren[e];
            i && t.group.remove(i)
        }

        function ZI(e) {
            return e && (e.pathData || e.d)
        }

        function QI(e, t) {
            return e && e.hasOwnProperty(t)
        }

        function e_(e) {
            return e.get("stack") || "__ec_stack_" + e.seriesIndex
        }

        function t_(e, t) {
            return t.dim + e.model.componentIndex
        }

        function i_(e, t) {
            Dp.call(this, "radius", e, t), this.type = "category"
        }

        ec.extend({
            type: "series.custom",
            dependencies: ["grid", "polar", "geo", "singleAxis", "calendar"],
            defaultOption: {
                coordinateSystem: "cartesian2d",
                zlevel: 0,
                z: 2,
                legendHoverLink: !0,
                useTransform: !0,
                clip: !1
            },
            getInitialData: function (e, t) {
                return rg(this.getSource(), this)
            },
            getDataParams: function (e, t, i) {
                var n = ec.prototype.getDataParams.apply(this, arguments);
                return i && (n.info = i.info), n
            }
        }), fc.extend({
            type: "custom", _data: null, render: function (e, t, i, n) {
                var a = this._data, o = e.getData(), r = this.group, s = zI(e, o, t, i);
                o.diff(a).add(function (t) {
                    jI(null, t, s(t, n), e, r, o)
                }).update(function (t, i) {
                    jI(a.getItemGraphicEl(i), t, s(t, n), e, r, o)
                }).remove(function (e) {
                    var t = a.getItemGraphicEl(e);
                    t && r.remove(t)
                }).execute();
                var l = e.get("clip", !0) ? cv(e.coordinateSystem, !1, e) : null;
                l ? r.setClipPath(l) : r.removeClipPath(), this._data = o
            }, incrementalPrepareRender: function (e, t, i) {
                this.group.removeAll(), this._data = null
            }, incrementalRender: function (e, t, i, n, a) {
                var o = t.getData(), r = zI(t, o, i, n);

                function s(e) {
                    e.isGroup || (e.incremental = !0, e.useHoverLayer = !0)
                }

                for (var l = e.start; l < e.end; l++) jI(null, l, r(l, a), t, this.group, o).traverse(s)
            }, dispose: te, filterForExposedEvent: function (e, t, i, n) {
                var a = t.element;
                if (null == a || i.name === a) return !0;
                for (; (i = i.parent) && i !== this.group;) if (i.name === a) return !0;
                return !1
            }
        }), i_.prototype = {
            constructor: i_, pointToData: function (e, t) {
                return this.polar.pointToData(e, t)["radius" === this.dim ? 0 : 1]
            }, dataToRadius: Dp.prototype.dataToCoord, radiusToData: Dp.prototype.coordToData
        }, b(i_, Dp);
        var n_ = Wa();

        function a_(e, t) {
            t = t || [0, 360], Dp.call(this, "angle", e, t), this.type = "category"
        }

        function o_(e) {
            this.name = e || "", this.cx = 0, this.cy = 0, this._radiusAxis = new i_, this._angleAxis = new a_, this._radiusAxis.polar = this._angleAxis.polar = this
        }

        a_.prototype = {
            constructor: a_,
            pointToData: function (e, t) {
                return this.polar.pointToData(e, t)["radius" === this.dim ? 0 : 1]
            },
            dataToAngle: Dp.prototype.dataToCoord,
            angleToData: Dp.prototype.coordToData,
            calculateCategoryInterval: function () {
                var e = this.getLabelModel(), t = this.scale, i = t.getExtent(), n = t.count();
                if (i[1] - i[0] < 1) return 0;
                var a = i[0], o = this.dataToCoord(a + 1) - this.dataToCoord(a), r = Math.abs(o),
                    s = cn(a, e.getFont(), "center", "top"), l = Math.max(s.height, 7) / r;
                isNaN(l) && (l = 1 / 0);
                var d = Math.max(0, Math.floor(l)), u = n_(this.model), c = u.lastAutoInterval, h = u.lastTickCount;
                return null != c && null != h && Math.abs(c - d) <= 1 && Math.abs(h - n) <= 1 && d < c ? d = c : (u.lastTickCount = n, u.lastAutoInterval = d), d
            }
        }, b(a_, Dp), o_.prototype = {
            type: "polar",
            axisPointerEnabled: !0,
            constructor: o_,
            dimensions: ["radius", "angle"],
            model: null,
            containPoint: function (e) {
                var t = this.pointToCoord(e);
                return this._radiusAxis.contain(t[0]) && this._angleAxis.contain(t[1])
            },
            containData: function (e) {
                return this._radiusAxis.containData(e[0]) && this._angleAxis.containData(e[1])
            },
            getAxis: function (e) {
                return this["_" + e + "Axis"]
            },
            getAxes: function () {
                return [this._radiusAxis, this._angleAxis]
            },
            getAxesByScale: function (e) {
                var t = [], i = this._angleAxis, n = this._radiusAxis;
                return i.scale.type === e && t.push(i), n.scale.type === e && t.push(n), t
            },
            getAngleAxis: function () {
                return this._angleAxis
            },
            getRadiusAxis: function () {
                return this._radiusAxis
            },
            getOtherAxis: function (e) {
                var t = this._angleAxis;
                return e === t ? this._radiusAxis : t
            },
            getBaseAxis: function () {
                return this.getAxesByScale("ordinal")[0] || this.getAxesByScale("time")[0] || this.getAngleAxis()
            },
            getTooltipAxes: function (e) {
                var t = null != e && "auto" !== e ? this.getAxis(e) : this.getBaseAxis();
                return {baseAxes: [t], otherAxes: [this.getOtherAxis(t)]}
            },
            dataToPoint: function (e, t) {
                return this.coordToPoint([this._radiusAxis.dataToRadius(e[0], t), this._angleAxis.dataToAngle(e[1], t)])
            },
            pointToData: function (e, t) {
                var i = this.pointToCoord(e);
                return [this._radiusAxis.radiusToData(i[0], t), this._angleAxis.angleToData(i[1], t)]
            },
            pointToCoord: function (e) {
                var t = e[0] - this.cx, i = e[1] - this.cy, n = this.getAngleAxis(), a = n.getExtent(),
                    o = Math.min(a[0], a[1]), r = Math.max(a[0], a[1]);
                n.inverse ? o = r - 360 : r = o + 360;
                var s = Math.sqrt(t * t + i * i);
                t /= s, i /= s;
                for (var l = Math.atan2(-i, t) / Math.PI * 180, d = l < o ? 1 : -1; l < o || r < l;) l += 360 * d;
                return [s, l]
            },
            coordToPoint: function (e) {
                var t = e[0], i = e[1] / 180 * Math.PI;
                return [Math.cos(i) * t + this.cx, -Math.sin(i) * t + this.cy]
            },
            getArea: function () {
                var e = this.getAngleAxis(), t = this.getRadiusAxis().getExtent().slice();
                t[0] > t[1] && t.reverse();
                var i = e.getExtent(), n = Math.PI / 180;
                return {
                    cx: this.cx,
                    cy: this.cy,
                    r0: t[0],
                    r: t[1],
                    startAngle: -i[0] * n,
                    endAngle: -i[1] * n,
                    clockwise: e.inverse,
                    contain: function (e, t) {
                        var i = e - this.cx, n = t - this.cy, a = i * i + n * n, o = this.r, r = this.r0;
                        return a <= o * o && r * r <= a
                    }
                }
            }
        };
        var r_ = Id.extend({
            type: "polarAxis", axis: null, getCoordSysModel: function () {
                return this.ecModel.queryComponents({
                    mainType: "polar",
                    index: this.option.polarIndex,
                    id: this.option.polarId
                })[0]
            }
        });

        function s_(e, t) {
            return t.type || (t.data ? "category" : "value")
        }

        function l_(e, t) {
            var i = this, n = i.getAngleAxis(), a = i.getRadiusAxis();
            if (n.scale.setExtent(1 / 0, -1 / 0), a.scale.setExtent(1 / 0, -1 / 0), e.eachSeries(function (e) {
                if (e.coordinateSystem === i) {
                    var t = e.getData();
                    A(t.mapDimension("radius", !0), function (e) {
                        a.scale.unionExtentFromData(t, og(t, e))
                    }), A(t.mapDimension("angle", !0), function (e) {
                        n.scale.unionExtentFromData(t, og(t, e))
                    })
                }
            }), Yg(n.scale, n.model), Yg(a.scale, a.model), "category" === n.type && !n.onBand) {
                var o = n.getExtent(), r = 360 / n.scale.count();
                n.inverse ? o[1] += r : o[1] -= r, n.setExtent(o[0], o[1])
            }
        }

        function d_(e, t) {
            if (e.type = t.get("type"), e.scale = Jg(t), e.onBand = t.get("boundaryGap") && "category" === e.type, e.inverse = t.get("inverse"), "angleAxis" === t.mainType) {
                e.inverse ^= t.get("clockwise");
                var i = t.get("startAngle");
                e.setExtent(i, i + (e.inverse ? -360 : 360))
            }
            (t.axis = e).model = t
        }

        m(r_.prototype, ip), Av("angle", r_, s_, {
            startAngle: 90,
            clockwise: !0,
            splitNumber: 12,
            axisLabel: {rotate: !1}
        }), Av("radius", r_, s_, {splitNumber: 5}), kf({
            type: "polar",
            dependencies: ["polarAxis", "angleAxis"],
            coordinateSystem: null,
            findAxisModel: function (e) {
                var t;
                return this.ecModel.eachComponent(e, function (e) {
                    e.getCoordSysModel() === this && (t = e)
                }, this), t
            },
            defaultOption: {zlevel: 0, z: 0, center: ["50%", "50%"], radius: "80%"}
        }), iu.register("polar", {
            dimensions: o_.prototype.dimensions, create: function (e, t) {
                var i = [];
                return e.eachComponent("polar", function (e, n) {
                    var a = new o_(n);
                    a.update = l_;
                    var o = a.getRadiusAxis(), r = a.getAngleAxis(), s = e.findAxisModel("radiusAxis"),
                        l = e.findAxisModel("angleAxis");
                    d_(o, s), d_(r, l), function (e, t, i) {
                        var n = t.get("center"), a = i.getWidth(), o = i.getHeight();
                        e.cx = Nl(n[0], a), e.cy = Nl(n[1], o);
                        var r = e.getRadiusAxis(), s = Math.min(a, o) / 2, l = t.get("radius");
                        null == l ? l = [0, "100%"] : O(l) || (l = [0, l]), l = [Nl(l[0], s), Nl(l[1], s)], r.inverse ? r.setExtent(l[1], l[0]) : r.setExtent(l[0], l[1])
                    }(a, e, t), i.push(a), (e.coordinateSystem = a).model = e
                }), e.eachSeries(function (t) {
                    if ("polar" === t.get("coordinateSystem")) {
                        var i = e.queryComponents({
                            mainType: "polar",
                            index: t.get("polarIndex"),
                            id: t.get("polarId")
                        })[0];
                        t.coordinateSystem = i.coordinateSystem
                    }
                }), i
            }
        });
        var u_ = ["axisLine", "axisLabel", "axisTick", "minorTick", "splitLine", "minorSplitLine", "splitArea"];

        function c_(e, t, i) {
            t[1] > t[0] && (t = t.slice().reverse());
            var n = e.coordToPoint([t[0], i]), a = e.coordToPoint([t[1], i]);
            return {x1: n[0], y1: n[1], x2: a[0], y2: a[1]}
        }

        function h_(e) {
            return e.getRadiusAxis().inverse ? 0 : 1
        }

        function f_(e) {
            var t = e[0], i = e[e.length - 1];
            t && i && Math.abs(Math.abs(t.coord - i.coord) - 360) < 1e-4 && e.pop()
        }

        im.extend({
            type: "angleAxis", axisPointerClass: "PolarAxisPointer", render: function (e, t) {
                if (this.group.removeAll(), e.get("show")) {
                    var i = e.axis, n = i.polar, a = n.getRadiusAxis().getExtent(), o = i.getTicksCoords(),
                        r = i.getMinorTicksCoords(), s = D(i.getViewLabels(), function (e) {
                            return (e = v(e)).coord = i.dataToCoord(e.tickValue), e
                        });
                    f_(s), f_(o), A(u_, function (t) {
                        !e.get(t + ".show") || i.scale.isBlank() && "axisLine" !== t || this["_" + t](e, n, o, r, a, s)
                    }, this)
                }
            }, _axisLine: function (e, t, i, n, a) {
                var o, r = e.getModel("axisLine.lineStyle"), s = h_(t), l = s ? 0 : 1;
                (o = 0 === a[l] ? new Wr({
                    shape: {cx: t.cx, cy: t.cy, r: a[s]},
                    style: r.getLineStyle(),
                    z2: 1,
                    silent: !0
                }) : new zr({
                    shape: {cx: t.cx, cy: t.cy, r: a[s], r0: a[l]},
                    style: r.getLineStyle(),
                    z2: 1,
                    silent: !0
                })).style.fill = null, this.group.add(o)
            }, _axisTick: function (e, t, i, n, a) {
                var o = e.getModel("axisTick"), r = (o.get("inside") ? -1 : 1) * o.get("length"), s = a[h_(t)],
                    l = D(i, function (e) {
                        return new is({shape: c_(t, [s, s + r], e.coord)})
                    });
                this.group.add(xs(l, {style: T(o.getModel("lineStyle").getLineStyle(), {stroke: e.get("axisLine.lineStyle.color")})}))
            }, _minorTick: function (e, t, i, n, a) {
                if (n.length) {
                    for (var o = e.getModel("axisTick"), r = e.getModel("minorTick"), s = (o.get("inside") ? -1 : 1) * r.get("length"), l = a[h_(t)], d = [], u = 0; u < n.length; u++) for (var c = 0; c < n[u].length; c++) d.push(new is({shape: c_(t, [l, l + s], n[u][c].coord)}));
                    this.group.add(xs(d, {style: T(r.getModel("lineStyle").getLineStyle(), T(o.getLineStyle(), {stroke: e.get("axisLine.lineStyle.color")}))}))
                }
            }, _axisLabel: function (e, t, i, n, a, o) {
                var r = e.getCategories(!0), s = e.getModel("axisLabel"), l = s.get("margin"),
                    d = e.get("triggerEvent");
                A(o, function (i, n) {
                    var o = s, u = i.tickValue, c = a[h_(t)], h = t.coordToPoint([c + l, i.coord]), f = t.cx, g = t.cy,
                        p = Math.abs(h[0] - f) / c < .3 ? "center" : h[0] > f ? "left" : "right",
                        v = Math.abs(h[1] - g) / c < .3 ? "middle" : h[1] > g ? "top" : "bottom";
                    r && r[u] && r[u].textStyle && (o = new Sl(r[u].textStyle, s, s.ecModel));
                    var m = new Rr({silent: Kv.isLabelSilent(e)});
                    this.group.add(m), Js(m.style, o, {
                        x: h[0],
                        y: h[1],
                        textFill: o.getTextColor() || e.get("axisLine.lineStyle.color"),
                        text: i.formattedLabel,
                        textAlign: p,
                        textVerticalAlign: v
                    }), d && (m.eventData = Kv.makeAxisEventDataBase(e), m.eventData.targetType = "axisLabel", m.eventData.value = i.rawLabel)
                }, this)
            }, _splitLine: function (e, t, i, n, a) {
                var o = e.getModel("splitLine").getModel("lineStyle"), r = o.get("color"), s = 0;
                r = r instanceof Array ? r : [r];
                for (var l = [], d = 0; d < i.length; d++) {
                    var u = s++ % r.length;
                    l[u] = l[u] || [], l[u].push(new is({shape: c_(t, a, i[d].coord)}))
                }
                for (d = 0; d < l.length; d++) this.group.add(xs(l[d], {
                    style: T({stroke: r[d % r.length]}, o.getLineStyle()),
                    silent: !0,
                    z: e.get("z")
                }))
            }, _minorSplitLine: function (e, t, i, n, a) {
                if (n.length) {
                    for (var o = e.getModel("minorSplitLine").getModel("lineStyle"), r = [], s = 0; s < n.length; s++) for (var l = 0; l < n[s].length; l++) r.push(new is({shape: c_(t, a, n[s][l].coord)}));
                    this.group.add(xs(r, {style: o.getLineStyle(), silent: !0, z: e.get("z")}))
                }
            }, _splitArea: function (e, t, i, n, a) {
                if (i.length) {
                    var o = e.getModel("splitArea").getModel("areaStyle"), r = o.get("color"), s = 0;
                    r = r instanceof Array ? r : [r];
                    for (var l = [], d = Math.PI / 180, u = -i[0].coord * d, c = Math.min(a[0], a[1]), h = Math.max(a[0], a[1]), f = e.get("clockwise"), g = 1; g < i.length; g++) {
                        var p = s++ % r.length;
                        l[p] = l[p] || [], l[p].push(new Hr({
                            shape: {
                                cx: t.cx,
                                cy: t.cy,
                                r0: c,
                                r: h,
                                startAngle: u,
                                endAngle: -i[g].coord * d,
                                clockwise: f
                            }, silent: !0
                        })), u = -i[g].coord * d
                    }
                    for (g = 0; g < l.length; g++) this.group.add(xs(l[g], {
                        style: T({fill: r[g % r.length]}, o.getAreaStyle()),
                        silent: !0
                    }))
                }
            }
        });
        var g_ = ["axisLine", "axisTickLabel", "axisName"], p_ = ["splitLine", "splitArea", "minorSplitLine"];
        im.extend({
            type: "radiusAxis", axisPointerClass: "PolarAxisPointer", render: function (e, t) {
                if (this.group.removeAll(), e.get("show")) {
                    var i = e.axis, n = i.polar, a = n.getAngleAxis(), o = i.getTicksCoords(),
                        r = i.getMinorTicksCoords(), s = a.getExtent()[0], l = i.getExtent(), d = function (e, t, i) {
                            return {
                                position: [e.cx, e.cy],
                                rotation: i / 180 * Math.PI,
                                labelDirection: -1,
                                tickDirection: -1,
                                nameDirection: 1,
                                labelRotate: t.getModel("axisLabel").get("rotate"),
                                z2: 1
                            }
                        }(n, e, s), u = new Kv(e, d);
                    A(g_, u.add, u), this.group.add(u.getGroup()), A(p_, function (t) {
                        e.get(t + ".show") && !i.scale.isBlank() && this["_" + t](e, n, s, l, o, r)
                    }, this)
                }
            }, _splitLine: function (e, t, i, n, a) {
                var o = e.getModel("splitLine").getModel("lineStyle"), r = o.get("color"), s = 0;
                r = r instanceof Array ? r : [r];
                for (var l = [], d = 0; d < a.length; d++) {
                    var u = s++ % r.length;
                    l[u] = l[u] || [], l[u].push(new Wr({shape: {cx: t.cx, cy: t.cy, r: a[d].coord}}))
                }
                for (d = 0; d < l.length; d++) this.group.add(xs(l[d], {
                    style: T({
                        stroke: r[d % r.length],
                        fill: null
                    }, o.getLineStyle()), silent: !0
                }))
            }, _minorSplitLine: function (e, t, i, n, a, o) {
                if (o.length) {
                    for (var r = e.getModel("minorSplitLine").getModel("lineStyle"), s = [], l = 0; l < o.length; l++) for (var d = 0; d < o[l].length; d++) s.push(new Wr({
                        shape: {
                            cx: t.cx,
                            cy: t.cy,
                            r: o[l][d].coord
                        }
                    }));
                    this.group.add(xs(s, {style: T({fill: null}, r.getLineStyle()), silent: !0}))
                }
            }, _splitArea: function (e, t, i, n, a) {
                if (a.length) {
                    var o = e.getModel("splitArea").getModel("areaStyle"), r = o.get("color"), s = 0;
                    r = r instanceof Array ? r : [r];
                    for (var l = [], d = a[0].coord, u = 1; u < a.length; u++) {
                        var c = s++ % r.length;
                        l[c] = l[c] || [], l[c].push(new Hr({
                            shape: {
                                cx: t.cx,
                                cy: t.cy,
                                r0: d,
                                r: a[u].coord,
                                startAngle: 0,
                                endAngle: 2 * Math.PI
                            }, silent: !0
                        })), d = a[u].coord
                    }
                    for (u = 0; u < l.length; u++) this.group.add(xs(l[u], {
                        style: T({fill: r[u % r.length]}, o.getAreaStyle()),
                        silent: !0
                    }))
                }
            }
        });
        var v_ = eI.extend({
            makeElOption: function (e, t, i, n, a) {
                var o = i.axis;
                "angle" === o.dim && (this.animationThreshold = Math.PI / 18);
                var r, s = o.polar, l = s.getOtherAxis(o).getExtent();
                r = o["dataTo" + sd(o.dim)](t);
                var d = n.get("type");
                if (d && "none" !== d) {
                    var u = oI(n), c = m_[d](o, s, r, l, u);
                    c.style = u, e.graphicKey = c.type, e.pointer = c
                }
                var h = n.get("label.margin");
                rI(e, i, n, a, function (e, t, i, n, a) {
                    var o = t.axis, r = o.dataToCoord(e), s = n.getAngleAxis().getExtent()[0];
                    s = s / 180 * Math.PI;
                    var l, d, u, c = n.getRadiusAxis().getExtent();
                    if ("radius" === o.dim) {
                        var h = ot();
                        ut(h, h, s), dt(h, h, [n.cx, n.cy]), l = ll([r, -a], h);
                        var f = t.getModel("axisLabel").get("rotate") || 0,
                            g = Kv.innerTextLayout(s, f * Math.PI / 180, -1);
                        d = g.textAlign, u = g.textVerticalAlign
                    } else {
                        var p = c[1];
                        l = n.coordToPoint([p + a, r]);
                        var v = n.cx, m = n.cy;
                        d = Math.abs(l[0] - v) / p < .3 ? "center" : l[0] > v ? "left" : "right", u = Math.abs(l[1] - m) / p < .3 ? "middle" : l[1] > m ? "top" : "bottom"
                    }
                    return {position: l, align: d, verticalAlign: u}
                }(t, i, 0, s, h))
            }
        }), m_ = {
            line: function (e, t, i, n, a) {
                return "angle" === e.dim ? {
                    type: "Line",
                    shape: uI(t.coordToPoint([n[0], i]), t.coordToPoint([n[1], i]))
                } : {type: "Circle", shape: {cx: t.cx, cy: t.cy, r: i}}
            }, shadow: function (e, t, i, n, a) {
                var o = Math.max(1, e.getBandWidth()), r = Math.PI / 180;
                return "angle" === e.dim ? {
                    type: "Sector",
                    shape: hI(t.cx, t.cy, n[0], n[1], (-i - o / 2) * r, (o / 2 - i) * r)
                } : {type: "Sector", shape: hI(t.cx, t.cy, i - o / 2, i + o / 2, 0, 2 * Math.PI)}
            }
        };

        function y_(e, t) {
            t.update = "updateView", ff(t, function (t, i) {
                var n = {};
                return i.eachComponent({mainType: "geo", query: t}, function (i) {
                    i[e](t.name), A(i.coordinateSystem.regions, function (e) {
                        n[e.name] = i.isSelected(e.name) || !1
                    })
                }), {selected: n, name: t.name}
            })
        }

        function k_(e, t, i) {
            this._model = e
        }

        function T_(e, t, i, n) {
            var a = i.calendarModel, o = i.seriesModel, r = a ? a.coordinateSystem : o ? o.coordinateSystem : null;
            return r === this ? r[e](n) : null
        }

        im.registerAxisPointerClass("PolarAxisPointer", v_), pf(M(function (e, t, i) {
            var n = {}, a = function (e) {
                var t = {};
                A(e, function (e, i) {
                    var n = e.getData(), a = e.coordinateSystem, o = a.getBaseAxis(), r = t_(a, o), s = o.getExtent(),
                        l = "category" === o.type ? o.getBandWidth() : Math.abs(s[1] - s[0]) / n.count(), d = t[r] || {
                            bandWidth: l,
                            remainedWidth: l,
                            autoWidthCount: 0,
                            categoryGap: "20%",
                            gap: "30%",
                            stacks: {}
                        }, u = d.stacks;
                    t[r] = d;
                    var c = e_(e);
                    u[c] || d.autoWidthCount++, u[c] = u[c] || {width: 0, maxWidth: 0};
                    var h = Nl(e.get("barWidth"), l), f = Nl(e.get("barMaxWidth"), l), g = e.get("barGap"),
                        p = e.get("barCategoryGap");
                    h && !u[c].width && (h = Math.min(d.remainedWidth, h), u[c].width = h, d.remainedWidth -= h), f && (u[c].maxWidth = f), null != g && (d.gap = g), null != p && (d.categoryGap = p)
                });
                var i = {};
                return A(t, function (e, t) {
                    i[t] = {};
                    var n = e.stacks, a = e.bandWidth, o = Nl(e.categoryGap, a), r = Nl(e.gap, 1), s = e.remainedWidth,
                        l = e.autoWidthCount, d = (s - o) / (l + (l - 1) * r);
                    d = Math.max(d, 0), A(n, function (e, t) {
                        var i = e.maxWidth;
                        i && i < d && (i = Math.min(i, s), e.width && (i = Math.min(i, e.width)), s -= i, e.width = i, l--)
                    }), d = (s - o) / (l + (l - 1) * r), d = Math.max(d, 0);
                    var u, c = 0;
                    A(n, function (e, t) {
                        e.width || (e.width = d), c += (u = e).width * (1 + r)
                    }), u && (c -= u.width * r);
                    var h = -c / 2;
                    A(n, function (e, n) {
                        i[t][n] = i[t][n] || {offset: h, width: e.width}, h += e.width * (1 + r)
                    })
                }), i
            }(N(t.getSeriesByType(e), function (e) {
                return !t.isSeriesFiltered(e) && e.coordinateSystem && "polar" === e.coordinateSystem.type
            }));
            t.eachSeriesByType(e, function (e) {
                if ("polar" === e.coordinateSystem.type) {
                    var t = e.getData(), i = e.coordinateSystem, o = i.getBaseAxis(), r = t_(i, o), s = e_(e),
                        l = a[r][s], d = l.offset, u = l.width, c = i.getOtherAxis(o), h = e.coordinateSystem.cx,
                        f = e.coordinateSystem.cy, g = e.get("barMinHeight") || 0, p = e.get("barMinAngle") || 0;
                    n[s] = n[s] || [];
                    for (var v = t.mapDimension(c.dim), m = t.mapDimension(o.dim), y = ag(t, v), k = "radius" !== o.dim || !e.get("roundCap", !0), T = c.getExtent()[0], w = 0, C = t.count(); w < C; w++) {
                        var S, b, I, _, A = t.get(v, w), D = t.get(m, w), x = 0 <= A ? "p" : "n", N = T;
                        if (y && (n[s][D] || (n[s][D] = {p: T, n: T}), N = n[s][D][x]), "radius" === c.dim) {
                            var E = c.dataToRadius(A) - T, P = o.dataToAngle(D);
                            Math.abs(E) < g && (E = (E < 0 ? -1 : 1) * g), b = (S = N) + E, _ = (I = P - d) - u, y && (n[s][D][x] = b)
                        } else {
                            var M = c.dataToAngle(A, k) - T, O = o.dataToRadius(D);
                            Math.abs(M) < p && (M = (M < 0 ? -1 : 1) * p), b = (S = O + d) + u, _ = (I = N) + M, y && (n[s][D][x] = _)
                        }
                        t.setItemLayout(w, {
                            cx: h,
                            cy: f,
                            r0: S,
                            r: b,
                            startAngle: -I * Math.PI / 180,
                            endAngle: -_ * Math.PI / 180
                        })
                    }
                }
            }, this)
        }, "bar")), Tf({type: "polar"}), I(Id.extend({
            type: "geo",
            coordinateSystem: null,
            layoutMode: "box",
            init: function (e) {
                Id.prototype.init.apply(this, arguments), Ma(e, "label", ["show"])
            },
            optionUpdated: function () {
                var e = this.option, t = this;
                e.regions = Zy.getFilledRegions(e.regions, e.map, e.nameMap), this._optionModelMap = x(e.regions || [], function (e, i) {
                    return i.name && e.set(i.name, new Sl(i, t)), e
                }, Q()), this.updateSelectedMap(e.regions)
            },
            defaultOption: {
                zlevel: 0,
                z: 0,
                show: !0,
                left: "center",
                top: "center",
                aspectScale: null,
                silent: !1,
                map: "",
                boundingCoords: null,
                center: null,
                zoom: 1,
                scaleLimit: null,
                label: {show: !1, color: "#000"},
                itemStyle: {borderWidth: .5, borderColor: "#444", color: "#eee"},
                emphasis: {label: {show: !0, color: "rgb(100,0,0)"}, itemStyle: {color: "rgba(255,215,0,0.8)"}},
                regions: []
            },
            getRegionModel: function (e) {
                return this._optionModelMap.get(e) || new Sl(null, this, this.ecModel)
            },
            getFormattedLabel: function (e, t) {
                var i = this.getRegionModel(e).get("label" + ("normal" === t ? "." : t + ".") + "formatter"),
                    n = {name: e};
                return "function" == typeof i ? (n.status = t, i(n)) : "string" == typeof i ? i.replace("{a}", null != e ? e : "") : void 0
            },
            setZoom: function (e) {
                this.option.zoom = e
            },
            setCenter: function (e) {
                this.option.center = e
            }
        }), Om), Tf({
            type: "geo", init: function (e, t) {
                var i = new Uy(t, !0);
                this._mapDraw = i, this.group.add(i.group)
            }, render: function (e, t, i, n) {
                if (!n || "geoToggleSelect" !== n.type || n.from !== this.uid) {
                    var a = this._mapDraw;
                    e.get("show") ? a.draw(e, t, i, this, n) : this._mapDraw.group.removeAll(), this.group.silent = e.get("silent")
                }
            }, dispose: function () {
                this._mapDraw && this._mapDraw.remove()
            }
        }), y_("toggleSelected", {type: "geoToggleSelect", event: "geoselectchanged"}), y_("select", {
            type: "geoSelect",
            event: "geoselected"
        }), y_("unSelect", {type: "geoUnSelect", event: "geounselected"}), k_.prototype = {
            constructor: k_,
            type: "calendar",
            dimensions: ["time", "value"],
            getDimensionsInfo: function () {
                return [{name: "time", type: "time"}, "value"]
            },
            getRangeInfo: function () {
                return this._rangeInfo
            },
            getModel: function () {
                return this._model
            },
            getRect: function () {
                return this._rect
            },
            getCellWidth: function () {
                return this._sw
            },
            getCellHeight: function () {
                return this._sh
            },
            getOrient: function () {
                return this._orient
            },
            getFirstDayOfWeek: function () {
                return this._firstDayOfWeek
            },
            getDateInfo: function (e) {
                var t = (e = Wl(e)).getFullYear(), i = e.getMonth() + 1;
                i = i < 10 ? "0" + i : i;
                var n = e.getDate();
                n = n < 10 ? "0" + n : n;
                var a = e.getDay();
                return {
                    y: t,
                    m: i,
                    d: n,
                    day: a = Math.abs((a + 7 - this.getFirstDayOfWeek()) % 7),
                    time: e.getTime(),
                    formatedDate: t + "-" + i + "-" + n,
                    date: e
                }
            },
            getNextNDay: function (e, t) {
                return 0 === (t = t || 0) || (e = new Date(this.getDateInfo(e).time)).setDate(e.getDate() + t), this.getDateInfo(e)
            },
            update: function (e, t) {
                this._firstDayOfWeek = +this._model.getModel("dayLabel").get("firstDay"), this._orient = this._model.get("orient"), this._lineWidth = this._model.getModel("itemStyle").getItemStyle().lineWidth || 0, this._rangeInfo = this._getRangeInfo(this._initRangeOption());
                var i = this._rangeInfo.weeks || 1, n = ["width", "height"], a = this._model.get("cellSize").slice(),
                    o = this._model.getBoxLayoutParams(), r = "horizontal" === this._orient ? [i, 7] : [7, i];
                A([0, 1], function (e) {
                    d(a, e) && (o[n[e]] = a[e] * r[e])
                });
                var s = {width: t.getWidth(), height: t.getHeight()}, l = this._rect = vd(o, s);

                function d(e, t) {
                    return null != e[t] && "auto" !== e[t]
                }

                A([0, 1], function (e) {
                    d(a, e) || (a[e] = l[n[e]] / r[e])
                }), this._sw = a[0], this._sh = a[1]
            },
            dataToPoint: function (e, t) {
                O(e) && (e = e[0]), null == t && (t = !0);
                var i = this.getDateInfo(e), n = this._rangeInfo, a = i.formatedDate;
                if (t && !(i.time >= n.start.time && i.time < n.end.time + 864e5)) return [NaN, NaN];
                var o = i.day, r = this._getRangeInfo([n.start.time, a]).nthWeek;
                return "vertical" === this._orient ? [this._rect.x + o * this._sw + this._sw / 2, this._rect.y + r * this._sh + this._sh / 2] : [this._rect.x + r * this._sw + this._sw / 2, this._rect.y + o * this._sh + this._sh / 2]
            },
            pointToData: function (e) {
                var t = this.pointToDate(e);
                return t && t.time
            },
            dataToRect: function (e, t) {
                var i = this.dataToPoint(e, t);
                return {
                    contentShape: {
                        x: i[0] - (this._sw - this._lineWidth) / 2,
                        y: i[1] - (this._sh - this._lineWidth) / 2,
                        width: this._sw - this._lineWidth,
                        height: this._sh - this._lineWidth
                    },
                    center: i,
                    tl: [i[0] - this._sw / 2, i[1] - this._sh / 2],
                    tr: [i[0] + this._sw / 2, i[1] - this._sh / 2],
                    br: [i[0] + this._sw / 2, i[1] + this._sh / 2],
                    bl: [i[0] - this._sw / 2, i[1] + this._sh / 2]
                }
            },
            pointToDate: function (e) {
                var t = Math.floor((e[0] - this._rect.x) / this._sw) + 1,
                    i = Math.floor((e[1] - this._rect.y) / this._sh) + 1, n = this._rangeInfo.range;
                return "vertical" === this._orient ? this._getDateByWeeksAndDay(i, t - 1, n) : this._getDateByWeeksAndDay(t, i - 1, n)
            },
            convertToPixel: M(T_, "dataToPoint"),
            convertFromPixel: M(T_, "pointToData"),
            _initRangeOption: function () {
                var e = this._model.get("range"), t = e;
                if (O(t) && 1 === t.length && (t = t[0]), /^\d{4}$/.test(t) && (e = [t + "-01-01", t + "-12-31"]), /^\d{4}[\/|-]\d{1,2}$/.test(t)) {
                    var i = this.getDateInfo(t), n = i.date;
                    n.setMonth(n.getMonth() + 1);
                    var a = this.getNextNDay(n, -1);
                    e = [i.formatedDate, a.formatedDate]
                }
                /^\d{4}[\/|-]\d{1,2}[\/|-]\d{1,2}$/.test(t) && (e = [t, t]);
                var o = this._getRangeInfo(e);
                return o.start.time > o.end.time && e.reverse(), e
            },
            _getRangeInfo: function (e) {
                var t;
                (e = [this.getDateInfo(e[0]), this.getDateInfo(e[1])])[0].time > e[1].time && (t = !0, e.reverse());
                var i = Math.floor(e[1].time / 864e5) - Math.floor(e[0].time / 864e5) + 1, n = new Date(e[0].time),
                    a = n.getDate(), o = e[1].date.getDate();
                n.setDate(a + i - 1);
                var r = n.getDate();
                if (r !== o) for (var s = 0 < n.getTime() - e[1].time ? 1 : -1; (r = n.getDate()) !== o && 0 < (n.getTime() - e[1].time) * s;) i -= s, n.setDate(r - s);
                var l = Math.floor((i + e[0].day + 6) / 7), d = t ? 1 - l : l - 1;
                return t && e.reverse(), {
                    range: [e[0].formatedDate, e[1].formatedDate],
                    start: e[0],
                    end: e[1],
                    allDay: i,
                    weeks: l,
                    nthWeek: d,
                    fweek: e[0].day,
                    lweek: e[1].day
                }
            },
            _getDateByWeeksAndDay: function (e, t, i) {
                var n = this._getRangeInfo(i);
                if (e > n.weeks || 0 === e && t < n.fweek || e === n.weeks && t > n.lweek) return !1;
                var a = 7 * (e - 1) - n.fweek + t, o = new Date(n.start.time);
                return o.setDate(n.start.d + a), this.getDateInfo(o)
            }
        }, k_.dimensions = k_.prototype.dimensions, k_.getDimensionsInfo = k_.prototype.getDimensionsInfo, k_.create = function (e, t) {
            var i = [];
            return e.eachComponent("calendar", function (n) {
                var a = new k_(n, e, t);
                i.push(a), n.coordinateSystem = a
            }), e.eachSeries(function (e) {
                "calendar" === e.get("coordinateSystem") && (e.coordinateSystem = i[e.get("calendarIndex") || 0])
            }), i
        }, iu.register("calendar", k_);
        var w_ = Id.extend({
            type: "calendar",
            coordinateSystem: null,
            defaultOption: {
                zlevel: 0,
                z: 2,
                left: 80,
                top: 60,
                cellSize: 20,
                orient: "horizontal",
                splitLine: {show: !0, lineStyle: {color: "#000", width: 1, type: "solid"}},
                itemStyle: {color: "#fff", borderWidth: 1, borderColor: "#ccc"},
                dayLabel: {show: !0, firstDay: 0, position: "start", margin: "50%", nameMap: "en", color: "#000"},
                monthLabel: {
                    show: !0,
                    position: "start",
                    margin: 5,
                    align: "center",
                    nameMap: "en",
                    formatter: null,
                    color: "#000"
                },
                yearLabel: {
                    show: !0,
                    position: null,
                    margin: 30,
                    formatter: null,
                    color: "#ccc",
                    fontFamily: "sans-serif",
                    fontWeight: "bolder",
                    fontSize: 20
                }
            },
            init: function (e, t, i, n) {
                var a = kd(e);
                w_.superApply(this, "init", arguments), C_(e, a)
            },
            mergeOption: function (e, t) {
                w_.superApply(this, "mergeOption", arguments), C_(this.option, e)
            }
        });

        function C_(e, t) {
            var i = e.cellSize;
            O(i) ? 1 === i.length && (i[1] = i[0]) : i = e.cellSize = [i, i];
            var n = D([0, 1], function (e) {
                return function (e, t) {
                    return null != e[fd[t][0]] || null != e[fd[t][1]] && null != e[fd[t][2]]
                }(t, e) && (i[e] = "auto"), null != i[e] && "auto" !== i[e]
            });
            yd(e, t, {type: "box", ignoreSize: n})
        }

        var S_ = {
            EN: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
            CN: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"]
        }, b_ = {EN: ["S", "M", "T", "W", "T", "F", "S"], CN: ["日", "一", "二", "三", "四", "五", "六"]};
        Tf({
            type: "calendar",
            _tlpoints: null,
            _blpoints: null,
            _firstDayOfMonth: null,
            _firstDayPoints: null,
            render: function (e, t, i) {
                var n = this.group;
                n.removeAll();
                var a = e.coordinateSystem, o = a.getRangeInfo(), r = a.getOrient();
                this._renderDayRect(e, o, n), this._renderLines(e, o, r, n), this._renderYearText(e, o, r, n), this._renderMonthText(e, r, n), this._renderWeekText(e, o, r, n)
            },
            _renderDayRect: function (e, t, i) {
                for (var n = e.coordinateSystem, a = e.getModel("itemStyle").getItemStyle(), o = n.getCellWidth(), r = n.getCellHeight(), s = t.start.time; s <= t.end.time; s = n.getNextNDay(s, 1).time) {
                    var l = n.dataToRect([s], !1).tl,
                        d = new es({shape: {x: l[0], y: l[1], width: o, height: r}, cursor: "default", style: a});
                    i.add(d)
                }
            },
            _renderLines: function (e, t, i, n) {
                var a = this, o = e.coordinateSystem, r = e.getModel("splitLine.lineStyle").getLineStyle(),
                    s = e.get("splitLine.show"), l = r.lineWidth;
                this._tlpoints = [], this._blpoints = [], this._firstDayOfMonth = [], this._firstDayPoints = [];
                for (var d = t.start, u = 0; d.time <= t.end.time; u++) {
                    h(d.formatedDate), 0 === u && (d = o.getDateInfo(t.start.y + "-" + t.start.m));
                    var c = d.date;
                    c.setMonth(c.getMonth() + 1), d = o.getDateInfo(c)
                }

                function h(t) {
                    a._firstDayOfMonth.push(o.getDateInfo(t)), a._firstDayPoints.push(o.dataToRect([t], !1).tl);
                    var l = a._getLinePointsOfOneWeek(e, t, i);
                    a._tlpoints.push(l[0]), a._blpoints.push(l[l.length - 1]), s && a._drawSplitline(l, r, n)
                }

                h(o.getNextNDay(t.end.time, 1).formatedDate), s && this._drawSplitline(a._getEdgesPoints(a._tlpoints, l, i), r, n), s && this._drawSplitline(a._getEdgesPoints(a._blpoints, l, i), r, n)
            },
            _getEdgesPoints: function (e, t, i) {
                var n = [e[0].slice(), e[e.length - 1].slice()], a = "horizontal" === i ? 0 : 1;
                return n[0][a] = n[0][a] - t / 2, n[1][a] = n[1][a] + t / 2, n
            },
            _drawSplitline: function (e, t, i) {
                var n = new Xr({z2: 20, shape: {points: e}, style: t});
                i.add(n)
            },
            _getLinePointsOfOneWeek: function (e, t, i) {
                var n = e.coordinateSystem;
                t = n.getDateInfo(t);
                for (var a = [], o = 0; o < 7; o++) {
                    var r = n.getNextNDay(t.time, o), s = n.dataToRect([r.time], !1);
                    a[2 * r.day] = s.tl, a[2 * r.day + 1] = s["horizontal" === i ? "bl" : "tr"]
                }
                return a
            },
            _formatterLabel: function (e, t) {
                return "string" == typeof e && e ? nd(e, t) : "function" == typeof e ? e(t) : t.nameMap
            },
            _yearTextPositionControl: function (e, t, i, n, a) {
                t = t.slice();
                var o = ["center", "bottom"];
                "bottom" === n ? (t[1] += a, o = ["center", "top"]) : "left" === n ? t[0] -= a : "right" === n ? (t[0] += a, o = ["center", "top"]) : t[1] -= a;
                var r = 0;
                return "left" !== n && "right" !== n || (r = Math.PI / 2), {
                    rotation: r,
                    position: t,
                    style: {textAlign: o[0], textVerticalAlign: o[1]}
                }
            },
            _renderYearText: function (e, t, i, n) {
                var a = e.getModel("yearLabel");
                if (a.get("show")) {
                    var o = a.get("margin"), r = a.get("position");
                    r = r || ("horizontal" !== i ? "top" : "left");
                    var s = [this._tlpoints[this._tlpoints.length - 1], this._blpoints[0]], l = (s[0][0] + s[1][0]) / 2,
                        d = (s[0][1] + s[1][1]) / 2, u = "horizontal" === i ? 0 : 1,
                        c = {top: [l, s[u][1]], bottom: [l, s[1 - u][1]], left: [s[1 - u][0], d], right: [s[u][0], d]},
                        h = t.start.y;
                    +t.end.y > +t.start.y && (h = h + "-" + t.end.y);
                    var f = a.get("formatter"), g = {start: t.start.y, end: t.end.y, nameMap: h},
                        p = this._formatterLabel(f, g), v = new Rr({z2: 30});
                    Js(v.style, a, {text: p}), v.attr(this._yearTextPositionControl(v, c[r], i, r, o)), n.add(v)
                }
            },
            _monthTextPositionControl: function (e, t, i, n, a) {
                var o = "left", r = "top", s = e[0], l = e[1];
                return "horizontal" === i ? (l += a, t && (o = "center"), "start" === n && (r = "bottom")) : (s += a, t && (r = "middle"), "start" === n && (o = "right")), {
                    x: s,
                    y: l,
                    textAlign: o,
                    textVerticalAlign: r
                }
            },
            _renderMonthText: function (e, t, i) {
                var n = e.getModel("monthLabel");
                if (n.get("show")) {
                    var a = n.get("nameMap"), o = n.get("margin"), r = n.get("position"), s = n.get("align"),
                        l = [this._tlpoints, this._blpoints];
                    L(a) && (a = S_[a.toUpperCase()] || []);
                    var d = "start" === r ? 0 : 1, u = "horizontal" === t ? 0 : 1;
                    o = "start" === r ? -o : o;
                    for (var c = "center" === s, h = 0; h < l[d].length - 1; h++) {
                        var f = l[d][h].slice(), g = this._firstDayOfMonth[h];
                        if (c) {
                            var p = this._firstDayPoints[h];
                            f[u] = (p[u] + l[0][h + 1][u]) / 2
                        }
                        var v = n.get("formatter"), m = a[+g.m - 1],
                            y = {yyyy: g.y, yy: (g.y + "").slice(2), MM: g.m, M: +g.m, nameMap: m},
                            T = this._formatterLabel(v, y), w = new Rr({z2: 30});
                        k(Js(w.style, n, {text: T}), this._monthTextPositionControl(f, c, t, r, o)), i.add(w)
                    }
                }
            },
            _weekTextPositionControl: function (e, t, i, n, a) {
                var o = "center", r = "middle", s = e[0], l = e[1], d = "start" === i;
                return "horizontal" === t ? (s = s + n + (d ? 1 : -1) * a[0] / 2, o = d ? "right" : "left") : (l = l + n + (d ? 1 : -1) * a[1] / 2, r = d ? "bottom" : "top"), {
                    x: s,
                    y: l,
                    textAlign: o,
                    textVerticalAlign: r
                }
            },
            _renderWeekText: function (e, t, i, n) {
                var a = e.getModel("dayLabel");
                if (a.get("show")) {
                    var o = e.coordinateSystem, r = a.get("position"), s = a.get("nameMap"), l = a.get("margin"),
                        d = o.getFirstDayOfWeek();
                    L(s) && (s = b_[s.toUpperCase()] || []);
                    var u = o.getNextNDay(t.end.time, 7 - t.lweek).time, c = [o.getCellWidth(), o.getCellHeight()];
                    l = Nl(l, c["horizontal" === i ? 0 : 1]), "start" === r && (u = o.getNextNDay(t.start.time, -(7 + t.fweek)).time, l = -l);
                    for (var h = 0; h < 7; h++) {
                        var f, g = o.getNextNDay(u, h), p = o.dataToRect([g.time], !1).center;
                        f = Math.abs((h + d) % 7);
                        var v = new Rr({z2: 30});
                        k(Js(v.style, a, {text: s[f]}), this._weekTextPositionControl(p, i, r, l, c)), n.add(v)
                    }
                }
            }
        });
        var I_ = {path: null, compoundPath: null, group: Di, image: qn, text: Rr};
        cf(function (e) {
            var t = e.graphic;
            O(t) ? t[0] && t[0].elements ? e.graphic = [e.graphic[0]] : e.graphic = [{elements: t}] : t && !t.elements && (e.graphic = [{elements: [t]}])
        });
        var __ = kf({
            type: "graphic",
            defaultOption: {elements: [], parentId: null},
            _elOptionsToUpdate: null,
            mergeOption: function (e) {
                var t = this.option.elements;
                this.option.elements = null, __.superApply(this, "mergeOption", arguments), this.option.elements = t
            },
            optionUpdated: function (e, t) {
                var i = this.option, n = (t ? i : e).elements, a = i.elements = t ? [] : i.elements, o = [];
                this._flatten(n, o);
                var r = La(a, o);
                Ba(r);
                var s = this._elOptionsToUpdate = [];
                A(r, function (e, t) {
                    var i = e.option;
                    i && (s.push(i), function (e, t) {
                        var i = e.exist;
                        if (t.id = e.keyInfo.id, !t.type && i && (t.type = i.type), null == t.parentId) {
                            var n = t.parentOption;
                            n ? t.parentId = n.id : i && (t.parentId = i.parentId)
                        }
                        t.parentOption = null
                    }(e, i), function (e, t, i) {
                        var n = k({}, i), a = e[t], o = i.$action || "merge";
                        "merge" === o ? a ? (m(a, n, !0), yd(a, n, {ignoreSize: !0}), Td(i, a)) : e[t] = n : "replace" === o ? e[t] = n : "remove" === o && a && (e[t] = null)
                    }(a, t, i), function (e, t) {
                        e && (e.hv = t.hv = [x_(t, ["left", "right"]), x_(t, ["top", "bottom"])], "group" === e.type && (null == e.width && (e.width = t.width = 0), null == e.height && (e.height = t.height = 0)))
                    }(a[t], i))
                }, this);
                for (var l = a.length - 1; 0 <= l; l--) null == a[l] ? a.splice(l, 1) : delete a[l].$action
            },
            _flatten: function (e, t, i) {
                A(e, function (e) {
                    if (e) {
                        i && (e.parentOption = i), t.push(e);
                        var n = e.children;
                        "group" === e.type && n && this._flatten(n, t, e), delete e.children
                    }
                }, this)
            },
            useElOptionsToUpdate: function () {
                var e = this._elOptionsToUpdate;
                return this._elOptionsToUpdate = null, e
            }
        });

        function A_(e, t, i, n) {
            var a = i.type, o = new (I_.hasOwnProperty(a) ? I_[a] : Is(a))(i);
            t.add(o), n.set(e, o), o.__ecGraphicId = e
        }

        function D_(e, t) {
            var i = e && e.parent;
            i && ("group" === e.type && e.traverse(function (e) {
                D_(e, t)
            }), t.removeKey(e.__ecGraphicId), i.remove(e))
        }

        function x_(e, t) {
            var i;
            return A(t, function (t) {
                null != e[t] && "auto" !== e[t] && (i = !0)
            }), i
        }

        Tf({
            type: "graphic", init: function (e, t) {
                this._elMap = Q(), this._lastGraphicModel
            }, render: function (e, t, i) {
                e !== this._lastGraphicModel && this._clear(), this._lastGraphicModel = e, this._updateElements(e), this._relocate(e, i)
            }, _updateElements: function (e) {
                var t = e.useElOptionsToUpdate();
                if (t) {
                    var i = this._elMap, n = this.group;
                    A(t, function (t) {
                        var a = t.$action, o = t.id, r = i.get(o), s = t.parentId, l = null != s ? i.get(s) : n,
                            d = t.style;
                        "text" === t.type && d && (t.hv && t.hv[1] && (d.textVerticalAlign = d.textBaseline = null), !d.hasOwnProperty("textFill") && d.fill && (d.textFill = d.fill), !d.hasOwnProperty("textStroke") && d.stroke && (d.textStroke = d.stroke));
                        var u = function (e) {
                            return e = k({}, e), A(["id", "parentId", "$action", "hv", "bounding"].concat(hd), function (t) {
                                delete e[t]
                            }), e
                        }(t);
                        a && "merge" !== a ? "replace" === a ? (D_(r, i), A_(o, l, u, i)) : "remove" === a && D_(r, i) : r ? r.attr(u) : A_(o, l, u, i);
                        var c = i.get(o);
                        c && (c.__ecGraphicWidthOption = t.width, c.__ecGraphicHeightOption = t.height, function (e, t) {
                            var i = e.eventData;
                            e.silent || e.ignore || i || (i = e.eventData = {
                                componentType: "graphic",
                                componentIndex: t.componentIndex,
                                name: e.name
                            }), i && (i.info = e.info)
                        }(c, e))
                    })
                }
            }, _relocate: function (e, t) {
                for (var i = e.option.elements, n = this.group, a = this._elMap, o = t.getWidth(), r = t.getHeight(), s = 0; s < i.length; s++) {
                    var l = i[s];
                    if ((u = a.get(l.id)) && u.isGroup) {
                        var d = (c = u.parent) === n;
                        u.__ecGraphicWidth = Nl(u.__ecGraphicWidthOption, d ? o : c.__ecGraphicWidth) || 0, u.__ecGraphicHeight = Nl(u.__ecGraphicHeightOption, d ? r : c.__ecGraphicHeight) || 0
                    }
                }
                for (s = i.length - 1; 0 <= s; s--) {
                    var u, c;
                    l = i[s], (u = a.get(l.id)) && md(u, l, (c = u.parent) === n ? {
                        width: o,
                        height: r
                    } : {width: c.__ecGraphicWidth, height: c.__ecGraphicHeight}, null, {
                        hv: l.hv,
                        boundingMode: l.bounding
                    })
                }
            }, _clear: function () {
                var e = this._elMap;
                e.each(function (t) {
                    D_(t, e)
                }), this._elMap = Q()
            }, dispose: function () {
                this._clear()
            }
        });
        var N_ = {};

        function E_(e, t) {
            N_[e] = t
        }

        function P_(e) {
            return N_[e]
        }

        var M_ = kf({
            type: "toolbox",
            layoutMode: {type: "box", ignoreSize: !0},
            optionUpdated: function () {
                M_.superApply(this, "optionUpdated", arguments), A(this.option.feature, function (e, t) {
                    var i = P_(t);
                    i && m(e, i.defaultOption)
                })
            },
            defaultOption: {
                show: !0,
                z: 6,
                zlevel: 0,
                orient: "horizontal",
                left: "right",
                top: "top",
                backgroundColor: "transparent",
                borderColor: "#ccc",
                borderRadius: 0,
                borderWidth: 0,
                padding: 5,
                itemSize: 15,
                itemGap: 8,
                showTitle: !0,
                iconStyle: {borderColor: "#666", color: "none"},
                emphasis: {iconStyle: {borderColor: "#3E98C5"}},
                tooltip: {show: !1}
            }
        });

        function O_(e, t) {
            var i = Yl(t.get("padding")), n = t.getItemStyle(["color", "opacity"]);
            return n.fill = t.get("backgroundColor"), e = new es({
                shape: {
                    x: e.x - i[3],
                    y: e.y - i[0],
                    width: e.width + i[1] + i[3],
                    height: e.height + i[0] + i[2],
                    r: t.get("borderRadius")
                }, style: n, silent: !0, z2: -1
            })
        }

        Tf({
            type: "toolbox", render: function (e, t, i, n) {
                var a = this.group;
                if (a.removeAll(), e.get("show")) {
                    var o = +e.get("itemSize"), r = e.get("feature") || {}, s = this._features || (this._features = {}),
                        l = [];
                    A(r, function (e, t) {
                        l.push(t)
                    }), new bf(this._featureNames || [], l).add(d).update(d).remove(M(d, null)).execute(), this._featureNames = l, function (e, t, i) {
                        var n = t.getBoxLayoutParams(), a = t.get("padding"),
                            o = {width: i.getWidth(), height: i.getHeight()}, r = vd(n, o, a);
                        pd(t.get("orient"), e, t.get("itemGap"), r.width, r.height), md(e, n, o, a)
                    }(a, e, i), a.add(O_(a.getBoundingRect(), e)), a.eachChild(function (e) {
                        var t = e.__title, n = e.hoverStyle;
                        if (n && t) {
                            var r = cn(t, Sn(n)), s = e.position[0] + a.position[0], l = !1;
                            e.position[1] + a.position[1] + o + r.height > i.getHeight() && (n.textPosition = "top", l = !0);
                            var d = l ? -5 - r.height : o + 8;
                            s + r.width / 2 > i.getWidth() ? (n.textPosition = ["100%", d], n.textAlign = "right") : s - r.width / 2 < 0 && (n.textPosition = [0, d], n.textAlign = "left")
                        }
                    })
                }

                function d(d, u) {
                    var c, h = l[d], f = l[u], g = r[h], p = new Sl(g, e, e.ecModel);
                    if (n && null != n.newTitle && n.featureName === h && (g.title = n.newTitle), h && !f) {
                        if (function (e) {
                            return 0 === e.indexOf("my")
                        }(h)) c = {model: p, onclick: p.option.onclick, featureName: h}; else {
                            var v = P_(h);
                            if (!v) return;
                            c = new v(p, t, i)
                        }
                        s[h] = c
                    } else {
                        if (!(c = s[f])) return;
                        c.model = p, c.ecModel = t, c.api = i
                    }
                    h || !f ? p.get("show") && !c.unusable ? (function (n, r, s) {
                        var l = n.getModel("iconStyle"), d = n.getModel("emphasis.iconStyle"),
                            u = r.getIcons ? r.getIcons() : n.get("icon"), c = n.get("title") || {};
                        if ("string" == typeof u) {
                            var h = u, f = c;
                            c = {}, (u = {})[s] = h, c[s] = f
                        }
                        var g = n.iconPaths = {};
                        A(u, function (s, u) {
                            var h = hl(s, {}, {x: -o / 2, y: -o / 2, width: o, height: o});
                            h.setStyle(l.getItemStyle()), h.hoverStyle = d.getItemStyle(), h.setStyle({
                                text: c[u],
                                textAlign: d.get("textAlign"),
                                textBorderRadius: d.get("textBorderRadius"),
                                textPadding: d.get("textPadding"),
                                textFill: null
                            });
                            var f = e.getModel("tooltip");
                            f && f.get("show") && h.attr("tooltip", k({
                                content: c[u],
                                formatter: f.get("formatter", !0) || function () {
                                    return c[u]
                                },
                                formatterParams: {
                                    componentType: "toolbox",
                                    name: u,
                                    title: c[u],
                                    $vars: ["name", "title"]
                                },
                                position: f.get("position", !0) || "bottom"
                            }, f.option)), js(h), e.get("showTitle") && (h.__title = c[u], h.on("mouseover", function () {
                                var t = d.getItemStyle(),
                                    i = "vertical" === e.get("orient") ? null == e.get("right") ? "right" : "left" : null == e.get("bottom") ? "bottom" : "top";
                                h.setStyle({
                                    textFill: d.get("textFill") || t.fill || t.stroke || "#000",
                                    textBackgroundColor: d.get("textBackgroundColor"),
                                    textPosition: d.get("textPosition") || i
                                })
                            }).on("mouseout", function () {
                                h.setStyle({textFill: null, textBackgroundColor: null})
                            })), h.trigger(n.get("iconStatus." + u) || "normal"), a.add(h), h.on("click", P(r.onclick, r, t, i, u)), g[u] = h
                        })
                    }(p, c, h), p.setIconStatus = function (e, t) {
                        var i = this.option, n = this.iconPaths;
                        i.iconStatus = i.iconStatus || {}, i.iconStatus[e] = t, n[e] && n[e].trigger(t)
                    }, c.render && c.render(p, t, i, n)) : c.remove && c.remove(t, i) : c.dispose && c.dispose(t, i)
                }
            }, updateView: function (e, t, i, n) {
                A(this._features, function (e) {
                    e.updateView && e.updateView(e.model, t, i, n)
                })
            }, remove: function (e, t) {
                A(this._features, function (i) {
                    i.remove && i.remove(e, t)
                }), this.group.removeAll()
            }, dispose: function (e, t) {
                A(this._features, function (i) {
                    i.dispose && i.dispose(e, t)
                })
            }
        });
        var F_ = Ac.toolbox.saveAsImage;

        function L_(e) {
            this.model = e
        }

        L_.defaultOption = {
            show: !0,
            icon: "M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0",
            title: F_.title,
            type: "png",
            connectedBackgroundColor: "#fff",
            name: "",
            excludeComponents: ["toolbox"],
            pixelRatio: 1,
            lang: F_.lang.slice()
        }, L_.prototype.unusable = !a.canvasSupported, L_.prototype.onclick = function (e, t) {
            var i = this.model, n = i.get("name") || e.get("title.0.text") || "echarts",
                o = "svg" === t.getZr().painter.getType() ? "svg" : i.get("type", !0) || "png",
                r = t.getConnectedDataURL({
                    type: o,
                    backgroundColor: i.get("backgroundColor", !0) || e.get("backgroundColor") || "#fff",
                    connectedBackgroundColor: i.get("connectedBackgroundColor"),
                    excludeComponents: i.get("excludeComponents"),
                    pixelRatio: i.get("pixelRatio")
                });
            if ("function" != typeof MouseEvent || a.browser.ie || a.browser.edge) if (window.navigator.msSaveOrOpenBlob) {
                for (var s = atob(r.split(",")[1]), l = s.length, d = new Uint8Array(l); l--;) d[l] = s.charCodeAt(l);
                var u = new Blob([d]);
                window.navigator.msSaveOrOpenBlob(u, n + "." + o)
            } else {
                var c = i.get("lang"),
                    h = '<body style="margin:0;"><img src="' + r + '" style="max-width:100%;" title="' + (c && c[0] || "") + '" /></body>';
                window.open().document.write(h)
            } else {
                var f = document.createElement("a");
                f.download = n + "." + o, f.target = "_blank", f.href = r;
                var g = new MouseEvent("click", {view: window, bubbles: !0, cancelable: !1});
                f.dispatchEvent(g)
            }
        }, E_("saveAsImage", L_);
        var B_ = Ac.toolbox.magicType, U_ = "__ec_magicType_stack__";

        function R_(e) {
            this.model = e
        }

        R_.defaultOption = {
            show: !0,
            type: [],
            icon: {
                line: "M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4",
                bar: "M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7",
                stack: "M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z"
            },
            title: v(B_.title),
            option: {},
            seriesIndex: {}
        };
        var K_ = R_.prototype;
        K_.getIcons = function () {
            var e = this.model, t = e.get("icon"), i = {};
            return A(e.get("type"), function (e) {
                t[e] && (i[e] = t[e])
            }), i
        };
        var W_ = {
            line: function (e, t, i, n) {
                if ("bar" === e) return m({
                    id: t,
                    type: "line",
                    data: i.get("data"),
                    stack: i.get("stack"),
                    markPoint: i.get("markPoint"),
                    markLine: i.get("markLine")
                }, n.get("option.line") || {}, !0)
            }, bar: function (e, t, i, n) {
                if ("line" === e) return m({
                    id: t,
                    type: "bar",
                    data: i.get("data"),
                    stack: i.get("stack"),
                    markPoint: i.get("markPoint"),
                    markLine: i.get("markLine")
                }, n.get("option.bar") || {}, !0)
            }, stack: function (e, t, i, n) {
                var a = i.get("stack") === U_;
                if ("line" === e || "bar" === e) return n.setIconStatus("stack", a ? "normal" : "emphasis"), m({
                    id: t,
                    stack: a ? "" : U_
                }, n.get("option.stack") || {}, !0)
            }
        }, V_ = [["line", "bar"], ["stack"]];
        K_.onclick = function (e, t, i) {
            var n = this.model, a = n.get("seriesIndex." + i);
            if (W_[i]) {
                var o, r = {series: []};
                A(V_, function (e) {
                    0 <= S(e, i) && A(e, function (e) {
                        n.setIconStatus(e, "normal")
                    })
                }), n.setIconStatus(i, "emphasis"), e.eachComponent({
                    mainType: "series",
                    query: null == a ? null : {seriesIndex: a}
                }, function (t) {
                    var a = t.subType, o = t.id, s = W_[i](a, o, t, n);
                    s && (T(s, t.option), r.series.push(s));
                    var l = t.coordinateSystem;
                    if (l && "cartesian2d" === l.type && ("line" === i || "bar" === i)) {
                        var d = l.getAxesByScale("ordinal")[0];
                        if (d) {
                            var u = d.dim + "Axis", c = e.queryComponents({
                                mainType: u,
                                index: t.get(name + "Index"),
                                id: t.get(name + "Id")
                            })[0].componentIndex;
                            r[u] = r[u] || [];
                            for (var h = 0; h <= c; h++) r[u][c] = r[u][c] || {};
                            r[u][c].boundaryGap = "bar" === i
                        }
                    }
                }), "stack" === i && (o = r.series && r.series[0] && r.series[0].stack === U_ ? m({stack: B_.title.tiled}, B_.title) : v(B_.title)), t.dispatchAction({
                    type: "changeMagicType",
                    currentType: i,
                    newOption: r,
                    newTitle: o,
                    featureName: "magicType"
                })
            }
        }, ff({type: "changeMagicType", event: "magicTypeChanged", update: "prepareAndUpdate"}, function (e, t) {
            t.mergeOption(e.newOption)
        }), E_("magicType", R_);
        var H_ = Ac.toolbox.dataView, z_ = new Array(60).join("-"), j_ = "\t";

        function G_(e) {
            return e.replace(/^\s\s*/, "").replace(/\s\s*$/, "")
        }

        var $_ = new RegExp("[" + j_ + "]+", "g");

        function X_(e) {
            this._dom = null, this.model = e
        }

        X_.defaultOption = {
            show: !0,
            readOnly: !1,
            optionToContent: null,
            contentToOption: null,
            icon: "M17.5,17.3H33 M17.5,17.3H33 M45.4,29.5h-28 M11.5,2v56H51V14.8L38.4,2H11.5z M38.4,2.2v12.7H51 M45.4,41.7h-28",
            title: v(H_.title),
            lang: v(H_.lang),
            backgroundColor: "#fff",
            textColor: "#000",
            textareaColor: "#fff",
            textareaBorderColor: "#333",
            buttonColor: "#c23531",
            buttonTextColor: "#fff"
        }, X_.prototype.onclick = function (e, t) {
            var i = t.getDom(), n = this.model;
            this._dom && i.removeChild(this._dom);
            var a = document.createElement("div");
            a.style.cssText = "position:absolute;left:5px;top:5px;bottom:5px;right:5px;", a.style.backgroundColor = n.get("backgroundColor") || "#fff";
            var o = document.createElement("h4"), r = n.get("lang") || [];
            o.innerHTML = r[0] || n.get("title"), o.style.cssText = "margin: 10px 20px;", o.style.color = n.get("textColor");
            var s = document.createElement("div"), l = document.createElement("textarea");
            s.style.cssText = "display:block;width:100%;overflow:auto;";
            var d = n.get("optionToContent"), u = n.get("contentToOption"), c = function (e) {
                var t = function (e) {
                    var t = {}, i = [], n = [];
                    return e.eachRawSeries(function (e) {
                        var a = e.coordinateSystem;
                        if (!a || "cartesian2d" !== a.type && "polar" !== a.type) i.push(e); else {
                            var o = a.getBaseAxis();
                            if ("category" === o.type) {
                                var r = o.dim + "_" + o.index;
                                t[r] || (t[r] = {
                                    categoryAxis: o,
                                    valueAxis: a.getOtherAxis(o),
                                    series: []
                                }, n.push({axisDim: o.dim, axisIndex: o.index})), t[r].series.push(e)
                            } else i.push(e)
                        }
                    }), {seriesGroupByCategoryAxis: t, other: i, meta: n}
                }(e);
                return {
                    value: N([function (e) {
                        var t = [];
                        return A(e, function (e, i) {
                            var n = e.categoryAxis, a = e.valueAxis.dim, o = [" "].concat(D(e.series, function (e) {
                                return e.name
                            })), r = [n.model.getCategories()];
                            A(e.series, function (e) {
                                r.push(e.getRawData().mapArray(a, function (e) {
                                    return e
                                }))
                            });
                            for (var s = [o.join(j_)], l = 0; l < r[0].length; l++) {
                                for (var d = [], u = 0; u < r.length; u++) d.push(r[u][l]);
                                s.push(d.join(j_))
                            }
                            t.push(s.join("\n"))
                        }), t.join("\n\n" + z_ + "\n\n")
                    }(t.seriesGroupByCategoryAxis), function (e) {
                        return D(e, function (e) {
                            var t = e.getRawData(), i = [e.name], n = [];
                            return t.each(t.dimensions, function () {
                                for (var e = arguments.length, a = arguments[e - 1], o = t.getName(a), r = 0; r < e - 1; r++) n[r] = arguments[r];
                                i.push((o ? o + j_ : "") + n.join(j_))
                            }), i.join("\n")
                        }).join("\n\n" + z_ + "\n\n")
                    }(t.other)], function (e) {
                        return e.replace(/[\n\t\s]/g, "")
                    }).join("\n\n" + z_ + "\n\n"), meta: t.meta
                }
            }(e);
            if ("function" == typeof d) {
                var h = d(t.getOption());
                "string" == typeof h ? s.innerHTML = h : K(h) && s.appendChild(h)
            } else s.appendChild(l), l.readOnly = n.get("readOnly"), l.style.cssText = "width:100%;height:100%;font-family:monospace;font-size:14px;line-height:1.6rem;", l.style.color = n.get("textColor"), l.style.borderColor = n.get("textareaBorderColor"), l.style.backgroundColor = n.get("textareaColor"), l.value = c.value;
            var f = c.meta, g = document.createElement("div");
            g.style.cssText = "position:absolute;bottom:0;left:0;right:0;";
            var p = "float:right;margin-right:20px;border:none;cursor:pointer;padding:2px 5px;font-size:12px;border-radius:3px",
                v = document.createElement("div"), m = document.createElement("div");
            p += ";background-color:" + n.get("buttonColor"), p += ";color:" + n.get("buttonTextColor");
            var y = this;

            function k() {
                i.removeChild(a), y._dom = null
            }

            je(v, "click", k), je(m, "click", function () {
                var e;
                try {
                    e = "function" == typeof u ? u(s, t.getOption()) : function (e, t) {
                        var i = {series: []};
                        return A(e.split(new RegExp("\n*" + z_ + "\n*", "g")), function (e, n) {
                            if (function (e) {
                                if (0 <= e.slice(0, e.indexOf("\n")).indexOf(j_)) return !0
                            }(e)) {
                                var a = function (e) {
                                    for (var t = e.split(/\n+/g), i = [], n = D(G_(t.shift()).split($_), function (e) {
                                        return {name: e, data: []}
                                    }), a = 0; a < t.length; a++) {
                                        var o = G_(t[a]).split($_);
                                        i.push(o.shift());
                                        for (var r = 0; r < o.length; r++) n[r] && (n[r].data[a] = o[r])
                                    }
                                    return {series: n, categories: i}
                                }(e), o = t[n], r = o.axisDim + "Axis";
                                o && (i[r] = i[r] || [], i[r][o.axisIndex] = {data: a.categories}, i.series = i.series.concat(a.series))
                            } else a = function (e) {
                                for (var t = e.split(/\n+/g), i = G_(t.shift()), n = [], a = 0; a < t.length; a++) {
                                    var o, r = G_(t[a]).split($_), s = "", l = !1;
                                    o = isNaN(r[0]) ? (l = !0, s = r[0], r = r.slice(1), n[a] = {
                                        name: s,
                                        value: []
                                    }, n[a].value) : n[a] = [];
                                    for (var d = 0; d < r.length; d++) o.push(+r[d]);
                                    1 === o.length && (l ? n[a].value = o[0] : n[a] = o[0])
                                }
                                return {name: i, data: n}
                            }(e), i.series.push(a)
                        }), i
                    }(l.value, f)
                } catch (e) {
                    throw k(), new Error("Data view format error " + e)
                }
                e && t.dispatchAction({type: "changeDataView", newOption: e}), k()
            }), v.innerHTML = r[1], m.innerHTML = r[2], m.style.cssText = p, v.style.cssText = p, n.get("readOnly") || g.appendChild(m), g.appendChild(v), a.appendChild(o), a.appendChild(s), a.appendChild(g), s.style.height = i.clientHeight - 80 + "px", i.appendChild(a), this._dom = a
        }, X_.prototype.remove = function (e, t) {
            this._dom && t.getDom().removeChild(this._dom)
        }, X_.prototype.dispose = function (e, t) {
            this.remove(e, t)
        }, E_("dataView", X_), ff({
            type: "changeDataView",
            event: "dataViewChanged",
            update: "prepareAndUpdate"
        }, function (e, t) {
            var i = [];
            A(e.newOption.series, function (e) {
                var n = t.getSeriesByName(e.name)[0];
                if (n) {
                    var a = n.get("data");
                    i.push({
                        name: e.name, data: function (e, t) {
                            return D(e, function (e, i) {
                                var n = t && t[i];
                                return B(n) && !O(n) ? (B(e) && !O(e) && (e = e.value), T({value: e}, n)) : e
                            })
                        }(e.data, a)
                    })
                } else i.push(k({type: "scatter"}, e))
            }), t.mergeOption(T({series: i}, e.newOption))
        });
        var q_ = A, Y_ = S, J_ = M, Z_ = ["dataToPoint", "pointToData"],
            Q_ = ["grid", "xAxis", "yAxis", "geo", "graph", "polar", "radiusAxis", "angleAxis", "bmap"];

        function eA(e, t, i) {
            var n = this._targetInfoList = [], a = {}, o = nA(t, e);
            q_(aA, function (e, t) {
                i && i.include && !(0 <= Y_(i.include, t)) || e(o, n, a)
            })
        }

        var tA = eA.prototype;

        function iA(e) {
            return e[0] > e[1] && e.reverse(), e
        }

        function nA(e, t) {
            return Ha(e, t, {includeMainTypes: Q_})
        }

        tA.setOutputRanges = function (e, t) {
            this.matchOutputRanges(e, t, function (e, t, i) {
                if ((e.coordRanges || (e.coordRanges = [])).push(t), !e.coordRange) {
                    e.coordRange = t;
                    var n = sA[e.brushType](0, i, t);
                    e.__rangeOffset = {offset: dA[e.brushType](n.values, e.range, [1, 1]), xyMinMax: n.xyMinMax}
                }
            })
        }, tA.matchOutputRanges = function (e, t, i) {
            q_(e, function (e) {
                var n = this.findTargetInfo(e, t);
                n && !0 !== n && A(n.coordSyses, function (n) {
                    var a = sA[e.brushType](1, n, e.range);
                    i(e, a.values, n, t)
                })
            }, this)
        }, tA.setInputRanges = function (e, t) {
            q_(e, function (e) {
                var i = this.findTargetInfo(e, t);
                if (e.range = e.range || [], i && !0 !== i) {
                    e.panelId = i.panelId;
                    var n = sA[e.brushType](0, i.coordSys, e.coordRange), a = e.__rangeOffset;
                    e.range = a ? dA[e.brushType](n.values, a.offset, function (e, t) {
                        var i = cA(e), n = cA(t), a = [i[0] / n[0], i[1] / n[1]];
                        return isNaN(a[0]) && (a[0] = 1), isNaN(a[1]) && (a[1] = 1), a
                    }(n.xyMinMax, a.xyMinMax)) : n.values
                }
            }, this)
        }, tA.makePanelOpts = function (e, t) {
            return D(this._targetInfoList, function (i) {
                var n = i.getPanelRect();
                return {
                    panelId: i.panelId,
                    defaultBrushType: t && t(i),
                    clipPath: OC(n),
                    isTargetByCursor: LC(n, e, i.coordSysModel),
                    getLinearBrushOtherExtent: FC(n)
                }
            })
        }, tA.controlSeries = function (e, t, i) {
            var n = this.findTargetInfo(e, i);
            return !0 === n || n && 0 <= Y_(n.coordSyses, t.coordinateSystem)
        }, tA.findTargetInfo = function (e, t) {
            for (var i = this._targetInfoList, n = nA(t, e), a = 0; a < i.length; a++) {
                var o = i[a], r = e.panelId;
                if (r) {
                    if (o.panelId === r) return o
                } else for (a = 0; a < oA.length; a++) if (oA[a](n, o)) return o
            }
            return !0
        };
        var aA = {
            grid: function (e, t) {
                var i = e.xAxisModels, n = e.yAxisModels, a = e.gridModels, o = Q(), r = {}, s = {};
                (i || n || a) && (q_(i, function (e) {
                    var t = e.axis.grid.model;
                    o.set(t.id, t), r[t.id] = !0
                }), q_(n, function (e) {
                    var t = e.axis.grid.model;
                    o.set(t.id, t), s[t.id] = !0
                }), q_(a, function (e) {
                    o.set(e.id, e), r[e.id] = !0, s[e.id] = !0
                }), o.each(function (e) {
                    var a = e.coordinateSystem, o = [];
                    q_(a.getCartesians(), function (e, t) {
                        (0 <= Y_(i, e.getAxis("x").model) || 0 <= Y_(n, e.getAxis("y").model)) && o.push(e)
                    }), t.push({
                        panelId: "grid--" + e.id,
                        gridModel: e,
                        coordSysModel: e,
                        coordSys: o[0],
                        coordSyses: o,
                        getPanelRect: rA.grid,
                        xAxisDeclared: r[e.id],
                        yAxisDeclared: s[e.id]
                    })
                }))
            }, geo: function (e, t) {
                q_(e.geoModels, function (e) {
                    var i = e.coordinateSystem;
                    t.push({
                        panelId: "geo--" + e.id,
                        geoModel: e,
                        coordSysModel: e,
                        coordSys: i,
                        coordSyses: [i],
                        getPanelRect: rA.geo
                    })
                })
            }
        }, oA = [function (e, t) {
            var i = e.xAxisModel, n = e.yAxisModel, a = e.gridModel;
            return !a && i && (a = i.axis.grid.model), !a && n && (a = n.axis.grid.model), a && a === t.gridModel
        }, function (e, t) {
            var i = e.geoModel;
            return i && i === t.geoModel
        }], rA = {
            grid: function () {
                return this.coordSys.grid.getRect().clone()
            }, geo: function () {
                var e = this.coordSys, t = e.getBoundingRect().clone();
                return t.applyTransform(sl(e)), t
            }
        }, sA = {
            lineX: J_(lA, 0), lineY: J_(lA, 1), rect: function (e, t, i) {
                var n = t[Z_[e]]([i[0][0], i[1][0]]), a = t[Z_[e]]([i[0][1], i[1][1]]),
                    o = [iA([n[0], a[0]]), iA([n[1], a[1]])];
                return {values: o, xyMinMax: o}
            }, polygon: function (e, t, i) {
                var n = [[1 / 0, -1 / 0], [1 / 0, -1 / 0]];
                return {
                    values: D(i, function (i) {
                        var a = t[Z_[e]](i);
                        return n[0][0] = Math.min(n[0][0], a[0]), n[1][0] = Math.min(n[1][0], a[1]), n[0][1] = Math.max(n[0][1], a[0]), n[1][1] = Math.max(n[1][1], a[1]), a
                    }), xyMinMax: n
                }
            }
        };

        function lA(e, t, i, n) {
            var a = i.getAxis(["x", "y"][e]), o = iA(D([0, 1], function (e) {
                return t ? a.coordToData(a.toLocalCoord(n[e])) : a.toGlobalCoord(a.dataToCoord(n[e]))
            })), r = [];
            return r[e] = o, r[1 - e] = [NaN, NaN], {values: o, xyMinMax: r}
        }

        var dA = {
            lineX: J_(uA, 0), lineY: J_(uA, 1), rect: function (e, t, i) {
                return [[e[0][0] - i[0] * t[0][0], e[0][1] - i[0] * t[0][1]], [e[1][0] - i[1] * t[1][0], e[1][1] - i[1] * t[1][1]]]
            }, polygon: function (e, t, i) {
                return D(e, function (e, n) {
                    return [e[0] - i[0] * t[n][0], e[1] - i[1] * t[n][1]]
                })
            }
        };

        function uA(e, t, i, n) {
            return [t[0] - n[e] * i[0], t[1] - n[e] * i[1]]
        }

        function cA(e) {
            return e ? [e[0][1] - e[0][0], e[1][1] - e[1][0]] : [NaN, NaN]
        }

        var hA = A, fA = "\0_ec_hist_store";

        function gA(e) {
            var t = e[fA];
            return t = t || (e[fA] = [{}])
        }

        Id.registerSubTypeDefaulter("dataZoom", function () {
            return "slider"
        });
        var pA, vA, mA, yA, kA = ["cartesian2d", "polar", "singleAxis"],
            TA = (vA = ["axisIndex", "axis", "index", "id"], mA = D(pA = (pA = ["x", "y", "z", "radius", "angle", "single"]).slice(), sd), yA = D(vA = (vA || []).slice(), sd), function (e, t) {
                A(pA, function (i, n) {
                    for (var a = {name: i, capital: mA[n]}, o = 0; o < vA.length; o++) a[vA[o]] = i + yA[o];
                    e.call(t, a)
                })
            });

        function wA(e, t, i, n) {
            this._dimName = e, this._axisIndex = t, this._valueWindow, this._percentWindow, this._dataExtent, this._minMaxSpan, this.ecModel = n, this._dataZoomModel = i
        }

        var CA = A, SA = Pl;

        function bA(e, t) {
            var i = e.getAxisModel(), n = e._percentWindow, a = e._valueWindow;
            if (n) {
                var o = Fl(a, [0, 500]);
                o = Math.min(o, 20);
                var r = t || 0 === n[0] && 100 === n[1];
                i.setRange(r ? null : +a[0].toFixed(o), r ? null : +a[1].toFixed(o))
            }
        }

        wA.prototype = {
            constructor: wA, hostedBy: function (e) {
                return this._dataZoomModel === e
            }, getDataValueWindow: function () {
                return this._valueWindow.slice()
            }, getDataPercentWindow: function () {
                return this._percentWindow.slice()
            }, getTargetSeriesModels: function () {
                var e = [], t = this.ecModel;
                return t.eachSeries(function (i) {
                    if (function (e) {
                        return 0 <= S(kA, e)
                    }(i.get("coordinateSystem"))) {
                        var n = this._dimName, a = t.queryComponents({
                            mainType: n + "Axis",
                            index: i.get(n + "AxisIndex"),
                            id: i.get(n + "AxisId")
                        })[0];
                        this._axisIndex === (a && a.componentIndex) && e.push(i)
                    }
                }, this), e
            }, getAxisModel: function () {
                return this.ecModel.getComponent(this._dimName + "Axis", this._axisIndex)
            }, getOtherAxisModel: function () {
                var e, t, i, n = this._dimName, a = this.ecModel, o = this.getAxisModel();
                return e = "x" === n || "y" === n ? (t = "gridIndex", "x" === n ? "y" : "x") : (t = "polarIndex", "angle" === n ? "radius" : "angle"), a.eachComponent(e + "Axis", function (e) {
                    (e.get(t) || 0) === (o.get(t) || 0) && (i = e)
                }), i
            }, getMinMaxSpan: function () {
                return v(this._minMaxSpan)
            }, calculateDataWindow: function (e) {
                var t, i = this._dataExtent, n = this.getAxisModel().axis.scale,
                    a = this._dataZoomModel.getRangePropMode(), o = [0, 100], r = [], s = [];
                CA(["start", "end"], function (l, d) {
                    var u = e[l], c = e[l + "Value"];
                    "percent" === a[d] ? (null == u && (u = o[d]), c = n.parse(xl(u, o, i))) : (t = !0, u = xl(c = null == c ? i[d] : n.parse(c), i, o)), s[d] = c, r[d] = u
                }), SA(s), SA(r);
                var l = this._minMaxSpan;

                function d(e, t, i, a, o) {
                    var r = o ? "Span" : "ValueSpan";
                    Ew(0, e, i, "all", l["min" + r], l["max" + r]);
                    for (var s = 0; s < 2; s++) t[s] = xl(e[s], i, a, !0), o && (t[s] = n.parse(t[s]))
                }

                return t ? d(s, r, i, o, !1) : d(r, s, o, i, !0), {valueWindow: s, percentWindow: r}
            }, reset: function (e) {
                if (e === this._dataZoomModel) {
                    var t = this.getTargetSeriesModels();
                    this._dataExtent = function (e, t, i) {
                        var n = [1 / 0, -1 / 0];
                        return CA(i, function (e) {
                            var i = e.getData();
                            i && CA(i.mapDimension(t, !0), function (e) {
                                var t = i.getApproximateExtent(e);
                                t[0] < n[0] && (n[0] = t[0]), t[1] > n[1] && (n[1] = t[1])
                            })
                        }), n[1] < n[0] && (n = [NaN, NaN]), function (e, t) {
                            var i = e.getAxisModel(), n = i.getMin(!0), a = "category" === i.get("type"),
                                o = a && i.getCategories().length;
                            null != n && "dataMin" !== n && "function" != typeof n ? t[0] = n : a && (t[0] = 0 < o ? 0 : NaN);
                            var r = i.getMax(!0);
                            null != r && "dataMax" !== r && "function" != typeof r ? t[1] = r : a && (t[1] = 0 < o ? o - 1 : NaN), i.get("scale", !0) || (0 < t[0] && (t[0] = 0), t[1] < 0 && (t[1] = 0))
                        }(e, n), n
                    }(this, this._dimName, t), a = (n = this)._minMaxSpan = {}, o = n._dataZoomModel, r = n._dataExtent, CA(["min", "max"], function (e) {
                        var t = o.get(e + "Span"), i = o.get(e + "ValueSpan");
                        null != i && (i = n.getAxisModel().axis.scale.parse(i)), null != i ? t = xl(r[0] + i, r, [0, 100], !0) : null != t && (i = xl(t, [0, 100], r, !0) - r[0]), a[e + "Span"] = t, a[e + "ValueSpan"] = i
                    });
                    var i = this.calculateDataWindow(e.settledOption);
                    this._valueWindow = i.valueWindow, this._percentWindow = i.percentWindow, bA(this)
                }
                var n, a, o, r
            }, restore: function (e) {
                e === this._dataZoomModel && (this._valueWindow = this._percentWindow = null, bA(this, !0))
            }, filterData: function (e, t) {
                if (e === this._dataZoomModel) {
                    var i = this._dimName, n = this.getTargetSeriesModels(), a = e.get("filterMode"),
                        o = this._valueWindow;
                    "none" !== a && CA(n, function (e) {
                        var t = e.getData(), n = t.mapDimension(i, !0);
                        n.length && ("weakFilter" === a ? t.filterSelf(function (e) {
                            for (var i, a, r, s = 0; s < n.length; s++) {
                                var l = t.get(n[s], e), d = !isNaN(l), u = l < o[0], c = l > o[1];
                                if (d && !u && !c) return !0;
                                d && (r = !0), u && (i = !0), c && (a = !0)
                            }
                            return r && i && a
                        }) : CA(n, function (i) {
                            if ("empty" === a) e.setData(t = t.map(i, function (e) {
                                return function (e) {
                                    return e >= o[0] && e <= o[1]
                                }(e) ? e : NaN
                            })); else {
                                var n = {};
                                n[i] = o, t.selectRange(n)
                            }
                        }), CA(n, function (e) {
                            t.setApproximateExtent(o, e)
                        }))
                    })
                }
            }
        };
        var IA = A, _A = TA, AA = kf({
            type: "dataZoom",
            dependencies: ["xAxis", "yAxis", "zAxis", "radiusAxis", "angleAxis", "singleAxis", "series"],
            defaultOption: {
                zlevel: 0,
                z: 4,
                orient: null,
                xAxisIndex: null,
                yAxisIndex: null,
                filterMode: "filter",
                throttle: null,
                start: 0,
                end: 100,
                startValue: null,
                endValue: null,
                minSpan: null,
                maxSpan: null,
                minValueSpan: null,
                maxValueSpan: null,
                rangeMode: null
            },
            init: function (e, t, i) {
                this._dataIntervalByAxis = {}, this._dataInfo = {}, this._axisProxies = {}, this.textStyleModel, this._autoThrottle = !0, this._rangePropMode = ["percent", "percent"];
                var n = DA(e);
                this.settledOption = n, this.mergeDefaultAndTheme(e, i), this.doInit(n)
            },
            mergeOption: function (e) {
                var t = DA(e);
                m(this.option, e, !0), m(this.settledOption, t, !0), this.doInit(t)
            },
            doInit: function (e) {
                var t = this.option;
                a.canvasSupported || (t.realtime = !1), this._setDefaultThrottle(e), xA(this, e);
                var i = this.settledOption;
                IA([["start", "startValue"], ["end", "endValue"]], function (e, n) {
                    "value" === this._rangePropMode[n] && (t[e[0]] = i[e[0]] = null)
                }, this), this.textStyleModel = this.getModel("textStyle"), this._resetTarget(), this._giveAxisProxies()
            },
            _giveAxisProxies: function () {
                var e = this._axisProxies;
                this.eachTargetAxis(function (t, i, n, a) {
                    var o = this.dependentModels[t.axis][i],
                        r = o.__dzAxisProxy || (o.__dzAxisProxy = new wA(t.name, i, this, a));
                    e[t.name + "_" + i] = r
                }, this)
            },
            _resetTarget: function () {
                var e = this.option, t = this._judgeAutoMode();
                _A(function (t) {
                    var i = t.axisIndex;
                    e[i] = Pa(e[i])
                }, this), "axisIndex" === t ? this._autoSetAxisIndex() : "orient" === t && this._autoSetOrient()
            },
            _judgeAutoMode: function () {
                var e = this.option, t = !1;
                _A(function (i) {
                    null != e[i.axisIndex] && (t = !0)
                }, this);
                var i = e.orient;
                return null == i && t ? "orient" : t ? void 0 : (null == i && (e.orient = "horizontal"), "axisIndex")
            },
            _autoSetAxisIndex: function () {
                var e = !0, t = this.get("orient", !0), i = this.option, n = this.dependentModels;
                if (e) {
                    var a = "vertical" === t ? "y" : "x";
                    n[a + "Axis"].length ? (i[a + "AxisIndex"] = [0], e = !1) : IA(n.singleAxis, function (n) {
                        e && n.get("orient", !0) === t && (i.singleAxisIndex = [n.componentIndex], e = !1)
                    })
                }
                e && _A(function (t) {
                    if (e) {
                        var n = [], a = this.dependentModels[t.axis];
                        if (a.length && !n.length) for (var o = 0, r = a.length; o < r; o++) "category" === a[o].get("type") && n.push(o);
                        (i[t.axisIndex] = n).length && (e = !1)
                    }
                }, this), e && this.ecModel.eachSeries(function (e) {
                    this._isSeriesHasAllAxesTypeOf(e, "value") && _A(function (t) {
                        var n = i[t.axisIndex], a = e.get(t.axisIndex), o = e.get(t.axisId);
                        S(n, a = e.ecModel.queryComponents({
                            mainType: t.axis,
                            index: a,
                            id: o
                        })[0].componentIndex) < 0 && n.push(a)
                    })
                }, this)
            },
            _autoSetOrient: function () {
                var e;
                this.eachTargetAxis(function (t) {
                    e = e || t.name
                }, this), this.option.orient = "y" === e ? "vertical" : "horizontal"
            },
            _isSeriesHasAllAxesTypeOf: function (e, t) {
                var i = !0;
                return _A(function (n) {
                    var a = e.get(n.axisIndex), o = this.dependentModels[n.axis][a];
                    o && o.get("type") === t || (i = !1)
                }, this), i
            },
            _setDefaultThrottle: function (e) {
                if (e.hasOwnProperty("throttle") && (this._autoThrottle = !1), this._autoThrottle) {
                    var t = this.ecModel.option;
                    this.option.throttle = t.animation && 0 < t.animationDurationUpdate ? 100 : 20
                }
            },
            getFirstTargetAxisModel: function () {
                var e;
                return _A(function (t) {
                    if (null == e) {
                        var i = this.get(t.axisIndex);
                        i.length && (e = this.dependentModels[t.axis][i[0]])
                    }
                }, this), e
            },
            eachTargetAxis: function (e, t) {
                var i = this.ecModel;
                _A(function (n) {
                    IA(this.get(n.axisIndex), function (a) {
                        e.call(t, n, a, this, i)
                    }, this)
                }, this)
            },
            getAxisProxy: function (e, t) {
                return this._axisProxies[e + "_" + t]
            },
            getAxisModel: function (e, t) {
                var i = this.getAxisProxy(e, t);
                return i && i.getAxisModel()
            },
            setRawRange: function (e) {
                var t = this.option, i = this.settledOption;
                IA([["start", "startValue"], ["end", "endValue"]], function (n) {
                    null == e[n[0]] && null == e[n[1]] || (t[n[0]] = i[n[0]] = e[n[0]], t[n[1]] = i[n[1]] = e[n[1]])
                }, this), xA(this, e)
            },
            setCalculatedRange: function (e) {
                var t = this.option;
                IA(["start", "startValue", "end", "endValue"], function (i) {
                    t[i] = e[i]
                })
            },
            getPercentRange: function () {
                var e = this.findRepresentativeAxisProxy();
                if (e) return e.getDataPercentWindow()
            },
            getValueRange: function (e, t) {
                if (null != e || null != t) return this.getAxisProxy(e, t).getDataValueWindow();
                var i = this.findRepresentativeAxisProxy();
                return i ? i.getDataValueWindow() : void 0
            },
            findRepresentativeAxisProxy: function (e) {
                if (e) return e.__dzAxisProxy;
                var t = this._axisProxies;
                for (var i in t) if (t.hasOwnProperty(i) && t[i].hostedBy(this)) return t[i];
                for (var i in t) if (t.hasOwnProperty(i) && !t[i].hostedBy(this)) return t[i]
            },
            getRangePropMode: function () {
                return this._rangePropMode.slice()
            }
        });

        function DA(e) {
            var t = {};
            return IA(["start", "end", "startValue", "endValue", "throttle"], function (i) {
                e.hasOwnProperty(i) && (t[i] = e[i])
            }), t
        }

        function xA(e, t) {
            var i = e._rangePropMode, n = e.get("rangeMode");
            IA([["start", "startValue"], ["end", "endValue"]], function (e, a) {
                var o = null != t[e[0]], r = null != t[e[1]];
                o && !r ? i[a] = "percent" : !o && r ? i[a] = "value" : n ? i[a] = n[a] : o && (i[a] = "percent")
            })
        }

        var NA = lc.extend({
            type: "dataZoom", render: function (e, t, i, n) {
                this.dataZoomModel = e, this.ecModel = t, this.api = i
            }, getTargetCoordInfo: function () {
                var e = this.dataZoomModel, t = this.ecModel, i = {};
                return e.eachTargetAxis(function (e, n) {
                    var a = t.getComponent(e.axis, n);
                    if (a) {
                        var o = a.getCoordSysModel();
                        o && function (e, t, i, n) {
                            for (var a, o = 0; o < i.length; o++) if (i[o].model === e) {
                                a = i[o];
                                break
                            }
                            a || i.push(a = {model: e, axisModels: [], coordIndex: n}), a.axisModels.push(t)
                        }(o, a, i[o.mainType] || (i[o.mainType] = []), o.componentIndex)
                    }
                }, this), i
            }
        });
        AA.extend({type: "dataZoom.select"}), NA.extend({type: "dataZoom.select"}), hf({
            getTargetSeries: function (e) {
                var t = Q();
                return e.eachComponent("dataZoom", function (e) {
                    e.eachTargetAxis(function (e, i, n) {
                        A(n.getAxisProxy(e.name, i).getTargetSeriesModels(), function (e) {
                            t.set(e.uid, e)
                        })
                    })
                }), t
            }, modifyOutputEnd: !0, overallReset: function (e, t) {
                e.eachComponent("dataZoom", function (e) {
                    e.eachTargetAxis(function (e, i, n) {
                        n.getAxisProxy(e.name, i).reset(n, t)
                    }), e.eachTargetAxis(function (e, i, n) {
                        n.getAxisProxy(e.name, i).filterData(n, t)
                    })
                }), e.eachComponent("dataZoom", function (e) {
                    var t = e.findRepresentativeAxisProxy(), i = t.getDataPercentWindow(), n = t.getDataValueWindow();
                    e.setCalculatedRange({start: i[0], end: i[1], startValue: n[0], endValue: n[1]})
                })
            }
        }), ff("dataZoom", function (e, t) {
            var i = function (e, t, i) {
                return function (a) {
                    var o, r = {nodes: [], records: {}};
                    if (t(function (e) {
                        r.records[e.name] = {}
                    }), !a) return r;
                    for (n(a, r); o = !1, e(s), o;) ;

                    function s(e) {
                        !function (e, t) {
                            return 0 <= S(t.nodes, e)
                        }(e, r) && function (e, n) {
                            var a = !1;
                            return t(function (t) {
                                A(i(e, t) || [], function (e) {
                                    n.records[t.name][e] && (a = !0)
                                })
                            }), a
                        }(e, r) && (n(e, r), o = !0)
                    }

                    return r
                };

                function n(e, n) {
                    n.nodes.push(e), t(function (t) {
                        A(i(e, t) || [], function (e) {
                            n.records[t.name][e] = !0
                        })
                    })
                }
            }(P(t.eachComponent, t, "dataZoom"), TA, function (e, t) {
                return e.get(t.axisIndex)
            }), n = [];
            t.eachComponent({mainType: "dataZoom", query: e}, function (e, t) {
                n.push.apply(n, i(e).nodes)
            }), A(n, function (t, i) {
                t.setRawRange({start: e.start, end: e.end, startValue: e.startValue, endValue: e.endValue})
            })
        });
        var EA = Ac.toolbox.dataZoom, PA = A;

        function MA(e, t, i) {
            (this._brushController = new aC(i.getZr())).on("brush", P(this._onBrush, this)).mount(), this._isZoomActive
        }

        MA.defaultOption = {
            show: !0,
            filterMode: "filter",
            icon: {
                zoom: "M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1",
                back: "M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26"
            },
            title: v(EA.title)
        };
        var OA = MA.prototype;
        OA.render = function (e, t, i, n) {
            this.model = e, this.ecModel = t, this.api = i, function (e, t, i, n, a) {
                var o = i._isZoomActive;
                n && "takeGlobalCursor" === n.type && (o = "dataZoomSelect" === n.key && n.dataZoomSelectActive), i._isZoomActive = o, e.setIconStatus("zoom", o ? "emphasis" : "normal");
                var r = new eA(LA(e.option), t, {include: ["grid"]});
                i._brushController.setPanels(r.makePanelOpts(a, function (e) {
                    return e.xAxisDeclared && !e.yAxisDeclared ? "lineX" : !e.xAxisDeclared && e.yAxisDeclared ? "lineY" : "rect"
                })).enableBrush(!!o && {brushType: "auto", brushStyle: {lineWidth: 0, fill: "rgba(0,0,0,0.2)"}})
            }(e, t, this, n, i), function (e, t) {
                e.setIconStatus("back", 1 < function (e) {
                    return gA(e).length
                }(t) ? "emphasis" : "normal")
            }(e, t)
        }, OA.onclick = function (e, t, i) {
            FA[i].call(this)
        }, OA.remove = function (e, t) {
            this._brushController.unmount()
        }, OA.dispose = function (e, t) {
            this._brushController.dispose()
        };
        var FA = {
            zoom: function () {
                var e = !this._isZoomActive;
                this.api.dispatchAction({type: "takeGlobalCursor", key: "dataZoomSelect", dataZoomSelectActive: e})
            }, back: function () {
                this._dispatchZoomAction(function (e) {
                    var t = gA(e), i = t[t.length - 1];
                    1 < t.length && t.pop();
                    var n = {};
                    return hA(i, function (e, i) {
                        for (var a = t.length - 1; 0 <= a; a--) if (e = t[a][i]) {
                            n[i] = e;
                            break
                        }
                    }), n
                }(this.ecModel))
            }
        };

        function LA(e) {
            var t = {};
            return A(["xAxisIndex", "yAxisIndex"], function (i) {
                t[i] = e[i], null == t[i] && (t[i] = "all"), !1 !== t[i] && "none" !== t[i] || (t[i] = [])
            }), t
        }

        OA._onBrush = function (e, t) {
            if (t.isEnd && e.length) {
                var i = {}, n = this.ecModel;
                this._brushController.updateCovers([]), new eA(LA(this.model.option), n, {include: ["grid"]}).matchOutputRanges(e, n, function (e, t, i) {
                    if ("cartesian2d" === i.type) {
                        var n = e.brushType;
                        "rect" === n ? (a("x", i, t[0]), a("y", i, t[1])) : a({lineX: "x", lineY: "y"}[n], i, t)
                    }
                }), function (e, t) {
                    var i = gA(e);
                    hA(t, function (t, n) {
                        for (var a = i.length - 1; 0 <= a && !i[a][n]; a--) ;
                        if (a < 0) {
                            var o = e.queryComponents({mainType: "dataZoom", subType: "select", id: n})[0];
                            if (o) {
                                var r = o.getPercentRange();
                                i[0][n] = {dataZoomId: n, start: r[0], end: r[1]}
                            }
                        }
                    }), i.push(t)
                }(n, i), this._dispatchZoomAction(i)
            }

            function a(e, t, a) {
                var o = t.getAxis(e), r = o.model, s = function (e, t, i) {
                    var n;
                    return i.eachComponent({mainType: "dataZoom", subType: "select"}, function (i) {
                        i.getAxisModel(e, t.componentIndex) && (n = i)
                    }), n
                }(e, r, n), l = s.findRepresentativeAxisProxy(r).getMinMaxSpan();
                null == l.minValueSpan && null == l.maxValueSpan || (a = Ew(0, a.slice(), o.scale.getExtent(), 0, l.minValueSpan, l.maxValueSpan)), s && (i[s.id] = {
                    dataZoomId: s.id,
                    startValue: a[0],
                    endValue: a[1]
                })
            }
        }, OA._dispatchZoomAction = function (e) {
            var t = [];
            PA(e, function (e, i) {
                t.push(v(e))
            }), t.length && this.api.dispatchAction({type: "dataZoom", from: this.uid, batch: t})
        }, E_("dataZoom", MA), cf(function (e) {
            if (e) {
                var t = e.dataZoom || (e.dataZoom = []);
                O(t) || (e.dataZoom = t = [t]);
                var i = e.toolbox;
                if (i && (O(i) && (i = i[0]), i && i.feature)) {
                    var n = i.feature.dataZoom;
                    a("xAxis", n), a("yAxis", n)
                }
            }

            function a(i, n) {
                if (n) {
                    var a = i + "Index", o = n[a];
                    null == o || "all" === o || O(o) || (o = !1 === o || "none" === o ? [] : [o]), O(r = e[i]) || (r = r ? [r] : []), PA(r, function (e, r) {
                        if (null == o || "all" === o || -1 !== S(o, r)) {
                            var s = {
                                type: "select",
                                $fromToolbox: !0,
                                filterMode: n.filterMode || "filter",
                                id: "\0_ec_\0toolbox-dataZoom_" + i + r
                            };
                            s[a] = r, t.push(s)
                        }
                    })
                }
                var r
            }
        });
        var BA = Ac.toolbox.restore;

        function UA(e) {
            this.model = e
        }

        UA.defaultOption = {
            show: !0,
            icon: "M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5",
            title: BA.title
        }, UA.prototype.onclick = function (e, t, i) {
            !function (e) {
                e[fA] = null
            }(e), t.dispatchAction({type: "restore", from: this.uid})
        }, E_("restore", UA), ff({type: "restore", event: "restore", update: "prepareAndUpdate"}, function (e, t) {
            t.resetOption("recreate")
        }), kf({
            type: "tooltip",
            dependencies: ["axisPointer"],
            defaultOption: {
                zlevel: 0,
                z: 60,
                show: !0,
                showContent: !0,
                trigger: "item",
                triggerOn: "mousemove|click",
                alwaysShowContent: !1,
                displayMode: "single",
                renderMode: "auto",
                confine: !1,
                showDelay: 0,
                hideDelay: 100,
                transitionDuration: .4,
                enterable: !1,
                backgroundColor: "rgba(50,50,50,0.7)",
                borderColor: "#333",
                borderRadius: 4,
                borderWidth: 0,
                padding: 5,
                extraCssText: "",
                axisPointer: {
                    type: "line",
                    axis: "auto",
                    animation: "auto",
                    animationDurationUpdate: 200,
                    animationEasingUpdate: "exponentialOut",
                    crossStyle: {color: "#999", width: 1, type: "dashed", textStyle: {}}
                },
                textStyle: {color: "#fff", fontSize: 14}
            }
        });
        var RA = A, KA = ql, WA = ["", "-webkit-", "-moz-", "-o-"];

        function VA(e, t, i, n, a) {
            var o = t && t.painter;
            if (i) {
                var r = o && o.getViewportRoot();
                r && function (e, t, i, n, a) {
                    Le(Fe, t, n, a, !0) && Le(e, i, Fe[0], Fe[1])
                }(e, r, document.body, n, a)
            } else {
                e[0] = n, e[1] = a;
                var s = o && o.getViewportRootOffset();
                s && (e[0] += s.offsetLeft, e[1] += s.offsetTop)
            }
        }

        function HA(e, t, i) {
            if (a.wxa) return null;
            var n = document.createElement("div");
            n.domBelongToZr = !0, this.el = n;
            var o = this._zr = t.getZr(), r = this._appendToBody = i && i.appendToBody;
            this._styleCoord = [0, 0], VA(this._styleCoord, o, r, t.getWidth() / 2, t.getHeight() / 2), r ? document.body.appendChild(n) : e.appendChild(n), this._container = e, this._show = !1, this._hideTimeout;
            var s = this;
            n.onmouseenter = function () {
                s._enterable && (clearTimeout(s._hideTimeout), s._show = !0), s._inContent = !0
            }, n.onmousemove = function (e) {
                if (e = e || window.event, !s._enterable) {
                    var t = o.handler;
                    ze(o.painter.getViewportRoot(), e, !0), t.dispatch("mousemove", e)
                }
            }, n.onmouseleave = function () {
                s._enterable && s._show && s.hideLater(s._hideDelay), s._inContent = !1
            }
        }

        function zA(e) {
            this._zr = e.getZr(), this._show = !1, this._hideTimeout
        }

        HA.prototype = {
            constructor: HA, _enterable: !0, update: function () {
                var e = this._container, t = e.currentStyle || document.defaultView.getComputedStyle(e), i = e.style;
                "absolute" !== i.position && "absolute" !== t.position && (i.position = "relative")
            }, show: function (e) {
                clearTimeout(this._hideTimeout);
                var t = this.el, i = this._styleCoord;
                t.style.cssText = "position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;" + function (e) {
                    var t = [], i = e.get("transitionDuration"), n = e.get("backgroundColor"),
                        o = e.getModel("textStyle"), r = e.get("padding");
                    return i && t.push(function (e) {
                        var t = "cubic-bezier(0.23, 1, 0.32, 1)", i = "left " + e + "s " + t + ",top " + e + "s " + t;
                        return D(WA, function (e) {
                            return e + "transition:" + i
                        }).join(";")
                    }(i)), n && (a.canvasSupported ? t.push("background-Color:" + n) : (t.push("background-Color:#" + zt(n)), t.push("filter:alpha(opacity=70)"))), RA(["width", "color", "radius"], function (i) {
                        var n = "border-" + i, a = KA(n), o = e.get(a);
                        null != o && t.push(n + ":" + o + ("color" === i ? "" : "px"))
                    }), t.push(function (e) {
                        var t = [], i = e.get("fontSize"), n = e.getTextColor();
                        return n && t.push("color:" + n), t.push("font:" + e.getFont()), i && t.push("line-height:" + Math.round(3 * i / 2) + "px"), RA(["decoration", "align"], function (i) {
                            var n = e.get(i);
                            n && t.push("text-" + i + ":" + n)
                        }), t.join(";")
                    }(o)), null != r && t.push("padding:" + Yl(r).join("px ") + "px"), t.join(";") + ";"
                }(e) + ";left:" + i[0] + "px;top:" + i[1] + "px;" + (e.get("extraCssText") || ""), t.style.display = t.innerHTML ? "block" : "none", t.style.pointerEvents = this._enterable ? "auto" : "none", this._show = !0
            }, setContent: function (e) {
                this.el.innerHTML = null == e ? "" : e
            }, setEnterable: function (e) {
                this._enterable = e
            }, getSize: function () {
                var e = this.el;
                return [e.clientWidth, e.clientHeight]
            }, moveTo: function (e, t) {
                var i = this._styleCoord;
                VA(i, this._zr, this._appendToBody, e, t);
                var n = this.el.style;
                n.left = i[0] + "px", n.top = i[1] + "px"
            }, hide: function () {
                this.el.style.display = "none", this._show = !1
            }, hideLater: function (e) {
                !this._show || this._inContent && this._enterable || (e ? (this._hideDelay = e, this._show = !1, this._hideTimeout = setTimeout(P(this.hide, this), e)) : this.hide())
            }, isShow: function () {
                return this._show
            }, dispose: function () {
                this.el.parentNode.removeChild(this.el)
            }, getOuterSize: function () {
                var e = this.el.clientWidth, t = this.el.clientHeight;
                if (document.defaultView && document.defaultView.getComputedStyle) {
                    var i = document.defaultView.getComputedStyle(this.el);
                    i && (e += parseInt(i.borderLeftWidth, 10) + parseInt(i.borderRightWidth, 10), t += parseInt(i.borderTopWidth, 10) + parseInt(i.borderBottomWidth, 10))
                }
                return {width: e, height: t}
            }
        }, zA.prototype = {
            constructor: zA, _enterable: !0, update: function () {
            }, show: function (e) {
                this._hideTimeout && clearTimeout(this._hideTimeout), this.el.attr("show", !0), this._show = !0
            }, setContent: function (e, t, i) {
                this.el && this._zr.remove(this.el);
                for (var n = {}, a = e, o = "{marker", r = a.indexOf(o); 0 <= r;) {
                    var s = a.indexOf("|}"), l = a.substr(r + o.length, s - r - o.length);
                    -1 < l.indexOf("sub") ? n["marker" + l] = {
                        textWidth: 4,
                        textHeight: 4,
                        textBorderRadius: 2,
                        textBackgroundColor: t[l],
                        textOffset: [3, 0]
                    } : n["marker" + l] = {
                        textWidth: 10,
                        textHeight: 10,
                        textBorderRadius: 5,
                        textBackgroundColor: t[l]
                    }, r = (a = a.substr(s + 1)).indexOf("{marker")
                }
                this.el = new Rr({
                    style: {
                        rich: n,
                        text: e,
                        textLineHeight: 20,
                        textBackgroundColor: i.get("backgroundColor"),
                        textBorderRadius: i.get("borderRadius"),
                        textFill: i.get("textStyle.color"),
                        textPadding: i.get("padding")
                    }, z: i.get("z")
                }), this._zr.add(this.el);
                var d = this;
                this.el.on("mouseover", function () {
                    d._enterable && (clearTimeout(d._hideTimeout), d._show = !0), d._inContent = !0
                }), this.el.on("mouseout", function () {
                    d._enterable && d._show && d.hideLater(d._hideDelay), d._inContent = !1
                })
            }, setEnterable: function (e) {
                this._enterable = e
            }, getSize: function () {
                var e = this.el.getBoundingRect();
                return [e.width, e.height]
            }, moveTo: function (e, t) {
                this.el && this.el.attr("position", [e, t])
            }, hide: function () {
                this.el && this.el.hide(), this._show = !1
            }, hideLater: function (e) {
                !this._show || this._inContent && this._enterable || (e ? (this._hideDelay = e, this._show = !1, this._hideTimeout = setTimeout(P(this.hide, this), e)) : this.hide())
            }, isShow: function () {
                return this._show
            }, getOuterSize: function () {
                var e = this.getSize();
                return {width: e[0], height: e[1]}
            }
        };
        var jA = P, GA = A, $A = Nl, XA = new es({shape: {x: -1, y: -1, width: 2, height: 2}});

        function qA(e) {
            for (var t = e.pop(); e.length;) {
                var i = e.pop();
                i && (Sl.isInstance(i) && (i = i.get("tooltip", !0)), "string" == typeof i && (i = {formatter: i}), t = new Sl(i, t, t.ecModel))
            }
            return t
        }

        function YA(e, t) {
            return e.dispatchAction || P(t.dispatchAction, t)
        }

        function JA(e) {
            return "center" === e || "middle" === e
        }

        Tf({
            type: "tooltip", init: function (e, t) {
                if (!a.node) {
                    var i, n = e.getComponent("tooltip"), o = n.get("renderMode");
                    this._renderMode = Ga(o), "html" === this._renderMode ? (i = new HA(t.getDom(), t, {appendToBody: n.get("appendToBody", !0)}), this._newLine = "<br/>") : (i = new zA(t), this._newLine = "\n"), this._tooltipContent = i
                }
            }, render: function (e, t, i) {
                if (!a.node) {
                    this.group.removeAll(), this._tooltipModel = e, this._ecModel = t, this._api = i, this._lastDataByCoordSys = null, this._alwaysShowContent = e.get("alwaysShowContent");
                    var n = this._tooltipContent;
                    n.update(), n.setEnterable(e.get("enterable")), this._initGlobalListener(), this._keepShow()
                }
            }, _initGlobalListener: function () {
                var e = this._tooltipModel.get("triggerOn");
                Gb("itemTooltip", this._api, jA(function (t, i, n) {
                    "none" !== e && (0 <= e.indexOf(t) ? this._tryShow(i, n) : "leave" === t && this._hide(n))
                }, this))
            }, _keepShow: function () {
                var e = this._tooltipModel, t = this._ecModel, i = this._api;
                if (null != this._lastX && null != this._lastY && "none" !== e.get("triggerOn")) {
                    var n = this;
                    clearTimeout(this._refreshUpdateTimeout), this._refreshUpdateTimeout = setTimeout(function () {
                        i.isDisposed() || n.manuallyShowTip(e, t, i, {x: n._lastX, y: n._lastY})
                    })
                }
            }, manuallyShowTip: function (e, t, i, n) {
                if (n.from !== this.uid && !a.node) {
                    var o = YA(n, i);
                    this._ticket = "";
                    var r = n.dataByCoordSys;
                    if (n.tooltip && null != n.x && null != n.y) {
                        var s = XA;
                        s.position = [n.x, n.y], s.update(), s.tooltip = n.tooltip, this._tryShow({
                            offsetX: n.x,
                            offsetY: n.y,
                            target: s
                        }, o)
                    } else if (r) this._tryShow({
                        offsetX: n.x,
                        offsetY: n.y,
                        position: n.position,
                        dataByCoordSys: n.dataByCoordSys,
                        tooltipOption: n.tooltipOption
                    }, o); else if (null != n.seriesIndex) {
                        if (this._manuallyAxisShowTip(e, t, i, n)) return;
                        var l = Fb(n, t), d = l.point[0], u = l.point[1];
                        null != d && null != u && this._tryShow({
                            offsetX: d,
                            offsetY: u,
                            position: n.position,
                            target: l.el
                        }, o)
                    } else null != n.x && null != n.y && (i.dispatchAction({
                        type: "updateAxisPointer",
                        x: n.x,
                        y: n.y
                    }), this._tryShow({
                        offsetX: n.x,
                        offsetY: n.y,
                        position: n.position,
                        target: i.getZr().findHover(n.x, n.y).target
                    }, o))
                }
            }, manuallyHideTip: function (e, t, i, n) {
                var a = this._tooltipContent;
                !this._alwaysShowContent && this._tooltipModel && a.hideLater(this._tooltipModel.get("hideDelay")), this._lastX = this._lastY = null, n.from !== this.uid && this._hide(YA(n, i))
            }, _manuallyAxisShowTip: function (e, t, i, n) {
                var a = n.seriesIndex, o = n.dataIndex, r = t.getComponent("axisPointer").coordSysAxesInfo;
                if (null != a && null != o && null != r) {
                    var s = t.getSeriesByIndex(a);
                    if (s && "axis" === (e = qA([s.getData().getItemModel(o), s, (s.coordinateSystem || {}).model, e])).get("trigger")) return i.dispatchAction({
                        type: "updateAxisPointer",
                        seriesIndex: a,
                        dataIndex: o,
                        position: n.position
                    }), !0
                }
            }, _tryShow: function (e, t) {
                var i = e.target;
                if (this._tooltipModel) {
                    this._lastX = e.offsetX, this._lastY = e.offsetY;
                    var n = e.dataByCoordSys;
                    n && n.length ? this._showAxisTooltip(n, e) : i && null != i.dataIndex ? (this._lastDataByCoordSys = null, this._showSeriesItemTooltip(e, i, t)) : i && i.tooltip ? (this._lastDataByCoordSys = null, this._showComponentItemTooltip(e, i, t)) : (this._lastDataByCoordSys = null, this._hide(t))
                }
            }, _showOrMove: function (e, t) {
                var i = e.get("showDelay");
                t = P(t, this), clearTimeout(this._showTimout), 0 < i ? this._showTimout = setTimeout(t, i) : t()
            }, _showAxisTooltip: function (e, t) {
                var i = this._ecModel, n = this._tooltipModel, a = [t.offsetX, t.offsetY], o = [], r = [],
                    s = qA([t.tooltipOption, n]), l = this._renderMode, d = this._newLine, u = {};
                GA(e, function (e) {
                    GA(e.dataByAxis, function (e) {
                        var t = i.getComponent(e.axisDim + "Axis", e.axisIndex), n = e.value, a = [];
                        if (t && null != n) {
                            var s = sI(n, t.axis, i, e.seriesDataIndices, e.valueLabelOpt);
                            A(e.seriesDataIndices, function (o) {
                                var d = i.getSeriesByIndex(o.seriesIndex), c = o.dataIndexInside,
                                    h = d && d.getDataParams(c);
                                if (h.axisDim = e.axisDim, h.axisIndex = e.axisIndex, h.axisType = e.axisType, h.axisId = e.axisId, h.axisValue = Qg(t.axis, n), h.axisValueLabel = s, h) {
                                    r.push(h);
                                    var f, g = d.formatTooltip(c, !0, null, l);
                                    if (B(g)) {
                                        f = g.html;
                                        var p = g.markers;
                                        m(u, p)
                                    } else f = g;
                                    a.push(f)
                                }
                            });
                            var c = s;
                            "html" !== l ? o.push(a.join(d)) : o.push((c ? Ql(c) + d : "") + a.join(d))
                        }
                    })
                }, this), o.reverse(), o = o.join(this._newLine + this._newLine);
                var c = t.position;
                this._showOrMove(s, function () {
                    this._updateContentNotChangedOnAxis(e) ? this._updatePosition(s, c, a[0], a[1], this._tooltipContent, r) : this._showTooltipContent(s, o, r, Math.random(), a[0], a[1], c, void 0, u)
                })
            }, _showSeriesItemTooltip: function (e, t, i) {
                var n = this._ecModel, a = t.seriesIndex, o = n.getSeriesByIndex(a), r = t.dataModel || o,
                    s = t.dataIndex, l = t.dataType, d = r.getData(l),
                    u = qA([d.getItemModel(s), r, o && (o.coordinateSystem || {}).model, this._tooltipModel]),
                    c = u.get("trigger");
                if (null == c || "item" === c) {
                    var h, f, g = r.getDataParams(s, l), p = r.formatTooltip(s, !1, l, this._renderMode);
                    f = B(p) ? (h = p.html, p.markers) : (h = p, null);
                    var v = "item_" + r.name + "_" + s;
                    this._showOrMove(u, function () {
                        this._showTooltipContent(u, h, g, v, e.offsetX, e.offsetY, e.position, e.target, f)
                    }), i({
                        type: "showTip",
                        dataIndexInside: s,
                        dataIndex: d.getRawIndex(s),
                        seriesIndex: a,
                        from: this.uid
                    })
                }
            }, _showComponentItemTooltip: function (e, t, i) {
                var n = t.tooltip;
                "string" == typeof n && (n = {content: n, formatter: n});
                var a = new Sl(n, this._tooltipModel, this._ecModel), o = a.get("content"), r = Math.random();
                this._showOrMove(a, function () {
                    this._showTooltipContent(a, o, a.get("formatterParams") || {}, r, e.offsetX, e.offsetY, e.position, t)
                }), i({type: "showTip", from: this.uid})
            }, _showTooltipContent: function (e, t, i, n, a, o, r, s, l) {
                if (this._ticket = "", e.get("showContent") && e.get("show")) {
                    var d = this._tooltipContent, u = e.get("formatter");
                    r = r || e.get("position");
                    var c = t;
                    if (u && "string" == typeof u) c = id(u, i, !0); else if ("function" == typeof u) {
                        var h = jA(function (t, n) {
                            t === this._ticket && (d.setContent(n, l, e), this._updatePosition(e, r, a, o, d, i, s))
                        }, this);
                        this._ticket = n, c = u(i, n, h)
                    }
                    d.setContent(c, l, e), d.show(e), this._updatePosition(e, r, a, o, d, i, s)
                }
            }, _updatePosition: function (e, t, i, n, a, o, r) {
                var s = this._api.getWidth(), l = this._api.getHeight();
                t = t || e.get("position");
                var d = a.getSize(), u = e.get("align"), c = e.get("verticalAlign"),
                    h = r && r.getBoundingRect().clone();
                if (r && h.applyTransform(r.transform), "function" == typeof t && (t = t([i, n], o, a.el, h, {
                    viewSize: [s, l],
                    contentSize: d.slice()
                })), O(t)) i = $A(t[0], s), n = $A(t[1], l); else if (B(t)) {
                    t.width = d[0], t.height = d[1];
                    var f = vd(t, {width: s, height: l});
                    i = f.x, n = f.y, c = u = null
                } else if ("string" == typeof t && r) i = (g = function (e, t, i) {
                    var n = i[0], a = i[1], o = 0, r = 0, s = t.width, l = t.height;
                    switch (e) {
                        case"inside":
                            o = t.x + s / 2 - n / 2, r = t.y + l / 2 - a / 2;
                            break;
                        case"top":
                            o = t.x + s / 2 - n / 2, r = t.y - a - 5;
                            break;
                        case"bottom":
                            o = t.x + s / 2 - n / 2, r = t.y + l + 5;
                            break;
                        case"left":
                            o = t.x - n - 5, r = t.y + l / 2 - a / 2;
                            break;
                        case"right":
                            o = t.x + s + 5, r = t.y + l / 2 - a / 2
                    }
                    return [o, r]
                }(t, h, d))[0], n = g[1]; else {
                    var g;
                    i = (g = function (e, t, i, n, a, o, r) {
                        var s = i.getOuterSize(), l = s.width, d = s.height;
                        return null != o && (n < e + l + o ? e -= l + o : e += o), null != r && (a < t + d + r ? t -= d + r : t += r), [e, t]
                    }(i, n, a, s, l, u ? null : 20, c ? null : 20))[0], n = g[1]
                }
                u && (i -= JA(u) ? d[0] / 2 : "right" === u ? d[0] : 0), c && (n -= JA(c) ? d[1] / 2 : "bottom" === c ? d[1] : 0), e.get("confine") && (i = (g = function (e, t, i, n, a) {
                    var o = i.getOuterSize(), r = o.width, s = o.height;
                    return e = Math.min(e + r, n) - r, t = Math.min(t + s, a) - s, e = Math.max(e, 0), t = Math.max(t, 0), [e, t]
                }(i, n, a, s, l))[0], n = g[1]), a.moveTo(i, n)
            }, _updateContentNotChangedOnAxis: function (e) {
                var t = this._lastDataByCoordSys, i = !!t && t.length === e.length;
                return i && GA(t, function (t, n) {
                    var a = t.dataByAxis || {}, o = (e[n] || {}).dataByAxis || [];
                    (i &= a.length === o.length) && GA(a, function (e, t) {
                        var n = o[t] || {}, a = e.seriesDataIndices || [], r = n.seriesDataIndices || [];
                        (i &= e.value === n.value && e.axisType === n.axisType && e.axisId === n.axisId && a.length === r.length) && GA(a, function (e, t) {
                            var n = r[t];
                            i &= e.seriesIndex === n.seriesIndex && e.dataIndex === n.dataIndex
                        })
                    })
                }), this._lastDataByCoordSys = e, !!i
            }, _hide: function (e) {
                this._lastDataByCoordSys = null, e({type: "hideTip", from: this.uid})
            }, dispose: function (e, t) {
                a.node || (this._tooltipContent.dispose(), qb("itemTooltip", t))
            }
        }), ff({type: "showTip", event: "showTip", update: "tooltip:manuallyShowTip"}, function () {
        }), ff({type: "hideTip", event: "hideTip", update: "tooltip:manuallyHideTip"}, function () {
        });
        var ZA = ["rect", "polygon", "keep", "clear"], QA = A;

        function eD(e) {
            if (e) for (var t in e) if (e.hasOwnProperty(t)) return !0
        }

        function tD(e, t, i) {
            var n = {};
            return QA(t, function (t) {
                var a = n[t] = function () {
                    function e() {
                    }

                    return e.prototype.__hidden = e.prototype, new e
                }();
                QA(e[t], function (e, n) {
                    if (Jk.isValidType(n)) {
                        var o = {type: n, visual: e};
                        i && i(o, t), a[n] = new Jk(o), "opacity" === n && ((o = v(o)).type = "colorAlpha", a.__hidden.__alphaForOpacity = new Jk(o))
                    }
                })
            }), n
        }

        function iD(e, t, i) {
            var n;
            A(i, function (e) {
                t.hasOwnProperty(e) && eD(t[e]) && (n = !0)
            }), n && A(i, function (i) {
                t.hasOwnProperty(i) && eD(t[i]) ? e[i] = v(t[i]) : delete e[i]
            })
        }

        var nD = {
            lineX: aD(0), lineY: aD(1), rect: {
                point: function (e, t, i) {
                    return e && i.boundingRect.contain(e[0], e[1])
                }, rect: function (e, t, i) {
                    return e && i.boundingRect.intersect(e)
                }
            }, polygon: {
                point: function (e, t, i) {
                    return e && i.boundingRect.contain(e[0], e[1]) && vp(i.range, e[0], e[1])
                }, rect: function (e, t, i) {
                    var n = i.range;
                    if (!e || n.length <= 1) return !1;
                    var a = e.x, o = e.y, r = e.width, s = e.height, l = n[0];
                    return !!(vp(n, a, o) || vp(n, a + r, o) || vp(n, a, o + s) || vp(n, a + r, o + s) || Ai.create(e).contain(l[0], l[1]) || fl(a, o, a + r, o, n) || fl(a, o, a, o + s, n) || fl(a + r, o, a + r, o + s, n) || fl(a, o + s, a + r, o + s, n)) || void 0
                }
            }
        };

        function aD(e) {
            var t = ["x", "y"], i = ["width", "height"];
            return {
                point: function (t, i, n) {
                    if (t) {
                        var a = n.range;
                        return oD(t[e], a)
                    }
                }, rect: function (n, a, o) {
                    if (n) {
                        var r = o.range, s = [n[t[e]], n[t[e]] + n[i[e]]];
                        return s[1] < s[0] && s.reverse(), oD(s[0], r) || oD(s[1], r) || oD(r[0], s) || oD(r[1], s)
                    }
                }
            }
        }

        function oD(e, t) {
            return t[0] <= e && e <= t[1]
        }

        var rD = ["inBrush", "outOfBrush"], sD = "__ecBrushSelect", lD = "__ecInBrushSelectEvent", dD = Sh.VISUAL.BRUSH;

        function uD(e) {
            e.eachComponent({mainType: "brush"}, function (t) {
                (t.brushTargetManager = new eA(t.option, e)).setInputRanges(t.areas, e)
            })
        }

        function cD(e, t) {
            if (!e.isDisposed()) {
                var i = e.getZr();
                i[lD] = !0, e.dispatchAction({type: "brushSelect", batch: t}), i[lD] = !1
            }
        }

        function hD(e, t, i, n) {
            for (var a = 0, o = t.length; a < o; a++) {
                var r = t[a];
                if (e[r.brushType](n, i, r.selectors, r)) return !0
            }
        }

        function fD(e) {
            var t = e.brushSelector;
            if (L(t)) {
                var i = [];
                return A(nD, function (e, n) {
                    i[n] = function (i, n, a, o) {
                        var r = n.getItemLayout(i);
                        return e[t](r, a, o)
                    }
                }), i
            }
            if (F(t)) {
                var n = {};
                return A(nD, function (e, i) {
                    n[i] = t
                }), n
            }
            return t
        }

        pf(dD, function (e, t, i) {
            e.eachComponent({mainType: "brush"}, function (e) {
                i && "takeGlobalCursor" === i.type && e.setBrushOption("brush" === i.key ? i.brushOption : {brushType: !1})
            }), uD(e)
        }), vf(dD, function (e, t, i) {
            var n, a, o = [];
            e.eachComponent({mainType: "brush"}, function (t, i) {
                var r = {brushId: t.id, brushIndex: i, brushName: t.name, areas: v(t.areas), selected: []};
                o.push(r);
                var s = t.option, l = s.brushLink, d = [], u = [], c = [], h = 0;
                i || (n = s.throttleType, a = s.throttleDelay);
                var f = D(t.areas, function (e) {
                    return t = T({boundingRect: gD[e.brushType](e)}, e), i = t.selectors = {}, A(nD[t.brushType], function (e, n) {
                        i[n] = function (n) {
                            return e(n, i, t)
                        }
                    }), t;
                    var t, i
                }), g = tD(t.option, rD, function (e) {
                    e.mappingMethod = "fixed"
                });

                function p(e) {
                    return "all" === l || d[e]
                }

                function m(e) {
                    return !!e.length
                }

                O(l) && A(l, function (e) {
                    d[e] = 1
                }), e.eachSeries(function (i, n) {
                    var a = c[n] = [];
                    "parallel" === i.subType ? function (e, t) {
                        var i = e.coordinateSystem;
                        h |= i.hasAxisBrushed(), p(t) && i.eachActiveState(e.getData(), function (e, t) {
                            "active" === e && (u[t] = 1)
                        })
                    }(i, n) : function (i, n, a) {
                        var o = fD(i);
                        if (o && !function (e, t) {
                            var i = e.option.seriesIndex;
                            return null != i && "all" !== i && (O(i) ? S(i, t) < 0 : t !== i)
                        }(t, n) && (A(f, function (n) {
                            o[n.brushType] && t.brushTargetManager.controlSeries(n, i, e) && a.push(n), h |= m(a)
                        }), p(n) && m(a))) {
                            var r = i.getData();
                            r.each(function (e) {
                                hD(o, a, r, e) && (u[e] = 1)
                            })
                        }
                    }(i, n, a)
                }), e.eachSeries(function (e, t) {
                    var i = {seriesId: e.id, seriesIndex: t, seriesName: e.name, dataIndex: []};
                    r.selected.push(i);
                    var n = fD(e), a = c[t], o = e.getData(), s = p(t) ? function (e) {
                        return u[e] ? (i.dataIndex.push(o.getRawIndex(e)), "inBrush") : "outOfBrush"
                    } : function (e) {
                        return hD(n, a, o, e) ? (i.dataIndex.push(o.getRawIndex(e)), "inBrush") : "outOfBrush"
                    };
                    (p(t) ? h : m(a)) && function (e, t, i, n, a, o) {
                        var r, s = {};

                        function l(e) {
                            return i.getItemVisual(r, e)
                        }

                        function d(e, t) {
                            i.setItemVisual(r, e, t)
                        }

                        function u(e, u) {
                            r = null == o ? e : u;
                            var c = i.getRawDataItem(r);
                            if (!c || !1 !== c.visualMap) for (var h = n.call(a, e), f = t[h], g = s[h], p = 0, v = g.length; p < v; p++) {
                                var m = g[p];
                                f[m] && f[m].applyVisual(e, l, d)
                            }
                        }

                        A(e, function (e) {
                            var i = Jk.prepareVisualTypes(t[e]);
                            s[e] = i
                        }), null == o ? i.each(u) : i.each([o], u)
                    }(rD, g, o, s)
                })
            }), function (e, t, i, n, a) {
                if (a) {
                    var o = e.getZr();
                    o[lD] || (o[sD] || (o[sD] = cD), bc(o, sD, i, t)(e, n))
                }
            }(t, n, a, o, i)
        });
        var gD = {
            lineX: te, lineY: te, rect: function (e) {
                return pD(e.range)
            }, polygon: function (e) {
                for (var t, i = e.range, n = 0, a = i.length; n < a; n++) {
                    t = t || [[1 / 0, -1 / 0], [1 / 0, -1 / 0]];
                    var o = i[n];
                    o[0] < t[0][0] && (t[0][0] = o[0]), o[0] > t[0][1] && (t[0][1] = o[0]), o[1] < t[1][0] && (t[1][0] = o[1]), o[1] > t[1][1] && (t[1][1] = o[1])
                }
                return t && pD(t)
            }
        };

        function pD(e) {
            return new Ai(e[0][0], e[1][0], e[0][1] - e[0][0], e[1][1] - e[1][0])
        }

        var vD = ["#ddd"];

        function mD(e, t) {
            return m({
                brushType: e.brushType,
                brushMode: e.brushMode,
                transformable: e.transformable,
                brushStyle: new Sl(e.brushStyle).getItemStyle(),
                removeOnClick: e.removeOnClick,
                z: e.z
            }, t, !0)
        }

        function yD(e, t, i, n) {
            n && n.$from === e.id || this._brushController.setPanels(e.brushTargetManager.makePanelOpts(i)).enableBrush(e.brushOption).updateCovers(e.areas.slice())
        }

        kf({
            type: "brush",
            dependencies: ["geo", "grid", "xAxis", "yAxis", "parallel", "series"],
            defaultOption: {
                toolbox: null,
                brushLink: null,
                seriesIndex: "all",
                geoIndex: null,
                xAxisIndex: null,
                yAxisIndex: null,
                brushType: "rect",
                brushMode: "single",
                transformable: !0,
                brushStyle: {borderWidth: 1, color: "rgba(120,140,180,0.3)", borderColor: "rgba(120,140,180,0.8)"},
                throttleType: "fixRate",
                throttleDelay: 0,
                removeOnClick: !0,
                z: 1e4
            },
            areas: [],
            brushType: null,
            brushOption: {},
            coordInfoList: [],
            optionUpdated: function (e, t) {
                var i = this.option;
                t || iD(i, e, ["inBrush", "outOfBrush"]);
                var n = i.inBrush = i.inBrush || {};
                i.outOfBrush = i.outOfBrush || {color: vD}, n.hasOwnProperty("liftZ") || (n.liftZ = 5)
            },
            setAreas: function (e) {
                e && (this.areas = D(e, function (e) {
                    return mD(this.option, e)
                }, this))
            },
            setBrushOption: function (e) {
                this.brushOption = mD(this.option, e), this.brushType = this.brushOption.brushType
            }
        }), Tf({
            type: "brush", init: function (e, t) {
                this.ecModel = e, this.api = t, this.model, (this._brushController = new aC(t.getZr())).on("brush", P(this._onBrush, this)).mount()
            }, render: function (e) {
                return this.model = e, yD.apply(this, arguments)
            }, updateTransform: function (e, t) {
                return uD(t), yD.apply(this, arguments)
            }, updateView: yD, dispose: function () {
                this._brushController.dispose()
            }, _onBrush: function (e, t) {
                var i = this.model.id;
                this.model.brushTargetManager.setOutputRanges(e, this.ecModel), t.isEnd && !t.removeOnClick || this.api.dispatchAction({
                    type: "brush",
                    brushId: i,
                    areas: v(e),
                    $from: i
                }), t.isEnd && this.api.dispatchAction({type: "brushEnd", brushId: i, areas: v(e), $from: i})
            }
        }), ff({type: "brush", event: "brush"}, function (e, t) {
            t.eachComponent({mainType: "brush", query: e}, function (t) {
                t.setAreas(e.areas)
            })
        }), ff({type: "brushSelect", event: "brushSelected", update: "none"}, function () {
        }), ff({type: "brushEnd", event: "brushEnd", update: "none"}, function () {
        });
        var kD = Ac.toolbox.brush;

        function TD(e, t, i) {
            this.model = e, this.ecModel = t, this.api = i, this._brushType, this._brushMode
        }

        TD.defaultOption = {
            show: !0,
            type: ["rect", "polygon", "lineX", "lineY", "keep", "clear"],
            icon: {
                rect: "M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13",
                polygon: "M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2",
                lineX: "M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4",
                lineY: "M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4",
                keep: "M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z",
                clear: "M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2"
            },
            title: v(kD.title)
        };
        var wD = TD.prototype;

        function CD(e) {
            var t = e.itemStyle || (e.itemStyle = {}), i = t.emphasis || (t.emphasis = {}),
                n = e.label || e.label || {}, a = n.normal || (n.normal = {}), o = {normal: 1, emphasis: 1};
            A(n, function (e, t) {
                o[t] || SD(a, t) || (a[t] = e)
            }), i.label && !SD(n, "emphasis") && (n.emphasis = i.label, delete i.label)
        }

        function SD(e, t) {
            return e.hasOwnProperty(t)
        }

        wD.render = wD.updateView = function (e, t, i) {
            var n, a, o;
            t.eachComponent({mainType: "brush"}, function (e) {
                n = e.brushType, a = e.brushOption.brushMode || "single", o |= e.areas.length
            }), this._brushType = n, this._brushMode = a, A(e.get("type", !0), function (t) {
                e.setIconStatus(t, ("keep" === t ? "multiple" === a : "clear" === t ? o : t === n) ? "emphasis" : "normal")
            })
        }, wD.getIcons = function () {
            var e = this.model, t = e.get("icon", !0), i = {};
            return A(e.get("type", !0), function (e) {
                t[e] && (i[e] = t[e])
            }), i
        }, wD.onclick = function (e, t, i) {
            var n = this._brushType, a = this._brushMode;
            "clear" === i ? (t.dispatchAction({type: "axisAreaSelect", intervals: []}), t.dispatchAction({
                type: "brush",
                command: "clear",
                areas: []
            })) : t.dispatchAction({
                type: "takeGlobalCursor",
                key: "brush",
                brushOption: {
                    brushType: "keep" === i ? n : n !== i && i,
                    brushMode: "keep" === i ? "multiple" === a ? "single" : "multiple" : a
                }
            })
        }, E_("brush", TD), cf(function (e, t) {
            var i = e && e.brush;
            if (O(i) || (i = i ? [i] : []), i.length) {
                var n = [];
                A(i, function (e) {
                    var t = e.hasOwnProperty("toolbox") ? e.toolbox : [];
                    t instanceof Array && (n = n.concat(t))
                });
                var a = e && e.toolbox;
                O(a) && (a = a[0]), a || (a = {feature: {}}, e.toolbox = [a]);
                var o = a.feature || (a.feature = {}), r = o.brush || (o.brush = {}), s = r.type || (r.type = []);
                s.push.apply(s, n), function (e) {
                    var t = {};
                    A(e, function (e) {
                        t[e] = 1
                    }), e.length = 0, A(t, function (t, i) {
                        e.push(i)
                    })
                }(s), t && !s.length && s.push.apply(s, ZA)
            }
        }), kf({
            type: "title",
            layoutMode: {type: "box", ignoreSize: !0},
            defaultOption: {
                zlevel: 0,
                z: 6,
                show: !0,
                text: "",
                target: "blank",
                subtext: "",
                subtarget: "blank",
                left: 0,
                top: 0,
                backgroundColor: "rgba(0,0,0,0)",
                borderColor: "#ccc",
                borderWidth: 0,
                padding: 5,
                itemGap: 10,
                textStyle: {fontSize: 18, fontWeight: "bolder", color: "#333"},
                subtextStyle: {color: "#aaa"}
            }
        }), Tf({
            type: "title", render: function (e, t, i) {
                if (this.group.removeAll(), e.get("show")) {
                    var n = this.group, a = e.getModel("textStyle"), o = e.getModel("subtextStyle"),
                        r = e.get("textAlign"), s = H(e.get("textBaseline"), e.get("textVerticalAlign")), l = new Rr({
                            style: Js({}, a, {
                                text: e.get("text"),
                                textFill: a.getTextColor()
                            }, {disableBox: !0}), z2: 10
                        }), d = l.getBoundingRect(), u = e.get("subtext"), c = new Rr({
                            style: Js({}, o, {
                                text: u,
                                textFill: o.getTextColor(),
                                y: d.height + e.get("itemGap"),
                                textVerticalAlign: "top"
                            }, {disableBox: !0}), z2: 10
                        }), h = e.get("link"), f = e.get("sublink"), g = e.get("triggerEvent", !0);
                    l.silent = !h && !g, c.silent = !f && !g, h && l.on("click", function () {
                        dd(h, "_" + e.get("target"))
                    }), f && c.on("click", function () {
                        dd(h, "_" + e.get("subtarget"))
                    }), l.eventData = c.eventData = g ? {
                        componentType: "title",
                        componentIndex: e.componentIndex
                    } : null, n.add(l), u && n.add(c);
                    var p = n.getBoundingRect(), v = e.getBoxLayoutParams();
                    v.width = p.width, v.height = p.height;
                    var m = vd(v, {width: i.getWidth(), height: i.getHeight()}, e.get("padding"));
                    r || ("middle" === (r = e.get("left") || e.get("right")) && (r = "center"), "right" === r ? m.x += m.width : "center" === r && (m.x += m.width / 2)), s || ("center" === (s = e.get("top") || e.get("bottom")) && (s = "middle"), "bottom" === s ? m.y += m.height : "middle" === s && (m.y += m.height / 2), s = s || "top"), n.attr("position", [m.x, m.y]);
                    var y = {textAlign: r, textVerticalAlign: s};
                    l.setStyle(y), c.setStyle(y), p = n.getBoundingRect();
                    var k = m.margin, T = e.getItemStyle(["color", "opacity"]);
                    T.fill = e.get("backgroundColor");
                    var w = new es({
                        shape: {
                            x: p.x - k[3],
                            y: p.y - k[0],
                            width: p.width + k[1] + k[3],
                            height: p.height + k[0] + k[2],
                            r: e.get("borderRadius")
                        }, style: T, subPixelOptimize: !0, silent: !0
                    });
                    n.add(w)
                }
            }
        }), Id.registerSubTypeDefaulter("timeline", function () {
            return "slider"
        }), ff({type: "timelineChange", event: "timelineChanged", update: "prepareAndUpdate"}, function (e, t) {
            var i = t.getComponent("timeline");
            return i && null != e.currentIndex && (i.setCurrentIndex(e.currentIndex), !i.get("loop", !0) && i.isIndexMax() && i.setPlayState(!1)), t.resetOption("timeline"), T({currentIndex: i.option.currentIndex}, e)
        }), ff({type: "timelinePlayChange", event: "timelinePlayChanged", update: "update"}, function (e, t) {
            var i = t.getComponent("timeline");
            i && null != e.playState && i.setPlayState(e.playState)
        });
        var bD = Id.extend({
            type: "timeline",
            layoutMode: "box",
            defaultOption: {
                zlevel: 0,
                z: 4,
                show: !0,
                axisType: "time",
                realtime: !0,
                left: "20%",
                top: null,
                right: "20%",
                bottom: 0,
                width: null,
                height: 40,
                padding: 5,
                controlPosition: "left",
                autoPlay: !1,
                rewind: !1,
                loop: !0,
                playInterval: 2e3,
                currentIndex: 0,
                itemStyle: {},
                label: {color: "#000"},
                data: []
            },
            init: function (e, t, i) {
                this._data, this._names, this.mergeDefaultAndTheme(e, i), this._initData()
            },
            mergeOption: function (e) {
                bD.superApply(this, "mergeOption", arguments), this._initData()
            },
            setCurrentIndex: function (e) {
                null == e && (e = this.option.currentIndex);
                var t = this._data.count();
                this.option.loop ? e = (e % t + t) % t : (t <= e && (e = t - 1), e < 0 && (e = 0)), this.option.currentIndex = e
            },
            getCurrentIndex: function () {
                return this.option.currentIndex
            },
            isIndexMax: function () {
                return this.getCurrentIndex() >= this._data.count() - 1
            },
            setPlayState: function (e) {
                this.option.autoPlay = !!e
            },
            getPlayState: function () {
                return !!this.option.autoPlay
            },
            _initData: function () {
                var e = this.option, t = e.data || [], i = e.axisType, n = this._names = [];
                if ("category" === i) {
                    var a = [];
                    A(t, function (e, t) {
                        var i, o = Fa(e);
                        B(e) ? (i = v(e)).value = t : i = t, a.push(i), L(o) || null != o && !isNaN(o) || (o = ""), n.push(o + "")
                    }), t = a
                }
                var o = {category: "ordinal", time: "time"}[i] || "number";
                (this._data = new Kf([{name: "value", type: o}], this)).initData(t, n)
            },
            getData: function () {
                return this._data
            },
            getCategories: function () {
                if ("category" === this.get("axisType")) return this._names.slice()
            }
        });

        function ID(e, t, i, n) {
            Dp.call(this, e, t, i), this.type = n || "value", this.model = null
        }

        I(bD.extend({
            type: "timeline.slider",
            defaultOption: {
                backgroundColor: "rgba(0,0,0,0)",
                borderColor: "#ccc",
                borderWidth: 0,
                orient: "horizontal",
                inverse: !1,
                tooltip: {trigger: "item"},
                symbol: "emptyCircle",
                symbolSize: 10,
                lineStyle: {show: !0, width: 2, color: "#304654"},
                label: {position: "auto", show: !0, interval: "auto", rotate: 0, color: "#304654"},
                itemStyle: {color: "#304654", borderWidth: 1},
                checkpointStyle: {
                    symbol: "circle",
                    symbolSize: 13,
                    color: "#c23531",
                    borderWidth: 5,
                    borderColor: "rgba(194,53,49, 0.5)",
                    animation: !0,
                    animationDuration: 300,
                    animationEasing: "quinticInOut"
                },
                controlStyle: {
                    show: !0,
                    showPlayBtn: !0,
                    showPrevBtn: !0,
                    showNextBtn: !0,
                    itemSize: 22,
                    itemGap: 12,
                    position: "left",
                    playIcon: "path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z",
                    stopIcon: "path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z",
                    nextIcon: "path://M18.6,50.8l22.5-22.5c0.2-0.2,0.3-0.4,0.3-0.7c0-0.3-0.1-0.5-0.3-0.7L18.7,4.4c-0.1-0.1-0.2-0.3-0.2-0.5 c0-0.4,0.3-0.8,0.8-0.8c0.2,0,0.5,0.1,0.6,0.3l23.5,23.5l0,0c0.2,0.2,0.3,0.4,0.3,0.7c0,0.3-0.1,0.5-0.3,0.7l-0.1,0.1L19.7,52 c-0.1,0.1-0.3,0.2-0.5,0.2c-0.4,0-0.8-0.3-0.8-0.8C18.4,51.2,18.5,51,18.6,50.8z",
                    prevIcon: "path://M43,52.8L20.4,30.3c-0.2-0.2-0.3-0.4-0.3-0.7c0-0.3,0.1-0.5,0.3-0.7L42.9,6.4c0.1-0.1,0.2-0.3,0.2-0.5 c0-0.4-0.3-0.8-0.8-0.8c-0.2,0-0.5,0.1-0.6,0.3L18.3,28.8l0,0c-0.2,0.2-0.3,0.4-0.3,0.7c0,0.3,0.1,0.5,0.3,0.7l0.1,0.1L41.9,54 c0.1,0.1,0.3,0.2,0.5,0.2c0.4,0,0.8-0.3,0.8-0.8C43.2,53.2,43.1,53,43,52.8z",
                    color: "#304654",
                    borderColor: "#304654",
                    borderWidth: 1
                },
                emphasis: {
                    label: {show: !0, color: "#c23531"},
                    itemStyle: {color: "#c23531"},
                    controlStyle: {color: "#c23531", borderColor: "#c23531", borderWidth: 2}
                },
                data: []
            }
        }), Ru);
        var _D = lc.extend({type: "timeline"});
        ID.prototype = {
            constructor: ID, getLabelModel: function () {
                return this.model.getModel("label")
            }, isHorizontal: function () {
                return "horizontal" === this.model.get("orient")
            }
        }, b(ID, Dp);
        var AD = P, DD = A, xD = Math.PI;

        function ND(e, t, i, n, a, o) {
            var r = t.get("color");
            a ? (a.setColor(r), i.add(a), o && o.onUpdate(a)) : ((a = cp(e.get("symbol"), -1, -1, 2, 2, r)).setStyle("strokeNoScale", !0), i.add(a), o && o.onCreate(a));
            var s = t.getItemStyle(["color", "symbol", "symbolSize"]);
            a.setStyle(s), n = m({rectHover: !0, z2: 100}, n, !0);
            var l = e.get("symbolSize");
            (l = l instanceof Array ? l.slice() : [+l, +l])[0] /= 2, l[1] /= 2, n.scale = l;
            var d = e.get("symbolOffset");
            if (d) {
                var u = n.position = n.position || [0, 0];
                u[0] += Nl(d[0], l[0]), u[1] += Nl(d[1], l[1])
            }
            var c = e.get("symbolRotate");
            return n.rotation = (c || 0) * Math.PI / 180 || 0, a.attr(n), a.updateTransform(), a
        }

        function ED(e, t, i, n, a) {
            if (!e.dragging) {
                var o = n.getModel("checkpointStyle"), r = i.dataToCoord(n.getData().get(["value"], t));
                a || !o.get("animation", !0) ? e.attr({position: [r, 0]}) : (e.stopAnimation(!0), e.animateTo({position: [r, 0]}, o.get("animationDuration", !0), o.get("animationEasing", !0)))
            }
        }

        _D.extend({
            type: "timeline.slider", init: function (e, t) {
                this.api = t, this._axis, this._viewRect, this._timer, this._currentPointer, this._mainGroup, this._labelGroup
            }, render: function (e, t, i, n) {
                if (this.model = e, this.api = i, this.ecModel = t, this.group.removeAll(), e.get("show", !0)) {
                    var a = this._layout(e, i), o = this._createGroup("mainGroup"), r = this._createGroup("labelGroup"),
                        s = this._axis = this._createAxis(a, e);
                    e.formatTooltip = function (e) {
                        return Ql(s.scale.getLabel(e))
                    }, DD(["AxisLine", "AxisTick", "Control", "CurrentPointer"], function (t) {
                        this["_render" + t](a, o, s, e)
                    }, this), this._renderAxisLabel(a, r, s, e), this._position(a, e)
                }
                this._doPlayStop()
            }, remove: function () {
                this._clearTimer(), this.group.removeAll()
            }, dispose: function () {
                this._clearTimer()
            }, _layout: function (e, t) {
                var i = e.get("label.position"), n = e.get("orient"), a = function (e, t) {
                    return vd(e.getBoxLayoutParams(), {width: t.getWidth(), height: t.getHeight()}, e.get("padding"))
                }(e, t);
                null == i || "auto" === i ? i = "horizontal" === n ? a.y + a.height / 2 < t.getHeight() / 2 ? "-" : "+" : a.x + a.width / 2 < t.getWidth() / 2 ? "+" : "-" : isNaN(i) && (i = {
                    horizontal: {
                        top: "-",
                        bottom: "+"
                    }, vertical: {left: "-", right: "+"}
                }[n][i]);
                var o, r, s, l, d = {horizontal: "center", vertical: 0 <= i || "+" === i ? "left" : "right"},
                    u = {horizontal: 0 <= i || "+" === i ? "top" : "bottom", vertical: "middle"},
                    c = {horizontal: 0, vertical: xD / 2}, h = "vertical" === n ? a.height : a.width,
                    f = e.getModel("controlStyle"), g = f.get("show", !0), p = g ? f.get("itemSize") : 0,
                    v = g ? f.get("itemGap") : 0, m = p + v, y = e.get("label.rotate") || 0;
                y = y * xD / 180;
                var k = f.get("position", !0), T = g && f.get("showPlayBtn", !0), w = g && f.get("showPrevBtn", !0),
                    C = g && f.get("showNextBtn", !0), S = 0, b = h;
                return "left" === k || "bottom" === k ? (T && (o = [0, 0], S += m), w && (r = [S, 0], S += m)) : (T && (o = [b - p, 0], b -= m), w && (r = [0, 0], S += m)), C && (s = [b - p, 0], b -= m), l = [S, b], e.get("inverse") && l.reverse(), {
                    viewRect: a,
                    mainLength: h,
                    orient: n,
                    rotation: c[n],
                    labelRotation: y,
                    labelPosOpt: i,
                    labelAlign: e.get("label.align") || d[n],
                    labelBaseline: e.get("label.verticalAlign") || e.get("label.baseline") || u[n],
                    playPosition: o,
                    prevBtnPosition: r,
                    nextBtnPosition: s,
                    axisExtent: l,
                    controlSize: p,
                    controlGap: v
                }
            }, _position: function (e, t) {
                var i = this._mainGroup, n = this._labelGroup, a = e.viewRect;
                if ("vertical" === e.orient) {
                    var o = ot(), r = a.x, s = a.y + a.height;
                    dt(o, o, [-r, -s]), ut(o, o, -xD / 2), dt(o, o, [r, s]), (a = a.clone()).applyTransform(o)
                }
                var l = v(a), d = v(i.getBoundingRect()), u = v(n.getBoundingRect()), c = i.position, h = n.position;
                h[0] = c[0] = l[0][0];
                var f, g = e.labelPosOpt;

                function p(e) {
                    var t = e.position;
                    e.origin = [l[0][0] - t[0], l[1][0] - t[1]]
                }

                function v(e) {
                    return [[e.x, e.x + e.width], [e.y, e.y + e.height]]
                }

                function m(e, t, i, n, a) {
                    e[n] += i[n][a] - t[n][a]
                }

                isNaN(g) ? (m(c, d, l, 1, f = "+" === g ? 0 : 1), m(h, u, l, 1, 1 - f)) : (m(c, d, l, 1, f = 0 <= g ? 0 : 1), h[1] = c[1] + g), i.attr("position", c), n.attr("position", h), i.rotation = n.rotation = e.rotation, p(i), p(n)
            }, _createAxis: function (e, t) {
                var i = t.getData(), n = t.get("axisType"), a = Jg(t, n);
                a.getTicks = function () {
                    return i.mapArray(["value"], function (e) {
                        return e
                    })
                };
                var o = i.getDataExtent("value");
                a.setExtent(o[0], o[1]), a.niceTicks();
                var r = new ID("value", a, e.axisExtent, n);
                return r.model = t, r
            }, _createGroup: function (e) {
                var t = this["_" + e] = new Di;
                return this.group.add(t), t
            }, _renderAxisLine: function (e, t, i, n) {
                var a = i.getExtent();
                n.get("lineStyle.show") && t.add(new is({
                    shape: {x1: a[0], y1: 0, x2: a[1], y2: 0},
                    style: k({lineCap: "round"}, n.getModel("lineStyle").getLineStyle()),
                    silent: !0,
                    z2: 1
                }))
            }, _renderAxisTick: function (e, t, i, n) {
                var a = n.getData(), o = i.scale.getTicks();
                DD(o, function (e) {
                    var o = i.dataToCoord(e), r = a.getItemModel(e), s = r.getModel("itemStyle"),
                        l = r.getModel("emphasis.itemStyle"),
                        d = {position: [o, 0], onclick: AD(this._changeTimeline, this, e)}, u = ND(r, s, t, d);
                    js(u, l.getItemStyle()), r.get("tooltip") ? (u.dataIndex = e, u.dataModel = n) : u.dataIndex = u.dataModel = null
                }, this)
            }, _renderAxisLabel: function (e, t, i, n) {
                if (i.getLabelModel().get("show")) {
                    var a = n.getData(), o = i.getViewLabels();
                    DD(o, function (n) {
                        var o = n.tickValue, r = a.getItemModel(o), s = r.getModel("label"),
                            l = r.getModel("emphasis.label"), d = i.dataToCoord(n.tickValue), u = new Rr({
                                position: [d, 0],
                                rotation: e.labelRotation - e.rotation,
                                onclick: AD(this._changeTimeline, this, o),
                                silent: !1
                            });
                        Js(u.style, s, {
                            text: n.formattedLabel,
                            textAlign: e.labelAlign,
                            textVerticalAlign: e.labelBaseline
                        }), t.add(u), js(u, Js({}, l))
                    }, this)
                }
            }, _renderControl: function (e, t, i, n) {
                var a = e.controlSize, o = e.rotation, r = n.getModel("controlStyle").getItemStyle(),
                    s = n.getModel("emphasis.controlStyle").getItemStyle(), l = [0, -a / 2, a, a], d = n.getPlayState(),
                    u = n.get("inverse", !0);

                function c(e, i, d, u) {
                    if (e) {
                        var c = function (e, t, i, n) {
                            return _s(e.get(t).replace(/^path:\/\//, ""), v(n || {}), new Ai(i[0], i[1], i[2], i[3]), "center")
                        }(n, i, l, {
                            position: e,
                            origin: [a / 2, 0],
                            rotation: u ? -o : 0,
                            rectHover: !0,
                            style: r,
                            onclick: d
                        });
                        t.add(c), js(c, s)
                    }
                }

                c(e.nextBtnPosition, "controlStyle.nextIcon", AD(this._changeTimeline, this, u ? "-" : "+")), c(e.prevBtnPosition, "controlStyle.prevIcon", AD(this._changeTimeline, this, u ? "+" : "-")), c(e.playPosition, "controlStyle." + (d ? "stopIcon" : "playIcon"), AD(this._handlePlayClick, this, !d), !0)
            }, _renderCurrentPointer: function (e, t, i, n) {
                var a = n.getData(), o = n.getCurrentIndex(), r = a.getItemModel(o).getModel("checkpointStyle"),
                    s = this, l = {
                        onCreate: function (e) {
                            e.draggable = !0, e.drift = AD(s._handlePointerDrag, s), e.ondragend = AD(s._handlePointerDragend, s), ED(e, o, i, n, !0)
                        }, onUpdate: function (e) {
                            ED(e, o, i, n)
                        }
                    };
                this._currentPointer = ND(r, r, this._mainGroup, {}, this._currentPointer, l)
            }, _handlePlayClick: function (e) {
                this._clearTimer(), this.api.dispatchAction({type: "timelinePlayChange", playState: e, from: this.uid})
            }, _handlePointerDrag: function (e, t, i) {
                this._clearTimer(), this._pointerChangeTimeline([i.offsetX, i.offsetY])
            }, _handlePointerDragend: function (e) {
                this._pointerChangeTimeline([e.offsetX, e.offsetY], !0)
            }, _pointerChangeTimeline: function (e, t) {
                var i = this._toAxisCoord(e)[0], n = Pl(this._axis.getExtent().slice());
                i > n[1] && (i = n[1]), i < n[0] && (i = n[0]), this._currentPointer.position[0] = i, this._currentPointer.dirty();
                var a = this._findNearestTick(i), o = this.model;
                (t || a !== o.getCurrentIndex() && o.get("realtime")) && this._changeTimeline(a)
            }, _doPlayStop: function () {
                this._clearTimer(), this.model.getPlayState() && (this._timer = setTimeout(AD(function () {
                    var e = this.model;
                    this._changeTimeline(e.getCurrentIndex() + (e.get("rewind", !0) ? -1 : 1))
                }, this), this.model.get("playInterval")))
            }, _toAxisCoord: function (e) {
                return ll(e, this._mainGroup.getLocalTransform(), !0)
            }, _findNearestTick: function (e) {
                var t, i = this.model.getData(), n = 1 / 0, a = this._axis;
                return i.each(["value"], function (i, o) {
                    var r = a.dataToCoord(i), s = Math.abs(r - e);
                    s < n && (n = s, t = o)
                }), t
            }, _clearTimer: function () {
                this._timer && (clearTimeout(this._timer), this._timer = null)
            }, _changeTimeline: function (e) {
                var t = this.model.getCurrentIndex();
                "+" === e ? e = t + 1 : "-" === e && (e = t - 1), this.api.dispatchAction({
                    type: "timelineChange",
                    currentIndex: e,
                    from: this.uid
                })
            }
        }), cf(function (e) {
            var t = e && e.timeline;
            O(t) || (t = t ? [t] : []), A(t, function (e) {
                e && function (e) {
                    var t = e.type, i = {number: "value", time: "time"};
                    if (i[t] && (e.axisType = i[t], delete e.type), CD(e), SD(e, "controlPosition")) {
                        var n = e.controlStyle || (e.controlStyle = {});
                        SD(n, "position") || (n.position = e.controlPosition), "none" !== n.position || SD(n, "show") || (n.show = !1, delete n.position), delete e.controlPosition
                    }
                    A(e.data || [], function (e) {
                        B(e) && !O(e) && (!SD(e, "value") && SD(e, "name") && (e.value = e.name), CD(e))
                    })
                }(e)
            })
        });
        var PD = Xl, MD = Ql;

        function OD(e) {
            Ma(e, "label", ["show"])
        }

        var FD = kf({
            type: "marker", dependencies: ["series", "grid", "polar", "geo"], init: function (e, t, i) {
                this.mergeDefaultAndTheme(e, i), this._mergeOption(e, i, !1, !0)
            }, isAnimationEnabled: function () {
                if (a.node) return !1;
                var e = this.__hostSeries;
                return this.getShallow("animation") && e && e.isAnimationEnabled()
            }, mergeOption: function (e, t) {
                this._mergeOption(e, t, !1, !1)
            }, _mergeOption: function (e, t, i, n) {
                var a = this.constructor, o = this.mainType + "Model";
                i || t.eachSeries(function (e) {
                    var i = e.get(this.mainType, !0), r = e[o];
                    i && i.data ? (r ? r._mergeOption(i, t, !0) : (n && OD(i), A(i.data, function (e) {
                        e instanceof Array ? (OD(e[0]), OD(e[1])) : OD(e)
                    }), k(r = new a(i, this, t), {
                        mainType: this.mainType,
                        seriesIndex: e.seriesIndex,
                        name: e.name,
                        createdBySelf: !0
                    }), r.__hostSeries = e), e[o] = r) : e[o] = null
                }, this)
            }, formatTooltip: function (e) {
                var t = this.getData(), i = this.getRawValue(e), n = O(i) ? D(i, PD).join(", ") : PD(i),
                    a = t.getName(e), o = MD(this.name);
                return null == i && !a || (o += "<br />"), a && (o += MD(a), null != i && (o += " : ")), null != i && (o += MD(n)), o
            }, getData: function () {
                return this._data
            }, setData: function (e) {
                this._data = e
            }
        });
        I(FD, Ru), FD.extend({
            type: "markPoint",
            defaultOption: {
                zlevel: 0,
                z: 5,
                symbol: "pin",
                symbolSize: 50,
                tooltip: {trigger: "item"},
                label: {show: !0, position: "inside"},
                itemStyle: {borderWidth: 2},
                emphasis: {label: {show: !0}}
            }
        });
        var LD = S;

        function BD(e, t, i, n, a, o) {
            var r = [], s = ag(t, n) ? t.getCalculationInfo("stackResultDimension") : n, l = zD(t, s, e),
                d = t.indicesOfNearest(s, l)[0];
            r[a] = t.get(i, d), r[o] = t.get(s, d);
            var u = t.get(n, d), c = Ml(t.get(n, d));
            return 0 <= (c = Math.min(c, 20)) && (r[o] = +r[o].toFixed(c)), [r, u]
        }

        var UD = M, RD = {min: UD(BD, "min"), max: UD(BD, "max"), average: UD(BD, "average")};

        function KD(e, t) {
            var i = e.getData(), n = e.coordinateSystem;
            if (t && !function (e) {
                return !isNaN(parseFloat(e.x)) && !isNaN(parseFloat(e.y))
            }(t) && !O(t.coord) && n) {
                var a = n.dimensions, o = WD(t, i, n, e);
                if ((t = v(t)).type && RD[t.type] && o.baseAxis && o.valueAxis) {
                    var r = LD(a, o.baseAxis.dim), s = LD(a, o.valueAxis.dim),
                        l = RD[t.type](i, o.baseDataDim, o.valueDataDim, r, s);
                    t.coord = l[0], t.value = l[1]
                } else {
                    for (var d = [null != t.xAxis ? t.xAxis : t.radiusAxis, null != t.yAxis ? t.yAxis : t.angleAxis], u = 0; u < 2; u++) RD[d[u]] && (d[u] = zD(i, i.mapDimension(a[u]), d[u]));
                    t.coord = d
                }
            }
            return t
        }

        function WD(e, t, i, n) {
            var a = {};
            return null != e.valueIndex || null != e.valueDim ? (a.valueDataDim = null != e.valueIndex ? t.getDimension(e.valueIndex) : e.valueDim, a.valueAxis = i.getAxis(function (e, t) {
                var i = e.getData(), n = i.dimensions;
                t = i.getDimension(t);
                for (var a = 0; a < n.length; a++) {
                    var o = i.getDimensionInfo(n[a]);
                    if (o.name === t) return o.coordDim
                }
            }(n, a.valueDataDim)), a.baseAxis = i.getOtherAxis(a.valueAxis), a.baseDataDim = t.mapDimension(a.baseAxis.dim)) : (a.baseAxis = n.getBaseAxis(), a.valueAxis = i.getOtherAxis(a.baseAxis), a.baseDataDim = t.mapDimension(a.baseAxis.dim), a.valueDataDim = t.mapDimension(a.valueAxis.dim)), a
        }

        function VD(e, t) {
            return !(e && e.containData && t.coord && !function (e) {
                return !(isNaN(parseFloat(e.x)) && isNaN(parseFloat(e.y)))
            }(t)) || e.containData(t.coord)
        }

        function HD(e, t, i, n) {
            return n < 2 ? e.coord && e.coord[n] : e.value
        }

        function zD(e, t, i) {
            if ("average" !== i) return "median" === i ? e.getMedian(t) : e.getDataExtent(t, !0)["max" === i ? 1 : 0];
            var n = 0, a = 0;
            return e.each(t, function (e, t) {
                isNaN(e) || (n += e, a++)
            }), n / a
        }

        var jD = Tf({
            type: "marker", init: function () {
                this.markerGroupMap = Q()
            }, render: function (e, t, i) {
                var n = this.markerGroupMap;
                n.each(function (e) {
                    e.__keep = !1
                });
                var a = this.type + "Model";
                t.eachSeries(function (e) {
                    var n = e[a];
                    n && this.renderSeries(e, n, t, i)
                }, this), n.each(function (e) {
                    e.__keep || this.group.remove(e.group)
                }, this)
            }, renderSeries: function () {
            }
        });

        function GD(e, t, i) {
            var n = t.coordinateSystem;
            e.each(function (a) {
                var o, r = e.getItemModel(a), s = Nl(r.get("x"), i.getWidth()), l = Nl(r.get("y"), i.getHeight());
                if (isNaN(s) || isNaN(l)) {
                    if (t.getMarkerPosition) o = t.getMarkerPosition(e.getValues(e.dimensions, a)); else if (n) {
                        var d = e.get(n.dimensions[0], a), u = e.get(n.dimensions[1], a);
                        o = n.dataToPoint([d, u])
                    }
                } else o = [s, l];
                isNaN(s) || (o[0] = s), isNaN(l) || (o[1] = l), e.setItemLayout(a, o)
            })
        }

        function $D(e, t, i, n) {
            var a = e.getData(), o = n.type;
            if (!O(n) && ("min" === o || "max" === o || "average" === o || "median" === o || null != n.xAxis || null != n.yAxis)) {
                var r, s;
                if (null != n.yAxis || null != n.xAxis) r = t.getAxis(null != n.yAxis ? "y" : "x"), s = V(n.yAxis, n.xAxis); else {
                    var l = WD(n, a, t, e);
                    r = l.valueAxis, s = zD(a, og(a, l.valueDataDim), o)
                }
                var d = "x" === r.dim ? 0 : 1, u = 1 - d, c = v(n), h = {};
                c.type = null, c.coord = [], h.coord = [], c.coord[u] = -1 / 0, h.coord[u] = 1 / 0;
                var f = i.get("precision");
                0 <= f && "number" == typeof s && (s = +s.toFixed(Math.min(f, 20))), c.coord[d] = h.coord[d] = s, n = [c, h, {
                    type: o,
                    valueIndex: n.valueIndex,
                    value: s
                }]
            }
            return (n = [KD(e, n[0]), KD(e, n[1]), k({}, n[2])])[2].type = n[2].type || "", m(n[2], n[0]), m(n[2], n[1]), n
        }

        function XD(e) {
            return !isNaN(e) && !isFinite(e)
        }

        function qD(e, t, i, n) {
            var a = 1 - e, o = n.dimensions[e];
            return XD(t[a]) && XD(i[a]) && t[e] === i[e] && n.getAxis(o).containData(t[e])
        }

        function YD(e, t) {
            if ("cartesian2d" === e.type) {
                var i = t[0].coord, n = t[1].coord;
                if (i && n && (qD(1, i, n, e) || qD(0, i, n, e))) return !0
            }
            return VD(e, t[0]) && VD(e, t[1])
        }

        function JD(e, t, i, n, a) {
            var o, r = n.coordinateSystem, s = e.getItemModel(t), l = Nl(s.get("x"), a.getWidth()),
                d = Nl(s.get("y"), a.getHeight());
            if (isNaN(l) || isNaN(d)) {
                if (n.getMarkerPosition) o = n.getMarkerPosition(e.getValues(e.dimensions, t)); else {
                    var u = r.dimensions, c = e.get(u[0], t), h = e.get(u[1], t);
                    o = r.dataToPoint([c, h])
                }
                if ("cartesian2d" === r.type) {
                    var f = r.getAxis("x"), g = r.getAxis("y");
                    u = r.dimensions, XD(e.get(u[0], t)) ? o[0] = f.toGlobalCoord(f.getExtent()[i ? 0 : 1]) : XD(e.get(u[1], t)) && (o[1] = g.toGlobalCoord(g.getExtent()[i ? 0 : 1]))
                }
                isNaN(l) || (o[0] = l), isNaN(d) || (o[1] = d)
            } else o = [l, d];
            e.setItemLayout(t, o)
        }

        function ZD(e, t, i, n) {
            var a = KD(e, n[0]), o = KD(e, n[1]), r = V, s = a.coord, l = o.coord;
            s[0] = r(s[0], -1 / 0), s[1] = r(s[1], -1 / 0), l[0] = r(l[0], 1 / 0), l[1] = r(l[1], 1 / 0);
            var d = y([{}, a, o]);
            return d.coord = [a.coord, o.coord], d.x0 = a.x, d.y0 = a.y, d.x1 = o.x, d.y1 = o.y, d
        }

        function QD(e) {
            return !isNaN(e) && !isFinite(e)
        }

        function ex(e, t, i) {
            var n = 1 - e;
            return QD(t[n]) && QD(i[n])
        }

        function tx(e, t) {
            var i = t.coord[0], n = t.coord[1];
            return !("cartesian2d" !== e.type || !i || !n || !ex(1, i, n) && !ex(0, i, n)) || VD(e, {
                coord: i,
                x: t.x0,
                y: t.y0
            }) || VD(e, {coord: n, x: t.x1, y: t.y1})
        }

        function ix(e, t, i, n, a) {
            var o, r = n.coordinateSystem, s = e.getItemModel(t), l = Nl(s.get(i[0]), a.getWidth()),
                d = Nl(s.get(i[1]), a.getHeight());
            if (isNaN(l) || isNaN(d)) {
                if (n.getMarkerPosition) o = n.getMarkerPosition(e.getValues(i, t)); else {
                    var u = [f = e.get(i[0], t), g = e.get(i[1], t)];
                    r.clampData && r.clampData(u, u), o = r.dataToPoint(u, !0)
                }
                if ("cartesian2d" === r.type) {
                    var c = r.getAxis("x"), h = r.getAxis("y"), f = e.get(i[0], t), g = e.get(i[1], t);
                    QD(f) ? o[0] = c.toGlobalCoord(c.getExtent()["x0" === i[0] ? 0 : 1]) : QD(g) && (o[1] = h.toGlobalCoord(h.getExtent()["y0" === i[1] ? 0 : 1]))
                }
                isNaN(l) || (o[0] = l), isNaN(d) || (o[1] = d)
            } else o = [l, d];
            return o
        }

        jD.extend({
            type: "markPoint", updateTransform: function (e, t, i) {
                t.eachSeries(function (e) {
                    var t = e.markPointModel;
                    t && (GD(t.getData(), e, i), this.markerGroupMap.get(e.id).updateLayout(t))
                }, this)
            }, renderSeries: function (e, t, i, n) {
                var a = e.coordinateSystem, o = e.id, r = e.getData(), s = this.markerGroupMap,
                    l = s.get(o) || s.set(o, new zp), d = function (e, t, i) {
                        var n;
                        n = e ? D(e && e.dimensions, function (e) {
                            return T({name: e}, t.getData().getDimensionInfo(t.getData().mapDimension(e)) || {})
                        }) : [{name: "value", type: "float"}];
                        var a = new Kf(n, i), o = D(i.get("data"), M(KD, t));
                        return e && (o = N(o, M(VD, e))), a.initData(o, null, e ? HD : function (e) {
                            return e.value
                        }), a
                    }(a, e, t);
                t.setData(d), GD(t.getData(), e, n), d.each(function (e) {
                    var i = d.getItemModel(e), n = i.getShallow("symbol"), a = i.getShallow("symbolSize"), o = F(n),
                        s = F(a);
                    if (o || s) {
                        var l = t.getRawValue(e), u = t.getDataParams(e);
                        o && (n = n(l, u)), s && (a = a(l, u))
                    }
                    d.setItemVisual(e, {
                        symbol: n,
                        symbolSize: a,
                        color: i.get("itemStyle.color") || r.getVisual("color")
                    })
                }), l.updateData(d), this.group.add(l.group), d.eachItemGraphicEl(function (e) {
                    e.traverse(function (e) {
                        e.dataModel = t
                    })
                }), l.__keep = !0, l.group.silent = t.get("silent") || e.get("silent")
            }
        }), cf(function (e) {
            e.markPoint = e.markPoint || {}
        }), FD.extend({
            type: "markLine",
            defaultOption: {
                zlevel: 0,
                z: 5,
                symbol: ["circle", "arrow"],
                symbolSize: [8, 16],
                precision: 2,
                tooltip: {trigger: "item"},
                label: {show: !0, position: "end", distance: 5},
                lineStyle: {type: "dashed"},
                emphasis: {label: {show: !0}, lineStyle: {width: 3}},
                animationEasing: "linear"
            }
        }), jD.extend({
            type: "markLine", updateTransform: function (e, t, i) {
                t.eachSeries(function (e) {
                    var t = e.markLineModel;
                    if (t) {
                        var n = t.getData(), a = t.__from, o = t.__to;
                        a.each(function (t) {
                            JD(a, t, !0, e, i), JD(o, t, !1, e, i)
                        }), n.each(function (e) {
                            n.setItemLayout(e, [a.getItemLayout(e), o.getItemLayout(e)])
                        }), this.markerGroupMap.get(e.id).updateLayout()
                    }
                }, this)
            }, renderSeries: function (e, t, i, n) {
                var a = e.coordinateSystem, o = e.id, r = e.getData(), s = this.markerGroupMap,
                    l = s.get(o) || s.set(o, new $T);
                this.group.add(l.group);
                var d = function (e, t, i) {
                    var n;
                    n = e ? D(e && e.dimensions, function (e) {
                        return T({name: e}, t.getData().getDimensionInfo(t.getData().mapDimension(e)) || {})
                    }) : [{name: "value", type: "float"}];
                    var a = new Kf(n, i), o = new Kf(n, i), r = new Kf([], i), s = D(i.get("data"), M($D, t, e, i));
                    e && (s = N(s, M(YD, e)));
                    var l = e ? HD : function (e) {
                        return e.value
                    };
                    return a.initData(D(s, function (e) {
                        return e[0]
                    }), null, l), o.initData(D(s, function (e) {
                        return e[1]
                    }), null, l), r.initData(D(s, function (e) {
                        return e[2]
                    })), r.hasItemOption = !0, {from: a, to: o, line: r}
                }(a, e, t), u = d.from, c = d.to, h = d.line;
                t.__from = u, t.__to = c, t.setData(h);
                var f = t.get("symbol"), g = t.get("symbolSize");

                function p(t, i, a) {
                    var o = t.getItemModel(i);
                    JD(t, i, a, e, n), t.setItemVisual(i, {
                        symbolSize: o.get("symbolSize") || g[a ? 0 : 1],
                        symbol: o.get("symbol", !0) || f[a ? 0 : 1],
                        color: o.get("itemStyle.color") || r.getVisual("color")
                    })
                }

                O(f) || (f = [f, f]), "number" == typeof g && (g = [g, g]), d.from.each(function (e) {
                    p(u, e, !0), p(c, e, !1)
                }), h.each(function (e) {
                    var t = h.getItemModel(e).get("lineStyle.color");
                    h.setItemVisual(e, {color: t || u.getItemVisual(e, "color")}), h.setItemLayout(e, [u.getItemLayout(e), c.getItemLayout(e)]), h.setItemVisual(e, {
                        fromSymbolSize: u.getItemVisual(e, "symbolSize"),
                        fromSymbol: u.getItemVisual(e, "symbol"),
                        toSymbolSize: c.getItemVisual(e, "symbolSize"),
                        toSymbol: c.getItemVisual(e, "symbol")
                    })
                }), l.updateData(h), d.line.eachItemGraphicEl(function (e, i) {
                    e.traverse(function (e) {
                        e.dataModel = t
                    })
                }), l.__keep = !0, l.group.silent = t.get("silent") || e.get("silent")
            }
        }), cf(function (e) {
            e.markLine = e.markLine || {}
        }), FD.extend({
            type: "markArea",
            defaultOption: {
                zlevel: 0,
                z: 1,
                tooltip: {trigger: "item"},
                animation: !1,
                label: {show: !0, position: "top"},
                itemStyle: {borderWidth: 0},
                emphasis: {label: {show: !0, position: "top"}}
            }
        });
        var nx = [["x0", "y0"], ["x1", "y0"], ["x1", "y1"], ["x0", "y1"]];
        jD.extend({
            type: "markArea", updateTransform: function (e, t, i) {
                t.eachSeries(function (e) {
                    var t = e.markAreaModel;
                    if (t) {
                        var n = t.getData();
                        n.each(function (t) {
                            var a = D(nx, function (a) {
                                return ix(n, t, a, e, i)
                            });
                            n.setItemLayout(t, a), n.getItemGraphicEl(t).setShape("points", a)
                        })
                    }
                }, this)
            }, renderSeries: function (e, t, i, n) {
                var a = e.coordinateSystem, o = e.id, r = e.getData(), s = this.markerGroupMap,
                    l = s.get(o) || s.set(o, {group: new Di});
                this.group.add(l.group), l.__keep = !0;
                var d = function (e, t, i) {
                    var n, a;
                    a = e ? (n = D(e && e.dimensions, function (e) {
                        var i = t.getData();
                        return T({name: e}, i.getDimensionInfo(i.mapDimension(e)) || {})
                    }), new Kf(D(["x0", "y0", "x1", "y1"], function (e, t) {
                        return {name: e, type: n[t % 2].type}
                    }), i)) : new Kf(n = [{name: "value", type: "float"}], i);
                    var o = D(i.get("data"), M(ZD, t, e, i));
                    e && (o = N(o, M(tx, e)));
                    var r = e ? function (e, t, i, n) {
                        return e.coord[Math.floor(n / 2)][n % 2]
                    } : function (e) {
                        return e.value
                    };
                    return a.initData(o, null, r), a.hasItemOption = !0, a
                }(a, e, t);
                t.setData(d), d.each(function (t) {
                    d.setItemLayout(t, D(nx, function (i) {
                        return ix(d, t, i, e, n)
                    })), d.setItemVisual(t, {color: r.getVisual("color")})
                }), d.diff(l.__data).add(function (e) {
                    var t = new $r({shape: {points: d.getItemLayout(e)}});
                    d.setItemGraphicEl(e, t), l.group.add(t)
                }).update(function (e, i) {
                    var n = l.__data.getItemGraphicEl(i);
                    ol(n, {shape: {points: d.getItemLayout(e)}}, t, e), l.group.add(n), d.setItemGraphicEl(e, n)
                }).remove(function (e) {
                    var t = l.__data.getItemGraphicEl(e);
                    l.group.remove(t)
                }).execute(), d.eachItemGraphicEl(function (e, i) {
                    var n = d.getItemModel(i), a = n.getModel("label"), o = n.getModel("emphasis.label"),
                        r = d.getItemVisual(i, "color");
                    e.useStyle(T(n.getModel("itemStyle").getItemStyle(), {
                        fill: Yt(r, .4),
                        stroke: r
                    })), e.hoverStyle = n.getModel("emphasis.itemStyle").getItemStyle(), qs(e.style, e.hoverStyle, a, o, {
                        labelFetcher: t,
                        labelDataIndex: i,
                        defaultText: d.getName(i) || "",
                        isRectText: !0,
                        autoColor: r
                    }), js(e, {}), e.dataModel = t
                }), l.__data = d, l.group.silent = t.get("silent") || e.get("silent")
            }
        }), cf(function (e) {
            e.markArea = e.markArea || {}
        });
        var ax = Ac.legend.selector,
            ox = {all: {type: "all", title: v(ax.all)}, inverse: {type: "inverse", title: v(ax.inverse)}}, rx = kf({
                type: "legend.plain",
                dependencies: ["series"],
                layoutMode: {type: "box", ignoreSize: !0},
                init: function (e, t, i) {
                    this.mergeDefaultAndTheme(e, i), e.selected = e.selected || {}, this._updateSelector(e)
                },
                mergeOption: function (e) {
                    rx.superCall(this, "mergeOption", e), this._updateSelector(e)
                },
                _updateSelector: function (e) {
                    var t = e.selector;
                    !0 === t && (t = e.selector = ["all", "inverse"]), O(t) && A(t, function (e, i) {
                        L(e) && (e = {type: e}), t[i] = m(e, ox[e.type])
                    })
                },
                optionUpdated: function () {
                    this._updateData(this.ecModel);
                    var e = this._data;
                    if (e[0] && "single" === this.get("selectedMode")) {
                        for (var t = !1, i = 0; i < e.length; i++) {
                            var n = e[i].get("name");
                            if (this.isSelected(n)) {
                                this.select(n), t = !0;
                                break
                            }
                        }
                        t || this.select(e[0].get("name"))
                    }
                },
                _updateData: function (e) {
                    var t = [], i = [];
                    e.eachRawSeries(function (n) {
                        var a, o = n.name;
                        if (i.push(o), n.legendVisualProvider) {
                            var r = n.legendVisualProvider.getAllNames();
                            e.isSeriesFiltered(n) || (i = i.concat(r)), r.length ? t = t.concat(r) : a = !0
                        } else a = !0;
                        a && Ua(n) && t.push(n.name)
                    }), this._availableNames = i;
                    var n = D(this.get("data") || t, function (e) {
                        return "string" != typeof e && "number" != typeof e || (e = {name: e}), new Sl(e, this, this.ecModel)
                    }, this);
                    this._data = n
                },
                getData: function () {
                    return this._data
                },
                select: function (e) {
                    var t = this.option.selected;
                    "single" === this.get("selectedMode") && A(this._data, function (e) {
                        t[e.get("name")] = !1
                    }), t[e] = !0
                },
                unSelect: function (e) {
                    "single" !== this.get("selectedMode") && (this.option.selected[e] = !1)
                },
                toggleSelected: function (e) {
                    var t = this.option.selected;
                    t.hasOwnProperty(e) || (t[e] = !0), this[t[e] ? "unSelect" : "select"](e)
                },
                allSelect: function () {
                    var e = this._data, t = this.option.selected;
                    A(e, function (e) {
                        t[e.get("name", !0)] = !0
                    })
                },
                inverseSelect: function () {
                    var e = this._data, t = this.option.selected;
                    A(e, function (e) {
                        var i = e.get("name", !0);
                        t.hasOwnProperty(i) || (t[i] = !0), t[i] = !t[i]
                    })
                },
                isSelected: function (e) {
                    var t = this.option.selected;
                    return !(t.hasOwnProperty(e) && !t[e]) && 0 <= S(this._availableNames, e)
                },
                getOrient: function () {
                    return "vertical" === this.get("orient") ? {index: 1, name: "vertical"} : {index: 0, name: "horizontal"}
                },
                defaultOption: {
                    zlevel: 0,
                    z: 4,
                    show: !0,
                    orient: "horizontal",
                    left: "center",
                    top: 0,
                    align: "auto",
                    backgroundColor: "rgba(0,0,0,0)",
                    borderColor: "#ccc",
                    borderRadius: 0,
                    borderWidth: 0,
                    padding: 5,
                    itemGap: 10,
                    itemWidth: 25,
                    itemHeight: 14,
                    inactiveColor: "#ccc",
                    inactiveBorderColor: "#ccc",
                    itemStyle: {borderWidth: 0},
                    textStyle: {color: "#333"},
                    selectedMode: !0,
                    selector: !1,
                    selectorLabel: {
                        show: !0,
                        borderRadius: 10,
                        padding: [3, 5, 3, 5],
                        fontSize: 12,
                        fontFamily: " sans-serif",
                        color: "#666",
                        borderWidth: 1,
                        borderColor: "#666"
                    },
                    emphasis: {selectorLabel: {show: !0, color: "#eee", backgroundColor: "#666"}},
                    selectorPosition: "auto",
                    selectorItemGap: 7,
                    selectorButtonGap: 10,
                    tooltip: {show: !1}
                }
            });

        function sx(e, t, i) {
            var n, a = {}, o = "toggleSelected" === e;
            return i.eachComponent("legend", function (i) {
                o && null != n ? i[n ? "select" : "unSelect"](t.name) : "allSelect" === e || "inverseSelect" === e ? i[e]() : (i[e](t.name), n = i.isSelected(t.name)), A(i.getData(), function (e) {
                    var t = e.get("name");
                    if ("\n" !== t && "" !== t) {
                        var n = i.isSelected(t);
                        a.hasOwnProperty(t) ? a[t] = a[t] && n : a[t] = n
                    }
                })
            }), "allSelect" === e || "inverseSelect" === e ? {selected: a} : {name: t.name, selected: a}
        }

        ff("legendToggleSelect", "legendselectchanged", M(sx, "toggleSelected")), ff("legendAllSelect", "legendselectall", M(sx, "allSelect")), ff("legendInverseSelect", "legendinverseselect", M(sx, "inverseSelect")), ff("legendSelect", "legendselected", M(sx, "select")), ff("legendUnSelect", "legendunselected", M(sx, "unSelect"));
        var lx = M, dx = A, ux = Di, cx = Tf({
            type: "legend.plain", newlineDisabled: !1, init: function () {
                this.group.add(this._contentGroup = new ux), this._backgroundEl, this.group.add(this._selectorGroup = new ux), this._isFirstRender = !0
            }, getContentGroup: function () {
                return this._contentGroup
            }, getSelectorGroup: function () {
                return this._selectorGroup
            }, render: function (e, t, i) {
                var n = this._isFirstRender;
                if (this._isFirstRender = !1, this.resetInner(), e.get("show", !0)) {
                    var a = e.get("align"), o = e.get("orient");
                    a && "auto" !== a || (a = "right" === e.get("left") && "vertical" === o ? "right" : "left");
                    var r = e.get("selector", !0), s = e.get("selectorPosition", !0);
                    !r || s && "auto" !== s || (s = "horizontal" === o ? "end" : "start"), this.renderInner(a, e, t, i, r, o, s);
                    var l = e.getBoxLayoutParams(), d = {width: i.getWidth(), height: i.getHeight()},
                        u = e.get("padding"), c = vd(l, d, u), h = this.layoutInner(e, a, c, n, r, s),
                        f = vd(T({width: h.width, height: h.height}, l), d, u);
                    this.group.attr("position", [f.x - h.x, f.y - h.y]), this.group.add(this._backgroundEl = O_(h, e))
                }
            }, resetInner: function () {
                this.getContentGroup().removeAll(), this._backgroundEl && this.group.remove(this._backgroundEl), this.getSelectorGroup().removeAll()
            }, renderInner: function (e, t, i, n, a, o, r) {
                var s = this.getContentGroup(), l = Q(), d = t.get("selectedMode"), u = [];
                i.eachRawSeries(function (e) {
                    e.get("legendHoverLink") || u.push(e.id)
                }), dx(t.getData(), function (a, o) {
                    var r = a.get("name");
                    if (this.newlineDisabled || "" !== r && "\n" !== r) {
                        var c = i.getSeriesByName(r)[0];
                        if (!l.get(r)) if (c) {
                            var h = c.getData(), f = h.getVisual("color"), g = h.getVisual("borderColor");
                            "function" == typeof f && (f = f(c.getDataParams(0))), "function" == typeof g && (g = g(c.getDataParams(0)));
                            var p = h.getVisual("legendSymbol") || "roundRect", v = h.getVisual("symbol");
                            this._createItem(r, o, a, t, p, v, e, f, g, d).on("click", lx(fx, r, null, n, u)).on("mouseover", lx(gx, c.name, null, n, u)).on("mouseout", lx(px, c.name, null, n, u)), l.set(r, !0)
                        } else i.eachRawSeries(function (i) {
                            if (!l.get(r) && i.legendVisualProvider) {
                                var s = i.legendVisualProvider;
                                if (!s.containName(r)) return;
                                var c = s.indexOfName(r), h = s.getItemVisual(c, "color"),
                                    f = s.getItemVisual(c, "borderColor");
                                this._createItem(r, o, a, t, "roundRect", null, e, h, f, d).on("click", lx(fx, null, r, n, u)).on("mouseover", lx(gx, null, r, n, u)).on("mouseout", lx(px, null, r, n, u)), l.set(r, !0)
                            }
                        }, this)
                    } else s.add(new ux({newline: !0}))
                }, this), a && this._createSelector(a, t, n, o, r)
            }, _createSelector: function (e, t, i, n, a) {
                var o = this.getSelectorGroup();
                dx(e, function (e) {
                    !function (e) {
                        var n = e.type, a = new Rr({
                            style: {x: 0, y: 0, align: "center", verticalAlign: "middle"},
                            onclick: function () {
                                i.dispatchAction({type: "all" === n ? "legendAllSelect" : "legendInverseSelect"})
                            }
                        });
                        o.add(a);
                        var r = t.getModel("selectorLabel"), s = t.getModel("emphasis.selectorLabel");
                        qs(a.style, a.hoverStyle = {}, r, s, {defaultText: e.title, isRectText: !1}), js(a)
                    }(e)
                })
            }, _createItem: function (e, t, i, n, a, o, r, s, l, d) {
                var u = n.get("itemWidth"), c = n.get("itemHeight"), h = n.get("inactiveColor"),
                    f = n.get("inactiveBorderColor"), g = n.get("symbolKeepAspect"), p = n.getModel("itemStyle"),
                    v = n.isSelected(e), m = new ux, y = i.getModel("textStyle"), T = i.get("icon"),
                    w = i.getModel("tooltip"), C = w.parentModel,
                    S = cp(a = T || a, 0, 0, u, c, v ? s : h, null == g || g);
                if (m.add(hx(S, a, p, l, f, v)), !T && o && (o !== a || "none" === o)) {
                    var b = .8 * c;
                    "none" === o && (o = "circle");
                    var I = cp(o, (u - b) / 2, (c - b) / 2, b, b, v ? s : h, null == g || g);
                    m.add(hx(I, o, p, l, f, v))
                }
                var _ = "left" === r ? u + 5 : -5, A = r, D = n.get("formatter"), x = e;
                "string" == typeof D && D ? x = D.replace("{name}", null != e ? e : "") : "function" == typeof D && (x = D(e)), m.add(new Rr({
                    style: Js({}, y, {
                        text: x,
                        x: _,
                        y: c / 2,
                        textFill: v ? y.getTextColor() : h,
                        textAlign: A,
                        textVerticalAlign: "middle"
                    })
                }));
                var N = new es({
                    shape: m.getBoundingRect(),
                    invisible: !0,
                    tooltip: w.get("show") ? k({
                        content: e,
                        formatter: C.get("formatter", !0) || function () {
                            return e
                        },
                        formatterParams: {
                            componentType: "legend",
                            legendIndex: n.componentIndex,
                            name: e,
                            $vars: ["name"]
                        }
                    }, w.option) : null
                });
                return m.add(N), m.eachChild(function (e) {
                    e.silent = !0
                }), N.silent = !d, this.getContentGroup().add(m), js(m), m.__legendDataIndex = t, m
            }, layoutInner: function (e, t, i, n, a, o) {
                var r = this.getContentGroup(), s = this.getSelectorGroup();
                pd(e.get("orient"), r, e.get("itemGap"), i.width, i.height);
                var l = r.getBoundingRect(), d = [-l.x, -l.y];
                if (a) {
                    pd("horizontal", s, e.get("selectorItemGap", !0));
                    var u = s.getBoundingRect(), c = [-u.x, -u.y], h = e.get("selectorButtonGap", !0),
                        f = e.getOrient().index, g = 0 === f ? "width" : "height", p = 0 === f ? "height" : "width",
                        v = 0 === f ? "y" : "x";
                    "end" === o ? c[f] += l[g] + h : d[f] += u[g] + h, c[1 - f] += l[p] / 2 - u[p] / 2, s.attr("position", c), r.attr("position", d);
                    var m = {x: 0, y: 0};
                    return m[g] = l[g] + h + u[g], m[p] = Math.max(l[p], u[p]), m[v] = Math.min(0, u[v] + c[1 - f]), m
                }
                return r.attr("position", d), this.group.getBoundingRect()
            }, remove: function () {
                this.getContentGroup().removeAll(), this._isFirstRender = !0
            }
        });

        function hx(e, t, i, n, a, o) {
            var r;
            return "line" !== t && t.indexOf("empty") < 0 ? (r = i.getItemStyle(), e.style.stroke = n, o || (r.stroke = a)) : r = i.getItemStyle(["borderWidth", "borderColor"]), e.setStyle(r)
        }

        function fx(e, t, i, n) {
            px(e, t, i, n), i.dispatchAction({type: "legendToggleSelect", name: null != e ? e : t}), gx(e, t, i, n)
        }

        function gx(e, t, i, n) {
            var a = i.getZr().storage.getDisplayList()[0];
            a && a.useHoverLayer || i.dispatchAction({type: "highlight", seriesName: e, name: t, excludeSeriesId: n})
        }

        function px(e, t, i, n) {
            var a = i.getZr().storage.getDisplayList()[0];
            a && a.useHoverLayer || i.dispatchAction({type: "downplay", seriesName: e, name: t, excludeSeriesId: n})
        }

        hf(Sh.PROCESSOR.SERIES_FILTER, function (e) {
            var t = e.findComponents({mainType: "legend"});
            t && t.length && e.filterSeries(function (e) {
                for (var i = 0; i < t.length; i++) if (!t[i].isSelected(e.name)) return !1;
                return !0
            })
        }), Id.registerSubTypeDefaulter("legend", function () {
            return "plain"
        });
        var vx = rx.extend({
            type: "legend.scroll",
            setScrollDataIndex: function (e) {
                this.option.scrollDataIndex = e
            },
            defaultOption: {
                scrollDataIndex: 0,
                pageButtonItemGap: 5,
                pageButtonGap: null,
                pageButtonPosition: "end",
                pageFormatter: "{current}/{total}",
                pageIcons: {
                    horizontal: ["M0,0L12,-10L12,10z", "M0,0L-12,-10L-12,10z"],
                    vertical: ["M0,0L20,0L10,-20z", "M0,0L20,0L10,20z"]
                },
                pageIconColor: "#2f4554",
                pageIconInactiveColor: "#aaa",
                pageIconSize: 15,
                pageTextStyle: {color: "#333"},
                animationDurationUpdate: 800
            },
            init: function (e, t, i, n) {
                var a = kd(e);
                vx.superCall(this, "init", e, t, i, n), mx(this, e, a)
            },
            mergeOption: function (e, t) {
                vx.superCall(this, "mergeOption", e, t), mx(this, this.option, e)
            }
        });

        function mx(e, t, i) {
            var n = [1, 1];
            n[e.getOrient().index] = 0, yd(t, i, {type: "box", ignoreSize: n})
        }

        var yx = Di, kx = ["width", "height"], Tx = ["x", "y"], Cx = cx.extend({
            type: "legend.scroll", newlineDisabled: !0, init: function () {
                Cx.superCall(this, "init"), this._currentIndex = 0, this.group.add(this._containerGroup = new yx), this._containerGroup.add(this.getContentGroup()), this.group.add(this._controllerGroup = new yx), this._showController
            }, resetInner: function () {
                Cx.superCall(this, "resetInner"), this._controllerGroup.removeAll(), this._containerGroup.removeClipPath(), this._containerGroup.__rectSize = null
            }, renderInner: function (e, t, i, n, a, o, r) {
                var s = this;
                Cx.superCall(this, "renderInner", e, t, i, n, a, o, r);
                var l = this._controllerGroup, d = t.get("pageIconSize", !0);
                O(d) || (d = [d, d]), c("pagePrev", 0);
                var u = t.getModel("pageTextStyle");

                function c(e, i) {
                    var a = e + "DataIndex",
                        o = hl(t.get("pageIcons", !0)[t.getOrient().name][i], {onclick: P(s._pageGo, s, a, t, n)}, {
                            x: -d[0] / 2,
                            y: -d[1] / 2,
                            width: d[0],
                            height: d[1]
                        });
                    o.name = e, l.add(o)
                }

                l.add(new Rr({
                    name: "pageText",
                    style: {
                        textFill: u.getTextColor(),
                        font: u.getFont(),
                        textVerticalAlign: "middle",
                        textAlign: "center"
                    },
                    silent: !0
                })), c("pageNext", 1)
            }, layoutInner: function (e, t, i, n, a, o) {
                var r = this.getSelectorGroup(), s = e.getOrient().index, l = kx[s], d = Tx[s], u = kx[1 - s],
                    c = Tx[1 - s];
                a && pd("horizontal", r, e.get("selectorItemGap", !0));
                var h = e.get("selectorButtonGap", !0), f = r.getBoundingRect(), g = [-f.x, -f.y], p = v(i);
                a && (p[l] = i[l] - f[l] - h);
                var m = this._layoutContentAndController(e, n, p, s, l, u, c);
                if (a) {
                    if ("end" === o) g[s] += m[l] + h; else {
                        var y = f[l] + h;
                        g[s] -= y, m[d] -= y
                    }
                    m[l] += f[l] + h, g[1 - s] += m[c] + m[u] / 2 - f[u] / 2, m[u] = Math.max(m[u], f[u]), m[c] = Math.min(m[c], f[c] + g[1 - s]), r.attr("position", g)
                }
                return m
            }, _layoutContentAndController: function (e, t, i, n, a, o, r) {
                var s = this.getContentGroup(), l = this._containerGroup, d = this._controllerGroup;
                pd(e.get("orient"), s, e.get("itemGap"), n ? i.width : null, n ? null : i.height), pd("horizontal", d, e.get("pageButtonItemGap", !0));
                var u = s.getBoundingRect(), c = d.getBoundingRect(), h = this._showController = u[a] > i[a],
                    f = [-u.x, -u.y];
                t || (f[n] = s.position[n]);
                var g = [0, 0], p = [-c.x, -c.y], v = H(e.get("pageButtonGap", !0), e.get("itemGap", !0));
                h && ("end" === e.get("pageButtonPosition", !0) ? p[n] += i[a] - c[a] : g[n] += c[a] + v), p[1 - n] += u[o] / 2 - c[o] / 2, s.attr("position", f), l.attr("position", g), d.attr("position", p);
                var m = {x: 0, y: 0};
                if (m[a] = h ? i[a] : u[a], m[o] = Math.max(u[o], c[o]), m[r] = Math.min(0, c[r] + p[1 - n]), l.__rectSize = i[a], h) {
                    var y = {x: 0, y: 0};
                    y[a] = Math.max(i[a] - c[a] - v, 0), y[o] = m[o], l.setClipPath(new es({shape: y})), l.__rectSize = y[a]
                } else d.eachChild(function (e) {
                    e.attr({invisible: !0, silent: !0})
                });
                var k = this._getPageInfo(e);
                return null != k.pageIndex && ol(s, {position: k.contentPosition}, h && e), this._updatePageInfoView(e, k), m
            }, _pageGo: function (e, t, i) {
                var n = this._getPageInfo(t)[e];
                null != n && i.dispatchAction({type: "legendScroll", scrollDataIndex: n, legendId: t.id})
            }, _updatePageInfoView: function (e, t) {
                var i = this._controllerGroup;
                A(["pagePrev", "pageNext"], function (n) {
                    var a = null != t[n + "DataIndex"], o = i.childOfName(n);
                    o && (o.setStyle("fill", a ? e.get("pageIconColor", !0) : e.get("pageIconInactiveColor", !0)), o.cursor = a ? "pointer" : "default")
                });
                var n = i.childOfName("pageText"), a = e.get("pageFormatter"), o = t.pageIndex,
                    r = null != o ? o + 1 : 0, s = t.pageCount;
                n && a && n.setStyle("text", L(a) ? a.replace("{current}", r).replace("{total}", s) : a({
                    current: r,
                    total: s
                }))
            }, _getPageInfo: function (e) {
                var t = e.get("scrollDataIndex", !0), i = this.getContentGroup(), n = this._containerGroup.__rectSize,
                    a = e.getOrient().index, o = kx[a], r = Tx[a], s = this._findTargetItemIndex(t), l = i.children(),
                    d = l[s], u = l.length, c = u ? 1 : 0, h = {
                        contentPosition: i.position.slice(),
                        pageCount: c,
                        pageIndex: c - 1,
                        pagePrevDataIndex: null,
                        pageNextDataIndex: null
                    };
                if (!d) return h;
                var f = y(d);
                h.contentPosition[a] = -f.s;
                for (var g = s + 1, p = f, v = f, m = null; g <= u; ++g) (!(m = y(l[g])) && v.e > p.s + n || m && !k(m, p.s)) && (p = v.i > p.i ? v : m) && (null == h.pageNextDataIndex && (h.pageNextDataIndex = p.i), ++h.pageCount), v = m;
                for (g = s - 1, p = f, v = f, m = null; -1 <= g; --g) (m = y(l[g])) && k(v, m.s) || !(p.i < v.i) || (v = p, null == h.pagePrevDataIndex && (h.pagePrevDataIndex = p.i), ++h.pageCount, ++h.pageIndex), p = m;
                return h;

                function y(e) {
                    if (e) {
                        var t = e.getBoundingRect(), i = t[r] + e.position[a];
                        return {s: i, e: i + t[o], i: e.__legendDataIndex}
                    }
                }

                function k(e, t) {
                    return e.e >= t && e.s <= t + n
                }
            }, _findTargetItemIndex: function (e) {
                return this._showController ? (this.getContentGroup().eachChild(function (n, a) {
                    var o = n.__legendDataIndex;
                    null == i && null != o && (i = a), o === e && (t = a)
                }), null != t ? t : i) : 0;
                var t, i
            }
        });
        ff("legendScroll", "legendscroll", function (e, t) {
            var i = e.scrollDataIndex;
            null != i && t.eachComponent({mainType: "legend", subType: "scroll", query: e}, function (e) {
                e.setScrollDataIndex(i)
            })
        }), AA.extend({
            type: "dataZoom.slider",
            layoutMode: "box",
            defaultOption: {
                show: !0,
                right: "ph",
                top: "ph",
                width: "ph",
                height: "ph",
                left: null,
                bottom: null,
                backgroundColor: "rgba(47,69,84,0)",
                dataBackground: {
                    lineStyle: {color: "#2f4554", width: .5, opacity: .3},
                    areaStyle: {color: "rgba(47,69,84,0.3)", opacity: .3}
                },
                borderColor: "#ddd",
                fillerColor: "rgba(167,183,204,0.4)",
                handleIcon: "M8.2,13.6V3.9H6.3v9.7H3.1v14.9h3.3v9.7h1.8v-9.7h3.3V13.6H8.2z M9.7,24.4H4.8v-1.4h4.9V24.4z M9.7,19.1H4.8v-1.4h4.9V19.1z",
                handleSize: "100%",
                handleStyle: {color: "#a7b7cc"},
                labelPrecision: null,
                labelFormatter: null,
                showDetail: !0,
                showDataShadow: "auto",
                realtime: !0,
                zoomLock: !1,
                textStyle: {color: "#333"}
            }
        });
        var Sx = es, bx = xl, Ix = Pl, _x = P, Ax = A, Dx = "horizontal", xx = "vertical",
            Nx = ["line", "bar", "candlestick", "scatter"], Ex = NA.extend({
                type: "dataZoom.slider", init: function (e, t) {
                    this._displayables = {}, this._orient, this._range, this._handleEnds, this._size, this._handleWidth, this._handleHeight, this._location, this._dragging, this._dataShadowInfo, this.api = t
                }, render: function (e, t, i, n) {
                    Ex.superApply(this, "render", arguments), bc(this, "_dispatchZoomAction", this.dataZoomModel.get("throttle"), "fixRate"), this._orient = e.get("orient"), !1 !== this.dataZoomModel.get("show") ? (n && "dataZoom" === n.type && n.from === this.uid || this._buildView(), this._updateView()) : this.group.removeAll()
                }, remove: function () {
                    Ex.superApply(this, "remove", arguments), Ic(this, "_dispatchZoomAction")
                }, dispose: function () {
                    Ex.superApply(this, "dispose", arguments), Ic(this, "_dispatchZoomAction")
                }, _buildView: function () {
                    var e = this.group;
                    e.removeAll(), this._resetLocation(), this._resetInterval();
                    var t = this._displayables.barGroup = new Di;
                    this._renderBackground(), this._renderHandle(), this._renderDataShadow(), e.add(t), this._positionGroup()
                }, _resetLocation: function () {
                    var e = this.dataZoomModel, t = this.api, i = this._findCoordRect(),
                        n = {width: t.getWidth(), height: t.getHeight()}, a = this._orient === Dx ? {
                            right: n.width - i.x - i.width,
                            top: n.height - 30 - 7,
                            width: i.width,
                            height: 30
                        } : {right: 7, top: i.y, width: 30, height: i.height}, o = kd(e.option);
                    A(["right", "top", "width", "height"], function (e) {
                        "ph" === o[e] && (o[e] = a[e])
                    });
                    var r = vd(o, n, e.padding);
                    this._location = {
                        x: r.x,
                        y: r.y
                    }, this._size = [r.width, r.height], this._orient === xx && this._size.reverse()
                }, _positionGroup: function () {
                    var e = this.group, t = this._location, i = this._orient,
                        n = this.dataZoomModel.getFirstTargetAxisModel(), a = n && n.get("inverse"),
                        o = this._displayables.barGroup, r = (this._dataShadowInfo || {}).otherAxisInverse;
                    o.attr(i !== Dx || a ? i === Dx && a ? {scale: r ? [-1, 1] : [-1, -1]} : i !== xx || a ? {
                        scale: r ? [-1, -1] : [-1, 1],
                        rotation: Math.PI / 2
                    } : {scale: r ? [1, -1] : [1, 1], rotation: Math.PI / 2} : {scale: r ? [1, 1] : [1, -1]});
                    var s = e.getBoundingRect([o]);
                    e.attr("position", [t.x - s.x, t.y - s.y])
                }, _getViewExtent: function () {
                    return [0, this._size[0]]
                }, _renderBackground: function () {
                    var e = this.dataZoomModel, t = this._size, i = this._displayables.barGroup;
                    i.add(new Sx({
                        silent: !0,
                        shape: {x: 0, y: 0, width: t[0], height: t[1]},
                        style: {fill: e.get("backgroundColor")},
                        z2: -40
                    })), i.add(new Sx({
                        shape: {x: 0, y: 0, width: t[0], height: t[1]},
                        style: {fill: "transparent"},
                        z2: 0,
                        onclick: P(this._onClickPanelClick, this)
                    }))
                }, _renderDataShadow: function () {
                    var e = this._dataShadowInfo = this._prepareDataShadowInfo();
                    if (e) {
                        var t = this._size, i = e.series, n = i.getRawData(),
                            a = i.getShadowDim ? i.getShadowDim() : e.otherDim;
                        if (null != a) {
                            var o = n.getDataExtent(a), r = .3 * (o[1] - o[0]);
                            o = [o[0] - r, o[1] + r];
                            var s, l = [0, t[1]], d = [0, t[0]], u = [[t[0], 0], [0, 0]], c = [],
                                h = d[1] / (n.count() - 1), f = 0, g = Math.round(n.count() / t[0]);
                            n.each([a], function (e, t) {
                                if (0 < g && t % g) f += h; else {
                                    var i = null == e || isNaN(e) || "" === e, n = i ? 0 : bx(e, o, l, !0);
                                    i && !s && t ? (u.push([u[u.length - 1][0], 0]), c.push([c[c.length - 1][0], 0])) : !i && s && (u.push([f, 0]), c.push([f, 0])), u.push([f, n]), c.push([f, n]), f += h, s = i
                                }
                            });
                            var p = this.dataZoomModel;
                            this._displayables.barGroup.add(new $r({
                                shape: {points: u},
                                style: T({fill: p.get("dataBackgroundColor")}, p.getModel("dataBackground.areaStyle").getAreaStyle()),
                                silent: !0,
                                z2: -20
                            })), this._displayables.barGroup.add(new Xr({
                                shape: {points: c},
                                style: p.getModel("dataBackground.lineStyle").getLineStyle(),
                                silent: !0,
                                z2: -19
                            }))
                        }
                    }
                }, _prepareDataShadowInfo: function () {
                    var e = this.dataZoomModel, t = e.get("showDataShadow");
                    if (!1 !== t) {
                        var i, n = this.ecModel;
                        return e.eachTargetAxis(function (a, o) {
                            A(e.getAxisProxy(a.name, o).getTargetSeriesModels(), function (e) {
                                if (!(i || !0 !== t && S(Nx, e.get("type")) < 0)) {
                                    var r, s = n.getComponent(a.axis, o).axis, l = function (e) {
                                        return {x: "y", y: "x", radius: "angle", angle: "radius"}[e]
                                    }(a.name), d = e.coordinateSystem;
                                    null != l && d.getOtherAxis && (r = d.getOtherAxis(s).inverse), l = e.getData().mapDimension(l), i = {
                                        thisAxis: s,
                                        series: e,
                                        thisDim: a.name,
                                        otherDim: l,
                                        otherAxisInverse: r
                                    }
                                }
                            }, this)
                        }, this), i
                    }
                }, _renderHandle: function () {
                    var e = this._displayables, t = e.handles = [], i = e.handleLabels = [],
                        n = this._displayables.barGroup, a = this._size, o = this.dataZoomModel;
                    n.add(e.filler = new Sx({
                        draggable: !0,
                        cursor: Px(this._orient),
                        drift: _x(this._onDragMove, this, "all"),
                        ondragstart: _x(this._showDataInfo, this, !0),
                        ondragend: _x(this._onDragEnd, this),
                        onmouseover: _x(this._showDataInfo, this, !0),
                        onmouseout: _x(this._showDataInfo, this, !1),
                        style: {fill: o.get("fillerColor"), textPosition: "inside"}
                    })), n.add(new Sx({
                        silent: !0,
                        subPixelOptimize: !0,
                        shape: {x: 0, y: 0, width: a[0], height: a[1]},
                        style: {
                            stroke: o.get("dataBackgroundColor") || o.get("borderColor"),
                            lineWidth: 1,
                            fill: "rgba(0,0,0,0)"
                        }
                    })), Ax([0, 1], function (e) {
                        var a = hl(o.get("handleIcon"), {
                            cursor: Px(this._orient),
                            draggable: !0,
                            drift: _x(this._onDragMove, this, e),
                            ondragend: _x(this._onDragEnd, this),
                            onmouseover: _x(this._showDataInfo, this, !0),
                            onmouseout: _x(this._showDataInfo, this, !1)
                        }, {x: -1, y: 0, width: 2, height: 2}), r = a.getBoundingRect();
                        this._handleHeight = Nl(o.get("handleSize"), this._size[1]), this._handleWidth = r.width / r.height * this._handleHeight, a.setStyle(o.getModel("handleStyle").getItemStyle());
                        var s = o.get("handleColor");
                        null != s && (a.style.fill = s), n.add(t[e] = a);
                        var l = o.textStyleModel;
                        this.group.add(i[e] = new Rr({
                            silent: !0,
                            invisible: !0,
                            style: {
                                x: 0,
                                y: 0,
                                text: "",
                                textVerticalAlign: "middle",
                                textAlign: "center",
                                textFill: l.getTextColor(),
                                textFont: l.getFont()
                            },
                            z2: 10
                        }))
                    }, this)
                }, _resetInterval: function () {
                    var e = this._range = this.dataZoomModel.getPercentRange(), t = this._getViewExtent();
                    this._handleEnds = [bx(e[0], [0, 100], t, !0), bx(e[1], [0, 100], t, !0)]
                }, _updateInterval: function (e, t) {
                    var i = this.dataZoomModel, n = this._handleEnds, a = this._getViewExtent(),
                        o = i.findRepresentativeAxisProxy().getMinMaxSpan(), r = [0, 100];
                    Ew(t, n, a, i.get("zoomLock") ? "all" : e, null != o.minSpan ? bx(o.minSpan, r, a, !0) : null, null != o.maxSpan ? bx(o.maxSpan, r, a, !0) : null);
                    var s = this._range, l = this._range = Ix([bx(n[0], a, r, !0), bx(n[1], a, r, !0)]);
                    return !s || s[0] !== l[0] || s[1] !== l[1]
                }, _updateView: function (e) {
                    var t = this._displayables, i = this._handleEnds, n = Ix(i.slice()), a = this._size;
                    Ax([0, 1], function (e) {
                        var n = t.handles[e], o = this._handleHeight;
                        n.attr({scale: [o / 2, o / 2], position: [i[e], a[1] / 2 - o / 2]})
                    }, this), t.filler.setShape({
                        x: n[0],
                        y: 0,
                        width: n[1] - n[0],
                        height: a[1]
                    }), this._updateDataInfo(e)
                }, _updateDataInfo: function (e) {
                    var t = this.dataZoomModel, i = this._displayables, n = i.handleLabels, a = this._orient, o = ["", ""];
                    if (t.get("showDetail")) {
                        var r = t.findRepresentativeAxisProxy();
                        if (r) {
                            var s = r.getAxisModel().axis, l = this._range, d = e ? r.calculateDataWindow({
                                start: l[0],
                                end: l[1]
                            }).valueWindow : r.getDataValueWindow();
                            o = [this._formatLabel(d[0], s), this._formatLabel(d[1], s)]
                        }
                    }
                    var u = Ix(this._handleEnds.slice());

                    function c(e) {
                        var t = sl(i.handles[e].parent, this.group), r = dl(0 === e ? "right" : "left", t),
                            s = this._handleWidth / 2 + 5, l = ll([u[e] + (0 === e ? -s : s), this._size[1] / 2], t);
                        n[e].setStyle({
                            x: l[0],
                            y: l[1],
                            textVerticalAlign: a === Dx ? "middle" : r,
                            textAlign: a === Dx ? r : "center",
                            text: o[e]
                        })
                    }

                    c.call(this, 0), c.call(this, 1)
                }, _formatLabel: function (e, t) {
                    var i = this.dataZoomModel, n = i.get("labelFormatter"), a = i.get("labelPrecision");
                    null != a && "auto" !== a || (a = t.getPixelPrecision());
                    var o = null == e || isNaN(e) ? "" : "category" === t.type || "time" === t.type ? t.scale.getLabel(Math.round(e)) : e.toFixed(Math.min(a, 20));
                    return F(n) ? n(e, o) : L(n) ? n.replace("{value}", o) : o
                }, _showDataInfo: function (e) {
                    e = this._dragging || e;
                    var t = this._displayables.handleLabels;
                    t[0].attr("invisible", !e), t[1].attr("invisible", !e)
                }, _onDragMove: function (e, t, i, n) {
                    this._dragging = !0, Ge(n.event);
                    var a = ll([t, i], this._displayables.barGroup.getLocalTransform(), !0),
                        o = this._updateInterval(e, a[0]), r = this.dataZoomModel.get("realtime");
                    this._updateView(!r), o && r && this._dispatchZoomAction()
                }, _onDragEnd: function () {
                    this._dragging = !1, this._showDataInfo(!1), this.dataZoomModel.get("realtime") || this._dispatchZoomAction()
                }, _onClickPanelClick: function (e) {
                    var t = this._size, i = this._displayables.barGroup.transformCoordToLocal(e.offsetX, e.offsetY);
                    if (!(i[0] < 0 || i[0] > t[0] || i[1] < 0 || i[1] > t[1])) {
                        var n = this._handleEnds, a = (n[0] + n[1]) / 2, o = this._updateInterval("all", i[0] - a);
                        this._updateView(), o && this._dispatchZoomAction()
                    }
                }, _dispatchZoomAction: function () {
                    var e = this._range;
                    this.api.dispatchAction({
                        type: "dataZoom",
                        from: this.uid,
                        dataZoomId: this.dataZoomModel.id,
                        start: e[0],
                        end: e[1]
                    })
                }, _findCoordRect: function () {
                    var e;
                    if (Ax(this.getTargetCoordInfo(), function (t) {
                        if (!e && t.length) {
                            var i = t[0].model.coordinateSystem;
                            e = i.getRect && i.getRect()
                        }
                    }), !e) {
                        var t = this.api.getWidth(), i = this.api.getHeight();
                        e = {x: .2 * t, y: .2 * i, width: .6 * t, height: .6 * i}
                    }
                    return e
                }
            });

        function Px(e) {
            return "vertical" === e ? "ns-resize" : "ew-resize"
        }

        AA.extend({
            type: "dataZoom.inside",
            defaultOption: {
                disabled: !1,
                zoomLock: !1,
                zoomOnMouseWheel: !0,
                moveOnMouseMove: !0,
                moveOnMouseWheel: !1,
                preventDefaultMouseMove: !0
            }
        });
        var Mx = "\0_ec_dataZoom_roams";

        function Ox(e) {
            return e.type + "\0_" + e.id
        }

        function Fx(e) {
            var t = e.getZr();
            return t[Mx] || (t[Mx] = {})
        }

        function Lx(e) {
            A(e, function (t, i) {
                t.count || (t.controller.dispose(), delete e[i])
            })
        }

        function Bx(e, t) {
            e.dispatchAction({type: "dataZoom", batch: t})
        }

        var Ux = P, Rx = NA.extend({
            type: "dataZoom.inside", init: function (e, t) {
                this._range
            }, render: function (e, t, i, n) {
                Rx.superApply(this, "render", arguments), this._range = e.getPercentRange(), A(this.getTargetCoordInfo(), function (t, n) {
                    var a = D(t, function (e) {
                        return Ox(e.model)
                    });
                    A(t, function (t) {
                        var o = t.model, r = {};
                        A(["pan", "zoom", "scrollMove"], function (e) {
                            r[e] = Ux(Kx[e], this, t, n)
                        }, this), function (e, t) {
                            var i = Fx(e), n = t.dataZoomId, a = t.coordId;
                            A(i, function (e, i) {
                                var o = e.dataZoomInfos;
                                o[n] && S(t.allCoordIds, a) < 0 && (delete o[n], e.count--)
                            }), Lx(i);
                            var o = i[a];
                            o || ((o = i[a] = {coordId: a, dataZoomInfos: {}, count: 0}).controller = function (e, t) {
                                var i = new Sy(e.getZr());
                                return A(["pan", "zoom", "scrollMove"], function (e) {
                                    i.on(e, function (i) {
                                        var n = [];
                                        A(t.dataZoomInfos, function (a) {
                                            if (i.isAvailableBehavior(a.dataZoomModel.option)) {
                                                var o = (a.getRange || {})[e], r = o && o(t.controller, i);
                                                !a.dataZoomModel.get("disabled", !0) && r && n.push({
                                                    dataZoomId: a.dataZoomId,
                                                    start: r[0],
                                                    end: r[1]
                                                })
                                            }
                                        }), n.length && t.dispatchAction(n)
                                    })
                                }), i
                            }(e, o), o.dispatchAction = M(Bx, e)), o.dataZoomInfos[n] || o.count++, o.dataZoomInfos[n] = t;
                            var r = function (e) {
                                var t, i = {type_true: 2, type_move: 1, type_false: 0, type_undefined: -1}, n = !0;
                                return A(e, function (e) {
                                    var a = e.dataZoomModel,
                                        o = !a.get("disabled", !0) && (!a.get("zoomLock", !0) || "move");
                                    i["type_" + t] < i["type_" + o] && (t = o), n &= a.get("preventDefaultMouseMove", !0)
                                }), {
                                    controlType: t,
                                    opt: {
                                        zoomOnMouseWheel: !0,
                                        moveOnMouseMove: !0,
                                        moveOnMouseWheel: !0,
                                        preventDefaultMouseMove: !!n
                                    }
                                }
                            }(o.dataZoomInfos);
                            o.controller.enable(r.controlType, r.opt), o.controller.setPointerChecker(t.containsPoint), bc(o, "dispatchAction", t.dataZoomModel.get("throttle", !0), "fixRate")
                        }(i, {
                            coordId: Ox(o), allCoordIds: a, containsPoint: function (e, t, i) {
                                return o.coordinateSystem.containPoint([t, i])
                            }, dataZoomId: e.id, dataZoomModel: e, getRange: r
                        })
                    }, this)
                }, this)
            }, dispose: function () {
                var e, t, i;
                e = this.api, t = this.dataZoomModel.id, A(i = Fx(e), function (e) {
                    e.controller.dispose();
                    var i = e.dataZoomInfos;
                    i[t] && (delete i[t], e.count--)
                }), Lx(i), Rx.superApply(this, "dispose", arguments), this._range = null
            }
        }), Kx = {
            zoom: function (e, t, i, n) {
                var a = this._range, o = a.slice(), r = e.axisModels[0];
                if (r) {
                    var s = Hx[t](null, [n.originX, n.originY], r, i, e),
                        l = (0 < s.signal ? s.pixelStart + s.pixelLength - s.pixel : s.pixel - s.pixelStart) / s.pixelLength * (o[1] - o[0]) + o[0],
                        d = Math.max(1 / n.scale, 0);
                    o[0] = (o[0] - l) * d + l, o[1] = (o[1] - l) * d + l;
                    var u = this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();
                    return Ew(0, o, [0, 100], 0, u.minSpan, u.maxSpan), this._range = o, a[0] !== o[0] || a[1] !== o[1] ? o : void 0
                }
            }, pan: Wx(function (e, t, i, n, a, o) {
                var r = Hx[n]([o.oldX, o.oldY], [o.newX, o.newY], t, a, i);
                return r.signal * (e[1] - e[0]) * r.pixel / r.pixelLength
            }), scrollMove: Wx(function (e, t, i, n, a, o) {
                return Hx[n]([0, 0], [o.scrollDelta, o.scrollDelta], t, a, i).signal * (e[1] - e[0]) * o.scrollDelta
            })
        };

        function Wx(e) {
            return function (t, i, n, a) {
                var o = this._range, r = o.slice(), s = t.axisModels[0];
                if (s) {
                    var l = e(r, s, t, i, n, a);
                    return Ew(l, r, [0, 100], "all"), this._range = r, o[0] !== r[0] || o[1] !== r[1] ? r : void 0
                }
            }
        }

        function Vx(e) {
            var t = e && e.visualMap;
            O(t) || (t = t ? [t] : []), zx(t, function (e) {
                if (e) {
                    jx(e, "splitList") && !jx(e, "pieces") && (e.pieces = e.splitList, delete e.splitList);
                    var t = e.pieces;
                    t && O(t) && zx(t, function (e) {
                        B(e) && (jx(e, "start") && !jx(e, "min") && (e.min = e.start), jx(e, "end") && !jx(e, "max") && (e.max = e.end))
                    })
                }
            })
        }

        var Hx = {
            grid: function (e, t, i, n, a) {
                var o = i.axis, r = {}, s = a.model.coordinateSystem.getRect();
                return e = e || [0, 0], "x" === o.dim ? (r.pixel = t[0] - e[0], r.pixelLength = s.width, r.pixelStart = s.x, r.signal = o.inverse ? 1 : -1) : (r.pixel = t[1] - e[1], r.pixelLength = s.height, r.pixelStart = s.y, r.signal = o.inverse ? -1 : 1), r
            }, polar: function (e, t, i, n, a) {
                var o = i.axis, r = {}, s = a.model.coordinateSystem, l = s.getRadiusAxis().getExtent(),
                    d = s.getAngleAxis().getExtent();
                return e = e ? s.pointToCoord(e) : [0, 0], t = s.pointToCoord(t), "radiusAxis" === i.mainType ? (r.pixel = t[0] - e[0], r.pixelLength = l[1] - l[0], r.pixelStart = l[0], r.signal = o.inverse ? 1 : -1) : (r.pixel = t[1] - e[1], r.pixelLength = d[1] - d[0], r.pixelStart = d[0], r.signal = o.inverse ? -1 : 1), r
            }, singleAxis: function (e, t, i, n, a) {
                var o = i.axis, r = a.model.coordinateSystem.getRect(), s = {};
                return e = e || [0, 0], "horizontal" === o.orient ? (s.pixel = t[0] - e[0], s.pixelLength = r.width, s.pixelStart = r.x, s.signal = o.inverse ? 1 : -1) : (s.pixel = t[1] - e[1], s.pixelLength = r.height, s.pixelStart = r.y, s.signal = o.inverse ? -1 : 1), s
            }
        }, zx = A;

        function jx(e, t) {
            return e && e.hasOwnProperty && e.hasOwnProperty(t)
        }

        Id.registerSubTypeDefaulter("visualMap", function (e) {
            return e.categories || (e.pieces ? 0 < e.pieces.length : 0 < e.splitNumber) && !e.calculable ? "piecewise" : "continuous"
        });
        var Gx = Sh.VISUAL.COMPONENT;

        function $x(e, t, i, n) {
            for (var a = t.targetVisuals[n], o = Jk.prepareVisualTypes(a), r = {color: e.getData().getVisual("color")}, s = 0, l = o.length; s < l; s++) {
                var d = o[s], u = a["opacity" === d ? "__alphaForOpacity" : d];
                u && u.applyVisual(i, c, h)
            }
            return r.color;

            function c(e) {
                return r[e]
            }

            function h(e, t) {
                r[e] = t
            }
        }

        vf(Gx, {
            createOnAllSeries: !0, reset: function (e, t) {
                var i = [];
                return t.eachComponent("visualMap", function (t) {
                    var n = e.pipelineContext;
                    !t.isTargetSeries(e) || n && n.large || i.push(function (e, t, i, n) {
                        var a = {};
                        return A(e, function (e) {
                            var i = Jk.prepareVisualTypes(t[e]);
                            a[e] = i
                        }), {
                            progress: function (e, o) {
                                function r(e) {
                                    return o.getItemVisual(l, e)
                                }

                                function s(e, t) {
                                    o.setItemVisual(l, e, t)
                                }

                                var l;
                                for (null != n && (n = o.getDimension(n)); null != (l = e.next());) {
                                    var d = o.getRawDataItem(l);
                                    if (!d || !1 !== d.visualMap) for (var u = null != n ? o.get(n, l, !0) : l, c = i(u), h = t[c], f = a[c], g = 0, p = f.length; g < p; g++) {
                                        var v = f[g];
                                        h[v] && h[v].applyVisual(u, r, s)
                                    }
                                }
                            }
                        }
                    }(t.stateList, t.targetVisuals, P(t.getValueState, t), t.getDataDimension(e.getData())))
                }), i
            }
        }), vf(Gx, {
            createOnAllSeries: !0, reset: function (e, t) {
                var i = e.getData(), n = [];
                t.eachComponent("visualMap", function (t) {
                    if (t.isTargetSeries(e)) {
                        var a = t.getVisualMeta(P($x, null, e, t)) || {stops: [], outerColors: []},
                            o = t.getDataDimension(i), r = i.getDimensionInfo(o);
                        null != r && (a.dimension = r.index, n.push(a))
                    }
                }), e.getData().setVisual("visualMeta", n)
            }
        });
        var Xx = function (e, t, i) {
            var n = v((qx[e] || {})[t]);
            return i && O(n) ? n[n.length - 1] : n
        }, qx = {
            color: {active: ["#006edd", "#e0ffff"], inactive: ["rgba(0,0,0,0)"]},
            colorHue: {active: [0, 360], inactive: [0, 0]},
            colorSaturation: {active: [.3, 1], inactive: [0, 0]},
            colorLightness: {active: [.9, .5], inactive: [0, 0]},
            colorAlpha: {active: [.3, 1], inactive: [0, 0]},
            opacity: {active: [.3, 1], inactive: [0, 0]},
            symbol: {active: ["circle", "roundRect", "diamond"], inactive: ["none"]},
            symbolSize: {active: [10, 50], inactive: [0, 0]}
        }, Yx = Jk.mapVisual, Jx = Jk.eachVisual, Zx = O, Qx = A, eN = Pl, tN = xl, iN = kf({
            type: "visualMap",
            dependencies: ["series"],
            stateList: ["inRange", "outOfRange"],
            replacableOptionKeys: ["inRange", "outOfRange", "target", "controller", "color"],
            dataBound: [-1 / 0, 1 / 0],
            layoutMode: {type: "box", ignoreSize: !0},
            defaultOption: {
                show: !0,
                zlevel: 0,
                z: 4,
                seriesIndex: "all",
                min: 0,
                max: 200,
                dimension: null,
                inRange: null,
                outOfRange: null,
                left: 0,
                right: null,
                top: null,
                bottom: 0,
                itemWidth: null,
                itemHeight: null,
                inverse: !1,
                orient: "vertical",
                backgroundColor: "rgba(0,0,0,0)",
                borderColor: "#ccc",
                contentColor: "#5793f3",
                inactiveColor: "#aaa",
                borderWidth: 0,
                padding: 5,
                textGap: 10,
                precision: 0,
                color: null,
                formatter: null,
                text: null,
                textStyle: {color: "#333"}
            },
            init: function (e, t, i) {
                this._dataExtent, this.targetVisuals = {}, this.controllerVisuals = {}, this.textStyleModel, this.itemSize, this.mergeDefaultAndTheme(e, i)
            },
            optionUpdated: function (e, t) {
                var i = this.option;
                a.canvasSupported || (i.realtime = !1), t || iD(i, e, this.replacableOptionKeys), this.textStyleModel = this.getModel("textStyle"), this.resetItemSize(), this.completeVisualOption()
            },
            resetVisual: function (e) {
                var t = this.stateList;
                e = P(e, this), this.controllerVisuals = tD(this.option.controller, t, e), this.targetVisuals = tD(this.option.target, t, e)
            },
            getTargetSeriesIndices: function () {
                var e = this.option.seriesIndex, t = [];
                return null == e || "all" === e ? this.ecModel.eachSeries(function (e, i) {
                    t.push(i)
                }) : t = Pa(e), t
            },
            eachTargetSeries: function (e, t) {
                A(this.getTargetSeriesIndices(), function (i) {
                    e.call(t, this.ecModel.getSeriesByIndex(i))
                }, this)
            },
            isTargetSeries: function (e) {
                var t = !1;
                return this.eachTargetSeries(function (i) {
                    i === e && (t = !0)
                }), t
            },
            formatValueText: function (e, t, i) {
                var n, a, o = this.option, r = o.precision, s = this.dataBound, l = o.formatter;
                return i = i || ["<", ">"], O(e) && (e = e.slice(), n = !0), a = t ? e : n ? [d(e[0]), d(e[1])] : d(e), L(l) ? l.replace("{value}", n ? a[0] : a).replace("{value2}", n ? a[1] : a) : F(l) ? n ? l(e[0], e[1]) : l(e) : n ? e[0] === s[0] ? i[0] + " " + a[1] : e[1] === s[1] ? i[1] + " " + a[0] : a[0] + " - " + a[1] : a;

                function d(e) {
                    return e === s[0] ? "min" : e === s[1] ? "max" : (+e).toFixed(Math.min(r, 20))
                }
            },
            resetExtent: function () {
                var e = this.option, t = eN([e.min, e.max]);
                this._dataExtent = t
            },
            getDataDimension: function (e) {
                var t = this.option.dimension, i = e.dimensions;
                if (null != t || i.length) {
                    if (null != t) return e.getDimension(t);
                    for (var n = e.dimensions, a = n.length - 1; 0 <= a; a--) {
                        var o = n[a];
                        if (!e.getDimensionInfo(o).isCalculationCoord) return o
                    }
                }
            },
            getExtent: function () {
                return this._dataExtent.slice()
            },
            completeVisualOption: function () {
                var e = this.ecModel, t = this.option, i = {inRange: t.inRange, outOfRange: t.outOfRange},
                    n = t.target || (t.target = {}), a = t.controller || (t.controller = {});
                m(n, i), m(a, i);
                var o = this.isCategory();

                function r(i) {
                    Zx(t.color) && !i.inRange && (i.inRange = {color: t.color.slice().reverse()}), i.inRange = i.inRange || {color: e.get("gradientColor")}, Qx(this.stateList, function (e) {
                        var t = i[e];
                        if (L(t)) {
                            var n = Xx(t, "active", o);
                            n ? (i[e] = {}, i[e][t] = n) : delete i[e]
                        }
                    }, this)
                }

                r.call(this, n), r.call(this, a), function (e, t, i) {
                    var n = e[t], a = e[i];
                    n && !a && (a = e[i] = {}, Qx(n, function (e, t) {
                        if (Jk.isValidType(t)) {
                            var i = Xx(t, "inactive", o);
                            null != i && (a[t] = i, "color" !== t || a.hasOwnProperty("opacity") || a.hasOwnProperty("colorAlpha") || (a.opacity = [0, 0]))
                        }
                    }))
                }.call(this, n, "inRange", "outOfRange"), function (e) {
                    var t = (e.inRange || {}).symbol || (e.outOfRange || {}).symbol,
                        i = (e.inRange || {}).symbolSize || (e.outOfRange || {}).symbolSize,
                        n = this.get("inactiveColor");
                    Qx(this.stateList, function (a) {
                        var r = this.itemSize, s = e[a];
                        null == (s = s || (e[a] = {color: o ? n : [n]})).symbol && (s.symbol = t && v(t) || (o ? "roundRect" : ["roundRect"])), null == s.symbolSize && (s.symbolSize = i && v(i) || (o ? r[0] : [r[0], r[0]])), s.symbol = Yx(s.symbol, function (e) {
                            return "none" === e || "square" === e ? "roundRect" : e
                        });
                        var l = s.symbolSize;
                        if (null != l) {
                            var d = -1 / 0;
                            Jx(l, function (e) {
                                d < e && (d = e)
                            }), s.symbolSize = Yx(l, function (e) {
                                return tN(e, [0, d], [0, r[0]], !0)
                            })
                        }
                    }, this)
                }.call(this, a)
            },
            resetItemSize: function () {
                this.itemSize = [parseFloat(this.get("itemWidth")), parseFloat(this.get("itemHeight"))]
            },
            isCategory: function () {
                return !!this.option.categories
            },
            setSelected: te,
            getValueState: te,
            getVisualMeta: te
        }), nN = [20, 140], aN = iN.extend({
            type: "visualMap.continuous",
            defaultOption: {
                align: "auto",
                calculable: !1,
                range: null,
                realtime: !0,
                itemHeight: null,
                itemWidth: null,
                hoverLink: !0,
                hoverLinkDataSize: null,
                hoverLinkOnHandle: null
            },
            optionUpdated: function (e, t) {
                aN.superApply(this, "optionUpdated", arguments), this.resetExtent(), this.resetVisual(function (e) {
                    e.mappingMethod = "linear", e.dataExtent = this.getExtent()
                }), this._resetRange()
            },
            resetItemSize: function () {
                aN.superApply(this, "resetItemSize", arguments);
                var e = this.itemSize;
                "horizontal" === this._orient && e.reverse(), null != e[0] && !isNaN(e[0]) || (e[0] = nN[0]), null != e[1] && !isNaN(e[1]) || (e[1] = nN[1])
            },
            _resetRange: function () {
                var e = this.getExtent(), t = this.option.range;
                !t || t.auto ? (e.auto = 1, this.option.range = e) : O(t) && (t[0] > t[1] && t.reverse(), t[0] = Math.max(t[0], e[0]), t[1] = Math.min(t[1], e[1]))
            },
            completeVisualOption: function () {
                iN.prototype.completeVisualOption.apply(this, arguments), A(this.stateList, function (e) {
                    var t = this.option.controller[e].symbolSize;
                    t && t[0] !== t[1] && (t[0] = 0)
                }, this)
            },
            setSelected: function (e) {
                this.option.range = e.slice(), this._resetRange()
            },
            getSelected: function () {
                var e = this.getExtent(), t = Pl((this.get("range") || []).slice());
                return t[0] > e[1] && (t[0] = e[1]), t[1] > e[1] && (t[1] = e[1]), t[0] < e[0] && (t[0] = e[0]), t[1] < e[0] && (t[1] = e[0]), t
            },
            getValueState: function (e) {
                var t = this.option.range, i = this.getExtent();
                return (t[0] <= i[0] || t[0] <= e) && (t[1] >= i[1] || e <= t[1]) ? "inRange" : "outOfRange"
            },
            findTargetDataIndices: function (e) {
                var t = [];
                return this.eachTargetSeries(function (i) {
                    var n = [], a = i.getData();
                    a.each(this.getDataDimension(a), function (t, i) {
                        e[0] <= t && t <= e[1] && n.push(i)
                    }, this), t.push({seriesId: i.id, dataIndex: n})
                }, this), t
            },
            getVisualMeta: function (e) {
                var t = oN(0, 0, this.getExtent()), i = oN(0, 0, this.option.range.slice()), n = [];

                function a(t, i) {
                    n.push({value: t, color: e(t, i)})
                }

                for (var o = 0, r = 0, s = i.length, l = t.length; r < l && (!i.length || t[r] <= i[0]); r++) t[r] < i[o] && a(t[r], "outOfRange");
                for (var d = 1; o < s; o++, d = 0) d && n.length && a(i[o], "outOfRange"), a(i[o], "inRange");
                for (d = 1; r < l; r++) (!i.length || i[i.length - 1] < t[r]) && (d && (n.length && a(n[n.length - 1].value, "outOfRange"), d = 0), a(t[r], "outOfRange"));
                var u = n.length;
                return {stops: n, outerColors: [u ? n[0].color : "transparent", u ? n[u - 1].color : "transparent"]}
            }
        });

        function oN(e, t, i) {
            if (i[0] === i[1]) return i.slice();
            for (var n = (i[1] - i[0]) / 200, a = i[0], o = [], r = 0; r <= 200 && a < i[1]; r++) o.push(a), a += n;
            return o.push(i[1]), o
        }

        var rN = Tf({
            type: "visualMap",
            autoPositionValues: {left: 1, right: 1, top: 1, bottom: 1},
            init: function (e, t) {
                this.ecModel = e, this.api = t, this.visualMapModel
            },
            render: function (e, t, i, n) {
                !1 !== (this.visualMapModel = e).get("show") ? this.doRender.apply(this, arguments) : this.group.removeAll()
            },
            renderBackground: function (e) {
                var t = this.visualMapModel, i = Yl(t.get("padding") || 0), n = e.getBoundingRect();
                e.add(new es({
                    z2: -1,
                    silent: !0,
                    shape: {x: n.x - i[3], y: n.y - i[0], width: n.width + i[3] + i[1], height: n.height + i[0] + i[2]},
                    style: {
                        fill: t.get("backgroundColor"),
                        stroke: t.get("borderColor"),
                        lineWidth: t.get("borderWidth")
                    }
                }))
            },
            getControllerVisual: function (e, t, i) {
                var n = (i = i || {}).forceState, a = this.visualMapModel, o = {};
                if ("symbol" === t && (o.symbol = a.get("itemSymbol")), "color" === t) {
                    var r = a.get("contentColor");
                    o.color = r
                }

                function s(e) {
                    return o[e]
                }

                function l(e, t) {
                    o[e] = t
                }

                var d = a.controllerVisuals[n || a.getValueState(e)];
                return A(Jk.prepareVisualTypes(d), function (n) {
                    var a = d[n];
                    i.convertOpacityToAlpha && "opacity" === n && (n = "colorAlpha", a = d.__alphaForOpacity), Jk.dependsOn(n, t) && a && a.applyVisual(e, s, l)
                }), o[t]
            },
            positionGroup: function (e) {
                var t = this.visualMapModel, i = this.api;
                md(e, t.getBoxLayoutParams(), {width: i.getWidth(), height: i.getHeight()})
            },
            doRender: te
        });

        function sN(e, t, i) {
            var n = e.option, a = n.align;
            if (null != a && "auto" !== a) return a;
            for (var o = {
                width: t.getWidth(),
                height: t.getHeight()
            }, r = "horizontal" === n.orient ? 1 : 0, s = [["left", "right", "width"], ["top", "bottom", "height"]], l = s[r], d = [0, null, 10], u = {}, c = 0; c < 3; c++) u[s[1 - r][c]] = d[c], u[l[c]] = 2 === c ? i[0] : n[l[c]];
            var h = [["x", "width", 3], ["y", "height", 0]][r], f = vd(u, o, n.padding);
            return l[(f.margin[h[2]] || 0) + f[h[0]] + .5 * f[h[1]] < .5 * o[h[1]] ? 0 : 1]
        }

        function lN(e, t) {
            return A(e || [], function (e) {
                null != e.dataIndex && (e.dataIndexInside = e.dataIndex, e.dataIndex = null), e.highlightKey = "visualMap" + (t ? t.componentIndex : "")
            }), e
        }

        var dN = xl, uN = A, cN = Math.min, hN = Math.max, fN = rN.extend({
            type: "visualMap.continuous", init: function () {
                fN.superApply(this, "init", arguments), this._shapes = {}, this._dataInterval = [], this._handleEnds = [], this._orient, this._useHandle, this._hoverLinkDataIndices = [], this._dragging, this._hovering
            }, doRender: function (e, t, i, n) {
                n && "selectDataRange" === n.type && n.from === this.uid || this._buildView()
            }, _buildView: function () {
                this.group.removeAll();
                var e = this.visualMapModel, t = this.group;
                this._orient = e.get("orient"), this._useHandle = e.get("calculable"), this._resetInterval(), this._renderBar(t);
                var i = e.get("text");
                this._renderEndsText(t, i, 0), this._renderEndsText(t, i, 1), this._updateView(!0), this.renderBackground(t), this._updateView(), this._enableHoverLinkToSeries(), this._enableHoverLinkFromSeries(), this.positionGroup(t)
            }, _renderEndsText: function (e, t, i) {
                if (t) {
                    var n = t[1 - i];
                    n = null != n ? n + "" : "";
                    var a = this.visualMapModel, o = a.get("textGap"), r = a.itemSize, s = this._shapes.barGroup,
                        l = this._applyTransform([r[0] / 2, 0 === i ? -o : r[1] + o], s),
                        d = this._applyTransform(0 === i ? "bottom" : "top", s), u = this._orient,
                        c = this.visualMapModel.textStyleModel;
                    this.group.add(new Rr({
                        style: {
                            x: l[0],
                            y: l[1],
                            textVerticalAlign: "horizontal" === u ? "middle" : d,
                            textAlign: "horizontal" === u ? d : "center",
                            text: n,
                            textFont: c.getFont(),
                            textFill: c.getTextColor()
                        }
                    }))
                }
            }, _renderBar: function (e) {
                var t = this.visualMapModel, i = this._shapes, n = t.itemSize, a = this._orient, o = this._useHandle,
                    r = sN(t, this.api, n), s = i.barGroup = this._createBarGroup(r);
                s.add(i.outOfRange = gN()), s.add(i.inRange = gN(null, o ? vN(this._orient) : null, P(this._dragHandle, this, "all", !1), P(this._dragHandle, this, "all", !0)));
                var l = t.textStyleModel.getTextRect("国"), d = hN(l.width, l.height);
                o && (i.handleThumbs = [], i.handleLabels = [], i.handleLabelPoints = [], this._createHandle(s, 0, n, d, a, r), this._createHandle(s, 1, n, d, a, r)), this._createIndicator(s, n, d, a), e.add(s)
            }, _createHandle: function (e, t, i, n, a) {
                var o = P(this._dragHandle, this, t, !1), r = P(this._dragHandle, this, t, !0), s = gN(function (e, t) {
                    return 0 === e ? [[0, 0], [t, 0], [t, -t]] : [[0, 0], [t, 0], [t, t]]
                }(t, n), vN(this._orient), o, r);
                s.position[0] = i[0], e.add(s);
                var l = this.visualMapModel.textStyleModel, d = new Rr({
                    draggable: !0,
                    drift: o,
                    onmousemove: function (e) {
                        Ge(e.event)
                    },
                    ondragend: r,
                    style: {x: 0, y: 0, text: "", textFont: l.getFont(), textFill: l.getTextColor()}
                });
                this.group.add(d);
                var u = ["horizontal" === a ? n / 2 : 1.5 * n, "horizontal" === a ? 0 === t ? -1.5 * n : 1.5 * n : 0 === t ? -n / 2 : n / 2],
                    c = this._shapes;
                c.handleThumbs[t] = s, c.handleLabelPoints[t] = u, c.handleLabels[t] = d
            }, _createIndicator: function (e, t, i, n) {
                var a = gN([[0, 0]], "move");
                a.position[0] = t[0], a.attr({invisible: !0, silent: !0}), e.add(a);
                var o = this.visualMapModel.textStyleModel, r = new Rr({
                    silent: !0,
                    invisible: !0,
                    style: {x: 0, y: 0, text: "", textFont: o.getFont(), textFill: o.getTextColor()}
                });
                this.group.add(r);
                var s = ["horizontal" === n ? i / 2 : 9, 0], l = this._shapes;
                l.indicator = a, l.indicatorLabel = r, l.indicatorLabelPoint = s
            }, _dragHandle: function (e, t, i, n) {
                if (this._useHandle) {
                    if (this._dragging = !t, !t) {
                        var a = this._applyTransform([i, n], this._shapes.barGroup, !0);
                        this._updateInterval(e, a[1]), this._updateView()
                    }
                    t === !this.visualMapModel.get("realtime") && this.api.dispatchAction({
                        type: "selectDataRange",
                        from: this.uid,
                        visualMapId: this.visualMapModel.id,
                        selected: this._dataInterval.slice()
                    }), t ? this._hovering || this._clearHoverLinkToSeries() : pN(this.visualMapModel) && this._doHoverLinkToSeries(this._handleEnds[e], !1)
                }
            }, _resetInterval: function () {
                var e = this.visualMapModel, t = this._dataInterval = e.getSelected(), i = e.getExtent(),
                    n = [0, e.itemSize[1]];
                this._handleEnds = [dN(t[0], i, n, !0), dN(t[1], i, n, !0)]
            }, _updateInterval: function (e, t) {
                t = t || 0;
                var i = this.visualMapModel, n = this._handleEnds, a = [0, i.itemSize[1]];
                Ew(t, n, a, e, 0);
                var o = i.getExtent();
                this._dataInterval = [dN(n[0], a, o, !0), dN(n[1], a, o, !0)]
            }, _updateView: function (e) {
                var t = this.visualMapModel, i = t.getExtent(), n = this._shapes, a = [0, t.itemSize[1]],
                    o = e ? a : this._handleEnds, r = this._createBarVisual(this._dataInterval, i, o, "inRange"),
                    s = this._createBarVisual(i, i, a, "outOfRange");
                n.inRange.setStyle({
                    fill: r.barColor,
                    opacity: r.opacity
                }).setShape("points", r.barPoints), n.outOfRange.setStyle({
                    fill: s.barColor,
                    opacity: s.opacity
                }).setShape("points", s.barPoints), this._updateHandle(o, r)
            }, _createBarVisual: function (e, t, i, n) {
                var a = {forceState: n, convertOpacityToAlpha: !0}, o = this._makeColorGradient(e, a),
                    r = [this.getControllerVisual(e[0], "symbolSize", a), this.getControllerVisual(e[1], "symbolSize", a)],
                    s = this._createBarPoints(i, r);
                return {
                    barColor: new ds(0, 0, 0, 1, o),
                    barPoints: s,
                    handlesColor: [o[0].color, o[o.length - 1].color]
                }
            }, _makeColorGradient: function (e, t) {
                var i = [], n = (e[1] - e[0]) / 100;
                i.push({color: this.getControllerVisual(e[0], "color", t), offset: 0});
                for (var a = 1; a < 100; a++) {
                    var o = e[0] + n * a;
                    if (o > e[1]) break;
                    i.push({color: this.getControllerVisual(o, "color", t), offset: a / 100})
                }
                return i.push({color: this.getControllerVisual(e[1], "color", t), offset: 1}), i
            }, _createBarPoints: function (e, t) {
                var i = this.visualMapModel.itemSize;
                return [[i[0] - t[0], e[0]], [i[0], e[0]], [i[0], e[1]], [i[0] - t[1], e[1]]]
            }, _createBarGroup: function (e) {
                var t = this._orient, i = this.visualMapModel.get("inverse");
                return new Di("horizontal" !== t || i ? "horizontal" === t && i ? {
                    scale: "bottom" === e ? [-1, 1] : [1, 1],
                    rotation: -Math.PI / 2
                } : "vertical" !== t || i ? {scale: "left" === e ? [1, 1] : [-1, 1]} : {scale: "left" === e ? [1, -1] : [-1, -1]} : {
                    scale: "bottom" === e ? [1, 1] : [-1, 1],
                    rotation: Math.PI / 2
                })
            }, _updateHandle: function (e, t) {
                if (this._useHandle) {
                    var i = this._shapes, n = this.visualMapModel, a = i.handleThumbs, o = i.handleLabels;
                    uN([0, 1], function (r) {
                        var s = a[r];
                        s.setStyle("fill", t.handlesColor[r]), s.position[1] = e[r];
                        var l = ll(i.handleLabelPoints[r], sl(s, this.group));
                        o[r].setStyle({
                            x: l[0],
                            y: l[1],
                            text: n.formatValueText(this._dataInterval[r]),
                            textVerticalAlign: "middle",
                            textAlign: this._applyTransform("horizontal" === this._orient ? 0 === r ? "bottom" : "top" : "left", i.barGroup)
                        })
                    }, this)
                }
            }, _showIndicator: function (e, t, i, n) {
                var a = this.visualMapModel, o = a.getExtent(), r = a.itemSize, s = [0, r[1]], l = dN(e, o, s, !0),
                    d = this._shapes, u = d.indicator;
                if (u) {
                    u.position[1] = l, u.attr("invisible", !1), u.setShape("points", function (e, t, i, n) {
                        return e ? [[0, -cN(t, hN(i, 0))], [6, 0], [0, cN(t, hN(n - i, 0))]] : [[0, 0], [5, -5], [5, 5]]
                    }(!!i, n, l, r[1]));
                    var c = this.getControllerVisual(e, "color", {convertOpacityToAlpha: !0});
                    u.setStyle("fill", c);
                    var h = ll(d.indicatorLabelPoint, sl(u, this.group)), f = d.indicatorLabel;
                    f.attr("invisible", !1);
                    var g = this._applyTransform("left", d.barGroup), p = this._orient;
                    f.setStyle({
                        text: (i || "") + a.formatValueText(t),
                        textVerticalAlign: "horizontal" === p ? g : "middle",
                        textAlign: "horizontal" === p ? "center" : g,
                        x: h[0],
                        y: h[1]
                    })
                }
            }, _enableHoverLinkToSeries: function () {
                var e = this;
                this._shapes.barGroup.on("mousemove", function (t) {
                    if (e._hovering = !0, !e._dragging) {
                        var i = e.visualMapModel.itemSize,
                            n = e._applyTransform([t.offsetX, t.offsetY], e._shapes.barGroup, !0, !0);
                        n[1] = cN(hN(0, n[1]), i[1]), e._doHoverLinkToSeries(n[1], 0 <= n[0] && n[0] <= i[0])
                    }
                }).on("mouseout", function () {
                    e._hovering = !1, e._dragging || e._clearHoverLinkToSeries()
                })
            }, _enableHoverLinkFromSeries: function () {
                var e = this.api.getZr();
                this.visualMapModel.option.hoverLink ? (e.on("mouseover", this._hoverLinkFromSeriesMouseOver, this), e.on("mouseout", this._hideIndicator, this)) : this._clearHoverLinkFromSeries()
            }, _doHoverLinkToSeries: function (e, t) {
                var i = this.visualMapModel, n = i.itemSize;
                if (i.option.hoverLink) {
                    var a = [0, n[1]], o = i.getExtent();
                    e = cN(hN(a[0], e), a[1]);
                    var r = function (e, t, i) {
                        var n = 6, a = e.get("hoverLinkDataSize");
                        return a && (n = dN(a, t, i, !0) / 2), n
                    }(i, o, a), s = [e - r, e + r], l = dN(e, a, o, !0), d = [dN(s[0], a, o, !0), dN(s[1], a, o, !0)];
                    s[0] < a[0] && (d[0] = -1 / 0), a[1] < s[1] && (d[1] = 1 / 0), t && (d[0] === -1 / 0 ? this._showIndicator(l, d[1], "< ", r) : d[1] === 1 / 0 ? this._showIndicator(l, d[0], "> ", r) : this._showIndicator(l, l, "≈ ", r));
                    this._hoverLinkDataIndices;
                    var u = [];
                    (t || pN(i)) && (u = this._hoverLinkDataIndices = i.findTargetDataIndices(d));
                    var c = function (e, t) {
                        var i = {}, n = {};
                        return a([], i), a(t || [], n, i), [o(i), o(n)];

                        function a(e, t, i) {
                            for (var n = 0, a = e.length; n < a; n++) for (var o = e[n].seriesId, r = Pa(e[n].dataIndex), s = i && i[o], l = 0, d = r.length; l < d; l++) {
                                var u = r[l];
                                s && s[u] ? s[u] = null : (t[o] || (t[o] = {}))[u] = 1
                            }
                        }

                        function o(e, t) {
                            var i = [];
                            for (var n in e) if (e.hasOwnProperty(n) && null != e[n]) if (t) i.push(+n); else {
                                var a = o(e[n], !0);
                                a.length && i.push({seriesId: n, dataIndex: a})
                            }
                            return i
                        }
                    }(0, u);
                    this._dispatchHighDown("downplay", lN(c[0], i)), this._dispatchHighDown("highlight", lN(c[1], i))
                }
            }, _hoverLinkFromSeriesMouseOver: function (e) {
                var t = e.target, i = this.visualMapModel;
                if (t && null != t.dataIndex) {
                    var n = this.ecModel.getSeriesByIndex(t.seriesIndex);
                    if (i.isTargetSeries(n)) {
                        var a = n.getData(t.dataType), o = a.get(i.getDataDimension(a), t.dataIndex, !0);
                        isNaN(o) || this._showIndicator(o, o)
                    }
                }
            }, _hideIndicator: function () {
                var e = this._shapes;
                e.indicator && e.indicator.attr("invisible", !0), e.indicatorLabel && e.indicatorLabel.attr("invisible", !0)
            }, _clearHoverLinkToSeries: function () {
                this._hideIndicator();
                var e = this._hoverLinkDataIndices;
                this._dispatchHighDown("downplay", lN(e, this.visualMapModel)), e.length = 0
            }, _clearHoverLinkFromSeries: function () {
                this._hideIndicator();
                var e = this.api.getZr();
                e.off("mouseover", this._hoverLinkFromSeriesMouseOver), e.off("mouseout", this._hideIndicator)
            }, _applyTransform: function (e, t, i, n) {
                var a = sl(t, n ? null : this.group);
                return vl[O(e) ? "applyTransform" : "transformDirection"](e, a, i)
            }, _dispatchHighDown: function (e, t) {
                t && t.length && this.api.dispatchAction({type: e, batch: t})
            }, dispose: function () {
                this._clearHoverLinkFromSeries(), this._clearHoverLinkToSeries()
            }, remove: function () {
                this._clearHoverLinkFromSeries(), this._clearHoverLinkToSeries()
            }
        });

        function gN(e, t, i, n) {
            return new $r({
                shape: {points: e}, draggable: !!i, cursor: t, drift: i, onmousemove: function (e) {
                    Ge(e.event)
                }, ondragend: n
            })
        }

        function pN(e) {
            var t = e.get("hoverLinkOnHandle");
            return !!(null == t ? e.get("realtime") : t)
        }

        function vN(e) {
            return "vertical" === e ? "ns-resize" : "ew-resize"
        }

        ff({type: "selectDataRange", event: "dataRangeSelected", update: "update"}, function (e, t) {
            t.eachComponent({mainType: "visualMap", query: e}, function (t) {
                t.setSelected(e.selected)
            })
        }), cf(Vx);
        var mN = iN.extend({
            type: "visualMap.piecewise",
            defaultOption: {
                selected: null,
                minOpen: !1,
                maxOpen: !1,
                align: "auto",
                itemWidth: 20,
                itemHeight: 14,
                itemSymbol: "roundRect",
                pieceList: null,
                categories: null,
                splitNumber: 5,
                selectedMode: "multiple",
                itemGap: 10,
                hoverLink: !0,
                showLabel: null
            },
            optionUpdated: function (e, t) {
                mN.superApply(this, "optionUpdated", arguments), this._pieceList = [], this.resetExtent();
                var i = this._mode = this._determineMode();
                yN[this._mode].call(this), this._resetSelected(e, t);
                var n = this.option.categories;
                this.resetVisual(function (e, t) {
                    "categories" === i ? (e.mappingMethod = "category", e.categories = v(n)) : (e.dataExtent = this.getExtent(), e.mappingMethod = "piecewise", e.pieceList = D(this._pieceList, function (e) {
                        return e = v(e), "inRange" !== t && (e.visual = null), e
                    }))
                })
            },
            completeVisualOption: function () {
                var e = this.option, t = {}, i = Jk.listVisualTypes(), n = this.isCategory();

                function a(e, t, i) {
                    return e && e[t] && (B(e[t]) ? e[t].hasOwnProperty(i) : e[t] === i)
                }

                A(e.pieces, function (e) {
                    A(i, function (i) {
                        e.hasOwnProperty(i) && (t[i] = 1)
                    })
                }), A(t, function (t, i) {
                    var o = 0;
                    A(this.stateList, function (t) {
                        o |= a(e, t, i) || a(e.target, t, i)
                    }, this), o || A(this.stateList, function (t) {
                        (e[t] || (e[t] = {}))[i] = Xx(i, "inRange" === t ? "active" : "inactive", n)
                    })
                }, this), iN.prototype.completeVisualOption.apply(this, arguments)
            },
            _resetSelected: function (e, t) {
                var i = this.option, n = this._pieceList, a = (t ? i : e).selected || {};
                if (i.selected = a, A(n, function (e, t) {
                    var i = this.getSelectedMapKey(e);
                    a.hasOwnProperty(i) || (a[i] = !0)
                }, this), "single" === i.selectedMode) {
                    var o = !1;
                    A(n, function (e, t) {
                        var i = this.getSelectedMapKey(e);
                        a[i] && (o ? a[i] = !1 : o = !0)
                    }, this)
                }
            },
            getSelectedMapKey: function (e) {
                return "categories" === this._mode ? e.value + "" : e.index + ""
            },
            getPieceList: function () {
                return this._pieceList
            },
            _determineMode: function () {
                var e = this.option;
                return e.pieces && 0 < e.pieces.length ? "pieces" : this.option.categories ? "categories" : "splitNumber"
            },
            setSelected: function (e) {
                this.option.selected = v(e)
            },
            getValueState: function (e) {
                var t = Jk.findPieceIndex(e, this._pieceList);
                return null != t && this.option.selected[this.getSelectedMapKey(this._pieceList[t])] ? "inRange" : "outOfRange"
            },
            findTargetDataIndices: function (e) {
                var t = [];
                return this.eachTargetSeries(function (i) {
                    var n = [], a = i.getData();
                    a.each(this.getDataDimension(a), function (t, i) {
                        Jk.findPieceIndex(t, this._pieceList) === e && n.push(i)
                    }, this), t.push({seriesId: i.id, dataIndex: n})
                }, this), t
            },
            getRepresentValue: function (e) {
                var t;
                if (this.isCategory()) t = e.value; else if (null != e.value) t = e.value; else {
                    var i = e.interval || [];
                    t = i[0] === -1 / 0 && i[1] === 1 / 0 ? 0 : (i[0] + i[1]) / 2
                }
                return t
            },
            getVisualMeta: function (e) {
                if (!this.isCategory()) {
                    var t = [], i = [], n = this, a = this._pieceList.slice();
                    if (a.length) {
                        var o = a[0].interval[0];
                        o !== -1 / 0 && a.unshift({interval: [-1 / 0, o]}), (o = a[a.length - 1].interval[1]) !== 1 / 0 && a.push({interval: [o, 1 / 0]})
                    } else a.push({interval: [-1 / 0, 1 / 0]});
                    var r = -1 / 0;
                    return A(a, function (e) {
                        var t = e.interval;
                        t && (t[0] > r && s([r, t[0]], "outOfRange"), s(t.slice()), r = t[1])
                    }, this), {stops: t, outerColors: i}
                }

                function s(a, o) {
                    var r = n.getRepresentValue({interval: a});
                    o = o || n.getValueState(r);
                    var s = e(r, o);
                    a[0] === -1 / 0 ? i[0] = s : a[1] === 1 / 0 ? i[1] = s : t.push({
                        value: a[0],
                        color: s
                    }, {value: a[1], color: s})
                }
            }
        }), yN = {
            splitNumber: function () {
                var e = this.option, t = this._pieceList, i = Math.min(e.precision, 20), n = this.getExtent(),
                    a = e.splitNumber;
                a = Math.max(parseInt(a, 10), 1), e.splitNumber = a;
                for (var o = (n[1] - n[0]) / a; +o.toFixed(i) !== o && i < 5;) i++;
                e.precision = i, o = +o.toFixed(i), e.minOpen && t.push({interval: [-1 / 0, n[0]], close: [0, 0]});
                for (var r = 0, s = n[0]; r < a; s += o, r++) {
                    var l = r === a - 1 ? n[1] : s + o;
                    t.push({interval: [s, l], close: [1, 1]})
                }
                e.maxOpen && t.push({interval: [n[1], 1 / 0], close: [0, 0]}), jl(t), A(t, function (e, t) {
                    e.index = t, e.text = this.formatValueText(e.interval)
                }, this)
            }, categories: function () {
                var e = this.option;
                A(e.categories, function (e) {
                    this._pieceList.push({text: this.formatValueText(e, !0), value: e})
                }, this), kN(e, this._pieceList)
            }, pieces: function () {
                var e = this.option, t = this._pieceList;
                A(e.pieces, function (e, i) {
                    B(e) || (e = {value: e});
                    var n = {text: "", index: i};
                    if (null != e.label && (n.text = e.label), e.hasOwnProperty("value")) {
                        var a = n.value = e.value;
                        n.interval = [a, a], n.close = [1, 1]
                    } else {
                        for (var o = n.interval = [], r = n.close = [0, 0], s = [1, 0, 1], l = [-1 / 0, 1 / 0], d = [], u = 0; u < 2; u++) {
                            for (var c = [["gte", "gt", "min"], ["lte", "lt", "max"]][u], h = 0; h < 3 && null == o[u]; h++) o[u] = e[c[h]], r[u] = s[h], d[u] = 2 === h;
                            null == o[u] && (o[u] = l[u])
                        }
                        d[0] && o[1] === 1 / 0 && (r[0] = 0), d[1] && o[0] === -1 / 0 && (r[1] = 0), o[0] === o[1] && r[0] && r[1] && (n.value = o[0])
                    }
                    n.visual = Jk.retrieveVisuals(e), t.push(n)
                }, this), kN(e, t), jl(t), A(t, function (e) {
                    var t = e.close, i = [["<", "≤"][t[1]], [">", "≥"][t[0]]];
                    e.text = e.text || this.formatValueText(null != e.value ? e.value : e.interval, !1, i)
                }, this)
            }
        };

        function kN(e, t) {
            var i = e.inverse;
            ("vertical" === e.orient ? !i : i) && t.reverse()
        }

        rN.extend({
            type: "visualMap.piecewise", doRender: function () {
                var e = this.group;
                e.removeAll();
                var t = this.visualMapModel, i = t.get("textGap"), n = t.textStyleModel, a = n.getFont(),
                    o = n.getTextColor(), r = this._getItemAlign(), s = t.itemSize, l = this._getViewData(),
                    d = l.endsText, u = V(t.get("showLabel", !0), !d);
                d && this._renderEndsText(e, d[0], s, u, r), A(l.viewPieceList, function (n) {
                    var l = n.piece, d = new Di;
                    d.onclick = P(this._onItemClick, this, l), this._enableHoverLink(d, n.indexInModelPieceList);
                    var c = t.getRepresentValue(l);
                    if (this._createItemSymbol(d, c, [0, 0, s[0], s[1]]), u) {
                        var h = this.visualMapModel.getValueState(c);
                        d.add(new Rr({
                            style: {
                                x: "right" === r ? -i : s[0] + i,
                                y: s[1] / 2,
                                text: l.text,
                                textVerticalAlign: "middle",
                                textAlign: r,
                                textFont: a,
                                textFill: o,
                                opacity: "outOfRange" === h ? .5 : 1
                            }
                        }))
                    }
                    e.add(d)
                }, this), d && this._renderEndsText(e, d[1], s, u, r), pd(t.get("orient"), e, t.get("itemGap")), this.renderBackground(e), this.positionGroup(e)
            }, _enableHoverLink: function (e, t) {
                function i(e) {
                    var i = this.visualMapModel;
                    i.option.hoverLink && this.api.dispatchAction({type: e, batch: lN(i.findTargetDataIndices(t), i)})
                }

                e.on("mouseover", P(i, this, "highlight")).on("mouseout", P(i, this, "downplay"))
            }, _getItemAlign: function () {
                var e = this.visualMapModel, t = e.option;
                if ("vertical" === t.orient) return sN(e, this.api, e.itemSize);
                var i = t.align;
                return i && "auto" !== i || (i = "left"), i
            }, _renderEndsText: function (e, t, i, n, a) {
                if (t) {
                    var o = new Di, r = this.visualMapModel.textStyleModel;
                    o.add(new Rr({
                        style: {
                            x: n ? "right" === a ? i[0] : 0 : i[0] / 2,
                            y: i[1] / 2,
                            textVerticalAlign: "middle",
                            textAlign: n ? a : "center",
                            text: t,
                            textFont: r.getFont(),
                            textFill: r.getTextColor()
                        }
                    })), e.add(o)
                }
            }, _getViewData: function () {
                var e = this.visualMapModel, t = D(e.getPieceList(), function (e, t) {
                    return {piece: e, indexInModelPieceList: t}
                }), i = e.get("text"), n = e.get("orient"), a = e.get("inverse");
                return ("horizontal" === n ? a : !a) ? t.reverse() : i = i && i.slice().reverse(), {
                    viewPieceList: t,
                    endsText: i
                }
            }, _createItemSymbol: function (e, t, i) {
                e.add(cp(this.getControllerVisual(t, "symbol"), i[0], i[1], i[2], i[3], this.getControllerVisual(t, "color")))
            }, _onItemClick: function (e) {
                var t = this.visualMapModel, i = t.option, n = v(i.selected), a = t.getSelectedMapKey(e);
                "single" === i.selectedMode ? (n[a] = !0, A(n, function (e, t) {
                    n[t] = t === a
                })) : n[a] = !n[a], this.api.dispatchAction({
                    type: "selectDataRange",
                    from: this.uid,
                    visualMapId: this.visualMapModel.id,
                    selected: n
                })
            }
        }), cf(Vx);
        var TN, wN = "urn:schemas-microsoft-com:vml", CN = "undefined" == typeof window ? null : window, SN = !1,
            bN = CN && CN.document;

        function IN(e) {
            return TN(e)
        }

        if (bN && !a.canvasSupported) try {
            bN.namespaces.zrvml || bN.namespaces.add("zrvml", wN), TN = function (e) {
                return bN.createElement("<zrvml:" + e + ' class="zrvml">')
            }
        } catch (e) {
            TN = function (e) {
                return bN.createElement("<" + e + ' xmlns="' + wN + '" class="zrvml">')
            }
        }
        var _N, AN = er.CMD, DN = Math.round, xN = Math.sqrt, NN = Math.abs, EN = Math.cos, PN = Math.sin,
            MN = Math.max;
        if (!a.canvasSupported) {
            var ON = ",", FN = "progid:DXImageTransform.Microsoft", LN = 21600, BN = LN / 2, UN = function (e) {
                e.style.cssText = "position:absolute;left:0;top:0;width:1px;height:1px;", e.coordsize = LN + "," + LN, e.coordorigin = "0,0"
            }, RN = function (e, t, i) {
                return "rgb(" + [e, t, i].join(",") + ")"
            }, KN = function (e, t) {
                t && e && t.parentNode !== e && e.appendChild(t)
            }, WN = function (e, t) {
                t && e && t.parentNode === e && e.removeChild(t)
            }, VN = function (e, t, i) {
                return 1e5 * (parseFloat(e) || 0) + 1e3 * (parseFloat(t) || 0) + i
            }, HN = Hn, zN = function (e, t, i) {
                var n = Wt(t);
                i = +i, isNaN(i) && (i = 1), n && (e.color = RN(n[0], n[1], n[2]), e.opacity = i * n[3])
            }, jN = function (e, t, i, n) {
                var a = "fill" === t, o = e.getElementsByTagName(t)[0];
                null != i[t] && "none" !== i[t] && (a || !a && i.lineWidth) ? (e[a ? "filled" : "stroked"] = "true", i[t] instanceof os && WN(e, o), o = o || IN(t), a ? function (e, t, i) {
                    var n, a, o = t.fill;
                    if (null != o) if (o instanceof os) {
                        var r, s = 0, l = [0, 0], d = 0, u = 1, c = i.getBoundingRect(), h = c.width, f = c.height;
                        if ("linear" === o.type) {
                            r = "gradient";
                            var g = i.transform, p = [o.x * h, o.y * f], v = [o.x2 * h, o.y2 * f];
                            g && (Ce(p, p, g), Ce(v, v, g));
                            var m = v[0] - p[0], y = v[1] - p[1];
                            (s = 180 * Math.atan2(m, y) / Math.PI) < 0 && (s += 360), s < 1e-6 && (s = 0)
                        } else {
                            r = "gradientradial", p = [o.x * h, o.y * f], g = i.transform;
                            var k = i.scale, T = h, w = f;
                            l = [(p[0] - c.x) / T, (p[1] - c.y) / w], g && Ce(p, p, g), T /= k[0] * LN, w /= k[1] * LN;
                            var C = MN(T, w);
                            d = 0 / C, u = 2 * o.r / C - d
                        }
                        var S = o.colorStops.slice();
                        S.sort(function (e, t) {
                            return e.offset - t.offset
                        });
                        for (var b = S.length, I = [], _ = [], A = 0; A < b; A++) {
                            var D = S[A], x = (n = D.color, a = Wt(n), [RN(a[0], a[1], a[2]), a[3]]);
                            _.push(D.offset * u + d + " " + x[0]), 0 !== A && A !== b - 1 || I.push(x)
                        }
                        if (2 <= b) {
                            var N = I[0][0], E = I[1][0], P = I[0][1] * t.opacity, M = I[1][1] * t.opacity;
                            e.type = r, e.method = "none", e.focus = "100%", e.angle = s, e.color = N, e.color2 = E, e.colors = _.join(","), e.opacity = M, e.opacity2 = P
                        }
                        "radial" === r && (e.focusposition = l.join(","))
                    } else zN(e, o, t.opacity)
                }(o, i, n) : function (e, t) {
                    t.lineDash && (e.dashstyle = t.lineDash.join(" ")), null == t.stroke || t.stroke instanceof os || zN(e, t.stroke, t.opacity)
                }(o, i), KN(e, o)) : (e[a ? "filled" : "stroked"] = "false", WN(e, o))
            }, GN = [[], [], []];
            wr.prototype.brushVML = function (e) {
                var t = this.style, i = this._vmlEl;
                i || (i = IN("shape"), UN(i), this._vmlEl = i), jN(i, "fill", t, this), jN(i, "stroke", t, this);
                var n = this.transform, a = null != n, o = i.getElementsByTagName("stroke")[0];
                if (o) {
                    var r = t.lineWidth;
                    if (a && !t.strokeNoScale) {
                        var s = n[0] * n[3] - n[1] * n[2];
                        r *= xN(NN(s))
                    }
                    o.weight = r + "px"
                }
                var l = this.path || (this.path = new er);
                this.__dirtyPath && (l.beginPath(), l.subPixelOptimize = !1, this.buildPath(l, this.shape), l.toStatic(), this.__dirtyPath = !1), i.path = function (e, t) {
                    var i, n, a, o, r, s, l = AN.M, d = AN.C, u = AN.L, c = AN.A, h = AN.Q, f = [], g = e.data,
                        p = e.len();
                    for (o = 0; o < p;) {
                        switch (n = "", i = 0, a = g[o++]) {
                            case l:
                                n = " m ", i = 1, r = g[o++], s = g[o++], GN[0][0] = r, GN[0][1] = s;
                                break;
                            case u:
                                n = " l ", i = 1, r = g[o++], s = g[o++], GN[0][0] = r, GN[0][1] = s;
                                break;
                            case h:
                            case d:
                                n = " c ", i = 3;
                                var v, m, y = g[o++], k = g[o++], T = g[o++], w = g[o++];
                                a === h ? (T = ((v = T) + 2 * y) / 3, w = ((m = w) + 2 * k) / 3, y = (r + 2 * y) / 3, k = (s + 2 * k) / 3) : (v = g[o++], m = g[o++]), GN[0][0] = y, GN[0][1] = k, GN[1][0] = T, GN[1][1] = w, r = GN[2][0] = v, s = GN[2][1] = m;
                                break;
                            case c:
                                var C = 0, S = 0, b = 1, I = 1, _ = 0;
                                t && (C = t[4], S = t[5], b = xN(t[0] * t[0] + t[1] * t[1]), I = xN(t[2] * t[2] + t[3] * t[3]), _ = Math.atan2(-t[1] / I, t[0] / b));
                                var A = g[o++], D = g[o++], x = g[o++], N = g[o++], E = g[o++] + _, P = g[o++] + E + _;
                                o++;
                                var M = g[o++], O = A + EN(E) * x, F = D + PN(E) * N,
                                    L = (y = A + EN(P) * x, k = D + PN(P) * N, M ? " wa " : " at ");
                                Math.abs(O - y) < 1e-4 && (.01 < Math.abs(P - E) ? M && (O += .0125) : Math.abs(F - D) < 1e-4 ? M && O < A || !M && A < O ? k -= .0125 : k += .0125 : M && F < D || !M && D < F ? y += .0125 : y -= .0125), f.push(L, DN(((A - x) * b + C) * LN - BN), ON, DN(((D - N) * I + S) * LN - BN), ON, DN(((A + x) * b + C) * LN - BN), ON, DN(((D + N) * I + S) * LN - BN), ON, DN((O * b + C) * LN - BN), ON, DN((F * I + S) * LN - BN), ON, DN((y * b + C) * LN - BN), ON, DN((k * I + S) * LN - BN)), r = y, s = k;
                                break;
                            case AN.R:
                                var B = GN[0], U = GN[1];
                                B[0] = g[o++], B[1] = g[o++], U[0] = B[0] + g[o++], U[1] = B[1] + g[o++], t && (Ce(B, B, t), Ce(U, U, t)), B[0] = DN(B[0] * LN - BN), U[0] = DN(U[0] * LN - BN), B[1] = DN(B[1] * LN - BN), U[1] = DN(U[1] * LN - BN), f.push(" m ", B[0], ON, B[1], " l ", U[0], ON, B[1], " l ", U[0], ON, U[1], " l ", B[0], ON, U[1]);
                                break;
                            case AN.Z:
                                f.push(" x ")
                        }
                        if (0 < i) {
                            f.push(n);
                            for (var R = 0; R < i; R++) {
                                var K = GN[R];
                                t && Ce(K, K, t), f.push(DN(K[0] * LN - BN), ON, DN(K[1] * LN - BN), R < i - 1 ? ON : "")
                            }
                        }
                    }
                    return f.join("")
                }(l, this.transform), i.style.zIndex = VN(this.zlevel, this.z, this.z2), KN(e, i), null != t.text ? this.drawRectText(e, this.getBoundingRect()) : this.removeRectText(e)
            }, wr.prototype.onRemove = function (e) {
                WN(e, this._vmlEl), this.removeRectText(e)
            }, wr.prototype.onAdd = function (e) {
                KN(e, this._vmlEl), this.appendRectText(e)
            }, qn.prototype.brushVML = function (e) {
                var t, i, n = this.style, a = n.image;
                if (function (e) {
                    return "object" == typeof e && e.tagName && "IMG" === e.tagName.toUpperCase()
                }(a)) {
                    var o = a.src;
                    if (o === this._imageSrc) t = this._imageWidth, i = this._imageHeight; else {
                        var r = a.runtimeStyle, s = r.width, l = r.height;
                        r.width = "auto", r.height = "auto", t = a.width, i = a.height, r.width = s, r.height = l, this._imageSrc = o, this._imageWidth = t, this._imageHeight = i
                    }
                    a = o
                } else a === this._imageSrc && (t = this._imageWidth, i = this._imageHeight);
                if (a) {
                    var d = n.x || 0, u = n.y || 0, c = n.width, h = n.height, f = n.sWidth, g = n.sHeight,
                        p = n.sx || 0, v = n.sy || 0, m = f && g, y = this._vmlEl;
                    y || (y = bN.createElement("div"), UN(y), this._vmlEl = y);
                    var k, T = y.style, w = !1, C = 1, S = 1;
                    if (this.transform && (k = this.transform, C = xN(k[0] * k[0] + k[1] * k[1]), S = xN(k[2] * k[2] + k[3] * k[3]), w = k[1] || k[2]), w) {
                        var b = [d, u], I = [d + c, u], _ = [d, u + h], A = [d + c, u + h];
                        Ce(b, b, k), Ce(I, I, k), Ce(_, _, k), Ce(A, A, k);
                        var D = MN(b[0], I[0], _[0], A[0]), x = MN(b[1], I[1], _[1], A[1]), N = [];
                        N.push("M11=", k[0] / C, ON, "M12=", k[2] / S, ON, "M21=", k[1] / C, ON, "M22=", k[3] / S, ON, "Dx=", DN(d * C + k[4]), ON, "Dy=", DN(u * S + k[5])), T.padding = "0 " + DN(D) + "px " + DN(x) + "px 0", T.filter = FN + ".Matrix(" + N.join("") + ", SizingMethod=clip)"
                    } else k && (d = d * C + k[4], u = u * S + k[5]), T.filter = "", T.left = DN(d) + "px", T.top = DN(u) + "px";
                    var E = this._imageEl, P = this._cropEl;
                    E || (E = bN.createElement("div"), this._imageEl = E);
                    var M = E.style;
                    if (m) {
                        if (t && i) M.width = DN(C * t * c / f) + "px", M.height = DN(S * i * h / g) + "px"; else {
                            var O = new Image, F = this;
                            O.onload = function () {
                                O.onload = null, t = O.width, i = O.height, M.width = DN(C * t * c / f) + "px", M.height = DN(S * i * h / g) + "px", F._imageWidth = t, F._imageHeight = i, F._imageSrc = a
                            }, O.src = a
                        }
                        P || ((P = bN.createElement("div")).style.overflow = "hidden", this._cropEl = P);
                        var L = P.style;
                        L.width = DN((c + p * c / f) * C), L.height = DN((h + v * h / g) * S), L.filter = FN + ".Matrix(Dx=" + -p * c / f * C + ",Dy=" + -v * h / g * S + ")", P.parentNode || y.appendChild(P), E.parentNode !== P && P.appendChild(E)
                    } else M.width = DN(C * c) + "px", M.height = DN(S * h) + "px", y.appendChild(E), P && P.parentNode && (y.removeChild(P), this._cropEl = null);
                    var B = "", U = n.opacity;
                    U < 1 && (B += ".Alpha(opacity=" + DN(100 * U) + ") "), B += FN + ".AlphaImageLoader(src=" + a + ", SizingMethod=scale)", M.filter = B, y.style.zIndex = VN(this.zlevel, this.z, this.z2), KN(e, y), null != n.text && this.drawRectText(e, this.getBoundingRect())
                }
            }, qn.prototype.onRemove = function (e) {
                WN(e, this._vmlEl), this._vmlEl = null, this._cropEl = null, this._imageEl = null, this.removeRectText(e)
            }, qn.prototype.onAdd = function (e) {
                KN(e, this._vmlEl), this.appendRectText(e)
            };
            var $N, XN = "normal", qN = {}, YN = 0, JN = document.createElement("div");
            _N = function (e, t) {
                var i = bN;
                $N || (($N = i.createElement("div")).style.cssText = "position:absolute;top:-20000px;left:0;padding:0;margin:0;border:none;white-space:pre;", bN.body.appendChild($N));
                try {
                    $N.style.font = t
                } catch (e) {
                }
                return $N.innerHTML = "", $N.appendChild(i.createTextNode(e)), {width: $N.offsetWidth}
            }, dn.measureText = _N;
            for (var ZN = new Ai, QN = function (e, t, i, n) {
                var a = this.style;
                this.__dirty && En(a);
                var o = a.text;
                if (null != o && (o += ""), o) {
                    if (a.rich) {
                        var r = wn(o, a);
                        o = [];
                        for (var s = 0; s < r.lines.length; s++) {
                            for (var l = r.lines[s].tokens, d = [], u = 0; u < l.length; u++) d.push(l[u].text);
                            o.push(d.join(""))
                        }
                        o = o.join("\n")
                    }
                    var c, h, f = a.textAlign, g = a.textVerticalAlign, p = function (e) {
                        var t = qN[e];
                        if (!t) {
                            100 < YN && (YN = 0, qN = {});
                            var i, n = JN.style;
                            try {
                                n.font = e, i = n.fontFamily.split(",")[0]
                            } catch (e) {
                            }
                            t = {
                                style: n.fontStyle || XN,
                                variant: n.fontVariant || XN,
                                weight: n.fontWeight || XN,
                                size: 0 | parseFloat(n.fontSize || 12),
                                family: i || "Microsoft YaHei"
                            }, qN[e] = t, YN++
                        }
                        return t
                    }(a.font), v = p.style + " " + p.variant + " " + p.weight + " " + p.size + 'px "' + p.family + '"';
                    i = i || cn(o, v, f, g, a.textPadding, a.textLineHeight);
                    var m = this.transform;
                    if (m && !n && (ZN.copy(t), ZN.applyTransform(m), t = ZN), n) c = t.x, h = t.y; else {
                        var y = a.textPosition;
                        if (y instanceof Array) c = t.x + HN(y[0], t.width), h = t.y + HN(y[1], t.height), f = f || "left"; else {
                            var k = this.calculateTextPosition ? this.calculateTextPosition({}, a, t) : gn({}, a, t);
                            c = k.x, h = k.y, f = f || k.textAlign, g = g || k.textVerticalAlign
                        }
                    }
                    c = hn(c, i.width, f), h = fn(h, i.height, g), h += i.height / 2;
                    var T, w, C, S = IN, b = this._textVmlEl;
                    b ? w = (T = (C = b.firstChild).nextSibling).nextSibling : (b = S("line"), T = S("path"), w = S("textpath"), C = S("skew"), w.style["v-text-align"] = "left", UN(b), T.textpathok = !0, w.on = !0, b.from = "0 0", b.to = "1000 0.05", KN(b, C), KN(b, T), KN(b, w), this._textVmlEl = b);
                    var I = [c, h], _ = b.style;
                    m && n ? (Ce(I, I, m), C.on = !0, C.matrix = m[0].toFixed(3) + ON + m[2].toFixed(3) + ON + m[1].toFixed(3) + ON + m[3].toFixed(3) + ",0,0", C.offset = (DN(I[0]) || 0) + "," + (DN(I[1]) || 0), C.origin = "0 0", _.left = "0px", _.top = "0px") : (C.on = !1, _.left = DN(c) + "px", _.top = DN(h) + "px"), w.string = function (e) {
                        return String(e).replace(/&/g, "&amp;").replace(/"/g, "&quot;")
                    }(o);
                    try {
                        w.style.font = v
                    } catch (e) {
                    }
                    jN(b, "fill", {fill: a.textFill, opacity: a.opacity}, this), jN(b, "stroke", {
                        stroke: a.textStroke,
                        opacity: a.opacity,
                        lineDash: a.lineDash || null
                    }, this), b.style.zIndex = VN(this.zlevel, this.z, this.z2), KN(e, b)
                }
            }, eE = function (e) {
                WN(e, this._textVmlEl), this._textVmlEl = null
            }, tE = function (e) {
                KN(e, this._textVmlEl)
            }, iE = [Gn, Xn, qn, wr, Rr], nE = 0; nE < iE.length; nE++) {
                var aE = iE[nE].prototype;
                aE.drawRectText = QN, aE.removeRectText = eE, aE.appendRectText = tE
            }
            Rr.prototype.brushVML = function (e) {
                var t = this.style;
                null != t.text ? this.drawRectText(e, {
                    x: t.x || 0,
                    y: t.y || 0,
                    width: 0,
                    height: 0
                }, this.getBoundingRect(), !0) : this.removeRectText(e)
            }, Rr.prototype.onRemove = function (e) {
                this.removeRectText(e)
            }, Rr.prototype.onAdd = function (e) {
                this.appendRectText(e)
            }
        }

        function oE(e) {
            return parseInt(e, 10)
        }

        function rE(e, t) {
            !function () {
                if (!SN && bN) {
                    SN = !0;
                    var e = bN.styleSheets;
                    e.length < 31 ? bN.createStyleSheet().addRule(".zrvml", "behavior:url(#default#VML)") : e[0].addRule(".zrvml", "behavior:url(#default#VML)")
                }
            }(), this.root = e, this.storage = t;
            var i = document.createElement("div"), n = document.createElement("div");
            i.style.cssText = "display:inline-block;overflow:hidden;position:relative;width:300px;height:150px;", n.style.cssText = "position:absolute;left:0;top:0;", e.appendChild(i), this._vmlRoot = n, this._vmlViewport = i, this.resize();
            var a = t.delFromStorage, o = t.addToStorage;
            t.delFromStorage = function (e) {
                a.call(t, e), e && e.onRemove && e.onRemove(n)
            }, t.addToStorage = function (e) {
                e.onAdd && e.onAdd(n), o.call(t, e)
            }, this._firstPaint = !0
        }

        function sE(e) {
            return document.createElementNS("http://www.w3.org/2000/svg", e)
        }

        rE.prototype = {
            constructor: rE, getType: function () {
                return "vml"
            }, getViewportRoot: function () {
                return this._vmlViewport
            }, getViewportRootOffset: function () {
                var e = this.getViewportRoot();
                if (e) return {offsetLeft: e.offsetLeft || 0, offsetTop: e.offsetTop || 0}
            }, refresh: function () {
                var e = this.storage.getDisplayList(!0, !0);
                this._paintList(e)
            }, _paintList: function (e) {
                for (var t = this._vmlRoot, i = 0; i < e.length; i++) {
                    var n = e[i];
                    n.invisible || n.ignore ? (n.__alreadyNotVisible || n.onRemove(t), n.__alreadyNotVisible = !0) : (n.__alreadyNotVisible && n.onAdd(t), n.__alreadyNotVisible = !1, n.__dirty && (n.beforeBrush && n.beforeBrush(), (n.brushVML || n.brush).call(n, t), n.afterBrush && n.afterBrush())), n.__dirty = !1
                }
                this._firstPaint && (this._vmlViewport.appendChild(t), this._firstPaint = !1)
            }, resize: function (e, t) {
                if (e = null == e ? this._getWidth() : e, t = null == t ? this._getHeight() : t, this._width !== e || this._height !== t) {
                    this._width = e, this._height = t;
                    var i = this._vmlViewport.style;
                    i.width = e + "px", i.height = t + "px"
                }
            }, dispose: function () {
                this.root.innerHTML = "", this._vmlRoot = this._vmlViewport = this.storage = null
            }, getWidth: function () {
                return this._width
            }, getHeight: function () {
                return this._height
            }, clear: function () {
                this._vmlViewport && this.root.removeChild(this._vmlViewport)
            }, _getWidth: function () {
                var e = this.root, t = e.currentStyle;
                return (e.clientWidth || oE(t.width)) - oE(t.paddingLeft) - oE(t.paddingRight) | 0
            }, _getHeight: function () {
                var e = this.root, t = e.currentStyle;
                return (e.clientHeight || oE(t.height)) - oE(t.paddingTop) - oE(t.paddingBottom) | 0
            }
        }, A(["getLayer", "insertLayer", "eachLayer", "eachBuiltinLayer", "eachOtherLayer", "getLayers", "modLayer", "delLayer", "clearLayer", "toDataURL", "pathToImage"], function (e) {
            rE.prototype[e] = function (e) {
                return function () {
                    vi('In IE8.0 VML mode painter not support method "' + e + '"')
                }
            }(e)
        }), Ia("vml", rE);
        var lE = er.CMD, dE = Array.prototype.join, uE = "none", cE = Math.round, hE = Math.sin, fE = Math.cos,
            gE = Math.PI, pE = 2 * Math.PI, vE = 180 / gE, mE = 1e-4;

        function yE(e) {
            return cE(1e4 * e) / 1e4
        }

        function kE(e) {
            return e < mE && -mE < e
        }

        function TE(e, t) {
            t && wE(e, "transform", "matrix(" + dE.call(t, ",") + ")")
        }

        function wE(e, t, i) {
            i && ("linear" === i.type || "radial" === i.type) || e.setAttribute(t, i)
        }

        function CE(e, t, i, n) {
            if (function (e, t) {
                var i = t ? e.textFill : e.fill;
                return null != i && i !== uE
            }(t, i)) {
                var a = i ? t.textFill : t.fill;
                wE(e, "fill", a = "transparent" === a ? uE : a), wE(e, "fill-opacity", null != t.fillOpacity ? t.fillOpacity * t.opacity : t.opacity)
            } else wE(e, "fill", uE);
            if (function (e, t) {
                var i = t ? e.textStroke : e.stroke;
                return null != i && i !== uE
            }(t, i)) {
                var o = i ? t.textStroke : t.stroke;
                wE(e, "stroke", o = "transparent" === o ? uE : o), wE(e, "stroke-width", (i ? t.textStrokeWidth : t.lineWidth) / (!i && t.strokeNoScale ? n.getLineScale() : 1)), wE(e, "paint-order", i ? "stroke" : "fill"), wE(e, "stroke-opacity", null != t.strokeOpacity ? t.strokeOpacity : t.opacity), t.lineDash ? (wE(e, "stroke-dasharray", t.lineDash.join(",")), wE(e, "stroke-dashoffset", cE(t.lineDashOffset || 0))) : wE(e, "stroke-dasharray", ""), t.lineCap && wE(e, "stroke-linecap", t.lineCap), t.lineJoin && wE(e, "stroke-linejoin", t.lineJoin), t.miterLimit && wE(e, "stroke-miterlimit", t.miterLimit)
            } else wE(e, "stroke", uE)
        }

        var SE = {
                brush: function (e) {
                    var t = e.style, i = e.__svgEl;
                    i || (i = sE("path"), e.__svgEl = i), e.path || e.createPathProxy();
                    var n = e.path;
                    if (e.__dirtyPath) {
                        n.beginPath(), n.subPixelOptimize = !1, e.buildPath(n, e.shape), e.__dirtyPath = !1;
                        var a = function (e) {
                            for (var t = [], i = e.data, n = e.len(), a = 0; a < n;) {
                                var o = "", r = 0;
                                switch (i[a++]) {
                                    case lE.M:
                                        o = "M", r = 2;
                                        break;
                                    case lE.L:
                                        o = "L", r = 2;
                                        break;
                                    case lE.Q:
                                        o = "Q", r = 4;
                                        break;
                                    case lE.C:
                                        o = "C", r = 6;
                                        break;
                                    case lE.A:
                                        var s = i[a++], l = i[a++], d = i[a++], u = i[a++], c = i[a++], h = i[a++],
                                            f = i[a++], g = i[a++], p = Math.abs(h),
                                            v = kE(p - pE) || (g ? pE <= h : pE <= -h), m = 0 < h ? h % pE : h % pE + pE,
                                            y = !1;
                                        y = !!v || !kE(p) && gE <= m == !!g;
                                        var k = yE(s + d * fE(c)), T = yE(l + u * hE(c));
                                        v && (h = g ? pE - 1e-4 : 1e-4 - pE, y = !0, 9 === a && t.push("M", k, T));
                                        var w = yE(s + d * fE(c + h)), C = yE(l + u * hE(c + h));
                                        t.push("A", yE(d), yE(u), cE(f * vE), +y, +g, w, C);
                                        break;
                                    case lE.Z:
                                        o = "Z";
                                        break;
                                    case lE.R:
                                        w = yE(i[a++]), C = yE(i[a++]);
                                        var S = yE(i[a++]), b = yE(i[a++]);
                                        t.push("M", w, C, "L", w + S, C, "L", w + S, C + b, "L", w, C + b, "L", w, C)
                                }
                                o && t.push(o);
                                for (var I = 0; I < r; I++) t.push(yE(i[a++]))
                            }
                            return t.join(" ")
                        }(n);
                        a.indexOf("NaN") < 0 && wE(i, "d", a)
                    }
                    CE(i, t, !1, e), TE(i, e.transform), null != t.text ? NE(e, e.getBoundingRect()) : PE(e)
                }
            }, bE = {
                brush: function (e) {
                    var t = e.style, i = t.image;
                    if (i instanceof HTMLImageElement && (i = i.src), i) {
                        var n = t.x || 0, a = t.y || 0, o = t.width, r = t.height, s = e.__svgEl;
                        s || (s = sE("image"), e.__svgEl = s), i !== e.__imageSrc && (function (e, t, i) {
                            e.setAttributeNS("http://www.w3.org/1999/xlink", "href", i)
                        }(s, 0, i), e.__imageSrc = i), wE(s, "width", o), wE(s, "height", r), wE(s, "x", n), wE(s, "y", a), TE(s, e.transform), null != t.text ? NE(e, e.getBoundingRect()) : PE(e)
                    }
                }
            }, IE = {}, _E = new Ai, AE = {}, DE = [],
            xE = {left: "start", right: "end", center: "middle", middle: "middle"}, NE = function (e, t) {
                var i = e.style, n = e.transform, a = e instanceof Rr || i.transformText;
                e.__dirty && En(i);
                var o = i.text;
                if (null != o && (o += ""), jn(o, i)) {
                    null == o && (o = ""), !a && n && (_E.copy(t), _E.applyTransform(n), t = _E);
                    var r = e.__textSvgEl;
                    r || (r = sE("text"), e.__textSvgEl = r);
                    var s = r.style, l = i.font || ln, d = r.__computedFont;
                    l !== r.__styleFont && (s.font = r.__styleFont = l, d = r.__computedFont = s.font);
                    var u = i.textPadding, c = i.textLineHeight, h = e.__textCotentBlock;
                    h && !e.__dirtyText || (h = e.__textCotentBlock = Tn(o, d, u, c, i.truncate));
                    var f = h.outerHeight, g = h.lineHeight;
                    Rn(AE, e, i, t);
                    var p = AE.baseX, v = AE.baseY, m = AE.textAlign || "left", y = AE.textVerticalAlign;
                    !function (e, t, i, n, a, o, r) {
                        rt(DE), t && i && st(DE, i);
                        var s = n.textRotation;
                        if (a && s) {
                            var l = n.textOrigin;
                            "center" === l ? (o = a.width / 2 + a.x, r = a.height / 2 + a.y) : l && (o = l[0] + a.x, r = l[1] + a.y), DE[4] -= o, DE[5] -= r, ut(DE, DE, s), DE[4] += o, DE[5] += r
                        }
                        TE(e, DE)
                    }(r, a, n, i, t, p, v);
                    var k = p, T = fn(v, f, y);
                    u && (k = function (e, t, i) {
                        return "right" === t ? e - i[1] : "center" === t ? e + i[3] / 2 - i[1] / 2 : e + i[3]
                    }(p, m, u), T += u[0]), T += g / 2, CE(r, i, !0, e);
                    var w = h.canCacheByTextString, C = e.__tspanList || (e.__tspanList = []), S = C.length;
                    if (w && e.__canCacheByTextString && e.__text === o) {
                        if (e.__dirtyText && S) for (var b = 0; b < S; ++b) EE(C[b], m, k, T + b * g)
                    } else {
                        e.__text = o, e.__canCacheByTextString = w;
                        var I = h.lines, _ = I.length;
                        for (b = 0; b < _; b++) {
                            var A = C[b], D = I[b];
                            A ? A.__zrText !== D && (A.innerHTML = "", A.appendChild(document.createTextNode(D))) : (A = C[b] = sE("tspan"), r.appendChild(A), A.appendChild(document.createTextNode(D))), EE(A, m, k, T + b * g)
                        }
                        if (_ < S) {
                            for (; b < S; b++) r.removeChild(C[b]);
                            C.length = _
                        }
                    }
                }
            };

        function EE(e, t, i, n) {
            wE(e, "dominant-baseline", "middle"), wE(e, "text-anchor", xE[t]), wE(e, "x", i), wE(e, "y", n)
        }

        function PE(e) {
            e && e.__textSvgEl && (e.__textSvgEl.parentNode && e.__textSvgEl.parentNode.removeChild(e.__textSvgEl), e.__textSvgEl = null, e.__tspanList = [], e.__text = null)
        }

        function ME() {
        }

        function OE(e, t) {
            for (var i = 0, n = t.length, a = 0, o = 0; i < n; i++) {
                var r = t[i];
                if (r.removed) {
                    for (s = [], l = o; l < o + r.count; l++) s.push(l);
                    r.indices = s, o += r.count
                } else {
                    for (var s = [], l = a; l < a + r.count; l++) s.push(l);
                    r.indices = s, a += r.count, r.added || (o += r.count)
                }
            }
            return t
        }

        IE.drawRectText = NE, IE.brush = function (e) {
            null != e.style.text ? NE(e, !1) : PE(e)
        }, ME.prototype = {
            diff: function (e, t, i) {
                i = i || function (e, t) {
                    return e === t
                }, this.equals = i;
                var n = this;
                e = e.slice();
                var a = (t = t.slice()).length, o = e.length, r = 1, s = a + o, l = [{newPos: -1, components: []}],
                    d = this.extractCommon(l[0], t, e, 0);
                if (l[0].newPos + 1 >= a && o <= d + 1) {
                    for (var u = [], c = 0; c < t.length; c++) u.push(c);
                    return [{indices: u, count: t.length}]
                }

                function h() {
                    for (var i = -1 * r; i <= r; i += 2) {
                        var s, d = l[i - 1], u = l[i + 1], c = (u ? u.newPos : 0) - i;
                        d && (l[i - 1] = void 0);
                        var h = d && d.newPos + 1 < a, f = u && 0 <= c && c < o;
                        if (h || f) {
                            if (!h || f && d.newPos < u.newPos ? (s = {
                                newPos: (g = u).newPos,
                                components: g.components.slice(0)
                            }, n.pushComponent(s.components, void 0, !0)) : ((s = d).newPos++, n.pushComponent(s.components, !0, void 0)), c = n.extractCommon(s, t, e, i), s.newPos + 1 >= a && o <= c + 1) return OE(0, s.components);
                            l[i] = s
                        } else l[i] = void 0
                    }
                    var g;
                    r++
                }

                for (; r <= s;) {
                    var f = h();
                    if (f) return f
                }
            }, pushComponent: function (e, t, i) {
                var n = e[e.length - 1];
                n && n.added === t && n.removed === i ? e[e.length - 1] = {
                    count: n.count + 1,
                    added: t,
                    removed: i
                } : e.push({count: 1, added: t, removed: i})
            }, extractCommon: function (e, t, i, n) {
                for (var a = t.length, o = i.length, r = e.newPos, s = r - n, l = 0; r + 1 < a && s + 1 < o && this.equals(t[r + 1], i[s + 1]);) r++, s++, l++;
                return l && e.components.push({count: l}), e.newPos = r, s
            }, tokenize: function (e) {
                return e.slice()
            }, join: function (e) {
                return e.slice()
            }
        };
        var FE = new ME;

        function LE(e, t, i, n, a) {
            this._zrId = e, this._svgRoot = t, this._tagNames = "string" == typeof i ? [i] : i, this._markLabel = n, this._domName = a || "_dom", this.nextId = 0
        }

        function BE(e, t) {
            LE.call(this, e, t, ["linearGradient", "radialGradient"], "__gradient_in_use__")
        }

        function UE(e, t) {
            LE.call(this, e, t, "clipPath", "__clippath_in_use__")
        }

        function RE(e, t) {
            LE.call(this, e, t, ["filter"], "__filter_in_use__", "_shadowDom")
        }

        function KE(e) {
            return e && (e.shadowBlur || e.shadowOffsetX || e.shadowOffsetY || e.textShadowBlur || e.textShadowOffsetX || e.textShadowOffsetY)
        }

        function WE(e) {
            return parseInt(e, 10)
        }

        function VE(e, t) {
            return t && e && t.parentNode !== e
        }

        function HE(e, t, i) {
            if (VE(e, t) && i) {
                var n = i.nextSibling;
                n ? e.insertBefore(t, n) : e.appendChild(t)
            }
        }

        function zE(e, t) {
            if (VE(e, t)) {
                var i = e.firstChild;
                i ? e.insertBefore(t, i) : e.appendChild(t)
            }
        }

        function jE(e, t) {
            t && e && t.parentNode === e && e.removeChild(t)
        }

        function GE(e) {
            return e.__textSvgEl
        }

        function $E(e) {
            return e.__svgEl
        }

        function XE(e, t, i, n) {
            this.root = e, this.storage = t, this._opts = i = k({}, i || {});
            var a = sE("svg");
            a.setAttribute("xmlns", "http://www.w3.org/2000/svg"), a.setAttribute("version", "1.1"), a.setAttribute("baseProfile", "full"), a.style.cssText = "user-select:none;position:absolute;left:0;top:0;";
            var o = sE("g");
            a.appendChild(o);
            var r = sE("g");
            a.appendChild(r), this.gradientManager = new BE(n, r), this.clipPathManager = new UE(n, r), this.shadowManager = new RE(n, r);
            var s = document.createElement("div");
            s.style.cssText = "overflow:hidden;position:relative", this._svgDom = a, this._svgRoot = r, this._backgroundRoot = o, this._viewport = s, e.appendChild(s), s.appendChild(a), this.resize(i.width, i.height), this._visibleList = []
        }

        LE.prototype.createElement = sE, LE.prototype.getDefs = function (e) {
            var t = this._svgRoot, i = this._svgRoot.getElementsByTagName("defs");
            return 0 === i.length ? e ? ((i = t.insertBefore(this.createElement("defs"), t.firstChild)).contains || (i.contains = function (e) {
                var t = i.children;
                if (!t) return !1;
                for (var n = t.length - 1; 0 <= n; --n) if (t[n] === e) return !0;
                return !1
            }), i) : null : i[0]
        }, LE.prototype.update = function (e, t) {
            if (e) {
                var i = this.getDefs(!1);
                if (e[this._domName] && i.contains(e[this._domName])) "function" == typeof t && t(e); else {
                    var n = this.add(e);
                    n && (e[this._domName] = n)
                }
            }
        }, LE.prototype.addDom = function (e) {
            this.getDefs(!0).appendChild(e)
        }, LE.prototype.removeDom = function (e) {
            var t = this.getDefs(!1);
            t && e[this._domName] && (t.removeChild(e[this._domName]), e[this._domName] = null)
        }, LE.prototype.getDoms = function () {
            var e = this.getDefs(!1);
            if (!e) return [];
            var t = [];
            return A(this._tagNames, function (i) {
                var n = e.getElementsByTagName(i);
                t = t.concat([].slice.call(n))
            }), t
        }, LE.prototype.markAllUnused = function () {
            var e = this.getDoms(), t = this;
            A(e, function (e) {
                e[t._markLabel] = "0"
            })
        }, LE.prototype.markUsed = function (e) {
            e && (e[this._markLabel] = "1")
        }, LE.prototype.removeUnused = function () {
            var e = this.getDefs(!1);
            if (e) {
                var t = this.getDoms(), i = this;
                A(t, function (t) {
                    "1" !== t[i._markLabel] && e.removeChild(t)
                })
            }
        }, LE.prototype.getSvgProxy = function (e) {
            return e instanceof wr ? SE : e instanceof qn ? bE : e instanceof Rr ? IE : SE
        }, LE.prototype.getTextSvgElement = function (e) {
            return e.__textSvgEl
        }, LE.prototype.getSvgElement = function (e) {
            return e.__svgEl
        }, b(BE, LE), BE.prototype.addWithoutUpdate = function (e, t) {
            if (t && t.style) {
                var i = this;
                A(["fill", "stroke"], function (n) {
                    if (t.style[n] && ("linear" === t.style[n].type || "radial" === t.style[n].type)) {
                        var a, o = t.style[n], r = i.getDefs(!0);
                        o._dom ? (a = o._dom, r.contains(o._dom) || i.addDom(a)) : a = i.add(o), i.markUsed(t);
                        var s = a.getAttribute("id");
                        e.setAttribute(n, "url(#" + s + ")")
                    }
                })
            }
        }, BE.prototype.add = function (e) {
            var t;
            if ("linear" === e.type) t = this.createElement("linearGradient"); else {
                if ("radial" !== e.type) return vi("Illegal gradient type."), null;
                t = this.createElement("radialGradient")
            }
            return e.id = e.id || this.nextId++, t.setAttribute("id", "zr" + this._zrId + "-gradient-" + e.id), this.updateDom(e, t), this.addDom(t), t
        }, BE.prototype.update = function (e) {
            var t = this;
            LE.prototype.update.call(this, e, function () {
                var i = e.type, n = e._dom.tagName;
                "linear" === i && "linearGradient" === n || "radial" === i && "radialGradient" === n ? t.updateDom(e, e._dom) : (t.removeDom(e), t.add(e))
            })
        }, BE.prototype.updateDom = function (e, t) {
            if ("linear" === e.type) t.setAttribute("x1", e.x), t.setAttribute("y1", e.y), t.setAttribute("x2", e.x2), t.setAttribute("y2", e.y2); else {
                if ("radial" !== e.type) return void vi("Illegal gradient type.");
                t.setAttribute("cx", e.x), t.setAttribute("cy", e.y), t.setAttribute("r", e.r)
            }
            e.global ? t.setAttribute("gradientUnits", "userSpaceOnUse") : t.setAttribute("gradientUnits", "objectBoundingBox"), t.innerHTML = "";
            for (var i = e.colorStops, n = 0, a = i.length; n < a; ++n) {
                var o = this.createElement("stop");
                o.setAttribute("offset", 100 * i[n].offset + "%");
                var r = i[n].color;
                if (r.indexOf(!1)) {
                    var s = Wt(r)[3], l = zt(r);
                    o.setAttribute("stop-color", "#" + l), o.setAttribute("stop-opacity", s)
                } else o.setAttribute("stop-color", i[n].color);
                t.appendChild(o)
            }
            e._dom = t
        }, BE.prototype.markUsed = function (e) {
            if (e.style) {
                var t = e.style.fill;
                t && t._dom && LE.prototype.markUsed.call(this, t._dom), (t = e.style.stroke) && t._dom && LE.prototype.markUsed.call(this, t._dom)
            }
        }, b(UE, LE), UE.prototype.update = function (e) {
            var t = this.getSvgElement(e);
            t && this.updateDom(t, e.__clipPaths, !1);
            var i = this.getTextSvgElement(e);
            i && this.updateDom(i, e.__clipPaths, !0), this.markUsed(e)
        }, UE.prototype.updateDom = function (e, t, i) {
            if (t && 0 < t.length) {
                var n, a, o = this.getDefs(!0), r = t[0], s = i ? "_textDom" : "_dom";
                r[s] ? (a = r[s].getAttribute("id"), n = r[s], o.contains(n) || o.appendChild(n)) : (a = "zr" + this._zrId + "-clip-" + this.nextId, ++this.nextId, (n = this.createElement("clipPath")).setAttribute("id", a), o.appendChild(n), r[s] = n);
                var l = this.getSvgProxy(r);
                if (r.transform && r.parent.invTransform && !i) {
                    var d = Array.prototype.slice.call(r.transform);
                    lt(r.transform, r.parent.invTransform, r.transform), l.brush(r), r.transform = d
                } else l.brush(r);
                var u = this.getSvgElement(r);
                n.innerHTML = "", n.appendChild(u.cloneNode()), e.setAttribute("clip-path", "url(#" + a + ")"), 1 < t.length && this.updateDom(n, t.slice(1), i)
            } else e && e.setAttribute("clip-path", "none")
        }, UE.prototype.markUsed = function (e) {
            var t = this;
            e.__clipPaths && A(e.__clipPaths, function (e) {
                e._dom && LE.prototype.markUsed.call(t, e._dom), e._textDom && LE.prototype.markUsed.call(t, e._textDom)
            })
        }, b(RE, LE), RE.prototype.addWithoutUpdate = function (e, t) {
            if (t && KE(t.style)) {
                var i;
                t._shadowDom ? (i = t._shadowDom, this.getDefs(!0).contains(t._shadowDom) || this.addDom(i)) : i = this.add(t), this.markUsed(t);
                var n = i.getAttribute("id");
                e.style.filter = "url(#" + n + ")"
            }
        }, RE.prototype.add = function (e) {
            var t = this.createElement("filter");
            return e._shadowDomId = e._shadowDomId || this.nextId++, t.setAttribute("id", "zr" + this._zrId + "-shadow-" + e._shadowDomId), this.updateDom(e, t), this.addDom(t), t
        }, RE.prototype.update = function (e, t) {
            if (KE(t.style)) {
                var i = this;
                LE.prototype.update.call(this, t, function () {
                    i.updateDom(t, t._shadowDom)
                })
            } else this.remove(e, t)
        }, RE.prototype.remove = function (e, t) {
            null != t._shadowDomId && (this.removeDom(e), e.style.filter = "")
        }, RE.prototype.updateDom = function (e, t) {
            var i = t.getElementsByTagName("feDropShadow");
            i = 0 === i.length ? this.createElement("feDropShadow") : i[0];
            var n, a, o, r, s = e.style, l = e.scale && e.scale[0] || 1, d = e.scale && e.scale[1] || 1;
            if (s.shadowBlur || s.shadowOffsetX || s.shadowOffsetY) n = s.shadowOffsetX || 0, a = s.shadowOffsetY || 0, o = s.shadowBlur, r = s.shadowColor; else {
                if (!s.textShadowBlur) return void this.removeDom(t, s);
                n = s.textShadowOffsetX || 0, a = s.textShadowOffsetY || 0, o = s.textShadowBlur, r = s.textShadowColor
            }
            i.setAttribute("dx", n / l), i.setAttribute("dy", a / d), i.setAttribute("flood-color", r);
            var u = o / 2 / l + " " + o / 2 / d;
            i.setAttribute("stdDeviation", u), t.setAttribute("x", "-100%"), t.setAttribute("y", "-100%"), t.setAttribute("width", Math.ceil(o / 2 * 200) + "%"), t.setAttribute("height", Math.ceil(o / 2 * 200) + "%"), t.appendChild(i), e._shadowDom = t
        }, RE.prototype.markUsed = function (e) {
            e._shadowDom && LE.prototype.markUsed.call(this, e._shadowDom)
        }, XE.prototype = {
            constructor: XE, getType: function () {
                return "svg"
            }, getViewportRoot: function () {
                return this._viewport
            }, getSvgDom: function () {
                return this._svgDom
            }, getSvgRoot: function () {
                return this._svgRoot
            }, getViewportRootOffset: function () {
                var e = this.getViewportRoot();
                if (e) return {offsetLeft: e.offsetLeft || 0, offsetTop: e.offsetTop || 0}
            }, refresh: function () {
                var e = this.storage.getDisplayList(!0);
                this._paintList(e)
            }, setBackgroundColor: function (e) {
                this._backgroundRoot && this._backgroundNode && this._backgroundRoot.removeChild(this._backgroundNode);
                var t = sE("rect");
                t.setAttribute("width", this.getWidth()), t.setAttribute("height", this.getHeight()), t.setAttribute("x", 0), t.setAttribute("y", 0), t.setAttribute("id", 0), t.style.fill = e, this._backgroundRoot.appendChild(t), this._backgroundNode = t
            }, _paintList: function (e) {
                this.gradientManager.markAllUnused(), this.clipPathManager.markAllUnused(), this.shadowManager.markAllUnused();
                var t, i, n = this._svgRoot, a = this._visibleList, o = e.length, r = [];
                for (t = 0; t < o; t++) {
                    var s = e[t], l = (i = s) instanceof wr ? SE : i instanceof qn ? bE : i instanceof Rr ? IE : SE,
                        d = $E(s) || GE(s);
                    s.invisible || (s.__dirty && (l && l.brush(s), this.clipPathManager.update(s), s.style && (this.gradientManager.update(s.style.fill), this.gradientManager.update(s.style.stroke), this.shadowManager.update(d, s)), s.__dirty = !1), r.push(s))
                }
                var u, c = function (e, t, i) {
                    return FE.diff(e, t, void 0)
                }(a, r);
                for (t = 0; t < c.length; t++) if ((g = c[t]).removed) for (var h = 0; h < g.count; h++) {
                    d = $E(s = a[g.indices[h]]);
                    var f = GE(s);
                    jE(n, d), jE(n, f)
                }
                for (t = 0; t < c.length; t++) {
                    var g;
                    if ((g = c[t]).added) for (h = 0; h < g.count; h++) d = $E(s = r[g.indices[h]]), f = GE(s), u ? HE(n, d, u) : zE(n, d), d ? HE(n, f, d) : u ? HE(n, f, u) : zE(n, f), HE(n, f, d), u = f || d || u, this.gradientManager.addWithoutUpdate(d || f, s), this.shadowManager.addWithoutUpdate(d || f, s), this.clipPathManager.markUsed(s); else if (!g.removed) for (h = 0; h < g.count; h++) d = $E(s = r[g.indices[h]]), f = GE(s), d = $E(s), f = GE(s), this.gradientManager.markUsed(s), this.gradientManager.addWithoutUpdate(d || f, s), this.shadowManager.markUsed(s), this.shadowManager.addWithoutUpdate(d || f, s), this.clipPathManager.markUsed(s), f && HE(n, f, d), u = d || f || u
                }
                this.gradientManager.removeUnused(), this.clipPathManager.removeUnused(), this.shadowManager.removeUnused(), this._visibleList = r
            }, _getDefs: function (e) {
                var t, i = this._svgDom;
                return 0 !== (t = i.getElementsByTagName("defs")).length ? t[0] : e ? ((t = i.insertBefore(sE("defs"), i.firstChild)).contains || (t.contains = function (e) {
                    var i = t.children;
                    if (!i) return !1;
                    for (var n = i.length - 1; 0 <= n; --n) if (i[n] === e) return !0;
                    return !1
                }), t) : null
            }, resize: function (e, t) {
                var i = this._viewport;
                i.style.display = "none";
                var n = this._opts;
                if (null != e && (n.width = e), null != t && (n.height = t), e = this._getSize(0), t = this._getSize(1), i.style.display = "", this._width !== e || this._height !== t) {
                    this._width = e, this._height = t;
                    var a = i.style;
                    a.width = e + "px", a.height = t + "px";
                    var o = this._svgDom;
                    o.setAttribute("width", e), o.setAttribute("height", t)
                }
                this._backgroundNode && (this._backgroundNode.setAttribute("width", e), this._backgroundNode.setAttribute("height", t))
            }, getWidth: function () {
                return this._width
            }, getHeight: function () {
                return this._height
            }, _getSize: function (e) {
                var t = this._opts, i = ["width", "height"][e], n = ["clientWidth", "clientHeight"][e],
                    a = ["paddingLeft", "paddingTop"][e], o = ["paddingRight", "paddingBottom"][e];
                if (null != t[i] && "auto" !== t[i]) return parseFloat(t[i]);
                var r = this.root, s = document.defaultView.getComputedStyle(r);
                return (r[n] || WE(s[i]) || WE(r.style[i])) - (WE(s[a]) || 0) - (WE(s[o]) || 0) | 0
            }, dispose: function () {
                this.root.innerHTML = "", this._svgRoot = this._backgroundRoot = this._svgDom = this._backgroundNode = this._viewport = this.storage = null
            }, clear: function () {
                this._viewport && this.root.removeChild(this._viewport)
            }, toDataURL: function () {
                return this.refresh(), "data:image/svg+xml;charset=UTF-8," + encodeURIComponent(this._svgDom.outerHTML.replace(/></g, ">\n\r<"))
            }
        }, A(["getLayer", "insertLayer", "eachLayer", "eachBuiltinLayer", "eachOtherLayer", "getLayers", "modLayer", "delLayer", "clearLayer", "pathToImage"], function (e) {
            XE.prototype[e] = function (e) {
                return function () {
                    vi('In SVG mode painter not support method "' + e + '"')
                }
            }(e)
        }), Ia("svg", XE), e.version = "4.8.0", e.dependencies = {zrender: "4.3.1"}, e.PRIORITY = Sh, e.init = function (e, t, i) {
            var n = df(e);
            if (n) return n;
            var a = new xh(e, t, i);
            return a.id = "ec_" + af++, tf[a.id] = a, ja(e, rf, a.id), function (e) {
                var t = "__connectUpdateStatus";

                function i(e, i) {
                    for (var n = 0; n < e.length; n++) e[n][t] = i
                }

                kh(Xh, function (n, a) {
                    e._messageCenter.on(a, function (n) {
                        if (nf[e.group] && 0 !== e[t]) {
                            if (n && n.escapeConnect) return;
                            var a = e.makeActionFromEvent(n), o = [];
                            kh(tf, function (t) {
                                t !== e && t.group === e.group && o.push(t)
                            }), i(o, 0), kh(o, function (e) {
                                1 !== e[t] && e.dispatchAction(a)
                            }), i(o, 2)
                        }
                    })
                })
            }(a), a
        }, e.connect = function (e) {
            if (O(e)) {
                var t = e;
                e = null, kh(t, function (t) {
                    null != t.group && (e = t.group)
                }), e = e || "g_" + of++, kh(t, function (t) {
                    t.group = e
                })
            }
            return nf[e] = !0, e
        }, e.disConnect = sf, e.disconnect = lf, e.dispose = function (e) {
            "string" == typeof e ? e = tf[e] : e instanceof xh || (e = df(e)), e instanceof xh && !e.isDisposed() && e.dispose()
        }, e.getInstanceByDom = df, e.getInstanceById = function (e) {
            return tf[e]
        }, e.registerTheme = uf, e.registerPreprocessor = cf, e.registerProcessor = hf, e.registerPostUpdate = function (e) {
            Jh.push(e)
        }, e.registerAction = ff, e.registerCoordinateSystem = gf, e.getCoordinateSystemDimensions = function (e) {
            var t = iu.get(e);
            if (t) return t.getDimensionsInfo ? t.getDimensionsInfo() : t.dimensions.slice()
        }, e.registerLayout = pf, e.registerVisual = vf, e.registerLoading = yf, e.extendComponentModel = kf, e.extendComponentView = Tf, e.extendSeriesModel = wf, e.extendChartView = Cf, e.setCanvasCreator = function (e) {
            p("createCanvas", e)
        }, e.registerMap = function (e, t, i) {
            vh.registerMap(e, t, i)
        }, e.getMap = function (e) {
            var t = vh.retrieveMap(e);
            return t && t[0] && {geoJson: t[0].geoJSON, specialAreas: t[0].specialAreas}
        }, e.dataTool = {}, e.zrender = Aa, e.number = $l, e.format = ud, e.throttle = Sc, e.helper = fp, e.matrix = gt, e.vector = Ie, e.color = Zt, e.parseGeoJSON = kp, e.parseGeoJson = Np, e.util = Ep, e.graphic = Pp, e.List = Kf, e.Model = Sl, e.Axis = Dp, e.env = a
    }(t)
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(391), a = i(220);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    i(653);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, "68373646", null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\task-detail\\components\\tabs\\TaskChart.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    t.BSpline = class {
        constructor({points: e = [], degree: t = 4, tessellation: i = 10}) {
            e.length >= 2 ? this.points = [this.getExtendPoint(e[0], e[1]), ...e, this.getExtendPoint(e[e.length - 1], e[e.length - 2])] : this.points = e, this.degree = t, this.tessellation = i, this.curvePoints = [], this.knotVector = [], this.uniformRender()
        }

        getExtendPoint(e, t) {
            return {x: t.x - 2 * (t.x - e.x), y: t.y - 2 * (t.y - e.y)}
        }

        uniformRender() {
            if (this.createKnots(), this.points.length < 2) return;
            let e = 1 / this.tessellation;
            for (let t = this.knotVector[this.degree]; t < this.knotVector[this.knotVector.length - this.degree - 1]; t += e) {
                let e = this.deBoor(t);
                this.curvePoints.push(e)
            }
            let t = this.deBoor(this.knotVector[this.knotVector.length - this.degree - 1]);
            this.curvePoints.push(t)
        }

        createKnots() {
            if (this.knotVector = [], this.points.length >= 2) {
                let e = this.degree + this.points.length + 1, t = 1 / (e - 1);
                for (let i = 0; i < e; i++) this.knotVector.push(i * t)
            }
        }

        deBoor(e) {
            let t = 0, i = 0;
            for (let n = 0; n < this.points.length; n++) {
                let a = this.basisFunction(n, this.degree, e);
                a > 0 && (t += this.points[n].x * a, i += this.points[n].y * a)
            }
            return [t, i]
        }

        basisFunction(e, t, i) {
            if (0 === t) return this.knotVector[e] <= i && i < this.knotVector[e + 1] ? 1 : 0;
            let n = (i - this.knotVector[e]) / (this.knotVector[e + t] - this.knotVector[e]),
                a = (this.knotVector[e + t + 1] - i) / (this.knotVector[e + t + 1] - this.knotVector[e + 1]);
            return n * this.basisFunction(e, t - 1, i) + a * this.basisFunction(e + 1, t - 1, i)
        }
    }
}, function (e, t, i) {
    "use strict";
    var n = i(789);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(377), a = i(222);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\task-detail\\components\\XlHeader.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(378), a = i(224);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\task-detail\\pages\\XlDetail.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(379), a = i(226);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    i(657);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, "93d3b760", null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\task-detail\\pages\\FileList.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    var n = i(791);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(380), a = i(228);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\task-detail\\pages\\multi-chosen-tasks.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(392), a = i(230);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\task-detail\\components\\multi-chosen-item.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    var n = i(793);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(232);
    for (var a in n) "default" !== a && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(a);
    var o = i(1), r = Object(o.a)(n.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\download-list-container.vue", t.default = r.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(362), a = i(234);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\download-list.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(238);
    for (var a in n) "default" !== a && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(a);
    var o = i(1), r = Object(o.a)(n.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\task-items\\downloading-item-container.vue", t.default = r.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(393), a = i(240);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\task-items\\downloading-item.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(450), o = i(666), r = i(0), s = i(42), l = i(65), d = r.default.getLogger("Thunder.QueryTaskInfo");
    const u = new class extends a.HttpSession {
        constructor() {
            super(), this.lastActiveTaskId = -1, this.curBatchQueryId = void 0, this.timerId = null
        }

        queryP2spTaskInfo(e) {
            return n(this, void 0, void 0, function* () {
                return s.Common.isThunderPrivateUrl(e) && (e = s.Common.parseThunderPrivateUrl(e)), 0 === e.indexOf("ed2k://") && -1 === e.indexOf("|") && (e = e.replace(/%7C/g, "|")), new Promise(t => {
                    this.queryResInfo("url", e).then(e => {
                        let i = {result: 0, gcid: "", fileSize: 0, errCode: 0};
                        e && 200 === e.status && null !== e.data && null !== e.data.result && "ok" === e.data.result && "" !== e.data.gcid ? (i.result = e.data.code, i.fileSize = e.data.file_size, i.gcid = e.data.gcid, t(i)) : t(null)
                    }).catch(() => {
                        t(null)
                    })
                })
            })
        }

        asyncBatchQueryP2spTaskInfoByUrl(e, t, i) {
            return n(this, void 0, void 0, function* () {
                if (!e || 0 === e.length) return 0;
                void 0 === this.curBatchQueryId ? this.curBatchQueryId = 1 : this.curBatchQueryId += 1;
                let n = 0;
                for (; n < e.length; ++n) {
                    let i = yield this.queryP2spTaskInfo(e[n]);
                    i && t(e[n], i, n), yield this.delay(200)
                }
                return n >= e.length && i && "function" == typeof i && i(this.curBatchQueryId), this.curBatchQueryId
            })
        }

        postRequestEd2kTaskInfoByEd2kLink(e) {
            return s.Common.isThunderPrivateUrl(e) && (e = s.Common.parseThunderPrivateUrl(e)), new Promise(t => {
                this.host = "hub5idx.shub.sandai.net", this.port = 80, this.retries = 1, this.timeout = 15e3, this.body = o.QueryTaskInfoPackageNS.createQueryEd2kTaskInfoBuffer(e), this.post(e => {
                    let i = null;
                    200 === e.statusCode && e.body && e.body.length > 12 && (i = o.QueryTaskInfoPackageNS.praseEd2kTaskInfoBuffer(e.body)), d.information("postRequestEd2kTaskInfoByEd2kLink", i), t(i)
                }, e => {
                    d.error("postRequestEd2kTaskInfoByEd2kLink", e), t(null)
                })
            })
        }

        delay(e) {
            return n(this, void 0, void 0, function* () {
                return new Promise(t => {
                    setTimeout(t, e)
                })
            })
        }

        queryResInfo(e, t) {
            return n(this, void 0, void 0, function* () {
                return l.fetchPCRes({url: "/xlppc.resinfo.api/v1/queryresinfo", data: {type: e, res: t}}, "prod")
            })
        }
    };
    !function (e) {
        e.postRequestEd2kTaskInfoByEd2kLink = function (e) {
            return n(this, void 0, void 0, function* () {
                return u.postRequestEd2kTaskInfoByEd2kLink(e)
            })
        }, e.asyncBatchQueryP2spTaskInfoByUrl = function (e, t, i) {
            return n(this, void 0, void 0, function* () {
                return u.asyncBatchQueryP2spTaskInfoByUrl(e, t, i)
            })
        }, e.queryResInfo = function (e, t) {
            return n(this, void 0, void 0, function* () {
                return u.queryResInfo(e, t)
            })
        }
    }(t.QueryTaskInfoHelperNS || (t.QueryTaskInfoHelperNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(2), a = i(6), o = i(667), r = i(668), s = i(0).default.getLogger("Thunder.QueryTaskInfoPackage"),
        l = a.default(n.join(__rootDir, "../bin/ThunderHelper.node"));
    !function (e) {
        let t = 0;

        function i() {
            let e = 0, t = n.join(__rootDir, "../../Thunder.exe"), i = l.getFileVersion(t).split(".");
            if (i && 4 === i.length) {
                e = 26 * Number(i[0]).valueOf() + 18 * Number(i[1]).valueOf() + Number(i[3]).valueOf()
            }
            return e
        }

        function a() {
            return l.getPeerID()
        }

        e.createQueryP2spTaskInfoBuffer = function (e) {
            let n = 0, l = Buffer.alloc(10240);
            return s.information("createQueryP2spTaskInfoBuffer protocolVersion", 61, n), n = l.writeUInt32LE(61, n), s.information("createQueryP2spTaskInfoBuffer sequence", t, n), n = l.writeUInt32LE(++t, n), s.information("createQueryP2spTaskInfoBuffer command length", "0", n), n = l.writeUInt32LE(0, n), s.information("createQueryP2spTaskInfoBuffer thunder ver", i(), n), n = l.writeUInt32LE(i(), n), s.information("createQueryP2spTaskInfoBuffer compress flag", "0", n), n = l.writeUInt16LE(0, n), s.information("createQueryP2spTaskInfoBuffer reserved", "0", n), n = r.BufferUtilitiesNS.writeString(l, "", n, "utf-8"), s.information("createQueryP2spTaskInfoBuffer command", "2021", n), n = l.writeUInt16LE(2021, n), s.information("createQueryP2spTaskInfoBuffer by what", "2", n), n = l.writeUInt8(2, n), s.information("createQueryP2spTaskInfoBuffer body length", "0", n), n = l.writeUInt32LE(0, n), s.information("createQueryP2spTaskInfoBuffer url", e, n), n = r.BufferUtilitiesNS.writeString(l, e, n, "utf-8"), s.information("createQueryP2spTaskInfoBuffer code", "-1", n), n = l.writeInt32LE(-1, n), s.information("createQueryP2spTaskInfoBuffer", "origin url", n), n = r.BufferUtilitiesNS.writeString(l, "", n, "utf-8"), s.information("createQueryP2spTaskInfoBuffer code", "-1", n), n = l.writeInt32LE(-1, n), s.information("createQueryP2spTaskInfoBuffer", "refurl", n), n = r.BufferUtilitiesNS.writeString(l, "", n, "utf-8"), s.information("createQueryP2spTaskInfoBuffer code", "-1", n), n = l.writeInt32LE(-1, n), s.information("createQueryP2spTaskInfoBuffer", a(), n), n = r.BufferUtilitiesNS.writeString(l, a(), n, "utf-8"), s.information("createQueryP2spTaskInfoBuffer", "ip", n), n = l.writeInt32LE(0, n), n = l.writeInt32LE(0, n), n = l.writeInt32LE(-1, n), n = l.writeInt32LE(-1, n), s.information("createQueryP2spTaskInfoBuffer", "length", n), l = l.slice(0, n), s.information("createQueryP2spTaskInfoBuffer", l), l = o.ShubCryptoNS.encryptHttpBuffer(l)
        }, e.praseP2spTaskInfoBuffer = function (e) {
            let t = {result: 0, gcid: "", fileSize: 0, errCode: 0};
            try {
                e = o.ShubCryptoNS.decryptHttpBuffer(e);
                let i = 0, n = e.readUInt32LE(i);
                s.information("protocolVersion:", n), i += 4;
                let a = e.readUInt32LE(i);
                s.information("sequence:", a), i += 4;
                let l = e.readUInt32LE(i);
                s.information("commandLegth:", l), i += 4;
                let d = e.readUInt32LE(i);
                s.information("thunderVersion:", d), i += 4;
                let u = e.readUInt16LE(i);
                s.information("compressFlag:", u), i += 2, i = r.BufferUtilitiesNS.readString(e, i, "utf-8")[0];
                let c = e.readUInt16LE(i);
                if (s.information("commandType:", c), i += 2, t.result = e.readUInt8(i), i += 1, 1 === t.result) {
                    i = r.BufferUtilitiesNS.readString(e, i, "hex")[0];
                    let n = r.BufferUtilitiesNS.readUInt64LE(e, i);
                    i = n[0], t.fileSize = n[1];
                    let a = r.BufferUtilitiesNS.readString(e, i, "hex");
                    i = a[0], t.gcid = a[1].toUpperCase(), s.information("gcid", a[1])
                } else t.errCode = e.readUInt32LE(i);
                s.information("praseTaskInfoBuffer", t)
            } catch (e) {
                s.error("decryptHttpBuffer", e)
            }
            return t
        }, e.createQueryEd2kTaskInfoBuffer = function (e) {
            let n = 0, d = Buffer.alloc(4096);
            s.information("createQueryEd2kTaskInfoBuffer protocolVersion", 60, n), n = d.writeUInt32LE(60, n), s.information("createQueryEd2kTaskInfoBuffer sequence", t, n), n = d.writeUInt32LE(++t, n), s.information("createQueryEd2kTaskInfoBuffer command length", "0", n), n = d.writeUInt32LE(0, n), s.information("createQueryEd2kTaskInfoBuffer thunder ver", i(), n), n = d.writeUInt32LE(i(), n), s.information("createQueryEd2kTaskInfoBuffer compress flag", "0", n), n = d.writeUInt16LE(0, n), s.information("createQueryEd2kTaskInfoBuffer reserved", "0", n), n = r.BufferUtilitiesNS.writeString(d, "", n, "utf-8"), s.information("createQueryEd2kTaskInfoBuffer command", "5001", n), n = d.writeUInt16LE(5001, n), s.information("createQueryEd2kTaskInfoBuffer", a(), n), n = r.BufferUtilitiesNS.writeString(d, a(), n, "utf-8");
            let u = l.parseEd2kUrl(e), c = u.fileHash;
            n = d.writeInt32LE(c.length / 2, n);
            let h = 0, f = 0;
            for (let e = 0; e < c.length; e += 2) h = parseInt(c.charAt(e), 16), f = parseInt(c.charAt(e + 1), 16), n = d.writeUInt8(h << 4 | f, n);
            return n = r.BufferUtilitiesNS.writeUInt64LE(d, u.fileSize, n), n = d.writeInt32LE(0, n), n = r.BufferUtilitiesNS.writeString(d, "", n, "utf-8"), n = d.writeInt32LE(0, n), n = r.BufferUtilitiesNS.writeString(d, e, n, "utf-8"), d = d.slice(0, n), s.information("createQueryEd2kTaskInfoBuffer before encrypt", d, n), d = o.ShubCryptoNS.encryptHttpBuffer(d)
        }, e.praseEd2kTaskInfoBuffer = function (e) {
            let t = {result: 0, hasRecord: 0, gcid: ""};
            try {
                e = o.ShubCryptoNS.decryptHttpBuffer(e), s.information("praseEd2kTaskInfoBuffer buffer", e);
                let i = 0, n = e.readUInt32LE(i);
                s.information("protocolVersion:", n), i += 4;
                let a = e.readUInt32LE(i);
                s.information("sequence:", a), i += 4;
                let l = e.readUInt32LE(i);
                s.information("commandLegth:", l), i += 4;
                let d = e.readUInt32LE(i);
                s.information("thunderVersion:", d), i += 4;
                let u = e.readUInt16LE(i);
                s.information("compressFlag:", u), i += 2, i = r.BufferUtilitiesNS.readString(e, i, "utf-8")[0];
                let c = e.readUInt16LE(i);
                if (s.information("commandType:", c), i += 2, t.result = e.readUInt8(i), i += 1, 1 === t.result && (t.hasRecord = e.readInt32LE(i), i += 4, 1 === t.hasRecord)) {
                    i = r.BufferUtilitiesNS.readString(e, i, "utf-8")[0], i = r.BufferUtilitiesNS.readString(e, i, "utf-8")[0], i = r.BufferUtilitiesNS.readString(e, i, "hex")[0];
                    let n = r.BufferUtilitiesNS.readString(e, i, "hex");
                    i = n[0], t.gcid = n[1].toUpperCase()
                }
                s.information("praseTaskInfoBuffer", t)
            } catch (e) {
                s.error("decryptHttpBuffer", e)
            }
            return s.information("praseEd2kTaskInfoBuffer response", t), t
        }
    }(t.QueryTaskInfoPackageNS || (t.QueryTaskInfoPackageNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(400), a = i(410), o = i(75), r = i(34), s = i(0).default.getLogger("Thunder.shub-http.shub-crypto");
    !function (e) {
        function t(e) {
            let t = o.createHash("md5");
            return t.update(e), t.digest()
        }

        e.encryptHttpBuffer = function (e) {
            if (0 !== e.readUInt16LE(16)) {
                let t = n.Buffer.alloc(20);
                e.copy(t, 0, 0, 20);
                let i = n.Buffer.alloc(e.length - 20);
                e.copy(i, 0, 20);
                let o = a.deflateSync(i);
                e = n.Buffer.concat([t, o])
            }
            let i = n.Buffer.alloc(8);
            e.copy(i, 0, 0, 7), i = t(i);
            let o = n.Buffer.alloc(12);
            e.copy(o, 0, 0, 11);
            let s = n.Buffer.alloc(e.length - 12);
            e.copy(s, 0, 12), s = r.ToolsUtilitiesAWNS.encryptBuffer(s, i);
            let l = n.Buffer.concat([o, s]);
            return l.writeUInt32LE(s.length, 8), l
        }, e.decryptHttpBuffer = function (e) {
            let i = null;
            try {
                let o = n.Buffer.alloc(8);
                e.copy(o, 0, 0, 7), o = t(o);
                let l = n.Buffer.alloc(12);
                e.copy(l, 0, 0, 11);
                let d = n.Buffer.alloc(e.length - 12);
                if (e.copy(d, 0, 12), d = r.ToolsUtilitiesAWNS.decryptBuffer(d, o), 0 !== (i = n.Buffer.concat([l, d])).readUInt16LE(16)) {
                    let e = n.Buffer.alloc(20);
                    i.copy(e, 0, 0, 20);
                    let t = n.Buffer.alloc(i.length - 20);
                    i.copy(t, 0, 20);
                    let o = a.inflateSync(t);
                    i = n.Buffer.concat([e, o])
                }
            } catch (e) {
                s.error("decryptHttpBuffer", e)
            }
            return i
        }
    }(t.ShubCryptoNS || (t.ShubCryptoNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(2), a = i(6).default(n.join(__rootDir, "../bin/ThunderHelper.node"));
    !function (e) {
        e.writeUInt64LE = function (e, t, i) {
            const n = ~~(t / 4294967295), a = t % 4294967295 - n;
            return i = e.writeUInt32LE(a, i), i = e.writeUInt32LE(n, i)
        }, e.writeString = function (e, t, i, n) {
            let o = null;
            if ("gbk" === n) {
                let e = 936, i = a.utf8StringEncodeToBinary(t, e);
                o = Buffer.from(i, "binary")
            } else o = Buffer.from(t, n);
            return (i = e.writeUInt32LE(o.byteLength, i)) + o.copy(e, i, 0)
        }, e.readUInt64LE = function (e, t) {
            let i = e.readUInt32LE(t);
            t += 4;
            let n = e.readUInt32LE(t);
            return [t += 4, n * Math.pow(2, 32) + i]
        }, e.readString = function (e, t, i) {
            let n = e.readUInt32LE(t);
            t += 4;
            let o = void 0;
            if ("gbk" === i) {
                let i = 936, r = e.toString("binary", t, t + n);
                o = a.utf8StringDecodeFromBinary(r, i)
            } else o = e.toString(i, t, t + n);
            return [t += n, o]
        }
    }(t.BufferUtilitiesNS || (t.BufferUtilitiesNS = {}))
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(396), a = i(242);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\task-items\\item-vip-expand\\item-vip-speed-plugin.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(244);
    for (var a in n) "default" !== a && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(a);
    var o = i(1), r = Object(o.a)(n.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\task-items\\completed-item-container.vue", t.default = r.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(394), a = i(246);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\task-items\\completed-item.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(248);
    for (var a in n) "default" !== a && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(a);
    var o = i(1), r = Object(o.a)(n.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\task-items\\recycle-item-container.vue", t.default = r.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(395), a = i(250);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\task-items\\recycle-item.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    var n = i(795);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(252);
    for (var a in n) "default" !== a && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(a);
    var o = i(1), r = Object(o.a)(n.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\private-space-open-page-container.vue", t.default = r.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(363), a = i(254);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\private-space-open-page.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(256);
    for (var a in n) "default" !== a && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(a);
    var o = i(1), r = Object(o.a)(n.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\download-search-container.vue", t.default = r.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(364), a = i(258);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\download-panel\\download-list-search.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(260);
    for (var a in n) "default" !== a && function (e) {
        i.d(t, e, function () {
            return n[e]
        })
    }(a);
    var o = i(1), r = Object(o.a)(n.default, void 0, void 0, !1, null, null, null);
    r.options.__file = "src\\main-renderer\\views\\main-body\\find-page\\setting-center-view\\index-container.vue", t.default = r.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(349), a = i(262);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    i(694);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\main-renderer\\views\\main-body\\find-page\\setting-center-view\\index.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(353), a = i(264);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    i(693);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, "69ad46c4", null);
    s.options.__file = "src\\common\\generator-view\\generator-view.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(365), a = i(266);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\common\\generator-view\\conf-component\\conf-checkbox.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(433);
    !function (e) {
        e.setStyle = function (e, t) {
            return n(this, void 0, void 0, function* () {
                if (null !== e) {
                    const {WindowPreferenceNS: n} = yield Promise.resolve().then(() => i(435));
                    let o = {windowPreference: n.getWindowPreference()};
                    e.setStyle(a(o, t))
                }
            })
        }
    }(t.DropDownWindowSkinNS || (t.DropDownWindowSkinNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = i(797);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(384), a = i(280);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\common\\generator-view\\conf-component\\conf-speed.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(385), a = i(282);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\common\\generator-view\\conf-component\\conf-speed-time.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(371), a = i(286);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\common\\generator-view\\conf-component\\conf-radio.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(386), a = i(288);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\common\\generator-view\\conf-component\\conf-container.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(372), a = i(290);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\common\\generator-view\\conf-component\\conf-checkinput.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(373), a = i(292);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\common\\generator-view\\conf-component\\conf-checkselect.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(374), a = i(294);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\common\\generator-view\\conf-component\\conf-textarea.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    i.r(t);
    var n = i(375), a = i(296);
    for (var o in a) "default" !== o && function (e) {
        i.d(t, e, function () {
            return a[e]
        })
    }(o);
    var r = i(1), s = Object(r.a)(a.default, n.a, n.b, !1, null, null, null);
    s.options.__file = "src\\common\\generator-view\\conf-component\\conf-proxy-list.vue", t.default = s.exports
}, function (e, t, i) {
    "use strict";
    var n = i(799);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(801);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(803);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(805);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(813);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(815);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(819);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(822);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(825);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(827);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(829);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(832);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(835);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(838);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(840);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(843);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(845);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(847);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(849);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(851);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(854);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(856);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(860);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(864);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(867);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(869);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = i(871);
    i.n(n).a
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(12), o = i(5), r = i(7), s = i(83);
    !function (e) {
        function t(e, t) {
            return n(this, void 0, void 0, function* () {
                if (null !== e) {
                    let i = e.webContents;
                    (yield i.isDevToolsOpened()) ? yield i.closeDevTools() : yield i.openDevTools(t)
                }
            })
        }

        e.openDevTool = t, e.enableDevTools = function (e) {
            return n(this, void 0, void 0, function* () {
                window.addEventListener("keyup", i => n(this, void 0, void 0, function* () {
                    "F12" === i.key && i.ctrlKey && (yield s.DevEnvHelperNS.isLogEnable()) && (yield t(yield a.asyncRemoteCall.getCurrentWindow(), e))
                }), !0)
            })
        }, e.enableDragOpenFile = function (e) {
            void 0 === e && (e = !1), document.addEventListener("dragover", e => (e.preventDefault(), e.stopPropagation(), !1), !0), document.addEventListener("drop", e => n(this, void 0, void 0, function* () {
                e.preventDefault(), e.stopPropagation();
                let t = e.dataTransfer, i = t.files, n = t.items;
                if (void 0 !== n && null !== n && n.length > 0) for (let e = 0; e < n.length; e++) {
                    let t = n[e];
                    "string" === t.kind && "text/uri-list" === t.type ? t.getAsString(e => {
                        r.client.callServerFunction("DropOpenUrl", e).catch()
                    }) : t.kind
                }
                if (void 0 !== i && null !== i && i.length > 0) for (let e = 0; e < i.length; e++) {
                    let t = i[e].path;
                    void 0 !== t && null !== t && "" !== t && (yield o.FileSystemAWNS.existsAW(t)) && r.client.callServerFunction("DropOpenFile", t).catch()
                }
                return !1
            }), !0)
        }
    }(t.ThunderToolsNS || (t.ThunderToolsNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(12), r = i(44), s = i(0), l = i(6), d = i(42), u = i(3), c = i(10), h = i(38), f = i(35),
        g = i(69), p = i(72), v = i(78), m = l.default(a.join(__rootDir, "../bin/ThunderHelper.node"));

    class y {
        static getInstance() {
            return null === y.instance && (y.instance = new y), y.instance
        }
    }

    y.instance = null, function (e) {
        const t = ["http://", "https://", "ftp://"], i = "thunder://", l = "ed2k://", k = "magnet:?",
            T = [i, "thunders://", l, k];
        let w = !1;
        const C = s.default.getLogger("ClipBoardNS");

        function S(e) {
            let i = !1;
            if (e) for (let n = 0; n < t.length; ++n) {
                let a = t[n];
                if (0 === e.indexOf(a)) {
                    i = !0;
                    break
                }
            }
            return i
        }

        function b(e) {
            let t = !1;
            if (e) for (let i = 0; i < T.length; ++i) {
                let n = T[i];
                if (0 === e.indexOf(n)) {
                    t = !0;
                    break
                }
            }
            return t
        }

        function I(e) {
            let t = !1;
            return e && (t = 0 === e.indexOf(l)), t
        }

        function _(e) {
            let t = !1;
            return e && (t = 0 === e.indexOf(k)), t
        }

        function A(e, t) {
            let i = !1;
            do {
                if (!e) break;
                t.indexOf(e) > -1 && (i = !0)
            } while (0);
            return i
        }

        function D(e) {
            let t = !1;
            do {
                if (void 0 === e || null === e || "" === e) break;
                let i = "thunderx://";
                if (void 0 === (e = e.trim()) || null === e || "" === e) break;
                0 === e.indexOf(i, 0) && (t = !0)
            } while (0);
            return t
        }

        function x(e) {
            let t = "", i = (e = e.trim()).substring("thunderx://".length), n = i.lastIndexOf("}");
            return n > 0 && (t = i.substring(0, n + 1)), t
        }

        function N(e) {
            let t = e, i = e.substr(k.length).split("&");
            for (let n = 0; n < i.length; ++n) {
                let a = i[n].indexOf("=");
                if (a < 0) continue;
                let o = i[n].substr(0, a);
                if ("xt" === o || 0 === o.indexOf("xt.")) {
                    const o = "urn:btih:";
                    if (i[n].substr(a + 1, o.length) !== o) break;
                    let r = i[n].substr(a + o.length + 1);
                    if (r.length <= 32) break;
                    let s = /[0-9,A-Z,a-z]{40}/;
                    if (s.test(r)) {
                        r.length > 40 && "&" !== r[40] && (C.information("reg test 40"), r = r.substr(0, 40), (a = e.indexOf(r)) >= 0 && (t = e.substr(0, a + r.length))), C.information("urlOut", t, e);
                        break
                    }
                    if ((s = /[0-9,A-Z,a-z]{32}/).test(r)) {
                        "&" !== r[32] && (C.information("reg test 32"), r = r.substr(0, 32), (a = e.indexOf(r)) >= 0 && (t = e.substr(0, a + r.length))), C.information("urlOut", t, e);
                        break
                    }
                }
            }
            return t
        }

        function E(e) {
            let t = e;
            if (e) {
                let n = /[^A-Za-z0-9=\/\+]/g;
                n.lastIndex = i.length, n.exec(e) && (t = e.substr(0, n.lastIndex - 1), C.information("urlOut", t, e))
            }
            return t
        }

        function P(e) {
            let t = e;
            if (e) {
                let i = /\|\//g;
                i.lastIndex = l.length, i.exec(e) && (t = e.substr(0, i.lastIndex), C.information("urlOut", t, e))
            }
            return t
        }

        function M(e, t, i) {
            let n = !0, a = t[0];
            return i - a.length >= 3 && 0 === a.indexOf("http") && "&tr=" === e.substr(i - a.length - "&tr=".length, "&tr=".length) && (n = !1), n
        }

        function O(e) {
            let t = [];
            if (e) {
                let i = function (e) {
                    let t = [], i = /(https?|ftp|thunder|ed2k|magnet):/g, n = i.exec(e), a = -1;
                    for (; n;) {
                        if (M(e, n, i.lastIndex)) {
                            let o = a, r = n[0];
                            a = i.lastIndex - r.length, o >= 0 && t.push(e.substr(o, a - o))
                        }
                        (n = i.exec(e)) || t.push(e.substr(a))
                    }
                    return t
                }(e);
                if (C.information("splitTextByProtocal", i), 1 === i.length) {
                    let e = i[0];
                    _(e) ? e = N(e) : d.Common.isThunderPrivateUrl(e) ? e = E(e) : I(e) && (e = P(e)), t.push(e)
                } else i.forEach(e => {
                    _(e = function (e) {
                        let t = e;
                        if (e) {
                            let i = /[ ,\r,\n]/g;
                            i.exec(e) && (t = e.substr(0, i.lastIndex - 1), C.information("urlOut", t, e))
                        }
                        return t
                    }(e = e.trim())) ? e = N(e) : d.Common.isThunderPrivateUrl(e) ? e = E(e) : I(e) ? e = P(e) : S(e) && (e = function (e) {
                        let t = e;
                        if (e) {
                            let i = v.BHOConfigNS.getValue("Monitor", "ExtendNames", v.BHOConfigNS.getDefaultExtendNames()).split(";");
                            i.sort((e, t) => t.length - e.length), C.information("extendNamesArr", i);
                            let n = -1;
                            for (let t = 0; t < i.length; ++t) {
                                if (i[t].length <= 0) continue;
                                let a = e.lastIndexOf(i[t]);
                                C.information("index", a, "endIndex", n, "ext", i[t]), a >= 0 && a >= n && (n = a + i[t].length)
                            }
                            n >= 0 && (t = e.substr(0, n), C.information("urlOut", t, e))
                        }
                        return t
                    }(e)), C.information("validUrl", e), t.push(e)
                })
            }
            return t
        }

        function F(e, t) {
            return n(this, void 0, void 0, function* () {
                if (w) {
                    if (w = !1, !(yield(yield o.asyncRemoteCall.getCurrentWindow()).isVisible())) return
                }
                let i = [], n = c.ConfigNS.getValue("Monitor", "MonitorClipBoard", !0);
                do {
                    if (!n) {
                        C.information("notwatch");
                        break
                    }
                    let o = t.join("");
                    if (C.information("textList", t), p.URLHelperNS.isBirdKey(o) && (C.information("isbirdkey"), g.openBirdKeyDecodeDialog(o, {from: "clipboard"}, m)), C.information("attachClipBoardCallback type:", e, t), null !== t && void 0 !== t && t.length > 0) {
                        let e = t.join("");
                        if (D(e)) {
                            let t = x(e);
                            h.ThunderNewTask.createThunderxTask(t).catch();
                            break
                        }
                    }
                    let s = v.BHOConfigNS.getValue("Monitor", "ExtendNames", v.BHOConfigNS.getDefaultExtendNames()),
                        l = v.BHOConfigNS.getValue("Monitor", "WatchTraditionLink", 1),
                        c = v.BHOConfigNS.getValue("Monitor", "ConfigWatch_Bt", 1),
                        y = v.BHOConfigNS.getValue("EMuleGenericSettings", "EMuleWatchLink", 1),
                        k = v.BHOConfigNS.getValue("MagnetGenericSettings", "MagnetWatchLink", 1), T = new Map;
                    for (let e = 0; e < t.length; ++e) {
                        let i = t[e];
                        i && O(i).forEach(e => {
                            T.set(e, !0)
                        })
                    }
                    T.forEach((e, t) => {
                        if (!t) return;
                        let n = t;
                        if (d.Common.isThunderPrivateUrl(t) && (t = d.Common.parseThunderPrivateUrl(t)), !S(t) && !b(t)) return void C.information("isVaildUrl && isVaildUrl url:", t);
                        let o = f.ThunderHelper.getTaskTypeFromUrl(t);
                        if (o === u.DownloadKernel.TaskType.P2sp) {
                            if (0 === l && 0 === c) return void C.information("taskType: P2sp, watchTraditionLink === 0 && watchBtLink === 0");
                            let e = r.parse(t);
                            if (null === e) return;
                            let o = a.extname(e.pathname);
                            if (o && (o = o.toLowerCase()), 0 !== l && A(o, s)) C.information("valid watchTraditionLink"); else {
                                if (0 === c || ".torrent" !== o) return void C.information("invalid ext:", o);
                                C.information("valid watchBtLink")
                            }
                            -1 !== n.indexOf("(*)") || i.includes(n, 0) || i.push(n)
                        } else if (o === u.DownloadKernel.TaskType.Emule) {
                            if (0 === y) return void C.information("taskType: Emule, watchBtLink === 0");
                            -1 !== n.indexOf("(*)") || i.includes(n, 0) || i.push(n)
                        } else if (o === u.DownloadKernel.TaskType.Magnet || o === u.DownloadKernel.TaskType.Bt) {
                            if (0 === k) return void C.information("taskType: Magnet, watchMagnetLink === 0");
                            h.ThunderNewTask.createBtTaskWindow({url: n, type: "url"}, {source: "clipboard"})
                        }
                    })
                } while (0);
                i.length > 0 && h.ThunderNewTask.createPreNewTaskWindow(i, "clipboard")
            })
        }

        e.init = function (e) {
            w = e, m.initClipBoard(), setTimeout(() => {
                m.attachClipBoard(F)
            }, 1e3)
        }, e.getOperInfoInstance = function () {
            return y.getInstance()
        }
    }(t.ClipBoardNS || (t.ClipBoardNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(0), o = i(17), r = i(12), s = i(2), l = i(5), d = i(14), u = i(6), c = i(13), h = i(10),
        f = a.default.getLogger("MainRendererHelper"), g = u.default(s.join(__rootDir, "../bin/ThunderHelper.node"));
    const p = new class {
        constructor() {
            this.mainWndDataIniPath = s.resolve(__profilesDir, "mainWndData.ini"), this.preBossKeyName = "", this.defaultMainWndWidth = 960, this.defaultMainWndHeight = 640
        }

        saveMainWndData() {
            return n(this, void 0, void 0, function* () {
                let e = yield r.asyncRemoteCall.getCurrentWindow(), t = yield e.getSize(), i = "normal";
                (yield e.isMaximized()) && (i = "max");
                let n = this.defaultMainWndWidth, a = this.defaultMainWndHeight;
                t && (n = t[0], a = t[1]), g.writeINI(this.mainWndDataIniPath, "MainBody", "ExitState", i), g.writeINI(this.mainWndDataIniPath, "MainBody", "MainWndLastWidth", n.toString()), g.writeINI(this.mainWndDataIniPath, "MainBody", "MainWndLastHeight", a.toString()), f.information("saveMainWndData:", this.mainWndDataIniPath, n, a, i)
            })
        }

        initMainRendererHelper() {
            h.ConfigNS.attachListener(c.NodeEventMesssageNS.eventConfigInitFinished, () => {
                this.onRegisterBossKey(), this.onInitDefaultPath().catch()
            })
        }

        onInitDefaultPath() {
            return n(this, void 0, void 0, function* () {
                let e = h.ConfigNS.getValue("TaskDefaultSettings", "InitPath", "");
                if ("" === e) {
                    let t = d.ThunderUtil.getMaxFreeDriver();
                    null !== t && "" !== t && (e = t + ":\\迅雷下载")
                }
                "" !== e && h.ConfigNS.setValue("TaskDefaultSettings", "InitPath", e);
                let t = h.ConfigNS.getValue("TaskDefaultSettings", "DefaultPath", "");
                "" !== t && (yield l.FileSystemAWNS.mkdirsAW(t)) || "" !== e && (yield l.FileSystemAWNS.mkdirsAW(e), h.ConfigNS.setValue("TaskDefaultSettings", "DefaultPath", e))
            })
        }

        onRegisterBossKey() {
            h.ConfigNS.setValue("BossKey", "BossKeyState", !1), this.registerBossKey().catch(), h.ConfigNS.attachListener(c.NodeEventMesssageNS.eventConfigValueChanged, (e, t, i, n) => {
                "BossKey" === e && this.registerBossKey().catch()
            })
        }

        registerBossKey() {
            return n(this, void 0, void 0, function* () {
                let e = yield r.asyncRemoteCall.getGlobalShortcut();
                if ("" !== this.preBossKeyName && (yield e.unregister(this.preBossKeyName)), h.ConfigNS.getValue("BossKey", "BossKeySwitch", !1)) {
                    let t = h.ConfigNS.getValue("BossKey", "BossKeyName", "Alt+D");
                    null !== t && void 0 !== t && "" !== t && (e.register(t, () => {
                        o.ipcRenderer.send("closeMainWindow", "BossKey")
                    }), this.preBossKeyName = t)
                }
            })
        }
    };
    t.default = p
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(0), a = i(80), o = i(32), r = i(4), s = i(23), l = i(320), d = i(16),
        u = n.default.getLogger("MessageChannel.NativeFunction"), c = a.TabEventManagerNS.getEventEmitter();
    !function (e) {
        const t = new class {
            constructor() {
                this.isInit = !1, this.nextListenerCookie = 0, this.listenerMap = new Map
            }

            init() {
                if (!this.isInit) {
                    this.isInit = !0;
                    let e = [{
                        functionName: "MessageChannelRegisterService",
                        nativeFunc: this.registerService.bind(this)
                    }, {
                        functionName: "MessageChannelUnregisterService",
                        nativeFunc: this.unregisterService.bind(this)
                    }, {
                        functionName: "MessageChannelJoinGroup",
                        nativeFunc: this.joinGroup.bind(this)
                    }, {
                        functionName: "MessageChannelLeaveGroup",
                        nativeFunc: this.leaveGroup.bind(this)
                    }, {
                        functionName: "MessageChannelGetLongConnectState",
                        nativeFunc: this.getLongConnectState.bind(this)
                    }, {
                        functionName: "MessageChannelGetUserState",
                        nativeFunc: this.getUserState.bind(this)
                    }, {
                        functionName: "MessageChannelAttachEvent",
                        nativeFunc: this.attachEvent.bind(this)
                    }, {functionName: "MessageChannelDetachEvent", nativeFunc: this.detachEvent.bind(this)}];
                    o.NativeCallNS.registerNativeFunction(e), c.on(a.TabEventManagerNS.EventType.RemoveTab, this.onTabRemove.bind(this)), l.MessageChannelNS.attachListener(l.MessageChannelNS.eventUserLogin, () => {
                        this.fireUserLogin()
                    }), l.MessageChannelNS.attachListener(l.MessageChannelNS.eventUserLoginFailed, () => {
                        this.fireUserLoginFailed()
                    }), l.MessageChannelNS.attachListener(l.MessageChannelNS.eventUserLogout, () => {
                        this.fireUserLogout()
                    }), l.MessageChannelNS.attachListener(l.MessageChannelNS.eventUserLogoutFailed, () => {
                        this.fireUserLogoutFailed()
                    }), l.MessageChannelNS.attachListener(l.MessageChannelNS.eventServiceCallbackId, (e, t) => {
                        this.fireServiceCallbackEvent(e, t)
                    }), l.MessageChannelNS.attachListener(l.MessageChannelNS.eventGroupServiceCallbackId, (e, t) => {
                        this.fireGroupServiceCallbackEvent(e, t)
                    })
                }
            }

            onTabRemove(e) {
                this.listenerMap.forEach(t => {
                    let i = [];
                    for (let [n, a]of t) a.tab === e.tabInfo.tab && i.push(n);
                    i.forEach(e => {
                        if (t.size > 0) {
                            let i = t.get(e);
                            if (!i) return;
                            if (t.delete(e), i.eventType === l.MessageChannelNS.eventServiceCallbackId) {
                                let e = 0;
                                for (let [, n]of t) if (n.serviceType === i.serviceType) {
                                    ++e;
                                    break
                                }
                                if (0 === e) {
                                    let e = l.MessageChannelNS.unregisterService(i.serviceType);
                                    u.information("unregisterService serviceType: ", i.serviceType, ", success: ", e)
                                }
                            } else if (i.eventType === l.MessageChannelNS.eventGroupServiceCallbackId) {
                                let e = 0;
                                for (let [, n]of t) if (n.groupId === i.groupId) {
                                    ++e;
                                    break
                                }
                                if (0 === e) {
                                    let e = l.MessageChannelNS.leaveGroup(i.groupId);
                                    u.information("leaveGroup groupId: ", i.groupId, ", success: ", e)
                                }
                            }
                        }
                    })
                })
            }

            registerService(e, t, i, n) {
                if (u.information("registerService args:", n), r.isNullOrUndefined(n) || r.isNullOrUndefined(n[0])) return void e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.ParamError);
                let a = n[0];
                if (r.isNullOrUndefined(n[1])) {
                    let n = l.MessageChannelNS.registerService(a);
                    e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success, n)
                } else if (r.isNumber(n[1])) {
                    let o = n[1], r = this.listenerMap.get(l.MessageChannelNS.eventServiceCallbackId);
                    r || (r = new Map, this.listenerMap.set(l.MessageChannelNS.eventServiceCallbackId, r));
                    let d = 0;
                    for (let [, e]of r) if (e.serviceType === a) {
                        ++d;
                        break
                    }
                    if (0 === d && !l.MessageChannelNS.registerService(a)) return void e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success, !1);
                    let c = {};
                    c.tab = e, c.nativeCallId = t, c.eventType = l.MessageChannelNS.eventServiceCallbackId, c.serviceType = a, c.callBackId = o;
                    let h = this.nextListenerCookie;
                    u.information("registerService callBackId:", c.callBackId, ", cookie:", h), r.set(h, c), ++this.nextListenerCookie, e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success, !0, h)
                } else e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.ParamError)
            }

            unregisterService(e, t, i, n) {
                if (u.information("unregisterService args:", n), r.isNullOrUndefined(n) || r.isNullOrUndefined(n[0])) return void e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.ParamError);
                let a = n[0];
                if (r.isNullOrUndefined(n[1])) {
                    let n = l.MessageChannelNS.unregisterService(a);
                    e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success, n)
                } else if (r.isNumber(n[1])) {
                    let o = n[1], r = this.listenerMap.get(l.MessageChannelNS.eventServiceCallbackId);
                    if (r) {
                        r.delete(o);
                        let n = 0;
                        if (0 === r.size) this.listenerMap.delete(l.MessageChannelNS.eventServiceCallbackId); else for (let [, e]of r) if (e.serviceType === a) {
                            ++n;
                            break
                        }
                        if (u.information("unregisterService cookie: ", o, ", serviceType: ", a, ", serviceRefCount: ", n), 0 === n) {
                            let n = l.MessageChannelNS.unregisterService(a);
                            e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success, n)
                        } else e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success, !0)
                    } else {
                        u.warning("serviceType already unregister! cookie: ", o);
                        let n = l.MessageChannelNS.unregisterService(a);
                        e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success, n)
                    }
                } else e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.ParamError)
            }

            joinGroup(e, t, i, n) {
                if (u.information("joinGroup args:", n), r.isNullOrUndefined(n) || r.isNullOrUndefined(n[0])) e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.ParamError); else if (r.isNumber(n[1])) {
                    let a = n[0], o = n[1], r = this.listenerMap.get(l.MessageChannelNS.eventGroupServiceCallbackId);
                    r || (r = new Map, this.listenerMap.set(l.MessageChannelNS.eventGroupServiceCallbackId, r));
                    let d = 0;
                    for (let [, e]of r) if (e.groupId === a) {
                        ++d;
                        break
                    }
                    if (0 === d && !l.MessageChannelNS.joinGroup(a)) return void e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success, !1);
                    let c = {};
                    c.tab = e, c.nativeCallId = t, c.eventType = l.MessageChannelNS.eventGroupServiceCallbackId, c.groupId = a, c.callBackId = o;
                    let h = this.nextListenerCookie;
                    u.information("joinGroup callBackId:", c.callBackId, ", cookie:", h), r.set(h, c), ++this.nextListenerCookie, e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success, !0, h)
                } else e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.ParamError)
            }

            leaveGroup(e, t, i, n) {
                if (u.information("leaveGroup args:", n), r.isNullOrUndefined(n) || r.isNullOrUndefined(n[0])) e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.ParamError); else if (r.isNullOrUndefined(n[1])) {
                    let a = n[0], o = this.listenerMap.get(l.MessageChannelNS.eventGroupServiceCallbackId), r = !1;
                    if (o && o.size > 0) {
                        let e = [];
                        for (let [t, i]of o) i.groupId === a && e.push(t);
                        e.length > 0 && (e.forEach(e => {
                            o.delete(e)
                        }), r = l.MessageChannelNS.leaveGroup(a))
                    }
                    e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success, r)
                } else if (r.isNumber(n[1])) {
                    let a = n[0], o = n[1], r = this.listenerMap.get(l.MessageChannelNS.eventGroupServiceCallbackId);
                    if (r) {
                        r.delete(o);
                        let n = 0;
                        if (0 === r.size) this.listenerMap.delete(l.MessageChannelNS.eventGroupServiceCallbackId); else for (let [, e]of r) if (e.groupId === a) {
                            ++n;
                            break
                        }
                        if (u.information("leaveGroup cookie: ", o, ", groupId: ", a, ", serviceRefCount: ", n), 0 === n) {
                            let n = l.MessageChannelNS.leaveGroup(a);
                            e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success, n)
                        } else e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success, !0)
                    } else {
                        u.warning("groupServiceCallback already unregister! cookie: ", o);
                        let n = l.MessageChannelNS.leaveGroup(a);
                        e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success, n)
                    }
                } else e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.ParamError)
            }

            getLongConnectState(e, t, i, n) {
                if (u.information("getLongConnectState"), r.isNullOrUndefined(n)) return void e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.ParamError);
                let a = l.MessageChannelNS.getLongConnectState();
                u.information("longConnectState:", a), e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success, a)
            }

            getUserState(e, t, i, n) {
                if (u.information("getUserState"), r.isNullOrUndefined(n)) return void e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.ParamError);
                let a = l.MessageChannelNS.getUserState();
                u.information("userState:", a), e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success, a)
            }

            attachEvent(e, t, i, n) {
                if (u.information("attachEvent enter"), r.isNullOrUndefined(e) || r.isNullOrUndefined(t) || r.isNullOrUndefined(i)) return void u.information("attachEvent bad external args");
                if (r.isNullOrUndefined(n) || r.isNullOrUndefined(n[0]) || r.isNullOrUndefined(n[1])) return void e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.ParamError);
                let a = n[0], o = {};
                if (o.tab = e, o.nativeCallId = t, o.eventType = a, a === l.MessageChannelNS.eventServiceCallbackId) {
                    if (r.isNullOrUndefined(n[2])) return void e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.ParamError);
                    let a = n[1], l = n[2];
                    o.serviceType = a, o.callBackId = l
                } else if (a === l.MessageChannelNS.eventGroupServiceCallbackId) {
                    if (r.isNullOrUndefined(n[2])) return void e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.ParamError);
                    let a = n[1], l = n[2];
                    o.groupId = a, o.callBackId = l
                } else {
                    let i = n[1];
                    o.callBackId = i, a === l.MessageChannelNS.eventUserLogin && l.MessageChannelNS.getUserState() === l.MessageChannelNS.UserState.Login && (u.information("attach eventUserLogin, current userState is already MessageChannelNS.UserState.Login, direct callback this time."), e.callNativeFunctionCallback(t, i))
                }
                let d = this.nextListenerCookie;
                u.information("attachEvent eventType:", a, ", callBackId:", o.callBackId, ", cookie:", d);
                let c = this.listenerMap.get(a);
                c || (c = new Map, this.listenerMap.set(a, c)), c.set(d, o), ++this.nextListenerCookie, e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success, d)
            }

            detachEvent(e, t, i, n) {
                if (u.information("detachEvent enter"), r.isNullOrUndefined(e) || r.isNullOrUndefined(t) || r.isNullOrUndefined(i)) return void u.information("detachEvent bad external args");
                if (r.isNullOrUndefined(n) || r.isNullOrUndefined(n[0])) return void e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.ParamError);
                let a = n[0];
                u.information("detachEvent cookie:", a), this.listenerMap.forEach(e => {
                    e.delete(a)
                }), e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success)
            }

            fireUserLogin() {
                let e = this.listenerMap.get(l.MessageChannelNS.eventUserLogin);
                e && e.forEach((e, t) => {
                    e.eventType === l.MessageChannelNS.eventUserLogin && e.tab.callNativeFunctionCallback(e.nativeCallId, e.callBackId)
                }), d.NativeCallModule.nativeCall.CallNativeFunction("FireEventFunction", l.MessageChannelNS.eventUserLogin)
            }

            fireUserLoginFailed() {
                let e = this.listenerMap.get(l.MessageChannelNS.eventUserLoginFailed);
                e && e.forEach((e, t) => {
                    e.eventType === l.MessageChannelNS.eventUserLoginFailed && e.tab.callNativeFunctionCallback(e.nativeCallId, e.callBackId)
                }), d.NativeCallModule.nativeCall.CallNativeFunction("FireEventFunction", l.MessageChannelNS.eventUserLoginFailed)
            }

            fireUserLogout() {
                let e = this.listenerMap.get(l.MessageChannelNS.eventUserLogout);
                e && e.forEach((e, t) => {
                    e.eventType === l.MessageChannelNS.eventUserLogout && e.tab.callNativeFunctionCallback(e.nativeCallId, e.callBackId)
                }), d.NativeCallModule.nativeCall.CallNativeFunction("FireEventFunction", l.MessageChannelNS.eventUserLogout)
            }

            fireUserLogoutFailed() {
                let e = this.listenerMap.get(l.MessageChannelNS.eventUserLogoutFailed);
                e && e.forEach((e, t) => {
                    e.eventType === l.MessageChannelNS.eventUserLogoutFailed && e.tab.callNativeFunctionCallback(e.nativeCallId, e.callBackId)
                }), d.NativeCallModule.nativeCall.CallNativeFunction("FireEventFunction", l.MessageChannelNS.eventUserLogoutFailed)
            }

            fireServiceCallbackEvent(e, t) {
                let i = JSON.stringify(t), n = this.listenerMap.get(l.MessageChannelNS.eventServiceCallbackId);
                n && n.forEach((t, n) => {
                    t.eventType === l.MessageChannelNS.eventServiceCallbackId && t.serviceType === e && t.tab.callNativeFunctionCallback(t.nativeCallId, t.callBackId, e, i)
                }), d.NativeCallModule.nativeCall.CallNativeFunction("FireEventFunction", l.MessageChannelNS.eventServiceCallbackId, e, i)
            }

            fireGroupServiceCallbackEvent(e, t) {
                let i = JSON.stringify(t), n = this.listenerMap.get(l.MessageChannelNS.eventGroupServiceCallbackId);
                n && n.forEach((t, n) => {
                    t.eventType === l.MessageChannelNS.eventGroupServiceCallbackId && t.groupId === e && t.tab.callNativeFunctionCallback(t.nativeCallId, t.callBackId, e, i)
                })
            }
        };
        e.init = function () {
            t.init()
        }
    }(t.MessageChannelNaviteFunctionNS || (t.MessageChannelNaviteFunctionNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(0), o = i(2), r = i(6), s = i(16), l = r.default(o.join(__rootDir, "../bin/ThunderHelper.node")),
        d = a.default.getLogger("BindConfigNS");
    let u = o.resolve(__profilesDir, "BindingConfig.ini");
    !function (e) {
        e.init = function () {
            s.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", e => n(this, void 0, void 0, function* () {
                d.information("BindConfigNS init userId:", e), l.writeINI(u, "UserInfo", "UserId", e)
            }))
        }
    }(t.BindConfigNS || (t.BindConfigNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(32), a = i(4), o = i(23), r = i(454), s = i(726), l = i(336);
    !function (e) {
        e.adNaviteFunction = new class {
            constructor() {
                this.isRegister = !1
            }

            registerNativeFunction() {
                if (!this.isRegister) {
                    this.isRegister = !0;
                    let e = [{
                        functionName: "SetSceneStatus",
                        nativeFunc: this.setSceneStatus
                    }, {functionName: "ShowAdTips", nativeFunc: this.showTips}];
                    n.NativeCallNS.registerNativeFunction(e)
                }
            }

            setSceneStatus(e, t, i, n) {
                do {
                    if (a.isNullOrUndefined(e) || a.isNullOrUndefined(t) || a.isNullOrUndefined(i)) break;
                    if (a.isNullOrUndefined(n) || a.isNullOrUndefined(n[0]) || a.isNullOrUndefined(n[1])) {
                        e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let s = n[0], l = n[1];
                    r.adPlatform.setSceneStatus(s, l, n[2]), e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.Success)
                } while (0)
            }

            showTips(e, t, i, n) {
                do {
                    if (a.isNullOrUndefined(e) || a.isNullOrUndefined(t) || a.isNullOrUndefined(i)) break;
                    if (a.isNullOrUndefined(n) || a.isNullOrUndefined(n[0]) || a.isNullOrUndefined(n[1])) {
                        e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let r = n[0], l = n[1];
                    s.adTipsManager.showFunctionalTips(l, r), e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.Success)
                } while (0)
            }
        }, e.init = function () {
            e.adNaviteFunction.registerNativeFunction(), setTimeout(() => {
                r.adPlatform.initAw().catch()
            }, 5e3);
            let t = 60;
            process.env.DEBUG_AD_TEST && (t = 5), setTimeout(() => {
                l.adLeftBottomHelper.fetchOrderAw().catch()
            }, 1e3 * t);
            let i = 120;
            process.env.DEBUG_JS_TIP && (i = 5), setTimeout(() => {
                s.adTipsManager.initAw().catch()
            }, 1e3 * i)
        }
    }(t.AdManageNS || (t.AdManageNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(139), o = i(727), r = i(728), s = i(28), l = i(12), d = i(729);
    t.adTipsManager = new class {
        constructor() {
            this.marketTips = new o.AdMarketTips, this.functionalTips = new r.AdFunctionalTips, this.webPageTips = new d.AdWebPageTips
        }

        initAw() {
            return n(this, void 0, void 0, function* () {
                (yield l.asyncRemoteCall.getIpcMain()).on(s.ThunderChannelList.channelMRAdTipsClick, (e, t, i) => n(this, void 0, void 0, function* () {
                    i && i.orderType && (i.orderType === a.OrderType.Market ? yield this.marketTips.onClickAw(t, i) : i.orderType === a.OrderType.Functional && (yield this.functionalTips.onClickAw(t, i)))
                })), yield this.webPageTips.initAw(), setTimeout(() => n(this, void 0, void 0, function* () {
                    yield this.marketTips.initAw()
                }), 15e3), setTimeout(() => n(this, void 0, void 0, function* () {
                    yield this.functionalTips.initAw()
                }), 3e4)
            })
        }

        showFunctionalTips(e, t) {
            this.functionalTips.showTip(e, t)
        }
    }
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(63), o = i(10), r = i(98), s = i(139), l = i(16), d = i(7), u = i(0);
    t.AdMarketTips = class extends s.AdTips {
        constructor() {
            super(), this.isVip = !1, this.lastShowTime = 0, this.orderType = s.OrderType.Market, this.tipsPriority = r.MsgQueueNS.MsgPriority.AdvertisementMarket, this.positionId = 1305, this.logger = u.default.getLogger("AdMarketTips")
        }

        initAw() {
            const e = e => super[e];
            return n(this, void 0, void 0, function* () {
                return l.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", () => n(this, void 0, void 0, function* () {
                    yield this.updateUserInfoAw()
                })), l.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", () => n(this, void 0, void 0, function* () {
                    this.isVip = !1, (new Date).getTime() - this.lastShowTime > 108e5 && this.timerCookie && (this.killTimer(), yield this.fetchOrdersAw())
                })), yield this.updateUserInfoAw(), e("initAw").call(this)
            })
        }

        showTip() {
            do {
                if (null === this.curSelectOrder || void 0 === this.curSelectOrder) {
                    this.logger.information("showTip:curSelectOrder 有问题");
                    break
                }
                let e = this.curSelectOrder.materials;
                if (e.length <= 0) {
                    this.logger.information("showTip:materials 有问题");
                    break
                }
                let t = e[0].materialId;
                super.showTip(t)
            } while (0)
        }

        fetchOrdersAw() {
            const e = e => super[e];
            return n(this, void 0, void 0, function* () {
                let t = null;
                return this.isVip || (this.shownOrderIds = yield this.getShownOrderIdAw(), t = e("fetchOrdersAw").call(this)), this.createTimer(), t
            })
        }

        handleEventAW(e, t) {
            const i = e => super[e];
            return n(this, void 0, void 0, function* () {
                try {
                    switch (yield i("handleEventAW").call(this, e, t), e) {
                        case"ad_load":
                            let n = yield this.downloadResourcesAW();
                            this.logger.information("downloadResourcesAW result", n), n && (this.isVip ? yield this.handleEventAW("ad_noshow", "vip") : this.showTip());
                            break;
                        case"ad_show":
                            this.lastShowTime = (new Date).getTime(), this.saveShownOrders()
                    }
                } catch (e) {
                    this.logger.warning(e)
                }
            })
        }

        updateUserInfoAw() {
            return n(this, void 0, void 0, function* () {
                try {
                    let e = yield d.client.callServerFunction("GetUserInfo", 2);
                    if (e) {
                        let t = JSON.parse(e).isVip;
                        this.isVip = t > 0, this.isVip && this.clearAllTips()
                    }
                } catch (e) {
                    this.logger.warning(e)
                }
            })
        }

        getShownOrderIdAw() {
            return n(this, void 0, void 0, function* () {
                let e = "";
                return yield a.AdHelperNS.onConfigInitAw(), o.ConfigNS.getValue("AdMarketTips", "TheDate", "") === a.AdHelperNS.getCurDate() && "" !== (e = o.ConfigNS.getValue("AdMarketTips", "shownOrders", "")) && "," === e.slice(e.length - 1) && (e = e.slice(0, e.length - 1)), e
            })
        }

        saveShownOrders() {
            let e = o.ConfigNS.getValue("AdMarketTips", "TheDate", ""), t = a.AdHelperNS.getCurDate(), i = "";
            e === t ? "" !== (i = o.ConfigNS.getValue("AdMarketTips", "shownOrders", "")) && "," === i.slice(i.length - 1) && (i = i.slice(0, i.length - 1)) : o.ConfigNS.setValue("AdMarketTips", "TheDate", t), i = "" !== i ? `${i},${this.curShowOrder.orderId}` : `${this.curShowOrder.orderId}`, o.ConfigNS.setValue("AdMarketTips", "shownOrders", i)
        }
    }
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(63), r = i(34), s = i(5), l = i(98), d = i(139), u = i(58), c = i(0);
    t.AdFunctionalTips = class extends d.AdTips {
        constructor() {
            super(), this.readyScenesMap = new Map, this.orderType = d.OrderType.Functional, this.tipsPriority = l.MsgQueueNS.MsgPriority.AdvertisementFunctional, this.positionId = 1306, this.logger = c.default.getLogger("AdFunctionalTips")
        }

        showTip(e, t) {
            this.logger.information("sceneName", t);
            do {
                let i = this.readyScenesMap.get(t);
                if (!i) {
                    this.logger.information("showTip:sceneName 有问题");
                    break
                }
                this.curSelectScene = i, super.showTip(e)
            } while (0)
        }

        fetchOrdersAw() {
            const e = e => super[e];
            return n(this, void 0, void 0, function* () {
                let t = e("fetchOrdersAw").call(this);
                return this.createTimer(), t
            })
        }

        handleEventAW(e, t) {
            const i = e => super[e];
            return n(this, void 0, void 0, function* () {
                switch (yield i("handleEventAW").call(this, e, t), e) {
                    case"ad_load":
                        let n = yield this.downloadResourcesAW();
                        this.logger.information("downloadResourcesAW result", n), n && (yield this.downloadScenes(), yield this.loadAllScenes())
                }
            })
        }

        downloadScenes() {
            return n(this, void 0, void 0, function* () {
                do {
                    if (null === this.curSelectOrder || void 0 === this.curSelectOrder) break;
                    const {UnzipUtilitiesAWNS: e} = yield Promise.resolve().then(() => i(94));
                    let t = this.curSelectOrder.scenes;
                    if (!(t.length <= 0)) for (let i = 0; i < t.length; ++i) {
                        let n = t[i], o = n.url, l = n.md5, d = `${n.name}.zip`, c = a.join(this.adDataScenesDir, d);
                        this.logger.information("downloadScenes:", o, c);
                        let h = yield u.AxiosNS.downloadFileAW(o, c);
                        if (this.logger.information("下载场景包：result = ", h, ";fileName = ", d), h) {
                            if (!1 === (h = yield r.ToolsUtilitiesAWNS.matchFileMd5(c, l))) {
                                this.logger.information("校验MD5值没通过，故删除该文件", l), yield s.FileSystemAWNS.unlinkAW(c);
                                continue
                            }
                            h = yield e.uncompressZipFile(`${this.adDataScenesDir}/`, c), this.logger.information("解压场景包：result = ", h, ";fileName = ", d), yield s.FileSystemAWNS.unlinkAW(c)
                        }
                    }
                } while (0)
            })
        }

        loadAllScenes() {
            return n(this, void 0, void 0, function* () {
                do {
                    if (null === this.curSelectOrder || void 0 === this.curSelectOrder) break;
                    let e = this.curSelectOrder.scenes;
                    if (e.length <= 0) this.logger.information("没有场景包"); else for (let t = 0; t < e.length; ++t) {
                        let i = e[t], n = i.name, r = this.readyScenesMap.get(n);
                        if (null === r || void 0 === r) {
                            this.readyScenesMap.set(n, i);
                            let e = a.join(this.adDataScenesDir, n);
                            yield o.AdHelperNS.loadScene(e)
                        }
                    }
                } while (0)
            })
        }
    }
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(63), o = i(10), r = i(98), s = i(139), l = i(16), d = i(7), u = i(14), c = i(134), h = i(133), f = i(0),
        g = i(12);
    t.AdWebPageTips = class extends s.AdTips {
        constructor() {
            super(), this.isVip = !1, this.lastShowTime = 0, this.orderType = s.OrderType.WebPage, this.tipsPriority = r.MsgQueueNS.MsgPriority.AdvertisementMarket, this.positionId = 1352, this.logger = f.default.getLogger("AdWebPageTips")
        }

        initAw() {
            const e = e => super[e];
            return n(this, void 0, void 0, function* () {
                return l.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", () => n(this, void 0, void 0, function* () {
                    yield this.updateUserInfoAw()
                })), l.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", () => n(this, void 0, void 0, function* () {
                    this.isVip = !1, (new Date).getTime() - this.lastShowTime > 108e5 && this.timerCookie && (this.killTimer(), yield this.fetchOrdersAw())
                })), yield this.updateUserInfoAw(), e("initAw").call(this)
            })
        }

        showTip() {
            do {
                if (null === this.curSelectOrder || void 0 === this.curSelectOrder) {
                    this.logger.information("showTip:curSelectOrder 有问题");
                    break
                }
                let e = this.curSelectOrder.materials;
                if (e.length <= 0) {
                    this.logger.information("showTip:materials 有问题");
                    break
                }
                this.logger.information("showTip");
                let t = e[0].materialId;
                super.showTip(t)
            } while (0)
        }

        fetchOrdersAw() {
            const e = e => super[e];
            return n(this, void 0, void 0, function* () {
                let t = null;
                return this.isVip || (this.shownOrderIds = yield this.getShownOrderIdAw(), t = e("fetchOrdersAw").call(this)), this.createTimer(), t
            })
        }

        createTip(e) {
            let t = !0, i = u.ThunderUtil.deepCopy(e);
            h.NotificationHelper.notify({
                title: i.title || "迅雷TIPS",
                type: c.Notification.TipsType.AdvertisementWebPageTips,
                width: i.width || 316,
                height: i.height ? i.height + 30 : 296,
                duration: i.timeout ? 1e3 * i.timeout : 6e3,
                noDelay: !0,
                name: this.tipsName,
                priority: this.tipsPriority,
                url: i.targetUrl,
                data: {exData: i}
            }, (e, ...o) => n(this, void 0, void 0, function* () {
                if ("webpage_loading" === e) this.curShowOrder = this.curSelectOrder, this.curShowScene = this.curSelectScene, this.curShowMaterialId = i.materialId; else if ("webpage_load_failed" === e) this.handleEventAW("ad_noshow", "loaderror").catch(); else if ("webpage_loaded" === e) this.handleEventAW("ad_show").catch(); else if ("click" === e) {
                    t = !1, this.handleEventAW("ad_click", "img").catch();
                    let [e] = o;
                    a.AdHelperNS.execute(i.openType, e), 1 === i.openType && (yield g.asyncRemoteCall.getCurrentWindow()).show()
                } else "click_close" === e ? (t = !1, this.handleEventAW("ad_closed", "btnClose").catch()) : "closed" === e && t && this.handleEventAW("ad_closed", "auto").catch()
            }))
        }

        parseOrders(e) {
            let t = [];
            if (this.orderType !== s.OrderType.WebPage) throw this.logger.error("parseOrders only for orders width type [WebPage]"), new Error("parseOrders only for orders width type [WebPage]");
            for (let i = 0; i < e.length; ++i) {
                let n = {}, a = e[i];
                n.orderId = a.orderId, this.logger.information("parseOrders: orderId = ", a.orderId);
                let o = a.materials;
                if (!o || o.length <= 0) this.logger.warning("parseOrders: has no materials"); else {
                    n.materials = [];
                    for (let e of o) {
                        let t = {};
                        if (t.materialId = e.material_id, t.openType = e.open_type, t.targetUrl = e.open_url, t.style = e.type, this.orderType === s.OrderType.WebPage) {
                            let i = {
                                10101: {key: "title", type: "string"},
                                10901: {key: "width", type: "number"},
                                10902: {key: "height", type: "number"},
                                10906: {key: "timeout", type: "number"},
                                10910: {key: "targetUrl", type: "string"}
                            };
                            e.data.map(e => {
                                let n = i[e.asset];
                                n && ("number" === n.type ? t[n.key] = parseInt(e.value, 10) : t[n.key] = String(e.value))
                            })
                        }
                        t.targetUrl ? n.materials.push(t) : this.logger.warning("parseOrder: targetUrl missing")
                    }
                    t.push(n)
                }
            }
            return this.logger.information("parseOrder done. orders = ", t), t
        }

        handleEventAW(e, t) {
            const i = e => super[e];
            return n(this, void 0, void 0, function* () {
                try {
                    switch (yield i("handleEventAW").call(this, e, t), e) {
                        case"ad_load":
                            let n = yield this.downloadResourcesAW();
                            this.logger.information("downloadResourcesAW result", n), n && (this.isVip ? yield this.handleEventAW("ad_noshow", "vip") : this.showTip());
                            break;
                        case"ad_show":
                            this.lastShowTime = (new Date).getTime(), this.saveShownOrders()
                    }
                } catch (e) {
                    this.logger.warning(e)
                }
            })
        }

        updateUserInfoAw() {
            return n(this, void 0, void 0, function* () {
                try {
                    let e = yield d.client.callServerFunction("GetUserInfo", 2);
                    if (e) {
                        let t = JSON.parse(e).isVip;
                        this.isVip = t > 0, this.isVip && this.clearAllTips()
                    }
                } catch (e) {
                    this.logger.warning(e)
                }
            })
        }

        getShownOrderIdAw() {
            return n(this, void 0, void 0, function* () {
                let e = "";
                return yield a.AdHelperNS.onConfigInitAw(), o.ConfigNS.getValue("AdWebPageTips", "TheDate", "") === a.AdHelperNS.getCurDate() && "" !== (e = o.ConfigNS.getValue("AdWebPageTips", "shownOrders", "")) && "," === e.slice(e.length - 1) && (e = e.slice(0, e.length - 1)), e
            })
        }

        saveShownOrders() {
            let e = o.ConfigNS.getValue("AdWebPageTips", "TheDate", ""), t = a.AdHelperNS.getCurDate(), i = "";
            e === t ? "" !== (i = o.ConfigNS.getValue("AdWebPageTips", "shownOrders", "")) && "," === i.slice(i.length - 1) && (i = i.slice(0, i.length - 1)) : o.ConfigNS.setValue("AdWebPageTips", "TheDate", t), i = "" !== i ? `${i},${this.curShowOrder.orderId}` : `${this.curShowOrder.orderId}`, o.ConfigNS.setValue("AdWebPageTips", "shownOrders", i)
        }
    }
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(0), o = i(32), r = i(4), s = i(23), l = i(436), d = i(26), u = i(16),
        c = a.default.getLogger("NativeFunction.Login");
    !function (e) {
        const t = new class {
            constructor() {
                this.isRegister = !1
            }

            registerNativeFunction() {
                if (!this.isRegister) {
                    this.isRegister = !0;
                    let e = [{
                        functionName: "AttachCallbackEvent",
                        nativeFunc: this.attachCallbackEvent
                    }, {functionName: "IsTipsWndShow", nativeFunc: this.isTipsWndShow}, {
                        functionName: "IsMainWndShow",
                        nativeFunc: this.isMainWndShow
                    }, {functionName: "CreateTipsWnd", nativeFunc: this.createTipsWnd}, {
                        functionName: "CloseTipsWnd",
                        nativeFunc: this.closeTipsWnd
                    }, {functionName: "ShowOrHideTipsWnd", nativeFunc: this.showOrHideTipsWnd}];
                    o.NativeCallNS.registerNativeFunction(e)
                }
            }

            attachCallbackEvent(e, t, i, n) {
                if (r.isNullOrUndefined(n) || r.isNullOrUndefined(n[0])) return void e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.ParamError);
                let a = n[0], o = n[1];
                u.NativeCallModule.nativeCall.AttachNativeEvent(a, (...e) => {
                    d.NativeCallHostModule.nativeCallHost.fireNativeEvent(o, ...e)
                }), e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success)
            }

            createTipsWnd(e, t, i, n) {
                do {
                    if (r.isNullOrUndefined(e) || r.isNullOrUndefined(t) || r.isNullOrUndefined(i) || r.isNullOrUndefined(n)) break;
                    if (r.isNullOrUndefined(n[0]) || r.isNullOrUndefined(n[1])) {
                        e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let a = n[0], o = n[1], d = "", u = null, c = null;
                    r.isNullOrUndefined(n[2]) || (u = n[2]), r.isNullOrUndefined(n[3]) || (c = n[3]), r.isNullOrUndefined(n[4]) || (d = n[4]), l.TipsHelperNS.tipsUIHelper.createTipsWnd(a, o, u, c, d).catch(), e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success)
                } while (0)
            }

            isTipsWndShow(e, t, i) {
                do {
                    if (r.isNullOrUndefined(e) || r.isNullOrUndefined(t) || r.isNullOrUndefined(i)) break;
                    let n = l.TipsHelperNS.tipsUIHelper.isTipsWndShow();
                    e.callNativeFunctionCallback(t, i, n)
                } while (0)
            }

            isMainWndShow(e, t, i) {
                return n(this, void 0, void 0, function* () {
                    do {
                        if (r.isNullOrUndefined(e) || r.isNullOrUndefined(t) || r.isNullOrUndefined(i)) break;
                        let n = yield l.TipsHelperNS.tipsUIHelper.isMainWndShow();
                        e.callNativeFunctionCallback(t, i, n)
                    } while (0)
                })
            }

            closeTipsWnd(e, t, i) {
                do {
                    if (r.isNullOrUndefined(e) || r.isNullOrUndefined(t) || r.isNullOrUndefined(i)) break;
                    l.TipsHelperNS.tipsUIHelper.closeTipsWnd(), e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success)
                } while (0)
            }

            showOrHideTipsWnd(e, t, i, n) {
                c.information("showOrHideTipsWnd", e, t, i);
                let a = !1, o = null, d = null, u = null, h = null;
                r.isNullOrUndefined(n[0]) || (a = n[0]), r.isNullOrUndefined(n[1]) || (o = n[1]), r.isNullOrUndefined(n[2]) || (d = n[2]), r.isNullOrUndefined(n[3]) || (u = n[3]), r.isNullOrUndefined(n[4]) || (h = n[4]), l.TipsHelperNS.tipsUIHelper.showOrHideTipsWnd(a, o, d, u, h), e.callNativeFunctionCallback(t, i, s.NativeFunctionErrorCode.Success)
            }
        };
        e.registerNativeFunction = function () {
            t.registerNativeFunction()
        }
    }(t.TipsNaviteFunctionNS || (t.TipsNaviteFunctionNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(0), a = i(32), o = i(23), r = i(26), s = i(14), l = i(133),
        d = n.default.getLogger("NotificationNaviteFunction");
    !function (e) {
        const t = new class {
            constructor() {
                this.isRegister = !1
            }

            registerNativeFunction() {
                if (!this.isRegister) {
                    this.isRegister = !0;
                    let e = [{functionName: "ShowNotification", nativeFunc: this.showNotification}];
                    a.NativeCallNS.registerNativeFunction(e)
                }
            }

            showNotification(e, t, i, n) {
                do {
                    if (s.ThunderUtil.isUndef(e) || s.ThunderUtil.isUndef(t) || s.ThunderUtil.isUndef(i)) break;
                    if (s.ThunderUtil.isUndef(n) || s.ThunderUtil.isUndef(n[0])) {
                        e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    try {
                        let a = JSON.parse(n[0]);
                        if (d.information("showNotification", "options", a), !a) break;
                        let u = n[1], c = null;
                        d.information("notificationCallBackId", u), s.ThunderUtil.isDef(u) && (c = ((...e) => {
                            r.NativeCallHostModule.nativeCallHost.callJsFunctionById(t, u, ...e)
                        })), l.NotificationHelper.notify(a, c)
                    } catch (n) {
                        e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.Success)
                } while (0)
            }
        };
        e.registerNativeFunction = function () {
            t.registerNativeFunction()
        }
    }(t.NotificationNaviteFunctionNS || (t.NotificationNaviteFunctionNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(7), o = i(16), r = i(132), s = i(0), l = i(14), d = i(5), u = i(328), c = i(441), h = i(733),
        f = i(327), g = i(12), p = s.default.getLogger("MainRenderer"), {isDef: v, isUndef: m} = l.ThunderUtil, y = !1;
    let k = !1, T = !1, w = "", C = `${__profilesDir}/user-skin-info.json`, S = !1, b = null;

    function I(e) {
        let t = !1;
        do {
            let i;
            try {
                i = JSON.parse(localStorage.getItem("coolShakes"))
            } catch (e) {
                p.warning(e);
                break
            }
            let n = null;
            if (n = (i || []).find(t => t.id === e.skinID), m(n)) break;
            if (n.is_svip || n.is_vip) {
                t = n.is_svip ? T : k;
                break
            }
            t = !0;
            break
        } while (0);
        return t
    }

    function _(e, t = !1, i = !1) {
        return n(this, void 0, void 0, function* () {
            if (y) {
                if (t || function (e) {
                    let t, i, n = !0;
                    do {
                        if (e.type !== r.SkinHelperNS.SkinType.Wallpaper) break;
                        try {
                            t = JSON.parse(localStorage.getItem("wallpapers"))
                        } catch (e) {
                            p.warning(e);
                            break
                        }
                        if (i = (t || []).find(t => t.id === e.skinID), v(i) && i.is_vip) {
                            n = k;
                            break
                        }
                        try {
                            t = JSON.parse(localStorage.getItem("coolWallpapers"))
                        } catch (e) {
                            p.warning(e);
                            break
                        }
                        if (i = (t || []).find(t => t.id === e.skinID), m(i)) break;
                        if (i.is_svip || i.is_vip) {
                            n = i.is_svip ? T : k;
                            break
                        }
                    } while (0);
                    return n
                }(e)) {
                    if (e.type !== r.SkinHelperNS.SkinType.Default && e.type !== r.SkinHelperNS.SkinType.Color && e.type !== r.SkinHelperNS.SkinType.Wallpaper || (yield h.default.enableSuperCoolWallpaper(!1)), e.type === r.SkinHelperNS.SkinType.Default) document.body.classList.remove("is-theme"), l.ThunderUtil.setCSSProperties(document.body, {
                        "--background-main": "",
                        "--color-primary-theme": "",
                        "--color-primary-control-1": "",
                        "--color-primary-control-2": "",
                        "--color-primary-control-3": "",
                        "--color-primary-control-4": "",
                        "--color-primary-gradient-1": "",
                        "--color-primary-gradient-2": "",
                        "--color-primary-text": "",
                        "--color-search": "",
                        "--color-secondary": "",
                        "--color-gradient-background-1": "",
                        "--color-gradient-background-2": "",
                        "--color-gradient-foreground-1": "",
                        "--color-gradient-foreground-2": "",
                        "--color-accordion-1": "",
                        "--color-accordion-2": "",
                        "--default-opacity-1": "",
                        "--default-opacity-2": ""
                    }); else if (e.type === r.SkinHelperNS.SkinType.Color || e.type === r.SkinHelperNS.SkinType.Wallpaper || e.type === r.SkinHelperNS.SkinType.Cool) {
                        let {colors: {colorGradientBackground: t, colorGradientForeground: i, colorPrimaryControl1: n, colorPrimaryControl2: a, colorPrimaryControl3: o, colorPrimaryControl4: s, colorSearch: d, colorPrimaryText: u, colorPrimary: c, colorPrimaryGradient: f, colorSecondary: g, colorAccordion: p}, opacity: v, opacityDesc: m, image: y} = e;
                        if (document.body.classList.add("is-theme"), l.ThunderUtil.setCSSProperties(document.body, {
                            "--background-main": "",
                            "--color-primary-theme": `${c}`,
                            "--color-primary-control-1": `${n}`,
                            "--color-primary-control-2": `${a}`,
                            "--color-primary-control-3": `${o}`,
                            "--color-primary-control-4": `${s}`,
                            "--color-primary-gradient-1": `${f[0]}`,
                            "--color-primary-gradient-2": `${f[1]}`,
                            "--color-primary-text": `${u}`,
                            "--color-search": `${d}`,
                            "--color-secondary": `${g}`,
                            "--color-gradient-background-1": `${t[0]}`,
                            "--color-gradient-background-2": `${t[1]}`,
                            "--color-gradient-foreground-1": `${i[0]}`,
                            "--color-gradient-foreground-2": `${i[1]}`,
                            "--color-accordion-1": `${p[0]}`,
                            "--color-accordion-2": `${p[1]}`,
                            "--default-opacity-1": m ? `${v + .1}` : `${v - .1}`,
                            "--default-opacity-2": m ? `${v - .1}` : `${v + .1}`
                        }), e.type === r.SkinHelperNS.SkinType.Wallpaper || e.type === r.SkinHelperNS.SkinType.Cool) {
                            let t = new Image;
                            t.addEventListener("load", () => {
                                l.ThunderUtil.setCSSProperties(document.body, {"--background-main": `url("${y}")`}), e.type === r.SkinHelperNS.SkinType.Cool && h.default.enableSuperCoolWallpaper(!0).catch()
                            }), t.src = y
                        }
                    }
                } else try {
                    yield a.client.callServerFunction("SetSkinInfo", r.SkinHelperNS.defaultSkinInfo)
                } catch (e) {
                    p.warning(e)
                }
                i || (yield x(w))
            }
        })
    }

    function A() {
        return n(this, void 0, void 0, function* () {
            {
                let e = yield f.default.getShakeInfo(w);
                e ? I(e) && (yield h.default.enableSuperCoolShake(!0, e)) : yield h.default.enableSuperCoolShake(!1)
            }
        })
    }

    function D(e) {
        return n(this, void 0, void 0, function* () {
            if (m(e) || e) {
                let e = yield a.client.callServerFunction("GetUserInfo", 2), t = null;
                if (e) {
                    try {
                        t = JSON.parse(e)
                    } catch (e) {
                        p.warning(e)
                    }
                    if (t) {
                        k = "1" === t.isVip;
                        let e = Number(t.vasType).valueOf();
                        T = k && 5 === e
                    }
                }
            } else k = !1, T = !1;
            try {
                yield f.default.setSkinInfo(f.default.getFeaturedSkinInfo())
            } catch (e) {
                p.warning(e)
            }
        })
    }

    function x(e) {
        return n(this, void 0, void 0, function* () {
            try {
                let t = {}, i = yield a.client.callServerFunction("GetSkinInfo"),
                    n = yield c.SpringFestivalSkinNS.canShowSkin();
                if (i.is_spring_festival && n && (i = b), m(i)) return;
                let o = "{}";
                if (b = i, "" !== e) {
                    (yield d.FileSystemAWNS.existsAW(C)) && (o = (yield d.FileSystemAWNS.readFileAW(C)).toString() || "{}", t = JSON.parse(o)), (t = JSON.parse(o))[e] = i, delete t[e].colors, yield d.FileSystemAWNS.writeFileAW(C, JSON.stringify(t))
                }
            } catch (e) {
                p.warning(e)
            }
        })
    }

    a.client.attachServerEvent("OnChangeSkin", (e, ...t) => {
        _(t[0], t[1], t[2]).catch()
    }), a.client.attachServerEvent("OnChangeShake", (e, ...t) => {
        (function (e, t = !1) {
            return n(this, void 0, void 0, function* () {
                if (v(e)) {
                    if (t || I(e)) {
                        let t = void 0;
                        yield h.default.enableSuperCoolShake(!0, e, t)
                    }
                } else yield h.default.enableSuperCoolShake(!1);
                t || (yield f.default.handleShakeSave(w, e))
            })
        })(t[0], t[1]).catch()
    }), o.NativeCallModule.nativeCall.AttachNativeEvent("OnUserLogin", e => n(this, void 0, void 0, function* () {
        do {
            try {
                yield D(!0), w = e, A().catch();
                let t = (yield d.FileSystemAWNS.readFileAW(C)).toString(), i = JSON.parse(t)[e],
                    n = yield a.client.callServerFunction("GetSkinInfo");
                b = i;
                let o = JSON.parse(localStorage.getItem("wallpapers"));
                null === o && (o = ((yield u.default.getWallpapers()) || []).sort((e, t) => e.manual_order - t.manual_order) || []);
                let r = o.find(e => e.id === i.skinID), s = o.find(e => e.id === n.skinID);
                if (!r) {
                    o = null;
                    try {
                        o = JSON.parse(localStorage.getItem("coolWallpapers"))
                    } catch (e) {
                    }
                    null === o && (o = ((yield u.default.getCoolWallpapers()) || []).sort((e, t) => e.manual_order - t.manual_order) || []), r = o.find(e => e.id === i.skinID)
                }
                if (S && (S = !1, !s || s && !s.is_vip || s && s.is_vip && k)) return void (yield x(e));
                if ("" !== t && (!r || k && r.is_vip || !r.is_vip)) {
                    if (yield c.SpringFestivalSkinNS.canShowSkin()) break;
                    yield a.client.callServerFunction("SetSkinInfo", i)
                }
            } catch (e) {
                p.warning(e)
            }
        } while (0)
    })), o.NativeCallModule.nativeCall.AttachNativeEvent("OnUserLogout", e => n(this, void 0, void 0, function* () {
        try {
            w = "", yield D(!1)
        } catch (e) {
            p.warning(e)
        }
        yield h.default.enableSuperCoolShake(!1)
    })), function () {
        return n(this, void 0, void 0, function* () {
            (yield g.asyncRemoteCall.getIpcMain()).on("update-skin-reserved", (e, t) => {
                S = t
            })
        })
    }().catch()
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(12), o = i(5), r = i(0), s = i(14), l = r.default.getLogger("SuperCoolSkinHelper"), d = 680, u = .88,
        c = {width: 4096, height: 2160};
    t.default = new class {
        constructor() {
            this.injected = !1, this.moveAttachFunc = void 0, this.shakeAttachFunc = void 0, this.currentShakeInfo = void 0, this.preShakeTime = void 0, this.shakeStartTime = void 0, this.delayShakeTimerId = void 0, this.movements = []
        }

        enableSuperCoolWallpaper(e) {
            return n(this, void 0, void 0, function* () {
                let t = yield a.asyncRemoteCall.getCurrentWindow();
                if (e) {
                    if (!this.moveAttachFunc) {
                        this.onMainWindowMove(), this.moveAttachFunc = this.onMainWindowMove.bind(this), t.on("move", this.moveAttachFunc);
                        let e = yield(yield a.asyncRemoteCall.getScreen()).getPrimaryDisplay(), i = e.size.width,
                            n = e.size.height, o = c.width / i, r = c.height / n;
                        o <= r ? n = c.height / o : i = c.width / r;
                        let l = document.querySelector(".xlx-media");
                        s.ThunderUtil.setCSSProperties(l, {
                            "background-size": `${i}px ${n}px`,
                            "background-repeat": "repeat"
                        })
                    }
                } else if (this.moveAttachFunc) {
                    t.removeListener("move", this.moveAttachFunc), this.moveAttachFunc = void 0;
                    let e = document.querySelector(".xlx-media");
                    s.ThunderUtil.setCSSProperties(e, {
                        "background-position": "center top",
                        "background-size": "cover",
                        "background-repeat": "no-repeat"
                    })
                }
            })
        }

        doMove() {
            let e = void 0, t = void 0;
            e = `${0 - window.screenLeft}px`, t = `${0 - window.screenTop}px`;
            let i = document.querySelector(".xlx-media");
            s.ThunderUtil.setCSSProperties(i, {"background-position": `${e} ${t}`})
        }

        onMainWindowMove() {
            let e = void 0;
            e = setTimeout(() => {
                void 0 !== e && (clearTimeout(e), e = void 0), this.doMove()
            }, 15)
        }

        enableSuperCoolShake(e, t, i) {
            return n(this, void 0, void 0, function* () {
                let n = yield a.asyncRemoteCall.getCurrentWindow();
                e ? (this.injectJs(i), this.currentShakeInfo && this.currentShakeInfo.image !== t.image && window.stopCoolSkinShake && window.stopCoolSkinShake(), this.currentShakeInfo = t, l.information("update current shakeinfo", this.currentShakeInfo), this.shakeAttachFunc || (this.shakeAttachFunc = this.onMainWindowShake.bind(this), n.on("move", this.shakeAttachFunc))) : (this.currentShakeInfo = void 0, window.stopCoolSkinShake && window.stopCoolSkinShake(), this.shakeAttachFunc && (n.removeListener("move", this.shakeAttachFunc), this.shakeAttachFunc = void 0))
            })
        }

        previewShake(e) {
            return n(this, void 0, void 0, function* () {
                window.startCoolSkinShake && (yield o.FileSystemAWNS.existsAW(e)) && window.startCoolSkinShake({
                    image: e,
                    count: 30
                })
            })
        }

        injectJs(e) {
            do {
                if (this.injected) {
                    e && e();
                    break
                }
                this.injected = !0;
                let t = document.createElement("script");
                t.setAttribute("type", "text/javascript"), t.src = `file:///${__rootDir}/out/shake-skin.js`, t.onload = function () {
                    this.parentNode.removeChild(this), e && e()
                }, document.body.appendChild(t)
            } while (0)
        }

        doShake() {
            if (void 0 !== this.delayShakeTimerId && (clearTimeout(this.delayShakeTimerId), this.delayShakeTimerId = void 0), this.preShakeTime = void 0, this.shakeStartTime = void 0, this.movements = null, this.movements = [], window.startCoolSkinShake && this.currentShakeInfo) {
                let e = this.currentShakeInfo.count || 30, t = this.currentShakeInfo.rotate || 0, i = 10, n = 4;
                this.currentShakeInfo.time && this.currentShakeInfo.time.length >= 2 && (this.currentShakeInfo.time[0] && (i = isNaN(Number(this.currentShakeInfo.time[0])) ? 10 : Number(this.currentShakeInfo.time[1]) || 1), i = this.currentShakeInfo.time[0] || 10, void 0 !== this.currentShakeInfo.time[1] && null !== this.currentShakeInfo.time[1] && (n = isNaN(Number(this.currentShakeInfo.time[1])) ? 4 : Number(this.currentShakeInfo.time[1]))), window.startCoolSkinShake({
                    image: this.currentShakeInfo.image,
                    count: e,
                    rotate: t,
                    durationMax: i,
                    durationMin: n
                })
            }
        }

        continueDelayShake() {
            void 0 !== this.delayShakeTimerId && (clearTimeout(this.delayShakeTimerId), this.delayShakeTimerId = void 0, this.delayShakeTimerId = setTimeout(() => {
                this.doShake()
            }, 100))
        }

        getDistance(e, t) {
            return Math.sqrt(e * e + t * t)
        }

        getAverageSpeed() {
            let e = 0;
            do {
                if (!this.movements || this.movements.length < 2) break;
                let t = 0;
                for (let e = 0; e < this.movements.length - 1; e++) {
                    let i = this.movements[e], n = this.movements[e + 1];
                    n.tick - i.tick > 0 && (t += this.getDistance(n.x - i.x, n.y - i.y))
                }
                let i = this.movements[this.movements.length - 1].tick - this.movements[0].tick;
                e = t / i, l.information(`shake get distance ${t}, duration ${i}, speed: ${e}`)
            } while (0);
            return e
        }

        onPosChange() {
            do {
                if (!this.shakeStartTime) break;
                let e = (new Date).getTime();
                this.movements.push({tick: e, x: window.screenLeft, y: window.screenTop})
            } while (0)
        }

        onMainWindowShake() {
            this.onPosChange();
            do {
                this.continueDelayShake();
                let e = (new Date).getTime();
                if (this.preShakeTime && e - this.preShakeTime >= 100) {
                    l.information("shake 不连续的拖动，判断中断", e - this.preShakeTime), this.preShakeTime = void 0, this.shakeStartTime = void 0, this.movements = null, this.movements = [];
                    break
                }
                void 0 === this.preShakeTime && (this.shakeStartTime = e), this.preShakeTime = e, this.shakeStartTime && e - this.shakeStartTime >= d && (l.information(`shake 连续晃动超过${d}秒`), this.getAverageSpeed() > u && void 0 === this.delayShakeTimerId && (this.delayShakeTimerId = setTimeout(() => {
                    this.doShake()
                }, 100)))
            } while (0)
        }
    }
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(7), o = i(16), r = i(0), s = i(14), l = i(5), d = i(443), u = i(329),
        c = r.default.getLogger("Thunder.speedcurve-skin.init-skin"), {isDef: h, isUndef: f} = s.ThunderUtil;
    let g = !1, p = !1, v = "", m = `${d.SpeedCurveSkinHelperNS.cacheDir}/user-skin-info.json`;

    function y(e) {
        let t = !0;
        return e.type === d.SpeedCurveSkinHelperNS.SkinType.SuperVip ? t = p : e.type === d.SpeedCurveSkinHelperNS.SkinType.Vip && (t = g), t
    }

    function k(e) {
        return h(e.type) && e.type >= d.SpeedCurveSkinHelperNS.SkinType.Vip
    }

    function T(e, t = !1, i = !1) {
        return n(this, void 0, void 0, function* () {
            if (i || y(e)) ; else try {
                yield a.client.callServerFunction("SetSpeedCurveSkinInfo", d.SpeedCurveSkinHelperNS.defaultSkinInfo)
            } catch (e) {
                c.warning(e)
            }
            i && !t || (yield C(v))
        })
    }

    function w(e) {
        return n(this, void 0, void 0, function* () {
            if (f(e) || e) try {
                let e = JSON.parse(yield a.client.callServerFunction("GetUserInfo", 2));
                if (h(e)) {
                    let t = Number(e.vasType).valueOf();
                    g = "1" === e.isVip, p = g && 5 === t
                }
            } catch (e) {
                c.warning(e)
            } else g = !1, p = !1;
            try {
                yield T(yield a.client.callServerFunction("GetSpeedCurveSkinInfo"))
            } catch (e) {
                c.warning(e)
            }
        })
    }

    function C(e) {
        return n(this, void 0, void 0, function* () {
            try {
                let t = {}, i = yield a.client.callServerFunction("GetSpeedCurveSkinInfo"), n = "{}";
                if ("" !== e) {
                    (yield l.FileSystemAWNS.existsAW(m)) && (n = (yield l.FileSystemAWNS.readFileAW(m)).toString() || "{}"), (t = JSON.parse(n))[e] = {
                        id: i.id,
                        type: i.type
                    }, yield l.FileSystemAWNS.writeFileAW(m, JSON.stringify(t))
                }
            } catch (e) {
                c.warning(e)
            }
        })
    }

    a.client.attachServerEvent("OnChangeSpeedCurveSkin", (e, ...t) => n(this, void 0, void 0, function* () {
        yield T(t[0], t[1], t[2])
    })), o.NativeCallModule.nativeCall.AttachNativeEvent("OnUserLogin", e => n(this, void 0, void 0, function* () {
        try {
            yield w(!0), v = e;
            let t = (yield l.FileSystemAWNS.readFileAW(m)).toString(), i = JSON.parse(t)[e],
                n = yield a.client.callServerFunction("GetSpeedCurveSkinInfo"),
                o = JSON.parse(localStorage.getItem("speedcurveSkins"));
            if (null === o && (o = (yield u.default.getSkins()) || []), (n = o.find(e => e.id === n.id)) && k(n) && y(n)) return void (yield C(e));
            if (!i) return;
            if (i = o.find(e => e.id === i.id)) {
                let e = k(i);
                (e && y(i) || !e) && (yield a.client.callServerFunction("SetSpeedCurveSkinInfo", i))
            }
        } catch (e) {
            c.warning(e)
        }
    })), o.NativeCallModule.nativeCall.AttachNativeEvent("OnUserLogout", e => n(this, void 0, void 0, function* () {
        try {
            v = "", yield w(!1)
        } catch (e) {
            c.warning(e)
        }
    }))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(7), o = i(16), r = i(0), s = i(14), l = i(5), d = i(445),
        u = r.default.getLogger("Thunder.suspension-skin.init-skin"), {isDef: c, isUndef: h} = s.ThunderUtil;
    let f = !1, g = "", p = `${d.SuspensionSkinHelperNS.cacheDir}/user-skin-info.json`;

    function v(e) {
        let t = !0;
        return e.type === d.SuspensionSkinHelperNS.SkinType.Vip && (t = f), t
    }

    function m(e) {
        return c(e.type) && e.type >= d.SuspensionSkinHelperNS.SkinType.Vip
    }

    function y(e) {
        return n(this, void 0, void 0, function* () {
            u.information("updateUserSkin", e), g = e, yield function (e) {
                return n(this, void 0, void 0, function* () {
                    if (h(e) || e) try {
                        let e = JSON.parse(yield a.client.callServerFunction("GetUserInfo", 2));
                        c(e) && (f = "1" === e.isVip)
                    } catch (e) {
                        u.warning(e)
                    } else f = !1
                })
            }(e && "" !== e);
            let t = void 0;
            try {
                t = (yield l.FileSystemAWNS.readFileAW(p)).toString()
            } catch (e) {
                u.warning(e)
            }
            let i = null;
            if (t) try {
                let n = JSON.parse(t);
                n && (i = n[e])
            } catch (e) {
                u.warning(e)
            }
            let o = yield a.client.callServerFunction("GetSuspensionSkinInfo");
            if (o && m(o) && v(o)) return void (yield k(e));
            i || (i = f ? d.SuspensionSkinHelperNS.vipSkinInfo : d.SuspensionSkinHelperNS.defaultSkinInfo), u.information("skinInfo", i);
            let r = m(i);
            (r && v(i) || !r) && (yield a.client.callServerFunction("SetSuspensionSkinInfo", i))
        })
    }

    function k(e) {
        return n(this, void 0, void 0, function* () {
            u.information("userId", e, "isVip", f);
            try {
                if (f) {
                    let t = {}, i = yield a.client.callServerFunction("GetSuspensionSkinInfo"), n = "{}";
                    if ("" !== e) {
                        let a = yield l.FileSystemAWNS.existsAW(p);
                        u.information("isHaveSkinFile", a), a && (n = (yield l.FileSystemAWNS.readFileAW(p)).toString() || "{}"), (t = JSON.parse(n))[e] = {
                            id: i.id,
                            type: i.type
                        }, u.information("handleSkinSave", e, i), yield l.FileSystemAWNS.writeFileAW(p, JSON.stringify(t))
                    }
                }
            } catch (e) {
                u.warning(e)
            }
        })
    }

    a.client.attachServerEvent("OnChangeSuspensionSkin", (e, ...t) => {
        (function (e, t = !1, i = !1) {
            return n(this, void 0, void 0, function* () {
                if (u.information("changeSkin", "isPreview", t, "temp", i), i || v(e)) ; else try {
                    yield a.client.callServerFunction("SetSuspensionSkinInfo", d.SuspensionSkinHelperNS.defaultSkinInfo), u.information("set defaultSkinInfo")
                } catch (e) {
                    u.warning(e)
                }
                i && !t || (yield k(g))
            })
        })(t[0], t[1], t[2]).catch()
    }), o.NativeCallModule.nativeCall.AttachNativeEvent("OnUserLogin", e => n(this, void 0, void 0, function* () {
        yield y(e)
    })), o.NativeCallModule.nativeCall.AttachNativeEvent("onUserInfoChange", (e, t) => n(this, void 0, void 0, function* () {
        if ("vipinfo" === e) {
            u.information("data", t);
            try {
                let e = JSON.parse(yield a.client.callServerFunction("GetUserInfo", 2));
                if (u.information("userInfo", e), c(e) && "1" === e.isVip) {
                    let e = yield a.client.callServerFunction("GetUserID");
                    f = !0, g = e, yield a.client.callServerFunction("SetSuspensionSkinInfo", d.SuspensionSkinHelperNS.vipSkinInfo)
                }
            } catch (e) {
                u.warning(e)
            }
        }
    })), o.NativeCallModule.nativeCall.AttachNativeEvent("OnUserLogout", e => n(this, void 0, void 0, function* () {
        try {
            yield y("")
        } catch (e) {
            u.warning(e)
        }
    }))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(310), o = i(23), r = i(24), s = i(4), l = i(16), d = i(9), u = i(2), c = i(6), h = i(10), f = i(12),
        g = i(34), p = i(26), v = i(124), m = i(0).default.getLogger("EmbeddedNativeFunction"),
        y = c.default(u.join(__rootDir, "../bin/ThunderHelper.node"));
    t.defaultNavite = new class {
        constructor() {
        }

        registerDefaultNativeFunction() {
            let e = [{functionName: "GetUserID", nativeFunc: this.getUserID}, {
                functionName: "GetSessionID",
                nativeFunc: this.getSessionID
            }, {functionName: "LoadLoginData", nativeFunc: this.loadLoginData}, {
                functionName: "FireLoginEvent",
                nativeFunc: this.fireLoginEvent
            }, {functionName: "GetUserInfo", nativeFunc: this.getUserInfo}, {
                functionName: "IsLogined",
                nativeFunc: this.isLogined
            }, {functionName: "OpenNewTab", nativeFunc: this.openNewTab}, {
                functionName: "TrackEvent",
                nativeFunc: this.trackEvent
            }, {functionName: "GetThunderVersion", nativeFunc: this.getThunderVersion}, {
                functionName: "ShowLoginDlg",
                nativeFunc: this.showLoginDlg
            }, {functionName: "GetPeerID", nativeFunc: this.getPeerID}, {
                functionName: "GetConfigValue",
                nativeFunc: this.getConfigValue
            }, {functionName: "SetConfigValue", nativeFunc: this.setConfigValue}, {
                functionName: "GetDeviceID",
                nativeFunc: this.getDeviceID
            }, {functionName: "BringMainWndToTop", nativeFunc: this.bringMainWndToTop}, {
                functionName: "ShowWebWnd",
                nativeFunc: this.showWebWnd
            }, {functionName: "SaveLoginData", nativeFunc: this.saveLoginData}];
            a.BrowserCtrl.registerDefaultNativeFunction(e)
        }

        saveLoginData(e, t, i, n) {
            do {
                if (m.information("saveLoginData", e, t, i), s.isNullOrUndefined(n) || s.isNullOrUndefined(n[0]) || s.isNullOrUndefined(n[1]) || s.isNullOrUndefined(n[2])) {
                    e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.ParamError);
                    break
                }
                let a = n[0], l = n[1], d = n[2];
                r.LoginHelperNS.loginSDKHelper.saveData(a, l, d).then(n => {
                    e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.Success, n)
                }).catch(() => {
                    e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.CallFailed)
                })
            } while (0)
        }

        getUserID(e, t, i, n) {
            r.LoginHelperNS.loginHelper.getUserInfo("userid", function (n) {
                null !== n && void 0 !== n && "" !== n || (n = "0"), e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.Success, n)
            })
        }

        getSessionID(e, t, i, n) {
            r.LoginHelperNS.loginHelper.getUserInfo("sessionid", function (n) {
                e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.Success, n)
            })
        }

        loadLoginData(e, t, i, n) {
            let a = null;
            do {
                if (s.isNullOrUndefined(n) || s.isNullOrUndefined(n[0]) || s.isNullOrUndefined(n[1])) {
                    e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.ParamError);
                    break
                }
                let l = n[0], d = n[1];
                a = "memory" === l && "initconfig" === d ? r.LoginHelperNS.loginSDKHelper.getInitData() : r.LoginHelperNS.loginSDKHelper.loadData(l, d), e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.Success, a)
            } while (0)
        }

        fireLoginEvent(e, t, i, a) {
            return n(this, void 0, void 0, function* () {
                do {
                    if (s.isNullOrUndefined(a) || !Array.isArray(a)) {
                        e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    if ("string" != typeof a[0]) {
                        e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let n = a[0], l = a[1], d = yield r.LoginHelperNS.loginSDKHelper.fireEvent(n, l);
                    e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.Success, JSON.stringify(d))
                } while (0)
            })
        }

        getUserInfo(e, t, i, n) {
            (s.isNullOrUndefined(e) || s.isNullOrUndefined(t) || s.isNullOrUndefined(i)) && e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.ParamError);
            let a = 0;
            if (s.isNullOrUndefined(n) || s.isNullOrUndefined(n[0])) a = 0; else {
                let e = n[0];
                a = null === e || void 0 === e || "" === e ? 0 : Number(e)
            }
            r.LoginHelperNS.loginHelper.getUserInfoEx(a, function (n) {
                e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.Success, n)
            })
        }

        isLogined(e, t, i, n) {
            (s.isNullOrUndefined(e) || s.isNullOrUndefined(t) || s.isNullOrUndefined(i)) && e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.ParamError), r.LoginHelperNS.loginHelper.isLogined(function (n) {
                e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.Success, n)
            })
        }

        openNewTab(e, t, i, n) {
            do {
                if (s.isNullOrUndefined(n)) break;
                if (s.isNullOrUndefined(n[0])) break;
                let a = n[0], r = n[1];
                l.NativeCallModule.nativeCall.CallNativeFunction("OpenNewTab", a, r), e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.Success)
            } while (0)
        }

        trackEvent(e, t, i, a) {
            return n(this, void 0, void 0, function* () {
                do {
                    if (s.isNullOrUndefined(e) || s.isNullOrUndefined(t) || s.isNullOrUndefined(i)) break;
                    if (!a || !a[0]) {
                        e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let n = a[0], r = void 0 === a[1] ? "" : a[1], l = void 0 === a[2] ? "" : a[2],
                        u = void 0 === a[3] ? 0 : a[3], c = void 0 === a[4] ? 0 : a[4], h = void 0 === a[5] ? 0 : a[5],
                        f = void 0 === a[6] ? 0 : a[6], g = void 0 === a[7] ? "" : a[7], p = void 0 === a[8] ? 0 : a[8],
                        v = yield d.XLStatNS.asyncTrackEvent(n, r, l, u, c, h, f, g, p);
                    e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.Success, v)
                } while (0)
            })
        }

        getThunderVersion(e, t, i, n) {
            let a = u.join(__rootDir, "../../Thunder.exe"), r = y.getFileVersion(a);
            e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.Success, r)
        }

        showLoginDlg(e, t, i, n) {
            let a = "other", l = !0;
            s.isNullOrUndefined(n) || s.isNullOrUndefined(n[0]) || (a = n[0]), s.isNullOrUndefined(n) || s.isNullOrUndefined(n[1]) || (l = n[1]), r.LoginHelperNS.loginHelper.showLoginDlg(a, l), e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.Success)
        }

        getPeerID(e, t, i, n) {
            let a = y.getPeerID();
            e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.Success, a)
        }

        getConfigValue(e, t, i, n) {
            do {
                if (!e || s.isNullOrUndefined(t) || !i) break;
                if (!n || !n[0] || !n[1]) {
                    e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.ParamError);
                    break
                }
                let a = n[0], r = n[1], l = n[2], d = h.ConfigNS.getValue(a, r, l);
                e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.Success, d)
            } while (0)
        }

        setConfigValue(e, t, i, n) {
            do {
                if (!e || s.isNullOrUndefined(t) || !i) break;
                if (!n || !n[0] || !n[1]) {
                    e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.ParamError);
                    break
                }
                let a = n[0], r = n[1], l = n[2];
                h.ConfigNS.setValue(a, r, l), e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.Success)
            } while (0)
        }

        getDeviceID(e, t, i, n) {
            let a = y.getPeerID();
            e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.Success, a)
        }

        bringMainWndToTop(e, t, i, a) {
            return n(this, void 0, void 0, function* () {
                do {
                    if (s.isNullOrUndefined(e) || s.isNullOrUndefined(t) || s.isNullOrUndefined(i)) break;
                    let n = !1, a = yield f.asyncRemoteCall.getCurrentWindow();
                    a && (yield a.show(), yield g.ToolsUtilitiesAWNS.setForegroundWindow(y, a), n = !0), e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.Success, n)
                } while (0)
            })
        }

        showWebWnd(e, t, i, a) {
            return n(this, void 0, void 0, function* () {
                do {
                    if (s.isNullOrUndefined(e) || s.isNullOrUndefined(t) || s.isNullOrUndefined(i)) break;
                    if (s.isNullOrUndefined(a) || s.isNullOrUndefined(a[0])) {
                        e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.ParamError);
                        break
                    }
                    let r = a[0];
                    if (a.splice(0, 1), null !== a[10] && void 0 !== a[10]) {
                        let e = a[10];
                        a[10] = (() => n(this, void 0, void 0, function* () {
                            return new Promise(i => {
                                p.NativeCallHostModule.nativeCallHost.callJsFunctionById(t, e, (e, t) => {
                                    m.information(e, t), i(t)
                                })
                            })
                        }))
                    }
                    if (null !== a[11] && void 0 !== a[11]) {
                        let e = a[11];
                        a[11] = (() => n(this, void 0, void 0, function* () {
                            p.NativeCallHostModule.nativeCallHost.callJsFunctionById(t, e)
                        }))
                    }
                    v.EmbeddedBrowserManagerNs.showWebWnd(r, ...a), e.callNativeFunctionCallback(t, i, o.NativeFunctionErrorCode.Success)
                } while (0)
            })
        }
    }
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(12), r = i(6).default(a.join(__rootDir, "../bin/ThunderHelper.node"));
    !function (e) {
        let t = null, i = null;

        function s() {
            r.asyncFindProcess("xlbrowsershell.exe", function (e) {
                let t = a.join(__rootDir, "../../").toLocaleLowerCase();
                e.forEach(e => {
                    let i = e.path;
                    i && -1 !== i.toLocaleLowerCase().indexOf(t) && r.emptyWorkingSet(e.id)
                })
            }), r.asyncFindProcess("Thunder.exe", function (e) {
                let t = a.join(__rootDir, "../../").toLocaleLowerCase();
                e.forEach(e => {
                    let i = e.path;
                    i && -1 !== i.toLocaleLowerCase().indexOf(t) && r.emptyWorkingSet(e.id)
                })
            }), i && clearInterval(i), i = setInterval(() => {
                s()
            }, 6e4)
        }

        function l() {
            t && (clearTimeout(t), t = null), i && (clearInterval(i), i = null)
        }

        e.init = function () {
            return n(this, void 0, void 0, function* () {
                let e = yield o.asyncRemoteCall.getCurrentWindow();
                e.on("hide", s), e.on("minimize", () => {
                    t = setTimeout(() => {
                        t = null, s()
                    }, 6e5)
                }), e.on("restore", l), e.on("show", l)
            })
        }, e.emptyBrowserWorkingSet = function () {
            r.asyncFindProcess("xlbrowsershell.exe", function (e) {
                let t = a.join(__rootDir, "../../").toLocaleLowerCase();
                e.forEach(e => {
                    let i = e.path;
                    i && -1 !== i.toLocaleLowerCase().indexOf(t) && r.emptyWorkingSet(e.id)
                })
            })
        }
    }(t.EmptyWorkingSetNS || (t.EmptyWorkingSetNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(2), a = i(9), o = i(0), r = i(6), s = o.default.getLogger("360"),
        l = r.default(n.join(__rootDir, "../bin/ThunderHelper.node")), d = "360HealthElf.exe",
        u = "360DesktopLite64.exe";
    var c, h;
    !function (e) {
        e[e.GWL_EXSTYLE = -20] = "GWL_EXSTYLE"
    }(c || (c = {})), function (e) {
        e[e.WS_EX_TOPMOST = 8] = "WS_EX_TOPMOST"
    }(h || (h = {}));
    let f = 5e3, g = void 0, p = void 0, v = !1, m = !1;

    function y() {
        do {
            if (v) break;
            v = !0, a.XLStatNS.trackEvent("core_event", "360healthelf_run")
        } while (0)
    }

    function k() {
        do {
            if (m) break;
            m = !0, a.XLStatNS.trackEvent("core_event", "360desktoplite_run")
        } while (0)
    }

    function T() {
        do {
            let e = l.getCursorPos(), t = l.getWndHandleFromPoint(e.x, e.y);
            if (!t) break;
            if (!l.isFullScreen(t)) break;
            if (!(l.getWindowLong(t, c.GWL_EXSTYLE) & h.WS_EX_TOPMOST)) {
                s.information("WS_EX_TOPMOST", !1);
                break
            }
            s.information("WS_EX_TOPMOST", !0);
            let i = l.getWindowThreadProcessId(t);
            if (!i) break;
            let n = l.getProcessImageName(i);
            s.information("getProcessImageName", n);
            let o = n.toLowerCase() === d.toLowerCase(), r = n.toLowerCase() === u.toLowerCase();
            (o || r) && (g && (clearInterval(g), g = void 0), a.XLStatNS.trackEvent("core_event", "fullscreen_top_popup"))
        } while (0)
    }

    t.fullScreenCheckBegin = function () {
        do {
            if (p) break;
            p = setTimeout(() => {
                clearTimeout(p), p = void 0, l.asyncFindProcess(d, function (e) {
                    let t = e && e.length > 0;
                    s.information("check process", d, t, e), t && y()
                }), l.asyncFindProcess(u, function (e) {
                    let t = e && e.length > 0;
                    s.information("check process", u, t, e), t && k()
                }), g = setInterval(() => {
                    T()
                }, f)
            }, 1e4)
        } while (0)
    }, t.fullScreenCheckEnd = function () {
        return new Promise(e => {
            g && (clearInterval(g), g = void 0), p && (clearTimeout(p), p = void 0), e(!0)
        })
    }
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(740), o = i(2), r = i(6), s = i(20), l = i(25), d = i(10), u = i(62), c = i(9),
        h = r.default(o.join(__rootDir, "../bin/ThunderHelper.node"));
    !function (e) {
        let t = -1;

        function i(e, i, ...n) {
            return t
        }

        e.init = function () {
            return n(this, void 0, void 0, function* () {
                let e = !1;
                do {
                    let i = o.join(__rootDir, "../../Thunder.exe"), n = {
                        appKey: "eGx4X2Rvd25sb2FkX2RpYWdub3NpcwBSAAE=",
                        appName: "xlx_download_diagnosis",
                        appVer: h.getFileVersion(i),
                        peerId: h.getPeerID(),
                        installChannel: h.getInstallChannel(),
                        configFile: o.join(i, "../detect_stat.xml"),
                        storageFile: o.join(i, "../detect_stat.dat"),
                        useServerXml: 0
                    };
                    if ((t = yield c.XLStatNS.initParam(n)) < 0) break;
                    e = !0
                } while (0);
                let r = {GetDetectStatCookie: i};
                return s.server.registerFunctions(r), setTimeout(() => n(this, void 0, void 0, function* () {
                    if (yield l.default.isInitedAw(), l.default.getConfigInfo("downloadDetectTools", "autoDetect")) {
                        let e = new Date, t = u.TimeHelperNS.formatDate(e, "yyyy-MM-dd");
                        t !== d.ConfigNS.getValue("downloadDetectTools", "autoDetectDate", "") && (d.ConfigNS.setValue("downloadDetectTools", "autoDetectDate", t), a.DownloadDetectToolsNS.start("auto"))
                    }
                }), 3e4), e
            })
        }, e.uninit = function () {
            return n(this, void 0, void 0, function* () {
                let e = !1;
                do {
                    if (t < 0) break;
                    yield c.XLStatNS.asyncUninit(t), e = !0
                } while (0);
                return e
            })
        }
    }(t.DownloadDetectHelperNS || (t.DownloadDetectHelperNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(0), r = i(6), s = i(84), l = i(741), d = i(742), u = i(4).promisify, c = i(39), h = i(7),
        f = i(9), g = r.default(a.join(__rootDir, "../bin/ThunderHelper.node")),
        p = o.default.getLogger("download-detect-tools");
    !function (e) {
        let t, o, r, v, m, y;
        !function (e) {
            e[e.AF_INET = 2] = "AF_INET", e[e.AF_INET6 = 23] = "AF_INET6"
        }(t = e.AfType || (e.AfType = {})), function (e) {
            e[e.IF_TYPE_SOFTWARE_LOOPBACK = 24] = "IF_TYPE_SOFTWARE_LOOPBACK"
        }(o = e.IfType || (e.IfType = {})), function (e) {
            e[e.IfOperStatusUp = 1] = "IfOperStatusUp", e[e.IfOperStatusDown = 2] = "IfOperStatusDown", e[e.IfOperStatusTesting = 3] = "IfOperStatusTesting", e[e.IfOperStatusUnknown = 4] = "IfOperStatusUnknown", e[e.IfOperStatusDormant = 5] = "IfOperStatusDormant", e[e.IfOperStatusNotPresent = 6] = "IfOperStatusNotPresent", e[e.IfOperStatusLowerLayerDown = 7] = "IfOperStatusLowerLayerDown"
        }(r = e.IfOperStatus || (e.IfOperStatus = {})), function (e) {
            e[e.None = 0] = "None", e[e.Started = 1] = "Started", e[e.Success = 2] = "Success", e[e.Failed = 3] = "Failed"
        }(v = e.DetectState || (e.DetectState = {})), function (e) {
            e[e.IndexServer = 0] = "IndexServer", e[e.BTIndexServer = 1] = "BTIndexServer", e[e.EMuleIndexServer = 2] = "EMuleIndexServer", e[e.MirrorSource = 3] = "MirrorSource", e[e.TorrentServer = 4] = "TorrentServer", e[e.P2PServer = 5] = "P2PServer", e[e.PingServer = 6] = "PingServer", e[e.NATServer = 7] = "NATServer", e[e.AccountLogin = 8] = "AccountLogin", e[e.VipDownload = 9] = "VipDownload", e[e.UPNPState = 10] = "UPNPState", e[e.DHTState = 11] = "DHTState", e[e.IPv6Support = 12] = "IPv6Support"
        }(m = e.DetectItemType || (e.DetectItemType = {})), function (e) {
            e.Start = "Start", e.StartItem = "StartItem", e.StatusChange = "StatusChange", e.FinishItem = "FinishItem", e.Finish = "Finish"
        }(y = e.DetectEvent || (e.DetectEvent = {}));
        const k = new class extends c.default {
            constructor() {
                super(), this.detectingItems = null, this.localIPInfo = null, this.currentDetectingIndex = void 0, this.adapterInfos = null, this.statCookie = -1, this.detectingItems = [{
                    type: m.IndexServer,
                    name: "普通任务信息",
                    state: v.None,
                    detectDesc: "正在扫描...",
                    detail: "使用迅雷下载“HTTP、FTP”协议的下载链接时，需要查询下载链接对应的文件信息。\n          如果此项失败，您将无法加速下载“HTTP、FTP”协议的下载链接。\n          通常该问题与您的网络环境有关，您可以联系客服协助您解决问题。",
                    expand: !1,
                    showExpand: !1,
                    detect: this.detectIndexServer.bind(this)
                }, {
                    type: m.BTIndexServer,
                    name: "BT任务信息",
                    state: v.None,
                    detectDesc: "正在扫描...",
                    detail: "使用迅雷下载BT任务时，需要查询BT任务对应的文件信息。\n          如果此项失败，您将无法加速下载BT任务。\n          通常该问题与您的网络环境有关，您可以联系客服协助您解决问题。",
                    expand: !1,
                    showExpand: !1,
                    detect: this.detectBTIndexServer.bind(this)
                }, {
                    type: m.TorrentServer,
                    name: "磁力任务信息",
                    state: v.None,
                    detectDesc: "正在扫描...",
                    detail: "使用迅雷下载磁力链接时，需要查询磁力链接对应的BT种子信息。\n          如果此项失败，您将无法下载磁力链接。\n          通常该问题与您的网络环境有关，您可以联系客服协助您解决问题。",
                    expand: !1,
                    showExpand: !1,
                    detect: this.detectTorrentServer.bind(this)
                }, {
                    type: m.EMuleIndexServer,
                    name: "eMule任务信息",
                    state: v.None,
                    detectDesc: "正在扫描...",
                    detail: "使用迅雷下载“ed2k”协议的下载链接时，需要查询下载链接对应的文件信息。\n          如果此项失败，您将无法加速下载eMule任务。\n          通常该问题与您的网络环境有关，您可以联系客服协助您解决问题。",
                    expand: !1,
                    showExpand: !1,
                    detect: this.detectEMuleIndexServer.bind(this)
                }, {
                    type: m.MirrorSource,
                    name: "主机镜像资源服务",
                    state: v.None,
                    detectDesc: "正在扫描...",
                    detail: "使用迅雷下载任意任务时，需要通过该服务查询主机镜像资源。\n          如果此项失败，您下载任意任务时，都无法获得主机镜像资源加速。\n          通常该问题与您的网络环境有关，您可以联系客服协助您解决问题。",
                    expand: !1,
                    showExpand: !1,
                    detect: this.detectMirrorSource.bind(this)
                }, {
                    type: m.P2PServer,
                    name: "节点镜像资源服务",
                    state: v.None,
                    detectDesc: "正在扫描...",
                    detail: "使用迅雷下载任意任务时，需要通过该服务查询节点镜像资源。\n          如果此项失败，您下载任意任务时，都无法获得节点镜像资源加速。\n          通常该问题与您的网络环境有关，您可以联系客服协助您解决问题。",
                    expand: !1,
                    showExpand: !1,
                    detect: this.detectP2PServer.bind(this)
                }, {
                    type: m.PingServer,
                    name: "连通检测服务",
                    state: v.None,
                    detectDesc: "正在扫描...",
                    detail: "使用迅雷下载任意任务时，需要通过该服务检测各个镜像资源的连通性，从而提升镜像资源连通率，理论上可以更快获得加速效果。\n          如果此项失败，您下载任意任务时，下载加速效果提升较为缓慢。\n          通常该问题与您的网络环境有关，您可以联系客服协助您解决问题。",
                    expand: !1,
                    showExpand: !1,
                    detect: this.detectPingServer.bind(this)
                }, {
                    type: m.NATServer,
                    name: "网络感知服务",
                    state: v.None,
                    detectDesc: "正在扫描...",
                    detail: "使用迅雷下载任意任务时，需要通过该服务感知您与节点镜像资源之间的网络连接结构，从而提升节点镜像资源连通率，理论上可以获得更快的下载速度。\n          如果此项失败，您下载任意任务时，下载加速效果较差。\n          通常该问题与您的网络环境有关，您可以联系客服协助您解决问题。",
                    expand: !1,
                    showExpand: !1,
                    detect: this.detectNATServer.bind(this)
                }, {
                    type: m.AccountLogin,
                    name: "帐号登录服务",
                    state: v.None,
                    detectDesc: "正在扫描...",
                    detail: "使用迅雷登录帐号时，需要通过该服务获取您的帐号信息。\n          如果此项失败，您将无法登录迅雷帐号。\n          通常该问题与您的网络环境有关，您可以联系客服协助您解决问题。",
                    expand: !1,
                    showExpand: !1,
                    detect: this.detectAccountLogin.bind(this)
                }, {
                    type: m.VipDownload,
                    name: "会员加速服务",
                    state: v.None,
                    detectDesc: "正在扫描...",
                    detail: "使用迅雷会员加速下载任意任务时，需要通过该服务查询会员加速资源，从而获得会员加速效果。\n          如果此项失败，您下载任意任务时，都无法获得会员加速效果。\n          通常该问题与您的网络环境有关，您可以联系客服协助您解决问题。",
                    expand: !1,
                    showExpand: !1,
                    detect: this.detectVipDownload.bind(this)
                }, {
                    type: m.UPNPState,
                    name: "UPnP状态",
                    state: v.None,
                    detectDesc: "正在扫描...",
                    detail: "迅雷能够利用路由器的UPnP功能进行端口映射，从而提升镜像资源的连通率，理论上可以获得更快的下载速度。\n          如果您没有使用路由器，这项失败可以忽略。\n          如果您使用路由器，并且此项失败，请您登录路由器的管理页面，开启“UPnP”功能。",
                    expand: !1,
                    showExpand: !1,
                    detect: this.detectUPNPState.bind(this)
                }, {
                    type: m.DHTState,
                    name: "DHT状态",
                    state: v.None,
                    detectDesc: "正在扫描...",
                    detail: "使用迅雷下载BT任务时，需要通过DHT网络获取更多镜像资源，理论上可以获得更快的下载速度。\n          如果此项失败，您下载BT任务时，下载加速效果可能略受影响。\n          但是如果“BT任务信息、节点镜像资源服务”正常，则该失败可以忽略。",
                    expand: !1,
                    showExpand: !1,
                    detect: this.detectDHTState.bind(this)
                }, {
                    type: m.IPv6Support,
                    name: "IPv6支持",
                    state: v.None,
                    detectDesc: "正在扫描...",
                    detail: "迅雷现已支持IPv6互联网协议，通过该协议迅雷可以更快速可靠的连接镜像资源，从而提升镜像资源连通率，理论上可以获得更快的下载速度。\n          如果此项失败，可能是由于您的路由器或网络运营商暂未支持IPv6互联网协议，不过该项失败并不会影响您的正常下载。",
                    expand: !1,
                    showExpand: !1,
                    detect: this.detectIPv6Support.bind(this)
                }]
            }

            dnsLookupAW(e) {
                return n(this, void 0, void 0, function* () {
                    let t = null;
                    const i = u(l.lookup);
                    try {
                        t = yield i(e, 4)
                    } catch (t) {
                        p.warning("dnsLookup IPv4 failed! hostName", e, "e", t)
                    }
                    return t
                })
            }

            tcpConnectAW(e, t, i = 4) {
                return n(this, void 0, void 0, function* () {
                    return new Promise(a => n(this, void 0, void 0, function* () {
                        let n = new s.Socket;
                        try {
                            n.on("connect", () => {
                                a(!0), n.end()
                            }), n.on("error", i => {
                                p.error("tcpConnectAW error! host", e, "port", t, i), a(!1), n.end()
                            }), n.on("timeout", () => {
                                p.error("tcpConnectAW timeout! host", e, "port", t), a(!1), n.end()
                            }), n.connect({port: t, host: e, family: i})
                        } catch (i) {
                            p.warning("tcpConnect failed! host", e, "port", t, i), a(!1)
                        }
                    }))
                })
            }

            detectTcpConnect(e, t, i = 80) {
                return n(this, void 0, void 0, function* () {
                    let n = !1;
                    do {
                        this.setDetectDesc((-1 !== e.name.indexOf("服务") ? "开始连接" : "开始查询") + e.name);
                        let a = yield this.dnsLookupAW(t);
                        if (!a) {
                            this.setDetectDesc("域名解析失败", "域名解析失败");
                            break
                        }
                        this.setDetectDesc("域名解析成功");
                        let o = (new Date).getTime();
                        if (yield this.tcpConnectAW(a.address, i)) {
                            let t = (new Date).getTime() - o;
                            this.setDetectDesc(e.name + (-1 !== e.name.indexOf("服务") ? "连接" : "查询") + "成功（耗时：" + t + "毫秒）"), n = !0
                        } else this.setDetectDesc(e.name + (-1 !== e.name.indexOf("服务") ? "连接" : "查询") + "失败", "tcp连接失败（" + a.address + ":" + i + "）")
                    } while (0);
                    return n
                })
            }

            setDetectDesc(e, t) {
                if (void 0 !== this.currentDetectingIndex) {
                    let i = this.detectingItems[this.currentDetectingIndex];
                    i.detectDesc = e, i.statResult = t, this.fireEvent(y.StatusChange, i, e)
                }
            }

            detectIndexServer(e) {
                return n(this, void 0, void 0, function* () {
                    return this.detectTcpConnect(e, "hub5idx.v6.shub.sandai.net")
                })
            }

            detectBTIndexServer(e) {
                return n(this, void 0, void 0, function* () {
                    return this.detectTcpConnect(e, "hub5btmain.v6.shub.sandai.net")
                })
            }

            detectEMuleIndexServer(e) {
                return n(this, void 0, void 0, function* () {
                    return this.detectTcpConnect(e, "hub5emu.v6.shub.sandai.net")
                })
            }

            detectTorrentServer(e) {
                return n(this, void 0, void 0, function* () {
                    return this.detectTcpConnect(e, "pool.v6.bt.n0808.com")
                })
            }

            detectP2PServer(e) {
                return n(this, void 0, void 0, function* () {
                    return this.detectTcpConnect(e, "hub5pr.sandai.net")
                })
            }

            detectPingServer(e) {
                return n(this, void 0, void 0, function* () {
                    let t = !1, i = "hub5u.sandai.net";
                    this.setDetectDesc("开始连接" + e.name);
                    let n = (new Date).getTime(), a = yield d.promise.probe(i);
                    if (a && a.alive) {
                        let i = (new Date).getTime() - n;
                        this.setDetectDesc(e.name + "连接成功（耗时：" + i + "毫秒）"), t = !0
                    } else p.information("ping failed! host:", i, ", result:", a), this.setDetectDesc(e.name + "连接失败", "ping失败（" + i + "）");
                    return t
                })
            }

            detectDCDNServer(e) {
                return n(this, void 0, void 0, function* () {
                    let e = !1;
                    do {
                        this.setDetectDesc("开始连接会员加速服务");
                        let t = yield this.dnsLookupAW("dcdnhub.xfs.xcloud.sandai.net");
                        if (!t) {
                            this.setDetectDesc("域名解析失败", "dcdnhub.xfs.xcloud.sandai.net域名解析失败");
                            break
                        }
                        this.setDetectDesc("域名解析成功");
                        let i = (new Date).getTime();
                        if (yield this.tcpConnectAW(t.address, 80)) {
                            let t = (new Date).getTime() - i;
                            this.setDetectDesc("会员加速服务连接成功（耗时：" + t + "毫秒）"), e = !0
                        } else this.setDetectDesc("会员加速服务连接失败", "tcp连接失败（" + t.address + ":80）")
                    } while (0);
                    return e
                })
            }

            detectVipAuthServer(e) {
                return n(this, void 0, void 0, function* () {
                    let e = !1;
                    do {
                        this.setDetectDesc("开始连接会员加速验证服务");
                        let t = yield this.dnsLookupAW("ali.pc-x.speed.auth.vip.xunlei.com");
                        if (!t) {
                            this.setDetectDesc("域名解析失败", "ali.pc-x.speed.auth.vip.xunlei.com域名解析失败");
                            break
                        }
                        this.setDetectDesc("域名解析成功");
                        let i = (new Date).getTime();
                        if (yield this.tcpConnectAW(t.address, 80)) {
                            let t = (new Date).getTime() - i;
                            this.setDetectDesc("会员加速验证服务连接成功（耗时：" + t + "毫秒）"), e = !0
                        } else this.setDetectDesc("会员加速验证服务连接失败", "tcp连接失败（" + t.address + ":80）")
                    } while (0);
                    return e
                })
            }

            detectMirrorSource(e) {
                return n(this, void 0, void 0, function* () {
                    return this.detectTcpConnect(e, "hub5sr.v6.shub.sandai.net")
                })
            }

            detectNATServer(e) {
                return n(this, void 0, void 0, function* () {
                    return new Promise(t => n(this, void 0, void 0, function* () {
                        let i = !1;
                        {
                            const t = ["hub5pn.sandai.net", "g1.hub5pn.sandai.net", "g2.hub5pn.sandai.net", "g3.hub5pn.sandai.net"];
                            let n = "";
                            for (let a = 0; a < t.length; ++a) {
                                let o = t[a];
                                this.setDetectDesc("开始连接" + e.name + "【" + (a + 1) + "】");
                                let r = (new Date).getTime(), s = yield d.promise.probe(o);
                                if (s && s.alive) {
                                    let t = (new Date).getTime() - r;
                                    this.setDetectDesc(e.name + "连接成功（耗时：" + t + "毫秒）"), i = !0;
                                    break
                                }
                                p.warning("detectNATServer ping failed! host:", o, ", result", s), n.length > 0 && (n += ","), n += "ping失败（" + o + "）", this.setDetectDesc(e.name + "连接失败", n)
                            }
                        }
                        t(i)
                    }))
                })
            }

            detectAccountLogin(e) {
                return n(this, void 0, void 0, function* () {
                    return new Promise(t => n(this, void 0, void 0, function* () {
                        this.setDetectDesc("开始帐号登录服务");
                        let n = (new Date).getTime();
                        const a = yield i(18);
                        a.defaults.adapter = i(21);
                        let o = e.statResult || "";
                        try {
                            let e = yield a.request({
                                method: "options",
                                url: "https://xluser-ssl.xunlei.com/xluser.core.login",
                                params: {}
                            });
                            if (204 === e.status) {
                                let e = (new Date).getTime() - n;
                                this.setDetectDesc("连接帐号登录服务成功（耗时：" + e + "毫秒）"), t(!0)
                            } else o.length > 0 && (o += ","), o += "options请求失败（" + e.status + "）", this.setDetectDesc("连接帐号登录服务失败（" + e.status + "）", o), t(!1)
                        } catch (e) {
                            p.information("detectAccountLogin exception! e", e), o.length > 0 && (o += ","), o += "options请求失败，" + (e || ""), this.setDetectDesc("连接帐号登录服务失败", o), t(!1)
                        }
                    }))
                })
            }

            detectVipDownload(e) {
                return n(this, void 0, void 0, function* () {
                    return new Promise(t => n(this, void 0, void 0, function* () {
                        let i = !1;
                        do {
                            if (!(yield this.detectVipAuthServer(e))) break;
                            if (!(yield this.detectDCDNServer(e))) break;
                            i = !0
                        } while (0);
                        t(i)
                    }))
                })
            }

            detectUPNPState(e) {
                return n(this, void 0, void 0, function* () {
                    return new Promise(e => n(this, void 0, void 0, function* () {
                        this.setDetectDesc("开始检测UPnP状态");
                        let t = yield h.client.callServerFunction("QueryGlobalInfo"), i = t && t.isUPnPReady > 0;
                        this.setDetectDesc("UPnP状态" + (i ? "可用" : "不可用")), e(i)
                    }))
                })
            }

            detectDHTState(e) {
                return n(this, void 0, void 0, function* () {
                    return new Promise(e => n(this, void 0, void 0, function* () {
                        this.setDetectDesc("开始检测DHT状态");
                        let t = yield h.client.callServerFunction("QueryGlobalInfo"), i = t && t.dhtNodeCount > 0;
                        this.setDetectDesc("DHT状态" + (i ? "可用" : "不可用")), e(i)
                    }))
                })
            }

            detectIPv6Support(e) {
                return n(this, void 0, void 0, function* () {
                    return new Promise(e => {
                        this.setDetectDesc("开始检测IPv6支持"), g.getNetAdapterInfo(i => n(this, void 0, void 0, function* () {
                            p.information("adapterInfos", i), this.adapterInfos = i;
                            let n = !1;
                            for (let e = 0; e < i.length; ++e) {
                                let a = i[e];
                                if (a.type !== o.IF_TYPE_SOFTWARE_LOOPBACK && a.operStatus === r.IfOperStatusUp) {
                                    for (let e = 0; e < a.ipAddresses.length; ++e) if (a.ipAddresses[e].family === t.AF_INET6) {
                                        n = !0;
                                        break
                                    }
                                    if (n) break
                                }
                            }
                            if (n) {
                                let e = null;
                                const t = u(l.lookup);
                                let i = "hub5idx.v6.shub.sandai.net";
                                try {
                                    e = yield t(i, 6)
                                } catch (e) {
                                    p.warning("dnsLookup IPv6 failed! hostName", i, "e", e)
                                }
                                n = !!e && (yield this.tcpConnectAW(e.address, 80, 6))
                            }
                            this.setDetectDesc(n ? "机器和网络环境已支持IPv6" : "机器或网络环境不支持IPv6"), e(n)
                        }))
                    })
                })
            }

            sendFinishStat(e, t) {
                return n(this, void 0, void 0, function* () {
                    let n = "result=" + encodeURIComponent(e);
                    n += ",wrong_cnt=" + t, n += ",ip=" + (this.localIPInfo && this.localIPInfo.localIP ? this.localIPInfo.localIP : ""), n += ",windows_version=" + (yield Promise.resolve().then(() => i(57))).release();
                    let o = a.join(__rootDir, "../bin/SDK/DownloadSDK.dll");
                    n += ",download_engine_version=" + g.getFileVersion(o), n += ",dns=" + this.getDNSList().join("|"), f.XLStatNS.trackEvent("xlx_download_diagnosis", "download_diagnosis_result", "", 0, 0, 0, 0, n, this.statCookie)
                })
            }

            getLocalIPInfoAW() {
                return n(this, void 0, void 0, function* () {
                    if (this.localIPInfo) return this.localIPInfo;
                    const e = yield i(18);
                    e.defaults.adapter = i(21);
                    try {
                        let t = yield e.request({
                            method: "post",
                            url: "https://tool.lu/ip/ajax.html",
                            params: {},
                            headers: {}
                        });
                        200 === t.status && t.data && t.data.text && (this.localIPInfo = {
                            teleCommunications: t.data.text.ip2region_location,
                            localIP: t.data.text.ip
                        })
                    } catch (e) {
                        p.warning("request https://tool.lu/ip/ajax.html failed! e", e)
                    }
                    return this.localIPInfo
                })
            }

            start(e) {
                return n(this, void 0, void 0, function* () {
                    let t = "", i = 0;
                    this.statCookie = yield h.client.callServerFunction("GetDetectStatCookie"), h.client.broadcastEvent("DownloadDetectStart", e), this.fireEvent(y.Start);
                    let n = v.Success;
                    for (let e = 0; e < this.detectingItems.length; ++e) {
                        let a = this.detectingItems[e];
                        this.currentDetectingIndex = e, a.state = v.Started, this.fireEvent(y.StartItem, a, e), (yield a.detect(a)) ? a.state = v.Success : (a.state = v.Failed, n = v.Failed, t += a.name + "," + (a.statResult || "") + "|", i++), this.fireEvent(y.FinishItem, a, e, a.state)
                    }
                    yield this.getLocalIPInfoAW(), this.fireEvent(y.Finish, n), this.sendFinishStat(t, i).catch()
                })
            }

            getAllDectectItems() {
                return this.detectingItems
            }

            getDNSList() {
                let e = [];
                if (this.adapterInfos) {
                    let t = {};
                    for (let e = 0; e < this.adapterInfos.length; ++e) {
                        let i = this.adapterInfos[e];
                        i.type !== o.IF_TYPE_SOFTWARE_LOOPBACK && i.operStatus === r.IfOperStatusUp && i.dnsAddresses.forEach(e => {
                            t[e] = !0
                        })
                    }
                    e = Object.keys(t)
                }
                return e
            }

            restart(e) {
                return n(this, void 0, void 0, function* () {
                    for (let e = 0; e < this.detectingItems.length; ++e) {
                        let t = this.detectingItems[e];
                        t.state = v.None, t.detectDesc = "正在扫描…"
                    }
                    return this.currentDetectingIndex = 0, this.start(e)
                })
            }
        };
        e.getLocalIPInfo = function () {
            return n(this, void 0, void 0, function* () {
                return k.getLocalIPInfoAW()
            })
        }, e.start = function (e) {
            k.start(e).catch()
        }, e.restart = function (e) {
            k.restart(e).catch()
        }, e.getAllDectectItems = function () {
            return k.getAllDectectItems()
        }, e.getDNSList = function () {
            return k.getDNSList()
        }, e.attachListener = function (e, t) {
            k.attachListener(e, t)
        }, e.detachListener = function (e, t) {
            k.detachListener(e, t)
        }
    }(t.DownloadDetectToolsNS || (t.DownloadDetectToolsNS = {}))
}, function (e, t) {
    e.exports = require("dns")
}, function (e, t, i) {
    var n = {};
    n.sys = i(743), n.promise = i(459), e.exports = n
}, function (e, t, i) {
    "use strict";
    var n = i(459);
    t.probe = function (e, t, i) {
        var a = i || {};
        return n.probe(e, a).then(function (e) {
            t(e.alive, null)
        }).catch(function (e) {
            t(null, e)
        }).done()
    }
}, function (e, t, i) {
    /*!
 *
 * Copyright 2009-2017 Kris Kowal under the terms of the MIT
 * license found at https://github.com/kriskowal/q/blob/v1/LICENSE
 *
 * With parts by Tyler Close
 * Copyright 2007-2009 Tyler Close under the terms of the MIT X license found
 * at http://www.opensource.org/licenses/mit-license.html
 * Forked at ref_send.js version: 2009-05-11
 *
 * With parts by Mark Miller
 * Copyright (C) 2011 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */
    !function (t) {
        "use strict";
        "function" == typeof bootstrap ? bootstrap("promise", t) : e.exports = t()
    }(function () {
        "use strict";
        var e = !1;
        try {
            throw new Error
        } catch (t) {
            e = !!t.stack
        }
        var t, i = w(), n = function () {
        }, a = function () {
            var e = {task: void 0, next: null}, t = e, i = !1, n = void 0, o = !1, r = [];

            function s() {
                for (var t, n; e.next;) t = (e = e.next).task, e.task = void 0, (n = e.domain) && (e.domain = void 0, n.enter()), l(t, n);
                for (; r.length;) l(t = r.pop());
                i = !1
            }

            function l(e, t) {
                try {
                    e()
                } catch (e) {
                    if (o) throw t && t.exit(), setTimeout(s, 0), t && t.enter(), e;
                    setTimeout(function () {
                        throw e
                    }, 0)
                }
                t && t.exit()
            }

            if (a = function (e) {
                t = t.next = {task: e, domain: o && process.domain, next: null}, i || (i = !0, n())
            }, "object" == typeof process && "[object process]" === process.toString() && process.nextTick) o = !0, n = function () {
                process.nextTick(s)
            }; else if ("function" == typeof setImmediate) n = "undefined" != typeof window ? setImmediate.bind(window, s) : function () {
                setImmediate(s)
            }; else if ("undefined" != typeof MessageChannel) {
                var d = new MessageChannel;
                d.port1.onmessage = function () {
                    n = u, d.port1.onmessage = s, s()
                };
                var u = function () {
                    d.port2.postMessage(0)
                };
                n = function () {
                    setTimeout(s, 0), u()
                }
            } else n = function () {
                setTimeout(s, 0)
            };
            return a.runAfter = function (e) {
                r.push(e), i || (i = !0, n())
            }, a
        }(), o = Function.call;

        function r(e) {
            return function () {
                return o.apply(e, arguments)
            }
        }

        var s, l = r(Array.prototype.slice), d = r(Array.prototype.reduce || function (e, t) {
            var i = 0, n = this.length;
            if (1 === arguments.length) for (; ;) {
                if (i in this) {
                    t = this[i++];
                    break
                }
                if (++i >= n) throw new TypeError
            }
            for (; i < n; i++) i in this && (t = e(t, this[i], i));
            return t
        }), u = r(Array.prototype.indexOf || function (e) {
            for (var t = 0; t < this.length; t++) if (this[t] === e) return t;
            return -1
        }), c = r(Array.prototype.map || function (e, t) {
            var i = this, n = [];
            return d(i, function (a, o, r) {
                n.push(e.call(t, o, r, i))
            }, void 0), n
        }), h = Object.create || function (e) {
            function t() {
            }

            return t.prototype = e, new t
        }, f = Object.defineProperty || function (e, t, i) {
            return e[t] = i.value, e
        }, g = r(Object.prototype.hasOwnProperty), p = Object.keys || function (e) {
            var t = [];
            for (var i in e) g(e, i) && t.push(i);
            return t
        }, v = r(Object.prototype.toString);
        s = "undefined" != typeof ReturnValue ? ReturnValue : function (e) {
            this.value = e
        };
        var m = "From previous event:";

        function y(t, i) {
            if (e && i.stack && "object" == typeof t && null !== t && t.stack) {
                for (var n = [], a = i; a; a = a.source) a.stack && (!t.__minimumStackCounter__ || t.__minimumStackCounter__ > a.stackCounter) && (f(t, "__minimumStackCounter__", {
                    value: a.stackCounter,
                    configurable: !0
                }), n.unshift(a.stack));
                n.unshift(t.stack);
                var o = function (e) {
                    for (var t = e.split("\n"), i = [], n = 0; n < t.length; ++n) {
                        var a = t[n];
                        !T(a) && (-1 === (o = a).indexOf("(module.js:") && -1 === o.indexOf("(node.js:")) && a && i.push(a)
                    }
                    var o;
                    return i.join("\n")
                }(n.join("\n" + m + "\n"));
                f(t, "stack", {value: o, configurable: !0})
            }
        }

        function k(e) {
            var t = /at .+ \((.+):(\d+):(?:\d+)\)$/.exec(e);
            if (t) return [t[1], Number(t[2])];
            var i = /at ([^ ]+):(\d+):(?:\d+)$/.exec(e);
            if (i) return [i[1], Number(i[2])];
            var n = /.*@(.+):(\d+)$/.exec(e);
            return n ? [n[1], Number(n[2])] : void 0
        }

        function T(e) {
            var n = k(e);
            if (!n) return !1;
            var a = n[0], o = n[1];
            return a === t && o >= i && o <= $
        }

        function w() {
            if (e) try {
                throw new Error
            } catch (e) {
                var i = e.stack.split("\n"), n = k(i[0].indexOf("@") > 0 ? i[1] : i[2]);
                if (!n) return;
                return t = n[0], n[1]
            }
        }

        function C(e) {
            return e instanceof A ? e : E(e) ? (t = e, i = b(), C.nextTick(function () {
                try {
                    t.then(i.resolve, i.reject, i.notify)
                } catch (e) {
                    i.reject(e)
                }
            }), i.promise) : W(e);
            var t, i
        }

        C.resolve = C, C.nextTick = a, C.longStackSupport = !1;
        var S = 1;

        function b() {
            var t, i = [], n = [], a = h(b.prototype), o = h(A.prototype);
            if (o.promiseDispatch = function (e, a, o) {
                var r = l(arguments);
                i ? (i.push(r), "when" === a && o[1] && n.push(o[1])) : C.nextTick(function () {
                    t.promiseDispatch.apply(t, r)
                })
            }, o.valueOf = function () {
                if (i) return o;
                var e = x(t);
                return N(e) && (t = e), e
            }, o.inspect = function () {
                return t ? t.inspect() : {state: "pending"}
            }, C.longStackSupport && e) try {
                throw new Error
            } catch (e) {
                o.stack = e.stack.substring(e.stack.indexOf("\n") + 1), o.stackCounter = S++
            }

            function r(a) {
                t = a, C.longStackSupport && e && (o.source = a), d(i, function (e, t) {
                    C.nextTick(function () {
                        a.promiseDispatch.apply(a, t)
                    })
                }, void 0), i = void 0, n = void 0
            }

            return a.promise = o, a.resolve = function (e) {
                t || r(C(e))
            }, a.fulfill = function (e) {
                t || r(W(e))
            }, a.reject = function (e) {
                t || r(K(e))
            }, a.notify = function (e) {
                t || d(n, function (t, i) {
                    C.nextTick(function () {
                        i(e)
                    })
                }, void 0)
            }, a
        }

        function I(e) {
            if ("function" != typeof e) throw new TypeError("resolver must be a function.");
            var t = b();
            try {
                e(t.resolve, t.reject, t.notify)
            } catch (e) {
                t.reject(e)
            }
            return t.promise
        }

        function _(e) {
            return I(function (t, i) {
                for (var n = 0, a = e.length; n < a; n++) C(e[n]).then(t, i)
            })
        }

        function A(e, t, i) {
            void 0 === t && (t = function (e) {
                return K(new Error("Promise does not support operation: " + e))
            }), void 0 === i && (i = function () {
                return {state: "unknown"}
            });
            var n = h(A.prototype);
            if (n.promiseDispatch = function (i, a, o) {
                var r;
                try {
                    r = e[a] ? e[a].apply(n, o) : t.call(n, a, o)
                } catch (e) {
                    r = K(e)
                }
                i && i(r)
            }, n.inspect = i, i) {
                var a = i();
                "rejected" === a.state && (n.exception = a.reason), n.valueOf = function () {
                    var e = i();
                    return "pending" === e.state || "rejected" === e.state ? n : e.value
                }
            }
            return n
        }

        function D(e, t, i, n) {
            return C(e).then(t, i, n)
        }

        function x(e) {
            if (N(e)) {
                var t = e.inspect();
                if ("fulfilled" === t.state) return t.value
            }
            return e
        }

        function N(e) {
            return e instanceof A
        }

        function E(e) {
            return (t = e) === Object(t) && "function" == typeof e.then;
            var t
        }

        "object" == typeof process && process && process.env && process.env.Q_DEBUG && (C.longStackSupport = !0), C.defer = b, b.prototype.makeNodeResolver = function () {
            var e = this;
            return function (t, i) {
                t ? e.reject(t) : arguments.length > 2 ? e.resolve(l(arguments, 1)) : e.resolve(i)
            }
        }, C.Promise = I, C.promise = I, I.race = _, I.all = z, I.reject = K, I.resolve = C, C.passByCopy = function (e) {
            return e
        }, A.prototype.passByCopy = function () {
            return this
        }, C.join = function (e, t) {
            return C(e).join(t)
        }, A.prototype.join = function (e) {
            return C([this, e]).spread(function (e, t) {
                if (e === t) return e;
                throw new Error("Q can't join: not the same: " + e + " " + t)
            })
        }, C.race = _, A.prototype.race = function () {
            return this.then(C.race)
        }, C.makePromise = A, A.prototype.toString = function () {
            return "[object Promise]"
        }, A.prototype.then = function (e, t, i) {
            var n = this, a = b(), o = !1;
            return C.nextTick(function () {
                n.promiseDispatch(function (t) {
                    o || (o = !0, a.resolve(function (t) {
                        try {
                            return "function" == typeof e ? e(t) : t
                        } catch (e) {
                            return K(e)
                        }
                    }(t)))
                }, "when", [function (e) {
                    o || (o = !0, a.resolve(function (e) {
                        if ("function" == typeof t) {
                            y(e, n);
                            try {
                                return t(e)
                            } catch (e) {
                                return K(e)
                            }
                        }
                        return K(e)
                    }(e)))
                }])
            }), n.promiseDispatch(void 0, "when", [void 0, function (e) {
                var t, n = !1;
                try {
                    t = function (e) {
                        return "function" == typeof i ? i(e) : e
                    }(e)
                } catch (e) {
                    if (n = !0, !C.onerror) throw e;
                    C.onerror(e)
                }
                n || a.notify(t)
            }]), a.promise
        }, C.tap = function (e, t) {
            return C(e).tap(t)
        }, A.prototype.tap = function (e) {
            return e = C(e), this.then(function (t) {
                return e.fcall(t).thenResolve(t)
            })
        }, C.when = D, A.prototype.thenResolve = function (e) {
            return this.then(function () {
                return e
            })
        }, C.thenResolve = function (e, t) {
            return C(e).thenResolve(t)
        }, A.prototype.thenReject = function (e) {
            return this.then(function () {
                throw e
            })
        }, C.thenReject = function (e, t) {
            return C(e).thenReject(t)
        }, C.nearer = x, C.isPromise = N, C.isPromiseAlike = E, C.isPending = function (e) {
            return N(e) && "pending" === e.inspect().state
        }, A.prototype.isPending = function () {
            return "pending" === this.inspect().state
        }, C.isFulfilled = function (e) {
            return !N(e) || "fulfilled" === e.inspect().state
        }, A.prototype.isFulfilled = function () {
            return "fulfilled" === this.inspect().state
        }, C.isRejected = function (e) {
            return N(e) && "rejected" === e.inspect().state
        }, A.prototype.isRejected = function () {
            return "rejected" === this.inspect().state
        };
        var P, M, O, F = [], L = [], B = [], U = !0;

        function R() {
            F.length = 0, L.length = 0, U || (U = !0)
        }

        function K(e) {
            var t = A({
                when: function (t) {
                    return t && function (e) {
                        if (U) {
                            var t = u(L, e);
                            -1 !== t && ("object" == typeof process && "function" == typeof process.emit && C.nextTick.runAfter(function () {
                                var i = u(B, e);
                                -1 !== i && (process.emit("rejectionHandled", F[t], e), B.splice(i, 1))
                            }), L.splice(t, 1), F.splice(t, 1))
                        }
                    }(this), t ? t(e) : this
                }
            }, function () {
                return this
            }, function () {
                return {state: "rejected", reason: e}
            });
            return function (e, t) {
                U && ("object" == typeof process && "function" == typeof process.emit && C.nextTick.runAfter(function () {
                    -1 !== u(L, e) && (process.emit("unhandledRejection", t, e), B.push(e))
                }), L.push(e), t && void 0 !== t.stack ? F.push(t.stack) : F.push("(no stack) " + t))
            }(t, e), t
        }

        function W(e) {
            return A({
                when: function () {
                    return e
                }, get: function (t) {
                    return e[t]
                }, set: function (t, i) {
                    e[t] = i
                }, delete: function (t) {
                    delete e[t]
                }, post: function (t, i) {
                    return null === t || void 0 === t ? e.apply(void 0, i) : e[t].apply(e, i)
                }, apply: function (t, i) {
                    return e.apply(t, i)
                }, keys: function () {
                    return p(e)
                }
            }, void 0, function () {
                return {state: "fulfilled", value: e}
            })
        }

        function V(e, t, i) {
            return C(e).spread(t, i)
        }

        function H(e, t, i) {
            return C(e).dispatch(t, i)
        }

        function z(e) {
            return D(e, function (e) {
                var t = 0, i = b();
                return d(e, function (n, a, o) {
                    var r;
                    N(a) && "fulfilled" === (r = a.inspect()).state ? e[o] = r.value : (++t, D(a, function (n) {
                        e[o] = n, 0 == --t && i.resolve(e)
                    }, i.reject, function (e) {
                        i.notify({index: o, value: e})
                    }))
                }, void 0), 0 === t && i.resolve(e), i.promise
            })
        }

        function j(e) {
            if (0 === e.length) return C.resolve();
            var t = C.defer(), i = 0;
            return d(e, function (n, a, o) {
                var r = e[o];
                i++, D(r, function (e) {
                    t.resolve(e)
                }, function (e) {
                    if (0 == --i) {
                        var n = e || new Error("" + e);
                        n.message = "Q can't get fulfillment value from any promise, all promises were rejected. Last error message: " + n.message, t.reject(n)
                    }
                }, function (e) {
                    t.notify({index: o, value: e})
                })
            }, void 0), t.promise
        }

        function G(e) {
            return D(e, function (e) {
                return e = c(e, C), D(z(c(e, function (e) {
                    return D(e, n, n)
                })), function () {
                    return e
                })
            })
        }

        C.resetUnhandledRejections = R, C.getUnhandledReasons = function () {
            return F.slice()
        }, C.stopUnhandledRejectionTracking = function () {
            R(), U = !1
        }, R(), C.reject = K, C.fulfill = W, C.master = function (e) {
            return A({
                isDef: function () {
                }
            }, function (t, i) {
                return H(e, t, i)
            }, function () {
                return C(e).inspect()
            })
        }, C.spread = V, A.prototype.spread = function (e, t) {
            return this.all().then(function (t) {
                return e.apply(void 0, t)
            }, t)
        }, C.async = function (e) {
            return function () {
                function t(e, t) {
                    var o;
                    if ("undefined" == typeof StopIteration) {
                        try {
                            o = i[e](t)
                        } catch (e) {
                            return K(e)
                        }
                        return o.done ? C(o.value) : D(o.value, n, a)
                    }
                    try {
                        o = i[e](t)
                    } catch (e) {
                        return function (e) {
                            return "[object StopIteration]" === v(e) || e instanceof s
                        }(e) ? C(e.value) : K(e)
                    }
                    return D(o, n, a)
                }

                var i = e.apply(this, arguments), n = t.bind(t, "next"), a = t.bind(t, "throw");
                return n()
            }
        }, C.spawn = function (e) {
            C.done(C.async(e)())
        }, C.return = function (e) {
            throw new s(e)
        }, C.promised = function (e) {
            return function () {
                return V([this, z(arguments)], function (t, i) {
                    return e.apply(t, i)
                })
            }
        }, C.dispatch = H, A.prototype.dispatch = function (e, t) {
            var i = this, n = b();
            return C.nextTick(function () {
                i.promiseDispatch(n.resolve, e, t)
            }), n.promise
        }, C.get = function (e, t) {
            return C(e).dispatch("get", [t])
        }, A.prototype.get = function (e) {
            return this.dispatch("get", [e])
        }, C.set = function (e, t, i) {
            return C(e).dispatch("set", [t, i])
        }, A.prototype.set = function (e, t) {
            return this.dispatch("set", [e, t])
        }, C.del = C.delete = function (e, t) {
            return C(e).dispatch("delete", [t])
        }, A.prototype.del = A.prototype.delete = function (e) {
            return this.dispatch("delete", [e])
        }, C.mapply = C.post = function (e, t, i) {
            return C(e).dispatch("post", [t, i])
        }, A.prototype.mapply = A.prototype.post = function (e, t) {
            return this.dispatch("post", [e, t])
        }, C.send = C.mcall = C.invoke = function (e, t) {
            return C(e).dispatch("post", [t, l(arguments, 2)])
        }, A.prototype.send = A.prototype.mcall = A.prototype.invoke = function (e) {
            return this.dispatch("post", [e, l(arguments, 1)])
        }, C.fapply = function (e, t) {
            return C(e).dispatch("apply", [void 0, t])
        }, A.prototype.fapply = function (e) {
            return this.dispatch("apply", [void 0, e])
        }, C.try = C.fcall = function (e) {
            return C(e).dispatch("apply", [void 0, l(arguments, 1)])
        }, A.prototype.fcall = function () {
            return this.dispatch("apply", [void 0, l(arguments)])
        }, C.fbind = function (e) {
            var t = C(e), i = l(arguments, 1);
            return function () {
                return t.dispatch("apply", [this, i.concat(l(arguments))])
            }
        }, A.prototype.fbind = function () {
            var e = this, t = l(arguments);
            return function () {
                return e.dispatch("apply", [this, t.concat(l(arguments))])
            }
        }, C.keys = function (e) {
            return C(e).dispatch("keys", [])
        }, A.prototype.keys = function () {
            return this.dispatch("keys", [])
        }, C.all = z, A.prototype.all = function () {
            return z(this)
        }, C.any = j, A.prototype.any = function () {
            return j(this)
        }, C.allResolved = (P = G, M = "allResolved", O = "allSettled", function () {
            return "undefined" != typeof console && "function" == typeof console.warn && console.warn(M + " is deprecated, use " + O + " instead.", new Error("").stack), P.apply(P, arguments)
        }), A.prototype.allResolved = function () {
            return G(this)
        }, C.allSettled = function (e) {
            return C(e).allSettled()
        }, A.prototype.allSettled = function () {
            return this.then(function (e) {
                return z(c(e, function (e) {
                    function t() {
                        return e.inspect()
                    }

                    return (e = C(e)).then(t, t)
                }))
            })
        }, C.fail = C.catch = function (e, t) {
            return C(e).then(void 0, t)
        }, A.prototype.fail = A.prototype.catch = function (e) {
            return this.then(void 0, e)
        }, C.progress = function (e, t) {
            return C(e).then(void 0, void 0, t)
        }, A.prototype.progress = function (e) {
            return this.then(void 0, void 0, e)
        }, C.fin = C.finally = function (e, t) {
            return C(e).finally(t)
        }, A.prototype.fin = A.prototype.finally = function (e) {
            if (!e || "function" != typeof e.apply) throw new Error("Q can't apply finally callback");
            return e = C(e), this.then(function (t) {
                return e.fcall().then(function () {
                    return t
                })
            }, function (t) {
                return e.fcall().then(function () {
                    throw t
                })
            })
        }, C.done = function (e, t, i, n) {
            return C(e).done(t, i, n)
        }, A.prototype.done = function (e, t, i) {
            var n = function (e) {
                C.nextTick(function () {
                    if (y(e, a), !C.onerror) throw e;
                    C.onerror(e)
                })
            }, a = e || t || i ? this.then(e, t, i) : this;
            "object" == typeof process && process && process.domain && (n = process.domain.bind(n)), a.then(void 0, n)
        }, C.timeout = function (e, t, i) {
            return C(e).timeout(t, i)
        }, A.prototype.timeout = function (e, t) {
            var i = b(), n = setTimeout(function () {
                t && "string" != typeof t || ((t = new Error(t || "Timed out after " + e + " ms")).code = "ETIMEDOUT"), i.reject(t)
            }, e);
            return this.then(function (e) {
                clearTimeout(n), i.resolve(e)
            }, function (e) {
                clearTimeout(n), i.reject(e)
            }, i.notify), i.promise
        }, C.delay = function (e, t) {
            return void 0 === t && (t = e, e = void 0), C(e).delay(t)
        }, A.prototype.delay = function (e) {
            return this.then(function (t) {
                var i = b();
                return setTimeout(function () {
                    i.resolve(t)
                }, e), i.promise
            })
        }, C.nfapply = function (e, t) {
            return C(e).nfapply(t)
        }, A.prototype.nfapply = function (e) {
            var t = b(), i = l(e);
            return i.push(t.makeNodeResolver()), this.fapply(i).fail(t.reject), t.promise
        }, C.nfcall = function (e) {
            var t = l(arguments, 1);
            return C(e).nfapply(t)
        }, A.prototype.nfcall = function () {
            var e = l(arguments), t = b();
            return e.push(t.makeNodeResolver()), this.fapply(e).fail(t.reject), t.promise
        }, C.nfbind = C.denodeify = function (e) {
            if (void 0 === e) throw new Error("Q can't wrap an undefined function");
            var t = l(arguments, 1);
            return function () {
                var i = t.concat(l(arguments)), n = b();
                return i.push(n.makeNodeResolver()), C(e).fapply(i).fail(n.reject), n.promise
            }
        }, A.prototype.nfbind = A.prototype.denodeify = function () {
            var e = l(arguments);
            return e.unshift(this), C.denodeify.apply(void 0, e)
        }, C.nbind = function (e, t) {
            var i = l(arguments, 2);
            return function () {
                var n = i.concat(l(arguments)), a = b();
                return n.push(a.makeNodeResolver()), C(function () {
                    return e.apply(t, arguments)
                }).fapply(n).fail(a.reject), a.promise
            }
        }, A.prototype.nbind = function () {
            var e = l(arguments, 0);
            return e.unshift(this), C.nbind.apply(void 0, e)
        }, C.nmapply = C.npost = function (e, t, i) {
            return C(e).npost(t, i)
        }, A.prototype.nmapply = A.prototype.npost = function (e, t) {
            var i = l(t || []), n = b();
            return i.push(n.makeNodeResolver()), this.dispatch("post", [e, i]).fail(n.reject), n.promise
        }, C.nsend = C.nmcall = C.ninvoke = function (e, t) {
            var i = l(arguments, 2), n = b();
            return i.push(n.makeNodeResolver()), C(e).dispatch("post", [t, i]).fail(n.reject), n.promise
        }, A.prototype.nsend = A.prototype.nmcall = A.prototype.ninvoke = function (e) {
            var t = l(arguments, 1), i = b();
            return t.push(i.makeNodeResolver()), this.dispatch("post", [e, t]).fail(i.reject), i.promise
        }, C.nodeify = function (e, t) {
            return C(e).nodeify(t)
        }, A.prototype.nodeify = function (e) {
            if (!e) return this;
            this.then(function (t) {
                C.nextTick(function () {
                    e(null, t)
                })
            }, function (t) {
                C.nextTick(function () {
                    e(t)
                })
            })
        }, C.noConflict = function () {
            throw new Error("Q.noConflict only works when Q is used as a global")
        };
        var $ = w();
        return C
    })
}, function (e, t, i) {
    "use strict";
    var n = i(4), a = {}, o = {numeric: !0, timeout: 2, min_reply: 1, extra: []};
    a.getResult = function (e, t) {
        var i = t || {}, a = [];
        return ["numeric", "timeout", "min_reply", "extra"].forEach(function (e) {
            "boolean" != typeof i[e] && (i[e] = i[e] || o[e])
        }), i.numeric && a.push("-n"), i.timeout && (a = a.concat(["-w", n.format("%d", i.timeout)])), i.min_reply && (a = a.concat(["-c", n.format("%d", i.min_reply)])), i.extra && (a = a.concat(i.extra)), a.push(e), a
    }, e.exports = a
}, function (e, t, i) {
    "use strict";
    var n = i(4), a = {}, o = {numeric: !0, timeout: 2, min_reply: 1, extra: []};
    a.getResult = function (e, t) {
        var i = t || {}, a = [];
        return ["numeric", "timeout", "min_reply", "extra"].forEach(function (e) {
            "boolean" != typeof i[e] && (i[e] = i[e] || o[e])
        }), i.numeric && a.push("-n"), i.timeout && (a = a.concat(["-t", n.format("%d", i.timeout)])), i.min_reply && (a = a.concat(["-c", n.format("%d", i.min_reply)])), i.extra && (a = a.concat(i.extra)), a.push(e), a
    }, e.exports = a
}, function (e, t, i) {
    "use strict";
    var n = i(4), a = {}, o = {numeric: !0, timeout: 5, min_reply: 1, extra: []};
    a.getResult = function (e, t) {
        var i = t || {}, a = [];
        return ["numeric", "timeout", "min_reply", "extra"].forEach(function (e) {
            "boolean" != typeof i[e] && (i[e] = i[e] || o[e])
        }), i.numeric || a.push("-a"), i.timeout && (a = a.concat(["-w", n.format("%d", 1e3 * i.timeout)])), i.min_reply && (a = a.concat(["-n", n.format("%d", i.min_reply)])), i.extra && (a = a.concat(i.extra)), a.push(e), a
    }, e.exports = a
}, function (e, t, i) {
    "use strict";
    var n = i(4), a = i(460), o = i(749), r = i(461), s = i(750);

    function l() {
    }

    l.createParser = function (e) {
        if (!a.isPlatformSupport(e)) throw new Error(n.format("Platform |%s| is not support", e));
        var t = null;
        return a.isWindow(e) ? t = new o : a.isMacOS(e) ? t = new r : a.isLinux(e) && (t = new s), t
    }, e.exports = l
}, function (e, t, i) {
    "use strict";
    var n = i(4), a = i(102), o = i(337);

    function r() {
        o.call(this), this._ipv4Regex = /^([0-9]{1,3}\.){3}[0-9]{1,3}$/
    }

    n.inherits(r, o), r.prototype._processHeader = function (e) {
        var t = e.split(" ");
        this._response.host = t[1], this._ipv4Regex.test(this._response.host) ? this._response.numeric_host = t[1] : this._response.numeric_host = t[2].slice(1, -1), this._changeState(this.STATES.BODY)
    }, r.prototype._processBody = function (e) {
        var t = e.split(" "), i = a.filter(t, function (e) {
            return e.indexOf("=") >= 0 || e.indexOf("<") >= 0
        });
        if (i.length >= 3) {
            var n = a.find(i, function (e) {
                return e.indexOf("ms") >= 0
            }), o = /([0-9\.]+)/.exec(n);
            this._times.push(parseFloat(o[1], 10))
        }
        ":" === e.slice(-1) && this._changeState(this.STATES.FOOTER)
    }, r.prototype._processFooter = function (e) {
        if (e.indexOf("ms") >= 0) {
            var t = /([0-9\.]+)/g, i = t.exec(e), n = t.exec(e), o = t.exec(e);
            a.all([i, n, o]) && (this._response.min = parseFloat(i[1], 10), this._response.max = parseFloat(n[1], 10), this._response.avg = parseFloat(o[1], 10), this._changeState(this.STATES.END))
        }
    }, e.exports = r
}, function (e, t, i) {
    "use strict";
    var n = i(4), a = i(337), o = i(461);

    function r() {
        a.call(this)
    }

    n.inherits(r, a), r.prototype._processHeader = function (e) {
        var t = e.split(" ");
        this._response.host = t[1], this._response.numeric_host = t[2].slice(1, -1), this._changeState(this.STATES.BODY)
    }, r.prototype._processBody = function (e) {
        o.prototype._processBody.call(this, e)
    }, r.prototype._processFooter = function (e) {
        o.prototype._processFooter.call(this, e)
    }, e.exports = r
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0}), function (e) {
        let t, i, n;
        !function (e) {
            e[e.Vip = 0] = "Vip", e[e.Try = 1] = "Try", e[e.Ad = 2] = "Ad"
        }(t = e.VipTaskType || (e.VipTaskType = {})), function (e) {
            e[e.PlatinumVip = 0] = "PlatinumVip", e[e.SuperVip = 1] = "SuperVip", e[e.MixVip = 2] = "MixVip"
        }(i = e.TryType || (e.TryType = {})), function (e) {
            e[e.Unkown = -1] = "Unkown", e[e.Init = 0] = "Init", e[e.CommitWait = 1] = "CommitWait", e[e.Commiting = 2] = "Commiting", e[e.CommitFailed = 3] = "CommitFailed", e[e.CommitSuccess = 4] = "CommitSuccess", e[e.AcclerateWait = 5] = "AcclerateWait", e[e.SearchResource = 6] = "SearchResource", e[e.AcclerateFailed = 7] = "AcclerateFailed", e[e.AcclerateStoped = 8] = "AcclerateStoped", e[e.Acclerating = 9] = "Acclerating", e[e.Finished = 10] = "Finished"
        }(n = e.VipTaskStatus || (e.VipTaskStatus = {}))
    }(t.VipDownloadDefineNS || (t.VipDownloadDefineNS = {}))
}, function (e, t, i) {
    "use strict";
    var n = this && this.__awaiter || function (e, t, i, n) {
        return new (i || (i = Promise))(function (a, o) {
            function r(e) {
                try {
                    l(n.next(e))
                } catch (e) {
                    o(e)
                }
            }

            function s(e) {
                try {
                    l(n.throw(e))
                } catch (e) {
                    o(e)
                }
            }

            function l(e) {
                e.done ? a(e.value) : new i(function (t) {
                    t(e.value)
                }).then(r, s)
            }

            l((n = n.apply(e, t || [])).next())
        })
    };
    Object.defineProperty(t, "__esModule", {value: !0});
    const a = i(2), o = i(12), r = i(310), s = i(17), l = i(16), d = i(7), u = i(28), c = i(423), h = i(0), f = i(54),
        g = i(23), p = i(6), v = h.default.getLogger("Thunder.embedded-browser:individuation-browser"),
        m = p.default(a.join(__rootDir, "../bin/ThunderHelper.node"));

    class y {
        constructor() {
            this.browserCtr = null, this.wnd = null, this.state = void 0, this.curShowCmd = "show", this.browserEventHandler = null, this.attachListener().catch()
        }

        setBrowserEventHandler(e) {
            this.browserEventHandler = e
        }

        closeWnd() {
            return n(this, void 0, void 0, function* () {
                (yield this.isWindow()) && this.wnd.close()
            })
        }

        showBrowser(e, t, i, a, o, r, l, d, c) {
            return n(this, void 0, void 0, function* () {
                v.information("showBrowser");
                do {
                    if (!this.browserCtr) {
                        if (!(yield this.createBrowser(e, t, i, a, o, r, l, d, c))) break
                    }
                    if ("loaded" === this.state) {
                        let e = this.browserCtr.getBrowser().getWindowHandle();
                        m.showWindow(e, f.CmdShow.SW_SHOW)
                    } else "error" === this.state && s.ipcRenderer.send(u.ThunderChannelList.channelMRIndividuationBrowserMsg, "OnLoadError")
                } while (0)
            })
        }

        hideBrowser() {
            if (v.information("hideBrowser"), this.browserCtr) {
                let e = this.browserCtr.getBrowser().getWindowHandle();
                m.showWindow(e, f.CmdShow.SW_HIDE)
            }
        }

        destroyBrowser() {
            v.information("destroyBrowser"), this.browserCtr && this.browserCtr.destroyBrowser(!1), this.browserCtr = null, this.state = void 0
        }

        isWindow() {
            return n(this, void 0, void 0, function* () {
                let e = !1;
                return this.wnd && !(yield this.wnd.isDestroyed()) && (e = !0), e
            })
        }

        createBrowser(e, t, i, a, s, l, d, u, h) {
            return n(this, void 0, void 0, function* () {
                let n = !1, g = c.CommonFunctionNs.getBrowserWindowRect(e, a, s, l, d, u, h);
                v.information("createBrowser", "hwnd", e, "url", i, "rect", g);
                let p = yield(yield o.asyncRemoteCall.getBrowserWindow()).fromId(t), y = !0;
                return p && (y = yield p.isDestroyed()), y || (this.setWnd(p), this.browserCtr = new r.BrowserCtrl, this.browserCtr.createChromiumBrowser(e, i, !1, g, this.getDefaultEvents()).catch(), this.registerNativeFunctions(this.getNativeFunctionMap()), m.setWindowLong(e, f.SetWindowType.GWL_STYLE, f.WindowStyle.WS_CLIPCHILDREN), n = !0), n
            })
        }

        refresh() {
            v.information("refresh"), this.browserCtr && (this.state = void 0, this.browserCtr.refresh(!0))
        }

        resize(e, t, i, n, a, o) {
            v.information("resize"), this.browserCtr && this.browserCtr.getBrowser() && c.CommonFunctionNs.resizeBrowserWindow(this.browserCtr.getBrowser().getWindowHandle(), e, t, i, n, a, o, "show" === this.curShowCmd ? f.Uflag.SWP_SHOWWINDOW : f.Uflag.SWP_HIDEWINDOW)
        }

        setWnd(e) {
            this.wnd = e, this.wnd.once("close", () => {
                v.information("parentWindow close"), this.destroyBrowser(), this.wnd = null
            })
        }

        closeDialog(e, t, i, n) {
            this.closeWnd().catch(), e.callNativeFunctionCallback(t, i, g.NativeFunctionErrorCode.Success)
        }

        onLoadError(e, t, i, a, o, r) {
            return n(this, void 0, void 0, function* () {
                if (v.information("OnLoadError isMainFrame, errorCode, url: ", t, a, i), (yield this.isWindow()) && t) if (-3 === a) {
                    this.state = "loaded";
                    let t = e.target.getWindowHandle();
                    m.showWindow(t, "show" === this.curShowCmd ? f.CmdShow.SW_SHOW : f.CmdShow.SW_HIDE)
                } else this.state = "error", s.ipcRenderer.send(u.ThunderChannelList.channelMRIndividuationBrowserMsg, "OnLoadError");
                this.browserEventHandler && t && this.browserEventHandler("OnLoadError", t, i, a, o, r)
            })
        }

        onLoadEnd(e, t, i, a, o) {
            return n(this, void 0, void 0, function* () {
                v.information("OnLoadEnd isMainFrame", t, i);
                do {
                    if ("error" === this.state) break;
                    if ((yield this.isWindow()) && t) {
                        this.state = "loaded";
                        let t = e.target.getWindowHandle();
                        m.showWindow(t, "show" === this.curShowCmd ? f.CmdShow.SW_SHOW : f.CmdShow.SW_HIDE)
                    }
                    this.browserEventHandler && t && this.browserEventHandler("OnLoadEnd", t, i, a, o)
                } while (0)
            })
        }

        onBeforeNavigate(e, t, i, a) {
            return n(this, void 0, void 0, function* () {
                if (v.information("OnBeforeNavigate isMainframe", t, i), (yield this.isWindow()) && t) {
                    let t = e.target.getWindowHandle();
                    m.showWindow(t, f.CmdShow.SW_HIDE)
                }
                this.browserEventHandler && this.browserEventHandler("OnBeforeNavigate", t, i, a)
            })
        }

        onNewBrowserPopup(e, t, i, n, a, o) {
            v.information("onNewBrowserPopup url", i);
            let r = !1;
            this.browserEventHandler && (r = this.browserEventHandler("OnNewBrowserPopup", i)), r || d.client.callServerFunction("openNewTab", i).catch()
        }

        getDefaultEvents() {
            return [{eventName: "before-nav", listener: this.onBeforeNavigate.bind(this)}, {
                eventName: "load-error",
                listener: this.onLoadError.bind(this)
            }, {eventName: "load-end", listener: this.onLoadEnd.bind(this)}, {
                eventName: "new-browser-popup",
                listener: this.onNewBrowserPopup.bind(this)
            }]
        }

        getNativeFunctionMap() {
            return [{functionName: "CloseDialog", nativeFunc: this.closeDialog.bind(this)}]
        }

        attachListener() {
            return n(this, void 0, void 0, function* () {
                l.NativeCallModule.nativeCall.AttachNativeEvent("onLoginSuc", e => {
                    null !== this.browserCtr && void 0 !== this.browserCtr && this.browserCtr.fireEvent("OnUserLogin", e)
                }), l.NativeCallModule.nativeCall.AttachNativeEvent("onLogout", e => {
                    null !== this.browserCtr && void 0 !== this.browserCtr && this.browserCtr.fireEvent("OnUserLogout", e)
                }), (yield o.asyncRemoteCall.getIpcMain()).on(u.ThunderChannelList.channelRMIndividuationBrowserMsg, (e, t, ...i) => {
                    if (v.information(".ipcMain.on:", u.ThunderChannelList.channelRMIndividuationBrowserMsg, t), "show" === t) {
                        this.curShowCmd = "show";
                        let e = i[0], t = i[1], n = i[2], a = i[3], o = i[4], r = i[5], s = i[6], l = i[7], d = i[8];
                        this.showBrowser(e, t, n, a, o, r, s, l, d).catch()
                    } else if ("hide" === t) this.curShowCmd = "hide", this.hideBrowser(); else if ("refresh" === t) this.refresh(); else if ("resize" === t || "move" === t) {
                        let e = i[0], t = i[1], n = i[2], a = i[3], o = i[4], r = i[5];
                        this.resize(e, t, n, a, o, r)
                    }
                })
            })
        }

        registerNativeFunctions(e) {
            do {
                if (null === this.browserCtr || void 0 === this.browserCtr) break;
                if (null === e || void 0 === e || e.length <= 0) break;
                for (let t = 0; t < e.length; ++t) this.browserCtr.registerNativeFunction(e[t].functionName, e[t].nativeFunc, !0)
            } while (0)
        }
    }

    t.IndividuationBrowser = y, t.default = new y
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(2), a = i(0), o = i(3), r = i(15), s = i(6).default(n.join(__rootDir, "../bin/ThunderHelper.node")),
        l = a.default.getLogger("Thunder.TaskP2spAutoRename"), d = r.DownloadKernelEventManager.getEventManager();
    !function (e) {
        let t = void 0, i = void 0;

        function a(e, t) {
            do {
                if (!e) break;
                if (e.getType() !== o.DownloadKernel.TaskType.P2sp) break;
                if (0 == (t & (o.DownloadKernel.TaskDetailChangedFlags.OriginName | o.DownloadKernel.TaskDetailChangedFlags.HTTPContentType))) break;
                let i = "";
                0 != (t & o.DownloadKernel.TaskDetailChangedFlags.HTTPContentType) && (i = e.getTaskAttribute(o.DownloadKernel.TaskAttribute.HTTPContentType), l.information("httpContentType:", i));
                let a = "", r = e.getTaskAttribute(o.DownloadKernel.TaskAttribute.TaskName), d = !1;
                if (1 !== e.getExtraObject().getNameFixed()) {
                    if (0 != (t & o.DownloadKernel.TaskDetailChangedFlags.OriginName)) {
                        let t = e.getTaskAttribute(o.DownloadKernel.TaskAttribute.OriginName);
                        l.information("originName:", t), t && "" !== t && (a = t, n.extname(a) || (d = !0))
                    }
                } else if (l.information("p2spTask name fixed!", e.getId()), i && "" !== i) {
                    let e = n.extname(r);
                    (!e || "" === e || e.length > 5) && (a = r, d = !0)
                }
                if (d && i && "" !== i && "" !== a) {
                    let e = n.parse(a).name;
                    if (e && "" !== e) {
                        let t = "HKEY_CLASSES_ROOT", n = "MIME\\Database\\Content Type\\" + i, o = "Extension",
                            r = s.readRegString(t, n, o);
                        r && "" !== r && (a = e + r)
                    }
                }
                "" !== a && a !== r && (l.information("task rename:", a, ", old name:", r), e.reName(a).catch())
            } while (0)
        }

        function r(e, t) {
            e.forEach(e => {
                a(e, t)
            })
        }

        e.init = function () {
            do {
                if (void 0 !== t && void 0 !== i) break;
                t = d.attachTaskEvent(o.DownloadKernel.TaskEventType.DetailChanged, (...e) => {
                    e && e[0] === o.DownloadKernel.TaskEventType.DetailChanged && r(e[1], e[2])
                }), i = d.attachTaskEvent(o.DownloadKernel.TaskEventType.GroupTaskSubFileDetailChanged, (...e) => {
                    e && e[0] === o.DownloadKernel.TaskEventType.GroupTaskSubFileDetailChanged && e[1].forEach((e, t) => {
                        e.forEach(e => {
                            a(e, e.getDetailChangedFlags())
                        })
                    })
                })
            } while (0)
        }, e.uninit = function () {
            do {
                if (void 0 !== t && void 0 !== i) break;
                d.detachTaskEvent(o.DownloadKernel.TaskEventType.DetailChanged, t), t = void 0, d.detachTaskEvent(o.DownloadKernel.TaskEventType.GroupTaskSubFileDetailChanged, i), i = void 0
            } while (0)
        }
    }(t.TaskP2spAutoRenameNS || (t.TaskP2spAutoRenameNS = {}))
}, function (e, t, i) {
    "use strict";
    Object.defineProperty(t, "__esModule", {value: !0});
    const n = i(0), a = i(4), o = i(20), r = i(334), s = n.default.getLogger("ScheduleTaskPluginFunction");
    !function (e) {
        const t = new class {
            constructor() {
                this.isRegister = !1
            }

            registerPluginFunction() {
                if (!this.isRegister) {
                    this.isRegister = !0;
                    let e = {
                        GetDownloadCompleteTaskType: this.getDownloadCompleteTaskType,
                        SetDownloadCompleteTaskType: this.setDownloadCompleteTaskType,
                        CancelDownloadCompleteTask: this.cancelDownloadCompleteTask
                    };
                    o.server.registerFunctions(e)
                }
            }

            getDownloadCompleteTaskType(e, t, ...i) {
                let n = r.ScheduleCompleteTaskType.UnKnown;
                do {
                    if (!e) break;
                    n = r.ScheduleTaskNS.getDownloadCompleteTaskType()
                } while (0);
                return n
            }

            setDownloadCompleteTaskType(e, t, ...i) {
                let n = !1;
                do {
                    if (!e) break;
                    if (!i || !a.isNumber(i[0])) break;
                    s.information("setDownloadCompleteTaskType:", i[0]), r.ScheduleTaskNS.setDownloadCompleteTaskType(i[0]), n = !0
                } while (0);
                return n
            }

            cancelDownloadCompleteTask(e, t, ...i) {
                let n = !1;
                do {
                    if (!e) break;
                    s.information("cancelDownloadCompleteTask"), r.ScheduleTaskNS.cancelDownloadCompleteTask(), n = !0
                } while (0);
                return n
            }
        };
        e.registerPluginFunction = function () {
            t.registerPluginFunction()
        }
    }(t.ScheduleTaskPluginFunctionNS || (t.ScheduleTaskPluginFunctionNS = {}))
}, function (e, t) {
}, , , , , , , , , function (e, t) {
}, , function (e, t) {
}, , function (e, t) {
}, , function (e, t) {
}, , function (e, t) {
}, , function (e, t) {
}, , function (e, t) {
}, , function (e, t) {
}, , function (e, t) {
}, , , function (e, t) {
}, , function (e, t) {
}, , function (e, t) {
}, , function (e, t) {
}, , function (e, t) {
}, , function (e, t) {
}, , function (e, t) {
}, , function (e, t) {
}, , function (e, t) {
}, , function (e, t) {
}, , function (e, t) {
}, , function (e, t) {
}, , , , , , , , function (e, t) {
}, , function (e, t) {
}, , , , function (e, t) {
}, , , function (e, t) {
}, , , function (e, t) {
}, , function (e, t) {
}, , function (e, t) {
}, , , function (e, t) {
}, , , function (e, t) {
}, , , function (e, t) {
}, , function (e, t) {
}, , , function (e, t) {
}, , function (e, t) {
}, , function (e, t) {
}, , function (e, t) {
}, , function (e, t) {
}, , , function (e, t) {
}, , function (e, t) {
}, , , , function (e, t) {
}, , , , function (e, t) {
}, , , function (e, t) {
}, , function (e, t) {
}, , function (e, t) {
}]);
//# sourceMappingURL=renderer.js.map
/*! Thunder 11 BY LUOCHENZHIMU */
/*! Last updated on 2020/08/22 */
/*! https://www.luochenzhimu.com */