"use strict";!function(){function e(e){this.tabType=1,this.username=e.username,this.nickname=e.nickname,this.avatar=e.avatar,this.alreadyHaveCount=99,this.haveListReady=this.allListReady=!1,this.options=e,this.allMedalList=[],this.haveMedalList=[],this.spmMap=[{type:"创作",name:["持之以恒","1024勋章","1024超级勋章","勤写标兵Lv1","勤写标兵Lv2","博客之星","原力探索","原力突破","原力王者","学习力","原力新人","原力探索","原力突破"],spm:"3001.4299"},{type:"贡献",name:["分享学徒","分享小兵","分享达人","分享精英","分享宗师","分享王者","至尊王者"],spm:"3001.4300"}],this.getData()}var a="http"===location.protocol.substr(0,4)?"":"https:",t=a+"//g.csdnimg.cn/user-medal/1.0.6/user-medal.css",n="https://g-api.csdn.net";!function(e){var a=document.createElement("link");a.rel="stylesheet",a.type="text/css",a.href=e,document.getElementsByTagName("head")[0].appendChild(a)}(t),e.prototype={constructor:e,init:function(){this.haveListReady&&this.allListReady&&(this.setReportPoint(),this.renderMain(),this.renderTab(),this.renderNav())},close:function(){this.$box&&this.$box.remove()},setReportPoint:function(){var e=this;try{this.spmMap=this.spmMap.reduce(function(e,a){return a.name.forEach(function(t){e[t]={name:t,spm:a.spm,type:a.type}}),e},{}),this.allMedalList=this.allMedalList.map(function(a,t){return a.medals=a.medals.map(function(n){var s=e.spmMap[n.name]||{};return n.mod="1595992524_00"+(t+1),s.spm&&(n.spm=s.spm),e.spmMap[n.name]=Object.assign({},s,{mod:n.mod,type:a.name,name:n.name}),n}),a}),this.haveMedalList=this.haveMedalList.map(function(a){var t=e.spmMap[a.name]||{};return Object.assign({},a,t)})}catch(e){void 0}},renderMain:function(){var e=this,a=$('
\n 已拥有\n 成就勋章\n
\n'+e.name+'
\n'+e.description+"
\n "+(e.sourceUrl?''+(n?"去获得":"我也要")+"":'')+"\n "}),0===e.length&&(t=''),this.$box.find(".medal-content-body").html(t)},getCookie:function(e){var a={};return document.cookie.replace(/([^=;\s]+)=([^=;\s]+)/g,function(){for(var e=arguments.length,t=Array(e),n=0;n